@clearstory/drywall-react 4.1.3 → 4.1.4
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/{AdapterDayjs-CI-cczs8.js → AdapterDayjs-B-aQ7t7H.js} +1 -1
- package/dist/{Datepicker-5EuKlnxP.js → Datepicker-BvCR9LUk.js} +1 -1
- package/dist/components/AutocompleteControl/AutocompleteControl.d.ts +5 -1
- package/dist/components/AutocompleteControl/AutocompleteControl.js +70 -24
- package/dist/components/AutocompleteControl/index.js +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/index.js +2 -2
- package/dist/components/DatepickerControl/DatepickerControl.d.ts +5 -1
- package/dist/components/DatepickerControl/DatepickerControl.js +120 -24
- package/dist/components/DatepickerControl/index.js +1 -1
- package/dist/components/DialogClose/DialogClose.d.ts +1 -1
- package/dist/components/DialogClose/DialogClose.js +2 -17
- package/dist/components/FormSublabel/FormSublabel.d.ts +2 -2
- package/dist/components/FormSublabel/FormSublabel.js +8 -23
- package/dist/components/FormSublabel/index.js +2 -2
- package/dist/components/InputControl/InputControl.d.ts +5 -1
- package/dist/components/InputControl/InputControl.js +88 -24
- package/dist/components/InputControl/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +614 -22
- package/dist/components/NumberInput/index.js +1 -1
- package/dist/components/NumberInputControl/NumberInputControl.d.ts +5 -1
- package/dist/components/NumberInputControl/NumberInputControl.js +86 -24
- package/dist/components/NumberInputControl/index.js +1 -1
- package/dist/components/SelectControl/SelectControl.d.ts +5 -1
- package/dist/components/SelectControl/SelectControl.js +90 -24
- package/dist/components/SelectControl/index.js +1 -1
- package/dist/main.js +449 -443
- package/package.json +1 -1
- package/dist/SelectControl-JlfR4Ddv.js +0 -1043
|
@@ -1,1043 +0,0 @@
|
|
|
1
|
-
import { jsxs as Z, jsx as I } from "react/jsx-runtime";
|
|
2
|
-
import ee, { forwardRef as ae, useRef as re, useState as Be, useEffect as Se, useLayoutEffect as qe, useMemo as Pe } from "react";
|
|
3
|
-
import { useId as ue } from "./hooks/useId.js";
|
|
4
|
-
import "./icons/ClearstoryIcon.js";
|
|
5
|
-
import "./icons/InternalOnlyIcon.js";
|
|
6
|
-
import "./icons/MoneyBucketIcon.js";
|
|
7
|
-
import "./icons/MoreCircleOutlineIcon.js";
|
|
8
|
-
import { I as fe } from "./Info-Cykl51qM.js";
|
|
9
|
-
import "./theme/index.js";
|
|
10
|
-
import { A as He } from "./Autocomplete-FWamSgvx.js";
|
|
11
|
-
import { D as ze } from "./Datepicker-5EuKlnxP.js";
|
|
12
|
-
import "./components/DescriptionDetails/DescriptionDetails.js";
|
|
13
|
-
import "./components/DescriptionList/DescriptionList.js";
|
|
14
|
-
import "./components/DescriptionList/DescriptionListContext.js";
|
|
15
|
-
import "./components/DescriptionTerm/DescriptionTerm.js";
|
|
16
|
-
import { Input as Ee } from "./components/Input/Input.js";
|
|
17
|
-
import { Select as Je } from "./components/Select/Select.js";
|
|
18
|
-
import "./theme/internal.js";
|
|
19
|
-
import "./components/ToastContainer/ToastContainer.js";
|
|
20
|
-
import "./components/ToastContainer/ToastLabelContext.js";
|
|
21
|
-
import "./index-SzwnPTHF.js";
|
|
22
|
-
import { F as ce } from "./FormControl-SJ7nmkLi.js";
|
|
23
|
-
import { B as de } from "./Box-CRpDZJO_.js";
|
|
24
|
-
import { F as se } from "./FormLabel-Cq6v8zn0.js";
|
|
25
|
-
import { T as ve } from "./Tooltip-D_k6EcdK.js";
|
|
26
|
-
import { F as ne } from "./FormHelperText-Dh36nlW5.js";
|
|
27
|
-
import { s as Qe } from "./styled-SBTDGe0C.js";
|
|
28
|
-
function Xe(e, r) {
|
|
29
|
-
const {
|
|
30
|
-
disabled: t,
|
|
31
|
-
error: n,
|
|
32
|
-
helperText: a,
|
|
33
|
-
id: i,
|
|
34
|
-
label: o,
|
|
35
|
-
required: c,
|
|
36
|
-
slotProps: s,
|
|
37
|
-
sublabel: g,
|
|
38
|
-
tooltip: v,
|
|
39
|
-
...m
|
|
40
|
-
} = e, h = ue("autocomplete"), d = i || h, u = a ? `${d}-helper` : void 0;
|
|
41
|
-
return /* @__PURE__ */ Z(ce, { disabled: t, error: n, ...s?.root, children: [
|
|
42
|
-
/* @__PURE__ */ Z(
|
|
43
|
-
de,
|
|
44
|
-
{
|
|
45
|
-
sx: {
|
|
46
|
-
alignItems: "center",
|
|
47
|
-
display: "flex",
|
|
48
|
-
gap: "0.25rem"
|
|
49
|
-
},
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ I(se, { htmlFor: d, required: c, ...s?.label, children: o }),
|
|
52
|
-
v && /* @__PURE__ */ I(ve, { title: v, arrow: !0, children: /* @__PURE__ */ I(
|
|
53
|
-
fe,
|
|
54
|
-
{
|
|
55
|
-
sx: ({ vars: S }) => ({
|
|
56
|
-
color: S?.palette.text.secondary,
|
|
57
|
-
marginBlockEnd: "3px",
|
|
58
|
-
height: "1rem",
|
|
59
|
-
width: "1rem"
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
) })
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
g && /* @__PURE__ */ I(me, { ...s?.sublabel, children: g }),
|
|
67
|
-
/* @__PURE__ */ I(
|
|
68
|
-
He,
|
|
69
|
-
{
|
|
70
|
-
disabled: t,
|
|
71
|
-
ref: r,
|
|
72
|
-
error: n,
|
|
73
|
-
id: d,
|
|
74
|
-
"aria-describedby": u ? m["aria-describedby"] ? `${m["aria-describedby"]} ${u}` : u : m["aria-describedby"],
|
|
75
|
-
slotProps: s?.autocomplete,
|
|
76
|
-
...m
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
a && /* @__PURE__ */ I(ne, { id: u, ...s?.helperText, children: a })
|
|
80
|
-
] });
|
|
81
|
-
}
|
|
82
|
-
const Ye = ae(
|
|
83
|
-
Xe
|
|
84
|
-
);
|
|
85
|
-
Ye.displayName = "AutocompleteControl";
|
|
86
|
-
const er = ae(
|
|
87
|
-
({
|
|
88
|
-
disabled: e = !1,
|
|
89
|
-
error: r = !1,
|
|
90
|
-
fullWidth: t,
|
|
91
|
-
helperText: n,
|
|
92
|
-
label: a,
|
|
93
|
-
required: i = !1,
|
|
94
|
-
slotProps: o = {},
|
|
95
|
-
sublabel: c,
|
|
96
|
-
tooltip: s,
|
|
97
|
-
name: g,
|
|
98
|
-
value: v,
|
|
99
|
-
onChange: m,
|
|
100
|
-
onAccept: h,
|
|
101
|
-
onClose: d,
|
|
102
|
-
onOpen: u,
|
|
103
|
-
format: S,
|
|
104
|
-
views: V,
|
|
105
|
-
openTo: b,
|
|
106
|
-
disableFuture: E,
|
|
107
|
-
disablePast: F,
|
|
108
|
-
minDate: j,
|
|
109
|
-
maxDate: k,
|
|
110
|
-
closeOnSelect: K,
|
|
111
|
-
readOnly: U,
|
|
112
|
-
clearable: w,
|
|
113
|
-
reduceAnimations: _,
|
|
114
|
-
...G
|
|
115
|
-
}, M) => {
|
|
116
|
-
const W = ue("datepicker"), L = g || W, q = n ? `${L}-helper` : void 0;
|
|
117
|
-
return /* @__PURE__ */ Z(
|
|
118
|
-
ce,
|
|
119
|
-
{
|
|
120
|
-
disabled: e,
|
|
121
|
-
error: r,
|
|
122
|
-
fullWidth: t,
|
|
123
|
-
...o.root,
|
|
124
|
-
children: [
|
|
125
|
-
/* @__PURE__ */ Z(
|
|
126
|
-
de,
|
|
127
|
-
{
|
|
128
|
-
sx: {
|
|
129
|
-
alignItems: "center",
|
|
130
|
-
display: "flex",
|
|
131
|
-
gap: "0.25rem"
|
|
132
|
-
},
|
|
133
|
-
children: [
|
|
134
|
-
/* @__PURE__ */ I(se, { htmlFor: L, required: i, ...o.label, children: a }),
|
|
135
|
-
s && /* @__PURE__ */ I(ve, { title: s, arrow: !0, children: /* @__PURE__ */ I(
|
|
136
|
-
fe,
|
|
137
|
-
{
|
|
138
|
-
sx: ({ vars: Q }) => ({
|
|
139
|
-
color: Q?.palette.text.secondary,
|
|
140
|
-
marginBlockEnd: "3px",
|
|
141
|
-
height: "1rem",
|
|
142
|
-
width: "1rem"
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
) })
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
c && /* @__PURE__ */ I(me, { ...o.sublabel, children: c }),
|
|
150
|
-
/* @__PURE__ */ I(
|
|
151
|
-
ze,
|
|
152
|
-
{
|
|
153
|
-
ref: M,
|
|
154
|
-
disabled: e,
|
|
155
|
-
name: L,
|
|
156
|
-
value: v,
|
|
157
|
-
onChange: m,
|
|
158
|
-
onAccept: h,
|
|
159
|
-
onClose: d,
|
|
160
|
-
onOpen: u,
|
|
161
|
-
format: S,
|
|
162
|
-
views: V,
|
|
163
|
-
openTo: b,
|
|
164
|
-
disableFuture: E,
|
|
165
|
-
disablePast: F,
|
|
166
|
-
minDate: j,
|
|
167
|
-
maxDate: k,
|
|
168
|
-
closeOnSelect: K,
|
|
169
|
-
readOnly: U,
|
|
170
|
-
clearable: w,
|
|
171
|
-
reduceAnimations: _,
|
|
172
|
-
error: r,
|
|
173
|
-
slotProps: {
|
|
174
|
-
field: {
|
|
175
|
-
id: L,
|
|
176
|
-
"aria-describedby": q,
|
|
177
|
-
...t && { sx: { width: "100%" } }
|
|
178
|
-
},
|
|
179
|
-
popper: {
|
|
180
|
-
"aria-label": `Date picker${typeof a == "string" && ` for ${a}`}`
|
|
181
|
-
},
|
|
182
|
-
...o?.datepicker
|
|
183
|
-
},
|
|
184
|
-
...G
|
|
185
|
-
}
|
|
186
|
-
),
|
|
187
|
-
n && /* @__PURE__ */ I(ne, { id: q, ...o.helperText, children: n })
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
er.displayName = "DatepickerControl";
|
|
194
|
-
const me = Qe(ne)(() => ({
|
|
195
|
-
marginBlockStart: 0,
|
|
196
|
-
marginBlockEnd: "3px",
|
|
197
|
-
marginInline: 0
|
|
198
|
-
})), rr = ae(
|
|
199
|
-
({
|
|
200
|
-
disabled: e,
|
|
201
|
-
error: r,
|
|
202
|
-
fullWidth: t,
|
|
203
|
-
helperText: n,
|
|
204
|
-
id: a,
|
|
205
|
-
label: i,
|
|
206
|
-
required: o,
|
|
207
|
-
slotProps: c,
|
|
208
|
-
sublabel: s,
|
|
209
|
-
tooltip: g,
|
|
210
|
-
...v
|
|
211
|
-
}, m) => {
|
|
212
|
-
const h = ue("input"), d = a || h, u = n ? `${d}-helper` : void 0;
|
|
213
|
-
return /* @__PURE__ */ Z(
|
|
214
|
-
ce,
|
|
215
|
-
{
|
|
216
|
-
disabled: e,
|
|
217
|
-
error: r,
|
|
218
|
-
fullWidth: t,
|
|
219
|
-
...c?.root,
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ Z(
|
|
222
|
-
de,
|
|
223
|
-
{
|
|
224
|
-
sx: {
|
|
225
|
-
alignItems: "center",
|
|
226
|
-
display: "flex",
|
|
227
|
-
gap: "0.25rem"
|
|
228
|
-
},
|
|
229
|
-
children: [
|
|
230
|
-
/* @__PURE__ */ I(
|
|
231
|
-
se,
|
|
232
|
-
{
|
|
233
|
-
htmlFor: d,
|
|
234
|
-
required: o,
|
|
235
|
-
...c?.label,
|
|
236
|
-
children: i
|
|
237
|
-
}
|
|
238
|
-
),
|
|
239
|
-
g && /* @__PURE__ */ I(ve, { title: g, arrow: !0, children: /* @__PURE__ */ I(
|
|
240
|
-
fe,
|
|
241
|
-
{
|
|
242
|
-
sx: ({ vars: S }) => ({
|
|
243
|
-
color: S?.palette.text.secondary,
|
|
244
|
-
marginBlockEnd: "3px",
|
|
245
|
-
height: "1rem",
|
|
246
|
-
width: "1rem"
|
|
247
|
-
})
|
|
248
|
-
}
|
|
249
|
-
) })
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
),
|
|
253
|
-
s && /* @__PURE__ */ I(me, { ...c?.sublabel, children: s }),
|
|
254
|
-
/* @__PURE__ */ I(
|
|
255
|
-
Ee,
|
|
256
|
-
{
|
|
257
|
-
ref: m,
|
|
258
|
-
disabled: e,
|
|
259
|
-
error: r,
|
|
260
|
-
fullWidth: t,
|
|
261
|
-
id: d,
|
|
262
|
-
"aria-describedby": u ? v["aria-describedby"] ? `${v["aria-describedby"]} ${u}` : u : v["aria-describedby"],
|
|
263
|
-
slotProps: c?.input,
|
|
264
|
-
...v
|
|
265
|
-
}
|
|
266
|
-
),
|
|
267
|
-
n && /* @__PURE__ */ I(ne, { id: u, ...c?.helperText, children: n })
|
|
268
|
-
]
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
rr.displayName = "InputControl";
|
|
274
|
-
function Fe(e, r) {
|
|
275
|
-
var t = {};
|
|
276
|
-
for (var n in e)
|
|
277
|
-
Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
278
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
279
|
-
for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
|
|
280
|
-
r.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (t[n[a]] = e[n[a]]);
|
|
281
|
-
return t;
|
|
282
|
-
}
|
|
283
|
-
var oe;
|
|
284
|
-
(function(e) {
|
|
285
|
-
e.event = "event", e.props = "prop";
|
|
286
|
-
})(oe || (oe = {}));
|
|
287
|
-
function J() {
|
|
288
|
-
}
|
|
289
|
-
function tr(e) {
|
|
290
|
-
var r, t = void 0;
|
|
291
|
-
return function() {
|
|
292
|
-
for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
|
|
293
|
-
return r && n.length === r.length && n.every(function(i, o) {
|
|
294
|
-
return i === r[o];
|
|
295
|
-
}) || (r = n, t = e.apply(void 0, n)), t;
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
function le(e) {
|
|
299
|
-
return !!(e || "").match(/\d/);
|
|
300
|
-
}
|
|
301
|
-
function te(e) {
|
|
302
|
-
return e == null;
|
|
303
|
-
}
|
|
304
|
-
function ar(e) {
|
|
305
|
-
return typeof e == "number" && isNaN(e);
|
|
306
|
-
}
|
|
307
|
-
function Te(e) {
|
|
308
|
-
return te(e) || ar(e) || typeof e == "number" && !isFinite(e);
|
|
309
|
-
}
|
|
310
|
-
function Oe(e) {
|
|
311
|
-
return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
312
|
-
}
|
|
313
|
-
function nr(e) {
|
|
314
|
-
switch (e) {
|
|
315
|
-
case "lakh":
|
|
316
|
-
return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
|
|
317
|
-
case "wan":
|
|
318
|
-
return /(\d)(?=(\d{4})+(?!\d))/g;
|
|
319
|
-
case "thousand":
|
|
320
|
-
default:
|
|
321
|
-
return /(\d)(?=(\d{3})+(?!\d))/g;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
function ir(e, r, t) {
|
|
325
|
-
var n = nr(t), a = e.search(/[1-9]/);
|
|
326
|
-
return a = a === -1 ? e.length : a, e.substring(0, a) + e.substring(a, e.length).replace(n, "$1" + r);
|
|
327
|
-
}
|
|
328
|
-
function or(e) {
|
|
329
|
-
var r = re(e);
|
|
330
|
-
r.current = e;
|
|
331
|
-
var t = re(function() {
|
|
332
|
-
for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
|
|
333
|
-
return r.current.apply(r, n);
|
|
334
|
-
});
|
|
335
|
-
return t.current;
|
|
336
|
-
}
|
|
337
|
-
function we(e, r) {
|
|
338
|
-
r === void 0 && (r = !0);
|
|
339
|
-
var t = e[0] === "-", n = t && r;
|
|
340
|
-
e = e.replace("-", "");
|
|
341
|
-
var a = e.split("."), i = a[0], o = a[1] || "";
|
|
342
|
-
return {
|
|
343
|
-
beforeDecimal: i,
|
|
344
|
-
afterDecimal: o,
|
|
345
|
-
hasNegation: t,
|
|
346
|
-
addNegation: n
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
function lr(e) {
|
|
350
|
-
if (!e)
|
|
351
|
-
return e;
|
|
352
|
-
var r = e[0] === "-";
|
|
353
|
-
r && (e = e.substring(1, e.length));
|
|
354
|
-
var t = e.split("."), n = t[0].replace(/^0+/, "") || "0", a = t[1] || "";
|
|
355
|
-
return (r ? "-" : "") + n + (a ? "." + a : "");
|
|
356
|
-
}
|
|
357
|
-
function Re(e, r, t) {
|
|
358
|
-
for (var n = "", a = t ? "0" : "", i = 0; i <= r - 1; i++)
|
|
359
|
-
n += e[i] || a;
|
|
360
|
-
return n;
|
|
361
|
-
}
|
|
362
|
-
function Ve(e, r) {
|
|
363
|
-
return Array(r + 1).join(e);
|
|
364
|
-
}
|
|
365
|
-
function ke(e) {
|
|
366
|
-
var r = e + "", t = r[0] === "-" ? "-" : "";
|
|
367
|
-
t && (r = r.substring(1));
|
|
368
|
-
var n = r.split(/[eE]/g), a = n[0], i = n[1];
|
|
369
|
-
if (i = Number(i), !i)
|
|
370
|
-
return t + a;
|
|
371
|
-
a = a.replace(".", "");
|
|
372
|
-
var o = 1 + i, c = a.length;
|
|
373
|
-
return o < 0 ? a = "0." + Ve("0", Math.abs(o)) + a : o >= c ? a = a + Ve("0", o - c) : a = (a.substring(0, o) || "0") + "." + a.substring(o), t + a;
|
|
374
|
-
}
|
|
375
|
-
function De(e, r, t) {
|
|
376
|
-
if (["", "-"].indexOf(e) !== -1)
|
|
377
|
-
return e;
|
|
378
|
-
var n = (e.indexOf(".") !== -1 || t) && r, a = we(e), i = a.beforeDecimal, o = a.afterDecimal, c = a.hasNegation, s = parseFloat("0." + (o || "0")), g = o.length <= r ? "0." + o : s.toFixed(r), v = g.split("."), m = i;
|
|
379
|
-
i && Number(v[0]) && (m = i.split("").reverse().reduce(function(S, V, b) {
|
|
380
|
-
return S.length > b ? (Number(S[0]) + Number(V)).toString() + S.substring(1, S.length) : V + S;
|
|
381
|
-
}, v[0]));
|
|
382
|
-
var h = Re(v[1] || "", r, t), d = c ? "-" : "", u = n ? "." : "";
|
|
383
|
-
return "" + d + m + u + h;
|
|
384
|
-
}
|
|
385
|
-
function X(e, r) {
|
|
386
|
-
if (e.value = e.value, e !== null) {
|
|
387
|
-
if (e.createTextRange) {
|
|
388
|
-
var t = e.createTextRange();
|
|
389
|
-
return t.move("character", r), t.select(), !0;
|
|
390
|
-
}
|
|
391
|
-
return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(r, r), !0) : (e.focus(), !1);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
var _e = tr(function(e, r) {
|
|
395
|
-
for (var t = 0, n = 0, a = e.length, i = r.length; e[t] === r[t] && t < a; )
|
|
396
|
-
t++;
|
|
397
|
-
for (; e[a - 1 - n] === r[i - 1 - n] && i - n > t && a - n > t; )
|
|
398
|
-
n++;
|
|
399
|
-
return {
|
|
400
|
-
from: { start: t, end: a - n },
|
|
401
|
-
to: { start: t, end: i - n }
|
|
402
|
-
};
|
|
403
|
-
}), ur = function(e, r) {
|
|
404
|
-
var t = Math.min(e.selectionStart, r);
|
|
405
|
-
return {
|
|
406
|
-
from: { start: t, end: e.selectionEnd },
|
|
407
|
-
to: { start: t, end: r }
|
|
408
|
-
};
|
|
409
|
-
};
|
|
410
|
-
function fr(e, r, t) {
|
|
411
|
-
return Math.min(Math.max(e, r), t);
|
|
412
|
-
}
|
|
413
|
-
function Ie(e) {
|
|
414
|
-
return Math.max(e.selectionStart, e.selectionEnd);
|
|
415
|
-
}
|
|
416
|
-
function cr() {
|
|
417
|
-
return typeof navigator < "u" && !(navigator.platform && /iPhone|iPod/.test(navigator.platform));
|
|
418
|
-
}
|
|
419
|
-
function dr(e) {
|
|
420
|
-
return {
|
|
421
|
-
from: {
|
|
422
|
-
start: 0,
|
|
423
|
-
end: 0
|
|
424
|
-
},
|
|
425
|
-
to: {
|
|
426
|
-
start: 0,
|
|
427
|
-
end: e.length
|
|
428
|
-
},
|
|
429
|
-
lastValue: ""
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
function sr(e) {
|
|
433
|
-
var r = e.currentValue, t = e.formattedValue, n = e.currentValueIndex, a = e.formattedValueIndex;
|
|
434
|
-
return r[n] === t[a];
|
|
435
|
-
}
|
|
436
|
-
function vr(e, r, t, n, a, i, o) {
|
|
437
|
-
o === void 0 && (o = sr);
|
|
438
|
-
var c = a.findIndex(function(j) {
|
|
439
|
-
return j;
|
|
440
|
-
}), s = e.slice(0, c);
|
|
441
|
-
!r && !t.startsWith(s) && (r = s, t = s + t, n = n + s.length);
|
|
442
|
-
for (var g = t.length, v = e.length, m = {}, h = new Array(g), d = 0; d < g; d++) {
|
|
443
|
-
h[d] = -1;
|
|
444
|
-
for (var u = 0, S = v; u < S; u++) {
|
|
445
|
-
var V = o({
|
|
446
|
-
currentValue: t,
|
|
447
|
-
lastValue: r,
|
|
448
|
-
formattedValue: e,
|
|
449
|
-
currentValueIndex: d,
|
|
450
|
-
formattedValueIndex: u
|
|
451
|
-
});
|
|
452
|
-
if (V && m[u] !== !0) {
|
|
453
|
-
h[d] = u, m[u] = !0;
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
for (var b = n; b < g && (h[b] === -1 || !i(t[b])); )
|
|
459
|
-
b++;
|
|
460
|
-
var E = b === g || h[b] === -1 ? v : h[b];
|
|
461
|
-
for (b = n - 1; b > 0 && h[b] === -1; )
|
|
462
|
-
b--;
|
|
463
|
-
var F = b === -1 || h[b] === -1 ? 0 : h[b] + 1;
|
|
464
|
-
return F > E ? E : n - F < E - n ? F : E;
|
|
465
|
-
}
|
|
466
|
-
function Ce(e, r, t, n) {
|
|
467
|
-
var a = e.length;
|
|
468
|
-
if (r = fr(r, 0, a), n === "left") {
|
|
469
|
-
for (; r >= 0 && !t[r]; )
|
|
470
|
-
r--;
|
|
471
|
-
r === -1 && (r = t.indexOf(!0));
|
|
472
|
-
} else {
|
|
473
|
-
for (; r <= a && !t[r]; )
|
|
474
|
-
r++;
|
|
475
|
-
r > a && (r = t.lastIndexOf(!0));
|
|
476
|
-
}
|
|
477
|
-
return r === -1 && (r = a), r;
|
|
478
|
-
}
|
|
479
|
-
function mr(e) {
|
|
480
|
-
for (var r = Array.from({ length: e.length + 1 }).map(function() {
|
|
481
|
-
return !0;
|
|
482
|
-
}), t = 0, n = r.length; t < n; t++)
|
|
483
|
-
r[t] = !!(le(e[t]) || le(e[t - 1]));
|
|
484
|
-
return r;
|
|
485
|
-
}
|
|
486
|
-
function $e(e, r, t, n, a, i) {
|
|
487
|
-
i === void 0 && (i = J);
|
|
488
|
-
var o = or(function(u, S) {
|
|
489
|
-
var V, b;
|
|
490
|
-
return Te(u) ? (b = "", V = "") : typeof u == "number" || S ? (b = typeof u == "number" ? ke(u) : u, V = n(b)) : (b = a(u, void 0), V = n(b)), { formattedValue: V, numAsString: b };
|
|
491
|
-
}), c = Be(function() {
|
|
492
|
-
return o(te(e) ? r : e, t);
|
|
493
|
-
}), s = c[0], g = c[1], v = function(u, S) {
|
|
494
|
-
u.formattedValue !== s.formattedValue && g({
|
|
495
|
-
formattedValue: u.formattedValue,
|
|
496
|
-
numAsString: u.value
|
|
497
|
-
}), i(u, S);
|
|
498
|
-
}, m = e, h = t;
|
|
499
|
-
te(e) && (m = s.numAsString, h = !0);
|
|
500
|
-
var d = o(m, h);
|
|
501
|
-
return Pe(function() {
|
|
502
|
-
g(d);
|
|
503
|
-
}, [d.formattedValue]), [s, v];
|
|
504
|
-
}
|
|
505
|
-
function gr(e) {
|
|
506
|
-
return e.replace(/[^0-9]/g, "");
|
|
507
|
-
}
|
|
508
|
-
function hr(e) {
|
|
509
|
-
return e;
|
|
510
|
-
}
|
|
511
|
-
function pr(e) {
|
|
512
|
-
var r = e.type;
|
|
513
|
-
r === void 0 && (r = "text");
|
|
514
|
-
var t = e.displayType;
|
|
515
|
-
t === void 0 && (t = "input");
|
|
516
|
-
var n = e.customInput, a = e.renderText, i = e.getInputRef, o = e.format;
|
|
517
|
-
o === void 0 && (o = hr);
|
|
518
|
-
var c = e.removeFormatting;
|
|
519
|
-
c === void 0 && (c = gr);
|
|
520
|
-
var s = e.defaultValue, g = e.valueIsNumericString, v = e.onValueChange, m = e.isAllowed, h = e.onChange;
|
|
521
|
-
h === void 0 && (h = J);
|
|
522
|
-
var d = e.onKeyDown;
|
|
523
|
-
d === void 0 && (d = J);
|
|
524
|
-
var u = e.onMouseUp;
|
|
525
|
-
u === void 0 && (u = J);
|
|
526
|
-
var S = e.onFocus;
|
|
527
|
-
S === void 0 && (S = J);
|
|
528
|
-
var V = e.onBlur;
|
|
529
|
-
V === void 0 && (V = J);
|
|
530
|
-
var b = e.value, E = e.getCaretBoundary;
|
|
531
|
-
E === void 0 && (E = mr);
|
|
532
|
-
var F = e.isValidInputCharacter;
|
|
533
|
-
F === void 0 && (F = le);
|
|
534
|
-
var j = e.isCharacterSame, k = Fe(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), K = $e(b, s, !!g, o, c, v), U = K[0], w = U.formattedValue, _ = U.numAsString, G = K[1], M = re(), W = re({ formattedValue: w, numAsString: _ }), L = function(l, f) {
|
|
535
|
-
W.current = { formattedValue: l.formattedValue, numAsString: l.value }, G(l, f);
|
|
536
|
-
}, q = Be(!1), Q = q[0], y = q[1], p = re(null), D = re({
|
|
537
|
-
setCaretTimeout: null,
|
|
538
|
-
focusTimeout: null
|
|
539
|
-
});
|
|
540
|
-
Se(function() {
|
|
541
|
-
return y(!0), function() {
|
|
542
|
-
clearTimeout(D.current.setCaretTimeout), clearTimeout(D.current.focusTimeout);
|
|
543
|
-
};
|
|
544
|
-
}, []);
|
|
545
|
-
var T = o, O = function(l, f) {
|
|
546
|
-
var x = parseFloat(f);
|
|
547
|
-
return {
|
|
548
|
-
formattedValue: l,
|
|
549
|
-
value: f,
|
|
550
|
-
floatValue: isNaN(x) ? void 0 : x
|
|
551
|
-
};
|
|
552
|
-
}, B = function(l, f, x) {
|
|
553
|
-
l.selectionStart === 0 && l.selectionEnd === l.value.length || (X(l, f), D.current.setCaretTimeout = setTimeout(function() {
|
|
554
|
-
l.value === x && l.selectionStart !== f && X(l, f);
|
|
555
|
-
}, 0));
|
|
556
|
-
}, R = function(l, f, x) {
|
|
557
|
-
return Ce(l, f, E(l), x);
|
|
558
|
-
}, Y = function(l, f, x) {
|
|
559
|
-
var C = E(f), $ = vr(f, w, l, x, C, F, j);
|
|
560
|
-
return $ = Ce(f, $, C), $;
|
|
561
|
-
}, pe = function(l) {
|
|
562
|
-
var f = l.formattedValue;
|
|
563
|
-
f === void 0 && (f = "");
|
|
564
|
-
var x = l.input, C = l.source, $ = l.event, A = l.numAsString, N;
|
|
565
|
-
if (x) {
|
|
566
|
-
var P = l.inputValue || x.value, H = Ie(x);
|
|
567
|
-
x.value = f, N = Y(P, f, H), N !== void 0 && B(x, N, f);
|
|
568
|
-
}
|
|
569
|
-
f !== w && L(O(f, A), { event: $, source: C });
|
|
570
|
-
};
|
|
571
|
-
Se(function() {
|
|
572
|
-
var l = W.current, f = l.formattedValue, x = l.numAsString;
|
|
573
|
-
(w !== f || _ !== x) && L(O(w, _), {
|
|
574
|
-
event: void 0,
|
|
575
|
-
source: oe.props
|
|
576
|
-
});
|
|
577
|
-
}, [w, _]);
|
|
578
|
-
var ie = p.current ? Ie(p.current) : void 0, ge = typeof window < "u" ? qe : Se;
|
|
579
|
-
ge(function() {
|
|
580
|
-
var l = p.current;
|
|
581
|
-
if (w !== W.current.formattedValue && l) {
|
|
582
|
-
var f = Y(W.current.formattedValue, w, ie);
|
|
583
|
-
l.value = w, B(l, f, w);
|
|
584
|
-
}
|
|
585
|
-
}, [w]);
|
|
586
|
-
var be = function(l, f, x) {
|
|
587
|
-
var C = f.target, $ = M.current ? ur(M.current, C.selectionEnd) : _e(w, l), A = Object.assign(Object.assign({}, $), { lastValue: w }), N = c(l, A), P = T(N);
|
|
588
|
-
if (N = c(P, void 0), m && !m(O(P, N))) {
|
|
589
|
-
var H = f.target, z = Ie(H), ye = Y(l, w, z);
|
|
590
|
-
return H.value = w, B(H, ye, w), !1;
|
|
591
|
-
}
|
|
592
|
-
return pe({
|
|
593
|
-
formattedValue: P,
|
|
594
|
-
numAsString: N,
|
|
595
|
-
inputValue: l,
|
|
596
|
-
event: f,
|
|
597
|
-
source: x,
|
|
598
|
-
input: f.target
|
|
599
|
-
}), !0;
|
|
600
|
-
}, xe = function(l, f) {
|
|
601
|
-
f === void 0 && (f = 0);
|
|
602
|
-
var x = l.selectionStart, C = l.selectionEnd;
|
|
603
|
-
M.current = { selectionStart: x, selectionEnd: C + f };
|
|
604
|
-
}, Le = function(l) {
|
|
605
|
-
var f = l.target, x = f.value, C = be(x, l, oe.event);
|
|
606
|
-
C && h(l), M.current = void 0;
|
|
607
|
-
}, Me = function(l) {
|
|
608
|
-
var f = l.target, x = l.key, C = f.selectionStart, $ = f.selectionEnd, A = f.value;
|
|
609
|
-
A === void 0 && (A = "");
|
|
610
|
-
var N;
|
|
611
|
-
x === "ArrowLeft" || x === "Backspace" ? N = Math.max(C - 1, 0) : x === "ArrowRight" ? N = Math.min(C + 1, A.length) : x === "Delete" && (N = C);
|
|
612
|
-
var P = 0;
|
|
613
|
-
x === "Delete" && C === $ && (P = 1);
|
|
614
|
-
var H = x === "ArrowLeft" || x === "ArrowRight";
|
|
615
|
-
if (N === void 0 || C !== $ && !H) {
|
|
616
|
-
d(l), xe(f, P);
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
var z = N;
|
|
620
|
-
if (H) {
|
|
621
|
-
var ye = x === "ArrowLeft" ? "left" : "right";
|
|
622
|
-
z = R(A, N, ye), z !== N && l.preventDefault();
|
|
623
|
-
} else x === "Delete" && !F(A[N]) ? z = R(A, N, "right") : x === "Backspace" && !F(A[N]) && (z = R(A, N, "left"));
|
|
624
|
-
z !== N && B(f, z, A), d(l), xe(f, P);
|
|
625
|
-
}, Ke = function(l) {
|
|
626
|
-
var f = l.target, x = function() {
|
|
627
|
-
var C = f.selectionStart, $ = f.selectionEnd, A = f.value;
|
|
628
|
-
if (A === void 0 && (A = ""), C === $) {
|
|
629
|
-
var N = R(A, C);
|
|
630
|
-
N !== C && B(f, N, A);
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
x(), requestAnimationFrame(function() {
|
|
634
|
-
x();
|
|
635
|
-
}), u(l), xe(f);
|
|
636
|
-
}, Ue = function(l) {
|
|
637
|
-
l.persist && l.persist();
|
|
638
|
-
var f = l.target, x = l.currentTarget;
|
|
639
|
-
p.current = f, D.current.focusTimeout = setTimeout(function() {
|
|
640
|
-
var C = f.selectionStart, $ = f.selectionEnd, A = f.value;
|
|
641
|
-
A === void 0 && (A = "");
|
|
642
|
-
var N = R(A, C);
|
|
643
|
-
N !== C && !(C === 0 && $ === A.length) && B(f, N, A), S(Object.assign(Object.assign({}, l), { currentTarget: x }));
|
|
644
|
-
}, 0);
|
|
645
|
-
}, Ge = function(l) {
|
|
646
|
-
p.current = null, clearTimeout(D.current.focusTimeout), clearTimeout(D.current.setCaretTimeout), V(l);
|
|
647
|
-
}, We = Q && cr() ? "numeric" : void 0, Ne = Object.assign({ inputMode: We }, k, {
|
|
648
|
-
type: r,
|
|
649
|
-
value: w,
|
|
650
|
-
onChange: Le,
|
|
651
|
-
onKeyDown: Me,
|
|
652
|
-
onMouseUp: Ke,
|
|
653
|
-
onFocus: Ue,
|
|
654
|
-
onBlur: Ge
|
|
655
|
-
});
|
|
656
|
-
if (t === "text")
|
|
657
|
-
return a ? ee.createElement(ee.Fragment, null, a(w, k) || null) : ee.createElement("span", Object.assign({}, k, { ref: i }), w);
|
|
658
|
-
if (n) {
|
|
659
|
-
var Ze = n;
|
|
660
|
-
return ee.createElement(Ze, Object.assign({}, Ne, { ref: i }));
|
|
661
|
-
}
|
|
662
|
-
return ee.createElement("input", Object.assign({}, Ne, { ref: i }));
|
|
663
|
-
}
|
|
664
|
-
function Ae(e, r) {
|
|
665
|
-
var t = r.decimalScale, n = r.fixedDecimalScale, a = r.prefix;
|
|
666
|
-
a === void 0 && (a = "");
|
|
667
|
-
var i = r.suffix;
|
|
668
|
-
i === void 0 && (i = "");
|
|
669
|
-
var o = r.allowNegative, c = r.thousandsGroupStyle;
|
|
670
|
-
if (c === void 0 && (c = "thousand"), e === "" || e === "-")
|
|
671
|
-
return e;
|
|
672
|
-
var s = he(r), g = s.thousandSeparator, v = s.decimalSeparator, m = t !== 0 && e.indexOf(".") !== -1 || t && n, h = we(e, o), d = h.beforeDecimal, u = h.afterDecimal, S = h.addNegation;
|
|
673
|
-
return t !== void 0 && (u = Re(u, t, !!n)), g && (d = ir(d, g, c)), a && (d = a + d), i && (u = u + i), S && (d = "-" + d), e = d + (m && v || "") + u, e;
|
|
674
|
-
}
|
|
675
|
-
function he(e) {
|
|
676
|
-
var r = e.decimalSeparator;
|
|
677
|
-
r === void 0 && (r = ".");
|
|
678
|
-
var t = e.thousandSeparator, n = e.allowedDecimalSeparators;
|
|
679
|
-
return t === !0 && (t = ","), n || (n = [r, "."]), {
|
|
680
|
-
decimalSeparator: r,
|
|
681
|
-
thousandSeparator: t,
|
|
682
|
-
allowedDecimalSeparators: n
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
function br(e, r) {
|
|
686
|
-
e === void 0 && (e = "");
|
|
687
|
-
var t = new RegExp("(-)"), n = new RegExp("(-)(.)*(-)"), a = t.test(e), i = n.test(e);
|
|
688
|
-
return e = e.replace(/-/g, ""), a && !i && r && (e = "-" + e), e;
|
|
689
|
-
}
|
|
690
|
-
function xr(e, r) {
|
|
691
|
-
return new RegExp("(^-)|[0-9]|" + Oe(e), "g");
|
|
692
|
-
}
|
|
693
|
-
function yr(e, r, t) {
|
|
694
|
-
return e === "" ? !0 : !r?.match(/\d/) && !t?.match(/\d/) && typeof e == "string" && !isNaN(Number(e));
|
|
695
|
-
}
|
|
696
|
-
function Sr(e, r, t) {
|
|
697
|
-
var n;
|
|
698
|
-
r === void 0 && (r = dr(e));
|
|
699
|
-
var a = t.allowNegative, i = t.prefix;
|
|
700
|
-
i === void 0 && (i = "");
|
|
701
|
-
var o = t.suffix;
|
|
702
|
-
o === void 0 && (o = "");
|
|
703
|
-
var c = t.decimalScale, s = r.from, g = r.to, v = g.start, m = g.end, h = he(t), d = h.allowedDecimalSeparators, u = h.decimalSeparator, S = e[m] === u;
|
|
704
|
-
if (le(e) && (e === i || e === o) && r.lastValue === "")
|
|
705
|
-
return e;
|
|
706
|
-
if (m - v === 1 && d.indexOf(e[v]) !== -1) {
|
|
707
|
-
var V = c === 0 ? "" : u;
|
|
708
|
-
e = e.substring(0, v) + V + e.substring(v + 1, e.length);
|
|
709
|
-
}
|
|
710
|
-
var b = function(p, D, T) {
|
|
711
|
-
var O = !1, B = !1;
|
|
712
|
-
i.startsWith("-") ? O = !1 : p.startsWith("--") ? (O = !1, B = !0) : o.startsWith("-") && p.length === o.length ? O = !1 : p[0] === "-" && (O = !0);
|
|
713
|
-
var R = O ? 1 : 0;
|
|
714
|
-
return B && (R = 2), R && (p = p.substring(R), D -= R, T -= R), { value: p, start: D, end: T, hasNegation: O };
|
|
715
|
-
}, E = b(e, v, m), F = E.hasNegation;
|
|
716
|
-
n = E, e = n.value, v = n.start, m = n.end;
|
|
717
|
-
var j = b(r.lastValue, s.start, s.end), k = j.start, K = j.end, U = j.value, w = e.substring(v, m);
|
|
718
|
-
e.length && U.length && (k > U.length - o.length || K < i.length) && !(w && o.startsWith(w)) && (e = U);
|
|
719
|
-
var _ = 0;
|
|
720
|
-
e.startsWith(i) ? _ += i.length : v < i.length && (_ = v), e = e.substring(_), m -= _;
|
|
721
|
-
var G = e.length, M = e.length - o.length;
|
|
722
|
-
e.endsWith(o) ? G = M : (m > M || m > e.length - o.length) && (G = m), e = e.substring(0, G), e = br(F ? "-" + e : e, a), e = (e.match(xr(u)) || []).join("");
|
|
723
|
-
var W = e.indexOf(u);
|
|
724
|
-
e = e.replace(new RegExp(Oe(u), "g"), function(p, D) {
|
|
725
|
-
return D === W ? "." : "";
|
|
726
|
-
});
|
|
727
|
-
var L = we(e, a), q = L.beforeDecimal, Q = L.afterDecimal, y = L.addNegation;
|
|
728
|
-
return g.end - g.start < s.end - s.start && q === "" && S && !parseFloat(Q) && (e = y ? "-" : ""), e;
|
|
729
|
-
}
|
|
730
|
-
function Ir(e, r) {
|
|
731
|
-
var t = r.prefix;
|
|
732
|
-
t === void 0 && (t = "");
|
|
733
|
-
var n = r.suffix;
|
|
734
|
-
n === void 0 && (n = "");
|
|
735
|
-
var a = Array.from({ length: e.length + 1 }).map(function() {
|
|
736
|
-
return !0;
|
|
737
|
-
}), i = e[0] === "-";
|
|
738
|
-
a.fill(!1, 0, t.length + (i ? 1 : 0));
|
|
739
|
-
var o = e.length;
|
|
740
|
-
return a.fill(!1, o - n.length + 1, o + 1), a;
|
|
741
|
-
}
|
|
742
|
-
function wr(e) {
|
|
743
|
-
var r = he(e), t = r.thousandSeparator, n = r.decimalSeparator, a = e.prefix;
|
|
744
|
-
a === void 0 && (a = "");
|
|
745
|
-
var i = e.allowNegative;
|
|
746
|
-
if (i === void 0 && (i = !0), t === n)
|
|
747
|
-
throw new Error(`
|
|
748
|
-
Decimal separator can't be same as thousand separator.
|
|
749
|
-
thousandSeparator: ` + t + ` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
750
|
-
decimalSeparator: ` + n + ` (default value for decimalSeparator is .)
|
|
751
|
-
`);
|
|
752
|
-
return a.startsWith("-") && i && (console.error(`
|
|
753
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
754
|
-
prefix: ` + a + `
|
|
755
|
-
allowNegative: ` + i + `
|
|
756
|
-
`), i = !1), Object.assign(Object.assign({}, e), { allowNegative: i });
|
|
757
|
-
}
|
|
758
|
-
function Nr(e) {
|
|
759
|
-
e = wr(e), e.decimalSeparator, e.allowedDecimalSeparators, e.thousandsGroupStyle;
|
|
760
|
-
var r = e.suffix, t = e.allowNegative, n = e.allowLeadingZeros, a = e.onKeyDown;
|
|
761
|
-
a === void 0 && (a = J);
|
|
762
|
-
var i = e.onBlur;
|
|
763
|
-
i === void 0 && (i = J);
|
|
764
|
-
var o = e.thousandSeparator, c = e.decimalScale, s = e.fixedDecimalScale, g = e.prefix;
|
|
765
|
-
g === void 0 && (g = "");
|
|
766
|
-
var v = e.defaultValue, m = e.value, h = e.valueIsNumericString, d = e.onValueChange, u = Fe(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), S = he(e), V = S.decimalSeparator, b = S.allowedDecimalSeparators, E = function(y) {
|
|
767
|
-
return Ae(y, e);
|
|
768
|
-
}, F = function(y, p) {
|
|
769
|
-
return Sr(y, p, e);
|
|
770
|
-
}, j = te(m) ? v : m, k = h ?? yr(j, g, r);
|
|
771
|
-
te(m) ? te(v) || (k = k || typeof v == "number") : k = k || typeof m == "number";
|
|
772
|
-
var K = function(y) {
|
|
773
|
-
return Te(y) ? y : (typeof y == "number" && (y = ke(y)), k && typeof c == "number" ? De(y, c, !!s) : y);
|
|
774
|
-
}, U = $e(K(m), K(v), !!k, E, F, d), w = U[0], _ = w.numAsString, G = w.formattedValue, M = U[1], W = function(y) {
|
|
775
|
-
var p = y.target, D = y.key, T = p.selectionStart, O = p.selectionEnd, B = p.value;
|
|
776
|
-
if (B === void 0 && (B = ""), (D === "Backspace" || D === "Delete") && O < g.length) {
|
|
777
|
-
y.preventDefault();
|
|
778
|
-
return;
|
|
779
|
-
}
|
|
780
|
-
if (T !== O) {
|
|
781
|
-
a(y);
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
D === "Backspace" && B[0] === "-" && T === g.length + 1 && t && X(p, 1), c && s && (D === "Backspace" && B[T - 1] === V ? (X(p, T - 1), y.preventDefault()) : D === "Delete" && B[T] === V && y.preventDefault()), b?.includes(D) && B[T] === V && X(p, T + 1);
|
|
785
|
-
var R = o === !0 ? "," : o;
|
|
786
|
-
D === "Backspace" && B[T - 1] === R && X(p, T - 1), D === "Delete" && B[T] === R && X(p, T + 1), a(y);
|
|
787
|
-
}, L = function(y) {
|
|
788
|
-
var p = _;
|
|
789
|
-
if (p.match(/\d/g) || (p = ""), n || (p = lr(p)), s && c && (p = De(p, c, s)), p !== _) {
|
|
790
|
-
var D = Ae(p, e);
|
|
791
|
-
M({
|
|
792
|
-
formattedValue: D,
|
|
793
|
-
value: p,
|
|
794
|
-
floatValue: parseFloat(p)
|
|
795
|
-
}, {
|
|
796
|
-
event: y,
|
|
797
|
-
source: oe.event
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
i(y);
|
|
801
|
-
}, q = function(y) {
|
|
802
|
-
return y === V ? !0 : le(y);
|
|
803
|
-
}, Q = function(y) {
|
|
804
|
-
var p = y.currentValue, D = y.lastValue, T = y.formattedValue, O = y.currentValueIndex, B = y.formattedValueIndex, R = p[O], Y = T[B], pe = _e(D, p), ie = pe.to, ge = function(be) {
|
|
805
|
-
return F(be).indexOf(".") + g.length;
|
|
806
|
-
};
|
|
807
|
-
return m === 0 && s && c && p[ie.start] === V && ge(p) < O && ge(T) > B ? !1 : O >= ie.start && O < ie.end && b && b.includes(R) && Y === V ? !0 : R === Y;
|
|
808
|
-
};
|
|
809
|
-
return Object.assign(Object.assign({}, u), {
|
|
810
|
-
value: G,
|
|
811
|
-
valueIsNumericString: !1,
|
|
812
|
-
isValidInputCharacter: q,
|
|
813
|
-
isCharacterSame: Q,
|
|
814
|
-
onValueChange: M,
|
|
815
|
-
format: E,
|
|
816
|
-
removeFormatting: F,
|
|
817
|
-
getCaretBoundary: function(y) {
|
|
818
|
-
return Ir(y, e);
|
|
819
|
-
},
|
|
820
|
-
onKeyDown: W,
|
|
821
|
-
onBlur: L
|
|
822
|
-
});
|
|
823
|
-
}
|
|
824
|
-
function Vr(e) {
|
|
825
|
-
var r = Nr(e);
|
|
826
|
-
return ee.createElement(pr, Object.assign({}, r));
|
|
827
|
-
}
|
|
828
|
-
const je = ae(
|
|
829
|
-
({
|
|
830
|
-
allowNegative: e = !0,
|
|
831
|
-
decimalScale: r = 2,
|
|
832
|
-
fixedDecimalScale: t = !1,
|
|
833
|
-
thousandSeparator: n = !0,
|
|
834
|
-
prefix: a,
|
|
835
|
-
suffix: i,
|
|
836
|
-
isAllowed: o,
|
|
837
|
-
onValueChange: c,
|
|
838
|
-
defaultValue: s,
|
|
839
|
-
value: g,
|
|
840
|
-
id: v,
|
|
841
|
-
name: m,
|
|
842
|
-
placeholder: h,
|
|
843
|
-
disabled: d,
|
|
844
|
-
error: u,
|
|
845
|
-
fullWidth: S = !0,
|
|
846
|
-
size: V = "small",
|
|
847
|
-
onBlur: b,
|
|
848
|
-
onFocus: E,
|
|
849
|
-
onKeyDown: F,
|
|
850
|
-
valueIsNumericString: j,
|
|
851
|
-
...k
|
|
852
|
-
}, K) => /* @__PURE__ */ I(
|
|
853
|
-
Vr,
|
|
854
|
-
{
|
|
855
|
-
customInput: Ee,
|
|
856
|
-
getInputRef: K,
|
|
857
|
-
allowNegative: e,
|
|
858
|
-
decimalScale: r,
|
|
859
|
-
fixedDecimalScale: t,
|
|
860
|
-
thousandSeparator: n,
|
|
861
|
-
prefix: a,
|
|
862
|
-
suffix: i,
|
|
863
|
-
isAllowed: o,
|
|
864
|
-
onValueChange: c,
|
|
865
|
-
defaultValue: s,
|
|
866
|
-
value: g,
|
|
867
|
-
valueIsNumericString: j,
|
|
868
|
-
id: v,
|
|
869
|
-
name: m,
|
|
870
|
-
placeholder: h,
|
|
871
|
-
disabled: d,
|
|
872
|
-
error: u,
|
|
873
|
-
fullWidth: S,
|
|
874
|
-
size: V,
|
|
875
|
-
onBlur: b,
|
|
876
|
-
onFocus: E,
|
|
877
|
-
onKeyDown: F,
|
|
878
|
-
...k
|
|
879
|
-
}
|
|
880
|
-
)
|
|
881
|
-
);
|
|
882
|
-
je.displayName = "NumberInput";
|
|
883
|
-
const Dr = ae(
|
|
884
|
-
({
|
|
885
|
-
disabled: e,
|
|
886
|
-
fullWidth: r,
|
|
887
|
-
helperText: t,
|
|
888
|
-
id: n,
|
|
889
|
-
label: a,
|
|
890
|
-
required: i,
|
|
891
|
-
slotProps: o,
|
|
892
|
-
sublabel: c,
|
|
893
|
-
tooltip: s,
|
|
894
|
-
...g
|
|
895
|
-
}, v) => {
|
|
896
|
-
const m = ue("number-input"), h = n || m, d = t ? `${h}-helper` : void 0, u = g.error;
|
|
897
|
-
return /* @__PURE__ */ Z(
|
|
898
|
-
ce,
|
|
899
|
-
{
|
|
900
|
-
disabled: e,
|
|
901
|
-
error: u,
|
|
902
|
-
fullWidth: r,
|
|
903
|
-
...o?.root,
|
|
904
|
-
children: [
|
|
905
|
-
/* @__PURE__ */ Z(
|
|
906
|
-
de,
|
|
907
|
-
{
|
|
908
|
-
sx: {
|
|
909
|
-
alignItems: "center",
|
|
910
|
-
display: "flex",
|
|
911
|
-
gap: "0.25rem"
|
|
912
|
-
},
|
|
913
|
-
children: [
|
|
914
|
-
/* @__PURE__ */ I(
|
|
915
|
-
se,
|
|
916
|
-
{
|
|
917
|
-
htmlFor: h,
|
|
918
|
-
required: i,
|
|
919
|
-
...o?.label,
|
|
920
|
-
children: a
|
|
921
|
-
}
|
|
922
|
-
),
|
|
923
|
-
s && /* @__PURE__ */ I(ve, { title: s, arrow: !0, children: /* @__PURE__ */ I(
|
|
924
|
-
fe,
|
|
925
|
-
{
|
|
926
|
-
sx: ({ vars: S }) => ({
|
|
927
|
-
color: S?.palette.text.secondary,
|
|
928
|
-
marginBlockEnd: "3px",
|
|
929
|
-
height: "1rem",
|
|
930
|
-
width: "1rem"
|
|
931
|
-
})
|
|
932
|
-
}
|
|
933
|
-
) })
|
|
934
|
-
]
|
|
935
|
-
}
|
|
936
|
-
),
|
|
937
|
-
c && /* @__PURE__ */ I(me, { ...o?.sublabel, children: c }),
|
|
938
|
-
/* @__PURE__ */ I(
|
|
939
|
-
je,
|
|
940
|
-
{
|
|
941
|
-
ref: v,
|
|
942
|
-
disabled: e,
|
|
943
|
-
id: h,
|
|
944
|
-
error: u,
|
|
945
|
-
fullWidth: r,
|
|
946
|
-
"aria-describedby": d ? g["aria-describedby"] ? `${g["aria-describedby"]} ${d}` : d : g["aria-describedby"],
|
|
947
|
-
...g
|
|
948
|
-
}
|
|
949
|
-
),
|
|
950
|
-
t && /* @__PURE__ */ I(ne, { id: d, ...o?.helperText, children: t })
|
|
951
|
-
]
|
|
952
|
-
}
|
|
953
|
-
);
|
|
954
|
-
}
|
|
955
|
-
);
|
|
956
|
-
Dr.displayName = "NumberInputControl";
|
|
957
|
-
const Cr = ae(
|
|
958
|
-
({
|
|
959
|
-
disabled: e,
|
|
960
|
-
error: r,
|
|
961
|
-
fullWidth: t,
|
|
962
|
-
helperText: n,
|
|
963
|
-
id: a,
|
|
964
|
-
label: i,
|
|
965
|
-
required: o,
|
|
966
|
-
slotProps: c,
|
|
967
|
-
sublabel: s,
|
|
968
|
-
tooltip: g,
|
|
969
|
-
...v
|
|
970
|
-
}, m) => {
|
|
971
|
-
const h = ue("select"), d = a || h, u = n ? `${d}-helper` : void 0;
|
|
972
|
-
return /* @__PURE__ */ Z(
|
|
973
|
-
ce,
|
|
974
|
-
{
|
|
975
|
-
disabled: e,
|
|
976
|
-
error: r,
|
|
977
|
-
fullWidth: t,
|
|
978
|
-
...c?.root,
|
|
979
|
-
children: [
|
|
980
|
-
/* @__PURE__ */ Z(
|
|
981
|
-
de,
|
|
982
|
-
{
|
|
983
|
-
sx: {
|
|
984
|
-
alignItems: "center",
|
|
985
|
-
display: "flex",
|
|
986
|
-
gap: "0.25rem"
|
|
987
|
-
},
|
|
988
|
-
children: [
|
|
989
|
-
/* @__PURE__ */ I(
|
|
990
|
-
se,
|
|
991
|
-
{
|
|
992
|
-
id: `${d}-label`,
|
|
993
|
-
htmlFor: d,
|
|
994
|
-
required: o,
|
|
995
|
-
...c?.label,
|
|
996
|
-
children: i
|
|
997
|
-
}
|
|
998
|
-
),
|
|
999
|
-
g && /* @__PURE__ */ I(ve, { title: g, arrow: !0, children: /* @__PURE__ */ I(
|
|
1000
|
-
fe,
|
|
1001
|
-
{
|
|
1002
|
-
sx: ({ vars: S }) => ({
|
|
1003
|
-
color: S?.palette.text.secondary,
|
|
1004
|
-
marginBlockEnd: "3px",
|
|
1005
|
-
height: "1rem",
|
|
1006
|
-
width: "1rem"
|
|
1007
|
-
})
|
|
1008
|
-
}
|
|
1009
|
-
) })
|
|
1010
|
-
]
|
|
1011
|
-
}
|
|
1012
|
-
),
|
|
1013
|
-
s && /* @__PURE__ */ I(me, { ...c?.sublabel, children: s }),
|
|
1014
|
-
/* @__PURE__ */ I(
|
|
1015
|
-
Je,
|
|
1016
|
-
{
|
|
1017
|
-
ref: m,
|
|
1018
|
-
disabled: e,
|
|
1019
|
-
error: r,
|
|
1020
|
-
fullWidth: t,
|
|
1021
|
-
labelId: `${d}-label`,
|
|
1022
|
-
id: d,
|
|
1023
|
-
"aria-describedby": u ? v["aria-describedby"] ? `${v["aria-describedby"]} ${u}` : u : v["aria-describedby"],
|
|
1024
|
-
slotProps: c?.select,
|
|
1025
|
-
...v
|
|
1026
|
-
}
|
|
1027
|
-
),
|
|
1028
|
-
n && /* @__PURE__ */ I(ne, { id: u, ...c?.helperText, children: n })
|
|
1029
|
-
]
|
|
1030
|
-
}
|
|
1031
|
-
);
|
|
1032
|
-
}
|
|
1033
|
-
);
|
|
1034
|
-
Cr.displayName = "SelectControl";
|
|
1035
|
-
export {
|
|
1036
|
-
Ye as A,
|
|
1037
|
-
er as D,
|
|
1038
|
-
me as F,
|
|
1039
|
-
rr as I,
|
|
1040
|
-
je as N,
|
|
1041
|
-
Cr as S,
|
|
1042
|
-
Dr as a
|
|
1043
|
-
};
|