@rockshin/tao-ui 0.0.59 → 0.0.60
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/cascader/cascader.js +1 -0
- package/dist/components/color-picker/color-picker.css +1 -1
- package/dist/components/color-picker/color-picker.js +3 -2
- package/dist/components/context-menu/context-menu.d.ts +3 -1
- package/dist/components/context-menu/context-menu.js +48 -43
- package/dist/components/date-picker/calendar/time-panel.js +7 -3
- package/dist/components/date-picker/date-picker.js +3 -1
- package/dist/components/date-picker/range-picker.js +5 -3
- package/dist/components/dropdown/dropdown.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +18 -12
- package/dist/components/float-button/float-button.js +2 -1
- package/dist/components/form/use-form.js +2 -1
- package/dist/components/input-number/input-number.d.ts +2 -1
- package/dist/components/input-number/input-number.js +67 -52
- package/dist/components/mentions/mentions.js +3 -2
- package/dist/components/menu/menu-render.d.ts +6 -0
- package/dist/components/menu/menu-render.js +38 -26
- package/dist/components/modal/confirm-dialog.js +11 -6
- package/dist/components/modal/use-modal.js +1 -1
- package/dist/components/pagination/pagination.d.ts +3 -2
- package/dist/components/pagination/pagination.js +127 -117
- package/dist/components/popover/popover.js +125 -298
- package/dist/components/select/mobile-select.js +1 -1
- package/dist/components/select/select-model.js +1 -1
- package/dist/components/select/use-select-selection.js +94 -86
- package/dist/components/statistic/statistic.js +38 -31
- package/dist/components/table/table-filter.d.ts +3 -1
- package/dist/components/table/table-filter.js +100 -74
- package/dist/components/table/table.js +1 -0
- package/dist/components/tabs/tabs.d.ts +3 -2
- package/dist/components/tabs/tabs.js +122 -112
- package/dist/components/time-picker/time-picker.js +4 -2
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +168 -210
- package/dist/components/tree-select/tree-select.js +1 -0
- package/dist/number-input/use-number-input.d.ts +1 -0
- package/dist/number-input/use-number-input.js +6 -2
- package/dist/provider/tao-provider.js +18 -4
- package/dist/theme/control.css +5 -1
- package/dist/theme/theme.css +2 -2
- package/package.json +1 -1
|
@@ -1,84 +1,72 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { TaoPortalScope, useTaoDirection } from "../../provider/tao-provider.js";
|
|
5
|
-
import { asTriggerChild
|
|
5
|
+
import { asTriggerChild } from "../../utils/overlay.js";
|
|
6
6
|
import { useCommittedRef } from "../../utils/refs.js";
|
|
7
7
|
import { cx } from "../../utils/semantic.js";
|
|
8
8
|
import "./tooltip.css";
|
|
9
9
|
import * as __rspack_external__radix_ui_react_tooltip_b301f25d from "@radix-ui/react-tooltip";
|
|
10
|
-
function Tooltip(
|
|
11
|
-
const $ = c(
|
|
12
|
-
const { title, children } = props;
|
|
13
|
-
if (null == title || "" === title || "boolean" == typeof title) {
|
|
14
|
-
let t0;
|
|
15
|
-
if ($[0] !== children) {
|
|
16
|
-
t0 = /*#__PURE__*/ jsx(Fragment, {
|
|
17
|
-
children: children
|
|
18
|
-
});
|
|
19
|
-
$[0] = children;
|
|
20
|
-
$[1] = t0;
|
|
21
|
-
} else t0 = $[1];
|
|
22
|
-
return t0;
|
|
23
|
-
}
|
|
24
|
-
let t0;
|
|
25
|
-
if ($[2] !== props) {
|
|
26
|
-
t0 = /*#__PURE__*/ jsx(ActiveTooltip, {
|
|
27
|
-
...props
|
|
28
|
-
});
|
|
29
|
-
$[2] = props;
|
|
30
|
-
$[3] = t0;
|
|
31
|
-
} else t0 = $[3];
|
|
32
|
-
return t0;
|
|
33
|
-
}
|
|
34
|
-
function ActiveTooltip(t0) {
|
|
35
|
-
const $ = c(58);
|
|
10
|
+
function Tooltip(t0) {
|
|
11
|
+
const $ = c(53);
|
|
36
12
|
const { direction: directionProp, title, placement: t1, arrow: t2, open, defaultOpen, onOpenChange, mouseEnterDelay: t3, mouseLeaveDelay: t4, color, className, style, classNames, styles, children } = t0;
|
|
37
13
|
const placement = void 0 === t1 ? "top" : t1;
|
|
38
14
|
const arrow = void 0 === t2 ? true : t2;
|
|
39
15
|
const mouseEnterDelay = void 0 === t3 ? 0.1 : t3;
|
|
40
16
|
const mouseLeaveDelay = void 0 === t4 ? 0.1 : t4;
|
|
17
|
+
const hasTitle = null != title && "" !== title && "boolean" != typeof title;
|
|
41
18
|
const [direction, directionRef] = useTaoDirection(directionProp, "self");
|
|
19
|
+
const isControlled = null != open;
|
|
42
20
|
let t5;
|
|
43
|
-
if ($[0] !== defaultOpen || $[1] !==
|
|
44
|
-
t5 =
|
|
45
|
-
open,
|
|
46
|
-
defaultOpen,
|
|
47
|
-
onOpenChange
|
|
48
|
-
};
|
|
21
|
+
if ($[0] !== defaultOpen || $[1] !== hasTitle) {
|
|
22
|
+
t5 = ()=>Boolean(hasTitle && defaultOpen);
|
|
49
23
|
$[0] = defaultOpen;
|
|
50
|
-
$[1] =
|
|
51
|
-
$[2] =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
24
|
+
$[1] = hasTitle;
|
|
25
|
+
$[2] = t5;
|
|
26
|
+
} else t5 = $[2];
|
|
27
|
+
const [internalOpen, setInternalOpen] = useState(t5);
|
|
28
|
+
if (!hasTitle && internalOpen) setInternalOpen(false);
|
|
29
|
+
const realOpen = hasTitle && (isControlled ? open : internalOpen);
|
|
30
|
+
let t6;
|
|
31
|
+
if ($[3] !== hasTitle || $[4] !== isControlled || $[5] !== onOpenChange) {
|
|
32
|
+
t6 = (next)=>{
|
|
33
|
+
if (next && !hasTitle) return;
|
|
34
|
+
if (!isControlled) setInternalOpen(next);
|
|
35
|
+
onOpenChange?.(next);
|
|
36
|
+
};
|
|
37
|
+
$[3] = hasTitle;
|
|
38
|
+
$[4] = isControlled;
|
|
39
|
+
$[5] = onOpenChange;
|
|
40
|
+
$[6] = t6;
|
|
41
|
+
} else t6 = $[6];
|
|
42
|
+
const setOpen = t6;
|
|
55
43
|
const latestSetOpen = useCommittedRef(setOpen);
|
|
56
44
|
const closeTimer = useRef(void 0);
|
|
57
45
|
const pointerDriven = useRef(false);
|
|
58
|
-
let t6;
|
|
59
46
|
let t7;
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
let t8;
|
|
48
|
+
if ($[7] !== realOpen) {
|
|
49
|
+
t7 = ()=>{
|
|
62
50
|
if (!realOpen) return;
|
|
63
51
|
return ()=>{
|
|
64
52
|
clearTimeout(closeTimer.current);
|
|
65
53
|
pointerDriven.current = false;
|
|
66
54
|
};
|
|
67
55
|
};
|
|
68
|
-
|
|
56
|
+
t8 = [
|
|
69
57
|
realOpen
|
|
70
58
|
];
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
59
|
+
$[7] = realOpen;
|
|
60
|
+
$[8] = t7;
|
|
61
|
+
$[9] = t8;
|
|
74
62
|
} else {
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
t7 = $[8];
|
|
64
|
+
t8 = $[9];
|
|
77
65
|
}
|
|
78
|
-
useEffect(
|
|
79
|
-
let
|
|
80
|
-
if ($[
|
|
81
|
-
|
|
66
|
+
useEffect(t7, t8);
|
|
67
|
+
let t9;
|
|
68
|
+
if ($[10] !== latestSetOpen || $[11] !== mouseLeaveDelay || $[12] !== setOpen) {
|
|
69
|
+
t9 = ()=>{
|
|
82
70
|
clearTimeout(closeTimer.current);
|
|
83
71
|
if (mouseLeaveDelay <= 0) return void setOpen(false);
|
|
84
72
|
closeTimer.current = setTimeout(()=>{
|
|
@@ -86,196 +74,166 @@ function ActiveTooltip(t0) {
|
|
|
86
74
|
latestSetOpen.current(false);
|
|
87
75
|
}, 1000 * mouseLeaveDelay);
|
|
88
76
|
};
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[9] = setOpen;
|
|
92
|
-
$[10] = t8;
|
|
93
|
-
} else t8 = $[10];
|
|
94
|
-
const schedulePointerClose = t8;
|
|
95
|
-
let t9;
|
|
96
|
-
if ($[11] !== schedulePointerClose || $[12] !== setOpen) {
|
|
97
|
-
t9 = (next)=>{
|
|
98
|
-
if (!next && pointerDriven.current) return void schedulePointerClose();
|
|
99
|
-
clearTimeout(closeTimer.current);
|
|
100
|
-
pointerDriven.current = false;
|
|
101
|
-
setOpen(next);
|
|
102
|
-
};
|
|
103
|
-
$[11] = schedulePointerClose;
|
|
77
|
+
$[10] = latestSetOpen;
|
|
78
|
+
$[11] = mouseLeaveDelay;
|
|
104
79
|
$[12] = setOpen;
|
|
105
80
|
$[13] = t9;
|
|
106
81
|
} else t9 = $[13];
|
|
107
|
-
const
|
|
82
|
+
const schedulePointerClose = t9;
|
|
108
83
|
let t10;
|
|
109
|
-
if ($[14]
|
|
110
|
-
t10 = (
|
|
84
|
+
if ($[14] !== schedulePointerClose || $[15] !== setOpen) {
|
|
85
|
+
t10 = (next_0)=>{
|
|
86
|
+
if (!next_0 && pointerDriven.current) return void schedulePointerClose();
|
|
87
|
+
clearTimeout(closeTimer.current);
|
|
88
|
+
pointerDriven.current = false;
|
|
89
|
+
setOpen(next_0);
|
|
90
|
+
};
|
|
91
|
+
$[14] = schedulePointerClose;
|
|
92
|
+
$[15] = setOpen;
|
|
93
|
+
$[16] = t10;
|
|
94
|
+
} else t10 = $[16];
|
|
95
|
+
const handleOpenChange = t10;
|
|
96
|
+
let t11;
|
|
97
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
98
|
+
t11 = (event)=>{
|
|
111
99
|
if ("touch" === event.pointerType) return;
|
|
112
100
|
pointerDriven.current = false;
|
|
113
101
|
clearTimeout(closeTimer.current);
|
|
114
102
|
};
|
|
115
|
-
$[
|
|
116
|
-
} else
|
|
117
|
-
let
|
|
118
|
-
if ($[
|
|
119
|
-
|
|
120
|
-
onPointerEnter:
|
|
103
|
+
$[17] = t11;
|
|
104
|
+
} else t11 = $[17];
|
|
105
|
+
let t12;
|
|
106
|
+
if ($[18] !== realOpen || $[19] !== schedulePointerClose) {
|
|
107
|
+
t12 = {
|
|
108
|
+
onPointerEnter: t11,
|
|
121
109
|
onPointerLeave: (event_0)=>{
|
|
122
110
|
if (!realOpen || "touch" === event_0.pointerType) return;
|
|
123
111
|
pointerDriven.current = true;
|
|
124
112
|
schedulePointerClose();
|
|
125
113
|
}
|
|
126
114
|
};
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
} else
|
|
131
|
-
const hoverProps =
|
|
132
|
-
let
|
|
133
|
-
if ($[
|
|
134
|
-
|
|
115
|
+
$[18] = realOpen;
|
|
116
|
+
$[19] = schedulePointerClose;
|
|
117
|
+
$[20] = t12;
|
|
118
|
+
} else t12 = $[20];
|
|
119
|
+
const hoverProps = t12;
|
|
120
|
+
let t13;
|
|
121
|
+
if ($[21] !== color) {
|
|
122
|
+
t13 = color ? {
|
|
135
123
|
background: color
|
|
136
124
|
} : void 0;
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
} else
|
|
140
|
-
const colorStyle =
|
|
141
|
-
const
|
|
142
|
-
let
|
|
143
|
-
if ($[
|
|
144
|
-
|
|
125
|
+
$[21] = color;
|
|
126
|
+
$[22] = t13;
|
|
127
|
+
} else t13 = $[22];
|
|
128
|
+
const colorStyle = t13;
|
|
129
|
+
const t14 = 1000 * mouseEnterDelay;
|
|
130
|
+
let t15;
|
|
131
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
132
|
+
t15 = ()=>{
|
|
145
133
|
pointerDriven.current = false;
|
|
146
134
|
};
|
|
147
|
-
$[
|
|
148
|
-
} else
|
|
149
|
-
let t15;
|
|
150
|
-
if ($[21] !== children) {
|
|
151
|
-
t15 = asTriggerChild(children);
|
|
152
|
-
$[21] = children;
|
|
153
|
-
$[22] = t15;
|
|
154
|
-
} else t15 = $[22];
|
|
135
|
+
$[23] = t15;
|
|
136
|
+
} else t15 = $[23];
|
|
155
137
|
let t16;
|
|
156
|
-
if ($[
|
|
157
|
-
t16 =
|
|
138
|
+
if ($[24] !== children) {
|
|
139
|
+
t16 = asTriggerChild(children);
|
|
140
|
+
$[24] = children;
|
|
141
|
+
$[25] = t16;
|
|
142
|
+
} else t16 = $[25];
|
|
143
|
+
let t17;
|
|
144
|
+
if ($[26] !== directionRef || $[27] !== hoverProps || $[28] !== t16) {
|
|
145
|
+
t17 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Trigger, {
|
|
158
146
|
ref: directionRef,
|
|
159
147
|
asChild: true,
|
|
160
148
|
...hoverProps,
|
|
161
|
-
onBlur:
|
|
162
|
-
children:
|
|
149
|
+
onBlur: t15,
|
|
150
|
+
children: t16
|
|
163
151
|
});
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
} else
|
|
169
|
-
const t17 = classNames?.content;
|
|
152
|
+
$[26] = directionRef;
|
|
153
|
+
$[27] = hoverProps;
|
|
154
|
+
$[28] = t16;
|
|
155
|
+
$[29] = t17;
|
|
156
|
+
} else t17 = $[29];
|
|
170
157
|
let t18;
|
|
171
|
-
if ($[
|
|
172
|
-
t18 =
|
|
173
|
-
$[27] = className;
|
|
174
|
-
$[28] = t17;
|
|
175
|
-
$[29] = t18;
|
|
176
|
-
} else t18 = $[29];
|
|
177
|
-
const t19 = styles?.content;
|
|
178
|
-
let t20;
|
|
179
|
-
if ($[30] !== colorStyle || $[31] !== style || $[32] !== t19) {
|
|
180
|
-
t20 = {
|
|
181
|
-
...colorStyle,
|
|
182
|
-
...t19,
|
|
183
|
-
...style
|
|
184
|
-
};
|
|
185
|
-
$[30] = colorStyle;
|
|
186
|
-
$[31] = style;
|
|
187
|
-
$[32] = t19;
|
|
188
|
-
$[33] = t20;
|
|
189
|
-
} else t20 = $[33];
|
|
190
|
-
let t21;
|
|
191
|
-
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
192
|
-
t21 = ()=>{
|
|
193
|
-
pointerDriven.current = false;
|
|
194
|
-
};
|
|
195
|
-
$[34] = t21;
|
|
196
|
-
} else t21 = $[34];
|
|
197
|
-
let t22;
|
|
198
|
-
if ($[35] !== arrow || $[36] !== classNames?.arrow || $[37] !== color || $[38] !== styles?.arrow) {
|
|
199
|
-
t22 = arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Arrow, {
|
|
200
|
-
asChild: true,
|
|
201
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
202
|
-
"data-tao-tooltip-arrow": "",
|
|
203
|
-
className: cx(classNames?.arrow),
|
|
204
|
-
style: {
|
|
205
|
-
...color ? {
|
|
206
|
-
"--tao-tooltip-arrow-bg": color
|
|
207
|
-
} : void 0,
|
|
208
|
-
...styles?.arrow
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
});
|
|
212
|
-
$[35] = arrow;
|
|
213
|
-
$[36] = classNames?.arrow;
|
|
214
|
-
$[37] = color;
|
|
215
|
-
$[38] = styles?.arrow;
|
|
216
|
-
$[39] = t22;
|
|
217
|
-
} else t22 = $[39];
|
|
218
|
-
let t23;
|
|
219
|
-
if ($[40] !== hoverProps || $[41] !== placement || $[42] !== t18 || $[43] !== t20 || $[44] !== t22 || $[45] !== title) {
|
|
220
|
-
t23 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Content, {
|
|
221
|
-
"data-tao-tooltip-content": "",
|
|
222
|
-
className: t18,
|
|
223
|
-
style: t20,
|
|
224
|
-
side: placement,
|
|
225
|
-
sideOffset: 4,
|
|
226
|
-
onEscapeKeyDown: t21,
|
|
227
|
-
...hoverProps,
|
|
228
|
-
children: [
|
|
229
|
-
title,
|
|
230
|
-
t22
|
|
231
|
-
]
|
|
232
|
-
});
|
|
233
|
-
$[40] = hoverProps;
|
|
234
|
-
$[41] = placement;
|
|
235
|
-
$[42] = t18;
|
|
236
|
-
$[43] = t20;
|
|
237
|
-
$[44] = t22;
|
|
238
|
-
$[45] = title;
|
|
239
|
-
$[46] = t23;
|
|
240
|
-
} else t23 = $[46];
|
|
241
|
-
let t24;
|
|
242
|
-
if ($[47] !== direction || $[48] !== t23) {
|
|
243
|
-
t24 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Portal, {
|
|
158
|
+
if ($[30] !== arrow || $[31] !== className || $[32] !== classNames?.arrow || $[33] !== classNames?.content || $[34] !== color || $[35] !== colorStyle || $[36] !== direction || $[37] !== hasTitle || $[38] !== hoverProps || $[39] !== placement || $[40] !== style || $[41] !== styles?.arrow || $[42] !== styles?.content || $[43] !== title) {
|
|
159
|
+
t18 = hasTitle && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Portal, {
|
|
244
160
|
children: /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
245
161
|
direction: direction,
|
|
246
|
-
children:
|
|
162
|
+
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Content, {
|
|
163
|
+
"data-tao-tooltip-content": "",
|
|
164
|
+
className: cx(classNames?.content, className),
|
|
165
|
+
style: {
|
|
166
|
+
...colorStyle,
|
|
167
|
+
...styles?.content,
|
|
168
|
+
...style
|
|
169
|
+
},
|
|
170
|
+
side: placement,
|
|
171
|
+
sideOffset: 4,
|
|
172
|
+
onEscapeKeyDown: ()=>{
|
|
173
|
+
pointerDriven.current = false;
|
|
174
|
+
},
|
|
175
|
+
...hoverProps,
|
|
176
|
+
children: [
|
|
177
|
+
title,
|
|
178
|
+
arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Arrow, {
|
|
179
|
+
asChild: true,
|
|
180
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
181
|
+
"data-tao-tooltip-arrow": "",
|
|
182
|
+
className: cx(classNames?.arrow),
|
|
183
|
+
style: {
|
|
184
|
+
...color ? {
|
|
185
|
+
"--tao-tooltip-arrow-bg": color
|
|
186
|
+
} : void 0,
|
|
187
|
+
...styles?.arrow
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
})
|
|
247
193
|
})
|
|
248
194
|
});
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
195
|
+
$[30] = arrow;
|
|
196
|
+
$[31] = className;
|
|
197
|
+
$[32] = classNames?.arrow;
|
|
198
|
+
$[33] = classNames?.content;
|
|
199
|
+
$[34] = color;
|
|
200
|
+
$[35] = colorStyle;
|
|
201
|
+
$[36] = direction;
|
|
202
|
+
$[37] = hasTitle;
|
|
203
|
+
$[38] = hoverProps;
|
|
204
|
+
$[39] = placement;
|
|
205
|
+
$[40] = style;
|
|
206
|
+
$[41] = styles?.arrow;
|
|
207
|
+
$[42] = styles?.content;
|
|
208
|
+
$[43] = title;
|
|
209
|
+
$[44] = t18;
|
|
210
|
+
} else t18 = $[44];
|
|
211
|
+
let t19;
|
|
212
|
+
if ($[45] !== handleOpenChange || $[46] !== realOpen || $[47] !== t17 || $[48] !== t18) {
|
|
213
|
+
t19 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Root, {
|
|
256
214
|
open: realOpen,
|
|
257
215
|
onOpenChange: handleOpenChange,
|
|
258
216
|
children: [
|
|
259
|
-
|
|
260
|
-
|
|
217
|
+
t17,
|
|
218
|
+
t18
|
|
261
219
|
]
|
|
262
220
|
});
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
} else
|
|
269
|
-
let
|
|
270
|
-
if ($[
|
|
271
|
-
|
|
272
|
-
delayDuration:
|
|
273
|
-
children:
|
|
221
|
+
$[45] = handleOpenChange;
|
|
222
|
+
$[46] = realOpen;
|
|
223
|
+
$[47] = t17;
|
|
224
|
+
$[48] = t18;
|
|
225
|
+
$[49] = t19;
|
|
226
|
+
} else t19 = $[49];
|
|
227
|
+
let t20;
|
|
228
|
+
if ($[50] !== t14 || $[51] !== t19) {
|
|
229
|
+
t20 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Provider, {
|
|
230
|
+
delayDuration: t14,
|
|
231
|
+
children: t19
|
|
274
232
|
});
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
} else
|
|
279
|
-
return
|
|
233
|
+
$[50] = t14;
|
|
234
|
+
$[51] = t19;
|
|
235
|
+
$[52] = t20;
|
|
236
|
+
} else t20 = $[52];
|
|
237
|
+
return t20;
|
|
280
238
|
}
|
|
281
239
|
export { Tooltip };
|
|
@@ -63,6 +63,7 @@ function InternalTreeSelect(props, ref) {
|
|
|
63
63
|
"data-tao-error": 'error' === status || void 0,
|
|
64
64
|
"data-tao-warning": 'warning' === status || void 0,
|
|
65
65
|
disabled: disabled,
|
|
66
|
+
"aria-invalid": 'error' === status ? true : props['aria-invalid'],
|
|
66
67
|
onInputKeyDown: (event)=>{
|
|
67
68
|
props.onInputKeyDown?.(event);
|
|
68
69
|
if ('Enter' === event.key && (event.nativeEvent.isComposing || 229 === event.keyCode)) event.stopPropagation();
|
|
@@ -6,9 +6,10 @@ import { resolveNumberFormat } from "./locale.js";
|
|
|
6
6
|
import { fromPercent, toPercent } from "./percentage.js";
|
|
7
7
|
import { clampToRange, isValidCanonical, stripDisallowedSign, toCanonical } from "./validate.js";
|
|
8
8
|
function useNumberInput(opts) {
|
|
9
|
-
const { value: externalValue, defaultValue, onChange, onBlur, locale: localeProp, decimalSeparator, thousandsSeparator: thousandsSeparatorProp, decimalPlaces = 2, padDecimalsOnBlur: padMode = 'never', isPercentage = false, allowNegative = false, min, max } = opts;
|
|
9
|
+
const { value: externalValue, defaultValue, onChange, onBlur, locale: localeProp, decimalSeparator, thousandsSeparator: thousandsSeparatorProp, decimalPlaces = 2, padDecimalsOnBlur: padMode = 'never', isPercentage = false, allowNegative = false, min, max, disabled: disabledProp } = opts;
|
|
10
10
|
const value = 'number' == typeof externalValue ? toCanonical(externalValue) : externalValue;
|
|
11
11
|
const config = useTaoConfig();
|
|
12
|
+
const disabled = disabledProp ?? config.disabled;
|
|
12
13
|
const locale = localeProp ?? config.locale.numberLocale;
|
|
13
14
|
const fmtOpts = useMemo(()=>resolveNumberFormat(locale, {
|
|
14
15
|
decimalSeparator,
|
|
@@ -111,6 +112,7 @@ function useNumberInput(opts) {
|
|
|
111
112
|
displayBuffer
|
|
112
113
|
]);
|
|
113
114
|
const handleChange = (e)=>{
|
|
115
|
+
if (disabled) return;
|
|
114
116
|
const raw = e.target.value;
|
|
115
117
|
const cursor = e.target.selectionStart ?? raw.length;
|
|
116
118
|
let canonical_1 = parse(raw, fmtOpts);
|
|
@@ -147,16 +149,18 @@ function useNumberInput(opts) {
|
|
|
147
149
|
};
|
|
148
150
|
const handleBlur = ()=>{
|
|
149
151
|
isFocusedRef.current = false;
|
|
152
|
+
if (disabled) return;
|
|
150
153
|
const previous = isValueControlled ? value ?? '' : derivedActual;
|
|
151
154
|
const actual_3 = commit();
|
|
152
155
|
if (actual_3 !== previous) onChange?.(actual_3);
|
|
153
156
|
onBlur?.(actual_3);
|
|
154
157
|
};
|
|
155
158
|
const handleFocus = ()=>{
|
|
159
|
+
if (disabled) return;
|
|
156
160
|
isFocusedRef.current = true;
|
|
157
161
|
};
|
|
158
162
|
const handleKeyDown = (e_0)=>{
|
|
159
|
-
if (e_0.nativeEvent.isComposing || 229 === e_0.keyCode) return;
|
|
163
|
+
if (disabled || e_0.nativeEvent.isComposing || 229 === e_0.keyCode) return;
|
|
160
164
|
if ('Enter' === e_0.key) {
|
|
161
165
|
const previous_0 = isValueControlled ? value ?? '' : derivedActual;
|
|
162
166
|
const actual_4 = commit();
|
|
@@ -58,11 +58,25 @@ function useTaoDirection(explicit, t0) {
|
|
|
58
58
|
const target = "self" === source || "auto" === explicit ? element : getComposedParent(element);
|
|
59
59
|
if (!target) return;
|
|
60
60
|
const update = ()=>{
|
|
61
|
-
|
|
62
|
-
setInherited("rtl" === value ? "rtl" : "ltr");
|
|
61
|
+
let resolved;
|
|
63
62
|
for(let ancestor = target; ancestor; ancestor = getComposedParent(ancestor)){
|
|
64
|
-
const
|
|
65
|
-
|
|
63
|
+
const inlineDir = ancestor.style?.direction;
|
|
64
|
+
if ("rtl" === inlineDir || "ltr" === inlineDir) {
|
|
65
|
+
resolved = inlineDir;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
const attrDir = ancestor.getAttribute("dir");
|
|
69
|
+
if ("rtl" === attrDir || "ltr" === attrDir) {
|
|
70
|
+
resolved = attrDir;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const computed = getComputedStyle(target).direction;
|
|
75
|
+
const value = resolved ?? ("rtl" === computed ? "rtl" : contextDirection ?? "ltr");
|
|
76
|
+
setInherited("rtl" === value ? "rtl" : "ltr");
|
|
77
|
+
for(let ancestor_0 = target; ancestor_0; ancestor_0 = getComposedParent(ancestor_0)){
|
|
78
|
+
const auto = "auto" === ancestor_0.getAttribute("dir");
|
|
79
|
+
observer.observe(ancestor_0, {
|
|
66
80
|
attributes: true,
|
|
67
81
|
attributeFilter: [
|
|
68
82
|
"dir",
|
package/dist/theme/control.css
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
[data-tao-control][data-tao-variant="outlined"][data-tao-warning]:hover:not([data-disabled]):not(:focus-within) {
|
|
50
|
-
border-color: color-mix(in
|
|
50
|
+
border-color: color-mix(in oklab, var(--tao-color-warning) 80%, white);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
[data-tao-control][data-tao-variant="outlined"][data-tao-warning]:focus-within, [data-tao-control][data-tao-variant="outlined"][data-tao-warning][data-state="open"] {
|
|
@@ -134,6 +134,10 @@
|
|
|
134
134
|
border-block-end-color: var(--tao-error);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
[data-tao-control][data-tao-variant="borderless"][data-tao-warning] {
|
|
138
|
+
border-block-end-color: var(--tao-warning);
|
|
139
|
+
}
|
|
140
|
+
|
|
137
141
|
[data-tao-control][data-tao-variant="borderless"][data-disabled], [data-tao-control][data-tao-variant="borderless"]:has(input:disabled) {
|
|
138
142
|
color: var(--tao-color-text-disabled);
|
|
139
143
|
cursor: not-allowed;
|
package/dist/theme/theme.css
CHANGED
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
var(--tao-color-bg-base));
|
|
48
48
|
--tao-primary-fg: var(--tao-color-bg-base);
|
|
49
49
|
--tao-error: var(--tao-color-error);
|
|
50
|
-
--tao-error-hover: color-mix(in
|
|
51
|
-
--tao-error-active: color-mix(in
|
|
50
|
+
--tao-error-hover: color-mix(in oklab, var(--tao-color-error) 80%, white);
|
|
51
|
+
--tao-error-active: color-mix(in oklab, var(--tao-color-error) 90%, black);
|
|
52
52
|
--tao-error-bg: color-mix(in oklab,
|
|
53
53
|
var(--tao-color-error) 6%,
|
|
54
54
|
var(--tao-color-bg-base));
|