@rockshin/tao-ui 0.0.24 → 0.0.26
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 +17 -6
- package/component-manifest.json +534 -6
- package/dist/components/alert/alert.css +120 -0
- package/dist/components/alert/alert.d.ts +20 -0
- package/dist/components/alert/alert.js +185 -0
- package/dist/components/button/button.css +19 -18
- package/dist/components/button/button.d.ts +8 -0
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/range-picker.js +1 -1
- package/dist/components/dropdown/dropdown.css +22 -1
- package/dist/components/dropdown/dropdown.js +4 -3
- package/dist/components/form/form-context.d.ts +7 -0
- package/dist/components/form/form-context.js +8 -0
- package/dist/components/form/form-item.d.ts +55 -0
- package/dist/components/form/form-item.js +131 -0
- package/dist/components/form/form.css +22 -0
- package/dist/components/form/form.d.ts +35 -0
- package/dist/components/form/form.js +125 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form-field/form-field-view.d.ts +30 -0
- package/dist/components/form-field/form-field-view.js +154 -0
- package/dist/components/form-field/form-field.d.ts +2 -2
- package/dist/components/form-field/form-field.js +29 -137
- package/dist/components/form-field/form.css +17 -7
- package/dist/components/input/input.css +18 -8
- package/dist/components/modal/confirm-dialog.js +14 -111
- package/dist/components/modal/modal.d.ts +7 -1
- package/dist/components/modal/modal.js +205 -195
- package/dist/components/popconfirm/popconfirm.css +44 -0
- package/dist/components/popconfirm/popconfirm.d.ts +41 -0
- package/dist/components/popconfirm/popconfirm.js +238 -0
- package/dist/components/popover/popover.css +105 -0
- package/dist/components/popover/popover.d.ts +41 -0
- package/dist/components/popover/popover.js +412 -0
- package/dist/components/select/select.js +1 -1
- package/dist/components/status-icon/status-icon.d.ts +5 -0
- package/dist/components/status-icon/status-icon.js +77 -0
- package/dist/components/table/table-types.d.ts +7 -0
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +296 -283
- package/dist/components/tooltip/tooltip.css +93 -0
- package/dist/components/tooltip/tooltip.d.ts +33 -0
- package/dist/components/tooltip/tooltip.js +226 -0
- package/dist/docs/components/alert.doc.d.ts +29 -0
- package/dist/docs/components/alert.doc.js +93 -0
- package/dist/docs/components/form.doc.d.ts +29 -0
- package/dist/docs/components/form.doc.js +71 -0
- package/dist/docs/components/modal.doc.d.ts +6 -0
- package/dist/docs/components/modal.doc.js +9 -1
- package/dist/docs/components/popconfirm.doc.d.ts +29 -0
- package/dist/docs/components/popconfirm.doc.js +132 -0
- package/dist/docs/components/popover.doc.d.ts +29 -0
- package/dist/docs/components/popover.doc.js +121 -0
- package/dist/docs/components/stack.doc.d.ts +6 -0
- package/dist/docs/components/stack.doc.js +23 -2
- package/dist/docs/components/table.doc.js +2 -1
- package/dist/docs/components/tao-provider.doc.js +11 -1
- package/dist/docs/components/tooltip.doc.d.ts +37 -0
- package/dist/docs/components/tooltip.doc.js +76 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -1
- package/dist/layouts/stack/stack.d.ts +12 -3
- package/dist/layouts/stack/stack.js +60 -34
- package/dist/provider/tao-provider.d.ts +71 -0
- package/dist/provider/tao-provider.js +166 -120
- package/dist/theme/control.css +12 -12
- package/dist/theme/theme.css +23 -0
- package/dist/utils/breakpoint.d.ts +31 -0
- package/dist/utils/breakpoint.js +80 -0
- package/dist/utils/overlay.d.ts +19 -0
- package/dist/utils/overlay.js +41 -0
- package/llms.txt +68 -3
- package/package.json +6 -4
- package/dist/components/select/use-is-mobile.d.ts +0 -1
- package/dist/components/select/use-is-mobile.js +0 -27
|
@@ -2,13 +2,14 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { TaoPortalScope } from "../../provider/tao-provider.js";
|
|
5
|
+
import { resolveResponsiveValue, useBreakpoint } from "../../utils/breakpoint.js";
|
|
5
6
|
import { preventParentOutsideDismiss } from "../../utils/portal.js";
|
|
6
7
|
import { cx } from "../../utils/semantic.js";
|
|
7
8
|
import { Button } from "../button/button.js";
|
|
8
9
|
import "./modal.css";
|
|
9
10
|
import * as __rspack_external__radix_ui_react_dialog_dabd8325 from "@radix-ui/react-dialog";
|
|
10
11
|
function Modal(t0) {
|
|
11
|
-
const $ = c(
|
|
12
|
+
const $ = c(86);
|
|
12
13
|
const { open, onClose, title, footer, onOk, okText: t1, cancelText: t2, confirmLoading, okButtonProps, cancelButtonProps, width: t3, centered: t4, closable: t5, maskClosable: t6, keyboard: t7, afterClose, destroyOnHidden: t8, children, classNames, styles: stylesProp } = t0;
|
|
13
14
|
const okText = void 0 === t1 ? "OK" : t1;
|
|
14
15
|
const cancelText = void 0 === t2 ? "Cancel" : t2;
|
|
@@ -39,145 +40,154 @@ function Modal(t0) {
|
|
|
39
40
|
t9 = $[3];
|
|
40
41
|
}
|
|
41
42
|
useEffect(t9, t10);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} else t13 = $[6];
|
|
54
|
-
const contentStyle = t13;
|
|
43
|
+
const screens = useBreakpoint();
|
|
44
|
+
let t11;
|
|
45
|
+
if ($[4] !== screens || $[5] !== width) {
|
|
46
|
+
t11 = resolveResponsiveValue(width, screens) ?? 520;
|
|
47
|
+
$[4] = screens;
|
|
48
|
+
$[5] = width;
|
|
49
|
+
$[6] = t11;
|
|
50
|
+
} else t11 = $[6];
|
|
51
|
+
const resolvedWidth = t11;
|
|
52
|
+
const t12 = "number" == typeof resolvedWidth ? `${resolvedWidth}px` : resolvedWidth;
|
|
53
|
+
const t13 = stylesProp?.root;
|
|
55
54
|
let t14;
|
|
56
|
-
if ($[7] !==
|
|
57
|
-
t14 =
|
|
55
|
+
if ($[7] !== t12 || $[8] !== t13) {
|
|
56
|
+
t14 = {
|
|
57
|
+
width: t12,
|
|
58
|
+
...t13
|
|
59
|
+
};
|
|
60
|
+
$[7] = t12;
|
|
61
|
+
$[8] = t13;
|
|
62
|
+
$[9] = t14;
|
|
63
|
+
} else t14 = $[9];
|
|
64
|
+
const contentStyle = t14;
|
|
65
|
+
let t15;
|
|
66
|
+
if ($[10] !== cancelButtonProps || $[11] !== cancelText || $[12] !== onClose) {
|
|
67
|
+
t15 = ()=>/*#__PURE__*/ jsx(Button, {
|
|
58
68
|
variant: "secondary",
|
|
59
69
|
onClick: onClose,
|
|
60
70
|
...cancelButtonProps,
|
|
61
71
|
children: cancelText
|
|
62
72
|
});
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
} else
|
|
68
|
-
const CancelBtn =
|
|
69
|
-
let
|
|
70
|
-
if ($[
|
|
71
|
-
|
|
73
|
+
$[10] = cancelButtonProps;
|
|
74
|
+
$[11] = cancelText;
|
|
75
|
+
$[12] = onClose;
|
|
76
|
+
$[13] = t15;
|
|
77
|
+
} else t15 = $[13];
|
|
78
|
+
const CancelBtn = t15;
|
|
79
|
+
let t16;
|
|
80
|
+
if ($[14] !== confirmLoading || $[15] !== okButtonProps || $[16] !== okText || $[17] !== onOk) {
|
|
81
|
+
t16 = ()=>/*#__PURE__*/ jsx(Button, {
|
|
72
82
|
variant: "primary",
|
|
73
83
|
loading: confirmLoading,
|
|
74
84
|
onClick: onOk,
|
|
75
85
|
...okButtonProps,
|
|
76
86
|
children: okText
|
|
77
87
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
} else
|
|
84
|
-
const OkBtn =
|
|
85
|
-
let t16;
|
|
86
|
-
if ($[16] !== CancelBtn) {
|
|
87
|
-
t16 = /*#__PURE__*/ jsx(CancelBtn, {});
|
|
88
|
-
$[16] = CancelBtn;
|
|
89
|
-
$[17] = t16;
|
|
90
|
-
} else t16 = $[17];
|
|
88
|
+
$[14] = confirmLoading;
|
|
89
|
+
$[15] = okButtonProps;
|
|
90
|
+
$[16] = okText;
|
|
91
|
+
$[17] = onOk;
|
|
92
|
+
$[18] = t16;
|
|
93
|
+
} else t16 = $[18];
|
|
94
|
+
const OkBtn = t16;
|
|
91
95
|
let t17;
|
|
92
|
-
if ($[
|
|
93
|
-
t17 = /*#__PURE__*/ jsx(
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
} else t17 = $[
|
|
96
|
+
if ($[19] !== CancelBtn) {
|
|
97
|
+
t17 = /*#__PURE__*/ jsx(CancelBtn, {});
|
|
98
|
+
$[19] = CancelBtn;
|
|
99
|
+
$[20] = t17;
|
|
100
|
+
} else t17 = $[20];
|
|
97
101
|
let t18;
|
|
98
|
-
if ($[
|
|
99
|
-
t18 = /*#__PURE__*/
|
|
102
|
+
if ($[21] !== OkBtn) {
|
|
103
|
+
t18 = /*#__PURE__*/ jsx(OkBtn, {});
|
|
104
|
+
$[21] = OkBtn;
|
|
105
|
+
$[22] = t18;
|
|
106
|
+
} else t18 = $[22];
|
|
107
|
+
let t19;
|
|
108
|
+
if ($[23] !== t17 || $[24] !== t18) {
|
|
109
|
+
t19 = /*#__PURE__*/ jsxs(Fragment, {
|
|
100
110
|
children: [
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
t17,
|
|
112
|
+
t18
|
|
103
113
|
]
|
|
104
114
|
});
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
} else
|
|
109
|
-
const defaultFooter =
|
|
115
|
+
$[23] = t17;
|
|
116
|
+
$[24] = t18;
|
|
117
|
+
$[25] = t19;
|
|
118
|
+
} else t19 = $[25];
|
|
119
|
+
const defaultFooter = t19;
|
|
110
120
|
let footerContent;
|
|
111
121
|
if (void 0 === footer) footerContent = defaultFooter;
|
|
112
122
|
else if ("function" == typeof footer) {
|
|
113
|
-
let
|
|
114
|
-
if ($[
|
|
115
|
-
|
|
123
|
+
let t20;
|
|
124
|
+
if ($[26] !== CancelBtn || $[27] !== OkBtn || $[28] !== defaultFooter || $[29] !== footer) {
|
|
125
|
+
t20 = footer(defaultFooter, {
|
|
116
126
|
OkBtn,
|
|
117
127
|
CancelBtn
|
|
118
128
|
});
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
} else
|
|
125
|
-
footerContent =
|
|
129
|
+
$[26] = CancelBtn;
|
|
130
|
+
$[27] = OkBtn;
|
|
131
|
+
$[28] = defaultFooter;
|
|
132
|
+
$[29] = footer;
|
|
133
|
+
$[30] = t20;
|
|
134
|
+
} else t20 = $[30];
|
|
135
|
+
footerContent = t20;
|
|
126
136
|
} else footerContent = footer;
|
|
127
137
|
const keepAlive = !destroyOnHidden;
|
|
128
138
|
const forceMount = keepAlive ? true : void 0;
|
|
129
|
-
let
|
|
130
|
-
if ($[
|
|
131
|
-
|
|
139
|
+
let t20;
|
|
140
|
+
if ($[31] !== onClose) {
|
|
141
|
+
t20 = (v)=>{
|
|
132
142
|
if (!v) onClose?.();
|
|
133
143
|
};
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else
|
|
137
|
-
const
|
|
138
|
-
let
|
|
139
|
-
if ($[
|
|
140
|
-
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
} else
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
let
|
|
147
|
-
if ($[
|
|
148
|
-
|
|
144
|
+
$[31] = onClose;
|
|
145
|
+
$[32] = t20;
|
|
146
|
+
} else t20 = $[32];
|
|
147
|
+
const t21 = classNames?.overlay;
|
|
148
|
+
let t22;
|
|
149
|
+
if ($[33] !== t21) {
|
|
150
|
+
t22 = cx(t21);
|
|
151
|
+
$[33] = t21;
|
|
152
|
+
$[34] = t22;
|
|
153
|
+
} else t22 = $[34];
|
|
154
|
+
const t23 = stylesProp?.overlay;
|
|
155
|
+
const t24 = maskClosable ? onClose : void 0;
|
|
156
|
+
let t25;
|
|
157
|
+
if ($[35] !== forceMount || $[36] !== t22 || $[37] !== t23 || $[38] !== t24) {
|
|
158
|
+
t25 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
|
|
149
159
|
forceMount: forceMount,
|
|
150
160
|
"data-tao-modal-overlay": "",
|
|
151
|
-
className:
|
|
152
|
-
style:
|
|
153
|
-
onClick:
|
|
161
|
+
className: t22,
|
|
162
|
+
style: t23,
|
|
163
|
+
onClick: t24
|
|
154
164
|
});
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
let t28;
|
|
165
|
-
if ($[37] !== t27) {
|
|
166
|
-
t28 = cx(t27);
|
|
167
|
-
$[37] = t27;
|
|
168
|
-
$[38] = t28;
|
|
169
|
-
} else t28 = $[38];
|
|
165
|
+
$[35] = forceMount;
|
|
166
|
+
$[36] = t22;
|
|
167
|
+
$[37] = t23;
|
|
168
|
+
$[38] = t24;
|
|
169
|
+
$[39] = t25;
|
|
170
|
+
} else t25 = $[39];
|
|
171
|
+
const t26 = centered ? "" : void 0;
|
|
172
|
+
const t27 = open ? "" : void 0;
|
|
173
|
+
const t28 = classNames?.root;
|
|
170
174
|
let t29;
|
|
171
|
-
if ($[
|
|
172
|
-
t29 = (
|
|
175
|
+
if ($[40] !== t28) {
|
|
176
|
+
t29 = cx(t28);
|
|
177
|
+
$[40] = t28;
|
|
178
|
+
$[41] = t29;
|
|
179
|
+
} else t29 = $[41];
|
|
180
|
+
let t30;
|
|
181
|
+
if ($[42] !== keyboard) {
|
|
182
|
+
t30 = (e)=>{
|
|
173
183
|
if (!keyboard) e.preventDefault();
|
|
174
184
|
};
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
} else
|
|
178
|
-
let
|
|
179
|
-
if ($[
|
|
180
|
-
|
|
185
|
+
$[42] = keyboard;
|
|
186
|
+
$[43] = t30;
|
|
187
|
+
} else t30 = $[43];
|
|
188
|
+
let t31;
|
|
189
|
+
if ($[44] !== classNames?.close || $[45] !== classNames?.header || $[46] !== classNames?.title || $[47] !== closable || $[48] !== onClose || $[49] !== stylesProp?.close || $[50] !== stylesProp?.header || $[51] !== stylesProp?.title || $[52] !== title) {
|
|
190
|
+
t31 = (null != title || closable) && /*#__PURE__*/ jsxs("div", {
|
|
181
191
|
"data-tao-modal-header": "",
|
|
182
192
|
className: cx(classNames?.header),
|
|
183
193
|
style: stylesProp?.header,
|
|
@@ -204,125 +214,125 @@ function Modal(t0) {
|
|
|
204
214
|
})
|
|
205
215
|
]
|
|
206
216
|
});
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
} else
|
|
218
|
-
const
|
|
219
|
-
let
|
|
220
|
-
if ($[
|
|
221
|
-
|
|
222
|
-
$[51] = t31;
|
|
223
|
-
$[52] = t32;
|
|
224
|
-
} else t32 = $[52];
|
|
225
|
-
const t33 = stylesProp?.body;
|
|
226
|
-
let t34;
|
|
227
|
-
if ($[53] !== children || $[54] !== t32 || $[55] !== t33) {
|
|
228
|
-
t34 = /*#__PURE__*/ jsx("div", {
|
|
229
|
-
"data-tao-modal-body": "",
|
|
230
|
-
className: t32,
|
|
231
|
-
style: t33,
|
|
232
|
-
children: children
|
|
233
|
-
});
|
|
234
|
-
$[53] = children;
|
|
217
|
+
$[44] = classNames?.close;
|
|
218
|
+
$[45] = classNames?.header;
|
|
219
|
+
$[46] = classNames?.title;
|
|
220
|
+
$[47] = closable;
|
|
221
|
+
$[48] = onClose;
|
|
222
|
+
$[49] = stylesProp?.close;
|
|
223
|
+
$[50] = stylesProp?.header;
|
|
224
|
+
$[51] = stylesProp?.title;
|
|
225
|
+
$[52] = title;
|
|
226
|
+
$[53] = t31;
|
|
227
|
+
} else t31 = $[53];
|
|
228
|
+
const t32 = classNames?.body;
|
|
229
|
+
let t33;
|
|
230
|
+
if ($[54] !== t32) {
|
|
231
|
+
t33 = cx(t32);
|
|
235
232
|
$[54] = t32;
|
|
236
233
|
$[55] = t33;
|
|
237
|
-
|
|
238
|
-
|
|
234
|
+
} else t33 = $[55];
|
|
235
|
+
const t34 = stylesProp?.body;
|
|
239
236
|
let t35;
|
|
240
|
-
if ($[
|
|
241
|
-
t35 =
|
|
237
|
+
if ($[56] !== children || $[57] !== t33 || $[58] !== t34) {
|
|
238
|
+
t35 = /*#__PURE__*/ jsx("div", {
|
|
239
|
+
"data-tao-modal-body": "",
|
|
240
|
+
className: t33,
|
|
241
|
+
style: t34,
|
|
242
|
+
children: children
|
|
243
|
+
});
|
|
244
|
+
$[56] = children;
|
|
245
|
+
$[57] = t33;
|
|
246
|
+
$[58] = t34;
|
|
247
|
+
$[59] = t35;
|
|
248
|
+
} else t35 = $[59];
|
|
249
|
+
let t36;
|
|
250
|
+
if ($[60] !== classNames?.footer || $[61] !== footerContent || $[62] !== stylesProp?.footer) {
|
|
251
|
+
t36 = null != footerContent && /*#__PURE__*/ jsx("div", {
|
|
242
252
|
"data-tao-modal-footer": "",
|
|
243
253
|
className: cx(classNames?.footer),
|
|
244
254
|
style: stylesProp?.footer,
|
|
245
255
|
children: footerContent
|
|
246
256
|
});
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
} else
|
|
252
|
-
let
|
|
253
|
-
if ($[
|
|
254
|
-
|
|
257
|
+
$[60] = classNames?.footer;
|
|
258
|
+
$[61] = footerContent;
|
|
259
|
+
$[62] = stylesProp?.footer;
|
|
260
|
+
$[63] = t36;
|
|
261
|
+
} else t36 = $[63];
|
|
262
|
+
let t37;
|
|
263
|
+
if ($[64] !== contentStyle || $[65] !== forceMount || $[66] !== t29 || $[67] !== t30 || $[68] !== t31 || $[69] !== t35 || $[70] !== t36) {
|
|
264
|
+
t37 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dialog_dabd8325.Content, {
|
|
255
265
|
forceMount: forceMount,
|
|
256
266
|
"data-tao-modal": "",
|
|
257
267
|
style: contentStyle,
|
|
258
|
-
className:
|
|
268
|
+
className: t29,
|
|
259
269
|
"aria-describedby": void 0,
|
|
260
|
-
onEscapeKeyDown:
|
|
270
|
+
onEscapeKeyDown: t30,
|
|
261
271
|
onPointerDownOutside: preventParentOutsideDismiss,
|
|
262
272
|
onInteractOutside: preventParentOutsideDismiss,
|
|
263
273
|
children: [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
274
|
+
t31,
|
|
275
|
+
t35,
|
|
276
|
+
t36
|
|
267
277
|
]
|
|
268
278
|
});
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else
|
|
278
|
-
let t37;
|
|
279
|
-
if ($[69] !== t25 || $[70] !== t26 || $[71] !== t36) {
|
|
280
|
-
t37 = /*#__PURE__*/ jsx("div", {
|
|
281
|
-
"data-tao-modal-wrap": "",
|
|
282
|
-
"data-tao-centered": t25,
|
|
283
|
-
"data-tao-open": t26,
|
|
284
|
-
children: t36
|
|
285
|
-
});
|
|
286
|
-
$[69] = t25;
|
|
287
|
-
$[70] = t26;
|
|
288
|
-
$[71] = t36;
|
|
289
|
-
$[72] = t37;
|
|
290
|
-
} else t37 = $[72];
|
|
279
|
+
$[64] = contentStyle;
|
|
280
|
+
$[65] = forceMount;
|
|
281
|
+
$[66] = t29;
|
|
282
|
+
$[67] = t30;
|
|
283
|
+
$[68] = t31;
|
|
284
|
+
$[69] = t35;
|
|
285
|
+
$[70] = t36;
|
|
286
|
+
$[71] = t37;
|
|
287
|
+
} else t37 = $[71];
|
|
291
288
|
let t38;
|
|
292
|
-
if ($[73] !==
|
|
293
|
-
t38 = /*#__PURE__*/
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
289
|
+
if ($[72] !== t26 || $[73] !== t27 || $[74] !== t37) {
|
|
290
|
+
t38 = /*#__PURE__*/ jsx("div", {
|
|
291
|
+
"data-tao-modal-wrap": "",
|
|
292
|
+
"data-tao-centered": t26,
|
|
293
|
+
"data-tao-open": t27,
|
|
294
|
+
children: t37
|
|
298
295
|
});
|
|
299
|
-
$[
|
|
296
|
+
$[72] = t26;
|
|
297
|
+
$[73] = t27;
|
|
300
298
|
$[74] = t37;
|
|
301
299
|
$[75] = t38;
|
|
302
300
|
} else t38 = $[75];
|
|
303
301
|
let t39;
|
|
304
|
-
if ($[76] !==
|
|
305
|
-
t39 = /*#__PURE__*/
|
|
306
|
-
|
|
307
|
-
|
|
302
|
+
if ($[76] !== t25 || $[77] !== t38) {
|
|
303
|
+
t39 = /*#__PURE__*/ jsxs(TaoPortalScope, {
|
|
304
|
+
children: [
|
|
305
|
+
t25,
|
|
306
|
+
t38
|
|
307
|
+
]
|
|
308
308
|
});
|
|
309
|
-
$[76] =
|
|
309
|
+
$[76] = t25;
|
|
310
310
|
$[77] = t38;
|
|
311
311
|
$[78] = t39;
|
|
312
312
|
} else t39 = $[78];
|
|
313
313
|
let t40;
|
|
314
|
-
if ($[79] !==
|
|
315
|
-
t40 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.
|
|
316
|
-
|
|
317
|
-
onOpenChange: t19,
|
|
314
|
+
if ($[79] !== forceMount || $[80] !== t39) {
|
|
315
|
+
t40 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
|
|
316
|
+
forceMount: forceMount,
|
|
318
317
|
children: t39
|
|
319
318
|
});
|
|
320
|
-
$[79] =
|
|
321
|
-
$[80] =
|
|
322
|
-
$[81] =
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
319
|
+
$[79] = forceMount;
|
|
320
|
+
$[80] = t39;
|
|
321
|
+
$[81] = t40;
|
|
322
|
+
} else t40 = $[81];
|
|
323
|
+
let t41;
|
|
324
|
+
if ($[82] !== open || $[83] !== t20 || $[84] !== t40) {
|
|
325
|
+
t41 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
|
|
326
|
+
open: open,
|
|
327
|
+
onOpenChange: t20,
|
|
328
|
+
children: t40
|
|
329
|
+
});
|
|
330
|
+
$[82] = open;
|
|
331
|
+
$[83] = t20;
|
|
332
|
+
$[84] = t40;
|
|
333
|
+
$[85] = t41;
|
|
334
|
+
} else t41 = $[85];
|
|
335
|
+
return t41;
|
|
326
336
|
}
|
|
327
337
|
function CloseIcon() {
|
|
328
338
|
const $ = c(1);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[data-tao-popconfirm] {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
max-width: 260px;
|
|
4
|
+
font-family: var(--tao-font-family);
|
|
5
|
+
font-size: var(--tao-font-size-base);
|
|
6
|
+
line-height: var(--tao-line-height);
|
|
7
|
+
color: var(--tao-color-text);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-tao-popconfirm-message] {
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
gap: var(--tao-padding-xs);
|
|
13
|
+
display: flex;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-tao-popconfirm-icon] {
|
|
17
|
+
color: var(--tao-warning);
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
margin-block-start: 2px;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-tao-popconfirm-text] {
|
|
24
|
+
flex: 1;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-tao-popconfirm-title] {
|
|
29
|
+
font-weight: var(--tao-font-weight-strong);
|
|
30
|
+
color: var(--tao-color-text);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-tao-popconfirm-description] {
|
|
34
|
+
color: var(--tao-color-text-secondary);
|
|
35
|
+
margin-block-start: var(--tao-padding-xs);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-tao-popconfirm-footer] {
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
gap: var(--tao-padding-xs);
|
|
41
|
+
margin-block-start: var(--tao-padding-sm);
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
|
+
import { type ButtonProps } from '../button/button';
|
|
4
|
+
import { type PopoverPlacement } from '../popover/popover';
|
|
5
|
+
import './popconfirm.css';
|
|
6
|
+
export type PopconfirmSemanticPart = 'content' | 'title' | 'description' | 'footer' | 'icon';
|
|
7
|
+
export interface PopconfirmProps {
|
|
8
|
+
/** Main question text of the confirm popup (required, antd parity). */
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** Secondary text shown under the title. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** Called when OK is clicked; the popup also closes. */
|
|
13
|
+
onConfirm?: (e?: MouseEvent<HTMLElement>) => void;
|
|
14
|
+
/** Called when Cancel is clicked; the popup also closes. */
|
|
15
|
+
onCancel?: (e?: MouseEvent<HTMLElement>) => void;
|
|
16
|
+
/** Text of the OK button. Defaults to `'OK'`. */
|
|
17
|
+
okText?: ReactNode;
|
|
18
|
+
/** Text of the Cancel button. Defaults to `'Cancel'`. */
|
|
19
|
+
cancelText?: ReactNode;
|
|
20
|
+
/** Extra props forwarded to the OK button. */
|
|
21
|
+
okButtonProps?: ButtonProps;
|
|
22
|
+
/** Extra props forwarded to the Cancel button. */
|
|
23
|
+
cancelButtonProps?: ButtonProps;
|
|
24
|
+
/** Icon shown before the title. Defaults to a warning triangle; pass `null` to hide it. */
|
|
25
|
+
icon?: ReactNode | null;
|
|
26
|
+
/** When true, the trigger still renders but the popup never opens. */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
open?: boolean;
|
|
29
|
+
defaultOpen?: boolean;
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
/** Popup side relative to the trigger. Defaults to `'top'`. */
|
|
32
|
+
placement?: PopoverPlacement;
|
|
33
|
+
/** Merged onto the confirm content wrapper. */
|
|
34
|
+
className?: string;
|
|
35
|
+
style?: CSSProperties;
|
|
36
|
+
classNames?: SemanticClassNames<PopconfirmSemanticPart>;
|
|
37
|
+
styles?: SemanticStyles<PopconfirmSemanticPart>;
|
|
38
|
+
/** Exactly one trigger element. */
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare function Popconfirm({ title, description, onConfirm, onCancel, okText, cancelText, okButtonProps, cancelButtonProps, icon, disabled, open, defaultOpen, onOpenChange, placement, className, style, classNames, styles, children, }: PopconfirmProps): import("react/jsx-runtime").JSX.Element;
|