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" ;
23
12
24
- import { useContext } from ' react' ;
25
- import { EditorContext } from ' comps/editorState' ;
13
+ import { useContext } from " react" ;
14
+ import { EditorContext } from " comps/editorState" ;
26
15
27
16
const getStyle = ( style : ProgressStyleType ) => {
28
17
return css `
29
18
line-height : 2 ;
30
19
.ant-progress-text {
31
20
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 } ;
36
25
}
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 } ;
40
29
padding : ${ style . padding } ;
41
30
.ant-progress-inner {
42
31
background-color : ${ style . track } ;
@@ -55,12 +44,9 @@ const getStyle = (style: ProgressStyleType) => {
55
44
` ;
56
45
} ;
57
46
58
- export const ProgressStyled = styled ( Progress ) < {
59
- $style : ProgressStyleType ;
60
- $animationStyle ?: AnimationStyleType ;
61
- } > `
47
+ export const ProgressStyled = styled ( Progress ) < { $style : ProgressStyleType , $animationStyle ?: AnimationStyleType } > `
62
48
${ ( props ) => props . $style && getStyle ( props . $style ) }
63
- ${ ( props ) => props . $animationStyle }
49
+ ${ props => props . $animationStyle }
64
50
` ;
65
51
66
52
const ProgressBasicComp = ( function ( ) {
@@ -85,32 +71,28 @@ const ProgressBasicComp = (function () {
85
71
< >
86
72
< Section name = { sectionNames . basic } >
87
73
{ children . value . propertyView ( {
88
- label : trans ( ' progress.value' ) ,
89
- tooltip : trans ( ' progress.valueTooltip' ) ,
74
+ label : trans ( " progress.value" ) ,
75
+ tooltip : trans ( " progress.valueTooltip" ) ,
90
76
} ) }
91
77
</ Section >
92
78
93
- { [ 'logic' , 'both' ] . includes (
94
- useContext ( EditorContext ) . editorModeStatus
95
- ) && (
79
+ { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
96
80
< Section name = { sectionNames . interaction } >
97
81
{ hiddenPropertyView ( children ) }
98
82
{ children . showInfo . propertyView ( {
99
- label : trans ( ' progress.showInfo' ) ,
83
+ label : trans ( " progress.showInfo" ) ,
100
84
} ) }
101
85
</ Section >
102
86
) }
103
87
104
- { [ 'layout' , 'both' ] . includes (
105
- useContext ( EditorContext ) . editorModeStatus
106
- ) && (
88
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
107
89
< >
108
90
< Section name = { sectionNames . style } >
109
- { children . style . getPropertyView ( ) }
110
- </ Section >
91
+ { children . style . getPropertyView ( ) }
92
+ </ Section >
111
93
< Section name = { sectionNames . animationStyle } >
112
- { children . animationStyle . getPropertyView ( ) }
113
- </ Section >
94
+ { children . animationStyle . getPropertyView ( ) }
95
+ </ Section >
114
96
</ >
115
97
) }
116
98
</ >
@@ -120,7 +102,7 @@ const ProgressBasicComp = (function () {
120
102
} ) ( ) ;
121
103
122
104
export 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" ) ) ,
125
107
NameConfigHidden ,
126
108
] ) ;
0 commit comments