@rockshin/tao-ui 0.0.58 → 0.0.59
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 +38 -4
- package/dist/components/app/app-modals.js +11 -6
- package/dist/components/app/app-notices.js +105 -47
- package/dist/components/auto-complete/auto-complete.js +9 -2
- package/dist/components/calendar/calendar.js +22 -18
- package/dist/components/carousel/carousel.js +27 -14
- package/dist/components/cascader/cascader.js +17 -12
- package/dist/components/checkbox/checkbox.d.ts +3 -1
- package/dist/components/checkbox/checkbox.js +65 -58
- package/dist/components/color-picker/color-picker.js +383 -360
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
- package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
- package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/month-grid.js +61 -45
- package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
- package/dist/components/date-picker/calendar/time-panel.js +89 -88
- package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/year-grid.js +60 -44
- package/dist/components/date-picker/date-picker.css +9 -0
- package/dist/components/date-picker/date-picker.js +22 -13
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +127 -70
- package/dist/components/date-picker/types.js +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +4 -3
- package/dist/components/dropdown/dropdown.js +11 -9
- package/dist/components/float-button/float-button.js +4 -4
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +160 -120
- package/dist/components/form-field/form-field-view.d.ts +2 -1
- package/dist/components/form-field/form-field-view.js +173 -108
- package/dist/components/input/input-shared.js +3 -2
- package/dist/components/input/otp.js +114 -110
- package/dist/components/input/password.js +55 -61
- package/dist/components/input/search.js +8 -4
- package/dist/components/mentions/mentions.js +1 -0
- package/dist/components/menu/menu-render.js +1 -0
- package/dist/components/modal/confirm-dialog.js +11 -4
- package/dist/components/modal/modal.js +320 -315
- package/dist/components/pagination/pagination.d.ts +1 -0
- package/dist/components/pagination/pagination.js +1 -0
- package/dist/components/popover/popover.js +325 -289
- package/dist/components/qr-code/qr-code.js +157 -150
- package/dist/components/radio/radio.d.ts +3 -1
- package/dist/components/radio/radio.js +73 -64
- package/dist/components/select/mobile-select.js +6 -3
- package/dist/components/select/select-model.js +2 -2
- package/dist/components/select/select.js +78 -39
- package/dist/components/select/use-select-selection.js +58 -58
- package/dist/components/slider/slider.d.ts +2 -2
- package/dist/components/slider/slider.js +13 -2
- package/dist/components/sonner/sonner.js +2 -2
- package/dist/components/splitter/splitter.css +1 -0
- package/dist/components/splitter/splitter.js +152 -126
- package/dist/components/switch/switch.js +45 -39
- package/dist/components/table/table.js +1 -0
- package/dist/components/table/use-table-data.js +2 -2
- package/dist/components/time-picker/time-picker.js +31 -1
- package/dist/components/tooltip/tooltip.js +237 -99
- package/dist/components/tree/tree.js +31 -3
- package/dist/components/tree-select/tree-select.js +1 -1
- package/dist/components/upload/upload.js +67 -40
- package/dist/locales/ar-EG.js +2 -0
- package/dist/locales/de-DE.js +2 -0
- package/dist/locales/en-US.js +2 -0
- package/dist/locales/es-ES.js +2 -0
- package/dist/locales/fr-FR.js +2 -0
- package/dist/locales/hi-IN.js +2 -0
- package/dist/locales/id-ID.js +2 -0
- package/dist/locales/it-IT.js +2 -0
- package/dist/locales/ja-JP.js +2 -0
- package/dist/locales/ko-KR.js +2 -0
- package/dist/locales/pt-BR.js +2 -0
- package/dist/locales/ru-RU.js +2 -0
- package/dist/locales/th-TH.js +2 -0
- package/dist/locales/tr-TR.js +2 -0
- package/dist/locales/types.d.ts +2 -0
- package/dist/locales/vi-VN.js +2 -0
- package/dist/locales/zh-CN.js +2 -0
- package/dist/locales/zh-TW.js +2 -0
- package/dist/number-input/format.js +1 -1
- package/dist/number-input/use-number-input.js +166 -321
- package/dist/number-input/validate.d.ts +1 -0
- package/dist/number-input/validate.js +1 -1
- package/dist/provider/tao-provider.d.ts +2 -2
- package/dist/provider/tao-provider.js +49 -49
- package/dist/utils/composed-parent.d.ts +1 -0
- package/dist/utils/composed-parent.js +7 -0
- package/dist/utils/portal.d.ts +5 -0
- package/dist/utils/portal.js +7 -1
- package/dist/utils/refs.d.ts +3 -1
- package/dist/utils/refs.js +25 -1
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@ import { cx } from "../../utils/semantic.js";
|
|
|
6
6
|
import "./form.css";
|
|
7
7
|
const hasContent = (value)=>null != value && '' !== value && 'boolean' != typeof value;
|
|
8
8
|
function FormFieldView(t0) {
|
|
9
|
-
const $ = c(
|
|
10
|
-
const { formItem, reserveMessage, label, htmlFor, required, error, invalid, warning, description, extra, layout: t1, controlProps, renderControl, children, className, style, classNames, styles } = t0;
|
|
9
|
+
const $ = c(108);
|
|
10
|
+
const { formItem, reserveMessage, label, htmlFor, required, error, nestedErrors, invalid, warning, description, extra, layout: t1, controlProps, renderControl, children, className, style, classNames, styles } = t0;
|
|
11
11
|
const layout = void 0 === t1 ? "vertical" : t1;
|
|
12
12
|
const generatedId = useId();
|
|
13
13
|
const child = /*#__PURE__*/ isValidElement(children) && children.type !== Fragment ? children : null;
|
|
@@ -125,127 +125,192 @@ function FormFieldView(t0) {
|
|
|
125
125
|
$[38] = t11;
|
|
126
126
|
} else t11 = $[38];
|
|
127
127
|
const message = t11;
|
|
128
|
-
|
|
129
|
-
const t12 = classNames?.root;
|
|
128
|
+
let t12;
|
|
130
129
|
let t13;
|
|
131
|
-
|
|
132
|
-
t13 = cx(t12, className);
|
|
133
|
-
$[39] = className;
|
|
134
|
-
$[40] = t12;
|
|
135
|
-
$[41] = t13;
|
|
136
|
-
} else t13 = $[41];
|
|
137
|
-
const t14 = styles?.root;
|
|
130
|
+
let t14;
|
|
138
131
|
let t15;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
...style
|
|
143
|
-
};
|
|
144
|
-
$[42] = style;
|
|
145
|
-
$[43] = t14;
|
|
146
|
-
$[44] = t15;
|
|
147
|
-
} else t15 = $[44];
|
|
148
|
-
const t16 = formItem ? "" : void 0;
|
|
149
|
-
const t17 = hasMessage ? "" : void 0;
|
|
150
|
-
const t18 = "horizontal" === layout ? "horizontal" : void 0;
|
|
132
|
+
let t16;
|
|
133
|
+
let t17;
|
|
134
|
+
let t18;
|
|
151
135
|
let t19;
|
|
152
|
-
|
|
153
|
-
t19 = hasLabel && /*#__PURE__*/ jsxs("label", {
|
|
154
|
-
id: labelId,
|
|
155
|
-
htmlFor: controlId,
|
|
156
|
-
className: classNames?.label,
|
|
157
|
-
style: styles?.label,
|
|
158
|
-
"data-tao-form-label": "",
|
|
159
|
-
children: [
|
|
160
|
-
label,
|
|
161
|
-
required && /*#__PURE__*/ jsx("span", {
|
|
162
|
-
"data-tao-required": "",
|
|
163
|
-
"aria-hidden": "true",
|
|
164
|
-
children: "*"
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
});
|
|
168
|
-
$[45] = classNames?.label;
|
|
169
|
-
$[46] = controlId;
|
|
170
|
-
$[47] = hasLabel;
|
|
171
|
-
$[48] = label;
|
|
172
|
-
$[49] = labelId;
|
|
173
|
-
$[50] = required;
|
|
174
|
-
$[51] = styles?.label;
|
|
175
|
-
$[52] = t19;
|
|
176
|
-
} else t19 = $[52];
|
|
177
|
-
const t20 = hasLabel ? label : void 0;
|
|
136
|
+
let t20;
|
|
178
137
|
let t21;
|
|
179
|
-
if ($[
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
$[
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
138
|
+
if ($[39] !== child || $[40] !== className || $[41] !== classNames?.error || $[42] !== classNames?.label || $[43] !== classNames?.root || $[44] !== control || $[45] !== controlId || $[46] !== descriptionMessage || $[47] !== extra || $[48] !== extraId || $[49] !== formItem || $[50] !== hasExtra || $[51] !== hasLabel || $[52] !== label || $[53] !== labelId || $[54] !== layout || $[55] !== message || $[56] !== nestedErrors || $[57] !== renderControl || $[58] !== required || $[59] !== reserveMessage || $[60] !== style || $[61] !== styles?.error || $[62] !== styles?.label || $[63] !== styles?.root) {
|
|
139
|
+
const childErrors = Object.entries(nestedErrors ?? {});
|
|
140
|
+
const hasMessage = formItem && (reserveMessage || null !== message || hasExtra || childErrors.length > 0);
|
|
141
|
+
const t22 = classNames?.root;
|
|
142
|
+
if ($[74] !== className || $[75] !== t22) {
|
|
143
|
+
t15 = cx(t22, className);
|
|
144
|
+
$[74] = className;
|
|
145
|
+
$[75] = t22;
|
|
146
|
+
$[76] = t15;
|
|
147
|
+
} else t15 = $[76];
|
|
148
|
+
const t23 = styles?.root;
|
|
149
|
+
if ($[77] !== style || $[78] !== t23) {
|
|
150
|
+
t16 = {
|
|
151
|
+
...t23,
|
|
152
|
+
...style
|
|
153
|
+
};
|
|
154
|
+
$[77] = style;
|
|
155
|
+
$[78] = t23;
|
|
156
|
+
$[79] = t16;
|
|
157
|
+
} else t16 = $[79];
|
|
158
|
+
t17 = "";
|
|
159
|
+
t18 = formItem ? "" : void 0;
|
|
160
|
+
t19 = hasMessage ? "" : void 0;
|
|
161
|
+
t20 = "horizontal" === layout ? "horizontal" : void 0;
|
|
162
|
+
if ($[80] !== classNames?.label || $[81] !== controlId || $[82] !== hasLabel || $[83] !== label || $[84] !== labelId || $[85] !== required || $[86] !== styles?.label) {
|
|
163
|
+
t21 = hasLabel && /*#__PURE__*/ jsxs("label", {
|
|
164
|
+
id: labelId,
|
|
165
|
+
htmlFor: controlId,
|
|
166
|
+
className: classNames?.label,
|
|
167
|
+
style: styles?.label,
|
|
168
|
+
"data-tao-form-label": "",
|
|
169
|
+
children: [
|
|
170
|
+
label,
|
|
171
|
+
required && /*#__PURE__*/ jsx("span", {
|
|
172
|
+
"data-tao-required": "",
|
|
173
|
+
"aria-hidden": "true",
|
|
174
|
+
children: "*"
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
});
|
|
178
|
+
$[80] = classNames?.label;
|
|
179
|
+
$[81] = controlId;
|
|
180
|
+
$[82] = hasLabel;
|
|
181
|
+
$[83] = label;
|
|
182
|
+
$[84] = labelId;
|
|
183
|
+
$[85] = required;
|
|
184
|
+
$[86] = styles?.label;
|
|
185
|
+
$[87] = t21;
|
|
186
|
+
} else t21 = $[87];
|
|
187
|
+
t12 = "";
|
|
188
|
+
const t24 = hasLabel ? label : void 0;
|
|
189
|
+
let t25;
|
|
190
|
+
if ($[88] !== child || $[89] !== control || $[90] !== renderControl) {
|
|
191
|
+
t25 = renderControl && child && /*#__PURE__*/ isValidElement(control) ? renderControl(control) : control;
|
|
192
|
+
$[88] = child;
|
|
193
|
+
$[89] = control;
|
|
194
|
+
$[90] = renderControl;
|
|
195
|
+
$[91] = t25;
|
|
196
|
+
} else t25 = $[91];
|
|
197
|
+
if ($[92] !== t24 || $[93] !== t25) {
|
|
198
|
+
t13 = /*#__PURE__*/ jsx(FieldLabelContext.Provider, {
|
|
199
|
+
value: t24,
|
|
200
|
+
children: t25
|
|
201
|
+
});
|
|
202
|
+
$[92] = t24;
|
|
203
|
+
$[93] = t25;
|
|
204
|
+
$[94] = t13;
|
|
205
|
+
} else t13 = $[94];
|
|
206
|
+
t14 = hasMessage ? /*#__PURE__*/ jsxs("div", {
|
|
199
207
|
"data-tao-form-message": "",
|
|
200
208
|
children: [
|
|
201
209
|
message,
|
|
210
|
+
childErrors.map((t26)=>{
|
|
211
|
+
const [id_0, errors] = t26;
|
|
212
|
+
return /*#__PURE__*/ jsx("div", {
|
|
213
|
+
id: id_0,
|
|
214
|
+
role: "alert",
|
|
215
|
+
className: classNames?.error,
|
|
216
|
+
style: styles?.error,
|
|
217
|
+
"data-tao-form-error": "",
|
|
218
|
+
children: errors.map(_temp)
|
|
219
|
+
}, id_0);
|
|
220
|
+
}),
|
|
202
221
|
hasExtra && descriptionMessage(extraId, extra)
|
|
203
222
|
]
|
|
204
223
|
}) : message;
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
224
|
+
$[39] = child;
|
|
225
|
+
$[40] = className;
|
|
226
|
+
$[41] = classNames?.error;
|
|
227
|
+
$[42] = classNames?.label;
|
|
228
|
+
$[43] = classNames?.root;
|
|
229
|
+
$[44] = control;
|
|
230
|
+
$[45] = controlId;
|
|
231
|
+
$[46] = descriptionMessage;
|
|
232
|
+
$[47] = extra;
|
|
233
|
+
$[48] = extraId;
|
|
234
|
+
$[49] = formItem;
|
|
235
|
+
$[50] = hasExtra;
|
|
236
|
+
$[51] = hasLabel;
|
|
237
|
+
$[52] = label;
|
|
238
|
+
$[53] = labelId;
|
|
239
|
+
$[54] = layout;
|
|
240
|
+
$[55] = message;
|
|
241
|
+
$[56] = nestedErrors;
|
|
242
|
+
$[57] = renderControl;
|
|
243
|
+
$[58] = required;
|
|
244
|
+
$[59] = reserveMessage;
|
|
245
|
+
$[60] = style;
|
|
246
|
+
$[61] = styles?.error;
|
|
247
|
+
$[62] = styles?.label;
|
|
248
|
+
$[63] = styles?.root;
|
|
249
|
+
$[64] = t12;
|
|
250
|
+
$[65] = t13;
|
|
251
|
+
$[66] = t14;
|
|
252
|
+
$[67] = t15;
|
|
253
|
+
$[68] = t16;
|
|
254
|
+
$[69] = t17;
|
|
255
|
+
$[70] = t18;
|
|
256
|
+
$[71] = t19;
|
|
257
|
+
$[72] = t20;
|
|
258
|
+
$[73] = t21;
|
|
259
|
+
} else {
|
|
260
|
+
t12 = $[64];
|
|
261
|
+
t13 = $[65];
|
|
262
|
+
t14 = $[66];
|
|
263
|
+
t15 = $[67];
|
|
264
|
+
t16 = $[68];
|
|
265
|
+
t17 = $[69];
|
|
266
|
+
t18 = $[70];
|
|
267
|
+
t19 = $[71];
|
|
268
|
+
t20 = $[72];
|
|
269
|
+
t21 = $[73];
|
|
270
|
+
}
|
|
271
|
+
let t22;
|
|
272
|
+
if ($[95] !== t12 || $[96] !== t13 || $[97] !== t14) {
|
|
273
|
+
t22 = /*#__PURE__*/ jsxs("div", {
|
|
274
|
+
"data-tao-form-control": t12,
|
|
217
275
|
children: [
|
|
218
|
-
|
|
219
|
-
|
|
276
|
+
t13,
|
|
277
|
+
t14
|
|
220
278
|
]
|
|
221
279
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
"data-tao-form-
|
|
233
|
-
"data-tao-form-
|
|
234
|
-
"data-tao-
|
|
280
|
+
$[95] = t12;
|
|
281
|
+
$[96] = t13;
|
|
282
|
+
$[97] = t14;
|
|
283
|
+
$[98] = t22;
|
|
284
|
+
} else t22 = $[98];
|
|
285
|
+
let t23;
|
|
286
|
+
if ($[99] !== t15 || $[100] !== t16 || $[101] !== t17 || $[102] !== t18 || $[103] !== t19 || $[104] !== t20 || $[105] !== t21 || $[106] !== t22) {
|
|
287
|
+
t23 = /*#__PURE__*/ jsxs("div", {
|
|
288
|
+
className: t15,
|
|
289
|
+
style: t16,
|
|
290
|
+
"data-tao-form-field": t17,
|
|
291
|
+
"data-tao-form-item": t18,
|
|
292
|
+
"data-tao-form-feedback": t19,
|
|
293
|
+
"data-tao-layout": t20,
|
|
235
294
|
children: [
|
|
236
|
-
|
|
237
|
-
|
|
295
|
+
t21,
|
|
296
|
+
t22
|
|
238
297
|
]
|
|
239
298
|
});
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
|
|
249
|
-
|
|
299
|
+
$[99] = t15;
|
|
300
|
+
$[100] = t16;
|
|
301
|
+
$[101] = t17;
|
|
302
|
+
$[102] = t18;
|
|
303
|
+
$[103] = t19;
|
|
304
|
+
$[104] = t20;
|
|
305
|
+
$[105] = t21;
|
|
306
|
+
$[106] = t22;
|
|
307
|
+
$[107] = t23;
|
|
308
|
+
} else t23 = $[107];
|
|
309
|
+
return t23;
|
|
310
|
+
}
|
|
311
|
+
function _temp(error_0) {
|
|
312
|
+
return /*#__PURE__*/ jsx("div", {
|
|
313
|
+
children: error_0
|
|
314
|
+
}, error_0);
|
|
250
315
|
}
|
|
251
316
|
export { FormFieldView };
|
|
@@ -17,14 +17,15 @@ function useTextControlRef(ref, nodeRef, rootRef) {
|
|
|
17
17
|
if ($[2] !== nodeRef || $[3] !== rootRef) {
|
|
18
18
|
t1 = ()=>{
|
|
19
19
|
const node = nodeRef.current;
|
|
20
|
-
const nativeFocus = Object.getPrototypeOf(node).focus
|
|
20
|
+
const nativeFocus = Object.getPrototypeOf(node).focus;
|
|
21
|
+
if (!nativeFocus) return node;
|
|
21
22
|
return Object.assign(node, {
|
|
22
23
|
input: node,
|
|
23
24
|
textArea: node,
|
|
24
25
|
nativeElement: rootRef.current,
|
|
25
26
|
focus (options) {
|
|
26
27
|
nativeFocus.call(node, options);
|
|
27
|
-
if (options?.cursor && (
|
|
28
|
+
if (options?.cursor && ("textarea" === node.localName || [
|
|
28
29
|
"text",
|
|
29
30
|
"search",
|
|
30
31
|
"password",
|
|
@@ -6,7 +6,8 @@ import { cx } from "../../utils/semantic.js";
|
|
|
6
6
|
import { FormFieldChangeContext } from "../form/form-context.js";
|
|
7
7
|
import { BaseInput } from "./base-input.js";
|
|
8
8
|
const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
9
|
-
const $ = c(
|
|
9
|
+
const $ = c(62);
|
|
10
|
+
let ariaRequired;
|
|
10
11
|
let autoComplete;
|
|
11
12
|
let autoFocus;
|
|
12
13
|
let className;
|
|
@@ -29,51 +30,53 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
29
30
|
let value;
|
|
30
31
|
let variant;
|
|
31
32
|
if ($[0] !== props) {
|
|
32
|
-
({ value, defaultValue: t0, length: t1, formatter, separator, mask: t2, type: t3, autoComplete, disabled, status, size, variant, onChange, onInput, classNames: customClassNames, styles: customStyles, className, style, autoFocus, inputMode, ...rest } = props);
|
|
33
|
+
({ value, defaultValue: t0, length: t1, formatter, separator, mask: t2, type: t3, autoComplete, disabled, status, size, variant, onChange, onInput, classNames: customClassNames, styles: customStyles, className, style, autoFocus, inputMode, "aria-required": ariaRequired, ...rest } = props);
|
|
33
34
|
$[0] = props;
|
|
34
|
-
$[1] =
|
|
35
|
-
$[2] =
|
|
36
|
-
$[3] =
|
|
37
|
-
$[4] =
|
|
38
|
-
$[5] =
|
|
39
|
-
$[6] =
|
|
40
|
-
$[7] =
|
|
41
|
-
$[8] =
|
|
42
|
-
$[9] =
|
|
43
|
-
$[10] =
|
|
44
|
-
$[11] =
|
|
45
|
-
$[12] =
|
|
46
|
-
$[13] =
|
|
47
|
-
$[14] =
|
|
48
|
-
$[15] =
|
|
49
|
-
$[16] =
|
|
50
|
-
$[17] =
|
|
51
|
-
$[18] =
|
|
52
|
-
$[19] =
|
|
53
|
-
$[20] =
|
|
54
|
-
$[21] =
|
|
35
|
+
$[1] = ariaRequired;
|
|
36
|
+
$[2] = autoComplete;
|
|
37
|
+
$[3] = autoFocus;
|
|
38
|
+
$[4] = className;
|
|
39
|
+
$[5] = customClassNames;
|
|
40
|
+
$[6] = customStyles;
|
|
41
|
+
$[7] = disabled;
|
|
42
|
+
$[8] = formatter;
|
|
43
|
+
$[9] = inputMode;
|
|
44
|
+
$[10] = onChange;
|
|
45
|
+
$[11] = onInput;
|
|
46
|
+
$[12] = rest;
|
|
47
|
+
$[13] = separator;
|
|
48
|
+
$[14] = size;
|
|
49
|
+
$[15] = status;
|
|
50
|
+
$[16] = style;
|
|
51
|
+
$[17] = t0;
|
|
52
|
+
$[18] = t1;
|
|
53
|
+
$[19] = t2;
|
|
54
|
+
$[20] = t3;
|
|
55
|
+
$[21] = value;
|
|
56
|
+
$[22] = variant;
|
|
55
57
|
} else {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
ariaRequired = $[1];
|
|
59
|
+
autoComplete = $[2];
|
|
60
|
+
autoFocus = $[3];
|
|
61
|
+
className = $[4];
|
|
62
|
+
customClassNames = $[5];
|
|
63
|
+
customStyles = $[6];
|
|
64
|
+
disabled = $[7];
|
|
65
|
+
formatter = $[8];
|
|
66
|
+
inputMode = $[9];
|
|
67
|
+
onChange = $[10];
|
|
68
|
+
onInput = $[11];
|
|
69
|
+
rest = $[12];
|
|
70
|
+
separator = $[13];
|
|
71
|
+
size = $[14];
|
|
72
|
+
status = $[15];
|
|
73
|
+
style = $[16];
|
|
74
|
+
t0 = $[17];
|
|
75
|
+
t1 = $[18];
|
|
76
|
+
t2 = $[19];
|
|
77
|
+
t3 = $[20];
|
|
78
|
+
value = $[21];
|
|
79
|
+
variant = $[22];
|
|
77
80
|
}
|
|
78
81
|
const defaultValue = void 0 === t0 ? "" : t0;
|
|
79
82
|
const length = void 0 === t1 ? 6 : t1;
|
|
@@ -83,42 +86,42 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
83
86
|
const ctx = useTaoConfig();
|
|
84
87
|
const fieldChange = useContext(FormFieldChangeContext);
|
|
85
88
|
let t4;
|
|
86
|
-
if ($[
|
|
89
|
+
if ($[23] !== formatter || $[24] !== length) {
|
|
87
90
|
t4 = (text)=>Array.from(formatter ? formatter(text) : text).slice(0, length);
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
} else t4 = $[
|
|
91
|
+
$[23] = formatter;
|
|
92
|
+
$[24] = length;
|
|
93
|
+
$[25] = t4;
|
|
94
|
+
} else t4 = $[25];
|
|
92
95
|
const format = t4;
|
|
93
96
|
let t5;
|
|
94
|
-
if ($[
|
|
97
|
+
if ($[26] !== format || $[27] !== props || $[28] !== value) {
|
|
95
98
|
t5 = "value" in props ? format(value ?? "").join("") : void 0;
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
} else t5 = $[
|
|
99
|
+
$[26] = format;
|
|
100
|
+
$[27] = props;
|
|
101
|
+
$[28] = value;
|
|
102
|
+
$[29] = t5;
|
|
103
|
+
} else t5 = $[29];
|
|
101
104
|
const formattedValue = t5;
|
|
102
105
|
let t6;
|
|
103
|
-
if ($[
|
|
106
|
+
if ($[30] !== defaultValue || $[31] !== format || $[32] !== props || $[33] !== value) {
|
|
104
107
|
t6 = ()=>format("value" in props ? value ?? "" : defaultValue);
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
} else t6 = $[
|
|
108
|
+
$[30] = defaultValue;
|
|
109
|
+
$[31] = format;
|
|
110
|
+
$[32] = props;
|
|
111
|
+
$[33] = value;
|
|
112
|
+
$[34] = t6;
|
|
113
|
+
} else t6 = $[34];
|
|
111
114
|
const [innerValue, setInnerValue] = useState(t6);
|
|
112
115
|
let t7;
|
|
113
|
-
if ($[
|
|
116
|
+
if ($[35] !== formattedValue || $[36] !== value) {
|
|
114
117
|
t7 = {
|
|
115
118
|
value,
|
|
116
119
|
formattedValue
|
|
117
120
|
};
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
} else t7 = $[
|
|
121
|
+
$[35] = formattedValue;
|
|
122
|
+
$[36] = value;
|
|
123
|
+
$[37] = t7;
|
|
124
|
+
} else t7 = $[37];
|
|
122
125
|
const [previousValue, setPreviousValue] = useState(t7);
|
|
123
126
|
const [draft, setDraft] = useState(null);
|
|
124
127
|
if (previousValue.value !== value || previousValue.formattedValue !== formattedValue) {
|
|
@@ -131,16 +134,16 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
131
134
|
}
|
|
132
135
|
const cells = innerValue.slice(0, length);
|
|
133
136
|
let t8;
|
|
134
|
-
if ($[
|
|
137
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
135
138
|
t8 = [];
|
|
136
|
-
$[
|
|
137
|
-
} else t8 = $[
|
|
139
|
+
$[38] = t8;
|
|
140
|
+
} else t8 = $[38];
|
|
138
141
|
const inputs = useRef(t8);
|
|
139
142
|
const root = useRef(null);
|
|
140
143
|
const composing = useRef(null);
|
|
141
144
|
let t10;
|
|
142
145
|
let t9;
|
|
143
|
-
if ($[
|
|
146
|
+
if ($[39] !== length) {
|
|
144
147
|
t9 = ()=>{
|
|
145
148
|
if (null !== composing.current && composing.current >= length) {
|
|
146
149
|
composing.current = null;
|
|
@@ -150,52 +153,52 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
150
153
|
t10 = [
|
|
151
154
|
length
|
|
152
155
|
];
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
+
$[39] = length;
|
|
157
|
+
$[40] = t10;
|
|
158
|
+
$[41] = t9;
|
|
156
159
|
} else {
|
|
157
|
-
t10 = $[
|
|
158
|
-
t9 = $[
|
|
160
|
+
t10 = $[40];
|
|
161
|
+
t9 = $[41];
|
|
159
162
|
}
|
|
160
163
|
useEffect(t9, t10);
|
|
161
164
|
let t11;
|
|
162
|
-
if ($[
|
|
165
|
+
if ($[42] !== customClassNames || $[43] !== props) {
|
|
163
166
|
t11 = "function" == typeof customClassNames ? customClassNames({
|
|
164
167
|
props
|
|
165
168
|
}) : customClassNames;
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
} else t11 = $[
|
|
169
|
+
$[42] = customClassNames;
|
|
170
|
+
$[43] = props;
|
|
171
|
+
$[44] = t11;
|
|
172
|
+
} else t11 = $[44];
|
|
170
173
|
const classNames = t11;
|
|
171
174
|
let t12;
|
|
172
|
-
if ($[
|
|
175
|
+
if ($[45] !== customStyles || $[46] !== props) {
|
|
173
176
|
t12 = "function" == typeof customStyles ? customStyles({
|
|
174
177
|
props
|
|
175
178
|
}) : customStyles;
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
} else t12 = $[
|
|
179
|
+
$[45] = customStyles;
|
|
180
|
+
$[46] = props;
|
|
181
|
+
$[47] = t12;
|
|
182
|
+
} else t12 = $[47];
|
|
180
183
|
const styles = t12;
|
|
181
184
|
let t13;
|
|
182
|
-
if ($[
|
|
185
|
+
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
183
186
|
t13 = (index)=>{
|
|
184
187
|
inputs.current[index]?.focus();
|
|
185
188
|
inputs.current[index]?.select();
|
|
186
189
|
};
|
|
187
|
-
$[
|
|
188
|
-
} else t13 = $[
|
|
190
|
+
$[48] = t13;
|
|
191
|
+
} else t13 = $[48];
|
|
189
192
|
const focus = t13;
|
|
190
193
|
let t14;
|
|
191
|
-
if ($[
|
|
194
|
+
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
192
195
|
t14 = ()=>({
|
|
193
196
|
focus: ()=>focus(0),
|
|
194
197
|
blur: ()=>inputs.current.forEach(_temp),
|
|
195
198
|
nativeElement: root.current
|
|
196
199
|
});
|
|
197
|
-
$[
|
|
198
|
-
} else t14 = $[
|
|
200
|
+
$[49] = t14;
|
|
201
|
+
} else t14 = $[49];
|
|
199
202
|
useImperativeHandle(ref, t14);
|
|
200
203
|
const update = (index_0, text_0)=>{
|
|
201
204
|
const chars = format(text_0);
|
|
@@ -227,23 +230,23 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
227
230
|
const t16 = "";
|
|
228
231
|
const t17 = classNames?.root;
|
|
229
232
|
let t18;
|
|
230
|
-
if ($[
|
|
233
|
+
if ($[50] !== className || $[51] !== t17) {
|
|
231
234
|
t18 = cx(t17, className);
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
} else t18 = $[
|
|
235
|
+
$[50] = className;
|
|
236
|
+
$[51] = t17;
|
|
237
|
+
$[52] = t18;
|
|
238
|
+
} else t18 = $[52];
|
|
236
239
|
const t19 = styles?.root;
|
|
237
240
|
let t20;
|
|
238
|
-
if ($[
|
|
241
|
+
if ($[53] !== style || $[54] !== t19) {
|
|
239
242
|
t20 = {
|
|
240
243
|
...t19,
|
|
241
244
|
...style
|
|
242
245
|
};
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
} else t20 = $[
|
|
246
|
+
$[53] = style;
|
|
247
|
+
$[54] = t19;
|
|
248
|
+
$[55] = t20;
|
|
249
|
+
} else t20 = $[55];
|
|
247
250
|
const t21 = Array.from({
|
|
248
251
|
length
|
|
249
252
|
}, (__0, index_1)=>/*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -268,6 +271,7 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
268
271
|
"aria-label": ctx.locale.otpLabel?.(index_1 + 1, length) ?? `Character ${index_1 + 1} of ${length}`,
|
|
269
272
|
"aria-describedby": rest["aria-describedby"],
|
|
270
273
|
"aria-invalid": rest["aria-invalid"],
|
|
274
|
+
"aria-required": ariaRequired,
|
|
271
275
|
classNames: {
|
|
272
276
|
input: classNames?.input
|
|
273
277
|
},
|
|
@@ -332,7 +336,7 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
332
336
|
]
|
|
333
337
|
}, `otp-${index_1}`));
|
|
334
338
|
let t22;
|
|
335
|
-
if ($[
|
|
339
|
+
if ($[56] !== rest || $[57] !== t15 || $[58] !== t18 || $[59] !== t20 || $[60] !== t21) {
|
|
336
340
|
t22 = /*#__PURE__*/ jsx("div", {
|
|
337
341
|
...rest,
|
|
338
342
|
ref: root,
|
|
@@ -342,13 +346,13 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
342
346
|
style: t20,
|
|
343
347
|
children: t21
|
|
344
348
|
});
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
} else t22 = $[
|
|
349
|
+
$[56] = rest;
|
|
350
|
+
$[57] = t15;
|
|
351
|
+
$[58] = t18;
|
|
352
|
+
$[59] = t20;
|
|
353
|
+
$[60] = t21;
|
|
354
|
+
$[61] = t22;
|
|
355
|
+
} else t22 = $[61];
|
|
352
356
|
return t22;
|
|
353
357
|
});
|
|
354
358
|
function _temp(input) {
|