Skip to content

Commit 7b6dda6

Browse files
committed
FOnt added for testing, circle progress and progress updated
1 parent 8a63065 commit 7b6dda6

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

client/packages/lowcoder/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<meta name="theme-color" content="#000000" />
88
<meta property="iframely:title" content="Lowcoder" />
99
<meta property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />
10+
<!-- Added Montserrat google font link to test font family style property for components -->
11+
<link rel="preconnect" href="https://fonts.googleapis.com">
12+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
13+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
1014
<style>
1115
html,
1216
body {

client/packages/lowcoder/src/comps/comps/progressCircleComp.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { default as Progress } from "antd/es/progress";
22
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";
44
import styled, { css } from "styled-components";
55
import { Section, sectionNames } from "lowcoder-design";
66
import { numberExposingStateControl } from "../controls/codeStateControl";
@@ -14,33 +14,38 @@ import { EditorContext } from "comps/editorState";
1414

1515
// TODO: after Update of ANTd, introduce Size attribute to ProgressCircle
1616

17-
const getStyle = (style: ProgressStyleType) => {
17+
const getStyle = (style: CircleProgressType) => {
1818
return css`
1919
width: ${widthCalculator(style.margin)};
2020
height: ${heightCalculator(style.margin)};
2121
margin: ${style.margin};
2222
padding: ${style.padding};
23+
border-radius:${style.radius};
2324
.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};
2530
}
2631
.ant-progress-circle-trail {
2732
stroke: ${style.track};
2833
}
2934
.ant-progress-inner .ant-progress-circle-path {
30-
stroke: ${style.fill};
35+
stroke: ${style.fill} !important;
3136
}
3237
&.ant-progress-status-success {
3338
.ant-progress-inner .ant-progress-circle-path {
34-
stroke: ${style.success};
39+
stroke: ${style.success} !important;
3540
}
3641
.ant-progress-text {
37-
color: ${style.success};
42+
color: ${style.success} !important;
3843
}
3944
}
4045
`;
4146
};
4247

43-
export const StyledProgressCircle = styled(Progress)<{ $style: ProgressStyleType }>`
48+
export const StyledProgressCircle = styled(Progress) <{ $style: CircleProgressType }>`
4449
width: 100%;
4550
height: 100%;
4651
padding: 2px;
@@ -59,7 +64,8 @@ export const StyledProgressCircle = styled(Progress)<{ $style: ProgressStyleType
5964
let ProgressCircleTmpComp = (function () {
6065
const childrenMap = {
6166
value: numberExposingStateControl("value", 60),
62-
style: styleControl(ProgressStyle),
67+
// borderRadius property hidden as it's not valid for progress circle
68+
style: styleControl(CircleProgressStyle),
6369
};
6470
return new UICompBuilder(childrenMap, (props) => {
6571
return (

client/packages/lowcoder/src/comps/comps/progressComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const getStyle = (style: ProgressStyleType) => {
2121
font-style:${style.fontStyle};
2222
font-family:${style.fontFamily};
2323
font-weight:${style.textWeight};
24+
font-size:${style.textSize};
2425
}
2526
width: ${widthCalculator(style.margin)};
2627
height: ${heightCalculator(style.margin)};

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,8 @@ export const ProgressStyle = [
10911091
SUCCESS,
10921092
] as const;
10931093

1094+
export const CircleProgressStyle = [...ProgressStyle.filter((style) => style.name !== 'radius')]
1095+
10941096
export const NavigationStyle = [
10951097
...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE, 'text', [
10961098
{
@@ -1375,6 +1377,7 @@ export type DateTimeStyleType = StyleConfigType<typeof DateTimeStyle>;
13751377
export type LinkStyleType = StyleConfigType<typeof LinkStyle>;
13761378
export type DividerStyleType = StyleConfigType<typeof DividerStyle>;
13771379
export type ProgressStyleType = StyleConfigType<typeof ProgressStyle>;
1380+
export type CircleProgressType = StyleConfigType<typeof CircleProgressStyle>;
13781381
export type NavigationStyleType = StyleConfigType<typeof NavigationStyle>;
13791382
export type ImageStyleType = StyleConfigType<typeof ImageStyle>;
13801383
export type ListViewStyleType = StyleConfigType<typeof ListViewStyle>;

0 commit comments

Comments
 (0)