@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
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import * as __rspack_external__radix_ui_react_popover_c8444160 from "@radix-ui/react-popover";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
import { TaoPortalScope } from "../../provider/tao-provider.js";
|
|
6
|
+
import { asTriggerChild, useControlledOpen } from "../../utils/overlay.js";
|
|
7
|
+
import { cx } from "../../utils/semantic.js";
|
|
8
|
+
import "./popover.css";
|
|
9
|
+
const placements = {
|
|
10
|
+
top: {
|
|
11
|
+
side: 'top',
|
|
12
|
+
align: 'center'
|
|
13
|
+
},
|
|
14
|
+
topLeft: {
|
|
15
|
+
side: 'top',
|
|
16
|
+
align: 'start'
|
|
17
|
+
},
|
|
18
|
+
topRight: {
|
|
19
|
+
side: 'top',
|
|
20
|
+
align: 'end'
|
|
21
|
+
},
|
|
22
|
+
bottom: {
|
|
23
|
+
side: 'bottom',
|
|
24
|
+
align: 'center'
|
|
25
|
+
},
|
|
26
|
+
bottomLeft: {
|
|
27
|
+
side: 'bottom',
|
|
28
|
+
align: 'start'
|
|
29
|
+
},
|
|
30
|
+
bottomRight: {
|
|
31
|
+
side: 'bottom',
|
|
32
|
+
align: 'end'
|
|
33
|
+
},
|
|
34
|
+
left: {
|
|
35
|
+
side: 'left',
|
|
36
|
+
align: 'center'
|
|
37
|
+
},
|
|
38
|
+
leftTop: {
|
|
39
|
+
side: 'left',
|
|
40
|
+
align: 'start'
|
|
41
|
+
},
|
|
42
|
+
leftBottom: {
|
|
43
|
+
side: 'left',
|
|
44
|
+
align: 'end'
|
|
45
|
+
},
|
|
46
|
+
right: {
|
|
47
|
+
side: 'right',
|
|
48
|
+
align: 'center'
|
|
49
|
+
},
|
|
50
|
+
rightTop: {
|
|
51
|
+
side: 'right',
|
|
52
|
+
align: 'start'
|
|
53
|
+
},
|
|
54
|
+
rightBottom: {
|
|
55
|
+
side: 'right',
|
|
56
|
+
align: 'end'
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function getRenderNode(node) {
|
|
60
|
+
return 'function' == typeof node ? node() : node;
|
|
61
|
+
}
|
|
62
|
+
function isRenderable(node) {
|
|
63
|
+
return null != node && false !== node && '' !== node;
|
|
64
|
+
}
|
|
65
|
+
function Popover(t0) {
|
|
66
|
+
const $ = c(86);
|
|
67
|
+
const { title, content, trigger: t1, placement: t2, open, defaultOpen, onOpenChange, mouseEnterDelay: t3, mouseLeaveDelay: t4, arrow: t5, destroyOnHidden, destroyTooltipOnHide, className, style, classNames, styles, children } = t0;
|
|
68
|
+
const trigger = void 0 === t1 ? "hover" : t1;
|
|
69
|
+
const placement = void 0 === t2 ? "top" : t2;
|
|
70
|
+
const mouseEnterDelay = void 0 === t3 ? 0.1 : t3;
|
|
71
|
+
const mouseLeaveDelay = void 0 === t4 ? 0.1 : t4;
|
|
72
|
+
const arrow = void 0 === t5 ? true : t5;
|
|
73
|
+
let t6;
|
|
74
|
+
if ($[0] !== trigger) {
|
|
75
|
+
t6 = Array.isArray(trigger) ? trigger : [
|
|
76
|
+
trigger
|
|
77
|
+
];
|
|
78
|
+
$[0] = trigger;
|
|
79
|
+
$[1] = t6;
|
|
80
|
+
} else t6 = $[1];
|
|
81
|
+
let t7;
|
|
82
|
+
if ($[2] !== t6) {
|
|
83
|
+
t7 = new Set(t6);
|
|
84
|
+
$[2] = t6;
|
|
85
|
+
$[3] = t7;
|
|
86
|
+
} else t7 = $[3];
|
|
87
|
+
const triggers = t7;
|
|
88
|
+
const hoverMode = triggers.has("hover");
|
|
89
|
+
const focusMode = triggers.has("focus");
|
|
90
|
+
const clickMode = triggers.has("click");
|
|
91
|
+
const contextMenuMode = triggers.has("contextMenu");
|
|
92
|
+
const shouldDestroy = destroyOnHidden ?? destroyTooltipOnHide ?? false;
|
|
93
|
+
const placementProps = placements[placement];
|
|
94
|
+
const TriggerPrimitive = clickMode ? __rspack_external__radix_ui_react_popover_c8444160.Trigger : __rspack_external__radix_ui_react_popover_c8444160.Anchor;
|
|
95
|
+
const titleNode = getRenderNode(title);
|
|
96
|
+
const contentNode = getRenderNode(content);
|
|
97
|
+
const hasPopup = isRenderable(titleNode) || isRenderable(contentNode);
|
|
98
|
+
const [realOpen, setOpen] = useControlledOpen({
|
|
99
|
+
open,
|
|
100
|
+
defaultOpen,
|
|
101
|
+
onOpenChange,
|
|
102
|
+
canOpen: hasPopup
|
|
103
|
+
});
|
|
104
|
+
const openTimer = useRef(void 0);
|
|
105
|
+
const closeTimer = useRef(void 0);
|
|
106
|
+
const popupRef = useRef(null);
|
|
107
|
+
let t8;
|
|
108
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
109
|
+
t8 = ()=>{
|
|
110
|
+
clearTimeout(openTimer.current);
|
|
111
|
+
clearTimeout(closeTimer.current);
|
|
112
|
+
};
|
|
113
|
+
$[4] = t8;
|
|
114
|
+
} else t8 = $[4];
|
|
115
|
+
const cancelTimers = t8;
|
|
116
|
+
let t10;
|
|
117
|
+
let t9;
|
|
118
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
119
|
+
t9 = ()=>cancelTimers;
|
|
120
|
+
t10 = [
|
|
121
|
+
cancelTimers
|
|
122
|
+
];
|
|
123
|
+
$[5] = t10;
|
|
124
|
+
$[6] = t9;
|
|
125
|
+
} else {
|
|
126
|
+
t10 = $[5];
|
|
127
|
+
t9 = $[6];
|
|
128
|
+
}
|
|
129
|
+
useEffect(t9, t10);
|
|
130
|
+
let t11;
|
|
131
|
+
if ($[7] !== mouseEnterDelay || $[8] !== setOpen) {
|
|
132
|
+
t11 = ()=>{
|
|
133
|
+
cancelTimers();
|
|
134
|
+
if (mouseEnterDelay <= 0) return void setOpen(true);
|
|
135
|
+
openTimer.current = setTimeout(()=>setOpen(true), 1000 * mouseEnterDelay);
|
|
136
|
+
};
|
|
137
|
+
$[7] = mouseEnterDelay;
|
|
138
|
+
$[8] = setOpen;
|
|
139
|
+
$[9] = t11;
|
|
140
|
+
} else t11 = $[9];
|
|
141
|
+
const scheduleOpen = t11;
|
|
142
|
+
let t12;
|
|
143
|
+
if ($[10] !== mouseLeaveDelay || $[11] !== setOpen) {
|
|
144
|
+
t12 = ()=>{
|
|
145
|
+
cancelTimers();
|
|
146
|
+
if (mouseLeaveDelay <= 0) return void setOpen(false);
|
|
147
|
+
closeTimer.current = setTimeout(()=>setOpen(false), 1000 * mouseLeaveDelay);
|
|
148
|
+
};
|
|
149
|
+
$[10] = mouseLeaveDelay;
|
|
150
|
+
$[11] = setOpen;
|
|
151
|
+
$[12] = t12;
|
|
152
|
+
} else t12 = $[12];
|
|
153
|
+
const scheduleClose = t12;
|
|
154
|
+
let t13;
|
|
155
|
+
if ($[13] !== focusMode || $[14] !== setOpen) {
|
|
156
|
+
t13 = (event)=>{
|
|
157
|
+
if (focusMode && !popupRef.current?.contains(event.relatedTarget)) setOpen(false);
|
|
158
|
+
};
|
|
159
|
+
$[13] = focusMode;
|
|
160
|
+
$[14] = setOpen;
|
|
161
|
+
$[15] = t13;
|
|
162
|
+
} else t13 = $[15];
|
|
163
|
+
const handleTriggerBlur = t13;
|
|
164
|
+
let t14;
|
|
165
|
+
if ($[16] !== focusMode || $[17] !== setOpen) {
|
|
166
|
+
t14 = (event_0)=>{
|
|
167
|
+
if (focusMode && !event_0.currentTarget.contains(event_0.relatedTarget)) setOpen(false);
|
|
168
|
+
};
|
|
169
|
+
$[16] = focusMode;
|
|
170
|
+
$[17] = setOpen;
|
|
171
|
+
$[18] = t14;
|
|
172
|
+
} else t14 = $[18];
|
|
173
|
+
const handleContentBlur = t14;
|
|
174
|
+
if (!hasPopup) {
|
|
175
|
+
let t15;
|
|
176
|
+
if ($[19] !== children) {
|
|
177
|
+
t15 = /*#__PURE__*/ jsx(Fragment, {
|
|
178
|
+
children: children
|
|
179
|
+
});
|
|
180
|
+
$[19] = children;
|
|
181
|
+
$[20] = t15;
|
|
182
|
+
} else t15 = $[20];
|
|
183
|
+
return t15;
|
|
184
|
+
}
|
|
185
|
+
let t15;
|
|
186
|
+
if ($[21] !== hoverMode || $[22] !== scheduleClose || $[23] !== scheduleOpen) {
|
|
187
|
+
t15 = hoverMode ? {
|
|
188
|
+
onPointerEnter: scheduleOpen,
|
|
189
|
+
onPointerLeave: scheduleClose
|
|
190
|
+
} : void 0;
|
|
191
|
+
$[21] = hoverMode;
|
|
192
|
+
$[22] = scheduleClose;
|
|
193
|
+
$[23] = scheduleOpen;
|
|
194
|
+
$[24] = t15;
|
|
195
|
+
} else t15 = $[24];
|
|
196
|
+
const hoverProps = t15;
|
|
197
|
+
let t16;
|
|
198
|
+
if ($[25] !== focusMode || $[26] !== setOpen) {
|
|
199
|
+
t16 = focusMode ? ()=>setOpen(true) : void 0;
|
|
200
|
+
$[25] = focusMode;
|
|
201
|
+
$[26] = setOpen;
|
|
202
|
+
$[27] = t16;
|
|
203
|
+
} else t16 = $[27];
|
|
204
|
+
const t17 = focusMode ? handleTriggerBlur : void 0;
|
|
205
|
+
let t18;
|
|
206
|
+
if ($[28] !== contextMenuMode || $[29] !== setOpen) {
|
|
207
|
+
t18 = contextMenuMode ? (event_1)=>{
|
|
208
|
+
event_1.preventDefault();
|
|
209
|
+
setOpen(true);
|
|
210
|
+
} : void 0;
|
|
211
|
+
$[28] = contextMenuMode;
|
|
212
|
+
$[29] = setOpen;
|
|
213
|
+
$[30] = t18;
|
|
214
|
+
} else t18 = $[30];
|
|
215
|
+
let t19;
|
|
216
|
+
if ($[31] !== hoverProps || $[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
|
|
217
|
+
t19 = {
|
|
218
|
+
...hoverProps,
|
|
219
|
+
onFocus: t16,
|
|
220
|
+
onBlur: t17,
|
|
221
|
+
onContextMenu: t18
|
|
222
|
+
};
|
|
223
|
+
$[31] = hoverProps;
|
|
224
|
+
$[32] = t16;
|
|
225
|
+
$[33] = t17;
|
|
226
|
+
$[34] = t18;
|
|
227
|
+
$[35] = t19;
|
|
228
|
+
} else t19 = $[35];
|
|
229
|
+
const triggerProps = t19;
|
|
230
|
+
const t20 = __rspack_external__radix_ui_react_popover_c8444160;
|
|
231
|
+
let t21;
|
|
232
|
+
if ($[36] !== children) {
|
|
233
|
+
t21 = asTriggerChild(children);
|
|
234
|
+
$[36] = children;
|
|
235
|
+
$[37] = t21;
|
|
236
|
+
} else t21 = $[37];
|
|
237
|
+
let t22;
|
|
238
|
+
if ($[38] !== TriggerPrimitive || $[39] !== t21 || $[40] !== triggerProps) {
|
|
239
|
+
t22 = /*#__PURE__*/ jsx(TriggerPrimitive, {
|
|
240
|
+
asChild: true,
|
|
241
|
+
...triggerProps,
|
|
242
|
+
children: t21
|
|
243
|
+
});
|
|
244
|
+
$[38] = TriggerPrimitive;
|
|
245
|
+
$[39] = t21;
|
|
246
|
+
$[40] = triggerProps;
|
|
247
|
+
$[41] = t22;
|
|
248
|
+
} else t22 = $[41];
|
|
249
|
+
const t23 = __rspack_external__radix_ui_react_popover_c8444160;
|
|
250
|
+
const t24 = shouldDestroy ? void 0 : true;
|
|
251
|
+
const T0 = TaoPortalScope;
|
|
252
|
+
const t25 = true;
|
|
253
|
+
const t26 = __rspack_external__radix_ui_react_popover_c8444160;
|
|
254
|
+
const t27 = "";
|
|
255
|
+
const t28 = !shouldDestroy || void 0;
|
|
256
|
+
const t29 = classNames?.root;
|
|
257
|
+
let t30;
|
|
258
|
+
if ($[42] !== className || $[43] !== t29) {
|
|
259
|
+
t30 = cx(t29, className);
|
|
260
|
+
$[42] = className;
|
|
261
|
+
$[43] = t29;
|
|
262
|
+
$[44] = t30;
|
|
263
|
+
} else t30 = $[44];
|
|
264
|
+
const t31 = styles?.root;
|
|
265
|
+
let t32;
|
|
266
|
+
if ($[45] !== style || $[46] !== t31) {
|
|
267
|
+
t32 = {
|
|
268
|
+
...t31,
|
|
269
|
+
...style
|
|
270
|
+
};
|
|
271
|
+
$[45] = style;
|
|
272
|
+
$[46] = t31;
|
|
273
|
+
$[47] = t32;
|
|
274
|
+
} else t32 = $[47];
|
|
275
|
+
const t33 = 4;
|
|
276
|
+
const t34 = shouldDestroy ? void 0 : true;
|
|
277
|
+
const t35 = _temp;
|
|
278
|
+
const t36 = focusMode ? cancelTimers : void 0;
|
|
279
|
+
const t37 = focusMode ? handleContentBlur : void 0;
|
|
280
|
+
const t38 = "";
|
|
281
|
+
const t39 = classNames?.container;
|
|
282
|
+
let t40;
|
|
283
|
+
if ($[48] !== t39) {
|
|
284
|
+
t40 = cx(t39);
|
|
285
|
+
$[48] = t39;
|
|
286
|
+
$[49] = t40;
|
|
287
|
+
} else t40 = $[49];
|
|
288
|
+
const t41 = styles?.container;
|
|
289
|
+
const t42 = isRenderable(titleNode) && /*#__PURE__*/ jsx("div", {
|
|
290
|
+
"data-tao-popover-title": "",
|
|
291
|
+
className: cx(classNames?.title),
|
|
292
|
+
style: styles?.title,
|
|
293
|
+
children: titleNode
|
|
294
|
+
});
|
|
295
|
+
const t43 = isRenderable(contentNode) && /*#__PURE__*/ jsx("div", {
|
|
296
|
+
"data-tao-popover-content": "",
|
|
297
|
+
className: cx(classNames?.content),
|
|
298
|
+
style: styles?.content,
|
|
299
|
+
children: contentNode
|
|
300
|
+
});
|
|
301
|
+
let t44;
|
|
302
|
+
if ($[50] !== t40 || $[51] !== t41 || $[52] !== t42 || $[53] !== t43) {
|
|
303
|
+
t44 = /*#__PURE__*/ jsxs("div", {
|
|
304
|
+
"data-tao-popover-container": t38,
|
|
305
|
+
className: t40,
|
|
306
|
+
style: t41,
|
|
307
|
+
children: [
|
|
308
|
+
t42,
|
|
309
|
+
t43
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
$[50] = t40;
|
|
313
|
+
$[51] = t41;
|
|
314
|
+
$[52] = t42;
|
|
315
|
+
$[53] = t43;
|
|
316
|
+
$[54] = t44;
|
|
317
|
+
} else t44 = $[54];
|
|
318
|
+
let t45;
|
|
319
|
+
if ($[55] !== arrow || $[56] !== classNames?.arrow || $[57] !== styles?.arrow) {
|
|
320
|
+
t45 = false !== arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Arrow, {
|
|
321
|
+
asChild: true,
|
|
322
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
323
|
+
"data-tao-popover-arrow": "",
|
|
324
|
+
className: cx(classNames?.arrow),
|
|
325
|
+
style: styles?.arrow
|
|
326
|
+
})
|
|
327
|
+
});
|
|
328
|
+
$[55] = arrow;
|
|
329
|
+
$[56] = classNames?.arrow;
|
|
330
|
+
$[57] = styles?.arrow;
|
|
331
|
+
$[58] = t45;
|
|
332
|
+
} else t45 = $[58];
|
|
333
|
+
let t46;
|
|
334
|
+
if ($[59] !== hoverProps || $[60] !== placement || $[61] !== placementProps || $[62] !== t26.Content || $[63] !== t28 || $[64] !== t30 || $[65] !== t32 || $[66] !== t34 || $[67] !== t35 || $[68] !== t36 || $[69] !== t37 || $[70] !== t44 || $[71] !== t45) {
|
|
335
|
+
t46 = /*#__PURE__*/ jsxs(t26.Content, {
|
|
336
|
+
ref: popupRef,
|
|
337
|
+
"data-tao-popover": t27,
|
|
338
|
+
"data-tao-placement": placement,
|
|
339
|
+
"data-tao-keep-alive": t28,
|
|
340
|
+
className: t30,
|
|
341
|
+
style: t32,
|
|
342
|
+
...placementProps,
|
|
343
|
+
sideOffset: t33,
|
|
344
|
+
forceMount: t34,
|
|
345
|
+
onOpenAutoFocus: t35,
|
|
346
|
+
onFocusCapture: t36,
|
|
347
|
+
onBlurCapture: t37,
|
|
348
|
+
...hoverProps,
|
|
349
|
+
children: [
|
|
350
|
+
t44,
|
|
351
|
+
t45
|
|
352
|
+
]
|
|
353
|
+
});
|
|
354
|
+
$[59] = hoverProps;
|
|
355
|
+
$[60] = placement;
|
|
356
|
+
$[61] = placementProps;
|
|
357
|
+
$[62] = t26.Content;
|
|
358
|
+
$[63] = t28;
|
|
359
|
+
$[64] = t30;
|
|
360
|
+
$[65] = t32;
|
|
361
|
+
$[66] = t34;
|
|
362
|
+
$[67] = t35;
|
|
363
|
+
$[68] = t36;
|
|
364
|
+
$[69] = t37;
|
|
365
|
+
$[70] = t44;
|
|
366
|
+
$[71] = t45;
|
|
367
|
+
$[72] = t46;
|
|
368
|
+
} else t46 = $[72];
|
|
369
|
+
let t47;
|
|
370
|
+
if ($[73] !== T0 || $[74] !== t46) {
|
|
371
|
+
t47 = /*#__PURE__*/ jsx(T0, {
|
|
372
|
+
asChild: t25,
|
|
373
|
+
children: t46
|
|
374
|
+
});
|
|
375
|
+
$[73] = T0;
|
|
376
|
+
$[74] = t46;
|
|
377
|
+
$[75] = t47;
|
|
378
|
+
} else t47 = $[75];
|
|
379
|
+
let t48;
|
|
380
|
+
if ($[76] !== t23.Portal || $[77] !== t24 || $[78] !== t47) {
|
|
381
|
+
t48 = /*#__PURE__*/ jsx(t23.Portal, {
|
|
382
|
+
forceMount: t24,
|
|
383
|
+
children: t47
|
|
384
|
+
});
|
|
385
|
+
$[76] = t23.Portal;
|
|
386
|
+
$[77] = t24;
|
|
387
|
+
$[78] = t47;
|
|
388
|
+
$[79] = t48;
|
|
389
|
+
} else t48 = $[79];
|
|
390
|
+
let t49;
|
|
391
|
+
if ($[80] !== realOpen || $[81] !== setOpen || $[82] !== t20.Root || $[83] !== t22 || $[84] !== t48) {
|
|
392
|
+
t49 = /*#__PURE__*/ jsxs(t20.Root, {
|
|
393
|
+
open: realOpen,
|
|
394
|
+
onOpenChange: setOpen,
|
|
395
|
+
children: [
|
|
396
|
+
t22,
|
|
397
|
+
t48
|
|
398
|
+
]
|
|
399
|
+
});
|
|
400
|
+
$[80] = realOpen;
|
|
401
|
+
$[81] = setOpen;
|
|
402
|
+
$[82] = t20.Root;
|
|
403
|
+
$[83] = t22;
|
|
404
|
+
$[84] = t48;
|
|
405
|
+
$[85] = t49;
|
|
406
|
+
} else t49 = $[85];
|
|
407
|
+
return t49;
|
|
408
|
+
}
|
|
409
|
+
function _temp(event_2) {
|
|
410
|
+
return event_2.preventDefault();
|
|
411
|
+
}
|
|
412
|
+
export { Popover };
|
|
@@ -8,7 +8,7 @@ import { defaultFilter, filterTree, flattenOptions } from "./select-model.js";
|
|
|
8
8
|
import { SearchableSelectList } from "./select-searchable-list.js";
|
|
9
9
|
import { SelectTags } from "./select-tags.js";
|
|
10
10
|
import "./select.css";
|
|
11
|
-
import { useIsMobile } from "
|
|
11
|
+
import { useIsMobile } from "../../utils/breakpoint.js";
|
|
12
12
|
import * as __rspack_external__radix_ui_react_popover_c8444160 from "@radix-ui/react-popover";
|
|
13
13
|
import * as __rspack_external__radix_ui_react_select_4606f4d3 from "@radix-ui/react-select";
|
|
14
14
|
const PLACEMENT_MAP = {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
const STATUS_PATHS = {
|
|
4
|
+
success: /*#__PURE__*/ jsxs(Fragment, {
|
|
5
|
+
children: [
|
|
6
|
+
/*#__PURE__*/ jsx("circle", {
|
|
7
|
+
cx: "12",
|
|
8
|
+
cy: "12",
|
|
9
|
+
r: "9"
|
|
10
|
+
}),
|
|
11
|
+
/*#__PURE__*/ jsx("path", {
|
|
12
|
+
d: "m8.5 12 2.5 2.5 4.5-5"
|
|
13
|
+
})
|
|
14
|
+
]
|
|
15
|
+
}),
|
|
16
|
+
info: /*#__PURE__*/ jsxs(Fragment, {
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ jsx("circle", {
|
|
19
|
+
cx: "12",
|
|
20
|
+
cy: "12",
|
|
21
|
+
r: "9"
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx("path", {
|
|
24
|
+
d: "M12 16v-4M12 8h.01"
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
}),
|
|
28
|
+
warning: /*#__PURE__*/ jsxs(Fragment, {
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ jsx("path", {
|
|
31
|
+
d: "M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsx("path", {
|
|
34
|
+
d: "M12 9v4M12 17h.01"
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
error: /*#__PURE__*/ jsxs(Fragment, {
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ jsx("circle", {
|
|
41
|
+
cx: "12",
|
|
42
|
+
cy: "12",
|
|
43
|
+
r: "9"
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ jsx("path", {
|
|
46
|
+
d: "M15 9 9 15M9 9l6 6"
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
function StatusIcon(t0) {
|
|
52
|
+
const $ = c(3);
|
|
53
|
+
const { type, size: t1 } = t0;
|
|
54
|
+
const size = void 0 === t1 ? "1em" : t1;
|
|
55
|
+
const t2 = STATUS_PATHS[type];
|
|
56
|
+
let t3;
|
|
57
|
+
if ($[0] !== size || $[1] !== t2) {
|
|
58
|
+
t3 = /*#__PURE__*/ jsx("svg", {
|
|
59
|
+
width: size,
|
|
60
|
+
height: size,
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeWidth: 2,
|
|
65
|
+
strokeLinecap: "round",
|
|
66
|
+
strokeLinejoin: "round",
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
focusable: "false",
|
|
69
|
+
children: t2
|
|
70
|
+
});
|
|
71
|
+
$[0] = size;
|
|
72
|
+
$[1] = t2;
|
|
73
|
+
$[2] = t3;
|
|
74
|
+
} else t3 = $[2];
|
|
75
|
+
return t3;
|
|
76
|
+
}
|
|
77
|
+
export { StatusIcon };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, HTMLAttributes, Key, ReactNode, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
2
|
import type { TaoSize, TaoVariant } from '../../provider/tao-provider';
|
|
3
|
+
import type { TaoBreakpoint } from '../../utils/breakpoint';
|
|
3
4
|
import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic';
|
|
4
5
|
export type TableRecord = object;
|
|
5
6
|
export type TableSemanticPart = 'root' | 'scroll' | 'table' | 'header.wrapper' | 'header.row' | 'header.cell' | 'header.content' | 'header.title' | 'body.row' | 'body.cell' | 'selection.cell' | 'empty' | 'pagination';
|
|
@@ -26,6 +27,12 @@ export interface TableColumn<T extends TableRecord = Record<string, unknown>> {
|
|
|
26
27
|
filters?: TableFilterItem[];
|
|
27
28
|
onFilter?: (value: string, record: T) => boolean;
|
|
28
29
|
filteredValue?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Show this column only when at least one listed breakpoint matches the
|
|
32
|
+
* current viewport (antd `ColumnType.responsive` semantics), e.g.
|
|
33
|
+
* `responsive: ['lg']` hides the column on small screens.
|
|
34
|
+
*/
|
|
35
|
+
responsive?: TaoBreakpoint[];
|
|
29
36
|
}
|
|
30
37
|
export interface TableRowSelection<T extends TableRecord = Record<string, unknown>> {
|
|
31
38
|
type?: 'checkbox' | 'radio';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TableProps, TableRecord } from './table-types';
|
|
2
2
|
import './table.css';
|
|
3
3
|
export type { SorterResult, SortOrder, TableColumn, TableFilterItem, TablePagination, TableProps, TableRowSelection, TableSemanticClassNames, TableSemanticInfo, TableSemanticPart, TableSemanticStyles, TableVariant, } from './table-types';
|
|
4
|
-
export declare function Table<T extends TableRecord = Record<string, unknown>>({ columns, dataSource, rowKey, loading, pagination: paginationProp, onChange, scroll, rowSelection, size, variant, headerBackground, emptyText, bordered, className, style, classNames, styles, rowClassName, rowStyle, onRow, onHeaderRow, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function Table<T extends TableRecord = Record<string, unknown>>({ columns: columnsProp, dataSource, rowKey, loading, pagination: paginationProp, onChange, scroll, rowSelection, size, variant, headerBackground, emptyText, bordered, className, style, classNames, styles, rowClassName, rowStyle, onRow, onHeaderRow, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|