@agentscope-ai/design 1.0.11 → 1.0.12
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/README.md +241 -71
- package/lib/antd/styles/select.style.js +7 -1
- package/lib/antd/themes/bailianDarkTheme.json +7 -0
- package/lib/antd/themes/bailianTheme.json +7 -0
- package/lib/antd/themes/carbonDarkTheme.json +7 -0
- package/lib/antd/themes/carbonTheme.json +3 -0
- package/lib/antd/themes/generateTheme.d.ts +132 -0
- package/lib/antd/themes/generateTheme.js +328 -0
- package/lib/components/commonComponents/AlertDialog/index.d.ts +325 -37
- package/lib/components/commonComponents/AlertDialog/index.js +3 -153
- package/lib/components/commonComponents/AlertDialog/index.style.js +14 -2
- package/lib/components/commonComponents/AlertDialog/mobile.d.ts +38 -0
- package/lib/components/commonComponents/AlertDialog/mobile.js +188 -0
- package/lib/components/commonComponents/AlertDialog/pc.d.ts +38 -0
- package/lib/components/commonComponents/AlertDialog/pc.js +152 -0
- package/lib/components/commonComponents/Anchor/index.js +1 -1
- package/lib/components/commonComponents/Button/index.js +5 -3
- package/lib/components/commonComponents/CodeBlock/index.js +1 -2
- package/lib/components/commonComponents/CollapsePanel/index.js +1 -2
- package/lib/components/commonComponents/Drawer/index.style.js +42 -2
- package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.d.ts +3 -0
- package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.js +21 -0
- package/lib/components/commonComponents/InputNumber/demo/demo1.js +0 -3
- package/lib/components/commonComponents/Modal/index.d.ts +2 -16
- package/lib/components/commonComponents/Modal/index.js +3 -71
- package/lib/components/commonComponents/Modal/index.style.js +62 -2
- package/lib/components/commonComponents/Modal/mobile.d.ts +28 -0
- package/lib/components/commonComponents/Modal/mobile.js +97 -0
- package/lib/components/commonComponents/Modal/pc.d.ts +28 -0
- package/lib/components/commonComponents/Modal/pc.js +72 -0
- package/lib/components/commonComponents/Pagination/index.js +4 -2
- package/lib/components/commonComponents/Pagination/index.style.js +11 -3
- package/lib/components/commonComponents/PromptsEditor/VarRender.js +6 -1
- package/lib/components/commonComponents/PromptsEditor/VarSelectInput.js +3 -2
- package/lib/components/commonComponents/PromptsEditor/demo/basic.js +2 -0
- package/lib/components/commonComponents/PromptsEditor/index.js +1 -1
- package/lib/components/commonComponents/RadioButton/index.js +1 -5
- package/lib/components/commonComponents/Table/demo/demo1.js +13 -23
- package/lib/components/commonComponents/Table/index.js +3 -1
- package/lib/components/commonComponents/Table/index.style.js +1 -3
- package/lib/components/commonComponents/Tag/index.d.ts +10 -1
- package/lib/components/commonComponents/Tag/index.js +13 -1
- package/lib/components/commonComponents/Tooltip/index.js +1 -2
- package/lib/config.d.ts +2 -0
- package/lib/i18n/index.js +3 -0
- package/lib/i18n/strings/index.d.ts +2 -0
- package/lib/index.d.ts +2 -4
- package/lib/index.js +2 -4
- package/lib/libs/env/index.d.ts +1 -1
- package/lib/libs/staticRenderer/index.js +12 -3
- package/lib/libs/utils/index.d.ts +1 -0
- package/lib/libs/utils/index.js +4 -0
- package/lib/typings.d.ts +2 -0
- package/package.json +19 -60
- package/lib/antd/styles/_readme.txt +0 -1
- package/lib/antd/themes/_readme.txt +0 -1
- package/lib/libs/generateCssVars/index.d.ts +0 -19
- package/lib/libs/generateCssVars/index.js +0 -39
- package/lib/libs/region/constant.d.ts +0 -6
- package/lib/libs/region/constant.js +0 -154
- package/lib/libs/region/index.d.ts +0 -2
- package/lib/libs/region/index.js +0 -18
|
@@ -1,38 +1,326 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const AlertDialog: {
|
|
3
|
+
(props: import("./mobile").AlertDialogProps): JSX.Element;
|
|
4
|
+
success: (props?: {
|
|
5
|
+
classNames?: import("rc-dialog/lib/IDialogPropTypes").ModalClassNames;
|
|
6
|
+
styles?: import("rc-dialog/lib/IDialogPropTypes").ModalStyles;
|
|
7
|
+
closable?: boolean | ({
|
|
8
|
+
closeIcon?: import("react").ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
} & import("react").AriaAttributes);
|
|
11
|
+
closeIcon?: import("react").ReactNode;
|
|
12
|
+
centered?: boolean;
|
|
13
|
+
onOk?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
14
|
+
height?: string | number;
|
|
15
|
+
width?: string | number | Partial<Record<import("antd").Breakpoint, string | number>>;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: import("react").CSSProperties;
|
|
18
|
+
title?: import("react").ReactNode;
|
|
19
|
+
content?: import("react").ReactNode;
|
|
20
|
+
children?: import("react").ReactNode;
|
|
21
|
+
prefixCls?: string;
|
|
22
|
+
transitionName?: string;
|
|
23
|
+
rootClassName?: string;
|
|
24
|
+
footer?: import("react").ReactNode | ((originNode: import("react").ReactNode, extra: {
|
|
25
|
+
OkBtn: import("react").FC<{}>;
|
|
26
|
+
CancelBtn: import("react").FC<{}>;
|
|
27
|
+
}) => import("react").ReactNode);
|
|
28
|
+
mask?: boolean;
|
|
29
|
+
info?: import("react").ReactNode;
|
|
30
|
+
visible?: boolean;
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
danger?: boolean;
|
|
33
|
+
zIndex?: number;
|
|
34
|
+
animation?: any;
|
|
35
|
+
keyboard?: boolean;
|
|
36
|
+
afterClose?: () => void;
|
|
37
|
+
afterOpenChange?: (open: boolean) => void;
|
|
38
|
+
onClose?: (e: import("react").SyntheticEvent<Element, Event>) => any;
|
|
39
|
+
maskClosable?: boolean;
|
|
40
|
+
destroyOnClose?: boolean;
|
|
41
|
+
mousePosition?: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
};
|
|
45
|
+
maskTransitionName?: string;
|
|
46
|
+
maskAnimation?: any;
|
|
47
|
+
wrapStyle?: Record<string, any>;
|
|
48
|
+
bodyStyle?: import("react").CSSProperties;
|
|
49
|
+
maskStyle?: import("react").CSSProperties;
|
|
50
|
+
wrapClassName?: string;
|
|
51
|
+
bodyProps?: any;
|
|
52
|
+
maskProps?: any;
|
|
53
|
+
wrapProps?: any;
|
|
54
|
+
getContainer?: string | false | HTMLElement | (() => HTMLElement);
|
|
55
|
+
modalRender?: (node: import("react").ReactNode) => import("react").ReactNode;
|
|
56
|
+
forceRender?: boolean;
|
|
57
|
+
focusTriggerAfterClose?: boolean;
|
|
58
|
+
panelRef?: import("react").Ref<HTMLDivElement>;
|
|
59
|
+
okText?: import("react").ReactNode;
|
|
60
|
+
okType?: import("antd/es/button/button").LegacyButtonType;
|
|
61
|
+
okButtonProps?: import("antd").ButtonProps;
|
|
62
|
+
onCancel?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
63
|
+
cancelText?: import("react").ReactNode;
|
|
64
|
+
cancelButtonProps?: import("antd").ButtonProps;
|
|
65
|
+
showDivider?: boolean;
|
|
66
|
+
confirmLoading?: boolean;
|
|
67
|
+
}) => void;
|
|
68
|
+
info: (props?: {
|
|
69
|
+
classNames?: import("rc-dialog/lib/IDialogPropTypes").ModalClassNames;
|
|
70
|
+
styles?: import("rc-dialog/lib/IDialogPropTypes").ModalStyles;
|
|
71
|
+
closable?: boolean | ({
|
|
72
|
+
closeIcon?: import("react").ReactNode;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
} & import("react").AriaAttributes);
|
|
75
|
+
closeIcon?: import("react").ReactNode;
|
|
76
|
+
centered?: boolean;
|
|
77
|
+
onOk?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
78
|
+
height?: string | number;
|
|
79
|
+
width?: string | number | Partial<Record<import("antd").Breakpoint, string | number>>;
|
|
80
|
+
className?: string;
|
|
81
|
+
style?: import("react").CSSProperties;
|
|
82
|
+
title?: import("react").ReactNode;
|
|
83
|
+
content?: import("react").ReactNode;
|
|
84
|
+
children?: import("react").ReactNode;
|
|
85
|
+
prefixCls?: string;
|
|
86
|
+
transitionName?: string;
|
|
87
|
+
rootClassName?: string;
|
|
88
|
+
footer?: import("react").ReactNode | ((originNode: import("react").ReactNode, extra: {
|
|
89
|
+
OkBtn: import("react").FC<{}>;
|
|
90
|
+
CancelBtn: import("react").FC<{}>;
|
|
91
|
+
}) => import("react").ReactNode);
|
|
92
|
+
mask?: boolean;
|
|
93
|
+
info?: import("react").ReactNode;
|
|
94
|
+
visible?: boolean;
|
|
95
|
+
loading?: boolean;
|
|
96
|
+
danger?: boolean;
|
|
97
|
+
zIndex?: number;
|
|
98
|
+
animation?: any;
|
|
99
|
+
keyboard?: boolean;
|
|
100
|
+
afterClose?: () => void;
|
|
101
|
+
afterOpenChange?: (open: boolean) => void;
|
|
102
|
+
onClose?: (e: import("react").SyntheticEvent<Element, Event>) => any;
|
|
103
|
+
maskClosable?: boolean;
|
|
104
|
+
destroyOnClose?: boolean;
|
|
105
|
+
mousePosition?: {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
};
|
|
109
|
+
maskTransitionName?: string;
|
|
110
|
+
maskAnimation?: any;
|
|
111
|
+
wrapStyle?: Record<string, any>;
|
|
112
|
+
bodyStyle?: import("react").CSSProperties;
|
|
113
|
+
maskStyle?: import("react").CSSProperties;
|
|
114
|
+
wrapClassName?: string;
|
|
115
|
+
bodyProps?: any;
|
|
116
|
+
maskProps?: any;
|
|
117
|
+
wrapProps?: any;
|
|
118
|
+
getContainer?: string | false | HTMLElement | (() => HTMLElement);
|
|
119
|
+
modalRender?: (node: import("react").ReactNode) => import("react").ReactNode;
|
|
120
|
+
forceRender?: boolean;
|
|
121
|
+
focusTriggerAfterClose?: boolean;
|
|
122
|
+
panelRef?: import("react").Ref<HTMLDivElement>;
|
|
123
|
+
okText?: import("react").ReactNode;
|
|
124
|
+
okType?: import("antd/es/button/button").LegacyButtonType;
|
|
125
|
+
okButtonProps?: import("antd").ButtonProps;
|
|
126
|
+
onCancel?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
127
|
+
cancelText?: import("react").ReactNode;
|
|
128
|
+
cancelButtonProps?: import("antd").ButtonProps;
|
|
129
|
+
showDivider?: boolean;
|
|
130
|
+
confirmLoading?: boolean;
|
|
131
|
+
}) => void;
|
|
132
|
+
warning: (props?: {
|
|
133
|
+
classNames?: import("rc-dialog/lib/IDialogPropTypes").ModalClassNames;
|
|
134
|
+
styles?: import("rc-dialog/lib/IDialogPropTypes").ModalStyles;
|
|
135
|
+
closable?: boolean | ({
|
|
136
|
+
closeIcon?: import("react").ReactNode;
|
|
137
|
+
disabled?: boolean;
|
|
138
|
+
} & import("react").AriaAttributes);
|
|
139
|
+
closeIcon?: import("react").ReactNode;
|
|
140
|
+
centered?: boolean;
|
|
141
|
+
onOk?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
142
|
+
height?: string | number;
|
|
143
|
+
width?: string | number | Partial<Record<import("antd").Breakpoint, string | number>>;
|
|
144
|
+
className?: string;
|
|
145
|
+
style?: import("react").CSSProperties;
|
|
146
|
+
title?: import("react").ReactNode;
|
|
147
|
+
content?: import("react").ReactNode;
|
|
148
|
+
children?: import("react").ReactNode;
|
|
149
|
+
prefixCls?: string;
|
|
150
|
+
transitionName?: string;
|
|
151
|
+
rootClassName?: string;
|
|
152
|
+
footer?: import("react").ReactNode | ((originNode: import("react").ReactNode, extra: {
|
|
153
|
+
OkBtn: import("react").FC<{}>;
|
|
154
|
+
CancelBtn: import("react").FC<{}>;
|
|
155
|
+
}) => import("react").ReactNode);
|
|
156
|
+
mask?: boolean;
|
|
157
|
+
info?: import("react").ReactNode;
|
|
158
|
+
visible?: boolean;
|
|
159
|
+
loading?: boolean;
|
|
160
|
+
danger?: boolean;
|
|
161
|
+
zIndex?: number;
|
|
162
|
+
animation?: any;
|
|
163
|
+
keyboard?: boolean;
|
|
164
|
+
afterClose?: () => void;
|
|
165
|
+
afterOpenChange?: (open: boolean) => void;
|
|
166
|
+
onClose?: (e: import("react").SyntheticEvent<Element, Event>) => any;
|
|
167
|
+
maskClosable?: boolean;
|
|
168
|
+
destroyOnClose?: boolean;
|
|
169
|
+
mousePosition?: {
|
|
170
|
+
x: number;
|
|
171
|
+
y: number;
|
|
172
|
+
};
|
|
173
|
+
maskTransitionName?: string;
|
|
174
|
+
maskAnimation?: any;
|
|
175
|
+
wrapStyle?: Record<string, any>;
|
|
176
|
+
bodyStyle?: import("react").CSSProperties;
|
|
177
|
+
maskStyle?: import("react").CSSProperties;
|
|
178
|
+
wrapClassName?: string;
|
|
179
|
+
bodyProps?: any;
|
|
180
|
+
maskProps?: any;
|
|
181
|
+
wrapProps?: any;
|
|
182
|
+
getContainer?: string | false | HTMLElement | (() => HTMLElement);
|
|
183
|
+
modalRender?: (node: import("react").ReactNode) => import("react").ReactNode;
|
|
184
|
+
forceRender?: boolean;
|
|
185
|
+
focusTriggerAfterClose?: boolean;
|
|
186
|
+
panelRef?: import("react").Ref<HTMLDivElement>;
|
|
187
|
+
okText?: import("react").ReactNode;
|
|
188
|
+
okType?: import("antd/es/button/button").LegacyButtonType;
|
|
189
|
+
okButtonProps?: import("antd").ButtonProps;
|
|
190
|
+
onCancel?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
191
|
+
cancelText?: import("react").ReactNode;
|
|
192
|
+
cancelButtonProps?: import("antd").ButtonProps;
|
|
193
|
+
showDivider?: boolean;
|
|
194
|
+
confirmLoading?: boolean;
|
|
195
|
+
}) => void;
|
|
196
|
+
error: (props?: {
|
|
197
|
+
classNames?: import("rc-dialog/lib/IDialogPropTypes").ModalClassNames;
|
|
198
|
+
styles?: import("rc-dialog/lib/IDialogPropTypes").ModalStyles;
|
|
199
|
+
closable?: boolean | ({
|
|
200
|
+
closeIcon?: import("react").ReactNode;
|
|
201
|
+
disabled?: boolean;
|
|
202
|
+
} & import("react").AriaAttributes);
|
|
203
|
+
closeIcon?: import("react").ReactNode;
|
|
204
|
+
centered?: boolean;
|
|
205
|
+
onOk?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
206
|
+
height?: string | number;
|
|
207
|
+
width?: string | number | Partial<Record<import("antd").Breakpoint, string | number>>;
|
|
208
|
+
className?: string;
|
|
209
|
+
style?: import("react").CSSProperties;
|
|
210
|
+
title?: import("react").ReactNode;
|
|
211
|
+
content?: import("react").ReactNode;
|
|
212
|
+
children?: import("react").ReactNode;
|
|
213
|
+
prefixCls?: string;
|
|
214
|
+
transitionName?: string;
|
|
215
|
+
rootClassName?: string;
|
|
216
|
+
footer?: import("react").ReactNode | ((originNode: import("react").ReactNode, extra: {
|
|
217
|
+
OkBtn: import("react").FC<{}>;
|
|
218
|
+
CancelBtn: import("react").FC<{}>;
|
|
219
|
+
}) => import("react").ReactNode);
|
|
220
|
+
mask?: boolean;
|
|
221
|
+
info?: import("react").ReactNode;
|
|
222
|
+
visible?: boolean;
|
|
223
|
+
loading?: boolean;
|
|
224
|
+
danger?: boolean;
|
|
225
|
+
zIndex?: number;
|
|
226
|
+
animation?: any;
|
|
227
|
+
keyboard?: boolean;
|
|
228
|
+
afterClose?: () => void;
|
|
229
|
+
afterOpenChange?: (open: boolean) => void;
|
|
230
|
+
onClose?: (e: import("react").SyntheticEvent<Element, Event>) => any;
|
|
231
|
+
maskClosable?: boolean;
|
|
232
|
+
destroyOnClose?: boolean;
|
|
233
|
+
mousePosition?: {
|
|
234
|
+
x: number;
|
|
235
|
+
y: number;
|
|
236
|
+
};
|
|
237
|
+
maskTransitionName?: string;
|
|
238
|
+
maskAnimation?: any;
|
|
239
|
+
wrapStyle?: Record<string, any>;
|
|
240
|
+
bodyStyle?: import("react").CSSProperties;
|
|
241
|
+
maskStyle?: import("react").CSSProperties;
|
|
242
|
+
wrapClassName?: string;
|
|
243
|
+
bodyProps?: any;
|
|
244
|
+
maskProps?: any;
|
|
245
|
+
wrapProps?: any;
|
|
246
|
+
getContainer?: string | false | HTMLElement | (() => HTMLElement);
|
|
247
|
+
modalRender?: (node: import("react").ReactNode) => import("react").ReactNode;
|
|
248
|
+
forceRender?: boolean;
|
|
249
|
+
focusTriggerAfterClose?: boolean;
|
|
250
|
+
panelRef?: import("react").Ref<HTMLDivElement>;
|
|
251
|
+
okText?: import("react").ReactNode;
|
|
252
|
+
okType?: import("antd/es/button/button").LegacyButtonType;
|
|
253
|
+
okButtonProps?: import("antd").ButtonProps;
|
|
254
|
+
onCancel?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
255
|
+
cancelText?: import("react").ReactNode;
|
|
256
|
+
cancelButtonProps?: import("antd").ButtonProps;
|
|
257
|
+
showDivider?: boolean;
|
|
258
|
+
confirmLoading?: boolean;
|
|
259
|
+
}) => void;
|
|
260
|
+
confirm: (props?: {
|
|
261
|
+
classNames?: import("rc-dialog/lib/IDialogPropTypes").ModalClassNames;
|
|
262
|
+
styles?: import("rc-dialog/lib/IDialogPropTypes").ModalStyles;
|
|
263
|
+
closable?: boolean | ({
|
|
264
|
+
closeIcon?: import("react").ReactNode;
|
|
265
|
+
disabled?: boolean;
|
|
266
|
+
} & import("react").AriaAttributes);
|
|
267
|
+
closeIcon?: import("react").ReactNode;
|
|
268
|
+
centered?: boolean;
|
|
269
|
+
onOk?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
270
|
+
height?: string | number;
|
|
271
|
+
width?: string | number | Partial<Record<import("antd").Breakpoint, string | number>>;
|
|
272
|
+
className?: string;
|
|
273
|
+
style?: import("react").CSSProperties;
|
|
274
|
+
title?: import("react").ReactNode;
|
|
275
|
+
content?: import("react").ReactNode;
|
|
276
|
+
children?: import("react").ReactNode;
|
|
277
|
+
prefixCls?: string;
|
|
278
|
+
transitionName?: string;
|
|
279
|
+
rootClassName?: string;
|
|
280
|
+
footer?: import("react").ReactNode | ((originNode: import("react").ReactNode, extra: {
|
|
281
|
+
OkBtn: import("react").FC<{}>;
|
|
282
|
+
CancelBtn: import("react").FC<{}>;
|
|
283
|
+
}) => import("react").ReactNode);
|
|
284
|
+
mask?: boolean;
|
|
285
|
+
info?: import("react").ReactNode;
|
|
286
|
+
visible?: boolean;
|
|
287
|
+
loading?: boolean;
|
|
288
|
+
danger?: boolean;
|
|
289
|
+
zIndex?: number;
|
|
290
|
+
animation?: any;
|
|
291
|
+
keyboard?: boolean;
|
|
292
|
+
afterClose?: () => void;
|
|
293
|
+
afterOpenChange?: (open: boolean) => void;
|
|
294
|
+
onClose?: (e: import("react").SyntheticEvent<Element, Event>) => any;
|
|
295
|
+
maskClosable?: boolean;
|
|
296
|
+
destroyOnClose?: boolean;
|
|
297
|
+
mousePosition?: {
|
|
298
|
+
x: number;
|
|
299
|
+
y: number;
|
|
300
|
+
};
|
|
301
|
+
maskTransitionName?: string;
|
|
302
|
+
maskAnimation?: any;
|
|
303
|
+
wrapStyle?: Record<string, any>;
|
|
304
|
+
bodyStyle?: import("react").CSSProperties;
|
|
305
|
+
maskStyle?: import("react").CSSProperties;
|
|
306
|
+
wrapClassName?: string;
|
|
307
|
+
bodyProps?: any;
|
|
308
|
+
maskProps?: any;
|
|
309
|
+
wrapProps?: any;
|
|
310
|
+
getContainer?: string | false | HTMLElement | (() => HTMLElement);
|
|
311
|
+
modalRender?: (node: import("react").ReactNode) => import("react").ReactNode;
|
|
312
|
+
forceRender?: boolean;
|
|
313
|
+
focusTriggerAfterClose?: boolean;
|
|
314
|
+
panelRef?: import("react").Ref<HTMLDivElement>;
|
|
315
|
+
okText?: import("react").ReactNode;
|
|
316
|
+
okType?: import("antd/es/button/button").LegacyButtonType;
|
|
317
|
+
okButtonProps?: import("antd").ButtonProps;
|
|
318
|
+
onCancel?: (e: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
319
|
+
cancelText?: import("react").ReactNode;
|
|
320
|
+
cancelButtonProps?: import("antd").ButtonProps;
|
|
321
|
+
showDivider?: boolean;
|
|
322
|
+
confirmLoading?: boolean;
|
|
323
|
+
}) => void;
|
|
37
324
|
};
|
|
38
|
-
export default
|
|
325
|
+
export default AlertDialog;
|
|
326
|
+
export type { AlertDialogProps } from './pc';
|
|
@@ -1,154 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
import $i18n from "../../../i18n";
|
|
11
|
-
import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined } from "@agentscope-ai/icons-override-antd";
|
|
12
|
-
import { Flex, Modal } from 'antd';
|
|
13
|
-
import classNames from 'classnames';
|
|
14
|
-
import { getCommonConfig } from "../../../config";
|
|
15
|
-
import { useStyle } from "./index.style";
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
var getCommonProps = function getCommonProps(props) {
|
|
20
|
-
var renderTitle = function renderTitle(_ref) {
|
|
21
|
-
var type = _ref.type,
|
|
22
|
-
title = _ref.title;
|
|
23
|
-
var _getCommonConfig = getCommonConfig(),
|
|
24
|
-
antPrefix = _getCommonConfig.antPrefix;
|
|
25
|
-
switch (type) {
|
|
26
|
-
case 'success':
|
|
27
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
28
|
-
align: "center",
|
|
29
|
-
gap: 8,
|
|
30
|
-
className: "leading-[28px]",
|
|
31
|
-
children: [/*#__PURE__*/_jsx(CheckCircleOutlined, {
|
|
32
|
-
style: {
|
|
33
|
-
color: "var(--".concat(antPrefix, "-color-success)"),
|
|
34
|
-
fontSize: 18,
|
|
35
|
-
margin: '0 3px'
|
|
36
|
-
}
|
|
37
|
-
}), title]
|
|
38
|
-
});
|
|
39
|
-
case 'warning':
|
|
40
|
-
case 'confirm':
|
|
41
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
42
|
-
align: "center",
|
|
43
|
-
gap: 8,
|
|
44
|
-
className: "leading-[28px]",
|
|
45
|
-
children: [/*#__PURE__*/_jsx(ExclamationCircleOutlined, {
|
|
46
|
-
style: {
|
|
47
|
-
color: "var(--".concat(antPrefix, "-color-warning)"),
|
|
48
|
-
fontSize: 18,
|
|
49
|
-
margin: '0 3px'
|
|
50
|
-
}
|
|
51
|
-
}), title]
|
|
52
|
-
});
|
|
53
|
-
case 'info':
|
|
54
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
55
|
-
align: "center",
|
|
56
|
-
gap: 8,
|
|
57
|
-
className: "leading-[28px]",
|
|
58
|
-
children: [/*#__PURE__*/_jsx(InfoCircleOutlined, {
|
|
59
|
-
style: {
|
|
60
|
-
color: "var(--".concat(antPrefix, "-color-info)"),
|
|
61
|
-
fontSize: 18,
|
|
62
|
-
margin: '0 3px'
|
|
63
|
-
}
|
|
64
|
-
}), title]
|
|
65
|
-
});
|
|
66
|
-
case 'error':
|
|
67
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
68
|
-
align: "center",
|
|
69
|
-
gap: 8,
|
|
70
|
-
className: "leading-[28px]",
|
|
71
|
-
children: [/*#__PURE__*/_jsx(CloseCircleOutlined, {
|
|
72
|
-
style: {
|
|
73
|
-
color: "var(--".concat(antPrefix, "-color-error)"),
|
|
74
|
-
fontSize: 18,
|
|
75
|
-
margin: '0 3px'
|
|
76
|
-
}
|
|
77
|
-
}), title]
|
|
78
|
-
});
|
|
79
|
-
default:
|
|
80
|
-
return $i18n.get({
|
|
81
|
-
id: 'components.commonComponents.AlertDialog.Prompt',
|
|
82
|
-
dm: '提示'
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var children = props.children,
|
|
87
|
-
_props$type = props.type,
|
|
88
|
-
type = _props$type === void 0 ? 'info' : _props$type,
|
|
89
|
-
_props$danger = props.danger,
|
|
90
|
-
danger = _props$danger === void 0 ? false : _props$danger,
|
|
91
|
-
title = props.title,
|
|
92
|
-
_props$width = props.width,
|
|
93
|
-
width = _props$width === void 0 ? 400 : _props$width,
|
|
94
|
-
_props$className = props.className,
|
|
95
|
-
className = _props$className === void 0 ? '' : _props$className,
|
|
96
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
|
97
|
-
return {
|
|
98
|
-
width: width,
|
|
99
|
-
transitionName: '',
|
|
100
|
-
restProps: restProps,
|
|
101
|
-
closeIcon: null,
|
|
102
|
-
title: renderTitle({
|
|
103
|
-
type: type,
|
|
104
|
-
title: title
|
|
105
|
-
}),
|
|
106
|
-
okButtonProps: {
|
|
107
|
-
danger: type === 'error' || type === 'warning' || danger
|
|
108
|
-
},
|
|
109
|
-
destroyOnClose: true,
|
|
110
|
-
className: classNames(className, 'animate-in', "".concat(getCommonConfig().sparkPrefix, "-alert-dialog")),
|
|
111
|
-
content: props.content || children,
|
|
112
|
-
children: children
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
var AlertDialog = function AlertDialog(props) {
|
|
116
|
-
var commonProps = getCommonProps(props);
|
|
117
|
-
var Style = useStyle();
|
|
118
|
-
// useIndexStyle();
|
|
119
|
-
|
|
120
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
121
|
-
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
|
|
122
|
-
width: commonProps.width,
|
|
123
|
-
transitionName: ""
|
|
124
|
-
}, commonProps.restProps), {}, {
|
|
125
|
-
closeIcon: null,
|
|
126
|
-
title: commonProps.title,
|
|
127
|
-
okButtonProps: commonProps.okButtonProps || {},
|
|
128
|
-
destroyOnClose: commonProps.destroyOnClose,
|
|
129
|
-
className: commonProps.className,
|
|
130
|
-
children: commonProps.content || commonProps.children
|
|
131
|
-
}))]
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
var staticFns = ['success', 'info', 'warning', 'error', 'confirm'];
|
|
135
|
-
staticFns.forEach(function (type) {
|
|
136
|
-
AlertDialog[type] = function (props) {
|
|
137
|
-
var commonProps = getCommonProps(_objectSpread(_objectSpread({}, props), {}, {
|
|
138
|
-
type: type
|
|
139
|
-
}));
|
|
140
|
-
function Content() {
|
|
141
|
-
var Style = useStyle();
|
|
142
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
143
|
-
children: [/*#__PURE__*/_jsx(Style, {}), commonProps.content]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// @ts-ignore
|
|
148
|
-
return Modal.confirm(_objectSpread(_objectSpread(_objectSpread({}, commonProps), commonProps.restProps), {}, {
|
|
149
|
-
content: /*#__PURE__*/_jsx(Content, {}),
|
|
150
|
-
icon: null
|
|
151
|
-
}));
|
|
152
|
-
};
|
|
153
|
-
});
|
|
1
|
+
import PCAlertDialog from "./pc";
|
|
2
|
+
import MobileAlertDialog from "./mobile";
|
|
3
|
+
var AlertDialog = MOBILE ? MobileAlertDialog : PCAlertDialog;
|
|
154
4
|
export default AlertDialog;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
var _templateObject;
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import createGlobalStyle from "../../../libs/createStyle";
|
|
4
|
-
export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-alert-dialog {\n .", "-modal-body {\n padding: 0 0 12px 32px;\n font-size: 14px;\n color: var(--", "-color-text-secondary);\n }\n\n .", "-modal-confirm-content {\n padding: 0 0 12px 32px;\n font-size: 14px;\n color: var(--", "-color-text-secondary);\n }\n\n .", "-modal-confirm-paragraph {\n max-width: 100%;\n }\n}\n"])), function (p) {
|
|
4
|
+
export var useStyle = MOBILE ? createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-alert-dialog {\n min-width: 300px;\n max-width: 80vw !important;\n \n .", "-modal-body {\n padding: 0 0 12px 32px;\n font-size: 14px;\n color: var(--", "-color-text-secondary);\n }\n\n .", "-modal-confirm-content {\n padding: 0 0 12px 32px;\n font-size: 14px;\n color: var(--", "-color-text-secondary);\n }\n\n .", "-modal-confirm-paragraph {\n max-width: 100%;\n }\n}\n"])), function (p) {
|
|
5
|
+
return p.sparkPrefix;
|
|
6
|
+
}, function (p) {
|
|
7
|
+
return p.antPrefix;
|
|
8
|
+
}, function (p) {
|
|
9
|
+
return p.antPrefix;
|
|
10
|
+
}, function (p) {
|
|
11
|
+
return p.antPrefix;
|
|
12
|
+
}, function (p) {
|
|
13
|
+
return p.antPrefix;
|
|
14
|
+
}, function (p) {
|
|
15
|
+
return p.antPrefix;
|
|
16
|
+
}) : createGlobalStyle(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n.", "-alert-dialog {\n .", "-modal-body {\n padding: 0 0 12px 32px;\n font-size: 14px;\n color: var(--", "-color-text-secondary);\n }\n\n .", "-modal-confirm-content {\n padding: 0 0 12px 32px;\n font-size: 14px;\n color: var(--", "-color-text-secondary);\n }\n\n .", "-modal-confirm-paragraph {\n max-width: 100%;\n }\n}\n"])), function (p) {
|
|
5
17
|
return p.sparkPrefix;
|
|
6
18
|
}, function (p) {
|
|
7
19
|
return p.antPrefix;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ModalProps } from "../../../index";
|
|
2
|
+
import { SyntheticEvent } from 'react';
|
|
3
|
+
export interface AlertDialogProps extends ModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 类型
|
|
6
|
+
* @descriptionEn type
|
|
7
|
+
* @default info
|
|
8
|
+
*/
|
|
9
|
+
type?: 'success' | 'info' | 'warning' | 'error' | 'confirm';
|
|
10
|
+
/**
|
|
11
|
+
* @description 确认按钮是否带有danger属性
|
|
12
|
+
* @descriptionEn whether the confirm button has a danger property
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
danger?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @description 内容
|
|
18
|
+
* @descriptionEn content
|
|
19
|
+
* @default -
|
|
20
|
+
*/
|
|
21
|
+
content?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* @description 关闭时触发的回调函数
|
|
24
|
+
* @descriptionEn callback function triggered when closed
|
|
25
|
+
* @default -
|
|
26
|
+
*/
|
|
27
|
+
onClose?: (e: SyntheticEvent<Element, Event>) => any;
|
|
28
|
+
}
|
|
29
|
+
type AlertDialogStaticProps = Omit<AlertDialogProps, 'type' | 'open'>;
|
|
30
|
+
declare const _default: {
|
|
31
|
+
(props: AlertDialogProps): JSX.Element;
|
|
32
|
+
success: (props?: AlertDialogStaticProps) => void;
|
|
33
|
+
info: (props?: AlertDialogStaticProps) => void;
|
|
34
|
+
warning: (props?: AlertDialogStaticProps) => void;
|
|
35
|
+
error: (props?: AlertDialogStaticProps) => void;
|
|
36
|
+
confirm: (props?: AlertDialogStaticProps) => void;
|
|
37
|
+
};
|
|
38
|
+
export default _default;
|