1
1
import { default as Progress } from "antd/es/progress" ;
2
2
import { styleControl } from "comps/controls/styleControl" ;
3
- import { ProgressStyle , ProgressStyleType , heightCalculator , widthCalculator } from "comps/controls/styleControlConstants" ;
3
+ import { CircleProgressStyle , CircleProgressType , heightCalculator , widthCalculator } from "comps/controls/styleControlConstants" ;
4
4
import styled , { css } from "styled-components" ;
5
5
import { Section , sectionNames } from "lowcoder-design" ;
6
6
import { numberExposingStateControl } from "../controls/codeStateControl" ;
@@ -14,33 +14,38 @@ import { EditorContext } from "comps/editorState";
14
14
15
15
// TODO: after Update of ANTd, introduce Size attribute to ProgressCircle
16
16
17
- const getStyle = ( style : ProgressStyleType ) => {
17
+ const getStyle = ( style : CircleProgressType ) => {
18
18
return css `
19
19
width : ${ widthCalculator ( style . margin ) } ;
20
20
height : ${ heightCalculator ( style . margin ) } ;
21
21
margin : ${ style . margin } ;
22
22
padding : ${ style . padding } ;
23
+ border-radius : ${ style . radius } ;
23
24
.ant-progress-text {
24
- color : ${ style . text } ;
25
+ color : ${ style . text } !important ;
26
+ font-family : ${ style . fontFamily } ;
27
+ font-style : ${ style . fontStyle } ;
28
+ font-size : ${ style . textSize } !important ;
29
+ font-weight : ${ style . textWeight } ;
25
30
}
26
31
.ant-progress-circle-trail {
27
32
stroke : ${ style . track } ;
28
33
}
29
34
.ant-progress-inner .ant-progress-circle-path {
30
- stroke : ${ style . fill } ;
35
+ stroke : ${ style . fill } !important ;
31
36
}
32
37
& .ant-progress-status-success {
33
38
.ant-progress-inner .ant-progress-circle-path {
34
- stroke : ${ style . success } ;
39
+ stroke : ${ style . success } !important ;
35
40
}
36
41
.ant-progress-text {
37
- color : ${ style . success } ;
42
+ color : ${ style . success } !important ;
38
43
}
39
44
}
40
45
` ;
41
46
} ;
42
47
43
- export const StyledProgressCircle = styled ( Progress ) < { $style : ProgressStyleType } > `
48
+ export const StyledProgressCircle = styled ( Progress ) < { $style : CircleProgressType } > `
44
49
width: 100%;
45
50
height: 100%;
46
51
padding: 2px;
@@ -59,7 +64,8 @@ export const StyledProgressCircle = styled(Progress)<{ $style: ProgressStyleType
59
64
let ProgressCircleTmpComp = ( function ( ) {
60
65
const childrenMap = {
61
66
value : numberExposingStateControl ( "value" , 60 ) ,
62
- style : styleControl ( ProgressStyle ) ,
67
+ // borderRadius property hidden as it's not valid for progress circle
68
+ style : styleControl ( CircleProgressStyle ) ,
63
69
} ;
64
70
return new UICompBuilder ( childrenMap , ( props ) => {
65
71
return (
0 commit comments