@rockshin/tao-ui 0.0.48 → 0.0.49
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/components/affix/affix.js +20 -16
- package/dist/components/alert/alert.js +114 -99
- package/dist/components/app/app-modals.js +134 -96
- package/dist/components/app/app-notices.js +39 -23
- package/dist/components/auto-complete/auto-complete.js +21 -7
- package/dist/components/avatar/avatar.js +31 -11
- package/dist/components/badge/badge.css +1 -1
- package/dist/components/badge/badge.js +72 -257
- package/dist/components/border-beam/border-beam.js +21 -17
- package/dist/components/breadcrumb/breadcrumb.js +178 -159
- package/dist/components/button/button.js +61 -53
- package/dist/components/calendar/calendar.js +6 -4
- package/dist/components/card/card.js +24 -8
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/carousel.js +105 -68
- package/dist/components/cascader/cascader.js +54 -19
- package/dist/components/checkbox/checkbox.css +13 -2
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.js +320 -229
- package/dist/components/collapse/collapse-panels.d.ts +1 -1
- package/dist/components/collapse/collapse-panels.js +122 -113
- package/dist/components/collapse/collapse.js +98 -63
- package/dist/components/color-picker/color-picker.js +539 -441
- package/dist/components/color-picker/color.js +1 -1
- package/dist/components/context-menu/context-menu.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +108 -68
- package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
- package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/month-grid.js +79 -37
- package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
- package/dist/components/date-picker/calendar/time-panel.js +94 -89
- package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/year-grid.js +66 -35
- package/dist/components/date-picker/date-picker.css +24 -1
- package/dist/components/date-picker/date-picker.js +99 -53
- package/dist/components/date-picker/presets.d.ts +2 -1
- package/dist/components/date-picker/presets.js +27 -24
- package/dist/components/date-picker/range-picker.js +308 -153
- package/dist/components/descriptions/descriptions.js +7 -3
- package/dist/components/divider/divider.css +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.js +201 -369
- package/dist/components/dropdown/dropdown.d.ts +1 -1
- package/dist/components/dropdown/dropdown.js +183 -279
- package/dist/components/empty/empty.js +57 -78
- package/dist/components/float-button/float-button.d.ts +1 -0
- package/dist/components/float-button/float-button.js +47 -30
- package/dist/components/form/field-control.d.ts +4 -2
- package/dist/components/form/field-control.js +17 -9
- package/dist/components/form/form-context.d.ts +8 -2
- package/dist/components/form/form-context.js +2 -1
- package/dist/components/form/form-item.js +85 -63
- package/dist/components/form/use-form.d.ts +2 -1
- package/dist/components/form/use-form.js +2 -1
- package/dist/components/form-field/form-field-view.d.ts +3 -1
- package/dist/components/form-field/form-field-view.js +194 -141
- package/dist/components/form-section/form-section.d.ts +1 -1
- package/dist/components/form-section/form-section.js +52 -45
- package/dist/components/image/image.js +585 -477
- package/dist/components/input/base-input.js +8 -9
- package/dist/components/input/input-shared.d.ts +5 -2
- package/dist/components/input/input-shared.js +42 -18
- package/dist/components/input/otp.js +236 -217
- package/dist/components/input/password.js +2 -1
- package/dist/components/input/search.js +8 -7
- package/dist/components/list/list-pagination.js +41 -36
- package/dist/components/list/list.js +141 -125
- package/dist/components/listy/listy.js +175 -106
- package/dist/components/masonry/masonry.js +108 -85
- package/dist/components/mentions/mentions.js +12 -3
- package/dist/components/menu/menu-render.d.ts +9 -3
- package/dist/components/menu/menu-render.js +99 -36
- package/dist/components/modal/confirm-dialog.js +10 -4
- package/dist/components/modal/confirm.js +3 -7
- package/dist/components/modal/index.js +9 -3
- package/dist/components/modal/modal.js +390 -365
- package/dist/components/pagination/pagination.js +105 -96
- package/dist/components/popconfirm/popconfirm.d.ts +1 -1
- package/dist/components/popconfirm/popconfirm.js +219 -168
- package/dist/components/popover/popover.js +330 -243
- package/dist/components/progress/progress.css +2 -2
- package/dist/components/progress/progress.js +232 -458
- package/dist/components/qr-code/qr-code.js +72 -66
- package/dist/components/radio/radio.css +15 -4
- package/dist/components/radio/radio.d.ts +2 -1
- package/dist/components/radio/radio.js +260 -198
- package/dist/components/rate/rate.js +173 -113
- package/dist/components/scroll-area/scroll-area.js +241 -211
- package/dist/components/segmented/segmented.js +73 -41
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +24 -13
- package/dist/components/select/select-searchable-list.d.ts +2 -1
- package/dist/components/select/select-searchable-list.js +2 -3
- package/dist/components/select/select.js +49 -25
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +7 -4
- package/dist/components/skeleton/skeleton.js +56 -48
- package/dist/components/slider/slider.js +87 -212
- package/dist/components/sonner/sonner.js +109 -93
- package/dist/components/spinner/spinner.js +147 -138
- package/dist/components/splitter/splitter.js +222 -159
- package/dist/components/statistic/statistic.js +7 -6
- package/dist/components/steps/steps.js +88 -81
- package/dist/components/steps/use-display-steps.js +1 -1
- package/dist/components/switch/switch.js +89 -89
- package/dist/components/table/table-filter.js +66 -56
- package/dist/components/table/table-icons.d.ts +2 -1
- package/dist/components/table/table-icons.js +11 -9
- package/dist/components/table/table-model.js +1 -1
- package/dist/components/table/table.js +107 -83
- package/dist/components/table/use-table-data.d.ts +6 -3
- package/dist/components/table/use-table-data.js +166 -130
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.js +236 -179
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.js +111 -108
- package/dist/components/textarea/textarea.js +22 -17
- package/dist/components/time-picker/time-picker.js +5 -3
- package/dist/components/timeline/timeline.css +6 -1
- package/dist/components/timeline/timeline.js +21 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/tooltip.js +123 -233
- package/dist/components/tour/tour.css +4 -0
- package/dist/components/tour/tour.js +400 -331
- package/dist/components/transfer/transfer-list.js +29 -11
- package/dist/components/transfer/transfer-parts.js +1 -1
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +29 -14
- package/dist/components/tree/tree-keyboard.d.ts +1 -1
- package/dist/components/tree/tree-keyboard.js +5 -3
- package/dist/components/tree/tree.js +74 -59
- package/dist/components/tree-select/select-engine.d.ts +3 -2
- package/dist/components/tree-select/select-engine.js +18 -16
- package/dist/components/tree-select/tree-select.js +21 -5
- package/dist/components/upload/upload.css +8 -0
- package/dist/components/upload/upload.js +160 -72
- package/dist/components/watermark/watermark.js +36 -29
- package/dist/number-input/use-number-input.js +129 -90
- package/dist/number-input/validate.js +32 -5
- package/dist/provider/merge-locale.js +12 -9
- package/dist/provider/tao-provider.d.ts +3 -1
- package/dist/provider/tao-provider.js +123 -86
- package/package.json +1 -1
|
@@ -6,13 +6,17 @@ import { resolveResponsiveValue, useBreakpoint } from "../../utils/breakpoint.js
|
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
7
|
import "./descriptions.css";
|
|
8
8
|
const renderable = (value)=>null != value && 'boolean' != typeof value;
|
|
9
|
-
function childrenToItems(children) {
|
|
9
|
+
function childrenToItems(children, parentKeys = []) {
|
|
10
10
|
return Children.toArray(children).flatMap((child)=>{
|
|
11
11
|
if (!/*#__PURE__*/ isValidElement(child)) return [];
|
|
12
|
-
|
|
12
|
+
const keys = [
|
|
13
|
+
...parentKeys,
|
|
14
|
+
child.key
|
|
15
|
+
];
|
|
16
|
+
return child.type === external_react_Fragment ? childrenToItems(child.props.children, keys) : [
|
|
13
17
|
{
|
|
14
18
|
...child.props,
|
|
15
|
-
key:
|
|
19
|
+
key: JSON.stringify(keys)
|
|
16
20
|
}
|
|
17
21
|
];
|
|
18
22
|
});
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
flex: 0 0 5%;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
[data-tao-divider][data-tao-custom-margin][data-tao-placement="start"] [data-tao-divider-rail="start"], [data-tao-divider][data-tao-custom-margin][data-tao-placement="end"] [data-tao-divider-rail="end"] {
|
|
55
|
+
[data-tao-divider][data-tao-custom-margin][data-tao-placement="start"] [data-tao-divider-rail="start"], [data-tao-divider][data-tao-custom-margin][data-tao-placement="left"]:dir(ltr) [data-tao-divider-rail="start"], [data-tao-divider][data-tao-custom-margin][data-tao-placement="left"]:dir(rtl) [data-tao-divider-rail="end"], [data-tao-divider][data-tao-custom-margin][data-tao-placement="right"]:dir(ltr) [data-tao-divider-rail="end"], [data-tao-divider][data-tao-custom-margin][data-tao-placement="right"]:dir(rtl) [data-tao-divider-rail="start"], [data-tao-divider][data-tao-custom-margin][data-tao-placement="end"] [data-tao-divider-rail="end"] {
|
|
56
56
|
flex-basis: 0;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -25,7 +25,7 @@ const Divider = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
25
25
|
nativeElement: node.current
|
|
26
26
|
}));
|
|
27
27
|
const hasTitle = 'horizontal' === direction && null != children && 'boolean' != typeof children;
|
|
28
|
-
const margin = 'string' == typeof orientationMargin &&
|
|
28
|
+
const margin = 'string' == typeof orientationMargin && /^-?(?:\d+\.?\d*|\.\d+)$/.test(orientationMargin.trim()) ? Number(orientationMargin) : orientationMargin;
|
|
29
29
|
const titleStyle = {
|
|
30
30
|
...'start' === titlePlacement ? {
|
|
31
31
|
marginInlineStart: margin
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { TaoPortalScope, TaoProvider, useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { DialogContent } from "../../utils/dialog-content.js";
|
|
6
6
|
import { preventParentOutsideDismiss } from "../../utils/portal.js";
|
|
@@ -13,388 +13,220 @@ const SIZE_PRESET = {
|
|
|
13
13
|
large: 736
|
|
14
14
|
};
|
|
15
15
|
const MIN_DRAG_SIZE = 200;
|
|
16
|
-
function Drawer(
|
|
17
|
-
const $ = c(105);
|
|
18
|
-
const { direction, open, onClose, title, extra, footer, placement: t1, size, width, height, closable: t2, closeIcon, maskClosable: t3, mask: t4, keyboard: t5, resizable, afterOpenChange, afterClose, destroyOnHidden: t6, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
|
|
19
|
-
const placement = void 0 === t1 ? "right" : t1;
|
|
20
|
-
const closable = void 0 === t2 ? true : t2;
|
|
21
|
-
const maskClosable = void 0 === t3 ? true : t3;
|
|
22
|
-
const mask = void 0 === t4 ? true : t4;
|
|
23
|
-
const keyboard = void 0 === t5 ? true : t5;
|
|
24
|
-
const destroyOnHidden = void 0 === t6 ? true : t6;
|
|
16
|
+
function Drawer({ direction, open, onClose, title, extra, footer, placement = 'right', size, width, height, closable = true, closeIcon, maskClosable = true, mask = true, keyboard = true, resizable, afterOpenChange, afterClose, destroyOnHidden = true, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy }) {
|
|
25
17
|
const { locale } = useTaoConfig();
|
|
26
|
-
const prevOpen = useRef(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
afterClose
|
|
41
|
-
];
|
|
42
|
-
$[0] = afterClose;
|
|
43
|
-
$[1] = afterOpenChange;
|
|
44
|
-
$[2] = open;
|
|
45
|
-
$[3] = t7;
|
|
46
|
-
$[4] = t8;
|
|
47
|
-
} else {
|
|
48
|
-
t7 = $[3];
|
|
49
|
-
t8 = $[4];
|
|
50
|
-
}
|
|
51
|
-
useEffect(t7, t8);
|
|
52
|
-
const isHorizontal = "left" === placement || "right" === placement;
|
|
18
|
+
const prevOpen = useRef(false);
|
|
19
|
+
const restoreFocus = useRef(null);
|
|
20
|
+
useEffect(()=>{
|
|
21
|
+
if (prevOpen.current !== open) {
|
|
22
|
+
prevOpen.current = open;
|
|
23
|
+
afterOpenChange?.(open);
|
|
24
|
+
if (!open) afterClose?.();
|
|
25
|
+
}
|
|
26
|
+
}, [
|
|
27
|
+
open,
|
|
28
|
+
afterOpenChange,
|
|
29
|
+
afterClose
|
|
30
|
+
]);
|
|
31
|
+
const isHorizontal = 'left' === placement || 'right' === placement;
|
|
53
32
|
const sizePx = size ? SIZE_PRESET[size] : void 0;
|
|
54
|
-
const resizeCfg =
|
|
33
|
+
const resizeCfg = 'object' == typeof resizable ? resizable : void 0;
|
|
55
34
|
const isResizable = !!resizable;
|
|
56
35
|
const contentRef = useRef(null);
|
|
57
36
|
const watermarkRef = useWatermarkPanelRef();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
$[5] = watermarkRef;
|
|
65
|
-
$[6] = t9;
|
|
66
|
-
} else t9 = $[6];
|
|
67
|
-
const panelRef = t9;
|
|
37
|
+
const panelRef = useCallback((node)=>{
|
|
38
|
+
contentRef.current = node;
|
|
39
|
+
watermarkRef(node);
|
|
40
|
+
}, [
|
|
41
|
+
watermarkRef
|
|
42
|
+
]);
|
|
68
43
|
const dragRef = useRef(null);
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
resizeCfg?.onResize?.(next);
|
|
105
|
-
};
|
|
106
|
-
$[10] = isHorizontal;
|
|
107
|
-
$[11] = placement;
|
|
108
|
-
$[12] = resizeCfg;
|
|
109
|
-
$[13] = t11;
|
|
110
|
-
} else t11 = $[13];
|
|
111
|
-
const onDraggerPointerMove = t11;
|
|
112
|
-
let t12;
|
|
113
|
-
if ($[14] !== resizeCfg) {
|
|
114
|
-
t12 = (e_1)=>{
|
|
115
|
-
if (!dragRef.current) return;
|
|
116
|
-
dragRef.current = null;
|
|
117
|
-
e_1.currentTarget.releasePointerCapture?.(e_1.pointerId);
|
|
118
|
-
resizeCfg?.onResizeEnd?.();
|
|
44
|
+
const resizeEnd = useRef(resizeCfg?.onResizeEnd);
|
|
45
|
+
if (isResizable) resizeEnd.current = resizeCfg?.onResizeEnd;
|
|
46
|
+
const endResize = useCallback((pointerId)=>{
|
|
47
|
+
const drag = dragRef.current;
|
|
48
|
+
if (!drag || void 0 !== pointerId && drag.pointerId !== pointerId) return;
|
|
49
|
+
dragRef.current = null;
|
|
50
|
+
if (drag.target.hasPointerCapture(drag.pointerId)) drag.target.releasePointerCapture(drag.pointerId);
|
|
51
|
+
resizeEnd.current?.();
|
|
52
|
+
}, []);
|
|
53
|
+
useEffect(()=>{
|
|
54
|
+
const active = dragRef.current;
|
|
55
|
+
if (active && (!open || !isResizable || active.placement !== placement)) endResize();
|
|
56
|
+
}, [
|
|
57
|
+
open,
|
|
58
|
+
isResizable,
|
|
59
|
+
placement,
|
|
60
|
+
endResize
|
|
61
|
+
]);
|
|
62
|
+
useEffect(()=>()=>endResize(), [
|
|
63
|
+
endResize
|
|
64
|
+
]);
|
|
65
|
+
const [drag_0, setDrag] = useState(null);
|
|
66
|
+
const dragSize = drag_0 && drag_0.horizontal === isHorizontal ? drag_0.size : null;
|
|
67
|
+
const onDraggerPointerDown = (e)=>{
|
|
68
|
+
const el = contentRef.current;
|
|
69
|
+
if (!el || dragRef.current || 0 !== e.button) return;
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
72
|
+
const rect = el.getBoundingClientRect();
|
|
73
|
+
dragRef.current = {
|
|
74
|
+
pointerId: e.pointerId,
|
|
75
|
+
target: e.currentTarget,
|
|
76
|
+
placement,
|
|
77
|
+
startPos: isHorizontal ? e.clientX : e.clientY,
|
|
78
|
+
startSize: isHorizontal ? rect.width : rect.height
|
|
119
79
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
80
|
+
resizeCfg?.onResizeStart?.();
|
|
81
|
+
};
|
|
82
|
+
const onDraggerPointerMove = (e_0)=>{
|
|
83
|
+
const dragStart = dragRef.current;
|
|
84
|
+
if (!dragStart || dragStart.pointerId !== e_0.pointerId) return;
|
|
85
|
+
const pos = isHorizontal ? e_0.clientX : e_0.clientY;
|
|
86
|
+
let delta = pos - dragStart.startPos;
|
|
87
|
+
if ('right' === placement || 'bottom' === placement) delta = -delta;
|
|
88
|
+
const max = isHorizontal ? window.innerWidth : window.innerHeight;
|
|
89
|
+
const next = Math.max(MIN_DRAG_SIZE, Math.min(dragStart.startSize + delta, max));
|
|
90
|
+
setDrag({
|
|
91
|
+
horizontal: isHorizontal,
|
|
92
|
+
size: next
|
|
93
|
+
});
|
|
94
|
+
resizeCfg?.onResize?.(next);
|
|
95
|
+
};
|
|
96
|
+
const onDraggerPointerEnd = (e_1)=>{
|
|
97
|
+
endResize(e_1.pointerId);
|
|
98
|
+
};
|
|
99
|
+
const contentStyle = {
|
|
100
|
+
...stylesProp?.root
|
|
101
|
+
};
|
|
102
|
+
if (isHorizontal) {
|
|
103
|
+
const w = dragSize ?? width ?? sizePx;
|
|
104
|
+
if (null != w) contentStyle.width = 'number' == typeof w ? `${w}px` : w;
|
|
105
|
+
} else {
|
|
106
|
+
const h = dragSize ?? height ?? sizePx;
|
|
107
|
+
if (null != h) contentStyle.height = 'number' == typeof h ? `${h}px` : h;
|
|
108
|
+
}
|
|
145
109
|
const keepAlive = !destroyOnHidden;
|
|
146
110
|
const forceMount = keepAlive ? true : void 0;
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"data-tao-drawer-overlay": "",
|
|
161
|
-
className: cx(classNames?.overlay),
|
|
162
|
-
style: stylesProp?.overlay,
|
|
163
|
-
onClick: maskClosable ? onClose : void 0
|
|
164
|
-
});
|
|
165
|
-
$[25] = classNames?.overlay;
|
|
166
|
-
$[26] = forceMount;
|
|
167
|
-
$[27] = keepAlive;
|
|
168
|
-
$[28] = mask;
|
|
169
|
-
$[29] = maskClosable;
|
|
170
|
-
$[30] = onClose;
|
|
171
|
-
$[31] = open;
|
|
172
|
-
$[32] = stylesProp?.overlay;
|
|
173
|
-
$[33] = t15;
|
|
174
|
-
} else t15 = $[33];
|
|
175
|
-
const t16 = classNames?.root;
|
|
176
|
-
let t17;
|
|
177
|
-
if ($[34] !== t16) {
|
|
178
|
-
t17 = cx(t16);
|
|
179
|
-
$[34] = t16;
|
|
180
|
-
$[35] = t17;
|
|
181
|
-
} else t17 = $[35];
|
|
182
|
-
let t18;
|
|
183
|
-
if ($[36] !== ariaLabel || $[37] !== ariaLabelledBy) {
|
|
184
|
-
t18 = ariaLabel || ariaLabelledBy ? {
|
|
185
|
-
"aria-labelledby": ariaLabelledBy
|
|
186
|
-
} : {};
|
|
187
|
-
$[36] = ariaLabel;
|
|
188
|
-
$[37] = ariaLabelledBy;
|
|
189
|
-
$[38] = t18;
|
|
190
|
-
} else t18 = $[38];
|
|
191
|
-
let t19;
|
|
192
|
-
if ($[39] !== keyboard) {
|
|
193
|
-
t19 = (e_2)=>{
|
|
194
|
-
if (!keyboard) e_2.preventDefault();
|
|
195
|
-
};
|
|
196
|
-
$[39] = keyboard;
|
|
197
|
-
$[40] = t19;
|
|
198
|
-
} else t19 = $[40];
|
|
199
|
-
let t20;
|
|
200
|
-
if ($[41] !== classNames?.dragger || $[42] !== isResizable || $[43] !== onDraggerPointerDown || $[44] !== onDraggerPointerMove || $[45] !== onDraggerPointerUp || $[46] !== placement || $[47] !== stylesProp?.dragger) {
|
|
201
|
-
t20 = isResizable && /*#__PURE__*/ jsx("div", {
|
|
202
|
-
"data-tao-drawer-dragger": "",
|
|
203
|
-
"data-tao-placement": placement,
|
|
204
|
-
className: cx(classNames?.dragger),
|
|
205
|
-
style: stylesProp?.dragger,
|
|
206
|
-
onPointerDown: onDraggerPointerDown,
|
|
207
|
-
onPointerMove: onDraggerPointerMove,
|
|
208
|
-
onPointerUp: onDraggerPointerUp
|
|
209
|
-
});
|
|
210
|
-
$[41] = classNames?.dragger;
|
|
211
|
-
$[42] = isResizable;
|
|
212
|
-
$[43] = onDraggerPointerDown;
|
|
213
|
-
$[44] = onDraggerPointerMove;
|
|
214
|
-
$[45] = onDraggerPointerUp;
|
|
215
|
-
$[46] = placement;
|
|
216
|
-
$[47] = stylesProp?.dragger;
|
|
217
|
-
$[48] = t20;
|
|
218
|
-
} else t20 = $[48];
|
|
219
|
-
let t21;
|
|
220
|
-
if ($[49] !== classNames?.close || $[50] !== classNames?.extra || $[51] !== classNames?.header || $[52] !== classNames?.title || $[53] !== closable || $[54] !== closeIcon || $[55] !== extra || $[56] !== locale || $[57] !== onClose || $[58] !== showHeader || $[59] !== stylesProp?.close || $[60] !== stylesProp?.extra || $[61] !== stylesProp?.header || $[62] !== stylesProp?.title || $[63] !== title) {
|
|
221
|
-
t21 = showHeader && /*#__PURE__*/ jsxs("div", {
|
|
222
|
-
"data-tao-drawer-header": "",
|
|
223
|
-
className: cx(classNames?.header),
|
|
224
|
-
style: stylesProp?.header,
|
|
225
|
-
children: [
|
|
226
|
-
null != title ? /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
|
|
227
|
-
"data-tao-drawer-title": "",
|
|
228
|
-
className: cx(classNames?.title),
|
|
229
|
-
style: stylesProp?.title,
|
|
230
|
-
children: title
|
|
231
|
-
}) : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
|
|
232
|
-
"data-tao-drawer-title": "",
|
|
233
|
-
style: {
|
|
234
|
-
display: "none"
|
|
235
|
-
}
|
|
236
|
-
}),
|
|
237
|
-
/*#__PURE__*/ jsxs("div", {
|
|
238
|
-
"data-tao-drawer-actions": "",
|
|
111
|
+
const showClose = closable && false !== closeIcon;
|
|
112
|
+
const showHeader = null != title || null != extra || showClose;
|
|
113
|
+
return /*#__PURE__*/ jsx(TaoProvider, {
|
|
114
|
+
direction: direction,
|
|
115
|
+
children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
|
|
116
|
+
open: open,
|
|
117
|
+
onOpenChange: (v)=>{
|
|
118
|
+
if (!v) onClose?.();
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
|
|
121
|
+
forceMount: forceMount,
|
|
122
|
+
children: /*#__PURE__*/ jsxs(TaoPortalScope, {
|
|
123
|
+
direction: direction,
|
|
239
124
|
children: [
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
125
|
+
mask && (!keepAlive || open) && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
|
|
126
|
+
forceMount: forceMount,
|
|
127
|
+
"data-tao-drawer-overlay": "",
|
|
128
|
+
className: cx(classNames?.overlay),
|
|
129
|
+
style: stylesProp?.overlay,
|
|
130
|
+
onClick: maskClosable ? onClose : void 0
|
|
245
131
|
}),
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"
|
|
253
|
-
|
|
132
|
+
/*#__PURE__*/ jsxs(DialogContent, {
|
|
133
|
+
open: open,
|
|
134
|
+
keepAlive: keepAlive,
|
|
135
|
+
contentRef: panelRef,
|
|
136
|
+
forceMount: forceMount,
|
|
137
|
+
"data-tao-drawer": "",
|
|
138
|
+
"data-tao-placement": placement,
|
|
139
|
+
style: contentStyle,
|
|
140
|
+
className: cx(classNames?.root),
|
|
141
|
+
"aria-label": ariaLabel,
|
|
142
|
+
...ariaLabel || ariaLabelledBy ? {
|
|
143
|
+
'aria-labelledby': ariaLabelledBy
|
|
144
|
+
} : {},
|
|
145
|
+
"aria-describedby": ariaDescribedBy,
|
|
146
|
+
onOpenAutoFocus: ()=>{
|
|
147
|
+
const ownerDocument = contentRef.current?.ownerDocument;
|
|
148
|
+
const active_0 = ownerDocument?.activeElement;
|
|
149
|
+
restoreFocus.current = active_0 && active_0 !== ownerDocument?.body ? active_0 : null;
|
|
150
|
+
},
|
|
151
|
+
onCloseAutoFocus: (event)=>{
|
|
152
|
+
event.preventDefault();
|
|
153
|
+
const target = restoreFocus.current;
|
|
154
|
+
if (target?.isConnected && (!prevOpen.current || !contentRef.current)) target.focus();
|
|
155
|
+
},
|
|
156
|
+
onEscapeKeyDown: (e_2)=>{
|
|
157
|
+
if (!keyboard) e_2.preventDefault();
|
|
158
|
+
},
|
|
159
|
+
onPointerDownOutside: preventParentOutsideDismiss,
|
|
160
|
+
onInteractOutside: preventParentOutsideDismiss,
|
|
161
|
+
children: [
|
|
162
|
+
isResizable && /*#__PURE__*/ jsx("div", {
|
|
163
|
+
"data-tao-drawer-dragger": "",
|
|
164
|
+
"data-tao-placement": placement,
|
|
165
|
+
className: cx(classNames?.dragger),
|
|
166
|
+
style: stylesProp?.dragger,
|
|
167
|
+
onPointerDown: onDraggerPointerDown,
|
|
168
|
+
onPointerMove: onDraggerPointerMove,
|
|
169
|
+
onPointerUp: onDraggerPointerEnd,
|
|
170
|
+
onPointerCancel: onDraggerPointerEnd,
|
|
171
|
+
onLostPointerCapture: onDraggerPointerEnd
|
|
172
|
+
}),
|
|
173
|
+
showHeader && /*#__PURE__*/ jsxs("div", {
|
|
174
|
+
"data-tao-drawer-header": "",
|
|
175
|
+
className: cx(classNames?.header),
|
|
176
|
+
style: stylesProp?.header,
|
|
177
|
+
children: [
|
|
178
|
+
null != title ? /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
|
|
179
|
+
"data-tao-drawer-title": "",
|
|
180
|
+
className: cx(classNames?.title),
|
|
181
|
+
style: stylesProp?.title,
|
|
182
|
+
children: title
|
|
183
|
+
}) : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Title, {
|
|
184
|
+
"data-tao-drawer-title": "",
|
|
185
|
+
style: {
|
|
186
|
+
display: 'none'
|
|
187
|
+
}
|
|
188
|
+
}),
|
|
189
|
+
/*#__PURE__*/ jsxs("div", {
|
|
190
|
+
"data-tao-drawer-actions": "",
|
|
191
|
+
children: [
|
|
192
|
+
null != extra && /*#__PURE__*/ jsx("div", {
|
|
193
|
+
"data-tao-drawer-extra": "",
|
|
194
|
+
className: cx(classNames?.extra),
|
|
195
|
+
style: stylesProp?.extra,
|
|
196
|
+
children: extra
|
|
197
|
+
}),
|
|
198
|
+
showClose && /*#__PURE__*/ jsx("button", {
|
|
199
|
+
type: "button",
|
|
200
|
+
"data-tao-drawer-close": "",
|
|
201
|
+
className: cx(classNames?.close),
|
|
202
|
+
style: stylesProp?.close,
|
|
203
|
+
onClick: onClose,
|
|
204
|
+
"aria-label": locale.close,
|
|
205
|
+
children: closeIcon ?? /*#__PURE__*/ jsx(CloseIcon, {})
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
}),
|
|
211
|
+
/*#__PURE__*/ jsx("div", {
|
|
212
|
+
"data-tao-drawer-body": "",
|
|
213
|
+
className: cx(classNames?.body),
|
|
214
|
+
style: stylesProp?.body,
|
|
215
|
+
children: children
|
|
216
|
+
}),
|
|
217
|
+
null != footer && /*#__PURE__*/ jsx("div", {
|
|
218
|
+
"data-tao-drawer-footer": "",
|
|
219
|
+
className: cx(classNames?.footer),
|
|
220
|
+
style: stylesProp?.footer,
|
|
221
|
+
children: footer
|
|
222
|
+
})
|
|
223
|
+
]
|
|
254
224
|
})
|
|
255
225
|
]
|
|
256
226
|
})
|
|
257
|
-
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
$[50] = classNames?.extra;
|
|
261
|
-
$[51] = classNames?.header;
|
|
262
|
-
$[52] = classNames?.title;
|
|
263
|
-
$[53] = closable;
|
|
264
|
-
$[54] = closeIcon;
|
|
265
|
-
$[55] = extra;
|
|
266
|
-
$[56] = locale;
|
|
267
|
-
$[57] = onClose;
|
|
268
|
-
$[58] = showHeader;
|
|
269
|
-
$[59] = stylesProp?.close;
|
|
270
|
-
$[60] = stylesProp?.extra;
|
|
271
|
-
$[61] = stylesProp?.header;
|
|
272
|
-
$[62] = stylesProp?.title;
|
|
273
|
-
$[63] = title;
|
|
274
|
-
$[64] = t21;
|
|
275
|
-
} else t21 = $[64];
|
|
276
|
-
const t22 = classNames?.body;
|
|
277
|
-
let t23;
|
|
278
|
-
if ($[65] !== t22) {
|
|
279
|
-
t23 = cx(t22);
|
|
280
|
-
$[65] = t22;
|
|
281
|
-
$[66] = t23;
|
|
282
|
-
} else t23 = $[66];
|
|
283
|
-
const t24 = stylesProp?.body;
|
|
284
|
-
let t25;
|
|
285
|
-
if ($[67] !== children || $[68] !== t23 || $[69] !== t24) {
|
|
286
|
-
t25 = /*#__PURE__*/ jsx("div", {
|
|
287
|
-
"data-tao-drawer-body": "",
|
|
288
|
-
className: t23,
|
|
289
|
-
style: t24,
|
|
290
|
-
children: children
|
|
291
|
-
});
|
|
292
|
-
$[67] = children;
|
|
293
|
-
$[68] = t23;
|
|
294
|
-
$[69] = t24;
|
|
295
|
-
$[70] = t25;
|
|
296
|
-
} else t25 = $[70];
|
|
297
|
-
let t26;
|
|
298
|
-
if ($[71] !== classNames?.footer || $[72] !== footer || $[73] !== stylesProp?.footer) {
|
|
299
|
-
t26 = null != footer && /*#__PURE__*/ jsx("div", {
|
|
300
|
-
"data-tao-drawer-footer": "",
|
|
301
|
-
className: cx(classNames?.footer),
|
|
302
|
-
style: stylesProp?.footer,
|
|
303
|
-
children: footer
|
|
304
|
-
});
|
|
305
|
-
$[71] = classNames?.footer;
|
|
306
|
-
$[72] = footer;
|
|
307
|
-
$[73] = stylesProp?.footer;
|
|
308
|
-
$[74] = t26;
|
|
309
|
-
} else t26 = $[74];
|
|
310
|
-
let t27;
|
|
311
|
-
if ($[75] !== ariaDescribedBy || $[76] !== ariaLabel || $[77] !== contentStyle || $[78] !== forceMount || $[79] !== keepAlive || $[80] !== open || $[81] !== panelRef || $[82] !== placement || $[83] !== t17 || $[84] !== t18 || $[85] !== t19 || $[86] !== t20 || $[87] !== t21 || $[88] !== t25 || $[89] !== t26) {
|
|
312
|
-
t27 = /*#__PURE__*/ jsxs(DialogContent, {
|
|
313
|
-
open: open,
|
|
314
|
-
keepAlive: keepAlive,
|
|
315
|
-
contentRef: panelRef,
|
|
316
|
-
forceMount: forceMount,
|
|
317
|
-
"data-tao-drawer": "",
|
|
318
|
-
"data-tao-placement": placement,
|
|
319
|
-
style: contentStyle,
|
|
320
|
-
className: t17,
|
|
321
|
-
"aria-label": ariaLabel,
|
|
322
|
-
...t18,
|
|
323
|
-
"aria-describedby": ariaDescribedBy,
|
|
324
|
-
onEscapeKeyDown: t19,
|
|
325
|
-
onPointerDownOutside: preventParentOutsideDismiss,
|
|
326
|
-
onInteractOutside: preventParentOutsideDismiss,
|
|
327
|
-
children: [
|
|
328
|
-
t20,
|
|
329
|
-
t21,
|
|
330
|
-
t25,
|
|
331
|
-
t26
|
|
332
|
-
]
|
|
333
|
-
});
|
|
334
|
-
$[75] = ariaDescribedBy;
|
|
335
|
-
$[76] = ariaLabel;
|
|
336
|
-
$[77] = contentStyle;
|
|
337
|
-
$[78] = forceMount;
|
|
338
|
-
$[79] = keepAlive;
|
|
339
|
-
$[80] = open;
|
|
340
|
-
$[81] = panelRef;
|
|
341
|
-
$[82] = placement;
|
|
342
|
-
$[83] = t17;
|
|
343
|
-
$[84] = t18;
|
|
344
|
-
$[85] = t19;
|
|
345
|
-
$[86] = t20;
|
|
346
|
-
$[87] = t21;
|
|
347
|
-
$[88] = t25;
|
|
348
|
-
$[89] = t26;
|
|
349
|
-
$[90] = t27;
|
|
350
|
-
} else t27 = $[90];
|
|
351
|
-
let t28;
|
|
352
|
-
if ($[91] !== direction || $[92] !== t15 || $[93] !== t27) {
|
|
353
|
-
t28 = /*#__PURE__*/ jsxs(TaoPortalScope, {
|
|
354
|
-
direction: direction,
|
|
355
|
-
children: [
|
|
356
|
-
t15,
|
|
357
|
-
t27
|
|
358
|
-
]
|
|
359
|
-
});
|
|
360
|
-
$[91] = direction;
|
|
361
|
-
$[92] = t15;
|
|
362
|
-
$[93] = t27;
|
|
363
|
-
$[94] = t28;
|
|
364
|
-
} else t28 = $[94];
|
|
365
|
-
let t29;
|
|
366
|
-
if ($[95] !== forceMount || $[96] !== t28) {
|
|
367
|
-
t29 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
|
|
368
|
-
forceMount: forceMount,
|
|
369
|
-
children: t28
|
|
370
|
-
});
|
|
371
|
-
$[95] = forceMount;
|
|
372
|
-
$[96] = t28;
|
|
373
|
-
$[97] = t29;
|
|
374
|
-
} else t29 = $[97];
|
|
375
|
-
let t30;
|
|
376
|
-
if ($[98] !== open || $[99] !== t14 || $[100] !== t29) {
|
|
377
|
-
t30 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
|
|
378
|
-
open: open,
|
|
379
|
-
onOpenChange: t14,
|
|
380
|
-
children: t29
|
|
381
|
-
});
|
|
382
|
-
$[98] = open;
|
|
383
|
-
$[99] = t14;
|
|
384
|
-
$[100] = t29;
|
|
385
|
-
$[101] = t30;
|
|
386
|
-
} else t30 = $[101];
|
|
387
|
-
let t31;
|
|
388
|
-
if ($[102] !== direction || $[103] !== t30) {
|
|
389
|
-
t31 = /*#__PURE__*/ jsx(TaoProvider, {
|
|
390
|
-
direction: direction,
|
|
391
|
-
children: t30
|
|
392
|
-
});
|
|
393
|
-
$[102] = direction;
|
|
394
|
-
$[103] = t30;
|
|
395
|
-
$[104] = t31;
|
|
396
|
-
} else t31 = $[104];
|
|
397
|
-
return t31;
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
});
|
|
398
230
|
}
|
|
399
231
|
function CloseIcon() {
|
|
400
232
|
const $ = c(1);
|
|
@@ -43,4 +43,4 @@ export declare function Dropdown(props: DropdownProps): import("react").JSX.Elem
|
|
|
43
43
|
export declare namespace Dropdown {
|
|
44
44
|
export { DropdownButton as Button };
|
|
45
45
|
}
|
|
46
|
-
declare function DropdownButton({ children, onClick, icon, variant, size, menu, ...dropdownRest }: DropdownButtonProps): import("react").JSX.Element;
|
|
46
|
+
declare function DropdownButton({ children, onClick, icon, variant, size, disabled, menu, ...dropdownRest }: DropdownButtonProps): import("react").JSX.Element;
|