1- import { default as Progress } from 'antd/es/progress' ;
2- import { Section , sectionNames } from 'lowcoder-design' ;
3- import { numberExposingStateControl } from '../controls/codeStateControl' ;
4- import { BoolControl } from '../controls/boolControl' ;
5- import { UICompBuilder } from '../generators' ;
6- import {
7- NameConfig ,
8- NameConfigHidden ,
9- withExposingConfigs ,
10- } from '../generators/withExposing' ;
11- import { styleControl } from 'comps/controls/styleControl' ;
12- import {
13- AnimationStyle ,
14- AnimationStyleType ,
15- ProgressStyle ,
16- ProgressStyleType ,
17- heightCalculator ,
18- widthCalculator ,
19- } from 'comps/controls/styleControlConstants' ;
20- import styled , { css } from 'styled-components' ;
21- import { hiddenPropertyView } from 'comps/utils/propertyUtils' ;
22- import { trans } from 'i18n' ;
1+ import { default as Progress } from "antd/es/progress" ;
2+ import { Section , sectionNames } from "lowcoder-design" ;
3+ import { numberExposingStateControl } from "../controls/codeStateControl" ;
4+ import { BoolControl } from "../controls/boolControl" ;
5+ import { UICompBuilder } from "../generators" ;
6+ import { NameConfig , NameConfigHidden , withExposingConfigs } from "../generators/withExposing" ;
7+ import { styleControl } from "comps/controls/styleControl" ;
8+ import { AnimationStyle , AnimationStyleType , ProgressStyle , ProgressStyleType , heightCalculator , widthCalculator } from "comps/controls/styleControlConstants" ;
9+ import styled , { css } from "styled-components" ;
10+ import { hiddenPropertyView } from "comps/utils/propertyUtils" ;
11+ import { trans } from "i18n" ;
2312
24- import { useContext } from ' react' ;
25- import { EditorContext } from ' comps/editorState' ;
13+ import { useContext } from " react" ;
14+ import { EditorContext } from " comps/editorState" ;
2615
2716const getStyle = ( style : ProgressStyleType ) => {
2817 return css `
2918 line-height : 2 ;
3019 .ant-progress-text {
3120 color : ${ style . text } ;
32- font-style : ${ style . fontStyle } ;
33- font-family : ${ style . fontFamily } ;
34- font-weight : ${ style . textWeight } ;
35- font-size : ${ style . textSize } ;
21+ font-style : ${ style . fontStyle } ;
22+ font-family : ${ style . fontFamily } ;
23+ font-weight : ${ style . textWeight } ;
24+ font-size : ${ style . textSize } ;
3625 }
37- width : ${ widthCalculator ( style . margin ) } ;
38- height : ${ heightCalculator ( style . margin ) } ;
39- margin : ${ style . margin } ;
26+ width : ${ widthCalculator ( style . margin ) } ;
27+ height : ${ heightCalculator ( style . margin ) } ;
28+ margin : ${ style . margin } ;
4029 padding : ${ style . padding } ;
4130 .ant-progress-inner {
4231 background-color : ${ style . track } ;
@@ -55,12 +44,9 @@ const getStyle = (style: ProgressStyleType) => {
5544 ` ;
5645} ;
5746
58- export const ProgressStyled = styled ( Progress ) < {
59- $style : ProgressStyleType ;
60- $animationStyle ?: AnimationStyleType ;
61- } > `
47+ export const ProgressStyled = styled ( Progress ) < { $style : ProgressStyleType , $animationStyle ?: AnimationStyleType } > `
6248 ${ ( props ) => props . $style && getStyle ( props . $style ) }
63- ${ ( props ) => props . $animationStyle }
49+ ${ props => props . $animationStyle }
6450` ;
6551
6652const ProgressBasicComp = ( function ( ) {
@@ -85,32 +71,28 @@ const ProgressBasicComp = (function () {
8571 < >
8672 < Section name = { sectionNames . basic } >
8773 { children . value . propertyView ( {
88- label : trans ( ' progress.value' ) ,
89- tooltip : trans ( ' progress.valueTooltip' ) ,
74+ label : trans ( " progress.value" ) ,
75+ tooltip : trans ( " progress.valueTooltip" ) ,
9076 } ) }
9177 </ Section >
9278
93- { [ 'logic' , 'both' ] . includes (
94- useContext ( EditorContext ) . editorModeStatus
95- ) && (
79+ { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
9680 < Section name = { sectionNames . interaction } >
9781 { hiddenPropertyView ( children ) }
9882 { children . showInfo . propertyView ( {
99- label : trans ( ' progress.showInfo' ) ,
83+ label : trans ( " progress.showInfo" ) ,
10084 } ) }
10185 </ Section >
10286 ) }
10387
104- { [ 'layout' , 'both' ] . includes (
105- useContext ( EditorContext ) . editorModeStatus
106- ) && (
88+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
10789 < >
10890 < Section name = { sectionNames . style } >
109- { children . style . getPropertyView ( ) }
110- </ Section >
91+ { children . style . getPropertyView ( ) }
92+ </ Section >
11193 < Section name = { sectionNames . animationStyle } >
112- { children . animationStyle . getPropertyView ( ) }
113- </ Section >
94+ { children . animationStyle . getPropertyView ( ) }
95+ </ Section >
11496 </ >
11597 ) }
11698 </ >
@@ -120,7 +102,7 @@ const ProgressBasicComp = (function () {
120102} ) ( ) ;
121103
122104export const ProgressComp = withExposingConfigs ( ProgressBasicComp , [
123- new NameConfig ( ' value' , trans ( ' progress.valueDesc' ) ) ,
124- new NameConfig ( ' showInfo' , trans ( ' progress.showInfoDesc' ) ) ,
105+ new NameConfig ( " value" , trans ( " progress.valueDesc" ) ) ,
106+ new NameConfig ( " showInfo" , trans ( " progress.showInfoDesc" ) ) ,
125107 NameConfigHidden ,
126108] ) ;
0 commit comments