Skip to content

Commit 47c101b

Browse files
committed
added examples for different components
1 parent 9726857 commit 47c101b

35 files changed

+2629
-42
lines changed

client/packages/lowcoder/src/pages/ComponentDoc/examples/ButtonComp/FloatButton.tsx

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,51 @@ export default function FloatButtonExample() {
2727
<>
2828
<ExampleGroup
2929
title={trans("componentDoc.basicUsage")}
30-
description={trans("componentDoc.basicDemoDescription")}
30+
description="The Following Examples Show the Basic Usage of the Float Button Component."
3131
>
3232
<Example
33-
title={trans("componentDoc.default")}
33+
title="A Simple Float Button"
3434
config={{
3535
buttons: buttons,
36-
buttonTheme: "primary",
37-
icon: "/icon:antd/questioncircleoutlined",
36+
}}
37+
compFactory={FloatButtonComp}
38+
/>
39+
<Example
40+
title="Hiding the Float Button"
41+
config={{
42+
buttons: buttons,
43+
hidden: true,
44+
}}
45+
compFactory={FloatButtonComp}
46+
/>
47+
<Example
48+
title="Different Icon on Float Button"
49+
config={{
50+
buttons: buttons,
51+
icon: "/icon:solid/align-justify",
52+
}}
53+
compFactory={FloatButtonComp}
54+
/>
55+
<Example
56+
title="Button Theme - Default"
57+
config={{
58+
buttons: buttons,
59+
buttonTheme: "default",
60+
icon: "/icon:solid/align-justify",
3861
includeMargin: true,
3962
preventStyleOverwriting: false,
40-
shape: "circle",
4163
value: "",
4264
}}
4365
compFactory={FloatButtonComp}
4466
/>
67+
<Example
68+
title="Button Shape - Square"
69+
config={{
70+
buttons: buttons,
71+
shape: "square",
72+
}}
73+
compFactory={FloatButtonComp}
74+
/>
4575
</ExampleGroup>
4676

4777
</>

client/packages/lowcoder/src/pages/ComponentDoc/examples/ButtonComp/IconButton.tsx

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,108 @@ export default function IconButtonExample() {
88
<>
99
<ExampleGroup
1010
title={trans("componentDoc.basicUsage")}
11-
description={trans("componentDoc.basicDemoDescription")}
11+
description="The Following Examples Show the Basic Usage of the Icon Button Component."
1212
>
1313
<Example
14-
title={trans("componentDoc.default")}
14+
title="A Simple Icon button"
15+
width={120}
1516
config={{
1617
prefixIcon: "/icon:solid/align-justify",
17-
iconSize: "30px",
1818
}}
1919
compFactory={ControlButton}
2020
/>
2121
<Example
2222
title={trans("componentDoc.loading")}
2323
width={120}
24-
config={{ type: "default", text: trans("componentDoc.submit"), loading: true }}
24+
config={{
25+
prefixIcon: "/icon:solid/align-justify",
26+
loading: true,
27+
}}
2528
compFactory={ControlButton}
2629
/>
2730
<Example
2831
title={trans("componentDoc.disabled")}
2932
width={120}
30-
config={{ type: "default", text: trans("componentDoc.submit"), disabled: true }}
33+
config={{
34+
disabled: true,
35+
prefixIcon: "/icon:solid/align-justify",
36+
}}
37+
compFactory={ControlButton}
38+
/>
39+
<Example
40+
title="Hiding the Icon Button"
41+
width={120}
42+
config={{
43+
hidden: true,
44+
prefixIcon: "/icon:solid/align-justify",
45+
}}
3146
compFactory={ControlButton}
3247
/>
3348
</ExampleGroup>
3449

35-
<ExampleGroup title={trans("componentDoc.style")}>
50+
<ExampleGroup
51+
title="Layout & Style"
52+
description="The Following Examples Show the Layout & Style options on Float Button Component."
53+
>
3654
<Example
3755
title={trans("componentDoc.danger")}
3856
width={120}
3957
config={{
40-
style: { backgroundColor: "#CD574C", borderColor: "#AC3A32", color: "#E0ECF6" },
58+
prefixIcon: "/icon:solid/ellipsis-vertical",
59+
style: {
60+
backgroundColor: "#CD574C",
61+
borderColor: "#AC3A32",
62+
color: "#E0ECF6" },
4163
}}
4264
compFactory={ControlButton}
4365
/>
4466
<Example
4567
title={trans("componentDoc.warning")}
4668
width={120}
4769
config={{
48-
style: { backgroundColor: "#F4A125", borderColor: "#DA7D16", color: "#000000" },
70+
prefixIcon: "/icon:solid/square-caret-right",
71+
style: {
72+
backgroundColor: "#F4A125",
73+
borderColor: "#DA7D16",
74+
color: "#000000" },
4975
}}
5076
compFactory={ControlButton}
5177
/>
5278
<Example
5379
title={trans("componentDoc.success")}
5480
width={120}
5581
config={{
56-
style: { backgroundColor: "#5E8D6E", borderColor: "#40694E", color: "#E0ECF6" },
82+
prefixIcon: "/icon:antd/audiofilled",
83+
style: {
84+
backgroundColor: "#5E8D6E",
85+
borderColor: "#40694E",
86+
color: "#E0ECF6" },
87+
}}
88+
compFactory={ControlButton}
89+
/>
90+
<Example
91+
title="Icon Size - 30px"
92+
width={120}
93+
config={{
94+
prefixIcon: "/icon:antd/audiofilled",
95+
iconSize: "30px",
96+
style: {
97+
backgroundColor: "#5E8D6E",
98+
borderColor: "#40694E",
99+
color: "#E0ECF6" },
100+
}}
101+
compFactory={ControlButton}
102+
/>
103+
<Example
104+
title="Icon Size - 40px"
105+
width={120}
106+
config={{
107+
prefixIcon: "/icon:antd/audiofilled",
108+
iconSize: "40px",
109+
style: {
110+
backgroundColor: "#5E8D6E",
111+
borderColor: "#40694E",
112+
color: "#E0ECF6" },
57113
}}
58114
compFactory={ControlButton}
59115
/>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { uiCompRegistry } from "comps/uiCompRegistry";
2+
import { trans } from "i18n";
3+
import { chartColorPalette } from "lowcoder-design";
4+
import Example from "../../common/Example";
5+
import ExampleGroup from "../../common/ExampleGroup";
6+
7+
const ChartCompWithDefault = uiCompRegistry["calendar"].comp;
8+
9+
export default function CalendarExample() {
10+
return (
11+
<>
12+
<ExampleGroup
13+
title={trans("componentDoc.basicUsage")}
14+
description={trans("componentDoc.basicDemoDescription")}
15+
>
16+
<Example
17+
title={trans("componentDoc.default")}
18+
config={{
19+
}}
20+
compFactory={ChartCompWithDefault}
21+
/>
22+
</ExampleGroup>
23+
</>
24+
);
25+
}

0 commit comments

Comments
 (0)