bi-sdk-react 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/js/bi-sdk.es.js +53 -32
- package/dist/types/components/PageDesigner.d.ts +1 -1
- package/dist/types/components/panel/ChatInput.d.ts +1 -1
- package/dist/types/components/plugins/@antd/item-props/CheckboxProps.d.ts +3 -3
- package/dist/types/components/plugins/@antd/item-props/ColProps.d.ts +2 -2
- package/dist/types/components/plugins/@antd/item-props/TextProps.d.ts +3 -2
- package/dist/types/components/plugins/@antd/items/TextRender.d.ts +1 -0
- package/dist/umd/js/bi-sdk.umd.min.js +52 -31
- package/package.json +1 -1
- package/src/components/PageDesigner.tsx +69 -4
- package/src/components/panel/ChatInput.tsx +76 -46
- package/src/components/panel/PropertiesPanel.tsx +2 -2
- package/src/components/plugins/@antd/index.ts +0 -1
- package/src/components/plugins/@antd/item-props/CapsuleProps.tsx +1 -1
- package/src/components/plugins/@antd/item-props/CheckboxProps.tsx +90 -42
- package/src/components/plugins/@antd/item-props/ColProps.tsx +139 -25
- package/src/components/plugins/@antd/item-props/SelectProps.tsx +1 -1
- package/src/components/plugins/@antd/item-props/TextProps.tsx +1 -2
|
@@ -1,43 +1,157 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Form, InputNumber, Tooltip } from
|
|
3
|
-
import type { PropEditorProps } from
|
|
4
|
-
import { InfoCircleOutlined } from
|
|
5
|
-
import styled from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Form, InputNumber, Tooltip } from "antd";
|
|
3
|
+
import type { PropEditorProps } from "./types";
|
|
4
|
+
import { InfoCircleOutlined } from "@ant-design/icons";
|
|
5
|
+
import styled from "styled-components";
|
|
6
6
|
|
|
7
7
|
const HelpIcon = styled(InfoCircleOutlined)`
|
|
8
8
|
vertical-align: middle;
|
|
9
9
|
margin-left: 2px;
|
|
10
10
|
color: var(--ant-color-text-description);
|
|
11
|
-
|
|
11
|
+
`;
|
|
12
12
|
|
|
13
|
-
export type ColModel = {
|
|
13
|
+
export type ColModel = {
|
|
14
|
+
span?: number;
|
|
15
|
+
xs?: number;
|
|
16
|
+
sm?: number;
|
|
17
|
+
md?: number;
|
|
18
|
+
lg?: number;
|
|
19
|
+
xl?: number;
|
|
20
|
+
xxl?: number;
|
|
21
|
+
};
|
|
14
22
|
|
|
15
|
-
export const ColProps: React.FC<PropEditorProps<ColModel>> = ({
|
|
16
|
-
|
|
23
|
+
export const ColProps: React.FC<PropEditorProps<ColModel>> = ({
|
|
24
|
+
model,
|
|
25
|
+
onChange,
|
|
26
|
+
}) => {
|
|
27
|
+
const trigger = (key: keyof ColModel, value: any) =>
|
|
28
|
+
onChange && onChange({ ...model, [key]: value });
|
|
17
29
|
return (
|
|
18
30
|
<Form labelCol={{ span: 12 }} wrapperCol={{ span: 12 }}>
|
|
19
31
|
<Form.Item label="默认列数">
|
|
20
|
-
<InputNumber
|
|
32
|
+
<InputNumber
|
|
33
|
+
size="small"
|
|
34
|
+
value={model.span}
|
|
35
|
+
min={0}
|
|
36
|
+
max={24}
|
|
37
|
+
step={4}
|
|
38
|
+
onChange={(v) => trigger("span", v || 0)}
|
|
39
|
+
/>
|
|
21
40
|
</Form.Item>
|
|
22
|
-
<Form.Item
|
|
23
|
-
|
|
41
|
+
<Form.Item
|
|
42
|
+
label={
|
|
43
|
+
<>
|
|
44
|
+
xs{" "}
|
|
45
|
+
<Tooltip title="<576px 响应式栅格">
|
|
46
|
+
<HelpIcon />
|
|
47
|
+
</Tooltip>
|
|
48
|
+
</>
|
|
49
|
+
}
|
|
50
|
+
>
|
|
51
|
+
<InputNumber
|
|
52
|
+
size="small"
|
|
53
|
+
value={model.xs}
|
|
54
|
+
min={0}
|
|
55
|
+
max={24}
|
|
56
|
+
step={4}
|
|
57
|
+
onChange={(v) => trigger("xs", v || 0)}
|
|
58
|
+
/>
|
|
24
59
|
</Form.Item>
|
|
25
|
-
<Form.Item
|
|
26
|
-
|
|
60
|
+
<Form.Item
|
|
61
|
+
label={
|
|
62
|
+
<>
|
|
63
|
+
sm{" "}
|
|
64
|
+
<Tooltip title="≥576px 响应式栅格">
|
|
65
|
+
<HelpIcon />
|
|
66
|
+
</Tooltip>
|
|
67
|
+
</>
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
<InputNumber
|
|
71
|
+
size="small"
|
|
72
|
+
value={model.sm}
|
|
73
|
+
min={0}
|
|
74
|
+
max={24}
|
|
75
|
+
step={4}
|
|
76
|
+
onChange={(v) => trigger("sm", v || 0)}
|
|
77
|
+
/>
|
|
27
78
|
</Form.Item>
|
|
28
|
-
<Form.Item
|
|
29
|
-
|
|
79
|
+
<Form.Item
|
|
80
|
+
label={
|
|
81
|
+
<>
|
|
82
|
+
md{" "}
|
|
83
|
+
<Tooltip title="≥768px 响应式栅格">
|
|
84
|
+
<HelpIcon />
|
|
85
|
+
</Tooltip>
|
|
86
|
+
</>
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
<InputNumber
|
|
90
|
+
size="small"
|
|
91
|
+
value={model.md}
|
|
92
|
+
min={0}
|
|
93
|
+
max={24}
|
|
94
|
+
step={4}
|
|
95
|
+
onChange={(v) => trigger("md", v || 0)}
|
|
96
|
+
/>
|
|
30
97
|
</Form.Item>
|
|
31
|
-
<Form.Item
|
|
32
|
-
|
|
98
|
+
<Form.Item
|
|
99
|
+
label={
|
|
100
|
+
<>
|
|
101
|
+
lg{" "}
|
|
102
|
+
<Tooltip title="≥992px 响应式栅格">
|
|
103
|
+
<HelpIcon />
|
|
104
|
+
</Tooltip>
|
|
105
|
+
</>
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
<InputNumber
|
|
109
|
+
size="small"
|
|
110
|
+
value={model.lg}
|
|
111
|
+
min={0}
|
|
112
|
+
max={24}
|
|
113
|
+
step={4}
|
|
114
|
+
onChange={(v) => trigger("lg", v || 0)}
|
|
115
|
+
/>
|
|
33
116
|
</Form.Item>
|
|
34
|
-
<Form.Item
|
|
35
|
-
|
|
117
|
+
<Form.Item
|
|
118
|
+
label={
|
|
119
|
+
<>
|
|
120
|
+
xl{" "}
|
|
121
|
+
<Tooltip title="≥1200px 响应式栅格">
|
|
122
|
+
<HelpIcon />
|
|
123
|
+
</Tooltip>
|
|
124
|
+
</>
|
|
125
|
+
}
|
|
126
|
+
>
|
|
127
|
+
<InputNumber
|
|
128
|
+
size="small"
|
|
129
|
+
value={model.xl}
|
|
130
|
+
min={0}
|
|
131
|
+
max={24}
|
|
132
|
+
step={4}
|
|
133
|
+
onChange={(v) => trigger("xl", v || 0)}
|
|
134
|
+
/>
|
|
36
135
|
</Form.Item>
|
|
37
|
-
<Form.Item
|
|
38
|
-
|
|
136
|
+
<Form.Item
|
|
137
|
+
label={
|
|
138
|
+
<>
|
|
139
|
+
xxl{" "}
|
|
140
|
+
<Tooltip title="≥1600px 响应式栅格">
|
|
141
|
+
<HelpIcon />
|
|
142
|
+
</Tooltip>
|
|
143
|
+
</>
|
|
144
|
+
}
|
|
145
|
+
>
|
|
146
|
+
<InputNumber
|
|
147
|
+
size="small"
|
|
148
|
+
value={model.xxl}
|
|
149
|
+
min={0}
|
|
150
|
+
max={24}
|
|
151
|
+
step={4}
|
|
152
|
+
onChange={(v) => trigger("xxl", v || 0)}
|
|
153
|
+
/>
|
|
39
154
|
</Form.Item>
|
|
40
155
|
</Form>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
156
|
+
);
|
|
157
|
+
};
|
|
@@ -118,7 +118,7 @@ export const SelectProps: React.FC<PropEditorProps<SelectModel>> = ({
|
|
|
118
118
|
onChange={(v) => trigger("multiple", v)}
|
|
119
119
|
/>
|
|
120
120
|
</Form.Item>
|
|
121
|
-
<Form.Item>
|
|
121
|
+
<Form.Item labelCol={{ span: 24 }} wrapperCol={{ span: 24 }}>
|
|
122
122
|
<Table
|
|
123
123
|
size="small"
|
|
124
124
|
dataSource={model.options}
|
|
@@ -15,7 +15,7 @@ export const TextProps: React.FC<PropEditorProps<TextModel>> = ({
|
|
|
15
15
|
onChange && onChange({ ...model, customStyle: next } as any);
|
|
16
16
|
};
|
|
17
17
|
return (
|
|
18
|
-
<Form>
|
|
18
|
+
<Form layout="vertical">
|
|
19
19
|
<Form.Item label="文本内容">
|
|
20
20
|
<Input.TextArea
|
|
21
21
|
size="small"
|
|
@@ -72,7 +72,6 @@ export const TextProps: React.FC<PropEditorProps<TextModel>> = ({
|
|
|
72
72
|
size="small"
|
|
73
73
|
value={model.customStyle?.color}
|
|
74
74
|
onChange={(v) => setStyle("color", v.toHexString())}
|
|
75
|
-
style={{ width: 90 }}
|
|
76
75
|
allowClear={true}
|
|
77
76
|
/>
|
|
78
77
|
</Space.Compact>
|