@rockshin/tao-ui 0.0.31 → 0.0.32
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 +14 -3
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +48 -50
- package/dist/components/checkbox/checkbox.css +5 -1
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +135 -120
- package/dist/components/collapsible/collapsible.js +1 -1
- package/dist/components/context-menu/context-menu.js +1 -1
- package/dist/components/date-picker/calendar/calendar-header.js +1 -1
- package/dist/components/date-picker/calendar/month-grid.d.ts +3 -1
- package/dist/components/date-picker/calendar/month-grid.js +19 -17
- package/dist/components/date-picker/calendar/time-panel.js +1 -1
- package/dist/components/date-picker/calendar/year-grid.d.ts +3 -1
- package/dist/components/date-picker/calendar/year-grid.js +28 -24
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/date-picker.js +37 -24
- package/dist/components/date-picker/presets.js +1 -1
- package/dist/components/date-picker/range-picker.d.ts +1 -1
- package/dist/components/date-picker/range-picker.js +104 -56
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +98 -91
- package/dist/components/dropdown/dropdown.js +84 -84
- package/dist/components/form/form-item.js +8 -4
- package/dist/components/form/form.js +1 -1
- package/dist/components/form-actions/form-actions.js +1 -1
- package/dist/components/form-field/form-field-view.js +58 -51
- package/dist/components/form-field/form-field.js +1 -1
- package/dist/components/form-section/form-section.js +1 -1
- package/dist/components/input/input.js +42 -39
- package/dist/components/input-number/input-number.d.ts +2 -2
- package/dist/components/input-number/input-number.js +57 -59
- package/dist/components/menu/menu-render.js +1 -1
- package/dist/components/modal/confirm-dialog.d.ts +2 -1
- package/dist/components/modal/confirm-dialog.js +25 -5
- package/dist/components/modal/confirm.js +15 -3
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/modal/modal.js +131 -132
- package/dist/components/modal/use-modal.js +48 -35
- package/dist/components/pagination/pagination.js +3 -1
- package/dist/components/popconfirm/popconfirm.js +1 -1
- package/dist/components/popover/popover.js +253 -228
- package/dist/components/radio/radio.css +2 -2
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +7 -7
- package/dist/components/scroll-area/scroll-area.css +2 -2
- package/dist/components/scroll-area/scroll-area.js +187 -165
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +12 -6
- package/dist/components/select/select-icons.js +1 -1
- package/dist/components/select/select-searchable-list.d.ts +1 -1
- package/dist/components/select/select-searchable-list.js +35 -21
- package/dist/components/select/select-tags.js +1 -1
- package/dist/components/select/select-types.d.ts +2 -2
- package/dist/components/select/select.css +4 -0
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +124 -72
- package/dist/components/sonner/sonner.js +6 -5
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.js +187 -194
- package/dist/components/status-icon/status-icon.js +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +6 -6
- package/dist/components/table/table-filter.js +1 -1
- package/dist/components/table/table-icons.js +1 -1
- package/dist/components/table/table.js +483 -599
- package/dist/components/tabs/tabs.js +179 -161
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.js +142 -108
- package/dist/components/tooltip/tooltip.js +88 -72
- package/dist/entries/alert.d.ts +3 -0
- package/dist/entries/alert.js +4 -0
- package/dist/entries/breadcrumb.d.ts +3 -0
- package/dist/entries/breadcrumb.js +4 -0
- package/dist/entries/button.d.ts +3 -0
- package/dist/entries/button.js +4 -0
- package/dist/entries/checkbox.d.ts +3 -0
- package/dist/entries/checkbox.js +4 -0
- package/dist/entries/collapsible.d.ts +3 -0
- package/dist/entries/collapsible.js +4 -0
- package/dist/entries/context-menu.d.ts +3 -0
- package/dist/entries/context-menu.js +4 -0
- package/dist/entries/date-picker.d.ts +3 -0
- package/dist/entries/date-picker.js +4 -0
- package/dist/entries/drawer.d.ts +3 -0
- package/dist/entries/drawer.js +4 -0
- package/dist/entries/dropdown.d.ts +3 -0
- package/dist/entries/dropdown.js +4 -0
- package/dist/entries/form-actions.d.ts +3 -0
- package/dist/entries/form-actions.js +4 -0
- package/dist/entries/form-field.d.ts +3 -0
- package/dist/entries/form-field.js +4 -0
- package/dist/entries/form-layout.d.ts +3 -0
- package/dist/entries/form-layout.js +4 -0
- package/dist/entries/form-section.d.ts +3 -0
- package/dist/entries/form-section.js +4 -0
- package/dist/entries/form.d.ts +4 -0
- package/dist/entries/form.js +4 -0
- package/dist/entries/input-number.d.ts +3 -0
- package/dist/entries/input-number.js +4 -0
- package/dist/entries/input.d.ts +3 -0
- package/dist/entries/input.js +4 -0
- package/dist/entries/modal.d.ts +3 -0
- package/dist/entries/modal.js +4 -0
- package/dist/entries/number-input.d.ts +3 -0
- package/dist/entries/number-input.js +4 -0
- package/dist/entries/pagination.d.ts +3 -0
- package/dist/entries/pagination.js +4 -0
- package/dist/entries/popconfirm.d.ts +3 -0
- package/dist/entries/popconfirm.js +4 -0
- package/dist/entries/popover.d.ts +3 -0
- package/dist/entries/popover.js +4 -0
- package/dist/entries/provider.d.ts +3 -0
- package/dist/entries/provider.js +4 -0
- package/dist/entries/radio.d.ts +3 -0
- package/dist/entries/radio.js +4 -0
- package/dist/entries/range-picker.d.ts +3 -0
- package/dist/entries/range-picker.js +4 -0
- package/dist/entries/scroll-area.d.ts +3 -0
- package/dist/entries/scroll-area.js +4 -0
- package/dist/entries/select.d.ts +3 -0
- package/dist/entries/select.js +4 -0
- package/dist/entries/sonner.d.ts +3 -0
- package/dist/entries/sonner.js +4 -0
- package/dist/entries/spinner.d.ts +3 -0
- package/dist/entries/spinner.js +4 -0
- package/dist/entries/splitter.d.ts +3 -0
- package/dist/entries/splitter.js +4 -0
- package/dist/entries/stack.d.ts +3 -0
- package/dist/entries/stack.js +4 -0
- package/dist/entries/switch.d.ts +3 -0
- package/dist/entries/switch.js +4 -0
- package/dist/entries/table.d.ts +3 -0
- package/dist/entries/table.js +4 -0
- package/dist/entries/tabs.d.ts +3 -0
- package/dist/entries/tabs.js +4 -0
- package/dist/entries/tag.d.ts +3 -0
- package/dist/entries/tag.js +4 -0
- package/dist/entries/textarea.d.ts +3 -0
- package/dist/entries/textarea.js +4 -0
- package/dist/entries/tooltip.d.ts +3 -0
- package/dist/entries/tooltip.js +4 -0
- package/dist/layouts/form-layout/form-layout.js +1 -1
- package/dist/layouts/stack/stack.js +1 -1
- package/dist/number-input/number-input.js +1 -1
- package/dist/number-input/use-number-input.d.ts +2 -2
- package/dist/number-input/use-number-input.js +224 -131
- package/dist/number-input/validate.js +7 -2
- package/dist/provider/tao-provider.js +1 -1
- package/dist/utils/dialog-content.d.ts +10 -0
- package/dist/utils/dialog-content.js +222 -0
- package/dist/utils/overlay.d.ts +2 -2
- package/dist/utils/overlay.js +8 -3
- package/dist/utils/refs.js +17 -2
- package/llms.txt +5 -3
- package/package.json +21 -8
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
3
|
-
import {
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
4
|
import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
|
+
import { asTriggerChild } from "../../utils/overlay.js";
|
|
5
6
|
import { cx } from "../../utils/semantic.js";
|
|
6
7
|
import { Button } from "../button/button.js";
|
|
7
8
|
import { ContextMenu } from "../context-menu/context-menu.js";
|
|
@@ -64,7 +65,7 @@ function EllipsisIcon() {
|
|
|
64
65
|
return t0;
|
|
65
66
|
}
|
|
66
67
|
function Dropdown(props) {
|
|
67
|
-
const $ = c(
|
|
68
|
+
const $ = c(62);
|
|
68
69
|
const { menu, children, trigger: t0, placement: t1, open, defaultOpen, onOpenChange, disabled, arrow: t2, className, style, classNames, styles } = props;
|
|
69
70
|
let t3;
|
|
70
71
|
if ($[0] !== t0) {
|
|
@@ -110,47 +111,46 @@ function Dropdown(props) {
|
|
|
110
111
|
const setOpen = t6;
|
|
111
112
|
const closeTimer = useRef(void 0);
|
|
112
113
|
let t7;
|
|
113
|
-
if ($[10] !== setOpen) {
|
|
114
|
+
if ($[10] !== resolvedDisabled || $[11] !== setOpen) {
|
|
114
115
|
t7 = ()=>{
|
|
115
116
|
clearTimeout(closeTimer.current);
|
|
116
|
-
setOpen(true);
|
|
117
|
+
if (!resolvedDisabled) setOpen(true);
|
|
117
118
|
};
|
|
118
|
-
$[10] =
|
|
119
|
-
$[11] =
|
|
120
|
-
|
|
119
|
+
$[10] = resolvedDisabled;
|
|
120
|
+
$[11] = setOpen;
|
|
121
|
+
$[12] = t7;
|
|
122
|
+
} else t7 = $[12];
|
|
121
123
|
const openOnHover = t7;
|
|
122
124
|
let t8;
|
|
123
|
-
if ($[
|
|
125
|
+
if ($[13] !== setOpen) {
|
|
124
126
|
t8 = ()=>{
|
|
125
127
|
closeTimer.current = setTimeout(()=>setOpen(false), 120);
|
|
126
128
|
};
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
} else t8 = $[
|
|
129
|
+
$[13] = setOpen;
|
|
130
|
+
$[14] = t8;
|
|
131
|
+
} else t8 = $[14];
|
|
130
132
|
const closeOnHover = t8;
|
|
131
133
|
let t9;
|
|
132
|
-
if ($[
|
|
134
|
+
if ($[15] !== classNames || $[16] !== styles) {
|
|
133
135
|
t9 = {
|
|
134
136
|
classNames,
|
|
135
137
|
styles
|
|
136
138
|
};
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
} else t9 = $[
|
|
139
|
+
$[15] = classNames;
|
|
140
|
+
$[16] = styles;
|
|
141
|
+
$[17] = t9;
|
|
142
|
+
} else t9 = $[17];
|
|
141
143
|
const content = useMenuController(menu, DD, t9);
|
|
142
144
|
let t10;
|
|
143
|
-
if ($[
|
|
144
|
-
t10 =
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
$[18] = t10;
|
|
149
|
-
} else t10 = $[18];
|
|
145
|
+
if ($[18] !== children) {
|
|
146
|
+
t10 = asTriggerChild(children);
|
|
147
|
+
$[18] = children;
|
|
148
|
+
$[19] = t10;
|
|
149
|
+
} else t10 = $[19];
|
|
150
150
|
const triggerChild = t10;
|
|
151
151
|
if (isContext) {
|
|
152
152
|
let t11;
|
|
153
|
-
if ($[
|
|
153
|
+
if ($[20] !== children || $[21] !== className || $[22] !== classNames || $[23] !== disabled || $[24] !== menu || $[25] !== onOpenChange || $[26] !== open || $[27] !== style || $[28] !== styles) {
|
|
154
154
|
t11 = /*#__PURE__*/ jsx(ContextMenu, {
|
|
155
155
|
menu: menu,
|
|
156
156
|
open: open,
|
|
@@ -162,40 +162,40 @@ function Dropdown(props) {
|
|
|
162
162
|
styles: styles,
|
|
163
163
|
children: children
|
|
164
164
|
});
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
} else t11 = $[
|
|
165
|
+
$[20] = children;
|
|
166
|
+
$[21] = className;
|
|
167
|
+
$[22] = classNames;
|
|
168
|
+
$[23] = disabled;
|
|
169
|
+
$[24] = menu;
|
|
170
|
+
$[25] = onOpenChange;
|
|
171
|
+
$[26] = open;
|
|
172
|
+
$[27] = style;
|
|
173
|
+
$[28] = styles;
|
|
174
|
+
$[29] = t11;
|
|
175
|
+
} else t11 = $[29];
|
|
176
176
|
return t11;
|
|
177
177
|
}
|
|
178
178
|
let t11;
|
|
179
|
-
if ($[
|
|
179
|
+
if ($[30] !== placement) {
|
|
180
180
|
t11 = parsePlacement(placement);
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
} else t11 = $[
|
|
181
|
+
$[30] = placement;
|
|
182
|
+
$[31] = t11;
|
|
183
|
+
} else t11 = $[31];
|
|
184
184
|
const { side, align } = t11;
|
|
185
185
|
let t12;
|
|
186
|
-
if ($[
|
|
186
|
+
if ($[32] !== closeOnHover || $[33] !== hoverMode || $[34] !== openOnHover) {
|
|
187
187
|
t12 = hoverMode ? {
|
|
188
188
|
onPointerEnter: openOnHover,
|
|
189
189
|
onPointerLeave: closeOnHover
|
|
190
190
|
} : void 0;
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else t12 = $[
|
|
191
|
+
$[32] = closeOnHover;
|
|
192
|
+
$[33] = hoverMode;
|
|
193
|
+
$[34] = openOnHover;
|
|
194
|
+
$[35] = t12;
|
|
195
|
+
} else t12 = $[35];
|
|
196
196
|
const hoverProps = t12;
|
|
197
197
|
let t13;
|
|
198
|
-
if ($[
|
|
198
|
+
if ($[36] !== hoverProps || $[37] !== resolvedDisabled || $[38] !== triggerChild) {
|
|
199
199
|
t13 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Trigger, {
|
|
200
200
|
asChild: true,
|
|
201
201
|
disabled: resolvedDisabled,
|
|
@@ -203,43 +203,43 @@ function Dropdown(props) {
|
|
|
203
203
|
...hoverProps,
|
|
204
204
|
children: triggerChild
|
|
205
205
|
});
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
} else t13 = $[
|
|
206
|
+
$[36] = hoverProps;
|
|
207
|
+
$[37] = resolvedDisabled;
|
|
208
|
+
$[38] = triggerChild;
|
|
209
|
+
$[39] = t13;
|
|
210
|
+
} else t13 = $[39];
|
|
211
211
|
const t14 = classNames?.content;
|
|
212
212
|
let t15;
|
|
213
|
-
if ($[
|
|
213
|
+
if ($[40] !== className || $[41] !== t14) {
|
|
214
214
|
t15 = cx(t14, className);
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
} else t15 = $[
|
|
215
|
+
$[40] = className;
|
|
216
|
+
$[41] = t14;
|
|
217
|
+
$[42] = t15;
|
|
218
|
+
} else t15 = $[42];
|
|
219
219
|
const t16 = styles?.content;
|
|
220
220
|
let t17;
|
|
221
|
-
if ($[
|
|
221
|
+
if ($[43] !== style || $[44] !== t16) {
|
|
222
222
|
t17 = {
|
|
223
223
|
...t16,
|
|
224
224
|
...style
|
|
225
225
|
};
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
} else t17 = $[
|
|
226
|
+
$[43] = style;
|
|
227
|
+
$[44] = t16;
|
|
228
|
+
$[45] = t17;
|
|
229
|
+
} else t17 = $[45];
|
|
230
230
|
let t18;
|
|
231
|
-
if ($[
|
|
231
|
+
if ($[46] !== arrow) {
|
|
232
232
|
t18 = arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Arrow, {
|
|
233
233
|
asChild: true,
|
|
234
234
|
children: /*#__PURE__*/ jsx("span", {
|
|
235
235
|
"data-tao-dropdown-arrow": ""
|
|
236
236
|
})
|
|
237
237
|
});
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
} else t18 = $[
|
|
238
|
+
$[46] = arrow;
|
|
239
|
+
$[47] = t18;
|
|
240
|
+
} else t18 = $[47];
|
|
241
241
|
let t19;
|
|
242
|
-
if ($[
|
|
242
|
+
if ($[48] !== align || $[49] !== content || $[50] !== hoverProps || $[51] !== side || $[52] !== size || $[53] !== t15 || $[54] !== t17 || $[55] !== t18) {
|
|
243
243
|
t19 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Portal, {
|
|
244
244
|
children: /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
245
245
|
asChild: true,
|
|
@@ -260,18 +260,18 @@ function Dropdown(props) {
|
|
|
260
260
|
})
|
|
261
261
|
})
|
|
262
262
|
});
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else t19 = $[
|
|
263
|
+
$[48] = align;
|
|
264
|
+
$[49] = content;
|
|
265
|
+
$[50] = hoverProps;
|
|
266
|
+
$[51] = side;
|
|
267
|
+
$[52] = size;
|
|
268
|
+
$[53] = t15;
|
|
269
|
+
$[54] = t17;
|
|
270
|
+
$[55] = t18;
|
|
271
|
+
$[56] = t19;
|
|
272
|
+
} else t19 = $[56];
|
|
273
273
|
let t20;
|
|
274
|
-
if ($[
|
|
274
|
+
if ($[57] !== realOpen || $[58] !== setOpen || $[59] !== t13 || $[60] !== t19) {
|
|
275
275
|
t20 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Root, {
|
|
276
276
|
open: realOpen,
|
|
277
277
|
onOpenChange: setOpen,
|
|
@@ -281,12 +281,12 @@ function Dropdown(props) {
|
|
|
281
281
|
t19
|
|
282
282
|
]
|
|
283
283
|
});
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
} else t20 = $[
|
|
284
|
+
$[57] = realOpen;
|
|
285
|
+
$[58] = setOpen;
|
|
286
|
+
$[59] = t13;
|
|
287
|
+
$[60] = t19;
|
|
288
|
+
$[61] = t20;
|
|
289
|
+
} else t20 = $[61];
|
|
290
290
|
return t20;
|
|
291
291
|
}
|
|
292
292
|
function DropdownButton(t0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { Field } from "@rc-component/form";
|
|
4
4
|
import { cloneElement, isValidElement } from "react";
|
|
5
5
|
import { FormFieldView } from "../form-field/form-field-view.js";
|
|
@@ -19,8 +19,8 @@ function FormItem(t0) {
|
|
|
19
19
|
let t2;
|
|
20
20
|
if ($[3] !== className || $[4] !== classNames || $[5] !== extra || $[6] !== help || $[7] !== htmlFor || $[8] !== label || $[9] !== layout || $[10] !== noStyle || $[11] !== requiredMark || $[12] !== style || $[13] !== styles || $[14] !== validateStatus || $[15] !== valuePropName) {
|
|
21
21
|
t2 = (content, meta, control)=>{
|
|
22
|
-
const status = validateStatus ?? (meta?.errors.length ? "error" : void 0);
|
|
23
|
-
const message = help ?? meta?.errors[0];
|
|
22
|
+
const status = validateStatus ?? (meta?.errors.length ? "error" : meta?.warnings.length ? "warning" : void 0);
|
|
23
|
+
const message = help ?? meta?.errors[0] ?? meta?.warnings[0];
|
|
24
24
|
const showAsStatus = null != message && null != status;
|
|
25
25
|
const errorSlot = showAsStatus ? message : void 0;
|
|
26
26
|
const descriptionSlot = extra ?? (showAsStatus ? void 0 : message);
|
|
@@ -29,7 +29,11 @@ function FormItem(t0) {
|
|
|
29
29
|
...controlProps,
|
|
30
30
|
status
|
|
31
31
|
};
|
|
32
|
-
if (controlProps &&
|
|
32
|
+
if (controlProps && "checked" === valuePropName && "checked" in controlProps && void 0 === controlProps.checked) controlProps = {
|
|
33
|
+
...controlProps,
|
|
34
|
+
checked: false
|
|
35
|
+
};
|
|
36
|
+
if (controlProps && /*#__PURE__*/ isValidElement(content) && ("input" === content.type || "textarea" === content.type) && null == valuePropName && void 0 === controlProps.value) controlProps = {
|
|
33
37
|
...controlProps,
|
|
34
38
|
value: ""
|
|
35
39
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import _rc_component_form, { FieldContext, FormProvider, List, useForm, useWatch } from "@rc-component/form";
|
|
4
4
|
import { forwardRef, useContext } from "react";
|
|
5
5
|
import { TaoProvider } from "../../provider/tao-provider.js";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { cloneElement, isValidElement, useId } from "react";
|
|
4
4
|
import { cx } from "../../utils/semantic.js";
|
|
5
5
|
function FormFieldView(t0) {
|
|
6
|
-
const $ = c(
|
|
6
|
+
const $ = c(47);
|
|
7
7
|
const { label, htmlFor, required, error, warning, description, layout: t1, controlProps, children, className, style, classNames, styles } = t0;
|
|
8
8
|
const layout = void 0 === t1 ? "vertical" : t1;
|
|
9
9
|
const generatedId = useId();
|
|
10
10
|
const child = /*#__PURE__*/ isValidElement(children) ? children : null;
|
|
11
11
|
const childId = "string" == typeof child?.props.id ? child.props.id : void 0;
|
|
12
12
|
const controlId = htmlFor ?? childId ?? `${generatedId}-control`;
|
|
13
|
+
const labelId = `${generatedId}-label`;
|
|
13
14
|
const descriptionId = `${generatedId}-description`;
|
|
14
15
|
const errorId = `${generatedId}-error`;
|
|
15
16
|
const childDescribedBy = "string" == typeof child?.props["aria-describedby"] ? child.props["aria-describedby"] : void 0;
|
|
@@ -26,13 +27,14 @@ function FormFieldView(t0) {
|
|
|
26
27
|
} else t3 = $[2];
|
|
27
28
|
const describedBy = t3.join(" ");
|
|
28
29
|
let t4;
|
|
29
|
-
if ($[3] !== child || $[4] !== children || $[5] !== controlId || $[6] !== controlProps || $[7] !== describedBy || $[8] !== error || $[9] !== errorId || $[10] !== required) {
|
|
30
|
+
if ($[3] !== child || $[4] !== children || $[5] !== controlId || $[6] !== controlProps || $[7] !== describedBy || $[8] !== error || $[9] !== errorId || $[10] !== label || $[11] !== labelId || $[12] !== required || $[13] !== warning) {
|
|
30
31
|
t4 = child ? /*#__PURE__*/ cloneElement(child, {
|
|
31
32
|
...controlProps,
|
|
32
33
|
id: controlId,
|
|
34
|
+
"aria-labelledby": child.props["aria-labelledby"] ?? (null == label || child.props["aria-label"] ? void 0 : labelId),
|
|
33
35
|
"aria-describedby": describedBy || void 0,
|
|
34
|
-
"aria-errormessage": error ? errorId :
|
|
35
|
-
"aria-invalid": error ? true : child.props["aria-invalid"],
|
|
36
|
+
"aria-errormessage": error && !warning ? errorId : child.props["aria-errormessage"],
|
|
37
|
+
"aria-invalid": error && !warning ? true : child.props["aria-invalid"],
|
|
36
38
|
"aria-required": required ? true : child.props["aria-required"]
|
|
37
39
|
}) : children;
|
|
38
40
|
$[3] = child;
|
|
@@ -42,33 +44,37 @@ function FormFieldView(t0) {
|
|
|
42
44
|
$[7] = describedBy;
|
|
43
45
|
$[8] = error;
|
|
44
46
|
$[9] = errorId;
|
|
45
|
-
$[10] =
|
|
46
|
-
$[11] =
|
|
47
|
-
|
|
47
|
+
$[10] = label;
|
|
48
|
+
$[11] = labelId;
|
|
49
|
+
$[12] = required;
|
|
50
|
+
$[13] = warning;
|
|
51
|
+
$[14] = t4;
|
|
52
|
+
} else t4 = $[14];
|
|
48
53
|
const control = t4;
|
|
49
54
|
const t5 = classNames?.root;
|
|
50
55
|
let t6;
|
|
51
|
-
if ($[
|
|
56
|
+
if ($[15] !== className || $[16] !== t5) {
|
|
52
57
|
t6 = cx(t5, className);
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
} else t6 = $[
|
|
58
|
+
$[15] = className;
|
|
59
|
+
$[16] = t5;
|
|
60
|
+
$[17] = t6;
|
|
61
|
+
} else t6 = $[17];
|
|
57
62
|
const t7 = styles?.root;
|
|
58
63
|
let t8;
|
|
59
|
-
if ($[
|
|
64
|
+
if ($[18] !== style || $[19] !== t7) {
|
|
60
65
|
t8 = {
|
|
61
66
|
...t7,
|
|
62
67
|
...style
|
|
63
68
|
};
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
} else t8 = $[
|
|
69
|
+
$[18] = style;
|
|
70
|
+
$[19] = t7;
|
|
71
|
+
$[20] = t8;
|
|
72
|
+
} else t8 = $[20];
|
|
68
73
|
const t9 = "horizontal" === layout ? "horizontal" : void 0;
|
|
69
74
|
let t10;
|
|
70
|
-
if ($[
|
|
75
|
+
if ($[21] !== classNames?.label || $[22] !== controlId || $[23] !== label || $[24] !== labelId || $[25] !== required || $[26] !== styles?.label) {
|
|
71
76
|
t10 = null != label && /*#__PURE__*/ jsxs("label", {
|
|
77
|
+
id: labelId,
|
|
72
78
|
htmlFor: controlId,
|
|
73
79
|
className: classNames?.label,
|
|
74
80
|
style: styles?.label,
|
|
@@ -82,15 +88,16 @@ function FormFieldView(t0) {
|
|
|
82
88
|
})
|
|
83
89
|
]
|
|
84
90
|
});
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
|
|
91
|
+
$[21] = classNames?.label;
|
|
92
|
+
$[22] = controlId;
|
|
93
|
+
$[23] = label;
|
|
94
|
+
$[24] = labelId;
|
|
95
|
+
$[25] = required;
|
|
96
|
+
$[26] = styles?.label;
|
|
97
|
+
$[27] = t10;
|
|
98
|
+
} else t10 = $[27];
|
|
92
99
|
let t11;
|
|
93
|
-
if ($[
|
|
100
|
+
if ($[28] !== classNames?.description || $[29] !== classNames?.error || $[30] !== description || $[31] !== descriptionId || $[32] !== error || $[33] !== errorId || $[34] !== styles?.description || $[35] !== styles?.error || $[36] !== warning) {
|
|
94
101
|
t11 = error ? /*#__PURE__*/ jsx("p", {
|
|
95
102
|
className: classNames?.error,
|
|
96
103
|
style: styles?.error,
|
|
@@ -106,19 +113,19 @@ function FormFieldView(t0) {
|
|
|
106
113
|
id: descriptionId,
|
|
107
114
|
children: description
|
|
108
115
|
}) : null;
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
} else t11 = $[
|
|
116
|
+
$[28] = classNames?.description;
|
|
117
|
+
$[29] = classNames?.error;
|
|
118
|
+
$[30] = description;
|
|
119
|
+
$[31] = descriptionId;
|
|
120
|
+
$[32] = error;
|
|
121
|
+
$[33] = errorId;
|
|
122
|
+
$[34] = styles?.description;
|
|
123
|
+
$[35] = styles?.error;
|
|
124
|
+
$[36] = warning;
|
|
125
|
+
$[37] = t11;
|
|
126
|
+
} else t11 = $[37];
|
|
120
127
|
let t12;
|
|
121
|
-
if ($[
|
|
128
|
+
if ($[38] !== control || $[39] !== t11) {
|
|
122
129
|
t12 = /*#__PURE__*/ jsxs("div", {
|
|
123
130
|
"data-tao-form-control": "",
|
|
124
131
|
children: [
|
|
@@ -126,12 +133,12 @@ function FormFieldView(t0) {
|
|
|
126
133
|
t11
|
|
127
134
|
]
|
|
128
135
|
});
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
} else t12 = $[
|
|
136
|
+
$[38] = control;
|
|
137
|
+
$[39] = t11;
|
|
138
|
+
$[40] = t12;
|
|
139
|
+
} else t12 = $[40];
|
|
133
140
|
let t13;
|
|
134
|
-
if ($[
|
|
141
|
+
if ($[41] !== t10 || $[42] !== t12 || $[43] !== t6 || $[44] !== t8 || $[45] !== t9) {
|
|
135
142
|
t13 = /*#__PURE__*/ jsxs("div", {
|
|
136
143
|
className: t6,
|
|
137
144
|
style: t8,
|
|
@@ -142,13 +149,13 @@ function FormFieldView(t0) {
|
|
|
142
149
|
t12
|
|
143
150
|
]
|
|
144
151
|
});
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
} else t13 = $[
|
|
152
|
+
$[41] = t10;
|
|
153
|
+
$[42] = t12;
|
|
154
|
+
$[43] = t6;
|
|
155
|
+
$[44] = t8;
|
|
156
|
+
$[45] = t9;
|
|
157
|
+
$[46] = t13;
|
|
158
|
+
} else t13 = $[46];
|
|
152
159
|
return t13;
|
|
153
160
|
}
|
|
154
161
|
export { FormFieldView };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { cx } from "../../utils/semantic.js";
|
|
6
6
|
import "./input.css";
|
|
7
7
|
const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(45);
|
|
9
9
|
let className;
|
|
10
10
|
let classNames;
|
|
11
11
|
let disabled;
|
|
@@ -85,43 +85,46 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
85
85
|
$[21] = styles?.prefix;
|
|
86
86
|
$[22] = t7;
|
|
87
87
|
} else t7 = $[22];
|
|
88
|
-
const t8 =
|
|
89
|
-
const t9 =
|
|
90
|
-
const t10 =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
const t8 = "value" in rest ? rest.value ?? "" : void 0;
|
|
89
|
+
const t9 = classNames?.input;
|
|
90
|
+
const t10 = styles?.input;
|
|
91
|
+
const t11 = "error" === status || error || void 0;
|
|
92
|
+
let t12;
|
|
93
|
+
if ($[23] !== ref || $[24] !== resolvedDisabled || $[25] !== rest || $[26] !== t10 || $[27] !== t11 || $[28] !== t8 || $[29] !== t9) {
|
|
94
|
+
t12 = /*#__PURE__*/ jsx("input", {
|
|
94
95
|
...rest,
|
|
96
|
+
value: t8,
|
|
95
97
|
ref: ref,
|
|
96
|
-
className:
|
|
97
|
-
style:
|
|
98
|
+
className: t9,
|
|
99
|
+
style: t10,
|
|
98
100
|
disabled: resolvedDisabled,
|
|
99
|
-
"aria-invalid":
|
|
101
|
+
"aria-invalid": t11
|
|
100
102
|
});
|
|
101
103
|
$[23] = ref;
|
|
102
104
|
$[24] = resolvedDisabled;
|
|
103
105
|
$[25] = rest;
|
|
104
106
|
$[26] = t10;
|
|
105
|
-
$[27] =
|
|
106
|
-
$[28] =
|
|
107
|
-
$[29] =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
$[27] = t11;
|
|
108
|
+
$[28] = t8;
|
|
109
|
+
$[29] = t9;
|
|
110
|
+
$[30] = t12;
|
|
111
|
+
} else t12 = $[30];
|
|
112
|
+
let t13;
|
|
113
|
+
if ($[31] !== classNames?.suffix || $[32] !== styles?.suffix || $[33] !== suffix) {
|
|
114
|
+
t13 = null != suffix && /*#__PURE__*/ jsx("span", {
|
|
112
115
|
className: classNames?.suffix,
|
|
113
116
|
style: styles?.suffix,
|
|
114
117
|
"data-tao-suffix": "",
|
|
115
118
|
children: suffix
|
|
116
119
|
});
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
} else
|
|
122
|
-
let
|
|
123
|
-
if ($[
|
|
124
|
-
|
|
120
|
+
$[31] = classNames?.suffix;
|
|
121
|
+
$[32] = styles?.suffix;
|
|
122
|
+
$[33] = suffix;
|
|
123
|
+
$[34] = t13;
|
|
124
|
+
} else t13 = $[34];
|
|
125
|
+
let t14;
|
|
126
|
+
if ($[35] !== resolvedSize || $[36] !== resolvedVariant || $[37] !== t12 || $[38] !== t13 || $[39] !== t2 || $[40] !== t4 || $[41] !== t5 || $[42] !== t6 || $[43] !== t7) {
|
|
127
|
+
t14 = /*#__PURE__*/ jsxs("div", {
|
|
125
128
|
className: t2,
|
|
126
129
|
style: t4,
|
|
127
130
|
"data-tao-control": "",
|
|
@@ -132,21 +135,21 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
132
135
|
"data-tao-warning": t6,
|
|
133
136
|
children: [
|
|
134
137
|
t7,
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
t12,
|
|
139
|
+
t13
|
|
137
140
|
]
|
|
138
141
|
});
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[36] = t11;
|
|
142
|
+
$[35] = resolvedSize;
|
|
143
|
+
$[36] = resolvedVariant;
|
|
142
144
|
$[37] = t12;
|
|
143
|
-
$[38] =
|
|
144
|
-
$[39] =
|
|
145
|
-
$[40] =
|
|
146
|
-
$[41] =
|
|
147
|
-
$[42] =
|
|
148
|
-
$[43] =
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
$[38] = t13;
|
|
146
|
+
$[39] = t2;
|
|
147
|
+
$[40] = t4;
|
|
148
|
+
$[41] = t5;
|
|
149
|
+
$[42] = t6;
|
|
150
|
+
$[43] = t7;
|
|
151
|
+
$[44] = t14;
|
|
152
|
+
} else t14 = $[44];
|
|
153
|
+
return t14;
|
|
151
154
|
});
|
|
152
155
|
export { input_Input as Input };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type UseNumberInputOptions } from '../../number-input/use-number-input';
|
|
3
3
|
import type { TaoSize, TaoStatus, TaoVariant } from '../../provider/tao-provider';
|
|
4
4
|
import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic';
|
|
@@ -21,4 +21,4 @@ export interface InputNumberProps extends UseNumberInputOptions {
|
|
|
21
21
|
classNames?: SemanticClassNames<InputNumberSemanticPart>;
|
|
22
22
|
styles?: SemanticStyles<InputNumberSemanticPart>;
|
|
23
23
|
}
|
|
24
|
-
export declare
|
|
24
|
+
export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<InputNumberProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|