@burdenoff/microfe-admin 2026.625.1 → 2026.626.1
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/admin/components/AccessDenied.js +2 -2
- package/dist/admin/components/AccessDenied.js.map +1 -1
- package/dist/admin/components/ActivityFeed.js +4 -4
- package/dist/admin/components/ActivityFeed.js.map +1 -1
- package/dist/admin/components/Charts.js.map +1 -1
- package/dist/admin/components/ConfirmDialog.js +1 -1
- package/dist/admin/components/ConfirmDialog.js.map +1 -1
- package/dist/admin/components/FormSheet.js +1 -1
- package/dist/admin/components/FormSheet.js.map +1 -1
- package/dist/admin/components/TenantSsoPanel.js +1 -1
- package/dist/admin/components/TenantSsoPanel.js.map +1 -1
- package/dist/admin/components/Toast.js +11 -11
- package/dist/admin/components/Toast.js.map +1 -1
- package/dist/admin/components/forms/SubscriptionForm.js +2 -2
- package/dist/admin/components/forms/SubscriptionForm.js.map +1 -1
- package/dist/admin/components/forms/TenantForm.js +1 -1
- package/dist/admin/components/forms/UserForm.js +1 -1
- package/dist/admin/components/ui.js +3 -3
- package/dist/admin/components/ui.js.map +1 -1
- package/dist/admin/constants/index.js +33 -24
- package/dist/admin/constants/index.js.map +1 -1
- package/dist/admin/pages/AuditLogsPage.js +92 -77
- package/dist/admin/pages/AuditLogsPage.js.map +1 -1
- package/dist/admin/pages/BillingPage.js +95 -51
- package/dist/admin/pages/BillingPage.js.map +1 -1
- package/dist/admin/pages/CommunicationsPage.js +97 -92
- package/dist/admin/pages/CommunicationsPage.js.map +1 -1
- package/dist/admin/pages/ContentPagesPage.js +274 -259
- package/dist/admin/pages/ContentPagesPage.js.map +1 -1
- package/dist/admin/pages/DashboardPage.js +113 -84
- package/dist/admin/pages/DashboardPage.js.map +1 -1
- package/dist/admin/pages/FeatureFlagsPage.js +93 -75
- package/dist/admin/pages/FeatureFlagsPage.js.map +1 -1
- package/dist/admin/pages/OrganizationsListPage.js +105 -87
- package/dist/admin/pages/OrganizationsListPage.js.map +1 -1
- package/dist/admin/pages/ProductsPage.js +138 -130
- package/dist/admin/pages/ProductsPage.js.map +1 -1
- package/dist/admin/pages/ReferralsPage.js +70 -52
- package/dist/admin/pages/ReferralsPage.js.map +1 -1
- package/dist/admin/pages/RolesPermissionsPage.js +136 -118
- package/dist/admin/pages/RolesPermissionsPage.js.map +1 -1
- package/dist/admin/pages/SREPage.js +34 -32
- package/dist/admin/pages/SREPage.js.map +1 -1
- package/dist/admin/pages/SandboxSettingsPage.js +360 -322
- package/dist/admin/pages/SandboxSettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage.js +63 -60
- package/dist/admin/pages/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SyncFailuresPage.js +120 -118
- package/dist/admin/pages/SyncFailuresPage.js.map +1 -1
- package/dist/admin/pages/TenantDetailPage.js +261 -218
- package/dist/admin/pages/TenantDetailPage.js.map +1 -1
- package/dist/admin/pages/TenantFormRoutePage.js +65 -61
- package/dist/admin/pages/TenantFormRoutePage.js.map +1 -1
- package/dist/admin/pages/TenantsListPage.js +86 -71
- package/dist/admin/pages/TenantsListPage.js.map +1 -1
- package/dist/admin/pages/UsersListPage.js +128 -113
- package/dist/admin/pages/UsersListPage.js.map +1 -1
- package/dist/admin/pages/WaitlistPage.js +78 -63
- package/dist/admin/pages/WaitlistPage.js.map +1 -1
- package/dist/admin/pages/WorkflowsPage.js +107 -102
- package/dist/admin/pages/WorkflowsPage.js.map +1 -1
- package/dist/admin/pages/WorkspacesListPage.js +61 -49
- package/dist/admin/pages/WorkspacesListPage.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/dist/resolvers.js +2 -2
- package/dist/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js +35 -26
- package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js +609 -516
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,35 +14,20 @@ function u(e) {
|
|
|
14
14
|
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = u(e[t]));
|
|
15
15
|
return r;
|
|
16
16
|
}
|
|
17
|
-
var d =
|
|
18
|
-
if (!t || !a(e)) return n;
|
|
19
|
-
let i = (d(t) ? [t] : m(t)).reduce((e, t) => r(e) ? void 0 : e[t], e);
|
|
20
|
-
return f(i) || i === e ? f(e[t]) ? n : e[t] : i;
|
|
21
|
-
}, g = (e) => typeof e == "boolean", _ = (e) => typeof e == "function", v = (e, t, n) => {
|
|
22
|
-
let r = -1, i = d(t) ? [t] : m(t), o = i.length, s = o - 1;
|
|
23
|
-
for (; ++r < o;) {
|
|
24
|
-
let t = i[r], o = n;
|
|
25
|
-
if (r !== s) {
|
|
26
|
-
let n = e[t];
|
|
27
|
-
o = a(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
28
|
-
}
|
|
29
|
-
if (t === "__proto__" || t === "constructor" || t === "prototype") return;
|
|
30
|
-
e[t] = o, e = e[t];
|
|
31
|
-
}
|
|
32
|
-
}, y = {
|
|
17
|
+
var d = {
|
|
33
18
|
BLUR: "blur",
|
|
34
19
|
FOCUS_OUT: "focusout",
|
|
35
20
|
CHANGE: "change",
|
|
36
21
|
SUBMIT: "submit",
|
|
37
22
|
TRIGGER: "trigger",
|
|
38
23
|
VALID: "valid"
|
|
39
|
-
},
|
|
24
|
+
}, f = {
|
|
40
25
|
onBlur: "onBlur",
|
|
41
26
|
onChange: "onChange",
|
|
42
27
|
onSubmit: "onSubmit",
|
|
43
28
|
onTouched: "onTouched",
|
|
44
29
|
all: "all"
|
|
45
|
-
},
|
|
30
|
+
}, p = {
|
|
46
31
|
max: "max",
|
|
47
32
|
min: "min",
|
|
48
33
|
maxLength: "maxLength",
|
|
@@ -50,18 +35,39 @@ var d = (e) => /^\w*$/.test(e), f = (e) => e === void 0, p = (e) => Array.isArra
|
|
|
50
35
|
pattern: "pattern",
|
|
51
36
|
required: "required",
|
|
52
37
|
validate: "validate"
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
}, m = "root", h = [
|
|
39
|
+
"__proto__",
|
|
40
|
+
"constructor",
|
|
41
|
+
"prototype"
|
|
42
|
+
], g = /^\w*$/, _ = (e) => g.test(e), v = (e) => e === void 0, y = /[.[\]'"]/, b = (e) => e.split(y).filter(Boolean), x = (e, t, n) => {
|
|
43
|
+
if (!t || !a(e)) return n;
|
|
44
|
+
let i = _(t) ? [t] : b(t);
|
|
45
|
+
if (i.some((e) => h.includes(e))) return n;
|
|
46
|
+
let o = i.reduce((e, t) => r(e) ? void 0 : e[t], e);
|
|
47
|
+
return v(o) || o === e ? v(e[t]) ? n : e[t] : o;
|
|
48
|
+
}, S = (e) => typeof e == "boolean", C = (e) => typeof e == "function", w = (e, t, n) => {
|
|
49
|
+
let r = -1, i = _(t) ? [t] : b(t), o = i.length, s = o - 1;
|
|
50
|
+
for (; ++r < o;) {
|
|
51
|
+
let t = i[r], o = n;
|
|
52
|
+
if (r !== s) {
|
|
53
|
+
let n = e[t];
|
|
54
|
+
o = a(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
55
|
+
}
|
|
56
|
+
if (h.includes(t)) return;
|
|
57
|
+
e[t] = o, e = e[t];
|
|
58
|
+
}
|
|
59
|
+
}, T = e.createContext(null);
|
|
60
|
+
T.displayName = "HookFormControlContext";
|
|
61
|
+
var E = () => e.useContext(T), D = (e, t, n, r = !0) => {
|
|
56
62
|
let i = {};
|
|
57
63
|
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
58
64
|
let i = a;
|
|
59
|
-
return t._proxyFormState[i] !==
|
|
65
|
+
return t._proxyFormState[i] !== f.all && (t._proxyFormState[i] = !r || f.all), n && (n[i] = !0), e[i];
|
|
60
66
|
} });
|
|
61
67
|
return i;
|
|
62
|
-
},
|
|
63
|
-
function
|
|
64
|
-
let n =
|
|
68
|
+
}, O = l ? e.useLayoutEffect : e.useEffect;
|
|
69
|
+
function k(t) {
|
|
70
|
+
let n = E(), { control: r = n, disabled: i, name: a, exact: o } = t || {}, [s, c] = e.useState(() => ({
|
|
65
71
|
...r._formState,
|
|
66
72
|
defaultValues: r._defaultValues
|
|
67
73
|
})), l = e.useRef({
|
|
@@ -74,7 +80,7 @@ function O(t) {
|
|
|
74
80
|
isValid: !1,
|
|
75
81
|
errors: !1
|
|
76
82
|
});
|
|
77
|
-
return
|
|
83
|
+
return O(() => r._subscribe({
|
|
78
84
|
name: a,
|
|
79
85
|
formState: l.current,
|
|
80
86
|
exact: o,
|
|
@@ -91,35 +97,42 @@ function O(t) {
|
|
|
91
97
|
o
|
|
92
98
|
]), e.useEffect(() => {
|
|
93
99
|
l.current.isValid && r._setValid(!0);
|
|
94
|
-
}, [r]), e.useMemo(() =>
|
|
100
|
+
}, [r]), e.useMemo(() => D(s, r, l.current, !1), [s, r]);
|
|
95
101
|
}
|
|
96
|
-
var
|
|
97
|
-
function
|
|
102
|
+
var A = (e) => typeof e == "string", j = (e, t, n, r, i) => A(e) ? (r && t.watch.add(e), x(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), x(n, e))) : (r && (t.watchAll = !0), n), M = (e) => r(e) || !i(e), N = (e, t) => t.length === 0 && !Array.isArray(e) && !c(e);
|
|
103
|
+
function P(e, t, r = /* @__PURE__ */ new WeakMap()) {
|
|
98
104
|
if (e === t) return !0;
|
|
99
|
-
if (
|
|
105
|
+
if (M(e) || M(t)) return Object.is(e, t);
|
|
100
106
|
if (n(e) && n(t)) return Object.is(e.getTime(), t.getTime());
|
|
101
107
|
let i = Object.keys(e), o = Object.keys(t);
|
|
102
108
|
if (i.length !== o.length) return !1;
|
|
103
|
-
if (
|
|
104
|
-
|
|
109
|
+
if (N(e, i) || N(t, o)) return Object.is(e, t);
|
|
110
|
+
if (!i.length && Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
111
|
+
let s = r.get(e);
|
|
112
|
+
if (s && s.has(t)) return !0;
|
|
113
|
+
if (s) s.add(t);
|
|
114
|
+
else {
|
|
115
|
+
let n = /* @__PURE__ */ new WeakSet();
|
|
116
|
+
n.add(t), r.set(e, n);
|
|
117
|
+
}
|
|
105
118
|
for (let o of i) {
|
|
106
119
|
let i = e[o];
|
|
107
120
|
if (!(o in t)) return !1;
|
|
108
121
|
if (o !== "ref") {
|
|
109
122
|
let e = t[o];
|
|
110
|
-
if (n(i) && n(e) || (a(i) || Array.isArray(i)) && (a(e) || Array.isArray(e)) ? !
|
|
123
|
+
if (n(i) && n(e) || (a(i) || Array.isArray(i)) && (a(e) || Array.isArray(e)) ? !P(i, e, r) : !Object.is(i, e)) return !1;
|
|
111
124
|
}
|
|
112
125
|
}
|
|
113
126
|
return !0;
|
|
114
127
|
}
|
|
115
|
-
function
|
|
116
|
-
let n =
|
|
128
|
+
function F(t) {
|
|
129
|
+
let n = E(), { control: r = n, name: i, defaultValue: a, disabled: o, exact: s, compute: c } = t || {}, l = e.useRef(a), u = e.useRef(c), d = e.useRef(void 0), f = e.useRef(r), p = e.useRef(i);
|
|
117
130
|
u.current = c;
|
|
118
131
|
let [m, h] = e.useState(() => {
|
|
119
132
|
let e = r._getWatch(i, l.current);
|
|
120
133
|
return u.current ? u.current(e) : e;
|
|
121
134
|
}), g = e.useCallback((e) => {
|
|
122
|
-
let t =
|
|
135
|
+
let t = j(i, r._names, e || r._formValues, !1, l.current);
|
|
123
136
|
return u.current ? u.current(t) : t;
|
|
124
137
|
}, [
|
|
125
138
|
r._formValues,
|
|
@@ -127,10 +140,10 @@ function N(t) {
|
|
|
127
140
|
i
|
|
128
141
|
]), _ = e.useCallback((e) => {
|
|
129
142
|
if (!o) {
|
|
130
|
-
let t =
|
|
143
|
+
let t = j(i, r._names, e || r._formValues, !1, l.current);
|
|
131
144
|
if (u.current) {
|
|
132
145
|
let e = u.current(t);
|
|
133
|
-
|
|
146
|
+
P(e, d.current) || (h(e), d.current = e);
|
|
134
147
|
} else h(t);
|
|
135
148
|
}
|
|
136
149
|
}, [
|
|
@@ -139,7 +152,7 @@ function N(t) {
|
|
|
139
152
|
o,
|
|
140
153
|
i
|
|
141
154
|
]);
|
|
142
|
-
|
|
155
|
+
O(() => ((f.current !== r || !P(p.current, i)) && (f.current = r, p.current = i, _()), r._subscribe({
|
|
143
156
|
name: i,
|
|
144
157
|
formState: { values: !0 },
|
|
145
158
|
exact: s,
|
|
@@ -154,7 +167,7 @@ function N(t) {
|
|
|
154
167
|
]), e.useEffect(() => r._removeUnmounted());
|
|
155
168
|
let v = f.current !== r, y = p.current, b = e.useMemo(() => {
|
|
156
169
|
if (o) return null;
|
|
157
|
-
let e = !v && !
|
|
170
|
+
let e = !v && !P(y, i);
|
|
158
171
|
return v || e ? g() : null;
|
|
159
172
|
}, [
|
|
160
173
|
o,
|
|
@@ -165,98 +178,109 @@ function N(t) {
|
|
|
165
178
|
]);
|
|
166
179
|
return b === null ? m : b;
|
|
167
180
|
}
|
|
168
|
-
function
|
|
169
|
-
let n =
|
|
181
|
+
function I(t) {
|
|
182
|
+
let n = E(), { name: r, disabled: i, control: a = n, shouldUnregister: c, defaultValue: l, exact: f = !0 } = t, p = s(a._names.array, r), m = F({
|
|
170
183
|
control: a,
|
|
171
184
|
name: r,
|
|
172
|
-
defaultValue: e.useMemo(() =>
|
|
185
|
+
defaultValue: e.useMemo(() => x(a._formValues, r, x(a._defaultValues, r, l)), [
|
|
173
186
|
a,
|
|
174
187
|
r,
|
|
175
188
|
l
|
|
176
189
|
]),
|
|
177
|
-
exact:
|
|
178
|
-
}),
|
|
190
|
+
exact: f
|
|
191
|
+
}), h = k({
|
|
179
192
|
control: a,
|
|
180
193
|
name: r,
|
|
181
|
-
exact:
|
|
182
|
-
}),
|
|
194
|
+
exact: f
|
|
195
|
+
}), g = e.useRef(t), _ = e.useRef(null), y = e.useRef(a.register(r, {
|
|
183
196
|
...t.rules,
|
|
184
197
|
value: m,
|
|
185
|
-
...
|
|
198
|
+
...S(t.disabled) ? { disabled: t.disabled } : {}
|
|
186
199
|
}));
|
|
187
|
-
|
|
188
|
-
let
|
|
200
|
+
g.current = t;
|
|
201
|
+
let b = e.useMemo(() => Object.defineProperties({}, {
|
|
189
202
|
invalid: {
|
|
190
203
|
enumerable: !0,
|
|
191
|
-
get: () => !!h
|
|
204
|
+
get: () => !!x(h.errors, r)
|
|
192
205
|
},
|
|
193
206
|
isDirty: {
|
|
194
207
|
enumerable: !0,
|
|
195
|
-
get: () => !!h
|
|
208
|
+
get: () => !!x(h.dirtyFields, r)
|
|
196
209
|
},
|
|
197
210
|
isTouched: {
|
|
198
211
|
enumerable: !0,
|
|
199
|
-
get: () => !!h
|
|
212
|
+
get: () => !!x(h.touchedFields, r)
|
|
200
213
|
},
|
|
201
214
|
isValidating: {
|
|
202
215
|
enumerable: !0,
|
|
203
|
-
get: () => !!h
|
|
216
|
+
get: () => !!x(h.validatingFields, r)
|
|
204
217
|
},
|
|
205
218
|
error: {
|
|
206
219
|
enumerable: !0,
|
|
207
|
-
get: () => h
|
|
220
|
+
get: () => x(h.errors, r)
|
|
208
221
|
}
|
|
209
|
-
}), [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
222
|
+
}), [h, r]), T = e.useCallback((e) => {
|
|
223
|
+
let t = o(e);
|
|
224
|
+
return x(a._fields, r) || (y.current = a.register(r, {
|
|
225
|
+
...g.current.rules,
|
|
226
|
+
value: t
|
|
227
|
+
})), y.current.onChange({
|
|
228
|
+
target: {
|
|
229
|
+
value: o(e),
|
|
230
|
+
name: r
|
|
231
|
+
},
|
|
232
|
+
type: d.CHANGE
|
|
233
|
+
});
|
|
234
|
+
}, [r, a]), D = e.useCallback(() => y.current.onBlur({
|
|
216
235
|
target: {
|
|
217
|
-
value:
|
|
236
|
+
value: x(a._formValues, r),
|
|
218
237
|
name: r
|
|
219
238
|
},
|
|
220
|
-
type:
|
|
221
|
-
}), [r, a._formValues]),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
reportValidity: () => _(e.reportValidity) && e.reportValidity()
|
|
239
|
+
type: d.BLUR
|
|
240
|
+
}), [r, a._formValues]), O = e.useCallback((e) => {
|
|
241
|
+
e && (_.current = {
|
|
242
|
+
focus: () => C(e.focus) && e.focus(),
|
|
243
|
+
select: () => C(e.select) && e.select(),
|
|
244
|
+
setCustomValidity: (t) => C(e.setCustomValidity) && e.setCustomValidity(t),
|
|
245
|
+
reportValidity: () => C(e.reportValidity) && e.reportValidity()
|
|
228
246
|
});
|
|
229
|
-
|
|
247
|
+
let t = x(a._fields, r);
|
|
248
|
+
t && t._f && e && (t._f.ref = _.current);
|
|
249
|
+
}, [a._fields, r]), A = e.useMemo(() => ({
|
|
230
250
|
name: r,
|
|
231
251
|
value: m,
|
|
232
|
-
...
|
|
233
|
-
onChange:
|
|
234
|
-
onBlur:
|
|
235
|
-
ref:
|
|
252
|
+
...S(i) || h.disabled ? { disabled: h.disabled || i } : {},
|
|
253
|
+
onChange: T,
|
|
254
|
+
onBlur: D,
|
|
255
|
+
ref: O
|
|
236
256
|
}), [
|
|
237
257
|
r,
|
|
238
258
|
i,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
E,
|
|
259
|
+
h.disabled,
|
|
260
|
+
T,
|
|
242
261
|
D,
|
|
262
|
+
O,
|
|
243
263
|
m
|
|
244
264
|
]);
|
|
245
265
|
return e.useEffect(() => {
|
|
246
266
|
let e = a._options.shouldUnregister || c;
|
|
247
267
|
a.register(r, {
|
|
248
|
-
...
|
|
249
|
-
...g
|
|
268
|
+
...g.current.rules,
|
|
269
|
+
...S(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
250
270
|
});
|
|
251
271
|
let t = (e, t) => {
|
|
252
|
-
let n =
|
|
272
|
+
let n = x(a._fields, e);
|
|
253
273
|
n && n._f && (n._f.mount = t);
|
|
254
274
|
};
|
|
255
275
|
if (t(r, !0), e) {
|
|
256
|
-
let e = u(
|
|
257
|
-
|
|
276
|
+
let e = u(x(c ? a._defaultValues : a._options.values || a._defaultValues, r, x(a._options.defaultValues, r, g.current.defaultValue)));
|
|
277
|
+
w(a._defaultValues, r, e), v(x(a._formValues, r)) && w(a._formValues, r, e);
|
|
278
|
+
}
|
|
279
|
+
if (!p && a.register(r), _.current) {
|
|
280
|
+
let e = x(a._fields, r);
|
|
281
|
+
e && e._f && (e._f.ref = _.current);
|
|
258
282
|
}
|
|
259
|
-
return
|
|
283
|
+
return () => {
|
|
260
284
|
(p ? e && !a._state.action : e) ? a.unregister(r) : t(r, !1);
|
|
261
285
|
};
|
|
262
286
|
}, [
|
|
@@ -274,24 +298,24 @@ function P(t) {
|
|
|
274
298
|
r,
|
|
275
299
|
a
|
|
276
300
|
]), e.useMemo(() => ({
|
|
277
|
-
field:
|
|
278
|
-
formState:
|
|
279
|
-
fieldState:
|
|
301
|
+
field: A,
|
|
302
|
+
formState: h,
|
|
303
|
+
fieldState: b
|
|
280
304
|
}), [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
305
|
+
A,
|
|
306
|
+
h,
|
|
307
|
+
b
|
|
284
308
|
]);
|
|
285
309
|
}
|
|
286
|
-
var
|
|
287
|
-
|
|
310
|
+
var L = (e) => e.render(I(e)), R = e.createContext(null);
|
|
311
|
+
R.displayName = "HookFormContext";
|
|
288
312
|
var ee = (e, t, n, r, i) => t ? {
|
|
289
313
|
...n[e],
|
|
290
314
|
types: {
|
|
291
315
|
...n[e] && n[e].types ? n[e].types : {},
|
|
292
316
|
[r]: i || !0
|
|
293
317
|
}
|
|
294
|
-
} : {},
|
|
318
|
+
} : {}, te = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ne = (e) => Array.isArray(e) ? e : [e], re = () => {
|
|
295
319
|
let e = [];
|
|
296
320
|
return {
|
|
297
321
|
get observers() {
|
|
@@ -308,23 +332,23 @@ var ee = (e, t, n, r, i) => t ? {
|
|
|
308
332
|
}
|
|
309
333
|
};
|
|
310
334
|
};
|
|
311
|
-
function
|
|
335
|
+
function ie(e, t) {
|
|
312
336
|
let n = {};
|
|
313
337
|
for (let r in e) if (e.hasOwnProperty(r)) {
|
|
314
338
|
let i = e[r], o = t[r];
|
|
315
339
|
if (i && a(i) && o) {
|
|
316
|
-
let e =
|
|
340
|
+
let e = ie(i, o);
|
|
317
341
|
a(e) && (n[r] = e);
|
|
318
342
|
} else e[r] && (n[r] = o);
|
|
319
343
|
}
|
|
320
344
|
return n;
|
|
321
345
|
}
|
|
322
|
-
var
|
|
346
|
+
var z = (e) => a(e) && !Object.keys(e).length, ae = (e) => e.type === "file", oe = (e) => {
|
|
323
347
|
if (!l) return !1;
|
|
324
348
|
let t = e ? e.ownerDocument : 0;
|
|
325
349
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
326
|
-
},
|
|
327
|
-
function
|
|
350
|
+
}, se = (e) => e.type === "select-multiple", ce = (e) => e.type === "radio", le = (e) => ce(e) || t(e), ue = (e) => oe(e) && e.isConnected;
|
|
351
|
+
function B(e, t) {
|
|
328
352
|
let n = t.slice(0, -1).length, i = 0;
|
|
329
353
|
for (; i < n;) {
|
|
330
354
|
if (r(e)) {
|
|
@@ -335,26 +359,26 @@ function V(e, t) {
|
|
|
335
359
|
}
|
|
336
360
|
return e;
|
|
337
361
|
}
|
|
338
|
-
function
|
|
339
|
-
for (let t in e) if (e.hasOwnProperty(t) && !
|
|
362
|
+
function V(e) {
|
|
363
|
+
for (let t in e) if (e.hasOwnProperty(t) && !v(e[t])) return !1;
|
|
340
364
|
return !0;
|
|
341
365
|
}
|
|
342
366
|
function H(e, t) {
|
|
343
|
-
if (
|
|
344
|
-
let n = Array.isArray(t) ? t :
|
|
345
|
-
return r && delete r[o], i !== 0 && (a(r) &&
|
|
367
|
+
if (A(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
368
|
+
let n = Array.isArray(t) ? t : _(t) ? [t] : b(t), r = n.length === 1 ? e : B(e, n), i = n.length - 1, o = n[i];
|
|
369
|
+
return r && delete r[o], i !== 0 && (a(r) && z(r) || Array.isArray(r) && V(r)) && H(e, n.slice(0, -1)), e;
|
|
346
370
|
}
|
|
347
|
-
var
|
|
348
|
-
for (let t in e) if (
|
|
371
|
+
var de = (e) => {
|
|
372
|
+
for (let t in e) if (C(e[t])) return !0;
|
|
349
373
|
return !1;
|
|
350
374
|
};
|
|
351
|
-
function
|
|
352
|
-
return Array.isArray(e) || a(e) && !
|
|
375
|
+
function fe(e) {
|
|
376
|
+
return Array.isArray(e) || a(e) && !de(e);
|
|
353
377
|
}
|
|
354
378
|
function U(e, t = {}) {
|
|
355
379
|
for (let n in e) {
|
|
356
380
|
let r = e[n];
|
|
357
|
-
|
|
381
|
+
fe(r) ? (t[n] = Array.isArray(r) ? [] : {}, U(r, t[n])) : v(r) || (t[n] = !0);
|
|
358
382
|
}
|
|
359
383
|
return t;
|
|
360
384
|
}
|
|
@@ -369,7 +393,7 @@ function W(e) {
|
|
|
369
393
|
let t = {};
|
|
370
394
|
for (let n in e) {
|
|
371
395
|
let r = W(e[n]);
|
|
372
|
-
|
|
396
|
+
v(r) || (t[n] = r);
|
|
373
397
|
}
|
|
374
398
|
return Object.keys(t).length ? t : void 0;
|
|
375
399
|
}
|
|
@@ -379,21 +403,21 @@ function G(e, t, n) {
|
|
|
379
403
|
n ||= U(t);
|
|
380
404
|
for (let i in e) {
|
|
381
405
|
let a = e[i];
|
|
382
|
-
if (
|
|
406
|
+
if (fe(a)) v(t) || M(n[i]) ? n[i] = U(a, Array.isArray(a) ? [] : {}) : G(a, r(t) ? {} : t[i], n[i]);
|
|
383
407
|
else {
|
|
384
408
|
let e = t[i];
|
|
385
|
-
n[i] = !
|
|
409
|
+
n[i] = !P(a, e);
|
|
386
410
|
}
|
|
387
411
|
}
|
|
388
412
|
return W(n) || {};
|
|
389
413
|
}
|
|
390
|
-
var
|
|
414
|
+
var pe = {
|
|
391
415
|
value: !1,
|
|
392
416
|
isValid: !1
|
|
393
|
-
},
|
|
417
|
+
}, me = {
|
|
394
418
|
value: !0,
|
|
395
419
|
isValid: !0
|
|
396
|
-
},
|
|
420
|
+
}, he = (e) => {
|
|
397
421
|
if (Array.isArray(e)) {
|
|
398
422
|
if (e.length > 1) {
|
|
399
423
|
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -402,28 +426,28 @@ var K = {
|
|
|
402
426
|
isValid: !!t.length
|
|
403
427
|
};
|
|
404
428
|
}
|
|
405
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !
|
|
429
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !v(e[0].attributes.value) ? v(e[0].value) || e[0].value === "" ? me : {
|
|
406
430
|
value: e[0].value,
|
|
407
431
|
isValid: !0
|
|
408
|
-
} :
|
|
432
|
+
} : me : pe;
|
|
409
433
|
}
|
|
410
|
-
return
|
|
411
|
-
},
|
|
434
|
+
return pe;
|
|
435
|
+
}, ge = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => v(e) ? e : t ? e === "" ? NaN : e && +e : n && A(e) ? new Date(e) : r ? r(e) : e, _e = {
|
|
412
436
|
isValid: !1,
|
|
413
437
|
value: null
|
|
414
|
-
},
|
|
438
|
+
}, K = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
415
439
|
isValid: !0,
|
|
416
440
|
value: t.value
|
|
417
|
-
} : e,
|
|
418
|
-
function
|
|
441
|
+
} : e, _e) : _e;
|
|
442
|
+
function ve(e) {
|
|
419
443
|
let n = e.ref;
|
|
420
|
-
return
|
|
444
|
+
return ae(n) ? n.files : ce(n) ? K(e.refs).value : se(n) ? [...n.selectedOptions].map(({ value: e }) => e) : t(n) ? he(e.refs).value : ge(v(n.value) ? e.ref.value : n.value, e);
|
|
421
445
|
}
|
|
422
|
-
var
|
|
446
|
+
var ye = (e, t, n, r) => {
|
|
423
447
|
let i = {};
|
|
424
448
|
for (let n of e) {
|
|
425
|
-
let e =
|
|
426
|
-
e &&
|
|
449
|
+
let e = x(t, n);
|
|
450
|
+
e && w(i, n, e._f);
|
|
427
451
|
}
|
|
428
452
|
return {
|
|
429
453
|
criteriaMode: n,
|
|
@@ -431,33 +455,45 @@ var he = (e, t, n, r) => {
|
|
|
431
455
|
fields: i,
|
|
432
456
|
shouldUseNativeValidation: r
|
|
433
457
|
};
|
|
434
|
-
},
|
|
435
|
-
isOnSubmit: !e || e ===
|
|
436
|
-
isOnBlur: e ===
|
|
437
|
-
isOnChange: e ===
|
|
438
|
-
isOnAll: e ===
|
|
439
|
-
isOnTouch: e ===
|
|
440
|
-
}),
|
|
458
|
+
}, q = (e) => e instanceof RegExp, J = (e) => v(e) ? e : q(e) ? e.source : a(e) ? q(e.value) ? e.value.source : e.value : e, be = (e) => ({
|
|
459
|
+
isOnSubmit: !e || e === f.onSubmit,
|
|
460
|
+
isOnBlur: e === f.onBlur,
|
|
461
|
+
isOnChange: e === f.onChange,
|
|
462
|
+
isOnAll: e === f.all,
|
|
463
|
+
isOnTouch: e === f.onTouched
|
|
464
|
+
}), xe = "AsyncFunction", Se = (e) => {
|
|
465
|
+
if (!e || !e.validate) return !1;
|
|
466
|
+
if (C(e.validate)) return e.validate.constructor.name === xe;
|
|
467
|
+
if (a(e.validate)) {
|
|
468
|
+
for (let t in e.validate) if (e.validate[t].constructor.name === xe) return !0;
|
|
469
|
+
}
|
|
470
|
+
return !1;
|
|
471
|
+
}, Ce = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), we = (e, t, n) => {
|
|
472
|
+
if (n) return !1;
|
|
473
|
+
if (t.watchAll || t.watch.has(e)) return !0;
|
|
474
|
+
for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
|
|
475
|
+
return !1;
|
|
476
|
+
}, Y = (e, t, n, r) => {
|
|
441
477
|
for (let i of n || Object.keys(e)) {
|
|
442
|
-
let n =
|
|
478
|
+
let n = x(e, i);
|
|
443
479
|
if (n) {
|
|
444
480
|
let { _f: e, ...o } = n;
|
|
445
481
|
if (e) {
|
|
446
482
|
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
447
|
-
if (
|
|
448
|
-
} else if (a(o) &&
|
|
483
|
+
if (Y(o, t)) break;
|
|
484
|
+
} else if (a(o) && Y(o, t)) break;
|
|
449
485
|
}
|
|
450
486
|
}
|
|
451
487
|
};
|
|
452
|
-
function
|
|
453
|
-
let r =
|
|
454
|
-
if (r ||
|
|
488
|
+
function Te(e, t, n) {
|
|
489
|
+
let r = x(e, n);
|
|
490
|
+
if (r || _(n)) return {
|
|
455
491
|
error: r,
|
|
456
492
|
name: n
|
|
457
493
|
};
|
|
458
494
|
let i = n.split(".");
|
|
459
495
|
for (; i.length;) {
|
|
460
|
-
let r = i.join("."), a =
|
|
496
|
+
let r = i.join("."), a = x(t, r), o = x(e, r);
|
|
461
497
|
if (a && !Array.isArray(a) && n !== r) return { name: n };
|
|
462
498
|
if (o && o.type) return {
|
|
463
499
|
name: r,
|
|
@@ -471,103 +507,106 @@ function xe(e, t, n) {
|
|
|
471
507
|
}
|
|
472
508
|
return { name: n };
|
|
473
509
|
}
|
|
474
|
-
var
|
|
510
|
+
var Ee = (e, t, n, r) => {
|
|
475
511
|
n(e);
|
|
476
|
-
let { name: i, ...a } = e;
|
|
477
|
-
return
|
|
478
|
-
},
|
|
479
|
-
let r =
|
|
480
|
-
return
|
|
512
|
+
let { name: i, ...a } = e, o = Object.keys(a);
|
|
513
|
+
return !o.length || r && o.length >= Object.keys(t).length || o.find((e) => t[e] === (!r || f.all));
|
|
514
|
+
}, De = (e, t, n) => !e || !t || e === t || ne(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), Oe = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, ke = (e, t) => !te(x(e, t)).length && H(e, t), Ae = (e, t, n) => {
|
|
515
|
+
let r = x(e, n), i = Array.isArray(r) ? r : [];
|
|
516
|
+
return w(i, m, t[n]), w(e, n, i), e;
|
|
481
517
|
};
|
|
482
|
-
function
|
|
483
|
-
if (
|
|
518
|
+
function X(e, t, n = "validate") {
|
|
519
|
+
if (A(e) || Array.isArray(e) && e.every(A) || S(e) && !e) return {
|
|
484
520
|
type: n,
|
|
485
|
-
message:
|
|
521
|
+
message: A(e) ? e : "",
|
|
486
522
|
ref: t
|
|
487
523
|
};
|
|
488
524
|
}
|
|
489
|
-
var
|
|
525
|
+
var Z = (e) => a(e) && !q(e) ? e : {
|
|
490
526
|
value: e,
|
|
491
527
|
message: ""
|
|
492
|
-
},
|
|
493
|
-
let { ref: l, refs: u, required: d, maxLength:
|
|
494
|
-
if (!T || n.has(
|
|
528
|
+
}, je = async (e, n, i, o, s, c) => {
|
|
529
|
+
let { ref: l, refs: u, required: d, maxLength: f, minLength: m, min: h, max: g, pattern: _, validate: y, name: b, valueAsNumber: w, mount: T } = e._f, E = x(i, b);
|
|
530
|
+
if (!T || n.has(b)) return {};
|
|
495
531
|
let D = u ? u[0] : l, O = (e) => {
|
|
496
|
-
s && D.reportValidity
|
|
497
|
-
|
|
532
|
+
if (s && D.reportValidity) {
|
|
533
|
+
let t = S(e) ? "" : e || "";
|
|
534
|
+
u ? u.forEach((e) => e.setCustomValidity(t)) : D.setCustomValidity(t), D.reportValidity();
|
|
535
|
+
}
|
|
536
|
+
}, k = {}, j = ce(l), M = t(l), N = j || M, P = (w || ae(l)) && v(l.value) && v(E) || oe(l) && l.value === "" || E === "" || Array.isArray(E) && !E.length, F = ee.bind(null, b, o, k), I = (e, t, n, r = p.maxLength, i = p.minLength) => {
|
|
498
537
|
let a = e ? t : n;
|
|
499
|
-
|
|
538
|
+
k[b] = {
|
|
500
539
|
type: e ? r : i,
|
|
501
540
|
message: a,
|
|
502
541
|
ref: l,
|
|
503
542
|
...F(e ? r : i, a)
|
|
504
543
|
};
|
|
505
544
|
};
|
|
506
|
-
if (c ? !Array.isArray(E) || !E.length : d && (!N && (P || r(E)) ||
|
|
507
|
-
let { value: e, message: t } =
|
|
545
|
+
if (c ? !Array.isArray(E) || !E.length : d && (!N && (P || r(E)) || S(E) && !E || M && !he(u).isValid || j && !K(u).isValid)) {
|
|
546
|
+
let { value: e, message: t } = A(d) ? {
|
|
508
547
|
value: !!d,
|
|
509
548
|
message: d
|
|
510
|
-
} :
|
|
511
|
-
if (e && (
|
|
512
|
-
type:
|
|
549
|
+
} : Z(d);
|
|
550
|
+
if (e && (k[b] = {
|
|
551
|
+
type: p.required,
|
|
513
552
|
message: t,
|
|
514
553
|
ref: D,
|
|
515
|
-
...F(
|
|
516
|
-
}, !o)) return O(t),
|
|
554
|
+
...F(p.required, t)
|
|
555
|
+
}, !o)) return O(t), k;
|
|
517
556
|
}
|
|
518
|
-
if (!P && (!r(
|
|
519
|
-
let e, t, n =
|
|
557
|
+
if (!P && (!r(h) || !r(g))) {
|
|
558
|
+
let e, t, n = Z(g), i = Z(h);
|
|
520
559
|
if (!r(E) && !isNaN(E)) {
|
|
521
560
|
let a = l.valueAsNumber || E && +E;
|
|
522
561
|
r(n.value) || (e = a > n.value), r(i.value) || (t = a < i.value);
|
|
523
562
|
} else {
|
|
524
563
|
let r = l.valueAsDate || new Date(E), a = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), o = l.type == "time", s = l.type == "week";
|
|
525
|
-
|
|
564
|
+
A(n.value) && E && (e = o ? a(E) > a(n.value) : s ? E > n.value : r > new Date(n.value)), A(i.value) && E && (t = o ? a(E) < a(i.value) : s ? E < i.value : r < new Date(i.value));
|
|
526
565
|
}
|
|
527
|
-
if ((e || t) && (I(!!e, n.message, i.message,
|
|
566
|
+
if ((e || t) && (I(!!e, n.message, i.message, p.max, p.min), !o)) return O(k[b].message), k;
|
|
528
567
|
}
|
|
529
|
-
if ((
|
|
530
|
-
let e =
|
|
531
|
-
if ((n || i) && (I(n, e.message, t.message), !o)) return O(
|
|
568
|
+
if ((f || m) && !P && (A(E) || c && Array.isArray(E))) {
|
|
569
|
+
let e = Z(f), t = Z(m), n = !r(e.value) && E.length > +e.value, i = !r(t.value) && E.length < +t.value;
|
|
570
|
+
if ((n || i) && (I(n, e.message, t.message), !o)) return O(k[b].message), k;
|
|
532
571
|
}
|
|
533
|
-
if (
|
|
534
|
-
let { value: e, message: t } =
|
|
535
|
-
if (
|
|
536
|
-
type:
|
|
572
|
+
if (_ && !P && A(E)) {
|
|
573
|
+
let { value: e, message: t } = Z(_);
|
|
574
|
+
if (q(e) && !E.match(e) && (k[b] = {
|
|
575
|
+
type: p.pattern,
|
|
537
576
|
message: t,
|
|
538
577
|
ref: l,
|
|
539
|
-
...F(
|
|
540
|
-
}, !o)) return O(t),
|
|
578
|
+
...F(p.pattern, t)
|
|
579
|
+
}, !o)) return O(t), k;
|
|
541
580
|
}
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
544
|
-
let e =
|
|
545
|
-
if (e && (
|
|
581
|
+
if (y) {
|
|
582
|
+
if (C(y)) {
|
|
583
|
+
let e = X(await y(E, i), D);
|
|
584
|
+
if (e && (k[b] = {
|
|
546
585
|
...e,
|
|
547
|
-
...F(
|
|
548
|
-
}, !o)) return O(e.message),
|
|
549
|
-
} else if (a(
|
|
586
|
+
...F(p.validate, e.message)
|
|
587
|
+
}, !o)) return O(e.message), k;
|
|
588
|
+
} else if (a(y)) {
|
|
550
589
|
let e = {};
|
|
551
|
-
for (let t in
|
|
552
|
-
if (!
|
|
553
|
-
let n =
|
|
590
|
+
for (let t in y) {
|
|
591
|
+
if (!z(e) && !o) break;
|
|
592
|
+
let n = X(await y[t](E, i), D, t);
|
|
554
593
|
n && (e = {
|
|
555
594
|
...n,
|
|
556
595
|
...F(t, n.message)
|
|
557
|
-
}, O(n.message), o && (
|
|
596
|
+
}, O(n.message), o && (k[b] = e));
|
|
558
597
|
}
|
|
559
|
-
if (!
|
|
598
|
+
if (!z(e) && (k[b] = {
|
|
560
599
|
ref: D,
|
|
561
600
|
...e
|
|
562
|
-
}, !o)) return
|
|
601
|
+
}, !o)) return k;
|
|
563
602
|
}
|
|
564
603
|
}
|
|
565
|
-
return O(!0),
|
|
566
|
-
},
|
|
567
|
-
mode:
|
|
568
|
-
reValidateMode:
|
|
604
|
+
return O(!0), k;
|
|
605
|
+
}, Me = {
|
|
606
|
+
mode: f.onSubmit,
|
|
607
|
+
reValidateMode: f.onChange,
|
|
569
608
|
shouldFocusError: !0
|
|
570
|
-
},
|
|
609
|
+
}, Ne = "form", Pe = {
|
|
571
610
|
submitCount: 0,
|
|
572
611
|
isDirty: !1,
|
|
573
612
|
isReady: !1,
|
|
@@ -580,16 +619,16 @@ var Q = (e) => a(e) && !J(e) ? e : {
|
|
|
580
619
|
dirtyFields: {},
|
|
581
620
|
validatingFields: {}
|
|
582
621
|
};
|
|
583
|
-
function
|
|
622
|
+
function Q(e = {}) {
|
|
584
623
|
let i = {
|
|
585
|
-
...
|
|
624
|
+
...Me,
|
|
586
625
|
...e
|
|
587
626
|
}, c = {
|
|
588
|
-
...u(
|
|
589
|
-
isLoading:
|
|
627
|
+
...u(Pe),
|
|
628
|
+
isLoading: C(i.defaultValues),
|
|
590
629
|
errors: i.errors || {},
|
|
591
630
|
disabled: i.disabled || !1
|
|
592
|
-
},
|
|
631
|
+
}, h = {}, g = (a(i.defaultValues) || a(i.values)) && u(i.defaultValues || i.values) || {}, y = i.shouldUnregister ? {} : u(g), T = {
|
|
593
632
|
action: !1,
|
|
594
633
|
mount: !1,
|
|
595
634
|
watch: !1,
|
|
@@ -601,7 +640,7 @@ function Ae(e = {}) {
|
|
|
601
640
|
array: /* @__PURE__ */ new Set(),
|
|
602
641
|
watch: /* @__PURE__ */ new Set(),
|
|
603
642
|
registerName: /* @__PURE__ */ new Set()
|
|
604
|
-
}, D, O = 0,
|
|
643
|
+
}, D, O = 0, k = 0, M = be(i.mode), N = be(i.reValidateMode), F = {
|
|
605
644
|
isDirty: !1,
|
|
606
645
|
dirtyFields: !1,
|
|
607
646
|
validatingFields: !1,
|
|
@@ -609,125 +648,137 @@ function Ae(e = {}) {
|
|
|
609
648
|
isValidating: !1,
|
|
610
649
|
isValid: !1,
|
|
611
650
|
errors: !1
|
|
612
|
-
},
|
|
613
|
-
array:
|
|
614
|
-
state:
|
|
615
|
-
},
|
|
651
|
+
}, I = { ...F }, L = { ...I }, R = {
|
|
652
|
+
array: re(),
|
|
653
|
+
state: re()
|
|
654
|
+
}, ee = i.criteriaMode === f.all, ce = (e) => (t) => {
|
|
616
655
|
clearTimeout(O), O = setTimeout(e, t);
|
|
617
656
|
}, B = async (e) => {
|
|
618
|
-
if (!T.keepIsValid && !i.disabled && (
|
|
657
|
+
if (!T.keepIsValid && !i.disabled && (I.isValid || L.isValid || e)) {
|
|
619
658
|
let e;
|
|
620
|
-
i.resolver ? (e =
|
|
621
|
-
fields:
|
|
659
|
+
i.resolver ? (e = z((await K()).errors), V()) : e = await X({
|
|
660
|
+
fields: h,
|
|
622
661
|
onlyCheckValid: !0,
|
|
623
|
-
eventType:
|
|
624
|
-
}), e !== c.isValid &&
|
|
662
|
+
eventType: d.VALID
|
|
663
|
+
}), e !== c.isValid && R.state.next({ isValid: e });
|
|
625
664
|
}
|
|
626
665
|
}, V = (e, t) => {
|
|
627
|
-
!i.disabled && (
|
|
628
|
-
e && (t ?
|
|
629
|
-
}),
|
|
666
|
+
!i.disabled && (I.isValidating || I.validatingFields || L.isValidating || L.validatingFields) && ((e || Array.from(E.mount)).forEach((e) => {
|
|
667
|
+
e && (t ? w(c.validatingFields, e, t) : H(c.validatingFields, e));
|
|
668
|
+
}), R.state.next({
|
|
630
669
|
validatingFields: c.validatingFields,
|
|
631
|
-
isValidating: !
|
|
670
|
+
isValidating: !z(c.validatingFields)
|
|
632
671
|
}));
|
|
633
|
-
},
|
|
634
|
-
c.dirtyFields = G(
|
|
635
|
-
},
|
|
672
|
+
}, de = () => {
|
|
673
|
+
c.dirtyFields = G(g, y);
|
|
674
|
+
}, fe = (e, t = [], n, r, a = !0, o = !0) => {
|
|
636
675
|
if (r && n && !i.disabled) {
|
|
637
|
-
if (T.action = !0, o && Array.isArray(h
|
|
638
|
-
let t = n(h
|
|
639
|
-
a &&
|
|
676
|
+
if (T.action = !0, o && Array.isArray(x(h, e))) {
|
|
677
|
+
let t = n(x(h, e), r.argA, r.argB);
|
|
678
|
+
a && w(h, e, t);
|
|
640
679
|
}
|
|
641
|
-
if (o && Array.isArray(
|
|
642
|
-
let t = n(
|
|
643
|
-
a &&
|
|
680
|
+
if (o && Array.isArray(x(c.errors, e))) {
|
|
681
|
+
let t = n(x(c.errors, e), r.argA, r.argB);
|
|
682
|
+
a && w(c.errors, e, t), ke(c.errors, e);
|
|
644
683
|
}
|
|
645
|
-
if ((
|
|
646
|
-
let t = n(
|
|
647
|
-
a &&
|
|
684
|
+
if ((I.touchedFields || L.touchedFields) && o && Array.isArray(x(c.touchedFields, e))) {
|
|
685
|
+
let t = n(x(c.touchedFields, e), r.argA, r.argB);
|
|
686
|
+
a && w(c.touchedFields, e, t);
|
|
648
687
|
}
|
|
649
|
-
(
|
|
688
|
+
(I.dirtyFields || L.dirtyFields) && de(), R.state.next({
|
|
650
689
|
name: e,
|
|
651
|
-
isDirty:
|
|
690
|
+
isDirty: Q(e, t),
|
|
652
691
|
dirtyFields: c.dirtyFields,
|
|
653
692
|
errors: c.errors,
|
|
654
693
|
isValid: c.isValid
|
|
655
694
|
});
|
|
656
|
-
} else
|
|
657
|
-
},
|
|
658
|
-
|
|
659
|
-
},
|
|
660
|
-
c.errors = e,
|
|
695
|
+
} else w(y, e, t);
|
|
696
|
+
}, U = (e, t) => {
|
|
697
|
+
w(c.errors, e, t), c.errors = { ...c.errors }, R.state.next({ errors: c.errors });
|
|
698
|
+
}, W = (e) => {
|
|
699
|
+
c.errors = e, R.state.next({
|
|
661
700
|
errors: c.errors,
|
|
662
701
|
isValid: !1
|
|
663
702
|
});
|
|
664
|
-
},
|
|
665
|
-
let
|
|
666
|
-
|
|
667
|
-
let a =
|
|
668
|
-
|
|
703
|
+
}, pe = (e) => {
|
|
704
|
+
let t = _(e) ? [e] : b(e), n = y, i = g;
|
|
705
|
+
for (let e = 0; e < t.length - 1; e++) {
|
|
706
|
+
let a = t[e];
|
|
707
|
+
if (n = r(n) ? n : n[a], i = r(i) ? i : i[a], n === null && i !== null) return !0;
|
|
708
|
+
}
|
|
709
|
+
return !1;
|
|
710
|
+
}, me = (t, n, r, i) => {
|
|
711
|
+
let a = x(h, t);
|
|
712
|
+
if (a) {
|
|
713
|
+
if (pe(t)) return;
|
|
714
|
+
let o = v(x(y, t)), s = x(y, t, v(r) ? x(g, t) : r);
|
|
715
|
+
v(s) || i && i.defaultChecked || n ? w(y, t, n ? s : ve(a._f)) : Le(t, s), T.mount && !T.action && (B(), o && c.isDirty && (I.isDirty || L.isDirty) && (Q() || (c.isDirty = !1, R.state.next({ ...c }))), e.shouldUnregister && o && !v(x(y, t)) && we(t, E) && (T.watch = !0));
|
|
669
716
|
}
|
|
670
|
-
},
|
|
717
|
+
}, he = (e, t, n, r, a) => {
|
|
671
718
|
let o = !1, s = !1, l = { name: e };
|
|
672
719
|
if (!i.disabled) {
|
|
673
720
|
if (!n || r) {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
s = !!h(c.dirtyFields, e), n ? H(c.dirtyFields, e) : v(c.dirtyFields, e, !0), l.dirtyFields = c.dirtyFields, o ||= (N.dirtyFields || P.dirtyFields) && s !== !n;
|
|
721
|
+
let n = P(x(g, e), t);
|
|
722
|
+
(I.isDirty || L.isDirty) && (s = c.isDirty, c.isDirty = l.isDirty = !n || Q(), o = s !== l.isDirty), s = !!x(c.dirtyFields, e), n === c.isDirty ? n ? H(c.dirtyFields, e) : w(c.dirtyFields, e, !0) : c.dirtyFields = G(g, y), l.dirtyFields = c.dirtyFields, o ||= (I.dirtyFields || L.dirtyFields) && s !== !n;
|
|
677
723
|
}
|
|
678
724
|
if (n) {
|
|
679
|
-
let t =
|
|
680
|
-
t || (
|
|
725
|
+
let t = x(c.touchedFields, e);
|
|
726
|
+
t || (w(c.touchedFields, e, n), l.touchedFields = c.touchedFields, o ||= (I.touchedFields || L.touchedFields) && t !== n);
|
|
681
727
|
}
|
|
682
|
-
o && a &&
|
|
728
|
+
o && a && R.state.next(l);
|
|
683
729
|
}
|
|
684
730
|
return o ? l : {};
|
|
685
|
-
},
|
|
686
|
-
let a =
|
|
687
|
-
if (i.delayError && n ? (D =
|
|
731
|
+
}, _e = (e, t, n, r) => {
|
|
732
|
+
let a = x(c.errors, e), o = (I.isValid || L.isValid) && S(t) && c.isValid !== t;
|
|
733
|
+
if (i.delayError && n ? (D = ce(() => U(e, n)), D(i.delayError)) : (clearTimeout(O), D = null, n ? w(c.errors, e, n) : H(c.errors, e), c.errors = { ...c.errors }), (n ? !P(a, n) : a) || !z(r) || o) {
|
|
688
734
|
let n = {
|
|
689
735
|
...r,
|
|
690
|
-
...o &&
|
|
736
|
+
...o && S(t) ? { isValid: t } : {},
|
|
691
737
|
errors: c.errors,
|
|
692
738
|
name: e
|
|
693
739
|
};
|
|
694
740
|
c = {
|
|
695
741
|
...c,
|
|
696
742
|
...n
|
|
697
|
-
},
|
|
698
|
-
}
|
|
699
|
-
}, q = async (e) => (V(e, !0), await i.resolver(w, i.context, he(e || E.mount, d, i.criteriaMode, i.shouldUseNativeValidation))), fe = async (e) => {
|
|
700
|
-
let { errors: t } = await q(e);
|
|
701
|
-
if (V(e), e) for (let n of e) {
|
|
702
|
-
let e = h(t, n);
|
|
703
|
-
e ? v(c.errors, n, e) : H(c.errors, n);
|
|
743
|
+
}, R.state.next(n);
|
|
704
744
|
}
|
|
705
|
-
|
|
745
|
+
}, K = async (e) => (V(e, !0), await i.resolver(y, i.context, ye(e || E.mount, h, i.criteriaMode, i.shouldUseNativeValidation))), q = async (e) => {
|
|
746
|
+
let { errors: t } = await K(e);
|
|
747
|
+
if (V(e), e) {
|
|
748
|
+
for (let n of e) {
|
|
749
|
+
let e = x(t, n);
|
|
750
|
+
e ? E.array.has(n) && a(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? Ae(c.errors, { [n]: e }, n) : w(c.errors, n, e) : H(c.errors, n);
|
|
751
|
+
}
|
|
752
|
+
c.errors = { ...c.errors };
|
|
753
|
+
} else c.errors = t;
|
|
706
754
|
return t;
|
|
707
|
-
},
|
|
755
|
+
}, xe = async ({ name: t, eventType: n }) => {
|
|
708
756
|
if (e.validate) {
|
|
709
757
|
let r = await e.validate({
|
|
710
|
-
formValues:
|
|
758
|
+
formValues: y,
|
|
711
759
|
formState: c,
|
|
712
760
|
name: t,
|
|
713
761
|
eventType: n
|
|
714
762
|
});
|
|
715
|
-
if (a(r)) for (let e in r)
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
763
|
+
if (a(r)) for (let e in r) {
|
|
764
|
+
let t = r[e];
|
|
765
|
+
t && qe(`${Ne}.${e}`, {
|
|
766
|
+
message: A(t.message) ? t.message : "",
|
|
767
|
+
type: t.type || p.validate
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
else A(r) || !r ? qe(Ne, {
|
|
720
771
|
message: r || "",
|
|
721
|
-
type:
|
|
722
|
-
}) :
|
|
772
|
+
type: p.validate
|
|
773
|
+
}) : Ke(Ne);
|
|
723
774
|
return r;
|
|
724
775
|
}
|
|
725
776
|
return !0;
|
|
726
|
-
},
|
|
777
|
+
}, X = async ({ fields: t, onlyCheckValid: n, name: r, eventType: a, context: o = {
|
|
727
778
|
valid: !0,
|
|
728
779
|
runRootValidation: !1
|
|
729
780
|
} }) => {
|
|
730
|
-
if (e.validate && (o.runRootValidation = !0, !await
|
|
781
|
+
if (e.validate && (o.runRootValidation = !0, !await xe({
|
|
731
782
|
name: r,
|
|
732
783
|
eventType: a
|
|
733
784
|
}) && (o.valid = !1, n))) return o.valid;
|
|
@@ -736,12 +787,12 @@ function Ae(e = {}) {
|
|
|
736
787
|
if (s) {
|
|
737
788
|
let { _f: t, ...l } = s;
|
|
738
789
|
if (t) {
|
|
739
|
-
let r = E.array.has(t.name), a = s._f &&
|
|
740
|
-
a &&
|
|
741
|
-
let
|
|
742
|
-
if (a &&
|
|
790
|
+
let r = E.array.has(t.name), a = s._f && Se(s._f), l = I.validatingFields || I.isValidating || L.validatingFields || L.isValidating;
|
|
791
|
+
a && l && V([t.name], !0);
|
|
792
|
+
let u = await je(s, E.disabled, y, ee, i.shouldUseNativeValidation && !n, r);
|
|
793
|
+
if (a && l && V([t.name]), u[t.name] && (o.valid = !1, n) || (!n && (x(u, t.name) ? r ? Ae(c.errors, u, t.name) : w(c.errors, t.name, u[t.name]) : H(c.errors, t.name)), e.shouldUseNativeValidation && u[t.name])) break;
|
|
743
794
|
}
|
|
744
|
-
!
|
|
795
|
+
!z(l) && await X({
|
|
745
796
|
context: o,
|
|
746
797
|
onlyCheckValid: n,
|
|
747
798
|
fields: l,
|
|
@@ -751,179 +802,205 @@ function Ae(e = {}) {
|
|
|
751
802
|
}
|
|
752
803
|
}
|
|
753
804
|
return o.valid;
|
|
754
|
-
},
|
|
805
|
+
}, Z = () => {
|
|
755
806
|
for (let e of E.unMount) {
|
|
756
|
-
let t = h
|
|
757
|
-
t && (t._f.refs ? t._f.refs.every((e) => !
|
|
807
|
+
let t = x(h, e);
|
|
808
|
+
t && (t._f.refs ? t._f.refs.every((e) => !ue(e)) : !ue(t._f.ref)) && Ze(e);
|
|
758
809
|
}
|
|
759
810
|
E.unMount = /* @__PURE__ */ new Set();
|
|
760
|
-
},
|
|
761
|
-
let
|
|
762
|
-
if (
|
|
763
|
-
let i =
|
|
764
|
-
i && (!i.disabled &&
|
|
765
|
-
(!e.defaultChecked || !e.disabled) && (Array.isArray(
|
|
766
|
-
}) : i.refs.forEach((e) => e.checked = e.value ===
|
|
811
|
+
}, Q = (e, t) => !i.disabled && (e && t && w(y, e, t), !P(T.mount ? y : g, g)), Fe = (e, t, n) => j(e, E, { ...T.mount ? y : v(t) ? g : A(e) ? { [e]: t } : t }, n, t), Ie = (e) => te(x(T.mount ? y : g, e, i.shouldUnregister ? x(g, e, []) : [])), Le = (e, n, i = {}, a = !1, o = !1) => {
|
|
812
|
+
let s = x(h, e), c = n;
|
|
813
|
+
if (s) {
|
|
814
|
+
let i = s._f;
|
|
815
|
+
i && (!i.disabled && w(y, e, ge(n, i)), c = oe(i.ref) && r(n) ? "" : n, se(i.ref) ? [...i.ref.options].forEach((e) => e.selected = c.includes(e.value)) : i.refs ? t(i.ref) ? i.refs.forEach((e) => {
|
|
816
|
+
(!e.defaultChecked || !e.disabled) && (Array.isArray(c) ? e.checked = !!c.find((t) => t === e.value) : e.checked = c === e.value || !!c);
|
|
817
|
+
}) : i.refs.forEach((e) => e.checked = e.value === c) : ae(i.ref) ? i.ref.value = "" : (i.ref.value = c, !i.ref.type && !o && R.state.next({
|
|
767
818
|
name: e,
|
|
768
|
-
values: u(
|
|
819
|
+
values: a ? y : u(y)
|
|
769
820
|
})));
|
|
770
821
|
}
|
|
771
|
-
(i.shouldDirty || i.shouldTouch) &&
|
|
772
|
-
},
|
|
773
|
-
for (let
|
|
774
|
-
if (!t.hasOwnProperty(
|
|
775
|
-
let
|
|
776
|
-
(E.array.has(e) || a(
|
|
822
|
+
(i.shouldDirty || i.shouldTouch) && he(e, c, i.shouldTouch, i.shouldDirty, !o), i.shouldValidate && Ue(e);
|
|
823
|
+
}, Re = (e, t, r, i = !1, o = !1) => {
|
|
824
|
+
for (let s in t) {
|
|
825
|
+
if (!t.hasOwnProperty(s)) return;
|
|
826
|
+
let c = t[s], l = e + "." + s, u = x(h, l);
|
|
827
|
+
(E.array.has(e) || a(c) || u && !u._f) && !n(c) ? Re(l, c, r, i, o) : Le(l, c, r, i, o);
|
|
777
828
|
}
|
|
778
|
-
},
|
|
779
|
-
let
|
|
780
|
-
if (
|
|
829
|
+
}, ze = (e, t, n, i, a = !1) => {
|
|
830
|
+
let o = x(h, e), s = E.array.has(e), l = i ? t : u(t), d = P(x(y, e), l);
|
|
831
|
+
if (d || w(y, e, l), s) R.array.next({
|
|
781
832
|
name: e,
|
|
782
|
-
values: u(
|
|
783
|
-
}), (
|
|
833
|
+
values: i ? y : u(y)
|
|
834
|
+
}), (I.isDirty || I.dirtyFields || L.isDirty || L.dirtyFields) && n.shouldDirty && (de(), a || R.state.next({
|
|
784
835
|
name: e,
|
|
785
836
|
dirtyFields: c.dirtyFields,
|
|
786
|
-
isDirty:
|
|
837
|
+
isDirty: Q(e, l)
|
|
787
838
|
}));
|
|
788
839
|
else {
|
|
789
|
-
let t = Array.isArray(
|
|
790
|
-
!
|
|
840
|
+
let t = Array.isArray(l) && !l.length || z(l);
|
|
841
|
+
!o || o._f || r(l) || t ? Le(e, l, n, i, a) : Re(e, l, n, i, a);
|
|
791
842
|
}
|
|
792
|
-
if (!
|
|
793
|
-
let t =
|
|
794
|
-
|
|
843
|
+
if (!d && !a) {
|
|
844
|
+
let t = we(e, E), n = i ? y : u(y);
|
|
845
|
+
R.state.next({
|
|
795
846
|
...t && c,
|
|
796
847
|
name: T.mount || t ? e : void 0,
|
|
797
|
-
values:
|
|
848
|
+
values: n
|
|
798
849
|
});
|
|
799
850
|
}
|
|
800
|
-
},
|
|
801
|
-
let
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
851
|
+
}, $ = (e, t, n = {}) => ze(e, t, n, !1), Be = (e, t = {}) => {
|
|
852
|
+
let n = C(e) ? e(y) : e;
|
|
853
|
+
if (!P(y, n)) {
|
|
854
|
+
y = {
|
|
855
|
+
...y,
|
|
856
|
+
...n
|
|
857
|
+
};
|
|
858
|
+
for (let e of E.mount) ze(e, x(n, e), t, !0, !0);
|
|
859
|
+
R.state.next({
|
|
860
|
+
...c,
|
|
861
|
+
name: void 0,
|
|
862
|
+
type: void 0,
|
|
863
|
+
...k ? { values: y } : {}
|
|
864
|
+
}), t.shouldValidate && B();
|
|
865
|
+
}
|
|
866
|
+
}, Ve = async (t) => {
|
|
810
867
|
T.mount = !0;
|
|
811
|
-
let r = t.target, a = r.name, s = !0, l = h
|
|
812
|
-
s = Number.isNaN(e) || n(e) && isNaN(e.getTime()) ||
|
|
813
|
-
}
|
|
868
|
+
let r = t.target, a = r.name, s = !0, l = x(h, a), f = (e) => {
|
|
869
|
+
s = Number.isNaN(e) || n(e) && isNaN(e.getTime()) || P(e, x(y, a, e));
|
|
870
|
+
};
|
|
814
871
|
if (l) {
|
|
815
|
-
let n,
|
|
816
|
-
|
|
817
|
-
let
|
|
818
|
-
if (!
|
|
872
|
+
let n, p, m = r.type ? ve(l._f) : o(t), g = t.type === d.BLUR || t.type === d.FOCUS_OUT, _ = !Ce(l._f) && !e.validate && !i.resolver && !x(c.errors, a) && !l._f.deps, v = _ || Oe(g, x(c.touchedFields, a), c.isSubmitted, N, M), b = we(a, E, g);
|
|
873
|
+
w(y, a, m), g ? (!r || !r.readOnly) && (l._f.onBlur && l._f.onBlur(t), D && D(0)) : l._f.onChange && l._f.onChange(t);
|
|
874
|
+
let S = he(a, m, g), C = !z(S) || b;
|
|
875
|
+
if (!g && R.state.next({
|
|
819
876
|
name: a,
|
|
820
877
|
type: t.type,
|
|
821
|
-
values: u(
|
|
822
|
-
}),
|
|
878
|
+
...k ? { values: u(y) } : {}
|
|
879
|
+
}), v) return (!_ || !c.isValid) && (I.isValid || L.isValid) && (i.mode === "onBlur" ? g && B() : g || B()), C && R.state.next({
|
|
823
880
|
name: a,
|
|
824
|
-
...
|
|
881
|
+
...b ? {} : S
|
|
825
882
|
});
|
|
826
|
-
if (!i.resolver && e.validate && await
|
|
883
|
+
if (!i.resolver && e.validate && await xe({
|
|
827
884
|
name: a,
|
|
828
885
|
eventType: t.type
|
|
829
|
-
}), !
|
|
830
|
-
let { errors: e } = await
|
|
831
|
-
if (V([a]), f(
|
|
832
|
-
|
|
833
|
-
|
|
886
|
+
}), !g && b && R.state.next({ ...c }), i.resolver) {
|
|
887
|
+
let { errors: e } = await K([a]);
|
|
888
|
+
if (V([a]), f(m), !s) {
|
|
889
|
+
!z(S) && R.state.next(S);
|
|
890
|
+
return;
|
|
834
891
|
}
|
|
835
|
-
|
|
836
|
-
|
|
892
|
+
let t = Te(c.errors, h, a), r = Te(e, h, t.name || a);
|
|
893
|
+
n = r.error, a = r.name, p = z(e);
|
|
894
|
+
} else V([a], !0), n = (await je(l, E.disabled, y, ee, i.shouldUseNativeValidation))[a], V([a]), f(m), s && (n ? p = !1 : (I.isValid || L.isValid) && (p = await X({
|
|
895
|
+
fields: h,
|
|
837
896
|
onlyCheckValid: !0,
|
|
838
897
|
name: a,
|
|
839
898
|
eventType: t.type
|
|
840
899
|
})));
|
|
841
|
-
s && (l._f.deps && (!Array.isArray(l._f.deps) || l._f.deps.length > 0) &&
|
|
900
|
+
s && (l._f.deps && (!Array.isArray(l._f.deps) || l._f.deps.length > 0) && Ue(l._f.deps), _e(a, p, n, S));
|
|
842
901
|
}
|
|
843
|
-
},
|
|
844
|
-
if (
|
|
845
|
-
},
|
|
846
|
-
let n, r, a =
|
|
902
|
+
}, He = (e, t) => {
|
|
903
|
+
if (x(c.errors, t) && e.focus) return e.focus(), 1;
|
|
904
|
+
}, Ue = async (e, t = {}) => {
|
|
905
|
+
let n, r, a = ne(e);
|
|
847
906
|
if (i.resolver) {
|
|
848
|
-
let t = await
|
|
849
|
-
n =
|
|
907
|
+
let t = await q(v(e) ? e : a);
|
|
908
|
+
n = z(t), r = e ? !a.some((e) => x(t, e)) : n;
|
|
850
909
|
} else e ? (r = (await Promise.all(a.map(async (e) => {
|
|
851
|
-
let t = h
|
|
852
|
-
return await
|
|
910
|
+
let t = x(h, e);
|
|
911
|
+
return await X({
|
|
853
912
|
fields: t && t._f ? { [e]: t } : t,
|
|
854
|
-
eventType:
|
|
913
|
+
eventType: d.TRIGGER
|
|
855
914
|
});
|
|
856
|
-
}))).every(Boolean), !(!r && !c.isValid) && B()) : r = n = await
|
|
857
|
-
fields:
|
|
915
|
+
}))).every(Boolean), !(!r && !c.isValid) && B()) : r = n = await X({
|
|
916
|
+
fields: h,
|
|
858
917
|
name: e,
|
|
859
|
-
eventType:
|
|
918
|
+
eventType: d.TRIGGER
|
|
860
919
|
});
|
|
861
|
-
return
|
|
862
|
-
...!
|
|
920
|
+
return R.state.next({
|
|
921
|
+
...!A(e) || (I.isValid || L.isValid) && n !== c.isValid ? {} : { name: e },
|
|
863
922
|
...i.resolver || !e ? { isValid: n } : {},
|
|
864
923
|
errors: c.errors
|
|
865
|
-
}), t.shouldFocus && !r &&
|
|
866
|
-
},
|
|
867
|
-
let n = { ...T.mount ?
|
|
868
|
-
return t && (n =
|
|
869
|
-
},
|
|
870
|
-
invalid: !!
|
|
871
|
-
isDirty: !!
|
|
872
|
-
error:
|
|
873
|
-
isValidating: !!
|
|
874
|
-
isTouched: !!
|
|
875
|
-
}),
|
|
876
|
-
let t = e ?
|
|
924
|
+
}), t.shouldFocus && !r && Y(h, He, e ? a : E.mount), r;
|
|
925
|
+
}, We = (e, t) => {
|
|
926
|
+
let n = { ...T.mount ? y : g };
|
|
927
|
+
return t && (n = ie(t.dirtyFields ? c.dirtyFields : c.touchedFields, n)), v(e) ? n : A(e) ? x(n, e) : e.map((e) => x(n, e));
|
|
928
|
+
}, Ge = (e, t) => ({
|
|
929
|
+
invalid: !!x((t || c).errors, e),
|
|
930
|
+
isDirty: !!x((t || c).dirtyFields, e),
|
|
931
|
+
error: x((t || c).errors, e),
|
|
932
|
+
isValidating: !!x(c.validatingFields, e),
|
|
933
|
+
isTouched: !!x((t || c).touchedFields, e)
|
|
934
|
+
}), Ke = (e) => {
|
|
935
|
+
let t = e ? ne(e) : void 0;
|
|
877
936
|
t?.forEach((e) => H(c.errors, e)), t ? t.forEach((e) => {
|
|
878
|
-
|
|
937
|
+
R.state.next({
|
|
879
938
|
name: e,
|
|
880
939
|
errors: c.errors
|
|
881
940
|
});
|
|
882
|
-
}) :
|
|
883
|
-
},
|
|
884
|
-
let r = (h
|
|
885
|
-
|
|
941
|
+
}) : R.state.next({ errors: {} });
|
|
942
|
+
}, qe = (e, t, n) => {
|
|
943
|
+
let r = (x(h, e, { _f: {} })._f || {}).ref, { ref: i, message: a, type: o, ...s } = x(c.errors, e) || {};
|
|
944
|
+
w(c.errors, e, {
|
|
886
945
|
...s,
|
|
887
946
|
...t,
|
|
888
947
|
ref: r
|
|
889
|
-
}),
|
|
948
|
+
}), R.state.next({
|
|
890
949
|
name: e,
|
|
891
950
|
errors: c.errors,
|
|
892
951
|
isValid: !1
|
|
893
952
|
}), n && n.shouldFocus && r && r.focus && r.focus();
|
|
894
|
-
},
|
|
895
|
-
if (
|
|
896
|
-
|
|
897
|
-
e.
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
defaultValues: m
|
|
902
|
-
});
|
|
953
|
+
}, Je = (e, t) => {
|
|
954
|
+
if (C(e)) {
|
|
955
|
+
k++;
|
|
956
|
+
let { unsubscribe: n } = R.state.subscribe({ next: (n) => "values" in n && e(n.values || Fe(void 0, t), n) }), r = !1;
|
|
957
|
+
return { unsubscribe: () => {
|
|
958
|
+
r || (r = !0, k--, n());
|
|
959
|
+
} };
|
|
903
960
|
}
|
|
904
|
-
|
|
905
|
-
|
|
961
|
+
return Fe(e, t, !0);
|
|
962
|
+
}, Ye = (e) => {
|
|
963
|
+
let t = !!e.formState?.values;
|
|
964
|
+
t && k++;
|
|
965
|
+
let { unsubscribe: n } = R.state.subscribe({ next: (t) => {
|
|
966
|
+
if (De(e.name, t.name, e.exact) && Ee(t, e.formState || I, st, e.reRenderRoot)) {
|
|
967
|
+
let n = { ...y };
|
|
968
|
+
e.callback({
|
|
969
|
+
values: n,
|
|
970
|
+
...c,
|
|
971
|
+
...t,
|
|
972
|
+
defaultValues: g
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
} });
|
|
976
|
+
if (!t) return n;
|
|
977
|
+
let r = !1;
|
|
978
|
+
return () => {
|
|
979
|
+
r || (r = !0, k--, n());
|
|
980
|
+
};
|
|
981
|
+
}, Xe = (e) => (T.mount = !0, L = {
|
|
982
|
+
...L,
|
|
906
983
|
...e.formState
|
|
907
|
-
},
|
|
984
|
+
}, Ye({
|
|
908
985
|
...e,
|
|
909
986
|
formState: {
|
|
910
|
-
...
|
|
987
|
+
...F,
|
|
911
988
|
...e.formState
|
|
912
989
|
}
|
|
913
|
-
})),
|
|
914
|
-
for (let n of e ?
|
|
915
|
-
|
|
990
|
+
})), Ze = (e, t = {}) => {
|
|
991
|
+
for (let n of e ? ne(e) : E.mount) E.mount.delete(n), E.array.delete(n), t.keepValue || (H(h, n), H(y, n)), !t.keepError && H(c.errors, n), !t.keepDirty && H(c.dirtyFields, n), !t.keepTouched && H(c.touchedFields, n), !t.keepIsValidating && H(c.validatingFields, n), !i.shouldUnregister && !t.keepDefaultValue && H(g, n);
|
|
992
|
+
R.state.next({ values: u(y) }), R.state.next({
|
|
916
993
|
...c,
|
|
917
|
-
...t.keepDirty ? { isDirty:
|
|
994
|
+
...t.keepDirty ? { isDirty: Q() } : {}
|
|
918
995
|
}), !t.keepIsValid && B();
|
|
919
|
-
},
|
|
920
|
-
if (
|
|
996
|
+
}, Qe = ({ disabled: e, name: t }) => {
|
|
997
|
+
if (S(e) && T.mount || e || E.disabled.has(t)) {
|
|
921
998
|
let n = E.disabled.has(t) !== !!e;
|
|
922
999
|
e ? E.disabled.add(t) : E.disabled.delete(t), n && T.mount && !T.action && B();
|
|
923
1000
|
}
|
|
924
|
-
},
|
|
925
|
-
let n = h
|
|
926
|
-
return
|
|
1001
|
+
}, $e = (e, t = {}) => {
|
|
1002
|
+
let n = x(h, e), r = S(t.disabled) || S(i.disabled), a = !E.registerName.has(e) && n && n._f && !n._f.mount;
|
|
1003
|
+
return w(h, e, {
|
|
927
1004
|
...n || {},
|
|
928
1005
|
_f: {
|
|
929
1006
|
...n && n._f ? n._f : { ref: { name: e } },
|
|
@@ -931,95 +1008,95 @@ function Ae(e = {}) {
|
|
|
931
1008
|
mount: !0,
|
|
932
1009
|
...t
|
|
933
1010
|
}
|
|
934
|
-
}), E.mount.add(e), n && !a ?
|
|
935
|
-
disabled:
|
|
1011
|
+
}), E.mount.add(e), n && !a ? Qe({
|
|
1012
|
+
disabled: S(t.disabled) ? t.disabled : i.disabled,
|
|
936
1013
|
name: e
|
|
937
|
-
}) :
|
|
1014
|
+
}) : me(e, !0, t.value), {
|
|
938
1015
|
...r ? { disabled: t.disabled || i.disabled } : {},
|
|
939
1016
|
...i.progressive ? {
|
|
940
1017
|
required: !!t.required,
|
|
941
|
-
min:
|
|
942
|
-
max:
|
|
943
|
-
minLength:
|
|
944
|
-
maxLength:
|
|
945
|
-
pattern:
|
|
1018
|
+
min: J(t.min),
|
|
1019
|
+
max: J(t.max),
|
|
1020
|
+
minLength: J(t.minLength),
|
|
1021
|
+
maxLength: J(t.maxLength),
|
|
1022
|
+
pattern: J(t.pattern)
|
|
946
1023
|
} : {},
|
|
947
1024
|
name: e,
|
|
948
|
-
onChange:
|
|
949
|
-
onBlur:
|
|
1025
|
+
onChange: Ve,
|
|
1026
|
+
onBlur: Ve,
|
|
950
1027
|
ref: (r) => {
|
|
951
1028
|
if (r) {
|
|
952
|
-
E.registerName.add(e),
|
|
953
|
-
let i =
|
|
1029
|
+
E.registerName.add(e), $e(e, t), E.registerName.delete(e), n = x(h, e);
|
|
1030
|
+
let i = v(r.value) && r.querySelectorAll && r.querySelectorAll("input,select,textarea")[0] || r, a = le(i), o = n._f.refs || [];
|
|
954
1031
|
if (a ? o.find((e) => e === i) : i === n._f.ref) return;
|
|
955
|
-
|
|
1032
|
+
w(h, e, { _f: {
|
|
956
1033
|
...n._f,
|
|
957
1034
|
...a ? {
|
|
958
1035
|
refs: [
|
|
959
|
-
...o.filter(
|
|
1036
|
+
...o.filter(ue),
|
|
960
1037
|
i,
|
|
961
|
-
...Array.isArray(
|
|
1038
|
+
...Array.isArray(x(g, e)) ? [{}] : []
|
|
962
1039
|
],
|
|
963
1040
|
ref: {
|
|
964
1041
|
type: i.type,
|
|
965
1042
|
name: e
|
|
966
1043
|
}
|
|
967
1044
|
} : { ref: i }
|
|
968
|
-
} }),
|
|
969
|
-
} else n = h
|
|
1045
|
+
} }), me(e, !1, void 0, i);
|
|
1046
|
+
} else n = x(h, e, {}), n._f && (n._f.mount = !1), (i.shouldUnregister || t.shouldUnregister) && !(s(E.array, e) && T.action) && E.unMount.add(e);
|
|
970
1047
|
}
|
|
971
1048
|
};
|
|
972
|
-
},
|
|
973
|
-
|
|
974
|
-
let r = h
|
|
1049
|
+
}, et = () => i.shouldFocusError && !i.shouldUseNativeValidation && Y(h, He, E.mount), tt = (e) => {
|
|
1050
|
+
S(e) && (R.state.next({ disabled: e }), Y(h, (t, n) => {
|
|
1051
|
+
let r = x(h, n);
|
|
975
1052
|
r && (t.disabled = r._f.disabled || e, Array.isArray(r._f.refs) && r._f.refs.forEach((t) => {
|
|
976
1053
|
t.disabled = r._f.disabled || e;
|
|
977
1054
|
}));
|
|
978
1055
|
}, 0, !1));
|
|
979
|
-
},
|
|
1056
|
+
}, nt = (e, t) => async (n) => {
|
|
980
1057
|
let r;
|
|
981
1058
|
n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
|
|
982
|
-
let a = u(
|
|
983
|
-
if (
|
|
984
|
-
let { errors: e, values: t } = await
|
|
1059
|
+
let a = u(y);
|
|
1060
|
+
if (R.state.next({ isSubmitting: !0 }), i.resolver) {
|
|
1061
|
+
let { errors: e, values: t } = await K();
|
|
985
1062
|
V(), c.errors = e, a = u(t);
|
|
986
|
-
} else await
|
|
987
|
-
fields:
|
|
988
|
-
eventType:
|
|
1063
|
+
} else await X({
|
|
1064
|
+
fields: h,
|
|
1065
|
+
eventType: d.SUBMIT
|
|
989
1066
|
});
|
|
990
1067
|
if (E.disabled.size) for (let e of E.disabled) H(a, e);
|
|
991
|
-
if (H(c.errors,
|
|
992
|
-
|
|
1068
|
+
if (H(c.errors, m), z(c.errors)) {
|
|
1069
|
+
R.state.next({ errors: {} });
|
|
993
1070
|
try {
|
|
994
1071
|
await e(a, n);
|
|
995
1072
|
} catch (e) {
|
|
996
1073
|
r = e;
|
|
997
1074
|
}
|
|
998
|
-
} else t && await t({ ...c.errors }, n),
|
|
999
|
-
if (
|
|
1075
|
+
} else t && await t({ ...c.errors }, n), et(), setTimeout(et);
|
|
1076
|
+
if (R.state.next({
|
|
1000
1077
|
isSubmitted: !0,
|
|
1001
1078
|
isSubmitting: !1,
|
|
1002
|
-
isSubmitSuccessful:
|
|
1079
|
+
isSubmitSuccessful: z(c.errors) && !r,
|
|
1003
1080
|
submitCount: c.submitCount + 1,
|
|
1004
1081
|
errors: c.errors
|
|
1005
1082
|
}), r) throw r;
|
|
1006
|
-
},
|
|
1007
|
-
h
|
|
1008
|
-
},
|
|
1009
|
-
let n = e ? u(e) :
|
|
1010
|
-
if (t.keepDefaultValues || (
|
|
1083
|
+
}, rt = (e, t = {}) => {
|
|
1084
|
+
x(h, e) && (v(t.defaultValue) ? $(e, u(x(g, e))) : ($(e, t.defaultValue), w(g, e, u(t.defaultValue))), t.keepTouched || H(c.touchedFields, e), t.keepDirty || (H(c.dirtyFields, e), c.isDirty = t.defaultValue ? Q(e, u(x(g, e))) : Q()), t.keepError || (H(c.errors, e), I.isValid && B()), R.state.next({ ...c }));
|
|
1085
|
+
}, it = (e, t = {}) => {
|
|
1086
|
+
let n = e ? u(e) : g, r = u(n), a = z(e), o = r;
|
|
1087
|
+
if (t.keepDefaultValues || (g = n), !t.keepValues) {
|
|
1011
1088
|
if (t.keepDirtyValues) {
|
|
1012
|
-
let e = new Set([...E.mount, ...Object.keys(G(
|
|
1089
|
+
let e = new Set([...E.mount, ...Object.keys(G(g, y))]);
|
|
1013
1090
|
for (let t of Array.from(e)) {
|
|
1014
|
-
let e =
|
|
1015
|
-
e && !
|
|
1091
|
+
let e = x(c.dirtyFields, t), n = x(y, t), r = x(o, t);
|
|
1092
|
+
e && !v(n) ? w(o, t, n) : !e && !v(r) && $(t, r);
|
|
1016
1093
|
}
|
|
1017
1094
|
} else {
|
|
1018
|
-
if (l &&
|
|
1019
|
-
let t = h
|
|
1095
|
+
if (l && v(e)) for (let e of E.mount) {
|
|
1096
|
+
let t = x(h, e);
|
|
1020
1097
|
if (t && t._f) {
|
|
1021
1098
|
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
1022
|
-
if (
|
|
1099
|
+
if (oe(e)) {
|
|
1023
1100
|
let t = e.closest("form");
|
|
1024
1101
|
if (t) {
|
|
1025
1102
|
t.reset();
|
|
@@ -1028,10 +1105,13 @@ function Ae(e = {}) {
|
|
|
1028
1105
|
}
|
|
1029
1106
|
}
|
|
1030
1107
|
}
|
|
1031
|
-
if (t.keepFieldsRef) for (let e of E.mount) $(e,
|
|
1032
|
-
else
|
|
1108
|
+
if (t.keepFieldsRef) for (let e of E.mount) $(e, x(o, e));
|
|
1109
|
+
else h = {};
|
|
1033
1110
|
}
|
|
1034
|
-
|
|
1111
|
+
if (i.shouldUnregister) {
|
|
1112
|
+
if (y = t.keepDefaultValues ? u(g) : {}, t.keepFieldsRef) for (let e of E.mount) w(y, e, x(o, e));
|
|
1113
|
+
} else y = u(o);
|
|
1114
|
+
R.array.next({ values: { ...o } }), R.state.next({ values: { ...o } });
|
|
1035
1115
|
}
|
|
1036
1116
|
E = {
|
|
1037
1117
|
mount: t.keepDirtyValues ? E.mount : /* @__PURE__ */ new Set(),
|
|
@@ -1042,64 +1122,64 @@ function Ae(e = {}) {
|
|
|
1042
1122
|
watch: /* @__PURE__ */ new Set(),
|
|
1043
1123
|
watchAll: !1,
|
|
1044
1124
|
focus: ""
|
|
1045
|
-
}, T.mount = !
|
|
1125
|
+
}, T.mount = !I.isValid || !!t.keepIsValid || !!t.keepDirtyValues || !i.shouldUnregister && !z(o), T.watch = !!i.shouldUnregister, T.keepIsValid = !!t.keepIsValid, T.action = !1, t.keepErrors || (c.errors = {}), R.state.next({
|
|
1046
1126
|
submitCount: t.keepSubmitCount ? c.submitCount : 0,
|
|
1047
|
-
isDirty: a ? !1 : t.keepDirty ? c.isDirty : !!(t.keepDefaultValues && !
|
|
1127
|
+
isDirty: a ? !1 : t.keepDirty ? c.isDirty : t.keepValues ? Q() : !!(t.keepDefaultValues && !P(e, g)),
|
|
1048
1128
|
isSubmitted: t.keepIsSubmitted ? c.isSubmitted : !1,
|
|
1049
|
-
dirtyFields: a ? {} : t.keepDirtyValues ? t.keepDefaultValues &&
|
|
1129
|
+
dirtyFields: a ? {} : t.keepDirtyValues ? t.keepDefaultValues && y ? G(g, y) : c.dirtyFields : t.keepDefaultValues && e ? G(g, e) : t.keepDirty ? c.dirtyFields : {},
|
|
1050
1130
|
touchedFields: t.keepTouched ? c.touchedFields : {},
|
|
1051
1131
|
errors: t.keepErrors ? c.errors : {},
|
|
1052
1132
|
isSubmitSuccessful: t.keepIsSubmitSuccessful ? c.isSubmitSuccessful : !1,
|
|
1053
1133
|
isSubmitting: !1,
|
|
1054
|
-
defaultValues:
|
|
1134
|
+
defaultValues: g
|
|
1055
1135
|
});
|
|
1056
|
-
},
|
|
1136
|
+
}, at = (e, t) => it(C(e) ? e(y) : e, {
|
|
1057
1137
|
...i.resetOptions,
|
|
1058
1138
|
...t
|
|
1059
|
-
}),
|
|
1060
|
-
let n = h
|
|
1139
|
+
}), ot = (e, t = {}) => {
|
|
1140
|
+
let n = x(h, e), r = n && n._f;
|
|
1061
1141
|
if (r) {
|
|
1062
1142
|
let e = r.refs ? r.refs[0] : r.ref;
|
|
1063
1143
|
e.focus && setTimeout(() => {
|
|
1064
|
-
e.focus(), t.shouldSelect &&
|
|
1144
|
+
e.focus(), t.shouldSelect && C(e.select) && e.select();
|
|
1065
1145
|
});
|
|
1066
1146
|
}
|
|
1067
|
-
},
|
|
1147
|
+
}, st = (e) => {
|
|
1068
1148
|
c = {
|
|
1069
1149
|
...c,
|
|
1070
1150
|
...e
|
|
1071
1151
|
};
|
|
1072
|
-
},
|
|
1152
|
+
}, ct = {
|
|
1073
1153
|
control: {
|
|
1074
|
-
register:
|
|
1075
|
-
unregister:
|
|
1076
|
-
getFieldState:
|
|
1077
|
-
handleSubmit:
|
|
1078
|
-
setError:
|
|
1079
|
-
_subscribe:
|
|
1080
|
-
_runSchema:
|
|
1154
|
+
register: $e,
|
|
1155
|
+
unregister: Ze,
|
|
1156
|
+
getFieldState: Ge,
|
|
1157
|
+
handleSubmit: nt,
|
|
1158
|
+
setError: qe,
|
|
1159
|
+
_subscribe: Ye,
|
|
1160
|
+
_runSchema: K,
|
|
1081
1161
|
_updateIsValidating: V,
|
|
1082
|
-
_focusError:
|
|
1083
|
-
_getWatch:
|
|
1084
|
-
_getDirty:
|
|
1162
|
+
_focusError: et,
|
|
1163
|
+
_getWatch: Fe,
|
|
1164
|
+
_getDirty: Q,
|
|
1085
1165
|
_setValid: B,
|
|
1086
|
-
_setFieldArray:
|
|
1087
|
-
_setDisabledField:
|
|
1088
|
-
_setErrors:
|
|
1089
|
-
_getFieldArray:
|
|
1090
|
-
_reset:
|
|
1091
|
-
_resetDefaultValues: () =>
|
|
1092
|
-
|
|
1166
|
+
_setFieldArray: fe,
|
|
1167
|
+
_setDisabledField: Qe,
|
|
1168
|
+
_setErrors: W,
|
|
1169
|
+
_getFieldArray: Ie,
|
|
1170
|
+
_reset: it,
|
|
1171
|
+
_resetDefaultValues: () => C(i.defaultValues) && i.defaultValues().then((e) => {
|
|
1172
|
+
at(e, i.resetOptions), R.state.next({ isLoading: !1 });
|
|
1093
1173
|
}),
|
|
1094
|
-
_removeUnmounted:
|
|
1095
|
-
_disableForm:
|
|
1096
|
-
_subjects:
|
|
1097
|
-
_proxyFormState:
|
|
1174
|
+
_removeUnmounted: Z,
|
|
1175
|
+
_disableForm: tt,
|
|
1176
|
+
_subjects: R,
|
|
1177
|
+
_proxyFormState: I,
|
|
1098
1178
|
get _fields() {
|
|
1099
|
-
return
|
|
1179
|
+
return h;
|
|
1100
1180
|
},
|
|
1101
1181
|
get _formValues() {
|
|
1102
|
-
return
|
|
1182
|
+
return y;
|
|
1103
1183
|
},
|
|
1104
1184
|
get _state() {
|
|
1105
1185
|
return T;
|
|
@@ -1108,7 +1188,7 @@ function Ae(e = {}) {
|
|
|
1108
1188
|
T = e;
|
|
1109
1189
|
},
|
|
1110
1190
|
get _defaultValues() {
|
|
1111
|
-
return
|
|
1191
|
+
return g;
|
|
1112
1192
|
},
|
|
1113
1193
|
get _names() {
|
|
1114
1194
|
return E;
|
|
@@ -1126,85 +1206,98 @@ function Ae(e = {}) {
|
|
|
1126
1206
|
i = {
|
|
1127
1207
|
...i,
|
|
1128
1208
|
...e
|
|
1129
|
-
};
|
|
1209
|
+
}, M = be(i.mode), N = be(i.reValidateMode);
|
|
1130
1210
|
}
|
|
1131
1211
|
},
|
|
1132
|
-
subscribe:
|
|
1133
|
-
trigger:
|
|
1134
|
-
register:
|
|
1135
|
-
handleSubmit:
|
|
1136
|
-
watch:
|
|
1212
|
+
subscribe: Xe,
|
|
1213
|
+
trigger: Ue,
|
|
1214
|
+
register: $e,
|
|
1215
|
+
handleSubmit: nt,
|
|
1216
|
+
watch: Je,
|
|
1137
1217
|
setValue: $,
|
|
1138
|
-
setValues:
|
|
1139
|
-
getValues:
|
|
1140
|
-
reset:
|
|
1141
|
-
resetField:
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1218
|
+
setValues: Be,
|
|
1219
|
+
getValues: We,
|
|
1220
|
+
reset: at,
|
|
1221
|
+
resetField: rt,
|
|
1222
|
+
resetDefaultValues: (e, t = {}) => {
|
|
1223
|
+
if (g = u(e), !t.keepDirty) {
|
|
1224
|
+
let e = G(g, y);
|
|
1225
|
+
c.dirtyFields = e, c.isDirty = !z(e);
|
|
1226
|
+
}
|
|
1227
|
+
t.keepIsValid || B(), R.state.next({
|
|
1228
|
+
...c,
|
|
1229
|
+
defaultValues: g
|
|
1230
|
+
});
|
|
1231
|
+
},
|
|
1232
|
+
clearErrors: Ke,
|
|
1233
|
+
unregister: Ze,
|
|
1234
|
+
setError: qe,
|
|
1235
|
+
setFocus: ot,
|
|
1236
|
+
getFieldState: Ge
|
|
1147
1237
|
};
|
|
1148
1238
|
return {
|
|
1149
|
-
...
|
|
1150
|
-
formControl:
|
|
1239
|
+
...ct,
|
|
1240
|
+
formControl: ct
|
|
1151
1241
|
};
|
|
1152
1242
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let n = e.useRef(void 0), r = e.useRef(void 0),
|
|
1155
|
-
...u(
|
|
1156
|
-
isLoading:
|
|
1243
|
+
function Fe(t = {}) {
|
|
1244
|
+
let n = e.useRef(void 0), r = e.useRef(void 0), i = e.useRef(t.formControl), [a, o] = e.useState(() => ({
|
|
1245
|
+
...u(Pe),
|
|
1246
|
+
isLoading: C(t.defaultValues),
|
|
1157
1247
|
errors: t.errors || {},
|
|
1158
1248
|
disabled: t.disabled || !1,
|
|
1159
|
-
defaultValues:
|
|
1249
|
+
defaultValues: C(t.defaultValues) ? void 0 : t.defaultValues
|
|
1160
1250
|
}));
|
|
1161
|
-
if (!n.current) if (t.formControl) n.current = {
|
|
1251
|
+
if (!n.current || t.formControl && i.current !== t.formControl) if (i.current = t.formControl, t.formControl) n.current = {
|
|
1162
1252
|
...t.formControl,
|
|
1163
|
-
formState:
|
|
1164
|
-
}, t.defaultValues && !
|
|
1253
|
+
formState: a
|
|
1254
|
+
}, t.defaultValues && !C(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
|
|
1165
1255
|
else {
|
|
1166
|
-
let { formControl: e, ...r } =
|
|
1256
|
+
let { formControl: e, ...r } = Q(t);
|
|
1167
1257
|
n.current = {
|
|
1168
1258
|
...r,
|
|
1169
|
-
formState:
|
|
1259
|
+
formState: a
|
|
1170
1260
|
};
|
|
1171
1261
|
}
|
|
1172
|
-
let
|
|
1173
|
-
return
|
|
1174
|
-
let e =
|
|
1175
|
-
formState:
|
|
1176
|
-
callback: () =>
|
|
1262
|
+
let s = n.current.control;
|
|
1263
|
+
return s._options = t, O(() => {
|
|
1264
|
+
let e = s._subscribe({
|
|
1265
|
+
formState: s._proxyFormState,
|
|
1266
|
+
callback: () => o({
|
|
1267
|
+
...s._formState,
|
|
1268
|
+
defaultValues: s._defaultValues
|
|
1269
|
+
}),
|
|
1177
1270
|
reRenderRoot: !0
|
|
1178
1271
|
});
|
|
1179
|
-
return
|
|
1272
|
+
return o((e) => ({
|
|
1180
1273
|
...e,
|
|
1181
1274
|
isReady: !0
|
|
1182
|
-
})),
|
|
1183
|
-
}, [
|
|
1184
|
-
t.mode && (
|
|
1275
|
+
})), s._formState.isReady = !0, e;
|
|
1276
|
+
}, [s]), e.useEffect(() => s._disableForm(t.disabled), [s, t.disabled]), e.useEffect(() => {
|
|
1277
|
+
t.mode && (s._options.mode = t.mode), t.reValidateMode && (s._options.reValidateMode = t.reValidateMode);
|
|
1185
1278
|
}, [
|
|
1186
|
-
|
|
1279
|
+
s,
|
|
1187
1280
|
t.mode,
|
|
1188
1281
|
t.reValidateMode
|
|
1189
1282
|
]), e.useEffect(() => {
|
|
1190
|
-
t.errors && (
|
|
1191
|
-
}, [
|
|
1192
|
-
t.shouldUnregister &&
|
|
1193
|
-
}, [
|
|
1194
|
-
if (
|
|
1195
|
-
let e =
|
|
1196
|
-
e !==
|
|
1283
|
+
t.errors && (s._setErrors(t.errors), s._focusError());
|
|
1284
|
+
}, [s, t.errors]), e.useEffect(() => {
|
|
1285
|
+
t.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
|
|
1286
|
+
}, [s, t.shouldUnregister]), e.useEffect(() => {
|
|
1287
|
+
if (s._proxyFormState.isDirty) {
|
|
1288
|
+
let e = s._getDirty();
|
|
1289
|
+
e !== a.isDirty && s._subjects.state.next({ isDirty: e });
|
|
1197
1290
|
}
|
|
1198
|
-
}, [
|
|
1199
|
-
t.values && !
|
|
1291
|
+
}, [s, a.isDirty]), e.useEffect(() => {
|
|
1292
|
+
t.values && !P(t.values, r.current) ? (s._reset(t.values, {
|
|
1200
1293
|
keepFieldsRef: !0,
|
|
1201
|
-
...
|
|
1202
|
-
}),
|
|
1203
|
-
}, [
|
|
1204
|
-
|
|
1205
|
-
}), n.current.formState = e.useMemo(() =>
|
|
1294
|
+
...s._options.resetOptions
|
|
1295
|
+
}), s._options.resetOptions?.keepIsValid || s._setValid(), r.current = t.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
|
|
1296
|
+
}, [s, t.values]), e.useEffect(() => {
|
|
1297
|
+
s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
|
|
1298
|
+
}), n.current.formState = e.useMemo(() => D(a, s), [s, a]), n.current;
|
|
1206
1299
|
}
|
|
1207
1300
|
//#endregion
|
|
1208
|
-
export {
|
|
1301
|
+
export { L as Controller, ee as appendErrors, x as get, w as set, Fe as useForm };
|
|
1209
1302
|
|
|
1210
1303
|
//# sourceMappingURL=index.esm.js.map
|