@max-ts/components 1.4.3 → 1.4.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/lib/index.mjs +340 -338
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -75,7 +75,7 @@ function Kl() {
|
|
|
75
75
|
switch (typeof O.tag == "number" && console.error(
|
|
76
76
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
77
77
|
), O.$$typeof) {
|
|
78
|
-
case
|
|
78
|
+
case k:
|
|
79
79
|
return "Portal";
|
|
80
80
|
case $:
|
|
81
81
|
return (O.displayName || "Context") + ".Provider";
|
|
@@ -84,7 +84,7 @@ function Kl() {
|
|
|
84
84
|
case A:
|
|
85
85
|
var _ = O.render;
|
|
86
86
|
return O = O.displayName, O || (O = _.displayName || _.name || "", O = O !== "" ? "ForwardRef(" + O + ")" : "ForwardRef"), O;
|
|
87
|
-
case
|
|
87
|
+
case x:
|
|
88
88
|
return _ = O.displayName || null, _ !== null ? _ : e(O.type) || "Memo";
|
|
89
89
|
case j:
|
|
90
90
|
_ = O._payload, O = O._init;
|
|
@@ -243,7 +243,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
function u(O) {
|
|
244
244
|
typeof O == "object" && O !== null && O.$$typeof === v && O._store && (O._store.validated = 1);
|
|
245
245
|
}
|
|
246
|
-
var p = g, v = Symbol.for("react.transitional.element"),
|
|
246
|
+
var p = g, v = Symbol.for("react.transitional.element"), k = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), m = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), T = Symbol.for("react.activity"), z = Symbol.for("react.client.reference"), L = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, W = Array.isArray, U = console.createTask ? console.createTask : function() {
|
|
247
247
|
return null;
|
|
248
248
|
};
|
|
249
249
|
p = {
|
|
@@ -1684,8 +1684,8 @@ const eu = ({
|
|
|
1684
1684
|
if (c)
|
|
1685
1685
|
r?.(!n, v);
|
|
1686
1686
|
else {
|
|
1687
|
-
const
|
|
1688
|
-
s(
|
|
1687
|
+
const k = !i;
|
|
1688
|
+
s(k), r?.(k, v);
|
|
1689
1689
|
}
|
|
1690
1690
|
}, p = typeof e == "string" ? au : Es;
|
|
1691
1691
|
return /* @__PURE__ */ l.jsxs("div", { ref: a, children: [
|
|
@@ -1711,19 +1711,19 @@ const eu = ({
|
|
|
1711
1711
|
isDisabled: r
|
|
1712
1712
|
}) => {
|
|
1713
1713
|
if ("actions" in e) {
|
|
1714
|
-
const { icon: v, disabled:
|
|
1714
|
+
const { icon: v, disabled: k, disabledReason: M, name: C, actions: b } = e;
|
|
1715
1715
|
return /* @__PURE__ */ l.jsx(
|
|
1716
1716
|
Te,
|
|
1717
1717
|
{
|
|
1718
1718
|
title: M || C,
|
|
1719
1719
|
placement: n,
|
|
1720
|
-
withoutContainer: !(r ||
|
|
1720
|
+
withoutContainer: !(r || k),
|
|
1721
1721
|
children: /* @__PURE__ */ l.jsx(
|
|
1722
1722
|
Dn,
|
|
1723
1723
|
{
|
|
1724
1724
|
icon: v,
|
|
1725
1725
|
variant: "text",
|
|
1726
|
-
disabled: r ||
|
|
1726
|
+
disabled: r || k,
|
|
1727
1727
|
children: b.map(
|
|
1728
1728
|
({ name: m, onClick: $, ...A }) => /* @__PURE__ */ At(
|
|
1729
1729
|
st,
|
|
@@ -2111,7 +2111,7 @@ const yu = y(
|
|
|
2111
2111
|
isNested: u,
|
|
2112
2112
|
actions: p,
|
|
2113
2113
|
disabled: v,
|
|
2114
|
-
disabledReason:
|
|
2114
|
+
disabledReason: k,
|
|
2115
2115
|
note: M,
|
|
2116
2116
|
isBlockingOperation: C,
|
|
2117
2117
|
...b
|
|
@@ -2119,7 +2119,7 @@ const yu = y(
|
|
|
2119
2119
|
return /* @__PURE__ */ l.jsx(
|
|
2120
2120
|
Te,
|
|
2121
2121
|
{
|
|
2122
|
-
title: v ?
|
|
2122
|
+
title: v ? k : M,
|
|
2123
2123
|
withoutContainer: !(t || v),
|
|
2124
2124
|
children: /* @__PURE__ */ l.jsx(
|
|
2125
2125
|
Cu,
|
|
@@ -2279,13 +2279,13 @@ const yu = y(
|
|
|
2279
2279
|
...i
|
|
2280
2280
|
}) => {
|
|
2281
2281
|
const { severity: s = "info", slots: c, ...d } = i, f = (u) => {
|
|
2282
|
-
const { variant: p, color: v, ...
|
|
2282
|
+
const { variant: p, color: v, ...k } = u;
|
|
2283
2283
|
return /* @__PURE__ */ l.jsx(
|
|
2284
2284
|
Pu,
|
|
2285
2285
|
{
|
|
2286
2286
|
variant: "text",
|
|
2287
2287
|
color: "primary",
|
|
2288
|
-
...
|
|
2288
|
+
...k
|
|
2289
2289
|
}
|
|
2290
2290
|
);
|
|
2291
2291
|
};
|
|
@@ -2760,7 +2760,7 @@ const Iu = {
|
|
|
2760
2760
|
return /* @__PURE__ */ l.jsx(Ar, { error: !0, children: n });
|
|
2761
2761
|
if (n)
|
|
2762
2762
|
return n;
|
|
2763
|
-
}, [n, e, t]),
|
|
2763
|
+
}, [n, e, t]), k = (M) => {
|
|
2764
2764
|
if (d) {
|
|
2765
2765
|
const C = M.target.value?.trim();
|
|
2766
2766
|
u.onChange?.({
|
|
@@ -2787,7 +2787,7 @@ const Iu = {
|
|
|
2787
2787
|
maxLength: c,
|
|
2788
2788
|
...i
|
|
2789
2789
|
},
|
|
2790
|
-
onBlur:
|
|
2790
|
+
onBlur: k,
|
|
2791
2791
|
...u
|
|
2792
2792
|
}
|
|
2793
2793
|
);
|
|
@@ -2809,7 +2809,7 @@ const Iu = {
|
|
|
2809
2809
|
noOptionsText: c = "Нет данных",
|
|
2810
2810
|
onInputChange: d
|
|
2811
2811
|
}) => {
|
|
2812
|
-
const [f, u] = me(""), p = Zu(e), v = f.length >= 1,
|
|
2812
|
+
const [f, u] = me(""), p = Zu(e), v = f.length >= 1, k = o.length > 0, M = v || k || a || i, C = ve(
|
|
2813
2813
|
(m, $) => t ? t(m, $) : JSON.stringify(m) === JSON.stringify($),
|
|
2814
2814
|
[t]
|
|
2815
2815
|
);
|
|
@@ -2837,7 +2837,7 @@ const Iu = {
|
|
|
2837
2837
|
multiple: u,
|
|
2838
2838
|
size: p = "medium",
|
|
2839
2839
|
placeholder: v = Xu,
|
|
2840
|
-
overflowOption:
|
|
2840
|
+
overflowOption: k,
|
|
2841
2841
|
closeText: M = "Закрыть",
|
|
2842
2842
|
openText: C = "Открыть",
|
|
2843
2843
|
clearText: b = "Очистить",
|
|
@@ -2846,7 +2846,7 @@ const Iu = {
|
|
|
2846
2846
|
loadedDataError: A,
|
|
2847
2847
|
noOptionsText: E,
|
|
2848
2848
|
autoHighlight: S,
|
|
2849
|
-
renderInput:
|
|
2849
|
+
renderInput: x,
|
|
2850
2850
|
renderTags: j,
|
|
2851
2851
|
renderOption: T,
|
|
2852
2852
|
...z
|
|
@@ -2863,11 +2863,11 @@ const Iu = {
|
|
|
2863
2863
|
helperText: d,
|
|
2864
2864
|
size: p
|
|
2865
2865
|
};
|
|
2866
|
-
return
|
|
2866
|
+
return x ? x(B) : /* @__PURE__ */ l.jsx(rn, { ...B });
|
|
2867
2867
|
},
|
|
2868
2868
|
[
|
|
2869
2869
|
t,
|
|
2870
|
-
|
|
2870
|
+
x,
|
|
2871
2871
|
f,
|
|
2872
2872
|
o,
|
|
2873
2873
|
v,
|
|
@@ -2891,12 +2891,12 @@ const Iu = {
|
|
|
2891
2891
|
Nt,
|
|
2892
2892
|
{
|
|
2893
2893
|
rowsCount: qu,
|
|
2894
|
-
...
|
|
2894
|
+
...k,
|
|
2895
2895
|
children: Y.key
|
|
2896
2896
|
}
|
|
2897
2897
|
));
|
|
2898
2898
|
},
|
|
2899
|
-
[u,
|
|
2899
|
+
[u, k, T]
|
|
2900
2900
|
), W = ve(
|
|
2901
2901
|
(Y, B, Z) => j ? j(Y, B, Z) : Y.map((oe, te) => {
|
|
2902
2902
|
const O = c?.(oe) || "";
|
|
@@ -2953,14 +2953,14 @@ const Iu = {
|
|
|
2953
2953
|
onOpen: i,
|
|
2954
2954
|
onInputChange: s
|
|
2955
2955
|
}) => {
|
|
2956
|
-
const [c, d] = me(!1), [f, u] = me(!0), [p, v] = me(!0),
|
|
2956
|
+
const [c, d] = me(!1), [f, u] = me(!0), [p, v] = me(!0), k = Le(null), [M, C] = me([]), b = ve(
|
|
2957
2957
|
Ra((E) => {
|
|
2958
|
-
|
|
2958
|
+
k.current?.abort();
|
|
2959
2959
|
const S = new AbortController();
|
|
2960
|
-
|
|
2961
|
-
C(
|
|
2960
|
+
k.current = S, e(E, S?.signal).then((x) => {
|
|
2961
|
+
C(x), v(x.length === 0);
|
|
2962
2962
|
}).finally(() => {
|
|
2963
|
-
d(!1),
|
|
2963
|
+
d(!1), k.current = null;
|
|
2964
2964
|
});
|
|
2965
2965
|
}, t),
|
|
2966
2966
|
[e, t, a]
|
|
@@ -2974,10 +2974,10 @@ const Iu = {
|
|
|
2974
2974
|
}
|
|
2975
2975
|
i?.(E);
|
|
2976
2976
|
},
|
|
2977
|
-
handleInputChange: (E, S,
|
|
2977
|
+
handleInputChange: (E, S, x) => {
|
|
2978
2978
|
if (!S || S.length < n)
|
|
2979
2979
|
return b && b.clear(), v(!1), d(!1), C([]);
|
|
2980
|
-
d(!0), f || b(S), s?.(E, S,
|
|
2980
|
+
d(!0), f || b(S), s?.(E, S, x);
|
|
2981
2981
|
},
|
|
2982
2982
|
options: M,
|
|
2983
2983
|
isLoadingData: c,
|
|
@@ -2999,7 +2999,7 @@ const Iu = {
|
|
|
2999
2999
|
isSuccess: u,
|
|
3000
3000
|
isError: p,
|
|
3001
3001
|
isLoading: v,
|
|
3002
|
-
isFullWidth:
|
|
3002
|
+
isFullWidth: k,
|
|
3003
3003
|
onOpen: M,
|
|
3004
3004
|
noOptionsText: C,
|
|
3005
3005
|
onInputChange: b,
|
|
@@ -3010,7 +3010,7 @@ const Iu = {
|
|
|
3010
3010
|
{
|
|
3011
3011
|
options: t,
|
|
3012
3012
|
disabled: d,
|
|
3013
|
-
fullWidth:
|
|
3013
|
+
fullWidth: k,
|
|
3014
3014
|
loading: v || n,
|
|
3015
3015
|
onOpen: r,
|
|
3016
3016
|
error: p,
|
|
@@ -3346,12 +3346,12 @@ const Iu = {
|
|
|
3346
3346
|
text: u,
|
|
3347
3347
|
variant: p,
|
|
3348
3348
|
onClick: v,
|
|
3349
|
-
...
|
|
3349
|
+
...k
|
|
3350
3350
|
} = i.cancel || {};
|
|
3351
3351
|
return /* @__PURE__ */ l.jsxs(Sd, { title: o, open: r, onClose: s, ...c, children: [
|
|
3352
3352
|
a && /* @__PURE__ */ l.jsx(Od, { children: /* @__PURE__ */ l.jsx(jd, { children: a }) }),
|
|
3353
3353
|
/* @__PURE__ */ l.jsxs(Md, { children: [
|
|
3354
|
-
t && /* @__PURE__ */ l.jsx(Td, { ...
|
|
3354
|
+
t && /* @__PURE__ */ l.jsx(Td, { ...k, ...n, children: u }),
|
|
3355
3355
|
/* @__PURE__ */ l.jsx(Fe, { ...f, children: d })
|
|
3356
3356
|
] })
|
|
3357
3357
|
] });
|
|
@@ -3590,12 +3590,12 @@ const qd = y("div")`
|
|
|
3590
3590
|
errorList: u,
|
|
3591
3591
|
onRetry: p,
|
|
3592
3592
|
actions: v = /* @__PURE__ */ l.jsx(Fe, { onClick: p, children: "Попробовать снова" })
|
|
3593
|
-
} = r,
|
|
3593
|
+
} = r, k = u.map((M) => /* @__PURE__ */ l.jsx(ye, { component: "p", children: M }, M));
|
|
3594
3594
|
return /* @__PURE__ */ l.jsx(
|
|
3595
3595
|
bn,
|
|
3596
3596
|
{
|
|
3597
3597
|
title: c,
|
|
3598
|
-
description:
|
|
3598
|
+
description: k,
|
|
3599
3599
|
imgAlt: d,
|
|
3600
3600
|
imgSrc: f,
|
|
3601
3601
|
Actions: v
|
|
@@ -3832,7 +3832,7 @@ const ir = () => tt(ai), si = 44, li = 36, ff = 10, Ro = "start", pf = {
|
|
|
3832
3832
|
onSelectRow: s,
|
|
3833
3833
|
onRowClick: c
|
|
3834
3834
|
}) => {
|
|
3835
|
-
const [d, f] = me(!1), u = n[e], { isDisabled: p, disabledReason: v } = o || {},
|
|
3835
|
+
const [d, f] = me(!1), u = n[e], { isDisabled: p, disabledReason: v } = o || {}, k = a && !!i?.find(($) => $[e] === u);
|
|
3836
3836
|
return {
|
|
3837
3837
|
rowId: u,
|
|
3838
3838
|
disabled: p,
|
|
@@ -3858,7 +3858,7 @@ const ir = () => tt(ai), si = 44, li = 36, ff = 10, Ro = "start", pf = {
|
|
|
3858
3858
|
onClose: () => f(!1)
|
|
3859
3859
|
},
|
|
3860
3860
|
checkboxProps: {
|
|
3861
|
-
checked:
|
|
3861
|
+
checked: k,
|
|
3862
3862
|
disabled: p,
|
|
3863
3863
|
onChange: s(n)
|
|
3864
3864
|
}
|
|
@@ -3873,7 +3873,7 @@ const ir = () => tt(ai), si = 44, li = 36, ff = 10, Ro = "start", pf = {
|
|
|
3873
3873
|
columns: u,
|
|
3874
3874
|
emptyCellValue: p,
|
|
3875
3875
|
selectedRows: v,
|
|
3876
|
-
activeRowId:
|
|
3876
|
+
activeRowId: k,
|
|
3877
3877
|
keyId: M,
|
|
3878
3878
|
onSelectRow: C,
|
|
3879
3879
|
onRowClick: b,
|
|
@@ -3884,15 +3884,15 @@ const ir = () => tt(ai), si = 44, li = 36, ff = 10, Ro = "start", pf = {
|
|
|
3884
3884
|
bf,
|
|
3885
3885
|
{
|
|
3886
3886
|
inert: a ? !0 : void 0,
|
|
3887
|
-
onClick: (
|
|
3887
|
+
onClick: (x) => x.stopPropagation(),
|
|
3888
3888
|
children: /* @__PURE__ */ l.jsx(or, { ...n, style: { padding: 0 } })
|
|
3889
3889
|
}
|
|
3890
3890
|
), S = ve(() => {
|
|
3891
|
-
const
|
|
3891
|
+
const x = $ ? void 0 : [u.length - 1];
|
|
3892
3892
|
return u?.map((j, T) => {
|
|
3893
3893
|
const z = `${t}-${T}`, L = wf(
|
|
3894
3894
|
a,
|
|
3895
|
-
|
|
3895
|
+
x,
|
|
3896
3896
|
T
|
|
3897
3897
|
), N = !T;
|
|
3898
3898
|
return /* @__PURE__ */ l.jsx(
|
|
@@ -3953,7 +3953,7 @@ const ir = () => tt(ai), si = 44, li = 36, ff = 10, Ro = "start", pf = {
|
|
|
3953
3953
|
noDataPlaceholder: u,
|
|
3954
3954
|
onRetry: p,
|
|
3955
3955
|
...v
|
|
3956
|
-
} = e,
|
|
3956
|
+
} = e, k = Re(() => o.map(({ children: M, options: C, ...b }) => {
|
|
3957
3957
|
const m = b[f];
|
|
3958
3958
|
return /* @__PURE__ */ l.jsx(
|
|
3959
3959
|
kf,
|
|
@@ -3977,7 +3977,7 @@ const ir = () => tt(ai), si = 44, li = 36, ff = 10, Ro = "start", pf = {
|
|
|
3977
3977
|
imgSrc: t.defaultErrorImgSrc,
|
|
3978
3978
|
onRetry: p
|
|
3979
3979
|
},
|
|
3980
|
-
children: o.length ?
|
|
3980
|
+
children: o.length ? k : u
|
|
3981
3981
|
}
|
|
3982
3982
|
) });
|
|
3983
3983
|
}, Mf = y("footer", {
|
|
@@ -4105,7 +4105,7 @@ const Of = y("div", {
|
|
|
4105
4105
|
};
|
|
4106
4106
|
}, Nf = (e) => {
|
|
4107
4107
|
const { checkboxProps: t, handleSort: n } = Ff(e), { columns: r, gridColumns: o, isSelectable: a, sorting: i, onSelectAllRows: s } = e, c = Re(() => r.map(({ field: d, label: f, sortable: u, align: p }, v) => {
|
|
4108
|
-
const
|
|
4108
|
+
const k = !v, M = () => !k || !a ? null : /* @__PURE__ */ l.jsx(_f, { children: /* @__PURE__ */ l.jsx(or, { ...t, onChange: s }) });
|
|
4109
4109
|
return /* @__PURE__ */ l.jsx(
|
|
4110
4110
|
Pf,
|
|
4111
4111
|
{
|
|
@@ -4208,7 +4208,7 @@ const Of = y("div", {
|
|
|
4208
4208
|
}, [n, o]);
|
|
4209
4209
|
const p = Hf(t), v = Re(() => f.filter(
|
|
4210
4210
|
(m) => !r.find(($) => $[e] === m[e])
|
|
4211
|
-
).length, [f, r, e]),
|
|
4211
|
+
).length, [f, r, e]), k = ve(() => n.length <= 1 ? t.map((m) => ({ ...m, sortable: !1 })) : t, [t, n]), M = o ? u.current : n, C = (m) => {
|
|
4212
4212
|
if (!i)
|
|
4213
4213
|
return;
|
|
4214
4214
|
if (m.target.checked) {
|
|
@@ -4244,7 +4244,7 @@ const Of = y("div", {
|
|
|
4244
4244
|
uncheckedRowsCount: v,
|
|
4245
4245
|
gridColumns: p,
|
|
4246
4246
|
isSelectable: c,
|
|
4247
|
-
columns:
|
|
4247
|
+
columns: k(),
|
|
4248
4248
|
onSelectAllRows: C
|
|
4249
4249
|
},
|
|
4250
4250
|
bodyProps: {
|
|
@@ -4266,7 +4266,7 @@ const Of = y("div", {
|
|
|
4266
4266
|
minDisplayRows: u = ff,
|
|
4267
4267
|
errorMsg: p,
|
|
4268
4268
|
footer: v,
|
|
4269
|
-
noDataPlaceholder:
|
|
4269
|
+
noDataPlaceholder: k,
|
|
4270
4270
|
isLoading: M,
|
|
4271
4271
|
isError: C,
|
|
4272
4272
|
keyId: b,
|
|
@@ -4275,9 +4275,9 @@ const Of = y("div", {
|
|
|
4275
4275
|
className: A,
|
|
4276
4276
|
onRowClick: E,
|
|
4277
4277
|
onSort: S,
|
|
4278
|
-
noDataOptions:
|
|
4278
|
+
noDataOptions: x,
|
|
4279
4279
|
onRetry: j
|
|
4280
|
-
} = e, T = t ? zf : ui, z = ve(() => M ? null :
|
|
4280
|
+
} = e, T = t ? zf : ui, z = ve(() => M ? null : k || /* @__PURE__ */ l.jsx(Lf, { ...x }), [k, x, M]);
|
|
4281
4281
|
return /* @__PURE__ */ l.jsxs(Vf, { $maxHeight: f, className: A, children: [
|
|
4282
4282
|
/* @__PURE__ */ l.jsxs(T, { inert: t ? !0 : void 0, children: [
|
|
4283
4283
|
/* @__PURE__ */ l.jsx(
|
|
@@ -4333,7 +4333,7 @@ const Of = y("div", {
|
|
|
4333
4333
|
disabledReason: u,
|
|
4334
4334
|
disabled: p,
|
|
4335
4335
|
loading: v,
|
|
4336
|
-
isBlockingOperation:
|
|
4336
|
+
isBlockingOperation: k,
|
|
4337
4337
|
loadingNote: M,
|
|
4338
4338
|
onClick: C,
|
|
4339
4339
|
...b
|
|
@@ -4534,7 +4534,7 @@ const Of = y("div", {
|
|
|
4534
4534
|
getOptionLabel: n,
|
|
4535
4535
|
onChange: r
|
|
4536
4536
|
}) => {
|
|
4537
|
-
const [o, a] = me(1), i = Le(!1), s = Le(null), c = (p, v,
|
|
4537
|
+
const [o, a] = me(1), i = Le(!1), s = Le(null), c = (p, v, k) => {
|
|
4538
4538
|
const M = n(e[0]);
|
|
4539
4539
|
document.body.appendChild(p);
|
|
4540
4540
|
let C = 0, b = 0;
|
|
@@ -4545,21 +4545,21 @@ const Of = y("div", {
|
|
|
4545
4545
|
if (!E)
|
|
4546
4546
|
throw new Error("Could not find text node");
|
|
4547
4547
|
E.textContent = A, p.appendChild($);
|
|
4548
|
-
const
|
|
4549
|
-
if (C +
|
|
4548
|
+
const x = $.getBoundingClientRect().width + k;
|
|
4549
|
+
if (C + x > v)
|
|
4550
4550
|
break;
|
|
4551
|
-
b += 1, C +=
|
|
4551
|
+
b += 1, C += x;
|
|
4552
4552
|
}
|
|
4553
4553
|
return document.body.removeChild(p), b;
|
|
4554
4554
|
}, d = () => {
|
|
4555
4555
|
const p = s.current;
|
|
4556
4556
|
if (!p)
|
|
4557
4557
|
throw new Error("Tags container ref is not set");
|
|
4558
|
-
const v = window.getComputedStyle(p),
|
|
4558
|
+
const v = window.getComputedStyle(p), k = Number.parseInt(v.columnGap), M = p.firstElementChild?.getBoundingClientRect().width || 0, C = p.getBoundingClientRect().width - M, b = p.cloneNode(!0);
|
|
4559
4559
|
for (; b.lastElementChild && b.children.length > 1; )
|
|
4560
4560
|
b.removeChild(b.lastElementChild);
|
|
4561
4561
|
b.style.visibility = "hidden";
|
|
4562
|
-
const m = c(b, C,
|
|
4562
|
+
const m = c(b, C, k);
|
|
4563
4563
|
a(1 + m);
|
|
4564
4564
|
};
|
|
4565
4565
|
Yr(() => {
|
|
@@ -4579,8 +4579,8 @@ const Of = y("div", {
|
|
|
4579
4579
|
return p.observe(s.current), () => p.disconnect();
|
|
4580
4580
|
}, [e]);
|
|
4581
4581
|
const f = (p, v) => {
|
|
4582
|
-
const
|
|
4583
|
-
return { label:
|
|
4582
|
+
const k = n(p), M = v === o - 1 && o <= e.length;
|
|
4583
|
+
return { label: k, shrinks: M, onDelete: () => {
|
|
4584
4584
|
const b = e?.filter((m) => typeof m == "string" ? m !== p : m[t] !== p[t]);
|
|
4585
4585
|
r(b?.length ? b : []);
|
|
4586
4586
|
} };
|
|
@@ -4680,10 +4680,10 @@ function up({
|
|
|
4680
4680
|
}
|
|
4681
4681
|
};
|
|
4682
4682
|
t?.call({}, M);
|
|
4683
|
-
}, v = i && !(!e || Array.isArray(e) && e.length === 0 || typeof e == "string" && e.length === 0),
|
|
4683
|
+
}, v = i && !(!e || Array.isArray(e) && e.length === 0 || typeof e == "string" && e.length === 0), k = !Ts.count(n);
|
|
4684
4684
|
return {
|
|
4685
4685
|
isOpened: s,
|
|
4686
|
-
isNoData:
|
|
4686
|
+
isNoData: k,
|
|
4687
4687
|
isShowingClearButton: v,
|
|
4688
4688
|
resetButtonRef: d,
|
|
4689
4689
|
openSelect: f,
|
|
@@ -4718,7 +4718,7 @@ function pi({
|
|
|
4718
4718
|
id: u,
|
|
4719
4719
|
onChange: p,
|
|
4720
4720
|
isShowClearButton: v,
|
|
4721
|
-
...
|
|
4721
|
+
...k
|
|
4722
4722
|
}) {
|
|
4723
4723
|
const {
|
|
4724
4724
|
isOpened: M,
|
|
@@ -4729,12 +4729,12 @@ function pi({
|
|
|
4729
4729
|
closeSelect: A,
|
|
4730
4730
|
resetButtonRef: E
|
|
4731
4731
|
} = up({
|
|
4732
|
-
...
|
|
4732
|
+
...k,
|
|
4733
4733
|
children: i,
|
|
4734
4734
|
onChange: p,
|
|
4735
4735
|
isShowClearButton: v
|
|
4736
|
-
}), S = (
|
|
4737
|
-
if (Array.isArray(
|
|
4736
|
+
}), S = (x) => {
|
|
4737
|
+
if (Array.isArray(x) && x.length) {
|
|
4738
4738
|
const j = (T) => p?.(T ? {
|
|
4739
4739
|
target: {
|
|
4740
4740
|
value: T
|
|
@@ -4747,7 +4747,7 @@ function pi({
|
|
|
4747
4747
|
return /* @__PURE__ */ l.jsx(
|
|
4748
4748
|
op,
|
|
4749
4749
|
{
|
|
4750
|
-
data:
|
|
4750
|
+
data: x,
|
|
4751
4751
|
keyId: "value",
|
|
4752
4752
|
getOptionLabel: t,
|
|
4753
4753
|
onChange: j,
|
|
@@ -4755,14 +4755,14 @@ function pi({
|
|
|
4755
4755
|
}
|
|
4756
4756
|
);
|
|
4757
4757
|
}
|
|
4758
|
-
return (Array.isArray(
|
|
4758
|
+
return (Array.isArray(x) || typeof x == "string") && !x.length ? n : t(x);
|
|
4759
4759
|
};
|
|
4760
4760
|
return /* @__PURE__ */ l.jsxs(La, { error: c, fullWidth: f, children: [
|
|
4761
4761
|
d && /* @__PURE__ */ l.jsx(Cl, { htmlFor: u || d, required: e, children: d }),
|
|
4762
4762
|
/* @__PURE__ */ l.jsxs(
|
|
4763
4763
|
cp,
|
|
4764
4764
|
{
|
|
4765
|
-
...
|
|
4765
|
+
...k,
|
|
4766
4766
|
open: M,
|
|
4767
4767
|
id: u || d,
|
|
4768
4768
|
disabled: s,
|
|
@@ -4869,7 +4869,7 @@ const hi = 20, fp = [20, 50, 100], pp = y("div")`
|
|
|
4869
4869
|
disabled: u,
|
|
4870
4870
|
isShowClearButton: !1,
|
|
4871
4871
|
onChange: o,
|
|
4872
|
-
children: d.map((
|
|
4872
|
+
children: d.map((k) => /* @__PURE__ */ l.jsx(st, { value: k, children: k }, k))
|
|
4873
4873
|
}
|
|
4874
4874
|
)
|
|
4875
4875
|
] }),
|
|
@@ -4978,8 +4978,8 @@ function gi(e) {
|
|
|
4978
4978
|
const c = gn(e.timeZone, e), f = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - c, u = c !== t, p = f - s;
|
|
4979
4979
|
if (u && p) {
|
|
4980
4980
|
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + p);
|
|
4981
|
-
const v = gn(e.timeZone, e),
|
|
4982
|
-
|
|
4981
|
+
const v = gn(e.timeZone, e), k = c - v;
|
|
4982
|
+
k && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + k), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + k));
|
|
4983
4983
|
}
|
|
4984
4984
|
}
|
|
4985
4985
|
class Pt extends xt {
|
|
@@ -6718,8 +6718,8 @@ function Mg(e, t, n, r, o) {
|
|
|
6718
6718
|
start: i(e),
|
|
6719
6719
|
end: s(e)
|
|
6720
6720
|
}).map((p) => {
|
|
6721
|
-
const v = r.formatMonthDropdown(p, o),
|
|
6722
|
-
return { value:
|
|
6721
|
+
const v = r.formatMonthDropdown(p, o), k = d(p), M = t && p < a(t) || n && p > a(n) || !1;
|
|
6722
|
+
return { value: k, label: v, disabled: M };
|
|
6723
6723
|
});
|
|
6724
6724
|
}
|
|
6725
6725
|
function Dg(e, t = {}, n = {}) {
|
|
@@ -6746,10 +6746,10 @@ function Eg(e, t, n, r) {
|
|
|
6746
6746
|
let v = f;
|
|
6747
6747
|
for (; c(v, u) || d(v, u); )
|
|
6748
6748
|
p.push(v), v = i(v, 1);
|
|
6749
|
-
return p.map((
|
|
6750
|
-
const M = n.formatYearDropdown(
|
|
6749
|
+
return p.map((k) => {
|
|
6750
|
+
const M = n.formatYearDropdown(k, r);
|
|
6751
6751
|
return {
|
|
6752
|
-
value: s(
|
|
6752
|
+
value: s(k),
|
|
6753
6753
|
label: M,
|
|
6754
6754
|
disabled: !1
|
|
6755
6755
|
};
|
|
@@ -6803,7 +6803,7 @@ function Yg(e, t, { classNames: n, months: r, focused: o, dateLib: a }) {
|
|
|
6803
6803
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
6804
6804
|
r.length === 0 || d.length === 0 || r.length !== d.length)
|
|
6805
6805
|
return;
|
|
6806
|
-
const f = a.isSameMonth(r[0].date, d[0].date), u = a.isAfter(r[0].date, d[0].date), p = u ? n[Ke.caption_after_enter] : n[Ke.caption_before_enter], v = u ? n[Ke.weeks_after_enter] : n[Ke.weeks_before_enter],
|
|
6806
|
+
const f = a.isSameMonth(r[0].date, d[0].date), u = a.isAfter(r[0].date, d[0].date), p = u ? n[Ke.caption_after_enter] : n[Ke.caption_before_enter], v = u ? n[Ke.weeks_after_enter] : n[Ke.weeks_before_enter], k = i.current, M = e.current.cloneNode(!0);
|
|
6807
6807
|
if (M instanceof HTMLElement ? (gr(M).forEach(($) => {
|
|
6808
6808
|
if (!($ instanceof HTMLElement))
|
|
6809
6809
|
return;
|
|
@@ -6816,7 +6816,7 @@ function Yg(e, t, { classNames: n, months: r, focused: o, dateLib: a }) {
|
|
|
6816
6816
|
}), i.current = M) : i.current = null, c.current || f || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
6817
6817
|
o)
|
|
6818
6818
|
return;
|
|
6819
|
-
const C =
|
|
6819
|
+
const C = k instanceof HTMLElement ? gr(k) : [], b = gr(e.current);
|
|
6820
6820
|
if (b && b.every((m) => m instanceof HTMLElement) && C && C.every((m) => m instanceof HTMLElement)) {
|
|
6821
6821
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
6822
6822
|
const m = zg(e.current);
|
|
@@ -6827,10 +6827,10 @@ function Yg(e, t, { classNames: n, months: r, focused: o, dateLib: a }) {
|
|
|
6827
6827
|
$.style.position = "relative", $.style.overflow = "hidden";
|
|
6828
6828
|
const S = mr($);
|
|
6829
6829
|
S && S.classList.add(p);
|
|
6830
|
-
const
|
|
6831
|
-
|
|
6830
|
+
const x = yr($);
|
|
6831
|
+
x && x.classList.add(v);
|
|
6832
6832
|
const j = () => {
|
|
6833
|
-
c.current = !1, e.current && (e.current.style.isolation = ""), m && (m.style.zIndex = ""), S && S.classList.remove(p),
|
|
6833
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), m && (m.style.zIndex = ""), S && S.classList.remove(p), x && x.classList.remove(v), $.style.position = "", $.style.overflow = "", $.contains(E) && $.removeChild(E);
|
|
6834
6834
|
};
|
|
6835
6835
|
E.style.pointerEvents = "none", E.style.position = "absolute", E.style.overflow = "hidden", E.setAttribute("aria-hidden", "true");
|
|
6836
6836
|
const T = Hg(E);
|
|
@@ -6844,14 +6844,14 @@ function Yg(e, t, { classNames: n, months: r, focused: o, dateLib: a }) {
|
|
|
6844
6844
|
});
|
|
6845
6845
|
}
|
|
6846
6846
|
function Gg(e, t, n, r) {
|
|
6847
|
-
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = n ?? {}, { addDays: d, differenceInCalendarDays: f, differenceInCalendarMonths: u, endOfBroadcastWeek: p, endOfISOWeek: v, endOfMonth:
|
|
6847
|
+
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = n ?? {}, { addDays: d, differenceInCalendarDays: f, differenceInCalendarMonths: u, endOfBroadcastWeek: p, endOfISOWeek: v, endOfMonth: k, endOfWeek: M, isAfter: C, startOfBroadcastWeek: b, startOfISOWeek: m, startOfWeek: $ } = r, A = c ? b(o, r) : i ? m(o) : $(o), E = c ? p(a, r) : i ? v(k(a)) : M(k(a)), S = f(E, A), x = u(a, o) + 1, j = [];
|
|
6848
6848
|
for (let L = 0; L <= S; L++) {
|
|
6849
6849
|
const N = d(A, L);
|
|
6850
6850
|
if (t && C(N, t))
|
|
6851
6851
|
break;
|
|
6852
6852
|
j.push(N);
|
|
6853
6853
|
}
|
|
6854
|
-
const z = (c ? 35 : 42) *
|
|
6854
|
+
const z = (c ? 35 : 42) * x;
|
|
6855
6855
|
if (s && j.length < z) {
|
|
6856
6856
|
const L = z - j.length;
|
|
6857
6857
|
for (let N = 0; N < L; N++) {
|
|
@@ -6911,27 +6911,27 @@ class Qg {
|
|
|
6911
6911
|
}
|
|
6912
6912
|
}
|
|
6913
6913
|
function Zg(e, t, n, r) {
|
|
6914
|
-
const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek: d, getWeek: f, startOfBroadcastWeek: u, startOfISOWeek: p, startOfWeek: v } = r,
|
|
6915
|
-
const b = n.broadcastCalendar ? u(C, r) : n.ISOWeek ? p(C) : v(C), m = n.broadcastCalendar ? a(C, r) : n.ISOWeek ? i(s(C)) : c(s(C)), $ = t.filter((
|
|
6914
|
+
const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek: d, getWeek: f, startOfBroadcastWeek: u, startOfISOWeek: p, startOfWeek: v } = r, k = e.reduce((M, C) => {
|
|
6915
|
+
const b = n.broadcastCalendar ? u(C, r) : n.ISOWeek ? p(C) : v(C), m = n.broadcastCalendar ? a(C, r) : n.ISOWeek ? i(s(C)) : c(s(C)), $ = t.filter((x) => x >= b && x <= m), A = n.broadcastCalendar ? 35 : 42;
|
|
6916
6916
|
if (n.fixedWeeks && $.length < A) {
|
|
6917
|
-
const
|
|
6917
|
+
const x = t.filter((j) => {
|
|
6918
6918
|
const T = A - $.length;
|
|
6919
6919
|
return j > m && j <= o(m, T);
|
|
6920
6920
|
});
|
|
6921
|
-
$.push(...
|
|
6921
|
+
$.push(...x);
|
|
6922
6922
|
}
|
|
6923
|
-
const E = $.reduce((
|
|
6924
|
-
const T = n.ISOWeek ? d(j) : f(j), z =
|
|
6925
|
-
return z ? z.days.push(L) :
|
|
6923
|
+
const E = $.reduce((x, j) => {
|
|
6924
|
+
const T = n.ISOWeek ? d(j) : f(j), z = x.find((N) => N.weekNumber === T), L = new Ri(j, C, r);
|
|
6925
|
+
return z ? z.days.push(L) : x.push(new Qg(T, [L])), x;
|
|
6926
6926
|
}, []), S = new Xg(C, E);
|
|
6927
6927
|
return M.push(S), M;
|
|
6928
6928
|
}, []);
|
|
6929
|
-
return n.reverseMonths ?
|
|
6929
|
+
return n.reverseMonths ? k.reverse() : k;
|
|
6930
6930
|
}
|
|
6931
6931
|
function Jg(e, t) {
|
|
6932
6932
|
let { startMonth: n, endMonth: r } = e;
|
|
6933
|
-
const { startOfYear: o, startOfDay: a, startOfMonth: i, endOfMonth: s, addYears: c, endOfYear: d, newDate: f, today: u } = t, { fromYear: p, toYear: v, fromMonth:
|
|
6934
|
-
!n &&
|
|
6933
|
+
const { startOfYear: o, startOfDay: a, startOfMonth: i, endOfMonth: s, addYears: c, endOfYear: d, newDate: f, today: u } = t, { fromYear: p, toYear: v, fromMonth: k, toMonth: M } = e;
|
|
6934
|
+
!n && k && (n = k), !n && p && (n = t.newDate(p, 0, 1)), !r && M && (r = M), !r && v && (r = f(v, 11, 31));
|
|
6935
6935
|
const C = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
6936
6936
|
return n ? n = i(n) : p ? n = f(p, 0, 1) : !n && C && (n = o(c(e.today ?? u(), -100))), r ? r = s(r) : v ? r = f(v, 11, 31) : !r && C && (r = d(e.today ?? u())), [
|
|
6937
6937
|
n && a(n),
|
|
@@ -6974,11 +6974,11 @@ function nm(e, t) {
|
|
|
6974
6974
|
const S = Ko(e, t);
|
|
6975
6975
|
c(S);
|
|
6976
6976
|
}, [e.timeZone]);
|
|
6977
|
-
const d = qg(s, r, e, t), f = Gg(d, e.endMonth ? a(e.endMonth) : void 0, e, t), u = Zg(d, f, e, t), p = tm(u), v = Ug(u),
|
|
6977
|
+
const d = qg(s, r, e, t), f = Gg(d, e.endMonth ? a(e.endMonth) : void 0, e, t), u = Zg(d, f, e, t), p = tm(u), v = Ug(u), k = em(s, n, e, t), M = Kg(s, r, e, t), { disableNavigation: C, onMonthChange: b } = e, m = (S) => p.some((x) => x.days.some((j) => j.isEqualTo(S))), $ = (S) => {
|
|
6978
6978
|
if (C)
|
|
6979
6979
|
return;
|
|
6980
|
-
let
|
|
6981
|
-
n &&
|
|
6980
|
+
let x = o(S);
|
|
6981
|
+
n && x < o(n) && (x = o(n)), r && x > o(r) && (x = o(r)), c(x), b?.(x);
|
|
6982
6982
|
};
|
|
6983
6983
|
return {
|
|
6984
6984
|
months: u,
|
|
@@ -6986,7 +6986,7 @@ function nm(e, t) {
|
|
|
6986
6986
|
days: v,
|
|
6987
6987
|
navStart: n,
|
|
6988
6988
|
navEnd: r,
|
|
6989
|
-
previousMonth:
|
|
6989
|
+
previousMonth: k,
|
|
6990
6990
|
nextMonth: M,
|
|
6991
6991
|
goToMonth: $,
|
|
6992
6992
|
goToDay: (S) => {
|
|
@@ -7053,14 +7053,14 @@ function $t(e, t, n = Ot) {
|
|
|
7053
7053
|
});
|
|
7054
7054
|
}
|
|
7055
7055
|
function om(e, t, n, r, o, a, i) {
|
|
7056
|
-
const { ISOWeek: s, broadcastCalendar: c } = a, { addDays: d, addMonths: f, addWeeks: u, addYears: p, endOfBroadcastWeek: v, endOfISOWeek:
|
|
7056
|
+
const { ISOWeek: s, broadcastCalendar: c } = a, { addDays: d, addMonths: f, addWeeks: u, addYears: p, endOfBroadcastWeek: v, endOfISOWeek: k, endOfWeek: M, max: C, min: b, startOfBroadcastWeek: m, startOfISOWeek: $, startOfWeek: A } = i;
|
|
7057
7057
|
let S = {
|
|
7058
7058
|
day: d,
|
|
7059
7059
|
week: u,
|
|
7060
7060
|
month: f,
|
|
7061
7061
|
year: p,
|
|
7062
|
-
startOfWeek: (
|
|
7063
|
-
endOfWeek: (
|
|
7062
|
+
startOfWeek: (x) => c ? m(x, i) : s ? $(x) : A(x),
|
|
7063
|
+
endOfWeek: (x) => c ? v(x, i) : s ? k(x) : M(x)
|
|
7064
7064
|
}[e](n, t === "after" ? 1 : -1);
|
|
7065
7065
|
return t === "before" && r ? S = C([r, S]) : t === "after" && o && (S = b([o, S])), S;
|
|
7066
7066
|
}
|
|
@@ -7097,7 +7097,7 @@ function am(e, t, n, r, o) {
|
|
|
7097
7097
|
};
|
|
7098
7098
|
}
|
|
7099
7099
|
function im(e, t, n) {
|
|
7100
|
-
const { disabled: r, hidden: o, modifiers: a, showOutsideDays: i, broadcastCalendar: s, today: c } = t, { isSameDay: d, isSameMonth: f, startOfMonth: u, isBefore: p, endOfMonth: v, isAfter:
|
|
7100
|
+
const { disabled: r, hidden: o, modifiers: a, showOutsideDays: i, broadcastCalendar: s, today: c } = t, { isSameDay: d, isSameMonth: f, startOfMonth: u, isBefore: p, endOfMonth: v, isAfter: k } = n, M = t.startMonth && u(t.startMonth), C = t.endMonth && v(t.endMonth), b = {
|
|
7101
7101
|
[De.focused]: [],
|
|
7102
7102
|
[De.outside]: [],
|
|
7103
7103
|
[De.disabled]: [],
|
|
@@ -7105,7 +7105,7 @@ function im(e, t, n) {
|
|
|
7105
7105
|
[De.today]: []
|
|
7106
7106
|
}, m = {};
|
|
7107
7107
|
for (const $ of e) {
|
|
7108
|
-
const { date: A, displayMonth: E } = $, S = !!(E && !f(A, E)),
|
|
7108
|
+
const { date: A, displayMonth: E } = $, S = !!(E && !f(A, E)), x = !!(M && p(A, M)), j = !!(C && k(A, C)), T = !!(r && $t(A, r, n)), z = !!(o && $t(A, o, n)) || x || j || // Broadcast calendar will show outside days as default
|
|
7109
7109
|
!s && !i && S || s && i === !1 && S, L = d(A, c ?? n.today());
|
|
7110
7110
|
S && b.outside.push($), T && b.disabled.push($), z && b.hidden.push($), L && b.today.push($), a && Object.keys(a).forEach((N) => {
|
|
7111
7111
|
const W = a?.[N];
|
|
@@ -7121,11 +7121,11 @@ function im(e, t, n) {
|
|
|
7121
7121
|
[De.today]: !1
|
|
7122
7122
|
}, E = {};
|
|
7123
7123
|
for (const S in b) {
|
|
7124
|
-
const
|
|
7125
|
-
A[S] =
|
|
7124
|
+
const x = b[S];
|
|
7125
|
+
A[S] = x.some((j) => j === $);
|
|
7126
7126
|
}
|
|
7127
7127
|
for (const S in m)
|
|
7128
|
-
E[S] = m[S].some((
|
|
7128
|
+
E[S] = m[S].some((x) => x === $);
|
|
7129
7129
|
return {
|
|
7130
7130
|
...A,
|
|
7131
7131
|
// custom modifiers should override all the previous ones
|
|
@@ -7134,10 +7134,10 @@ function im(e, t, n) {
|
|
|
7134
7134
|
};
|
|
7135
7135
|
}
|
|
7136
7136
|
function sm(e, t) {
|
|
7137
|
-
const { selected: n, required: r, onSelect: o } = e, [a, i] = sr(n, o ? n : void 0), s = o ? n : a, { isSameDay: c } = t, d = (v) => s?.some((
|
|
7137
|
+
const { selected: n, required: r, onSelect: o } = e, [a, i] = sr(n, o ? n : void 0), s = o ? n : a, { isSameDay: c } = t, d = (v) => s?.some((k) => c(k, v)) ?? !1, { min: f, max: u } = e;
|
|
7138
7138
|
return {
|
|
7139
7139
|
selected: s,
|
|
7140
|
-
select: (v,
|
|
7140
|
+
select: (v, k, M) => {
|
|
7141
7141
|
let C = [...s ?? []];
|
|
7142
7142
|
if (d(v)) {
|
|
7143
7143
|
if (s?.length === f || r && s?.length === 1)
|
|
@@ -7145,7 +7145,7 @@ function sm(e, t) {
|
|
|
7145
7145
|
C = s?.filter((b) => !c(b, v));
|
|
7146
7146
|
} else
|
|
7147
7147
|
s?.length === u ? C = [v] : C = [...C, v];
|
|
7148
|
-
return o || i(C), o?.(C, v,
|
|
7148
|
+
return o || i(C), o?.(C, v, k, M), C;
|
|
7149
7149
|
},
|
|
7150
7150
|
isSelected: d
|
|
7151
7151
|
};
|
|
@@ -7215,9 +7215,9 @@ function dm(e, t) {
|
|
|
7215
7215
|
const { disabled: n, excludeDisabled: r, selected: o, required: a, onSelect: i } = e, [s, c] = sr(o, i ? o : void 0), d = i ? o : s;
|
|
7216
7216
|
return {
|
|
7217
7217
|
selected: d,
|
|
7218
|
-
select: (p, v,
|
|
7218
|
+
select: (p, v, k) => {
|
|
7219
7219
|
const { min: M, max: C } = e, b = p ? lm(p, d, M, C, a, t) : void 0;
|
|
7220
|
-
return r && n && b?.from && b.to && um({ from: b.from, to: b.to }, n, t) && (b.from = p, b.to = void 0), i || c(b), i?.(b, p, v,
|
|
7220
|
+
return r && n && b?.from && b.to && um({ from: b.from, to: b.to }, n, t) && (b.from = p, b.to = void 0), i || c(b), i?.(b, p, v, k), b;
|
|
7221
7221
|
},
|
|
7222
7222
|
isSelected: (p) => d && St(d, p, !1, t)
|
|
7223
7223
|
};
|
|
@@ -7227,8 +7227,8 @@ function fm(e, t) {
|
|
|
7227
7227
|
return {
|
|
7228
7228
|
selected: s,
|
|
7229
7229
|
select: (u, p, v) => {
|
|
7230
|
-
let
|
|
7231
|
-
return !r && s && s && c(u, s) && (
|
|
7230
|
+
let k = u;
|
|
7231
|
+
return !r && s && s && c(u, s) && (k = void 0), o || i(k), o?.(k, u, p, v), k;
|
|
7232
7232
|
},
|
|
7233
7233
|
isSelected: (u) => s ? c(s, u) : !1
|
|
7234
7234
|
};
|
|
@@ -7279,7 +7279,7 @@ function hm(e) {
|
|
|
7279
7279
|
e.formatters,
|
|
7280
7280
|
e.labels,
|
|
7281
7281
|
e.classNames
|
|
7282
|
-
]), { captionLayout: s, mode: c, onDayBlur: d, onDayClick: f, onDayFocus: u, onDayKeyDown: p, onDayMouseEnter: v, onDayMouseLeave:
|
|
7282
|
+
]), { captionLayout: s, mode: c, onDayBlur: d, onDayClick: f, onDayFocus: u, onDayKeyDown: p, onDayMouseEnter: v, onDayMouseLeave: k, onNextClick: M, onPrevClick: C, showWeekNumber: b, styles: m } = e, { formatCaption: $, formatDay: A, formatMonthDropdown: E, formatWeekNumber: S, formatWeekNumberHeader: x, formatWeekdayName: j, formatYearDropdown: T } = n, z = nm(e, o), { days: L, months: N, navStart: W, navEnd: U, previousMonth: Y, nextMonth: B, goToMonth: Z } = z, oe = im(L, e, o), { isSelected: te, select: O, selected: _ } = pm(e, o) ?? {}, { blur: H, focused: G, isFocusTarget: le, moveFocus: se, setFocused: re } = am(e, z, oe, te ?? (() => !1), o), { labelDayButton: we, labelGridcell: ae, labelGrid: Se, labelMonthDropdown: Ee, labelNav: Ue, labelWeekday: lt, labelWeekNumber: Wt, labelWeekNumberHeader: q, labelYearDropdown: J } = r, $e = Re(() => Og(o, e.ISOWeek), [o, e.ISOWeek]), ke = c !== void 0 || f !== void 0, Ne = ve(() => {
|
|
7283
7283
|
Y && (Z(Y), C?.(Y));
|
|
7284
7284
|
}, [Y, Z, C]), ie = ve(() => {
|
|
7285
7285
|
B && (Z(B), M?.(B));
|
|
@@ -7289,7 +7289,7 @@ function hm(e) {
|
|
|
7289
7289
|
re(Q), u?.(Q.date, de, ce);
|
|
7290
7290
|
}, [u, re]), h = ve((Q, de) => (ce) => {
|
|
7291
7291
|
H(), d?.(Q.date, de, ce);
|
|
7292
|
-
}, [H, d]),
|
|
7292
|
+
}, [H, d]), w = ve((Q, de) => (ce) => {
|
|
7293
7293
|
const qe = {
|
|
7294
7294
|
ArrowLeft: ["day", e.dir === "rtl" ? "after" : "before"],
|
|
7295
7295
|
ArrowRight: ["day", e.dir === "rtl" ? "before" : "after"],
|
|
@@ -7309,8 +7309,8 @@ function hm(e) {
|
|
|
7309
7309
|
}, [se, p, e.dir]), D = ve((Q, de) => (ce) => {
|
|
7310
7310
|
v?.(Q.date, de, ce);
|
|
7311
7311
|
}, [v]), I = ve((Q, de) => (ce) => {
|
|
7312
|
-
|
|
7313
|
-
}, [
|
|
7312
|
+
k?.(Q.date, de, ce);
|
|
7313
|
+
}, [k]), F = ve((Q) => (de) => {
|
|
7314
7314
|
const ce = Number(de.target.value), qe = o.setMonth(o.startOfMonth(Q), ce);
|
|
7315
7315
|
Z(qe);
|
|
7316
7316
|
}, [o, Z]), P = ve((Q) => (de) => {
|
|
@@ -7381,7 +7381,7 @@ function hm(e) {
|
|
|
7381
7381
|
!e.hideWeekdays && g.createElement(
|
|
7382
7382
|
t.Weekdays,
|
|
7383
7383
|
{ "data-animated-weekdays": e.animate ? "true" : void 0, className: i[X.Weekdays], style: m?.[X.Weekdays] },
|
|
7384
|
-
b && g.createElement(t.WeekNumberHeader, { "aria-label": q(o.options), className: i[X.WeekNumberHeader], style: m?.[X.WeekNumberHeader], scope: "col" },
|
|
7384
|
+
b && g.createElement(t.WeekNumberHeader, { "aria-label": q(o.options), className: i[X.WeekNumberHeader], style: m?.[X.WeekNumberHeader], scope: "col" }, x()),
|
|
7385
7385
|
$e.map((He, ut) => g.createElement(t.Weekday, { "aria-label": lt(He, o.options, o), className: i[X.Weekday], key: ut, style: m?.[X.Weekday], scope: "col" }, j(He, o.options, o)))
|
|
7386
7386
|
),
|
|
7387
7387
|
g.createElement(t.Weeks, { "data-animated-weeks": e.animate ? "true" : void 0, className: i[X.Weeks], style: m?.[X.Weeks] }, Q.weeks.map((He, ut) => g.createElement(
|
|
@@ -7397,7 +7397,7 @@ function hm(e) {
|
|
|
7397
7397
|
fe[ht.range_start] = !!(Oe && Pe && o.isSameDay(rt, Oe)), fe[ht.range_end] = !!(Oe && Pe && o.isSameDay(rt, Pe)), fe[ht.range_middle] = St(_, rt, !0, o);
|
|
7398
7398
|
}
|
|
7399
7399
|
const Fn = Dg(fe, m, e.modifiersStyles), Nn = Hh(fe, i, e.modifiersClassNames), ee = !ke && !fe.hidden ? ae(rt, fe, o.options, o) : void 0;
|
|
7400
|
-
return g.createElement(t.Day, { key: `${o.format(rt, "yyyy-MM-dd")}_${o.format(be.displayMonth, "yyyy-MM")}`, day: be, modifiers: fe, className: Nn.join(" "), style: Fn, role: "gridcell", "aria-selected": fe.selected || void 0, "aria-label": ee, "data-day": o.format(rt, "yyyy-MM-dd"), "data-month": be.outside ? o.format(rt, "yyyy-MM") : void 0, "data-selected": fe.selected || void 0, "data-disabled": fe.disabled || void 0, "data-hidden": fe.hidden || void 0, "data-outside": be.outside || void 0, "data-focused": fe.focused || void 0, "data-today": fe.today || void 0 }, !fe.hidden && ke ? g.createElement(t.DayButton, { className: i[X.DayButton], style: m?.[X.DayButton], type: "button", day: be, modifiers: fe, disabled: fe.disabled || void 0, tabIndex: le(be) ? 0 : -1, "aria-label": we(rt, fe, o.options, o), onClick: Ie(be, fe), onBlur: h(be, fe), onFocus: ct(be, fe), onKeyDown:
|
|
7400
|
+
return g.createElement(t.Day, { key: `${o.format(rt, "yyyy-MM-dd")}_${o.format(be.displayMonth, "yyyy-MM")}`, day: be, modifiers: fe, className: Nn.join(" "), style: Fn, role: "gridcell", "aria-selected": fe.selected || void 0, "aria-label": ee, "data-day": o.format(rt, "yyyy-MM-dd"), "data-month": be.outside ? o.format(rt, "yyyy-MM") : void 0, "data-selected": fe.selected || void 0, "data-disabled": fe.disabled || void 0, "data-hidden": fe.hidden || void 0, "data-outside": be.outside || void 0, "data-focused": fe.focused || void 0, "data-today": fe.today || void 0 }, !fe.hidden && ke ? g.createElement(t.DayButton, { className: i[X.DayButton], style: m?.[X.DayButton], type: "button", day: be, modifiers: fe, disabled: fe.disabled || void 0, tabIndex: le(be) ? 0 : -1, "aria-label": we(rt, fe, o.options, o), onClick: Ie(be, fe), onBlur: h(be, fe), onFocus: ct(be, fe), onKeyDown: w(be, fe), onMouseEnter: D(be, fe), onMouseLeave: I(be, fe) }, A(rt, o.options, o)) : !fe.hidden && A(be.date, o.options, o));
|
|
7401
7401
|
})
|
|
7402
7402
|
)))
|
|
7403
7403
|
)
|
|
@@ -8438,22 +8438,22 @@ var yn = function(e) {
|
|
|
8438
8438
|
this.register = function(a) {
|
|
8439
8439
|
var i;
|
|
8440
8440
|
if (ua.includes(a.type)) {
|
|
8441
|
-
var s = (i = a._wrapperState) !== null && i !== void 0 ? i : {}, c = s.initialValue, d = c === void 0 ? "" : c, f = s.controlled, u = f !== void 0 && f, p = n({ initialValue: a.value || d, controlled: u }), v = p.value,
|
|
8441
|
+
var s = (i = a._wrapperState) !== null && i !== void 0 ? i : {}, c = s.initialValue, d = c === void 0 ? "" : c, f = s.controlled, u = f !== void 0 && f, p = n({ initialValue: a.value || d, controlled: u }), v = p.value, k = p.options, M = { value: v, options: k, fallbackOptions: k }, C = { id: -1, cachedId: -1 }, b = { value: "", selectionStart: 0, selectionEnd: 0 }, m = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
|
|
8442
8442
|
Object.defineProperty(a, "value", la(la({}, m), {}, { set: function(S) {
|
|
8443
|
-
var
|
|
8444
|
-
b.value = S, m == null || (
|
|
8443
|
+
var x;
|
|
8444
|
+
b.value = S, m == null || (x = m.set) === null || x === void 0 || x.call(a, S);
|
|
8445
8445
|
} })), a.value = v;
|
|
8446
8446
|
var $ = function() {
|
|
8447
8447
|
var S = function() {
|
|
8448
|
-
var
|
|
8449
|
-
b.selectionStart = (
|
|
8448
|
+
var x, j;
|
|
8449
|
+
b.selectionStart = (x = a.selectionStart) !== null && x !== void 0 ? x : 0, b.selectionEnd = (j = a.selectionEnd) !== null && j !== void 0 ? j : 0, C.id = window.setTimeout(S);
|
|
8450
8450
|
};
|
|
8451
8451
|
C.id = window.setTimeout(S);
|
|
8452
8452
|
}, A = function() {
|
|
8453
8453
|
window.clearTimeout(C.id), C.id = -1, C.cachedId = -1;
|
|
8454
8454
|
}, E = function(S) {
|
|
8455
8455
|
try {
|
|
8456
|
-
var
|
|
8456
|
+
var x, j;
|
|
8457
8457
|
if (C.cachedId === C.id) throw new yn("The input selection has not been updated.");
|
|
8458
8458
|
C.cachedId = C.id;
|
|
8459
8459
|
var T = a.value, z = a.selectionStart, L = a.selectionEnd;
|
|
@@ -8468,7 +8468,7 @@ var yn = function(e) {
|
|
|
8468
8468
|
}
|
|
8469
8469
|
M.value !== W ? M.options = M.fallbackOptions : M.fallbackOptions = M.options;
|
|
8470
8470
|
var oe = M.options, te = r({ inputType: N, previousValue: W, previousOptions: oe, value: T, addedValue: U, changeStart: Y, changeEnd: B, selectionStart: z, selectionEnd: L }), O = te.options, _ = gy(te, my);
|
|
8471
|
-
a.value = _.value, a.setSelectionRange(_.selectionStart, _.selectionEnd), M.value = _.value, M.options = O, b.selectionStart = _.selectionStart, b.selectionEnd = _.selectionEnd, (
|
|
8471
|
+
a.value = _.value, a.setSelectionRange(_.selectionStart, _.selectionEnd), M.value = _.value, M.options = O, b.selectionStart = _.selectionStart, b.selectionEnd = _.selectionEnd, (x = a._valueTracker) === null || x === void 0 || (j = x.setValue) === null || j === void 0 || j.call(x, W);
|
|
8472
8472
|
} catch (H) {
|
|
8473
8473
|
if (a.value = b.value, a.setSelectionRange(b.selectionStart, b.selectionEnd), S.preventDefault(), S.stopPropagation(), H.name !== "SyntheticChangeError") throw H;
|
|
8474
8474
|
}
|
|
@@ -8500,13 +8500,13 @@ var ts = function(e) {
|
|
|
8500
8500
|
return ry(this, t), (n = ny(this, t, [{ init: function(o) {
|
|
8501
8501
|
var a = o.initialValue, i = o.controlled, s = Zt(r), c = s.mask, d = s.replacement, f = s.separate, u = s.showMask;
|
|
8502
8502
|
return a = i || a ? a : u ? c : "", process.env.NODE_ENV !== "production" && function(p) {
|
|
8503
|
-
var v = p.initialValue,
|
|
8504
|
-
v.length >
|
|
8503
|
+
var v = p.initialValue, k = p.mask, M = p.replacement;
|
|
8504
|
+
v.length > k.length && console.error(vr(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(v, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
8505
8505
|
var C = Object.keys(M).filter(function(E) {
|
|
8506
8506
|
return E.length > 1;
|
|
8507
8507
|
});
|
|
8508
8508
|
C.length > 0 && console.error(vr(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(C.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
8509
|
-
for (var b =
|
|
8509
|
+
for (var b = k.slice(0, v.length), m = -1, $ = 0; $ < b.length; $++) {
|
|
8510
8510
|
var A = Object.prototype.hasOwnProperty.call(M, b[$]);
|
|
8511
8511
|
if (!(b[$] === v[$] || A && M[b[$]].test(v[$]))) {
|
|
8512
8512
|
m = $;
|
|
@@ -8516,19 +8516,19 @@ var ts = function(e) {
|
|
|
8516
8516
|
m !== -1 && console.error(vr(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(m, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(v, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
8517
8517
|
}({ initialValue: a, mask: c, replacement: d }), { value: a, options: { mask: c, replacement: d, separate: f } };
|
|
8518
8518
|
}, tracking: function(o) {
|
|
8519
|
-
var a = o.inputType, i = o.previousValue, s = o.previousOptions, c = o.addedValue, d = o.changeStart, f = o.changeEnd, u = Zt(r), p = u.track, v = u.modify,
|
|
8519
|
+
var a = o.inputType, i = o.previousValue, s = o.previousOptions, c = o.addedValue, d = o.changeStart, f = o.changeEnd, u = Zt(r), p = u.track, v = u.modify, k = iy(u, yy), M = k.mask, C = k.replacement, b = k.showMask, m = k.separate, $ = Ln(Ln({}, a === "insert" ? { inputType: a, data: c } : { inputType: a, data: null }), {}, { value: i, selectionStart: d, selectionEnd: f }), A = p?.($);
|
|
8520
8520
|
if (A === !1) throw new yn("Custom tracking stop.");
|
|
8521
8521
|
A === null ? c = "" : A !== !0 && A !== void 0 && (c = A);
|
|
8522
8522
|
var E = v?.($);
|
|
8523
8523
|
E?.mask !== void 0 && (M = E.mask), E?.replacement !== void 0 && (C = typeof E?.replacement == "string" ? on(E?.replacement) : E.replacement), E?.showMask !== void 0 && (b = E.showMask), E?.separate !== void 0 && (m = E.separate);
|
|
8524
|
-
var S = Wr(i, Ln({ end: d }, s)),
|
|
8524
|
+
var S = Wr(i, Ln({ end: d }, s)), x = Wr(i, Ln({ start: f }, s)), j = RegExp("[^".concat(Object.keys(C).join(""), "]"), "g"), T = M.replace(j, "");
|
|
8525
8525
|
if (S && (S = mn(S, { replacementChars: T, replacement: C, separate: m }), T = T.slice(S.length)), c && (c = mn(c, { replacementChars: T, replacement: C, separate: !1 }), T = T.slice(c.length)), a === "insert" && c === "") throw new yn("The character does not match the key value of the `replacement` object.");
|
|
8526
8526
|
if (m) {
|
|
8527
8527
|
var z = M.slice(d, f).replace(j, ""), L = z.length - c.length;
|
|
8528
|
-
L < 0 ?
|
|
8528
|
+
L < 0 ? x = x.slice(-L) : L > 0 && (x = z.slice(-L) + x);
|
|
8529
8529
|
}
|
|
8530
|
-
|
|
8531
|
-
var N = Xi(S + c +
|
|
8530
|
+
x && (x = mn(x, { replacementChars: T, replacement: C, separate: m }));
|
|
8531
|
+
var N = Xi(S + c + x, { mask: M, replacement: C, separate: m, showMask: b }), W = function(U) {
|
|
8532
8532
|
var Y, B, Z, oe = U.inputType, te = U.value, O = U.addedValue, _ = U.beforeChangeValue, H = U.mask, G = U.replacement, le = U.separate, se = Qi(te, { mask: H, replacement: G }).filter(function(Ee) {
|
|
8533
8533
|
var Ue = Ee.type;
|
|
8534
8534
|
return Ue === "input" || le && Ue === "replacement";
|
|
@@ -8591,7 +8591,7 @@ const ns = ({ maskProps: e, ...t }) => {
|
|
|
8591
8591
|
size: u,
|
|
8592
8592
|
name: p,
|
|
8593
8593
|
...v
|
|
8594
|
-
} = e, [
|
|
8594
|
+
} = e, [k, M] = me(null), [C, b] = me(null), [m, $] = me(/* @__PURE__ */ new Date()), [A, E] = me(""), S = () => a && i ? "dropdown" : a ? "dropdown-months" : i ? "dropdown-years" : "label", x = (L) => {
|
|
8595
8595
|
b(L.currentTarget);
|
|
8596
8596
|
}, j = () => {
|
|
8597
8597
|
b(null);
|
|
@@ -8633,14 +8633,14 @@ const ns = ({ maskProps: e, ...t }) => {
|
|
|
8633
8633
|
fullWidth: f,
|
|
8634
8634
|
size: u,
|
|
8635
8635
|
name: p,
|
|
8636
|
-
endAdornment: /* @__PURE__ */ l.jsx(Ze, { variant: "text", onClick:
|
|
8636
|
+
endAdornment: /* @__PURE__ */ l.jsx(Ze, { variant: "text", onClick: x, children: /* @__PURE__ */ l.jsx(_a, {}) }),
|
|
8637
8637
|
maskProps: {
|
|
8638
8638
|
mask: "__.__.____",
|
|
8639
8639
|
replacement: { _: /\d/ },
|
|
8640
8640
|
showMask: !0
|
|
8641
8641
|
},
|
|
8642
8642
|
placeholder: "дд.мм.гггг",
|
|
8643
|
-
error: !!
|
|
8643
|
+
error: !!k || s,
|
|
8644
8644
|
helperText: s || c
|
|
8645
8645
|
}
|
|
8646
8646
|
),
|
|
@@ -8886,7 +8886,7 @@ const Py = (e) => /* @__PURE__ */ l.jsx(Nt, { visibleLastSymbolsCount: 4, ...e }
|
|
|
8886
8886
|
}) => {
|
|
8887
8887
|
const a = ve(
|
|
8888
8888
|
(s, c) => {
|
|
8889
|
-
const { renderValue: d, color: f, canCopy: u, copyPosition: p, variant: v, copyText:
|
|
8889
|
+
const { renderValue: d, color: f, canCopy: u, copyPosition: p, variant: v, copyText: k } = c;
|
|
8890
8890
|
if (d)
|
|
8891
8891
|
return d(s, c);
|
|
8892
8892
|
if (v === "tag")
|
|
@@ -8900,7 +8900,7 @@ const Py = (e) => /* @__PURE__ */ l.jsx(Nt, { visibleLastSymbolsCount: 4, ...e }
|
|
|
8900
8900
|
$isCopy: u,
|
|
8901
8901
|
color: f,
|
|
8902
8902
|
copyPosition: p,
|
|
8903
|
-
copyText:
|
|
8903
|
+
copyText: k,
|
|
8904
8904
|
children: /* @__PURE__ */ l.jsx(Py, { tooltipProps: M, children: s })
|
|
8905
8905
|
}
|
|
8906
8906
|
);
|
|
@@ -9129,7 +9129,7 @@ function s0({ containerRef: e, inputRef: t, pushPasswordManagerStrategy: n, isFo
|
|
|
9129
9129
|
let [o, a] = K.useState(!1), [i, s] = K.useState(!1), [c, d] = K.useState(!1), f = K.useMemo(() => n === "none" ? !1 : (n === "increase-width" || n === "experimental-no-flickering") && o && i, [o, i, n]), u = K.useCallback(() => {
|
|
9130
9130
|
let p = e.current, v = t.current;
|
|
9131
9131
|
if (!p || !v || c || n === "none") return;
|
|
9132
|
-
let
|
|
9132
|
+
let k = p, M = k.getBoundingClientRect().left + k.offsetWidth, C = k.getBoundingClientRect().top + k.offsetHeight / 2, b = M - o0, m = C;
|
|
9133
9133
|
document.querySelectorAll(i0).length === 0 && document.elementFromPoint(b, m) === p || (a(!0), d(!0));
|
|
9134
9134
|
}, [e, t, c, n]);
|
|
9135
9135
|
return K.useEffect(() => {
|
|
@@ -9140,24 +9140,24 @@ function s0({ containerRef: e, inputRef: t, pushPasswordManagerStrategy: n, isFo
|
|
|
9140
9140
|
s(M >= is);
|
|
9141
9141
|
}
|
|
9142
9142
|
v();
|
|
9143
|
-
let
|
|
9143
|
+
let k = setInterval(v, 1e3);
|
|
9144
9144
|
return () => {
|
|
9145
|
-
clearInterval(
|
|
9145
|
+
clearInterval(k);
|
|
9146
9146
|
};
|
|
9147
9147
|
}, [e, n]), K.useEffect(() => {
|
|
9148
9148
|
let p = r || document.activeElement === t.current;
|
|
9149
9149
|
if (n === "none" || !p) return;
|
|
9150
|
-
let v = setTimeout(u, 0),
|
|
9150
|
+
let v = setTimeout(u, 0), k = setTimeout(u, 2e3), M = setTimeout(u, 5e3), C = setTimeout(() => {
|
|
9151
9151
|
d(!0);
|
|
9152
9152
|
}, 6e3);
|
|
9153
9153
|
return () => {
|
|
9154
|
-
clearTimeout(v), clearTimeout(
|
|
9154
|
+
clearTimeout(v), clearTimeout(k), clearTimeout(M), clearTimeout(C);
|
|
9155
9155
|
};
|
|
9156
9156
|
}, [t, r, n, u]), { hasPWMBadge: o, willPushPWMBadge: f, PWM_BADGE_SPACE_WIDTH: a0 };
|
|
9157
9157
|
}
|
|
9158
9158
|
var l0 = K.createContext({}), ss = K.forwardRef((e, t) => {
|
|
9159
|
-
var n = e, { value: r, onChange: o, maxLength: a, textAlign: i = "left", pattern: s, placeholder: c, inputMode: d = "numeric", onComplete: f, pushPasswordManagerStrategy: u = "increase-width", pasteTransformer: p, containerClassName: v, noScriptCSSFallback:
|
|
9160
|
-
let [
|
|
9159
|
+
var n = e, { value: r, onChange: o, maxLength: a, textAlign: i = "left", pattern: s, placeholder: c, inputMode: d = "numeric", onComplete: f, pushPasswordManagerStrategy: u = "increase-width", pasteTransformer: p, containerClassName: v, noScriptCSSFallback: k = c0, render: M, children: C } = n, b = t0(n, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), m, $, A, E, S;
|
|
9160
|
+
let [x, j] = K.useState(typeof b.defaultValue == "string" ? b.defaultValue : ""), T = r ?? x, z = r0(T), L = K.useCallback((q) => {
|
|
9161
9161
|
o?.(q), j(q);
|
|
9162
9162
|
}, [o]), N = K.useMemo(() => s ? typeof s == "string" ? new RegExp(s) : s : null, [s]), W = K.useRef(null), U = K.useRef(null), Y = K.useRef({ value: T, onChange: L, isIOS: typeof window < "u" && (($ = (m = window?.CSS) == null ? void 0 : m.supports) == null ? void 0 : $.call(m, "-webkit-touch-callout", "none")) }), B = K.useRef({ prev: [(A = W.current) == null ? void 0 : A.selectionStart, (E = W.current) == null ? void 0 : E.selectionEnd, (S = W.current) == null ? void 0 : S.selectionDirection] });
|
|
9163
9163
|
K.useImperativeHandle(t, () => W.current, []), K.useEffect(() => {
|
|
@@ -9169,14 +9169,14 @@ var l0 = K.createContext({}), ss = K.forwardRef((e, t) => {
|
|
|
9169
9169
|
H(null), le(null);
|
|
9170
9170
|
return;
|
|
9171
9171
|
}
|
|
9172
|
-
let ie = q.selectionStart, Ie = q.selectionEnd, ct = q.selectionDirection, h = q.maxLength,
|
|
9173
|
-
if (
|
|
9174
|
-
let Ce = ie === Ie, nt = ie ===
|
|
9172
|
+
let ie = q.selectionStart, Ie = q.selectionEnd, ct = q.selectionDirection, h = q.maxLength, w = q.value, D = B.current.prev, I = -1, F = -1, P;
|
|
9173
|
+
if (w.length !== 0 && ie !== null && Ie !== null) {
|
|
9174
|
+
let Ce = ie === Ie, nt = ie === w.length && w.length < h;
|
|
9175
9175
|
if (Ce && !nt) {
|
|
9176
9176
|
let Q = ie;
|
|
9177
9177
|
if (Q === 0) I = 0, F = 1, P = "forward";
|
|
9178
9178
|
else if (Q === h) I = Q - 1, F = Q, P = "backward";
|
|
9179
|
-
else if (h > 1 &&
|
|
9179
|
+
else if (h > 1 && w.length > 1) {
|
|
9180
9180
|
let de = 0;
|
|
9181
9181
|
if (D[0] !== null && D[1] !== null) {
|
|
9182
9182
|
P = Q < D[1] ? "backward" : "forward";
|
|
@@ -9241,8 +9241,8 @@ var l0 = K.createContext({}), ss = K.forwardRef((e, t) => {
|
|
|
9241
9241
|
let Ie = (J = W.current) == null ? void 0 : J.selectionStart, ct = ($e = W.current) == null ? void 0 : $e.selectionEnd, h = (Ie !== ct ? T.slice(0, Ie) + ie + T.slice(ct) : T.slice(0, Ie) + ie + T.slice(Ie)).slice(0, a);
|
|
9242
9242
|
if (h.length > 0 && N && !N.test(h)) return;
|
|
9243
9243
|
ke.value = h, L(h);
|
|
9244
|
-
let
|
|
9245
|
-
ke.setSelectionRange(
|
|
9244
|
+
let w = Math.min(h.length, a - 1), D = h.length;
|
|
9245
|
+
ke.setSelectionRange(w, D), H(w), le(D);
|
|
9246
9246
|
}, [a, L, N, T]), Se = K.useMemo(() => ({ position: "relative", cursor: b.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [b.disabled]), Ee = K.useMemo(() => ({ position: "absolute", inset: 0, width: se.willPushPWMBadge ? `calc(100% + ${se.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: se.willPushPWMBadge ? `inset(0 ${se.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: i, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [se.PWM_BADGE_SPACE_WIDTH, se.willPushPWMBadge, i]), Ue = K.useMemo(() => K.createElement("input", e0(Ky({ autoComplete: b.autoComplete || "one-time-code" }, b), { "data-input-otp": !0, "data-input-otp-placeholder-shown": T.length === 0 || void 0, "data-input-otp-mss": _, "data-input-otp-mse": G, inputMode: d, pattern: N?.source, "aria-placeholder": c, style: Ee, maxLength: a, value: T, ref: W, onPaste: (q) => {
|
|
9247
9247
|
var J;
|
|
9248
9248
|
ae(q), (J = b.onPaste) == null || J.call(b, q);
|
|
@@ -9263,7 +9263,7 @@ var l0 = K.createContext({}), ss = K.forwardRef((e, t) => {
|
|
|
9263
9263
|
let ke = te && _ !== null && G !== null && (_ === G && J === _ || J >= _ && J < G), Ne = T[J] !== void 0 ? T[J] : null, ie = T[0] !== void 0 ? null : ($e = c?.[J]) != null ? $e : null;
|
|
9264
9264
|
return { char: Ne, placeholderChar: ie, isActive: ke, hasFakeCaret: ke && Ne === null };
|
|
9265
9265
|
}), isFocused: te, isHovering: !b.disabled && Z }), [te, Z, a, G, _, b.disabled, T]), Wt = K.useMemo(() => M ? M(lt) : K.createElement(l0.Provider, { value: lt }, C), [C, lt, M]);
|
|
9266
|
-
return K.createElement(K.Fragment, null,
|
|
9266
|
+
return K.createElement(K.Fragment, null, k !== null && K.createElement("noscript", null, K.createElement("style", null, k)), K.createElement("div", { ref: U, "data-input-otp-container": !0, style: Se, className: v }, Wt, K.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Ue)));
|
|
9267
9267
|
});
|
|
9268
9268
|
ss.displayName = "Input";
|
|
9269
9269
|
function dn(e, t) {
|
|
@@ -9674,36 +9674,36 @@ class _0 {
|
|
|
9674
9674
|
});
|
|
9675
9675
|
else if (N0(d) && !d.ok) {
|
|
9676
9676
|
a = !1;
|
|
9677
|
-
const u = typeof n.error == "function" ? await n.error(`HTTP error! status: ${d.status}`) : n.error, p = typeof n.description == "function" ? await n.description(`HTTP error! status: ${d.status}`) : n.description,
|
|
9677
|
+
const u = typeof n.error == "function" ? await n.error(`HTTP error! status: ${d.status}`) : n.error, p = typeof n.description == "function" ? await n.description(`HTTP error! status: ${d.status}`) : n.description, k = typeof u == "object" && !g.isValidElement(u) ? u : {
|
|
9678
9678
|
message: u
|
|
9679
9679
|
};
|
|
9680
9680
|
this.create({
|
|
9681
9681
|
id: r,
|
|
9682
9682
|
type: "error",
|
|
9683
9683
|
description: p,
|
|
9684
|
-
...
|
|
9684
|
+
...k
|
|
9685
9685
|
});
|
|
9686
9686
|
} else if (d instanceof Error) {
|
|
9687
9687
|
a = !1;
|
|
9688
|
-
const u = typeof n.error == "function" ? await n.error(d) : n.error, p = typeof n.description == "function" ? await n.description(d) : n.description,
|
|
9688
|
+
const u = typeof n.error == "function" ? await n.error(d) : n.error, p = typeof n.description == "function" ? await n.description(d) : n.description, k = typeof u == "object" && !g.isValidElement(u) ? u : {
|
|
9689
9689
|
message: u
|
|
9690
9690
|
};
|
|
9691
9691
|
this.create({
|
|
9692
9692
|
id: r,
|
|
9693
9693
|
type: "error",
|
|
9694
9694
|
description: p,
|
|
9695
|
-
...
|
|
9695
|
+
...k
|
|
9696
9696
|
});
|
|
9697
9697
|
} else if (n.success !== void 0) {
|
|
9698
9698
|
a = !1;
|
|
9699
|
-
const u = typeof n.success == "function" ? await n.success(d) : n.success, p = typeof n.description == "function" ? await n.description(d) : n.description,
|
|
9699
|
+
const u = typeof n.success == "function" ? await n.success(d) : n.success, p = typeof n.description == "function" ? await n.description(d) : n.description, k = typeof u == "object" && !g.isValidElement(u) ? u : {
|
|
9700
9700
|
message: u
|
|
9701
9701
|
};
|
|
9702
9702
|
this.create({
|
|
9703
9703
|
id: r,
|
|
9704
9704
|
type: "success",
|
|
9705
9705
|
description: p,
|
|
9706
|
-
...
|
|
9706
|
+
...k
|
|
9707
9707
|
});
|
|
9708
9708
|
}
|
|
9709
9709
|
}).catch(async (d) => {
|
|
@@ -9775,7 +9775,7 @@ function q0(e) {
|
|
|
9775
9775
|
}
|
|
9776
9776
|
const X0 = (e) => {
|
|
9777
9777
|
var t, n, r, o, a, i, s, c, d;
|
|
9778
|
-
const { invert: f, toast: u, unstyled: p, interacting: v, setHeights:
|
|
9778
|
+
const { invert: f, toast: u, unstyled: p, interacting: v, setHeights: k, visibleToasts: M, heights: C, index: b, toasts: m, expanded: $, removeToast: A, defaultRichColors: E, closeButton: S, style: x, cancelButtonStyle: j, actionButtonStyle: T, className: z = "", descriptionClassName: L = "", duration: N, position: W, gap: U, expandByDefault: Y, classNames: B, icons: Z, closeButtonAriaLabel: oe = "Close toast" } = e, [te, O] = g.useState(null), [_, H] = g.useState(null), [G, le] = g.useState(!1), [se, re] = g.useState(!1), [we, ae] = g.useState(!1), [Se, Ee] = g.useState(!1), [Ue, lt] = g.useState(!1), [Wt, q] = g.useState(0), [J, $e] = g.useState(0), ke = g.useRef(u.duration || N || ga), Ne = g.useRef(null), ie = g.useRef(null), Ie = b === 0, ct = b + 1 <= M, h = u.type, w = u.dismissible !== !1, D = u.className || "", I = u.descriptionClassName || "", F = g.useMemo(() => C.findIndex((ee) => ee.toastId === u.id) || 0, [
|
|
9779
9779
|
C,
|
|
9780
9780
|
u.id
|
|
9781
9781
|
]), P = g.useMemo(() => {
|
|
@@ -9804,24 +9804,24 @@ const X0 = (e) => {
|
|
|
9804
9804
|
const ee = ie.current;
|
|
9805
9805
|
if (ee) {
|
|
9806
9806
|
const Oe = ee.getBoundingClientRect().height;
|
|
9807
|
-
return $e(Oe),
|
|
9807
|
+
return $e(Oe), k((Pe) => [
|
|
9808
9808
|
{
|
|
9809
9809
|
toastId: u.id,
|
|
9810
9810
|
height: Oe,
|
|
9811
9811
|
position: u.position
|
|
9812
9812
|
},
|
|
9813
9813
|
...Pe
|
|
9814
|
-
]), () =>
|
|
9814
|
+
]), () => k((Pe) => Pe.filter((Je) => Je.toastId !== u.id));
|
|
9815
9815
|
}
|
|
9816
9816
|
}, [
|
|
9817
|
-
|
|
9817
|
+
k,
|
|
9818
9818
|
u.id
|
|
9819
9819
|
]), g.useLayoutEffect(() => {
|
|
9820
9820
|
if (!G) return;
|
|
9821
9821
|
const ee = ie.current, Oe = ee.style.height;
|
|
9822
9822
|
ee.style.height = "auto";
|
|
9823
9823
|
const Pe = ee.getBoundingClientRect().height;
|
|
9824
|
-
ee.style.height = Oe, $e(Pe),
|
|
9824
|
+
ee.style.height = Oe, $e(Pe), k((Je) => Je.find((Be) => Be.toastId === u.id) ? Je.map((Be) => Be.toastId === u.id ? {
|
|
9825
9825
|
...Be,
|
|
9826
9826
|
height: Pe
|
|
9827
9827
|
} : Be) : [
|
|
@@ -9836,17 +9836,17 @@ const X0 = (e) => {
|
|
|
9836
9836
|
G,
|
|
9837
9837
|
u.title,
|
|
9838
9838
|
u.description,
|
|
9839
|
-
|
|
9839
|
+
k,
|
|
9840
9840
|
u.id
|
|
9841
9841
|
]);
|
|
9842
9842
|
const be = g.useCallback(() => {
|
|
9843
|
-
re(!0), q(ue.current),
|
|
9843
|
+
re(!0), q(ue.current), k((ee) => ee.filter((Oe) => Oe.toastId !== u.id)), setTimeout(() => {
|
|
9844
9844
|
A(u);
|
|
9845
9845
|
}, U0);
|
|
9846
9846
|
}, [
|
|
9847
9847
|
u,
|
|
9848
9848
|
A,
|
|
9849
|
-
|
|
9849
|
+
k,
|
|
9850
9850
|
ue
|
|
9851
9851
|
]);
|
|
9852
9852
|
g.useEffect(() => {
|
|
@@ -9909,7 +9909,7 @@ const X0 = (e) => {
|
|
|
9909
9909
|
"data-index": b,
|
|
9910
9910
|
"data-front": Ie,
|
|
9911
9911
|
"data-swiping": we,
|
|
9912
|
-
"data-dismissible":
|
|
9912
|
+
"data-dismissible": w,
|
|
9913
9913
|
"data-type": h,
|
|
9914
9914
|
"data-invert": He,
|
|
9915
9915
|
"data-swipe-out": Se,
|
|
@@ -9921,21 +9921,21 @@ const X0 = (e) => {
|
|
|
9921
9921
|
"--z-index": m.length - b,
|
|
9922
9922
|
"--offset": `${se ? Wt : ue.current}px`,
|
|
9923
9923
|
"--initial-height": Y ? "auto" : `${J}px`,
|
|
9924
|
-
...
|
|
9924
|
+
...x,
|
|
9925
9925
|
...u.style
|
|
9926
9926
|
},
|
|
9927
9927
|
onDragEnd: () => {
|
|
9928
9928
|
ae(!1), O(null), nt.current = null;
|
|
9929
9929
|
},
|
|
9930
9930
|
onPointerDown: (ee) => {
|
|
9931
|
-
ut || !
|
|
9931
|
+
ut || !w || (Ne.current = /* @__PURE__ */ new Date(), q(ue.current), ee.target.setPointerCapture(ee.pointerId), ee.target.tagName !== "BUTTON" && (ae(!0), nt.current = {
|
|
9932
9932
|
x: ee.clientX,
|
|
9933
9933
|
y: ee.clientY
|
|
9934
9934
|
}));
|
|
9935
9935
|
},
|
|
9936
9936
|
onPointerUp: () => {
|
|
9937
9937
|
var ee, Oe, Pe;
|
|
9938
|
-
if (Se || !
|
|
9938
|
+
if (Se || !w) return;
|
|
9939
9939
|
nt.current = null;
|
|
9940
9940
|
const Je = Number(((ee = ie.current) == null ? void 0 : ee.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Wn = Number(((Oe = ie.current) == null ? void 0 : Oe.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), Be = (/* @__PURE__ */ new Date()).getTime() - ((Pe = Ne.current) == null ? void 0 : Pe.getTime()), ot = te === "x" ? Je : Wn, In = Math.abs(ot) / Be;
|
|
9941
9941
|
if (Math.abs(ot) >= G0 || In > 0.11) {
|
|
@@ -9949,7 +9949,7 @@ const X0 = (e) => {
|
|
|
9949
9949
|
},
|
|
9950
9950
|
onPointerMove: (ee) => {
|
|
9951
9951
|
var Oe, Pe, Je;
|
|
9952
|
-
if (!nt.current || !
|
|
9952
|
+
if (!nt.current || !w || ((Oe = window.getSelection()) == null ? void 0 : Oe.toString().length) > 0) return;
|
|
9953
9953
|
const Be = ee.clientY - nt.current.y, ot = ee.clientX - nt.current.x;
|
|
9954
9954
|
var In;
|
|
9955
9955
|
const dt = (In = e.swipeDirections) != null ? In : q0(W);
|
|
@@ -9980,7 +9980,7 @@ const X0 = (e) => {
|
|
|
9980
9980
|
"aria-label": oe,
|
|
9981
9981
|
"data-disabled": ut,
|
|
9982
9982
|
"data-close-button": !0,
|
|
9983
|
-
onClick: ut || !
|
|
9983
|
+
onClick: ut || !w ? () => {
|
|
9984
9984
|
} : () => {
|
|
9985
9985
|
be(), u.onDismiss == null || u.onDismiss.call(u, u);
|
|
9986
9986
|
},
|
|
@@ -10002,7 +10002,7 @@ const X0 = (e) => {
|
|
|
10002
10002
|
"data-cancel": !0,
|
|
10003
10003
|
style: u.cancelButtonStyle || j,
|
|
10004
10004
|
onClick: (ee) => {
|
|
10005
|
-
Vn(u.cancel) &&
|
|
10005
|
+
Vn(u.cancel) && w && (u.cancel.onClick == null || u.cancel.onClick.call(u.cancel, ee), be());
|
|
10006
10006
|
},
|
|
10007
10007
|
className: gt(B?.cancelButton, u == null || (c = u.classNames) == null ? void 0 : c.cancelButton)
|
|
10008
10008
|
}, u.cancel.label) : null, /* @__PURE__ */ g.isValidElement(u.action) ? u.action : u.action && Vn(u.action) ? /* @__PURE__ */ g.createElement("button", {
|
|
@@ -10051,7 +10051,7 @@ const Z0 = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
|
10051
10051
|
const { invert: r, position: o = "bottom-right", hotkey: a = [
|
|
10052
10052
|
"altKey",
|
|
10053
10053
|
"KeyT"
|
|
10054
|
-
], expand: i, closeButton: s, className: c, offset: d, mobileOffset: f, theme: u = "light", richColors: p, duration: v, style:
|
|
10054
|
+
], expand: i, closeButton: s, className: c, offset: d, mobileOffset: f, theme: u = "light", richColors: p, duration: v, style: k, visibleToasts: M = L0, toastOptions: C, dir: b = ma(), gap: m = Y0, icons: $, containerAriaLabel: A = "Notifications" } = t, [E, S] = g.useState([]), x = g.useMemo(() => Array.from(new Set([
|
|
10055
10055
|
o
|
|
10056
10056
|
].concat(E.filter((_) => _.position).map((_) => _.position)))), [
|
|
10057
10057
|
E,
|
|
@@ -10148,7 +10148,7 @@ const Z0 = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
|
10148
10148
|
"aria-relevant": "additions text",
|
|
10149
10149
|
"aria-atomic": "false",
|
|
10150
10150
|
suppressHydrationWarning: !0
|
|
10151
|
-
},
|
|
10151
|
+
}, x.map((_, H) => {
|
|
10152
10152
|
var G;
|
|
10153
10153
|
const [le, se] = _.split("-");
|
|
10154
10154
|
return E.length ? /* @__PURE__ */ g.createElement("ol", {
|
|
@@ -10166,7 +10166,7 @@ const Z0 = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
|
10166
10166
|
"--front-toast-height": `${((G = j[0]) == null ? void 0 : G.height) || 0}px`,
|
|
10167
10167
|
"--width": `${H0}px`,
|
|
10168
10168
|
"--gap": `${m}px`,
|
|
10169
|
-
...
|
|
10169
|
+
...k,
|
|
10170
10170
|
...Q0(d, f)
|
|
10171
10171
|
},
|
|
10172
10172
|
onBlur: (re) => {
|
|
@@ -10503,13 +10503,13 @@ const kv = [
|
|
|
10503
10503
|
className: u,
|
|
10504
10504
|
size: p,
|
|
10505
10505
|
fullWidth: v,
|
|
10506
|
-
name:
|
|
10506
|
+
name: k
|
|
10507
10507
|
} = e, M = /* @__PURE__ */ new Date(), [C, b] = me(null), m = (S) => {
|
|
10508
10508
|
b(S.currentTarget);
|
|
10509
10509
|
}, $ = () => {
|
|
10510
10510
|
b(null);
|
|
10511
10511
|
}, A = (S) => {
|
|
10512
|
-
const
|
|
10512
|
+
const x = r?.getFullYear() || M.getFullYear(), j = new Date(x, S, r?.getDate() || 1);
|
|
10513
10513
|
o?.(j), $();
|
|
10514
10514
|
}, E = a === "month" ? r?.toLocaleDateString("ru-RU", {
|
|
10515
10515
|
month: "long",
|
|
@@ -10524,7 +10524,7 @@ const kv = [
|
|
|
10524
10524
|
disabled: n,
|
|
10525
10525
|
size: p,
|
|
10526
10526
|
fullWidth: v,
|
|
10527
|
-
name:
|
|
10527
|
+
name: k,
|
|
10528
10528
|
endAdornment: /* @__PURE__ */ l.jsx(Ze, { disabled: n, variant: "text", onClick: m, children: /* @__PURE__ */ l.jsx(_a, {}) }),
|
|
10529
10529
|
placeholder: i,
|
|
10530
10530
|
error: s,
|
|
@@ -10556,23 +10556,25 @@ const kv = [
|
|
|
10556
10556
|
maxDate: d
|
|
10557
10557
|
}
|
|
10558
10558
|
),
|
|
10559
|
-
a === "month" ? /* @__PURE__ */ l.jsx(Sv, { children: kv.map((S,
|
|
10559
|
+
a === "month" ? /* @__PURE__ */ l.jsx(Sv, { children: kv.map((S, x) => /* @__PURE__ */ l.jsx(
|
|
10560
10560
|
Fe,
|
|
10561
10561
|
{
|
|
10562
10562
|
variant: "text",
|
|
10563
10563
|
size: "small",
|
|
10564
|
-
|
|
10565
|
-
|
|
10564
|
+
disabled: f.getMonth() > x || d.getMonth() < x,
|
|
10565
|
+
onClick: () => A(x),
|
|
10566
|
+
selected: r?.getMonth() === x,
|
|
10566
10567
|
children: S
|
|
10567
10568
|
},
|
|
10568
10569
|
S
|
|
10569
|
-
)) }) : /* @__PURE__ */ l.jsx($v, { children: fs.map((S,
|
|
10570
|
+
)) }) : /* @__PURE__ */ l.jsx($v, { children: fs.map((S, x) => /* @__PURE__ */ l.jsx(
|
|
10570
10571
|
Fe,
|
|
10571
10572
|
{
|
|
10572
10573
|
variant: "text",
|
|
10573
10574
|
size: "small",
|
|
10574
|
-
|
|
10575
|
-
|
|
10575
|
+
disabled: f.getMonth() > x * 3 || d.getMonth() < x * 3,
|
|
10576
|
+
onClick: () => A(x * 3),
|
|
10577
|
+
selected: ps(r?.getMonth() || 0) === x,
|
|
10576
10578
|
children: S
|
|
10577
10579
|
},
|
|
10578
10580
|
S
|
|
@@ -10965,7 +10967,7 @@ function gx({
|
|
|
10965
10967
|
}) {
|
|
10966
10968
|
const [d, f] = me(e), [u, p] = me(t), v = (m, $) => {
|
|
10967
10969
|
Array.isArray($) && (f($[0]), p($[1]));
|
|
10968
|
-
},
|
|
10970
|
+
}, k = (m) => {
|
|
10969
10971
|
const { value: $ } = m.target;
|
|
10970
10972
|
Number.isNaN(+$) || f(+$);
|
|
10971
10973
|
}, M = (m) => {
|
|
@@ -10991,7 +10993,7 @@ function gx({
|
|
|
10991
10993
|
type: "text",
|
|
10992
10994
|
name: "minVal",
|
|
10993
10995
|
value: d,
|
|
10994
|
-
onChange:
|
|
10996
|
+
onChange: k,
|
|
10995
10997
|
onKeyDown: C
|
|
10996
10998
|
}
|
|
10997
10999
|
),
|
|
@@ -11058,7 +11060,7 @@ const Uv = y(zs)`
|
|
|
11058
11060
|
f(b.target.value), u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
11059
11061
|
n?.(b);
|
|
11060
11062
|
}, i);
|
|
11061
|
-
},
|
|
11063
|
+
}, k = () => {
|
|
11062
11064
|
f(""), p.current && (p.current.value = ""), u.current && clearTimeout(u.current);
|
|
11063
11065
|
const b = new InputEvent("input", {
|
|
11064
11066
|
bubbles: !0,
|
|
@@ -11082,7 +11084,7 @@ const Uv = y(zs)`
|
|
|
11082
11084
|
qv,
|
|
11083
11085
|
{
|
|
11084
11086
|
variant: "text",
|
|
11085
|
-
onClick:
|
|
11087
|
+
onClick: k,
|
|
11086
11088
|
disabled: r || !C,
|
|
11087
11089
|
$isActive: C,
|
|
11088
11090
|
children: /* @__PURE__ */ l.jsx(Qv, {})
|
|
@@ -11529,7 +11531,7 @@ function hb(e) {
|
|
|
11529
11531
|
name: n
|
|
11530
11532
|
},
|
|
11531
11533
|
type: Qn.BLUR
|
|
11532
|
-
}), [n, o._formValues]),
|
|
11534
|
+
}), [n, o._formValues]), k = g.useCallback((C) => {
|
|
11533
11535
|
const b = R(o._fields, n);
|
|
11534
11536
|
b && C && (b._f.ref = C);
|
|
11535
11537
|
}, [o._fields, n]), M = g.useMemo(() => ({
|
|
@@ -11538,8 +11540,8 @@ function hb(e) {
|
|
|
11538
11540
|
...et(r) || c.disabled ? { disabled: c.disabled || r } : {},
|
|
11539
11541
|
onChange: p,
|
|
11540
11542
|
onBlur: v,
|
|
11541
|
-
ref:
|
|
11542
|
-
}), [n, r, c.disabled, p, v,
|
|
11543
|
+
ref: k
|
|
11544
|
+
}), [n, r, c.disabled, p, v, k, s]);
|
|
11543
11545
|
return g.useEffect(() => {
|
|
11544
11546
|
const C = o._options.shouldUnregister || a;
|
|
11545
11547
|
o.register(n, {
|
|
@@ -11769,12 +11771,12 @@ var Jt = (e) => je(e) && !Kn(e) ? e : {
|
|
|
11769
11771
|
value: e,
|
|
11770
11772
|
message: ""
|
|
11771
11773
|
}, Hr = async (e, t, n, r, o, a) => {
|
|
11772
|
-
const { ref: i, refs: s, required: c, maxLength: d, minLength: f, min: u, max: p, pattern: v, validate:
|
|
11774
|
+
const { ref: i, refs: s, required: c, maxLength: d, minLength: f, min: u, max: p, pattern: v, validate: k, name: M, valueAsNumber: C, mount: b } = e._f, m = R(n, M);
|
|
11773
11775
|
if (!b || t.has(M))
|
|
11774
11776
|
return {};
|
|
11775
11777
|
const $ = s ? s[0] : i, A = (N) => {
|
|
11776
11778
|
o && $.reportValidity && ($.setCustomValidity(et(N) ? "" : N || ""), $.reportValidity());
|
|
11777
|
-
}, E = {}, S = ho(i),
|
|
11779
|
+
}, E = {}, S = ho(i), x = Tn(i), j = S || x, T = (C || po(i)) && xe(i.value) && xe(m) || Zn(i) && i.value === "" || m === "" || Array.isArray(m) && !m.length, z = gb.bind(null, M, r, E), L = (N, W, U, Y = Ct.maxLength, B = Ct.minLength) => {
|
|
11778
11780
|
const Z = N ? W : U;
|
|
11779
11781
|
E[M] = {
|
|
11780
11782
|
type: N ? Y : B,
|
|
@@ -11783,7 +11785,7 @@ var Jt = (e) => je(e) && !Kn(e) ? e : {
|
|
|
11783
11785
|
...z(N ? Y : B, Z)
|
|
11784
11786
|
};
|
|
11785
11787
|
};
|
|
11786
|
-
if (a ? !Array.isArray(m) || !m.length : c && (!j && (T || Ge(m)) || et(m) && !m ||
|
|
11788
|
+
if (a ? !Array.isArray(m) || !m.length : c && (!j && (T || Ge(m)) || et(m) && !m || x && !$s(s).isValid || S && !Ds(s).isValid)) {
|
|
11787
11789
|
const { value: N, message: W } = Yn(c) ? { value: !!c, message: c } : Jt(c);
|
|
11788
11790
|
if (N && (E[M] = {
|
|
11789
11791
|
type: Ct.required,
|
|
@@ -11821,20 +11823,20 @@ var Jt = (e) => je(e) && !Kn(e) ? e : {
|
|
|
11821
11823
|
}, !r))
|
|
11822
11824
|
return A(W), E;
|
|
11823
11825
|
}
|
|
11824
|
-
if (
|
|
11825
|
-
if (pt(
|
|
11826
|
-
const N = await
|
|
11826
|
+
if (k) {
|
|
11827
|
+
if (pt(k)) {
|
|
11828
|
+
const N = await k(m, n), W = Oa(N, $);
|
|
11827
11829
|
if (W && (E[M] = {
|
|
11828
11830
|
...W,
|
|
11829
11831
|
...z(Ct.validate, W.message)
|
|
11830
11832
|
}, !r))
|
|
11831
11833
|
return A(W.message), E;
|
|
11832
|
-
} else if (je(
|
|
11834
|
+
} else if (je(k)) {
|
|
11833
11835
|
let N = {};
|
|
11834
|
-
for (const W in
|
|
11836
|
+
for (const W in k) {
|
|
11835
11837
|
if (!Ve(N) && !r)
|
|
11836
11838
|
break;
|
|
11837
|
-
const U = Oa(await
|
|
11839
|
+
const U = Oa(await k[W](m, n), $, W);
|
|
11838
11840
|
U && (N = {
|
|
11839
11841
|
...U,
|
|
11840
11842
|
...z(W, U.message)
|
|
@@ -11901,23 +11903,23 @@ function Db(e = {}) {
|
|
|
11901
11903
|
const p = {
|
|
11902
11904
|
array: wa(),
|
|
11903
11905
|
state: wa()
|
|
11904
|
-
}, v = en(t.mode),
|
|
11905
|
-
clearTimeout(d), d = setTimeout(h,
|
|
11906
|
+
}, v = en(t.mode), k = en(t.reValidateMode), M = t.criteriaMode === at.all, C = (h) => (w) => {
|
|
11907
|
+
clearTimeout(d), d = setTimeout(h, w);
|
|
11906
11908
|
}, b = async (h) => {
|
|
11907
11909
|
if (!t.disabled && (f.isValid || u.isValid || h)) {
|
|
11908
|
-
const
|
|
11909
|
-
|
|
11910
|
-
isValid:
|
|
11910
|
+
const w = t.resolver ? Ve((await T()).errors) : await L(r, !0);
|
|
11911
|
+
w !== n.isValid && p.state.next({
|
|
11912
|
+
isValid: w
|
|
11911
11913
|
});
|
|
11912
11914
|
}
|
|
11913
|
-
}, m = (h,
|
|
11915
|
+
}, m = (h, w) => {
|
|
11914
11916
|
!t.disabled && (f.isValidating || f.validatingFields || u.isValidating || u.validatingFields) && ((h || Array.from(s.mount)).forEach((D) => {
|
|
11915
|
-
D && (
|
|
11917
|
+
D && (w ? pe(n.validatingFields, D, w) : Ae(n.validatingFields, D));
|
|
11916
11918
|
}), p.state.next({
|
|
11917
11919
|
validatingFields: n.validatingFields,
|
|
11918
11920
|
isValidating: !Ve(n.validatingFields)
|
|
11919
11921
|
}));
|
|
11920
|
-
}, $ = (h,
|
|
11922
|
+
}, $ = (h, w = [], D, I, F = !0, P = !0) => {
|
|
11921
11923
|
if (I && D && !t.disabled) {
|
|
11922
11924
|
if (i.action = !0, P && Array.isArray(R(r, h))) {
|
|
11923
11925
|
const V = D(R(r, h), I.argA, I.argB);
|
|
@@ -11933,15 +11935,15 @@ function Db(e = {}) {
|
|
|
11933
11935
|
}
|
|
11934
11936
|
(f.dirtyFields || u.dirtyFields) && (n.dirtyFields = fn(o, a)), p.state.next({
|
|
11935
11937
|
name: h,
|
|
11936
|
-
isDirty: W(h,
|
|
11938
|
+
isDirty: W(h, w),
|
|
11937
11939
|
dirtyFields: n.dirtyFields,
|
|
11938
11940
|
errors: n.errors,
|
|
11939
11941
|
isValid: n.isValid
|
|
11940
11942
|
});
|
|
11941
11943
|
} else
|
|
11942
|
-
pe(a, h,
|
|
11943
|
-
}, A = (h,
|
|
11944
|
-
pe(n.errors, h,
|
|
11944
|
+
pe(a, h, w);
|
|
11945
|
+
}, A = (h, w) => {
|
|
11946
|
+
pe(n.errors, h, w), p.state.next({
|
|
11945
11947
|
errors: n.errors
|
|
11946
11948
|
});
|
|
11947
11949
|
}, E = (h) => {
|
|
@@ -11949,13 +11951,13 @@ function Db(e = {}) {
|
|
|
11949
11951
|
errors: n.errors,
|
|
11950
11952
|
isValid: !1
|
|
11951
11953
|
});
|
|
11952
|
-
}, S = (h,
|
|
11954
|
+
}, S = (h, w, D, I) => {
|
|
11953
11955
|
const F = R(r, h);
|
|
11954
11956
|
if (F) {
|
|
11955
11957
|
const P = R(a, h, xe(D) ? R(o, h) : D);
|
|
11956
|
-
xe(P) || I && I.defaultChecked ||
|
|
11958
|
+
xe(P) || I && I.defaultChecked || w ? pe(a, h, w ? P : $a(F._f)) : B(h, P), i.mount && b();
|
|
11957
11959
|
}
|
|
11958
|
-
},
|
|
11960
|
+
}, x = (h, w, D, I, F) => {
|
|
11959
11961
|
let P = !1, V = !1;
|
|
11960
11962
|
const ne = {
|
|
11961
11963
|
name: h
|
|
@@ -11963,7 +11965,7 @@ function Db(e = {}) {
|
|
|
11963
11965
|
if (!t.disabled) {
|
|
11964
11966
|
if (!D || I) {
|
|
11965
11967
|
(f.isDirty || u.isDirty) && (V = n.isDirty, n.isDirty = ne.isDirty = W(), P = V !== ne.isDirty);
|
|
11966
|
-
const ue = Tt(R(o, h),
|
|
11968
|
+
const ue = Tt(R(o, h), w);
|
|
11967
11969
|
V = !!R(n.dirtyFields, h), ue ? Ae(n.dirtyFields, h) : pe(n.dirtyFields, h, !0), ne.dirtyFields = n.dirtyFields, P = P || (f.dirtyFields || u.dirtyFields) && V !== !ue;
|
|
11968
11970
|
}
|
|
11969
11971
|
if (D) {
|
|
@@ -11973,12 +11975,12 @@ function Db(e = {}) {
|
|
|
11973
11975
|
P && F && p.state.next(ne);
|
|
11974
11976
|
}
|
|
11975
11977
|
return P ? ne : {};
|
|
11976
|
-
}, j = (h,
|
|
11977
|
-
const F = R(n.errors, h), P = (f.isValid || u.isValid) && et(
|
|
11978
|
+
}, j = (h, w, D, I) => {
|
|
11979
|
+
const F = R(n.errors, h), P = (f.isValid || u.isValid) && et(w) && n.isValid !== w;
|
|
11978
11980
|
if (t.delayError && D ? (c = C(() => A(h, D)), c(t.delayError)) : (clearTimeout(d), c = null, D ? pe(n.errors, h, D) : Ae(n.errors, h)), (D ? !Tt(F, D) : F) || !Ve(I) || P) {
|
|
11979
11981
|
const V = {
|
|
11980
11982
|
...I,
|
|
11981
|
-
...P && et(
|
|
11983
|
+
...P && et(w) ? { isValid: w } : {},
|
|
11982
11984
|
errors: n.errors,
|
|
11983
11985
|
name: h
|
|
11984
11986
|
};
|
|
@@ -11989,19 +11991,19 @@ function Db(e = {}) {
|
|
|
11989
11991
|
}
|
|
11990
11992
|
}, T = async (h) => {
|
|
11991
11993
|
m(h, !0);
|
|
11992
|
-
const
|
|
11993
|
-
return m(h),
|
|
11994
|
+
const w = await t.resolver(a, t.context, bb(h || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation));
|
|
11995
|
+
return m(h), w;
|
|
11994
11996
|
}, z = async (h) => {
|
|
11995
|
-
const { errors:
|
|
11997
|
+
const { errors: w } = await T(h);
|
|
11996
11998
|
if (h)
|
|
11997
11999
|
for (const D of h) {
|
|
11998
|
-
const I = R(
|
|
12000
|
+
const I = R(w, D);
|
|
11999
12001
|
I ? pe(n.errors, D, I) : Ae(n.errors, D);
|
|
12000
12002
|
}
|
|
12001
12003
|
else
|
|
12002
|
-
n.errors =
|
|
12003
|
-
return
|
|
12004
|
-
}, L = async (h,
|
|
12004
|
+
n.errors = w;
|
|
12005
|
+
return w;
|
|
12006
|
+
}, L = async (h, w, D = {
|
|
12005
12007
|
valid: !0
|
|
12006
12008
|
}) => {
|
|
12007
12009
|
for (const I in h) {
|
|
@@ -12011,41 +12013,41 @@ function Db(e = {}) {
|
|
|
12011
12013
|
if (P) {
|
|
12012
12014
|
const ne = s.array.has(P.name), ue = F._f && xb(F._f);
|
|
12013
12015
|
ue && f.validatingFields && m([I], !0);
|
|
12014
|
-
const Ce = await Hr(F, s.disabled, a, M, t.shouldUseNativeValidation && !
|
|
12015
|
-
if (ue && f.validatingFields && m([I]), Ce[P.name] && (D.valid = !1,
|
|
12016
|
+
const Ce = await Hr(F, s.disabled, a, M, t.shouldUseNativeValidation && !w, ne);
|
|
12017
|
+
if (ue && f.validatingFields && m([I]), Ce[P.name] && (D.valid = !1, w))
|
|
12016
12018
|
break;
|
|
12017
|
-
!
|
|
12019
|
+
!w && (R(Ce, P.name) ? ne ? Os(n.errors, Ce, P.name) : pe(n.errors, P.name, Ce[P.name]) : Ae(n.errors, P.name));
|
|
12018
12020
|
}
|
|
12019
|
-
!Ve(V) && await L(V,
|
|
12021
|
+
!Ve(V) && await L(V, w, D);
|
|
12020
12022
|
}
|
|
12021
12023
|
}
|
|
12022
12024
|
return D.valid;
|
|
12023
12025
|
}, N = () => {
|
|
12024
12026
|
for (const h of s.unMount) {
|
|
12025
|
-
const
|
|
12026
|
-
|
|
12027
|
+
const w = R(r, h);
|
|
12028
|
+
w && (w._f.refs ? w._f.refs.every((D) => !kr(D)) : !kr(w._f.ref)) && Se(h);
|
|
12027
12029
|
}
|
|
12028
12030
|
s.unMount = /* @__PURE__ */ new Set();
|
|
12029
|
-
}, W = (h,
|
|
12030
|
-
...i.mount ? a : xe(
|
|
12031
|
-
}, D,
|
|
12031
|
+
}, W = (h, w) => !t.disabled && (h && w && pe(a, h, w), !Tt(H(), o)), U = (h, w, D) => ws(h, s, {
|
|
12032
|
+
...i.mount ? a : xe(w) ? o : wt(h) ? { [h]: w } : w
|
|
12033
|
+
}, D, w), Y = (h) => Pn(R(i.mount ? a : o, h, t.shouldUnregister ? R(o, h, []) : [])), B = (h, w, D = {}) => {
|
|
12032
12034
|
const I = R(r, h);
|
|
12033
|
-
let F =
|
|
12035
|
+
let F = w;
|
|
12034
12036
|
if (I) {
|
|
12035
12037
|
const P = I._f;
|
|
12036
|
-
P && (!P.disabled && pe(a, h, Ms(
|
|
12038
|
+
P && (!P.disabled && pe(a, h, Ms(w, P)), F = Zn(P.ref) && Ge(w) ? "" : w, ks(P.ref) ? [...P.ref.options].forEach((V) => V.selected = F.includes(V.value)) : P.refs ? Tn(P.ref) ? P.refs.length > 1 ? P.refs.forEach((V) => (!V.defaultChecked || !V.disabled) && (V.checked = Array.isArray(F) ? !!F.find((ne) => ne === V.value) : F === V.value)) : P.refs[0] && (P.refs[0].checked = !!F) : P.refs.forEach((V) => V.checked = V.value === F) : po(P.ref) ? P.ref.value = "" : (P.ref.value = F, P.ref.type || p.state.next({
|
|
12037
12039
|
name: h,
|
|
12038
12040
|
values: Me(a)
|
|
12039
12041
|
})));
|
|
12040
12042
|
}
|
|
12041
|
-
(D.shouldDirty || D.shouldTouch) &&
|
|
12042
|
-
}, Z = (h,
|
|
12043
|
-
for (const I in
|
|
12044
|
-
const F =
|
|
12043
|
+
(D.shouldDirty || D.shouldTouch) && x(h, F, D.shouldTouch, D.shouldDirty, !0), D.shouldValidate && _(h);
|
|
12044
|
+
}, Z = (h, w, D) => {
|
|
12045
|
+
for (const I in w) {
|
|
12046
|
+
const F = w[I], P = `${h}.${I}`, V = R(r, P);
|
|
12045
12047
|
(s.array.has(h) || je(F) || V && !V._f) && !zt(F) ? Z(P, F, D) : B(P, F, D);
|
|
12046
12048
|
}
|
|
12047
|
-
}, oe = (h,
|
|
12048
|
-
const I = R(r, h), F = s.array.has(h), P = Me(
|
|
12049
|
+
}, oe = (h, w, D = {}) => {
|
|
12050
|
+
const I = R(r, h), F = s.array.has(h), P = Me(w);
|
|
12049
12051
|
pe(a, h, P), F ? (p.array.next({
|
|
12050
12052
|
name: h,
|
|
12051
12053
|
values: Me(a)
|
|
@@ -12059,16 +12061,16 @@ function Db(e = {}) {
|
|
|
12059
12061
|
});
|
|
12060
12062
|
}, te = async (h) => {
|
|
12061
12063
|
i.mount = !0;
|
|
12062
|
-
const
|
|
12063
|
-
let D =
|
|
12064
|
+
const w = h.target;
|
|
12065
|
+
let D = w.name, I = !0;
|
|
12064
12066
|
const F = R(r, D), P = (V) => {
|
|
12065
12067
|
I = Number.isNaN(V) || zt(V) && isNaN(V.getTime()) || Tt(V, R(a, D, V));
|
|
12066
12068
|
};
|
|
12067
12069
|
if (F) {
|
|
12068
12070
|
let V, ne;
|
|
12069
|
-
const ue =
|
|
12071
|
+
const ue = w.type ? $a(F._f) : ms(h), Ce = h.type === Qn.BLUR || h.type === Qn.FOCUS_OUT, nt = !wb(F._f) && !t.resolver && !R(n.errors, D) && !F._f.deps || Sb(Ce, R(n.touchedFields, D), n.isSubmitted, k, v), Q = zr(D, s, Ce);
|
|
12070
12072
|
pe(a, D, ue), Ce ? (F._f.onBlur && F._f.onBlur(h), c && c(0)) : F._f.onChange && F._f.onChange(h);
|
|
12071
|
-
const de =
|
|
12073
|
+
const de = x(D, ue, Ce), ce = !Ve(de) || Q;
|
|
12072
12074
|
if (!Ce && p.state.next({
|
|
12073
12075
|
name: D,
|
|
12074
12076
|
type: h.type,
|
|
@@ -12085,10 +12087,10 @@ function Db(e = {}) {
|
|
|
12085
12087
|
m([D], !0), V = (await Hr(F, s.disabled, a, M, t.shouldUseNativeValidation))[D], m([D]), P(ue), I && (V ? ne = !1 : (f.isValid || u.isValid) && (ne = await L(r, !0)));
|
|
12086
12088
|
I && (F._f.deps && _(F._f.deps), j(D, ne, V, de));
|
|
12087
12089
|
}
|
|
12088
|
-
}, O = (h,
|
|
12089
|
-
if (R(n.errors,
|
|
12090
|
+
}, O = (h, w) => {
|
|
12091
|
+
if (R(n.errors, w) && h.focus)
|
|
12090
12092
|
return h.focus(), 1;
|
|
12091
|
-
}, _ = async (h,
|
|
12093
|
+
}, _ = async (h, w = {}) => {
|
|
12092
12094
|
let D, I;
|
|
12093
12095
|
const F = Qe(h);
|
|
12094
12096
|
if (t.resolver) {
|
|
@@ -12102,41 +12104,41 @@ function Db(e = {}) {
|
|
|
12102
12104
|
...!wt(h) || (f.isValid || u.isValid) && D !== n.isValid ? {} : { name: h },
|
|
12103
12105
|
...t.resolver || !h ? { isValid: D } : {},
|
|
12104
12106
|
errors: n.errors
|
|
12105
|
-
}),
|
|
12107
|
+
}), w.shouldFocus && !I && nn(r, O, h ? F : s.mount), I;
|
|
12106
12108
|
}, H = (h) => {
|
|
12107
|
-
const
|
|
12109
|
+
const w = {
|
|
12108
12110
|
...i.mount ? a : o
|
|
12109
12111
|
};
|
|
12110
|
-
return xe(h) ?
|
|
12111
|
-
}, G = (h,
|
|
12112
|
-
invalid: !!R((
|
|
12113
|
-
isDirty: !!R((
|
|
12114
|
-
error: R((
|
|
12112
|
+
return xe(h) ? w : wt(h) ? R(w, h) : h.map((D) => R(w, D));
|
|
12113
|
+
}, G = (h, w) => ({
|
|
12114
|
+
invalid: !!R((w || n).errors, h),
|
|
12115
|
+
isDirty: !!R((w || n).dirtyFields, h),
|
|
12116
|
+
error: R((w || n).errors, h),
|
|
12115
12117
|
isValidating: !!R(n.validatingFields, h),
|
|
12116
|
-
isTouched: !!R((
|
|
12118
|
+
isTouched: !!R((w || n).touchedFields, h)
|
|
12117
12119
|
}), le = (h) => {
|
|
12118
|
-
h && Qe(h).forEach((
|
|
12120
|
+
h && Qe(h).forEach((w) => Ae(n.errors, w)), p.state.next({
|
|
12119
12121
|
errors: h ? n.errors : {}
|
|
12120
12122
|
});
|
|
12121
|
-
}, se = (h,
|
|
12123
|
+
}, se = (h, w, D) => {
|
|
12122
12124
|
const I = (R(r, h, { _f: {} })._f || {}).ref, F = R(n.errors, h) || {}, { ref: P, message: V, type: ne, ...ue } = F;
|
|
12123
12125
|
pe(n.errors, h, {
|
|
12124
12126
|
...ue,
|
|
12125
|
-
...
|
|
12127
|
+
...w,
|
|
12126
12128
|
ref: I
|
|
12127
12129
|
}), p.state.next({
|
|
12128
12130
|
name: h,
|
|
12129
12131
|
errors: n.errors,
|
|
12130
12132
|
isValid: !1
|
|
12131
12133
|
}), D && D.shouldFocus && I && I.focus && I.focus();
|
|
12132
|
-
}, re = (h,
|
|
12133
|
-
next: (D) => h(U(void 0,
|
|
12134
|
-
}) : U(h,
|
|
12135
|
-
next: (
|
|
12136
|
-
Cb(h.name,
|
|
12134
|
+
}, re = (h, w) => pt(h) ? p.state.subscribe({
|
|
12135
|
+
next: (D) => h(U(void 0, w), D)
|
|
12136
|
+
}) : U(h, w, !0), we = (h) => p.state.subscribe({
|
|
12137
|
+
next: (w) => {
|
|
12138
|
+
Cb(h.name, w.name, h.exact) && kb(w, h.formState || f, ie, h.reRenderRoot) && h.callback({
|
|
12137
12139
|
values: { ...a },
|
|
12138
12140
|
...n,
|
|
12139
|
-
...
|
|
12141
|
+
...w
|
|
12140
12142
|
});
|
|
12141
12143
|
}
|
|
12142
12144
|
}).unsubscribe, ae = (h) => (i.mount = !0, u = {
|
|
@@ -12145,47 +12147,47 @@ function Db(e = {}) {
|
|
|
12145
12147
|
}, we({
|
|
12146
12148
|
...h,
|
|
12147
12149
|
formState: u
|
|
12148
|
-
})), Se = (h,
|
|
12150
|
+
})), Se = (h, w = {}) => {
|
|
12149
12151
|
for (const D of h ? Qe(h) : s.mount)
|
|
12150
|
-
s.mount.delete(D), s.array.delete(D),
|
|
12152
|
+
s.mount.delete(D), s.array.delete(D), w.keepValue || (Ae(r, D), Ae(a, D)), !w.keepError && Ae(n.errors, D), !w.keepDirty && Ae(n.dirtyFields, D), !w.keepTouched && Ae(n.touchedFields, D), !w.keepIsValidating && Ae(n.validatingFields, D), !t.shouldUnregister && !w.keepDefaultValue && Ae(o, D);
|
|
12151
12153
|
p.state.next({
|
|
12152
12154
|
values: Me(a)
|
|
12153
12155
|
}), p.state.next({
|
|
12154
12156
|
...n,
|
|
12155
|
-
...
|
|
12156
|
-
}), !
|
|
12157
|
-
}, Ee = ({ disabled: h, name:
|
|
12158
|
-
(et(h) && i.mount || h || s.disabled.has(
|
|
12159
|
-
}, Ue = (h,
|
|
12157
|
+
...w.keepDirty ? { isDirty: W() } : {}
|
|
12158
|
+
}), !w.keepIsValid && b();
|
|
12159
|
+
}, Ee = ({ disabled: h, name: w }) => {
|
|
12160
|
+
(et(h) && i.mount || h || s.disabled.has(w)) && (h ? s.disabled.add(w) : s.disabled.delete(w));
|
|
12161
|
+
}, Ue = (h, w = {}) => {
|
|
12160
12162
|
let D = R(r, h);
|
|
12161
|
-
const I = et(
|
|
12163
|
+
const I = et(w.disabled) || et(t.disabled);
|
|
12162
12164
|
return pe(r, h, {
|
|
12163
12165
|
...D || {},
|
|
12164
12166
|
_f: {
|
|
12165
12167
|
...D && D._f ? D._f : { ref: { name: h } },
|
|
12166
12168
|
name: h,
|
|
12167
12169
|
mount: !0,
|
|
12168
|
-
...
|
|
12170
|
+
...w
|
|
12169
12171
|
}
|
|
12170
12172
|
}), s.mount.add(h), D ? Ee({
|
|
12171
|
-
disabled: et(
|
|
12173
|
+
disabled: et(w.disabled) ? w.disabled : t.disabled,
|
|
12172
12174
|
name: h
|
|
12173
|
-
}) : S(h, !0,
|
|
12174
|
-
...I ? { disabled:
|
|
12175
|
+
}) : S(h, !0, w.value), {
|
|
12176
|
+
...I ? { disabled: w.disabled || t.disabled } : {},
|
|
12175
12177
|
...t.progressive ? {
|
|
12176
|
-
required: !!
|
|
12177
|
-
min: pn(
|
|
12178
|
-
max: pn(
|
|
12179
|
-
minLength: pn(
|
|
12180
|
-
maxLength: pn(
|
|
12181
|
-
pattern: pn(
|
|
12178
|
+
required: !!w.required,
|
|
12179
|
+
min: pn(w.min),
|
|
12180
|
+
max: pn(w.max),
|
|
12181
|
+
minLength: pn(w.minLength),
|
|
12182
|
+
maxLength: pn(w.maxLength),
|
|
12183
|
+
pattern: pn(w.pattern)
|
|
12182
12184
|
} : {},
|
|
12183
12185
|
name: h,
|
|
12184
12186
|
onChange: te,
|
|
12185
12187
|
onBlur: te,
|
|
12186
12188
|
ref: (F) => {
|
|
12187
12189
|
if (F) {
|
|
12188
|
-
Ue(h,
|
|
12190
|
+
Ue(h, w), D = R(r, h);
|
|
12189
12191
|
const P = xe(F.value) && F.querySelectorAll && F.querySelectorAll("input,select,textarea")[0] || F, V = mb(P), ne = D._f.refs || [];
|
|
12190
12192
|
if (V ? ne.find((ue) => ue === P) : P === D._f.ref)
|
|
12191
12193
|
return;
|
|
@@ -12203,17 +12205,17 @@ function Db(e = {}) {
|
|
|
12203
12205
|
}
|
|
12204
12206
|
}), S(h, !1, void 0, P);
|
|
12205
12207
|
} else
|
|
12206
|
-
D = R(r, h, {}), D._f && (D._f.mount = !1), (t.shouldUnregister ||
|
|
12208
|
+
D = R(r, h, {}), D._f && (D._f.mount = !1), (t.shouldUnregister || w.shouldUnregister) && !(ys(s.array, h) && i.action) && s.unMount.add(h);
|
|
12207
12209
|
}
|
|
12208
12210
|
};
|
|
12209
12211
|
}, lt = () => t.shouldFocusError && nn(r, O, s.mount), Wt = (h) => {
|
|
12210
|
-
et(h) && (p.state.next({ disabled: h }), nn(r, (
|
|
12212
|
+
et(h) && (p.state.next({ disabled: h }), nn(r, (w, D) => {
|
|
12211
12213
|
const I = R(r, D);
|
|
12212
|
-
I && (
|
|
12214
|
+
I && (w.disabled = I._f.disabled || h, Array.isArray(I._f.refs) && I._f.refs.forEach((F) => {
|
|
12213
12215
|
F.disabled = I._f.disabled || h;
|
|
12214
12216
|
}));
|
|
12215
12217
|
}, 0, !1));
|
|
12216
|
-
}, q = (h,
|
|
12218
|
+
}, q = (h, w) => async (D) => {
|
|
12217
12219
|
let I;
|
|
12218
12220
|
D && (D.preventDefault && D.preventDefault(), D.persist && D.persist());
|
|
12219
12221
|
let F = Me(a);
|
|
@@ -12237,7 +12239,7 @@ function Db(e = {}) {
|
|
|
12237
12239
|
I = P;
|
|
12238
12240
|
}
|
|
12239
12241
|
} else
|
|
12240
|
-
|
|
12242
|
+
w && await w({ ...n.errors }, D), lt(), setTimeout(lt);
|
|
12241
12243
|
if (p.state.next({
|
|
12242
12244
|
isSubmitted: !0,
|
|
12243
12245
|
isSubmitting: !1,
|
|
@@ -12246,12 +12248,12 @@ function Db(e = {}) {
|
|
|
12246
12248
|
errors: n.errors
|
|
12247
12249
|
}), I)
|
|
12248
12250
|
throw I;
|
|
12249
|
-
}, J = (h,
|
|
12250
|
-
R(r, h) && (xe(
|
|
12251
|
-
}, $e = (h,
|
|
12251
|
+
}, J = (h, w = {}) => {
|
|
12252
|
+
R(r, h) && (xe(w.defaultValue) ? oe(h, Me(R(o, h))) : (oe(h, w.defaultValue), pe(o, h, Me(w.defaultValue))), w.keepTouched || Ae(n.touchedFields, h), w.keepDirty || (Ae(n.dirtyFields, h), n.isDirty = w.defaultValue ? W(h, Me(R(o, h))) : W()), w.keepError || (Ae(n.errors, h), f.isValid && b()), p.state.next({ ...n }));
|
|
12253
|
+
}, $e = (h, w = {}) => {
|
|
12252
12254
|
const D = h ? Me(h) : o, I = Me(D), F = Ve(h), P = F ? o : I;
|
|
12253
|
-
if (
|
|
12254
|
-
if (
|
|
12255
|
+
if (w.keepDefaultValues || (o = D), !w.keepValues) {
|
|
12256
|
+
if (w.keepDirtyValues) {
|
|
12255
12257
|
const V = /* @__PURE__ */ new Set([
|
|
12256
12258
|
...s.mount,
|
|
12257
12259
|
...Object.keys(fn(o, a))
|
|
@@ -12283,28 +12285,28 @@ function Db(e = {}) {
|
|
|
12283
12285
|
});
|
|
12284
12286
|
}
|
|
12285
12287
|
s = {
|
|
12286
|
-
mount:
|
|
12288
|
+
mount: w.keepDirtyValues ? s.mount : /* @__PURE__ */ new Set(),
|
|
12287
12289
|
unMount: /* @__PURE__ */ new Set(),
|
|
12288
12290
|
array: /* @__PURE__ */ new Set(),
|
|
12289
12291
|
disabled: /* @__PURE__ */ new Set(),
|
|
12290
12292
|
watch: /* @__PURE__ */ new Set(),
|
|
12291
12293
|
watchAll: !1,
|
|
12292
12294
|
focus: ""
|
|
12293
|
-
}, i.mount = !f.isValid || !!
|
|
12294
|
-
submitCount:
|
|
12295
|
-
isDirty: F ? !1 :
|
|
12296
|
-
isSubmitted:
|
|
12297
|
-
dirtyFields: F ? {} :
|
|
12298
|
-
touchedFields:
|
|
12299
|
-
errors:
|
|
12300
|
-
isSubmitSuccessful:
|
|
12295
|
+
}, i.mount = !f.isValid || !!w.keepIsValid || !!w.keepDirtyValues, i.watch = !!t.shouldUnregister, p.state.next({
|
|
12296
|
+
submitCount: w.keepSubmitCount ? n.submitCount : 0,
|
|
12297
|
+
isDirty: F ? !1 : w.keepDirty ? n.isDirty : !!(w.keepDefaultValues && !Tt(h, o)),
|
|
12298
|
+
isSubmitted: w.keepIsSubmitted ? n.isSubmitted : !1,
|
|
12299
|
+
dirtyFields: F ? {} : w.keepDirtyValues ? w.keepDefaultValues && a ? fn(o, a) : n.dirtyFields : w.keepDefaultValues && h ? fn(o, h) : w.keepDirty ? n.dirtyFields : {},
|
|
12300
|
+
touchedFields: w.keepTouched ? n.touchedFields : {},
|
|
12301
|
+
errors: w.keepErrors ? n.errors : {},
|
|
12302
|
+
isSubmitSuccessful: w.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
12301
12303
|
isSubmitting: !1
|
|
12302
12304
|
});
|
|
12303
|
-
}, ke = (h,
|
|
12305
|
+
}, ke = (h, w) => $e(pt(h) ? h(a) : h, w), Ne = (h, w = {}) => {
|
|
12304
12306
|
const D = R(r, h), I = D && D._f;
|
|
12305
12307
|
if (I) {
|
|
12306
12308
|
const F = I.refs ? I.refs[0] : I.ref;
|
|
12307
|
-
F.focus && (F.focus(),
|
|
12309
|
+
F.focus && (F.focus(), w.shouldSelect && pt(F.select) && F.select());
|
|
12308
12310
|
}
|
|
12309
12311
|
}, ie = (h) => {
|
|
12310
12312
|
n = {
|
|
@@ -12426,8 +12428,8 @@ var Er = (e, t) => xe(t) ? [] : Ob(e, Qe(t).sort((n, r) => n - r)), jr = (e, t,
|
|
|
12426
12428
|
function Mx(e) {
|
|
12427
12429
|
const t = An(), { control: n = t.control, name: r, keyName: o = "id", shouldUnregister: a, rules: i } = e, [s, c] = g.useState(n._getFieldArray(r)), d = g.useRef(n._getFieldArray(r).map(jt)), f = g.useRef(s), u = g.useRef(r), p = g.useRef(!1);
|
|
12428
12430
|
u.current = r, f.current = s, n._names.array.add(r), i && n.register(r, i), g.useEffect(() => n._subjects.array.subscribe({
|
|
12429
|
-
next: ({ values: S, name:
|
|
12430
|
-
if (
|
|
12431
|
+
next: ({ values: S, name: x }) => {
|
|
12432
|
+
if (x === u.current || !x) {
|
|
12431
12433
|
const j = R(S, u.current);
|
|
12432
12434
|
Array.isArray(j) && (c(j), d.current = j.map(jt));
|
|
12433
12435
|
}
|
|
@@ -12435,48 +12437,48 @@ function Mx(e) {
|
|
|
12435
12437
|
}).unsubscribe, [n]);
|
|
12436
12438
|
const v = g.useCallback((S) => {
|
|
12437
12439
|
p.current = !0, n._setFieldArray(r, S);
|
|
12438
|
-
}, [n, r]),
|
|
12440
|
+
}, [n, r]), k = (S, x) => {
|
|
12439
12441
|
const j = Qe(Me(S)), T = Sr(n._getFieldArray(r), j);
|
|
12440
|
-
n._names.focus = Cr(r, T.length - 1,
|
|
12442
|
+
n._names.focus = Cr(r, T.length - 1, x), d.current = Sr(d.current, j.map(jt)), v(T), c(T), n._setFieldArray(r, T, Sr, {
|
|
12441
12443
|
argA: $r(S)
|
|
12442
12444
|
});
|
|
12443
|
-
}, M = (S,
|
|
12445
|
+
}, M = (S, x) => {
|
|
12444
12446
|
const j = Qe(Me(S)), T = Or(n._getFieldArray(r), j);
|
|
12445
|
-
n._names.focus = Cr(r, 0,
|
|
12447
|
+
n._names.focus = Cr(r, 0, x), d.current = Or(d.current, j.map(jt)), v(T), c(T), n._setFieldArray(r, T, Or, {
|
|
12446
12448
|
argA: $r(S)
|
|
12447
12449
|
});
|
|
12448
12450
|
}, C = (S) => {
|
|
12449
|
-
const
|
|
12450
|
-
d.current = Er(d.current, S), v(
|
|
12451
|
+
const x = Er(n._getFieldArray(r), S);
|
|
12452
|
+
d.current = Er(d.current, S), v(x), c(x), !Array.isArray(R(n._fields, r)) && pe(n._fields, r, void 0), n._setFieldArray(r, x, Er, {
|
|
12451
12453
|
argA: S
|
|
12452
12454
|
});
|
|
12453
|
-
}, b = (S,
|
|
12454
|
-
const T = Qe(Me(
|
|
12455
|
+
}, b = (S, x, j) => {
|
|
12456
|
+
const T = Qe(Me(x)), z = Mr(n._getFieldArray(r), S, T);
|
|
12455
12457
|
n._names.focus = Cr(r, S, j), d.current = Mr(d.current, S, T.map(jt)), v(z), c(z), n._setFieldArray(r, z, Mr, {
|
|
12456
12458
|
argA: S,
|
|
12457
|
-
argB: $r(
|
|
12459
|
+
argB: $r(x)
|
|
12458
12460
|
});
|
|
12459
|
-
}, m = (S,
|
|
12461
|
+
}, m = (S, x) => {
|
|
12460
12462
|
const j = n._getFieldArray(r);
|
|
12461
|
-
jr(j, S,
|
|
12463
|
+
jr(j, S, x), jr(d.current, S, x), v(j), c(j), n._setFieldArray(r, j, jr, {
|
|
12462
12464
|
argA: S,
|
|
12463
|
-
argB:
|
|
12465
|
+
argB: x
|
|
12464
12466
|
}, !1);
|
|
12465
|
-
}, $ = (S,
|
|
12467
|
+
}, $ = (S, x) => {
|
|
12466
12468
|
const j = n._getFieldArray(r);
|
|
12467
|
-
Dr(j, S,
|
|
12469
|
+
Dr(j, S, x), Dr(d.current, S, x), v(j), c(j), n._setFieldArray(r, j, Dr, {
|
|
12468
12470
|
argA: S,
|
|
12469
|
-
argB:
|
|
12471
|
+
argB: x
|
|
12470
12472
|
}, !1);
|
|
12471
|
-
}, A = (S,
|
|
12472
|
-
const j = Me(
|
|
12473
|
+
}, A = (S, x) => {
|
|
12474
|
+
const j = Me(x), T = Ea(n._getFieldArray(r), S, j);
|
|
12473
12475
|
d.current = [...T].map((z, L) => !z || L === S ? jt() : d.current[L]), v(T), c([...T]), n._setFieldArray(r, T, Ea, {
|
|
12474
12476
|
argA: S,
|
|
12475
12477
|
argB: j
|
|
12476
12478
|
}, !0, !1);
|
|
12477
12479
|
}, E = (S) => {
|
|
12478
|
-
const
|
|
12479
|
-
d.current =
|
|
12480
|
+
const x = Qe(Me(S));
|
|
12481
|
+
d.current = x.map(jt), v([...x]), c([...x]), n._setFieldArray(r, [...x], (j) => j, {}, !0, !1);
|
|
12480
12482
|
};
|
|
12481
12483
|
return g.useEffect(() => {
|
|
12482
12484
|
if (n._state.action = !1, zr(r, n._names) && n._subjects.state.next({
|
|
@@ -12484,27 +12486,27 @@ function Mx(e) {
|
|
|
12484
12486
|
}), p.current && (!en(n._options.mode).isOnSubmit || n._formState.isSubmitted) && !en(n._options.reValidateMode).isOnSubmit)
|
|
12485
12487
|
if (n._options.resolver)
|
|
12486
12488
|
n._runSchema([r]).then((S) => {
|
|
12487
|
-
const
|
|
12488
|
-
(j ? !
|
|
12489
|
+
const x = R(S.errors, r), j = R(n._formState.errors, r);
|
|
12490
|
+
(j ? !x && j.type || x && (j.type !== x.type || j.message !== x.message) : x && x.type) && (x ? pe(n._formState.errors, r, x) : Ae(n._formState.errors, r), n._subjects.state.next({
|
|
12489
12491
|
errors: n._formState.errors
|
|
12490
12492
|
}));
|
|
12491
12493
|
});
|
|
12492
12494
|
else {
|
|
12493
12495
|
const S = R(n._fields, r);
|
|
12494
|
-
S && S._f && !(en(n._options.reValidateMode).isOnSubmit && en(n._options.mode).isOnSubmit) && Hr(S, n._names.disabled, n._formValues, n._options.criteriaMode === at.all, n._options.shouldUseNativeValidation, !0).then((
|
|
12495
|
-
errors: Os(n._formState.errors,
|
|
12496
|
+
S && S._f && !(en(n._options.reValidateMode).isOnSubmit && en(n._options.mode).isOnSubmit) && Hr(S, n._names.disabled, n._formValues, n._options.criteriaMode === at.all, n._options.shouldUseNativeValidation, !0).then((x) => !Ve(x) && n._subjects.state.next({
|
|
12497
|
+
errors: Os(n._formState.errors, x, r)
|
|
12496
12498
|
}));
|
|
12497
12499
|
}
|
|
12498
12500
|
n._subjects.state.next({
|
|
12499
12501
|
name: r,
|
|
12500
12502
|
values: Me(n._formValues)
|
|
12501
|
-
}), n._names.focus && nn(n._fields, (S,
|
|
12502
|
-
if (n._names.focus &&
|
|
12503
|
+
}), n._names.focus && nn(n._fields, (S, x) => {
|
|
12504
|
+
if (n._names.focus && x.startsWith(n._names.focus) && S.focus)
|
|
12503
12505
|
return S.focus(), 1;
|
|
12504
12506
|
}), n._names.focus = "", n._setValid(), p.current = !1;
|
|
12505
12507
|
}, [s, r, n]), g.useEffect(() => (!R(n._formValues, r) && n._setFieldArray(r), () => {
|
|
12506
|
-
const S = (
|
|
12507
|
-
const T = R(n._fields,
|
|
12508
|
+
const S = (x, j) => {
|
|
12509
|
+
const T = R(n._fields, x);
|
|
12508
12510
|
T && T._f && (T._f.mount = j);
|
|
12509
12511
|
};
|
|
12510
12512
|
n._options.shouldUnregister || a ? n.unregister(r) : S(r, !1);
|
|
@@ -12512,14 +12514,14 @@ function Mx(e) {
|
|
|
12512
12514
|
swap: g.useCallback(m, [v, r, n]),
|
|
12513
12515
|
move: g.useCallback($, [v, r, n]),
|
|
12514
12516
|
prepend: g.useCallback(M, [v, r, n]),
|
|
12515
|
-
append: g.useCallback(
|
|
12517
|
+
append: g.useCallback(k, [v, r, n]),
|
|
12516
12518
|
remove: g.useCallback(C, [v, r, n]),
|
|
12517
12519
|
insert: g.useCallback(b, [v, r, n]),
|
|
12518
12520
|
update: g.useCallback(A, [v, r, n]),
|
|
12519
12521
|
replace: g.useCallback(E, [v, r, n]),
|
|
12520
|
-
fields: g.useMemo(() => s.map((S,
|
|
12522
|
+
fields: g.useMemo(() => s.map((S, x) => ({
|
|
12521
12523
|
...S,
|
|
12522
|
-
[o]: d.current[
|
|
12524
|
+
[o]: d.current[x] || jt()
|
|
12523
12525
|
})), [s, o])
|
|
12524
12526
|
};
|
|
12525
12527
|
}
|