suprform 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/suprform.es.js
CHANGED
|
@@ -78,7 +78,7 @@ var St = (t, r, e, s = !0) => {
|
|
|
78
78
|
});
|
|
79
79
|
return u;
|
|
80
80
|
};
|
|
81
|
-
const
|
|
81
|
+
const ke = typeof window < "u" ? b.useLayoutEffect : b.useEffect;
|
|
82
82
|
function tr(t) {
|
|
83
83
|
const r = Ve(), { control: e = r.control, disabled: s, name: u, exact: i } = t || {}, [c, l] = b.useState(e._formState), V = b.useRef({
|
|
84
84
|
isDirty: !1,
|
|
@@ -90,7 +90,7 @@ function tr(t) {
|
|
|
90
90
|
isValid: !1,
|
|
91
91
|
errors: !1
|
|
92
92
|
});
|
|
93
|
-
return
|
|
93
|
+
return ke(() => e._subscribe({
|
|
94
94
|
name: u,
|
|
95
95
|
formState: V.current,
|
|
96
96
|
exact: i,
|
|
@@ -147,7 +147,7 @@ function Je(t) {
|
|
|
147
147
|
L(d);
|
|
148
148
|
}
|
|
149
149
|
}, [e._formValues, e._names, i, s]);
|
|
150
|
-
|
|
150
|
+
ke(() => ((g.current !== e || !te(F.current, s)) && (g.current = e, F.current = s, N()), e._subscribe({
|
|
151
151
|
name: s,
|
|
152
152
|
formState: {
|
|
153
153
|
values: !0
|
|
@@ -326,13 +326,13 @@ var or = (t) => {
|
|
|
326
326
|
return !0;
|
|
327
327
|
return !1;
|
|
328
328
|
};
|
|
329
|
-
function
|
|
329
|
+
function kt(t) {
|
|
330
330
|
return Array.isArray(t) || P(t) && !or(t);
|
|
331
331
|
}
|
|
332
332
|
function je(t, r = {}) {
|
|
333
333
|
for (const e in t) {
|
|
334
334
|
const s = t[e];
|
|
335
|
-
|
|
335
|
+
kt(s) ? (r[e] = Array.isArray(s) ? [] : {}, je(s, r[e])) : O(s) || (r[e] = !0);
|
|
336
336
|
}
|
|
337
337
|
return r;
|
|
338
338
|
}
|
|
@@ -340,7 +340,7 @@ function fe(t, r, e) {
|
|
|
340
340
|
e || (e = je(r));
|
|
341
341
|
for (const s in t) {
|
|
342
342
|
const u = t[s];
|
|
343
|
-
if (
|
|
343
|
+
if (kt(u))
|
|
344
344
|
O(r) || qe(e[s]) ? e[s] = je(u, Array.isArray(u) ? [] : {}) : fe(u, G(r) ? {} : r[s], e[s]);
|
|
345
345
|
else {
|
|
346
346
|
const i = r[s];
|
|
@@ -353,7 +353,7 @@ const yt = {
|
|
|
353
353
|
value: !1,
|
|
354
354
|
isValid: !1
|
|
355
355
|
}, mt = { value: !0, isValid: !0 };
|
|
356
|
-
var
|
|
356
|
+
var Ct = (t) => {
|
|
357
357
|
if (Array.isArray(t)) {
|
|
358
358
|
if (t.length > 1) {
|
|
359
359
|
const r = t.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -376,7 +376,7 @@ var Rt = (t) => Array.isArray(t) ? t.reduce((r, e) => e && e.checked && !e.disab
|
|
|
376
376
|
} : r, _t) : _t;
|
|
377
377
|
function gt(t) {
|
|
378
378
|
const r = t.ref;
|
|
379
|
-
return Xe(r) ? r.files : Ze(r) ? Rt(t.refs).value : wt(r) ? [...r.selectedOptions].map(({ value: e }) => e) : ve(r) ?
|
|
379
|
+
return Xe(r) ? r.files : Ze(r) ? Rt(t.refs).value : wt(r) ? [...r.selectedOptions].map(({ value: e }) => e) : ve(r) ? Ct(t.refs).value : Dt(O(r.value) ? t.ref.value : r.value, t);
|
|
380
380
|
}
|
|
381
381
|
var lr = (t, r, e, s) => {
|
|
382
382
|
const u = {};
|
|
@@ -467,20 +467,20 @@ var de = (t) => P(t) && !Se(t) ? t : {
|
|
|
467
467
|
const { ref: c, refs: l, required: V, maxLength: v, minLength: x, min: g, max: F, pattern: $, validate: L, name: w, valueAsNumber: N, mount: H } = t._f, S = m(e, w);
|
|
468
468
|
if (!H || r.has(w))
|
|
469
469
|
return {};
|
|
470
|
-
const M = l ? l[0] : c, f = (
|
|
471
|
-
u && M.reportValidity && (M.setCustomValidity(K(
|
|
472
|
-
}, d = {}, p = Ze(c), E = ve(c), Z = p || E, W = (N || Xe(c)) && O(c.value) && O(S) || xe(c) && c.value === "" || S === "" || Array.isArray(S) && !S.length, oe = ar.bind(null, w, s, d), se = (
|
|
473
|
-
const ae =
|
|
470
|
+
const M = l ? l[0] : c, f = (k) => {
|
|
471
|
+
u && M.reportValidity && (M.setCustomValidity(K(k) ? "" : k || ""), M.reportValidity());
|
|
472
|
+
}, d = {}, p = Ze(c), E = ve(c), Z = p || E, W = (N || Xe(c)) && O(c.value) && O(S) || xe(c) && c.value === "" || S === "" || Array.isArray(S) && !S.length, oe = ar.bind(null, w, s, d), se = (k, D, I, j = ne.maxLength, Q = ne.minLength) => {
|
|
473
|
+
const ae = k ? D : I;
|
|
474
474
|
d[w] = {
|
|
475
|
-
type:
|
|
475
|
+
type: k ? j : Q,
|
|
476
476
|
message: ae,
|
|
477
477
|
ref: c,
|
|
478
|
-
...oe(
|
|
478
|
+
...oe(k ? j : Q, ae)
|
|
479
479
|
};
|
|
480
480
|
};
|
|
481
|
-
if (i ? !Array.isArray(S) || !S.length : V && (!Z && (W || G(S)) || K(S) && !S || E && !
|
|
482
|
-
const { value:
|
|
483
|
-
if (
|
|
481
|
+
if (i ? !Array.isArray(S) || !S.length : V && (!Z && (W || G(S)) || K(S) && !S || E && !Ct(l).isValid || p && !Rt(l).isValid)) {
|
|
482
|
+
const { value: k, message: D } = Y(V) ? { value: !!V, message: V } : de(V);
|
|
483
|
+
if (k && (d[w] = {
|
|
484
484
|
type: ne.required,
|
|
485
485
|
message: D,
|
|
486
486
|
ref: M,
|
|
@@ -489,26 +489,26 @@ var de = (t) => P(t) && !Se(t) ? t : {
|
|
|
489
489
|
return f(D), d;
|
|
490
490
|
}
|
|
491
491
|
if (!W && (!G(g) || !G(F))) {
|
|
492
|
-
let
|
|
492
|
+
let k, D;
|
|
493
493
|
const I = de(F), j = de(g);
|
|
494
494
|
if (!G(S) && !isNaN(S)) {
|
|
495
495
|
const Q = c.valueAsNumber || S && +S;
|
|
496
|
-
G(I.value) || (
|
|
496
|
+
G(I.value) || (k = Q > I.value), G(j.value) || (D = Q < j.value);
|
|
497
497
|
} else {
|
|
498
498
|
const Q = c.valueAsDate || new Date(S), ae = (Fe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Fe), _e = c.type == "time", ce = c.type == "week";
|
|
499
|
-
Y(I.value) && S && (
|
|
499
|
+
Y(I.value) && S && (k = _e ? ae(S) > ae(I.value) : ce ? S > I.value : Q > new Date(I.value)), Y(j.value) && S && (D = _e ? ae(S) < ae(j.value) : ce ? S < j.value : Q < new Date(j.value));
|
|
500
500
|
}
|
|
501
|
-
if ((
|
|
501
|
+
if ((k || D) && (se(!!k, I.message, j.message, ne.max, ne.min), !s))
|
|
502
502
|
return f(d[w].message), d;
|
|
503
503
|
}
|
|
504
504
|
if ((v || x) && !W && (Y(S) || i && Array.isArray(S))) {
|
|
505
|
-
const
|
|
506
|
-
if ((I || j) && (se(I,
|
|
505
|
+
const k = de(v), D = de(x), I = !G(k.value) && S.length > +k.value, j = !G(D.value) && S.length < +D.value;
|
|
506
|
+
if ((I || j) && (se(I, k.message, D.message), !s))
|
|
507
507
|
return f(d[w].message), d;
|
|
508
508
|
}
|
|
509
509
|
if ($ && !W && Y(S)) {
|
|
510
|
-
const { value:
|
|
511
|
-
if (Se(
|
|
510
|
+
const { value: k, message: D } = de($);
|
|
511
|
+
if (Se(k) && !S.match(k) && (d[w] = {
|
|
512
512
|
type: ne.pattern,
|
|
513
513
|
message: D,
|
|
514
514
|
ref: c,
|
|
@@ -518,26 +518,26 @@ var de = (t) => P(t) && !Se(t) ? t : {
|
|
|
518
518
|
}
|
|
519
519
|
if (L) {
|
|
520
520
|
if (re(L)) {
|
|
521
|
-
const
|
|
521
|
+
const k = await L(S, e), D = Vt(k, M);
|
|
522
522
|
if (D && (d[w] = {
|
|
523
523
|
...D,
|
|
524
524
|
...oe(ne.validate, D.message)
|
|
525
525
|
}, !s))
|
|
526
526
|
return f(D.message), d;
|
|
527
527
|
} else if (P(L)) {
|
|
528
|
-
let
|
|
528
|
+
let k = {};
|
|
529
529
|
for (const D in L) {
|
|
530
|
-
if (!q(
|
|
530
|
+
if (!q(k) && !s)
|
|
531
531
|
break;
|
|
532
532
|
const I = Vt(await L[D](S, e), M, D);
|
|
533
|
-
I && (
|
|
533
|
+
I && (k = {
|
|
534
534
|
...I,
|
|
535
535
|
...oe(D, I.message)
|
|
536
|
-
}, f(I.message), s && (d[w] =
|
|
536
|
+
}, f(I.message), s && (d[w] = k));
|
|
537
537
|
}
|
|
538
|
-
if (!q(
|
|
538
|
+
if (!q(k) && (d[w] = {
|
|
539
539
|
ref: M,
|
|
540
|
-
...
|
|
540
|
+
...k
|
|
541
541
|
}, !s))
|
|
542
542
|
return d;
|
|
543
543
|
}
|
|
@@ -650,22 +650,22 @@ function hr(t = {}) {
|
|
|
650
650
|
}
|
|
651
651
|
}, d = (a, n, o, h, _) => {
|
|
652
652
|
let y = !1, A = !1;
|
|
653
|
-
const
|
|
653
|
+
const C = {
|
|
654
654
|
name: a
|
|
655
655
|
};
|
|
656
656
|
if (!r.disabled) {
|
|
657
657
|
if (!o || h) {
|
|
658
|
-
(x.isDirty || g.isDirty) && (A = e.isDirty, e.isDirty =
|
|
658
|
+
(x.isDirty || g.isDirty) && (A = e.isDirty, e.isDirty = C.isDirty = se(), y = A !== C.isDirty);
|
|
659
659
|
const T = te(m(u, a), n);
|
|
660
|
-
A = !!m(e.dirtyFields, a), T ? B(e.dirtyFields, a) : R(e.dirtyFields, a, !0),
|
|
660
|
+
A = !!m(e.dirtyFields, a), T ? B(e.dirtyFields, a) : R(e.dirtyFields, a, !0), C.dirtyFields = e.dirtyFields, y = y || (x.dirtyFields || g.dirtyFields) && A !== !T;
|
|
661
661
|
}
|
|
662
662
|
if (o) {
|
|
663
663
|
const T = m(e.touchedFields, a);
|
|
664
|
-
T || (R(e.touchedFields, a, o),
|
|
664
|
+
T || (R(e.touchedFields, a, o), C.touchedFields = e.touchedFields, y = y || (x.touchedFields || g.touchedFields) && T !== o);
|
|
665
665
|
}
|
|
666
|
-
y && _ && F.state.next(
|
|
666
|
+
y && _ && F.state.next(C);
|
|
667
667
|
}
|
|
668
|
-
return y ?
|
|
668
|
+
return y ? C : {};
|
|
669
669
|
}, p = (a, n, o, h) => {
|
|
670
670
|
const _ = m(e.errors, a), y = (x.isValid || g.isValid) && K(n) && e.isValid !== n;
|
|
671
671
|
if (r.delayError && o ? (V = L(() => S(a, o)), V(r.delayError)) : (clearTimeout(v), V = null, o ? R(e.errors, a, o) : B(e.errors, a)), (o ? !te(_, o) : _) || !q(h) || y) {
|
|
@@ -702,12 +702,12 @@ function hr(t = {}) {
|
|
|
702
702
|
if (_) {
|
|
703
703
|
const { _f: y, ...A } = _;
|
|
704
704
|
if (y) {
|
|
705
|
-
const
|
|
705
|
+
const C = l.array.has(y.name), T = _._f && cr(_._f);
|
|
706
706
|
T && x.validatingFields && N([y.name], !0);
|
|
707
|
-
const J = await Ge(_, l.disabled, i, $, r.shouldUseNativeValidation && !n,
|
|
707
|
+
const J = await Ge(_, l.disabled, i, $, r.shouldUseNativeValidation && !n, C);
|
|
708
708
|
if (T && x.validatingFields && N([y.name]), J[y.name] && (o.valid = !1, n))
|
|
709
709
|
break;
|
|
710
|
-
!n && (m(J, y.name) ?
|
|
710
|
+
!n && (m(J, y.name) ? C ? Tt(e.errors, J, y.name) : R(e.errors, y.name, J[y.name]) : B(e.errors, y.name));
|
|
711
711
|
}
|
|
712
712
|
!q(A) && await W(A, n, o);
|
|
713
713
|
}
|
|
@@ -716,10 +716,10 @@ function hr(t = {}) {
|
|
|
716
716
|
}, oe = () => {
|
|
717
717
|
for (const a of l.unMount) {
|
|
718
718
|
const n = m(s, a);
|
|
719
|
-
n && (n._f.refs ? n._f.refs.every((o) => !Ue(o)) : !Ue(n._f.ref)) &&
|
|
719
|
+
n && (n._f.refs ? n._f.refs.every((o) => !Ue(o)) : !Ue(n._f.ref)) && Ce(a);
|
|
720
720
|
}
|
|
721
721
|
l.unMount = /* @__PURE__ */ new Set();
|
|
722
|
-
}, se = (a, n) => !r.disabled && (a && n && R(i, a, n), !te(Fe(), u)),
|
|
722
|
+
}, se = (a, n) => !r.disabled && (a && n && R(i, a, n), !te(Fe(), u)), k = (a, n, o) => He(a, l, {
|
|
723
723
|
...c.mount ? i : O(n) ? u : Y(a) ? { [a]: n } : n
|
|
724
724
|
}, o, n), D = (a) => we(m(c.mount ? i : u, a, r.shouldUnregister ? m(u, a, []) : [])), I = (a, n, o = {}) => {
|
|
725
725
|
const h = m(s, a);
|
|
@@ -727,7 +727,7 @@ function hr(t = {}) {
|
|
|
727
727
|
if (h) {
|
|
728
728
|
const y = h._f;
|
|
729
729
|
y && (!y.disabled && R(i, a, Dt(n, y)), _ = xe(y.ref) && G(n) ? "" : n, wt(y.ref) ? [...y.ref.options].forEach((A) => A.selected = _.includes(A.value)) : y.refs ? ve(y.ref) ? y.refs.forEach((A) => {
|
|
730
|
-
(!A.defaultChecked || !A.disabled) && (Array.isArray(_) ? A.checked = !!_.find((
|
|
730
|
+
(!A.defaultChecked || !A.disabled) && (Array.isArray(_) ? A.checked = !!_.find((C) => C === A.value) : A.checked = _ === A.value || !!_);
|
|
731
731
|
}) : y.refs.forEach((A) => A.checked = A.value === _) : Xe(y.ref) ? y.ref.value = "" : (y.ref.value = _, y.ref.type || F.state.next({
|
|
732
732
|
name: a,
|
|
733
733
|
values: U(i)
|
|
@@ -760,10 +760,10 @@ function hr(t = {}) {
|
|
|
760
760
|
let o = n.name, h = !0;
|
|
761
761
|
const _ = m(s, o), y = (T) => {
|
|
762
762
|
h = Number.isNaN(T) || le(T) && isNaN(T.getTime()) || te(T, m(i, o, T));
|
|
763
|
-
}, A = ye(r.mode),
|
|
763
|
+
}, A = ye(r.mode), C = ye(r.reValidateMode);
|
|
764
764
|
if (_) {
|
|
765
765
|
let T, J;
|
|
766
|
-
const be = n.type ? gt(_._f) : pt(a), ie = a.type === pe.BLUR || a.type === pe.FOCUS_OUT, Ht = !dr(_._f) && !r.resolver && !m(e.errors, o) && !_._f.deps || mr(ie, m(e.touchedFields, o), e.isSubmitted,
|
|
766
|
+
const be = n.type ? gt(_._f) : pt(a), ie = a.type === pe.BLUR || a.type === pe.FOCUS_OUT, Ht = !dr(_._f) && !r.resolver && !m(e.errors, o) && !_._f.deps || mr(ie, m(e.touchedFields, o), e.isSubmitted, C, A), Te = Qe(o, l, ie);
|
|
767
767
|
R(i, o, be), ie ? (!n || !n.readOnly) && (_._f.onBlur && _._f.onBlur(a), V && V(0)) : _._f.onChange && _._f.onChange(a);
|
|
768
768
|
const Oe = d(o, be, ie), qt = !q(Oe) || Te;
|
|
769
769
|
if (!ie && F.state.next({
|
|
@@ -816,7 +816,7 @@ function hr(t = {}) {
|
|
|
816
816
|
errors: a ? e.errors : {}
|
|
817
817
|
});
|
|
818
818
|
}, rt = (a, n, o) => {
|
|
819
|
-
const h = (m(s, a, { _f: {} })._f || {}).ref, _ = m(e.errors, a) || {}, { ref: y, message: A, type:
|
|
819
|
+
const h = (m(s, a, { _f: {} })._f || {}).ref, _ = m(e.errors, a) || {}, { ref: y, message: A, type: C, ...T } = _;
|
|
820
820
|
R(e.errors, a, {
|
|
821
821
|
...T,
|
|
822
822
|
...n,
|
|
@@ -827,8 +827,8 @@ function hr(t = {}) {
|
|
|
827
827
|
isValid: !1
|
|
828
828
|
}), o && o.shouldFocus && h && h.focus && h.focus();
|
|
829
829
|
}, Mt = (a, n) => re(a) ? F.state.subscribe({
|
|
830
|
-
next: (o) => "values" in o && a(
|
|
831
|
-
}) :
|
|
830
|
+
next: (o) => "values" in o && a(k(void 0, n), o)
|
|
831
|
+
}) : k(a, n, !0), st = (a) => F.state.subscribe({
|
|
832
832
|
next: (n) => {
|
|
833
833
|
yr(a.name, n.name, a.exact) && fr(n, a.formState || x, $t, a.reRenderRoot) && a.callback({
|
|
834
834
|
values: { ...i },
|
|
@@ -843,7 +843,7 @@ function hr(t = {}) {
|
|
|
843
843
|
}, st({
|
|
844
844
|
...a,
|
|
845
845
|
formState: g
|
|
846
|
-
})),
|
|
846
|
+
})), Ce = (a, n = {}) => {
|
|
847
847
|
for (const o of a ? z(a) : l.mount)
|
|
848
848
|
l.mount.delete(o), l.array.delete(o), n.keepValue || (B(s, o), B(i, o)), !n.keepError && B(e.errors, o), !n.keepDirty && B(e.dirtyFields, o), !n.keepTouched && B(e.touchedFields, o), !n.keepIsValidating && B(e.validatingFields, o), !r.shouldUnregister && !n.keepDefaultValue && B(u, o);
|
|
849
849
|
F.state.next({
|
|
@@ -884,15 +884,15 @@ function hr(t = {}) {
|
|
|
884
884
|
ref: (_) => {
|
|
885
885
|
if (_) {
|
|
886
886
|
De(a, n), o = m(s, a);
|
|
887
|
-
const y = O(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, A = nr(y),
|
|
888
|
-
if (A ?
|
|
887
|
+
const y = O(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, A = nr(y), C = o._f.refs || [];
|
|
888
|
+
if (A ? C.find((T) => T === y) : y === o._f.ref)
|
|
889
889
|
return;
|
|
890
890
|
R(s, a, {
|
|
891
891
|
_f: {
|
|
892
892
|
...o._f,
|
|
893
893
|
...A ? {
|
|
894
894
|
refs: [
|
|
895
|
-
...
|
|
895
|
+
...C.filter(Ue),
|
|
896
896
|
y,
|
|
897
897
|
...Array.isArray(m(u, a)) ? [{}] : []
|
|
898
898
|
],
|
|
@@ -954,14 +954,14 @@ function hr(t = {}) {
|
|
|
954
954
|
...l.mount,
|
|
955
955
|
...Object.keys(fe(u, i))
|
|
956
956
|
]);
|
|
957
|
-
for (const
|
|
958
|
-
m(e.dirtyFields,
|
|
957
|
+
for (const C of Array.from(A))
|
|
958
|
+
m(e.dirtyFields, C) ? R(y, C, m(i, C)) : Q(C, m(y, C));
|
|
959
959
|
} else {
|
|
960
960
|
if (ze && O(a))
|
|
961
961
|
for (const A of l.mount) {
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
const T = Array.isArray(
|
|
962
|
+
const C = m(s, A);
|
|
963
|
+
if (C && C._f) {
|
|
964
|
+
const T = Array.isArray(C._f.refs) ? C._f.refs[0] : C._f.ref;
|
|
965
965
|
if (xe(T)) {
|
|
966
966
|
const J = T.closest("form");
|
|
967
967
|
if (J) {
|
|
@@ -1016,14 +1016,14 @@ function hr(t = {}) {
|
|
|
1016
1016
|
}, ot = {
|
|
1017
1017
|
control: {
|
|
1018
1018
|
register: De,
|
|
1019
|
-
unregister:
|
|
1019
|
+
unregister: Ce,
|
|
1020
1020
|
getFieldState: tt,
|
|
1021
1021
|
handleSubmit: nt,
|
|
1022
1022
|
setError: rt,
|
|
1023
1023
|
_subscribe: st,
|
|
1024
1024
|
_runSchema: E,
|
|
1025
1025
|
_focusError: Re,
|
|
1026
|
-
_getWatch:
|
|
1026
|
+
_getWatch: k,
|
|
1027
1027
|
_getDirty: se,
|
|
1028
1028
|
_setValid: w,
|
|
1029
1029
|
_setFieldArray: H,
|
|
@@ -1084,7 +1084,7 @@ function hr(t = {}) {
|
|
|
1084
1084
|
reset: ut,
|
|
1085
1085
|
resetField: Pt,
|
|
1086
1086
|
clearErrors: Lt,
|
|
1087
|
-
unregister:
|
|
1087
|
+
unregister: Ce,
|
|
1088
1088
|
setError: rt,
|
|
1089
1089
|
setFocus: Wt,
|
|
1090
1090
|
getFieldState: tt
|
|
@@ -1130,7 +1130,7 @@ var We = (t, r) => O(r) ? [] : vr(t, z(r).sort((e, s) => e - s)), $e = (t, r, e)
|
|
|
1130
1130
|
}, Ft = (t, r, e) => (t[r] = e, t);
|
|
1131
1131
|
function Vr(t) {
|
|
1132
1132
|
const r = Ve(), { control: e = r.control, name: s, keyName: u = "id", shouldUnregister: i, rules: c } = t, [l, V] = b.useState(e._getFieldArray(s)), v = b.useRef(e._getFieldArray(s).map(ue)), x = b.useRef(!1);
|
|
1133
|
-
e._names.array.add(s), b.useMemo(() => c && l.length >= 0 && e.register(s, c), [e, s, l.length, c]),
|
|
1133
|
+
e._names.array.add(s), b.useMemo(() => c && l.length >= 0 && e.register(s, c), [e, s, l.length, c]), ke(() => e._subjects.array.subscribe({
|
|
1134
1134
|
next: ({ values: f, name: d }) => {
|
|
1135
1135
|
if (d === s || !d) {
|
|
1136
1136
|
const p = m(f, s);
|
|
@@ -1260,7 +1260,7 @@ function Fr(t = {}) {
|
|
|
1260
1260
|
};
|
|
1261
1261
|
}
|
|
1262
1262
|
const i = r.current.control;
|
|
1263
|
-
return i._options = t,
|
|
1263
|
+
return i._options = t, ke(() => {
|
|
1264
1264
|
const c = i._subscribe({
|
|
1265
1265
|
formState: i._proxyFormState,
|
|
1266
1266
|
callback: () => u({ ...i._formState }),
|
|
@@ -1335,19 +1335,14 @@ const pr = ({
|
|
|
1335
1335
|
children: t,
|
|
1336
1336
|
visibility: r
|
|
1337
1337
|
}) => {
|
|
1338
|
-
const e = he(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Je({ name: e })
|
|
1339
|
-
return
|
|
1340
|
-
"ConditionChecker - evaluateCondition:",
|
|
1341
|
-
u,
|
|
1342
|
-
"namesToWatch:",
|
|
1343
|
-
e
|
|
1344
|
-
), u ? t : null;
|
|
1338
|
+
const e = he(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Je({ name: e });
|
|
1339
|
+
return he(() => typeof r == "boolean" ? r : !r || (r == null ? void 0 : r.conditions.length) === 0 ? !0 : Ut(e, s, r), [r, e, s]) ? t : null;
|
|
1345
1340
|
}, xr = ({
|
|
1346
1341
|
children: t,
|
|
1347
1342
|
disabled: r
|
|
1348
1343
|
}) => {
|
|
1349
1344
|
const e = he(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Je({ name: e }), u = he(() => typeof r == "boolean" ? r : !r || (r == null ? void 0 : r.conditions.length) === 0 ? !1 : Ut(e, s, r), [r, e, s]);
|
|
1350
|
-
return
|
|
1345
|
+
return Ae(t, { ...t.props, disabled: u });
|
|
1351
1346
|
}, Nt = ({
|
|
1352
1347
|
children: t,
|
|
1353
1348
|
onSubmit: r = () => {
|