@reformer/core 11.0.0-beta.5 → 11.0.0-beta.6
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/form/create-form.d.ts +6 -6
- package/dist/form/factories/node-factory.d.ts +16 -16
- package/dist/form/nodes/array-node.d.ts +3 -3
- package/dist/form/nodes/field-node.d.ts +3 -3
- package/dist/form/nodes/group-node.d.ts +7 -7
- package/dist/form/nodes/model-array-node.d.ts +2 -2
- package/dist/form/types/deep-schema.d.ts +5 -5
- package/dist/index.js +443 -399
- package/dist/platforms/react/field-binding/field-adapter.d.ts +87 -0
- package/dist/platforms/react/field-binding/field-handle.d.ts +50 -0
- package/dist/platforms/react/index.d.ts +4 -0
- package/docs/llms/02-quick-start.md +7 -7
- package/docs/llms/03-api-signatures.md +5 -5
- package/docs/llms/05-common-mistakes.md +1 -1
- package/docs/llms/09-formschema.md +12 -12
- package/docs/llms/10-arrays.md +4 -4
- package/docs/llms/14-extended-mistakes.md +1 -1
- package/docs/llms/15-project-structure.md +15 -13
- package/docs/llms/16-ui-components.md +36 -9
- package/docs/llms/17-nonexistent-api.md +16 -2
- package/docs/llms/29-async-preload.md +4 -4
- package/docs/llms/30-type-safety-recipes.md +1 -1
- package/llms-index.json +1 -1
- package/llms.txt +340 -81
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { e as
|
|
3
|
-
import { a as
|
|
4
|
-
import { i as
|
|
5
|
-
import { c as
|
|
6
|
-
import { signal as g, computed as m, effect as _, batch as
|
|
7
|
-
import { r as
|
|
8
|
-
import { g as
|
|
9
|
-
import { f as
|
|
10
|
-
import { d as
|
|
11
|
-
import
|
|
1
|
+
import { c as te } from "./create-model-Dxh9cfLp.js";
|
|
2
|
+
import { e as tt } from "./create-model-Dxh9cfLp.js";
|
|
3
|
+
import { a as B } from "./model-signals-proxy-mV3WGdlO.js";
|
|
4
|
+
import { i as rt, m as it, u as nt } from "./model-signals-proxy-mV3WGdlO.js";
|
|
5
|
+
import { c as ot, a as lt, r as ut, b as dt, d as ct, e as ht, f as ft, s as vt, t as mt, w as pt } from "./behaviors-value-C7dSEhCc.js";
|
|
6
|
+
import { signal as g, computed as m, effect as _, batch as se, Signal as G } from "@preact/signals-core";
|
|
7
|
+
import { r as re } from "./signal-node-registry-tiwel-TV.js";
|
|
8
|
+
import { g as gt } from "./signal-node-registry-tiwel-TV.js";
|
|
9
|
+
import { f as ie, h as D, g as ne, d as ae } from "./strategy-DA3JwxsR.js";
|
|
10
|
+
import { d as Et, e as _t } from "./node-DGEFMTQu.js";
|
|
11
|
+
import Y, { useRef as A, useCallback as E, useMemo as oe, useEffect as J, useState as le, useImperativeHandle as ue } from "react";
|
|
12
12
|
class M {
|
|
13
13
|
// ============================================================================
|
|
14
14
|
// Protected состояние (для Template Method паттерна)
|
|
@@ -90,8 +90,8 @@ class M {
|
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
92
|
getErrors(e) {
|
|
93
|
-
const
|
|
94
|
-
return e ?
|
|
93
|
+
const s = this.errors.value;
|
|
94
|
+
return e ? s.filter((r) => {
|
|
95
95
|
if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(r.code) || e.message !== void 0 && !r.message.toLowerCase().includes(e.message.toLowerCase()))
|
|
96
96
|
return !1;
|
|
97
97
|
if (e.params !== void 0) {
|
|
@@ -102,7 +102,7 @@ class M {
|
|
|
102
102
|
return !1;
|
|
103
103
|
}
|
|
104
104
|
return !(e.predicate !== void 0 && !e.predicate(r));
|
|
105
|
-
}) :
|
|
105
|
+
}) : s;
|
|
106
106
|
}
|
|
107
107
|
// ============================================================================
|
|
108
108
|
// Методы управления состоянием (Template Method)
|
|
@@ -274,7 +274,7 @@ class M {
|
|
|
274
274
|
onEnable() {
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
class
|
|
277
|
+
class R {
|
|
278
278
|
/**
|
|
279
279
|
* Хранилище подписок
|
|
280
280
|
* Ключ: уникальный идентификатор подписки
|
|
@@ -309,8 +309,8 @@ class L {
|
|
|
309
309
|
* manager.remove('anotherSub');
|
|
310
310
|
* ```
|
|
311
311
|
*/
|
|
312
|
-
add(e,
|
|
313
|
-
return this.subscriptions.has(e) && (process.env.NODE_ENV !== "production" && console.warn(`[SubscriptionManager] Subscription "${e}" already exists, replacing`), this.subscriptions.get(e)?.()), this.subscriptions.set(e,
|
|
312
|
+
add(e, s) {
|
|
313
|
+
return this.subscriptions.has(e) && (process.env.NODE_ENV !== "production" && console.warn(`[SubscriptionManager] Subscription "${e}" already exists, replacing`), this.subscriptions.get(e)?.()), this.subscriptions.set(e, s), () => this.remove(e);
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
316
316
|
* Удаляет подписку по ключу
|
|
@@ -334,8 +334,8 @@ class L {
|
|
|
334
334
|
* ```
|
|
335
335
|
*/
|
|
336
336
|
remove(e) {
|
|
337
|
-
const
|
|
338
|
-
return
|
|
337
|
+
const s = this.subscriptions.get(e);
|
|
338
|
+
return s ? (s(), this.subscriptions.delete(e), !0) : !1;
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
341
|
* Очищает все подписки
|
|
@@ -442,7 +442,7 @@ class L {
|
|
|
442
442
|
this.clear();
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const F = {
|
|
446
446
|
/** FieldNode.watch() */
|
|
447
447
|
Watch: "watch",
|
|
448
448
|
/** FieldNode.computeFrom() */
|
|
@@ -452,15 +452,15 @@ const O = {
|
|
|
452
452
|
/** GroupNode.watchField() */
|
|
453
453
|
WatchField: "watchField"
|
|
454
454
|
};
|
|
455
|
-
let
|
|
456
|
-
function
|
|
457
|
-
return `${
|
|
455
|
+
let de = 0;
|
|
456
|
+
function O(t) {
|
|
457
|
+
return `${t}-${++de}`;
|
|
458
458
|
}
|
|
459
|
-
var S = /* @__PURE__ */ ((
|
|
460
|
-
class
|
|
461
|
-
static handle(e,
|
|
459
|
+
var S = /* @__PURE__ */ ((t) => (t.THROW = "throw", t.LOG = "log", t.CONVERT = "convert", t))(S || {});
|
|
460
|
+
class k {
|
|
461
|
+
static handle(e, s, r = "throw") {
|
|
462
462
|
const i = this.extractMessage(e);
|
|
463
|
-
switch (process.env.NODE_ENV !== "production" && console.error(`[${
|
|
463
|
+
switch (process.env.NODE_ENV !== "production" && console.error(`[${s}]`, e), r) {
|
|
464
464
|
case "throw":
|
|
465
465
|
throw e;
|
|
466
466
|
case "log":
|
|
@@ -469,7 +469,7 @@ class V {
|
|
|
469
469
|
return {
|
|
470
470
|
code: "validator_error",
|
|
471
471
|
message: i,
|
|
472
|
-
params: { field:
|
|
472
|
+
params: { field: s }
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
475
|
}
|
|
@@ -524,10 +524,10 @@ class V {
|
|
|
524
524
|
* // { code: 'required', message: 'This field is required', field: 'email' }
|
|
525
525
|
* ```
|
|
526
526
|
*/
|
|
527
|
-
static createValidationError(e,
|
|
527
|
+
static createValidationError(e, s, r) {
|
|
528
528
|
return {
|
|
529
529
|
code: e,
|
|
530
|
-
message:
|
|
530
|
+
message: s,
|
|
531
531
|
params: r ? { field: r } : void 0
|
|
532
532
|
};
|
|
533
533
|
}
|
|
@@ -550,7 +550,7 @@ class V {
|
|
|
550
550
|
return typeof e == "object" && e !== null && "code" in e && "message" in e && typeof e.code == "string" && typeof e.message == "string";
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
class
|
|
553
|
+
class ce {
|
|
554
554
|
/** Внутренний сигнал статуса */
|
|
555
555
|
_status;
|
|
556
556
|
/** Публичный read-only сигнал статуса */
|
|
@@ -650,7 +650,7 @@ class ue {
|
|
|
650
650
|
this._status.value = e ? "invalid" : "valid";
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
class
|
|
653
|
+
class he extends M {
|
|
654
654
|
// ============================================================================
|
|
655
655
|
// Приватные сигналы
|
|
656
656
|
// ============================================================================
|
|
@@ -702,13 +702,13 @@ class de extends M {
|
|
|
702
702
|
* Менеджер подписок для централизованного cleanup
|
|
703
703
|
* Использует SubscriptionManager вместо массива для управления подписками
|
|
704
704
|
*/
|
|
705
|
-
disposers = new
|
|
705
|
+
disposers = new R();
|
|
706
706
|
component;
|
|
707
707
|
// ============================================================================
|
|
708
708
|
// Конструктор
|
|
709
709
|
// ============================================================================
|
|
710
710
|
constructor(e) {
|
|
711
|
-
super(), this.validators = e.validators || [], this.asyncValidators = e.asyncValidators || [], this.updateOn = e.updateOn || "blur", this.debounceMs = e.debounce || 0, this.component = e.component, this._value = e.valueSignal ?? g(e.value), this.initialValue = this._value.peek(), this._errors = g([]), this._componentProps = g(e.componentProps || {}), this.statusMachine = new
|
|
711
|
+
super(), this.validators = e.validators || [], this.asyncValidators = e.asyncValidators || [], this.updateOn = e.updateOn || "blur", this.debounceMs = e.debounce || 0, this.component = e.component, this._value = e.valueSignal ?? g(e.value), this.initialValue = this._value.peek(), this._errors = g([]), this._componentProps = g(e.componentProps || {}), this.statusMachine = new ce(e.disabled ? "disabled" : "valid"), this.value = m(() => this._value.value), this.valid = m(() => this.statusMachine.valid.value), this.invalid = m(() => this.statusMachine.invalid.value), this.pending = m(() => this.statusMachine.pending.value), this.status = m(() => this.statusMachine.status.value), this.disabled = m(() => this.statusMachine.disabled.value), this.errors = m(() => this._errors.value), this.componentProps = m(() => this._componentProps.value), this.shouldShowError = m(
|
|
712
712
|
() => this.statusMachine.invalid.value && (this._touched.value || this._dirty.value)
|
|
713
713
|
);
|
|
714
714
|
}
|
|
@@ -718,8 +718,8 @@ class de extends M {
|
|
|
718
718
|
getValue() {
|
|
719
719
|
return this._value.peek();
|
|
720
720
|
}
|
|
721
|
-
setValue(e,
|
|
722
|
-
if (this._value.value = e, this._dirty.value = !0,
|
|
721
|
+
setValue(e, s) {
|
|
722
|
+
if (this._value.value = e, this._dirty.value = !0, s?.emitEvent === !1)
|
|
723
723
|
return;
|
|
724
724
|
const r = this.validators.length > 0 || this.asyncValidators.length > 0, i = this._errors.value.length > 0;
|
|
725
725
|
if (this.updateOn === "change") {
|
|
@@ -772,7 +772,7 @@ class de extends M {
|
|
|
772
772
|
*
|
|
773
773
|
* @example
|
|
774
774
|
* ```typescript
|
|
775
|
-
* const field = new FieldNode({ value: 'initial', component:
|
|
775
|
+
* const field = new FieldNode({ value: 'initial', component: Input });
|
|
776
776
|
*
|
|
777
777
|
* field.setValue('changed');
|
|
778
778
|
* field.reset('temp value');
|
|
@@ -816,8 +816,8 @@ class de extends M {
|
|
|
816
816
|
* ```
|
|
817
817
|
*/
|
|
818
818
|
async validate(e) {
|
|
819
|
-
const
|
|
820
|
-
if (this.cancelPendingValidation(),
|
|
819
|
+
const s = e?.debounce ?? this.debounceMs;
|
|
820
|
+
if (this.cancelPendingValidation(), s <= 0 || this.asyncValidators.length === 0)
|
|
821
821
|
return this.validateImmediate();
|
|
822
822
|
const r = new AbortController();
|
|
823
823
|
return new Promise((i) => {
|
|
@@ -829,7 +829,7 @@ class de extends M {
|
|
|
829
829
|
this.pendingValidation = void 0;
|
|
830
830
|
const n = await this.validateImmediate(r);
|
|
831
831
|
i(n);
|
|
832
|
-
},
|
|
832
|
+
}, s), r.signal.addEventListener(
|
|
833
833
|
"abort",
|
|
834
834
|
() => {
|
|
835
835
|
this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0), i(!1);
|
|
@@ -849,9 +849,9 @@ class de extends M {
|
|
|
849
849
|
* - Проверяет signal.aborted в ключевых точках
|
|
850
850
|
*/
|
|
851
851
|
async validateImmediate(e) {
|
|
852
|
-
const
|
|
853
|
-
e || this.currentAbortController?.abort(), this.currentAbortController =
|
|
854
|
-
const { signal: r } =
|
|
852
|
+
const s = e ?? new AbortController();
|
|
853
|
+
e || this.currentAbortController?.abort(), this.currentAbortController = s;
|
|
854
|
+
const { signal: r } = s, i = [];
|
|
855
855
|
for (const a of this.validators) {
|
|
856
856
|
const l = a(this._value.value);
|
|
857
857
|
l && i.push(l);
|
|
@@ -881,7 +881,7 @@ class de extends M {
|
|
|
881
881
|
} catch (u) {
|
|
882
882
|
if (u instanceof DOMException && u.name === "AbortError")
|
|
883
883
|
throw u;
|
|
884
|
-
return
|
|
884
|
+
return k.handle(
|
|
885
885
|
u,
|
|
886
886
|
"FieldNode AsyncValidator",
|
|
887
887
|
S.CONVERT
|
|
@@ -908,8 +908,8 @@ class de extends M {
|
|
|
908
908
|
}
|
|
909
909
|
setErrors(e) {
|
|
910
910
|
this._errors.value = e;
|
|
911
|
-
const
|
|
912
|
-
this.statusMachine.setErrors(
|
|
911
|
+
const s = e.some((r) => r.severity !== "warning");
|
|
912
|
+
this.statusMachine.setErrors(s);
|
|
913
913
|
}
|
|
914
914
|
clearErrors() {
|
|
915
915
|
this._errors.value = [], this.statusMachine.setErrors(!1);
|
|
@@ -972,7 +972,7 @@ class de extends M {
|
|
|
972
972
|
* const form = createForm({
|
|
973
973
|
* email: {
|
|
974
974
|
* value: '',
|
|
975
|
-
* component:
|
|
975
|
+
* component: Input,
|
|
976
976
|
* updateOn: 'submit', // Изначально валидация только при submit
|
|
977
977
|
* validators: [required, email],
|
|
978
978
|
* },
|
|
@@ -1027,12 +1027,12 @@ class de extends M {
|
|
|
1027
1027
|
* ```
|
|
1028
1028
|
*/
|
|
1029
1029
|
watch(e) {
|
|
1030
|
-
const
|
|
1030
|
+
const s = new AbortController(), r = _(() => {
|
|
1031
1031
|
const n = this.value.value;
|
|
1032
|
-
e(n,
|
|
1033
|
-
}), i =
|
|
1032
|
+
e(n, s.signal);
|
|
1033
|
+
}), i = O(F.Watch);
|
|
1034
1034
|
return this.disposers.add(i, () => {
|
|
1035
|
-
|
|
1035
|
+
s.abort(), r();
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
1038
|
/**
|
|
@@ -1057,11 +1057,11 @@ class de extends M {
|
|
|
1057
1057
|
* useEffect(() => dispose, []);
|
|
1058
1058
|
* ```
|
|
1059
1059
|
*/
|
|
1060
|
-
computeFrom(e,
|
|
1060
|
+
computeFrom(e, s) {
|
|
1061
1061
|
const r = _(() => {
|
|
1062
|
-
const n = e.map((l) => l.value), a =
|
|
1062
|
+
const n = e.map((l) => l.value), a = s(...n);
|
|
1063
1063
|
this.setValue(a, { emitEvent: !1 });
|
|
1064
|
-
}), i =
|
|
1064
|
+
}), i = O(F.ComputeFrom);
|
|
1065
1065
|
return this.disposers.add(i, r);
|
|
1066
1066
|
}
|
|
1067
1067
|
/**
|
|
@@ -1092,9 +1092,9 @@ class de extends M {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const { getChildren: e, ownErrors:
|
|
1097
|
-
const o = [...
|
|
1095
|
+
function L(t) {
|
|
1096
|
+
const { getChildren: e, ownErrors: s, disabled: r } = t, i = m(() => s.value.length > 0 ? !1 : e().every((o) => o.disabled.value || o.valid.value)), n = m(() => !i.value), a = m(() => e().some((o) => o.pending.value)), l = m(() => e().some((o) => o.touched.value)), d = m(() => e().some((o) => o.dirty.value)), u = m(() => {
|
|
1097
|
+
const o = [...s.value];
|
|
1098
1098
|
for (const f of e())
|
|
1099
1099
|
o.push(...f.errors.value);
|
|
1100
1100
|
return o;
|
|
@@ -1109,22 +1109,22 @@ function R(s) {
|
|
|
1109
1109
|
status: h
|
|
1110
1110
|
};
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return typeof
|
|
1112
|
+
function j(t) {
|
|
1113
|
+
return typeof t == "object" && t !== null && "getProxy" in t && typeof t.getProxy == "function";
|
|
1114
1114
|
}
|
|
1115
1115
|
const U = "$";
|
|
1116
|
-
function
|
|
1117
|
-
let
|
|
1116
|
+
function fe(t, e) {
|
|
1117
|
+
let s;
|
|
1118
1118
|
const r = () => {
|
|
1119
|
-
if (!
|
|
1119
|
+
if (!s) {
|
|
1120
1120
|
const i = {};
|
|
1121
1121
|
e.forEach((n, a) => {
|
|
1122
|
-
i[a] = n &&
|
|
1123
|
-
}),
|
|
1122
|
+
i[a] = n && j(n) ? n.getProxy() : n;
|
|
1123
|
+
}), s = i;
|
|
1124
1124
|
}
|
|
1125
|
-
return
|
|
1125
|
+
return s;
|
|
1126
1126
|
};
|
|
1127
|
-
return new Proxy(
|
|
1127
|
+
return new Proxy(t, {
|
|
1128
1128
|
get: (i, n) => {
|
|
1129
1129
|
if (n === U)
|
|
1130
1130
|
return r();
|
|
@@ -1132,7 +1132,7 @@ function ce(s, e) {
|
|
|
1132
1132
|
return i[n];
|
|
1133
1133
|
if (typeof n == "string" && e.has(n)) {
|
|
1134
1134
|
const a = e.get(n);
|
|
1135
|
-
return a &&
|
|
1135
|
+
return a && j(a) ? a.getProxy() : a;
|
|
1136
1136
|
}
|
|
1137
1137
|
},
|
|
1138
1138
|
set: (i, n, a) => typeof n == "string" && e.has(n) ? !1 : (i[n] = a, !0),
|
|
@@ -1144,7 +1144,7 @@ function ce(s, e) {
|
|
|
1144
1144
|
getOwnPropertyDescriptor: (i, n) => typeof n == "string" && e.has(n) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(i, n)
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
|
-
class
|
|
1147
|
+
class ve {
|
|
1148
1148
|
/**
|
|
1149
1149
|
* @param form - Форма для отправки
|
|
1150
1150
|
*/
|
|
@@ -1188,8 +1188,8 @@ class he {
|
|
|
1188
1188
|
* }
|
|
1189
1189
|
* ```
|
|
1190
1190
|
*/
|
|
1191
|
-
async submit(e,
|
|
1192
|
-
const { skipValidation: r = !1, skipTouch: i = !1 } =
|
|
1191
|
+
async submit(e, s) {
|
|
1192
|
+
const { skipValidation: r = !1, skipTouch: i = !1 } = s || {};
|
|
1193
1193
|
if (i || this.form.markAsTouched(), !r && !await this.form.validate())
|
|
1194
1194
|
return null;
|
|
1195
1195
|
this._submitting.value = !0;
|
|
@@ -1223,8 +1223,8 @@ class he {
|
|
|
1223
1223
|
* }
|
|
1224
1224
|
* ```
|
|
1225
1225
|
*/
|
|
1226
|
-
async submitWithResult(e,
|
|
1227
|
-
const { skipValidation: r = !1, skipTouch: i = !1 } =
|
|
1226
|
+
async submitWithResult(e, s) {
|
|
1227
|
+
const { skipValidation: r = !1, skipTouch: i = !1 } = s || {};
|
|
1228
1228
|
if (i || this.form.markAsTouched(), !r && !await this.form.validate())
|
|
1229
1229
|
return { success: !1, data: null };
|
|
1230
1230
|
this._submitting.value = !0;
|
|
@@ -1241,16 +1241,16 @@ class he {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function me(t) {
|
|
1245
1245
|
const e = [];
|
|
1246
|
-
for (const
|
|
1247
|
-
const r = /^([^[\]]+)(?:\[(\d+)\])?$/.exec(
|
|
1246
|
+
for (const s of t.split(".")) {
|
|
1247
|
+
const r = /^([^[\]]+)(?:\[(\d+)\])?$/.exec(s);
|
|
1248
1248
|
if (!r) return [];
|
|
1249
1249
|
e.push(r[2] !== void 0 ? { key: r[1], index: Number(r[2]) } : { key: r[1] });
|
|
1250
1250
|
}
|
|
1251
1251
|
return e;
|
|
1252
1252
|
}
|
|
1253
|
-
class
|
|
1253
|
+
class w extends M {
|
|
1254
1254
|
// ============================================================================
|
|
1255
1255
|
// Приватные поля
|
|
1256
1256
|
// ============================================================================
|
|
@@ -1263,7 +1263,7 @@ class A extends M {
|
|
|
1263
1263
|
/**
|
|
1264
1264
|
* Менеджер подписок для централизованного cleanup
|
|
1265
1265
|
*/
|
|
1266
|
-
disposers = new
|
|
1266
|
+
disposers = new R();
|
|
1267
1267
|
/**
|
|
1268
1268
|
* Ссылка на Proxy-инстанс
|
|
1269
1269
|
*/
|
|
@@ -1275,7 +1275,7 @@ class A extends M {
|
|
|
1275
1275
|
/**
|
|
1276
1276
|
* Фабрика для создания узлов формы
|
|
1277
1277
|
*/
|
|
1278
|
-
nodeFactory = new
|
|
1278
|
+
nodeFactory = new pe();
|
|
1279
1279
|
// ============================================================================
|
|
1280
1280
|
// Приватные сигналы состояния (inline из StateManager)
|
|
1281
1281
|
// ============================================================================
|
|
@@ -1306,8 +1306,8 @@ class A extends M {
|
|
|
1306
1306
|
status;
|
|
1307
1307
|
submitting;
|
|
1308
1308
|
constructor(e) {
|
|
1309
|
-
super(), this.formSubmitter = new
|
|
1310
|
-
const
|
|
1309
|
+
super(), this.formSubmitter = new ve(this);
|
|
1310
|
+
const s = e.form, r = s != null && typeof s == "object" && ("valueSignal" in s || "value" in s), n = "form" in e && !r ? e.form : e;
|
|
1311
1311
|
for (const [l, d] of Object.entries(n)) {
|
|
1312
1312
|
const u = this.createNode(d);
|
|
1313
1313
|
this._fields.set(l, u);
|
|
@@ -1318,7 +1318,7 @@ class A extends M {
|
|
|
1318
1318
|
l[u] = d.value.value;
|
|
1319
1319
|
}), l;
|
|
1320
1320
|
});
|
|
1321
|
-
const a =
|
|
1321
|
+
const a = L({
|
|
1322
1322
|
getChildren: () => Array.from(this._fields.values()),
|
|
1323
1323
|
ownErrors: this._formErrors,
|
|
1324
1324
|
disabled: this._disabled
|
|
@@ -1333,34 +1333,34 @@ class A extends M {
|
|
|
1333
1333
|
* @see buildFormProxy
|
|
1334
1334
|
*/
|
|
1335
1335
|
buildProxy() {
|
|
1336
|
-
return
|
|
1336
|
+
return fe(this, this._fields);
|
|
1337
1337
|
}
|
|
1338
1338
|
// ============================================================================
|
|
1339
1339
|
// Реализация абстрактных методов FormNode
|
|
1340
1340
|
// ============================================================================
|
|
1341
1341
|
getValue() {
|
|
1342
1342
|
const e = {};
|
|
1343
|
-
return this._fields.forEach((
|
|
1344
|
-
e[r] =
|
|
1343
|
+
return this._fields.forEach((s, r) => {
|
|
1344
|
+
e[r] = s.getValue();
|
|
1345
1345
|
}), e;
|
|
1346
1346
|
}
|
|
1347
|
-
setValue(e,
|
|
1347
|
+
setValue(e, s) {
|
|
1348
1348
|
for (const [r, i] of Object.entries(e)) {
|
|
1349
1349
|
const n = this._fields.get(r);
|
|
1350
1350
|
if (n) {
|
|
1351
1351
|
const a = this._fieldSignals.get(n) ?? n.value;
|
|
1352
|
-
if (
|
|
1353
|
-
n.setValue(i,
|
|
1352
|
+
if (B(a)) continue;
|
|
1353
|
+
n.setValue(i, s);
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
1357
|
patchValue(e) {
|
|
1358
|
-
|
|
1359
|
-
for (const [
|
|
1360
|
-
const i = this._fields.get(
|
|
1358
|
+
se(() => {
|
|
1359
|
+
for (const [s, r] of Object.entries(e)) {
|
|
1360
|
+
const i = this._fields.get(s);
|
|
1361
1361
|
if (i && r !== void 0) {
|
|
1362
1362
|
const n = this._fieldSignals.get(i) ?? i.value;
|
|
1363
|
-
if (
|
|
1363
|
+
if (B(n)) continue;
|
|
1364
1364
|
i.setValue(r, { emitEvent: !1 });
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
@@ -1384,9 +1384,9 @@ class A extends M {
|
|
|
1384
1384
|
* ```
|
|
1385
1385
|
*/
|
|
1386
1386
|
reset(e) {
|
|
1387
|
-
this._formErrors.value = [], this._fields.forEach((
|
|
1387
|
+
this._formErrors.value = [], this._fields.forEach((s, r) => {
|
|
1388
1388
|
const i = e?.[r];
|
|
1389
|
-
|
|
1389
|
+
s.reset(i);
|
|
1390
1390
|
});
|
|
1391
1391
|
}
|
|
1392
1392
|
/**
|
|
@@ -1398,8 +1398,8 @@ class A extends M {
|
|
|
1398
1398
|
});
|
|
1399
1399
|
}
|
|
1400
1400
|
async validate() {
|
|
1401
|
-
return this.clearErrors(), await Promise.all(Array.from(this._fields.values()).map((
|
|
1402
|
-
(
|
|
1401
|
+
return this.clearErrors(), await Promise.all(Array.from(this._fields.values()).map((s) => s.validate())), Array.from(this._fields.values()).every(
|
|
1402
|
+
(s) => s.valid.value || s.disabled.value
|
|
1403
1403
|
);
|
|
1404
1404
|
}
|
|
1405
1405
|
/**
|
|
@@ -1438,8 +1438,8 @@ class A extends M {
|
|
|
1438
1438
|
* @example
|
|
1439
1439
|
* ```typescript
|
|
1440
1440
|
* const form = new GroupNode({
|
|
1441
|
-
* email: { value: '', component:
|
|
1442
|
-
* name: { value: '', component:
|
|
1441
|
+
* email: { value: '', component: Input },
|
|
1442
|
+
* name: { value: '', component: Input },
|
|
1443
1443
|
* });
|
|
1444
1444
|
*
|
|
1445
1445
|
* const proxy = form.getProxy();
|
|
@@ -1485,8 +1485,8 @@ class A extends M {
|
|
|
1485
1485
|
* `onSubmit` (или void-обработчик). Если вызывающей стороне нужно различать эти случаи —
|
|
1486
1486
|
* используйте {@link submitWithResult}, который возвращает явный флаг `success`.
|
|
1487
1487
|
*/
|
|
1488
|
-
async submit(e,
|
|
1489
|
-
return this.formSubmitter.submit(e,
|
|
1488
|
+
async submit(e, s) {
|
|
1489
|
+
return this.formSubmitter.submit(e, s);
|
|
1490
1490
|
}
|
|
1491
1491
|
/**
|
|
1492
1492
|
* Отправить форму с расширенным результатом
|
|
@@ -1495,8 +1495,8 @@ class A extends M {
|
|
|
1495
1495
|
* @param options - Опции submit
|
|
1496
1496
|
* @returns Объект SubmitResult с данными, статусом и возможной ошибкой
|
|
1497
1497
|
*/
|
|
1498
|
-
async submitWithResult(e,
|
|
1499
|
-
return this.formSubmitter.submitWithResult(e,
|
|
1498
|
+
async submitWithResult(e, s) {
|
|
1499
|
+
return this.formSubmitter.submitWithResult(e, s);
|
|
1500
1500
|
}
|
|
1501
1501
|
/**
|
|
1502
1502
|
* Получить вложенное поле по пути
|
|
@@ -1513,11 +1513,11 @@ class A extends M {
|
|
|
1513
1513
|
* @example
|
|
1514
1514
|
* ```typescript
|
|
1515
1515
|
* const form = new GroupNode({
|
|
1516
|
-
* email: { value: '', component:
|
|
1516
|
+
* email: { value: '', component: Input },
|
|
1517
1517
|
* address: {
|
|
1518
|
-
* city: { value: '', component:
|
|
1518
|
+
* city: { value: '', component: Input }
|
|
1519
1519
|
* },
|
|
1520
|
-
* items: [{ name: { value: '', component:
|
|
1520
|
+
* items: [{ name: { value: '', component: Input } }]
|
|
1521
1521
|
* });
|
|
1522
1522
|
*
|
|
1523
1523
|
* form.getFieldByPath('email'); // FieldNode
|
|
@@ -1530,12 +1530,12 @@ class A extends M {
|
|
|
1530
1530
|
getFieldByPath(e) {
|
|
1531
1531
|
if (e.startsWith(".") || e.endsWith("."))
|
|
1532
1532
|
return;
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1533
|
+
const s = me(e);
|
|
1534
|
+
if (s.length === 0)
|
|
1535
1535
|
return;
|
|
1536
1536
|
let r = this;
|
|
1537
|
-
for (const i of
|
|
1538
|
-
if (!(r instanceof
|
|
1537
|
+
for (const i of s) {
|
|
1538
|
+
if (!(r instanceof w) || (r = r.getField(i.key), !r)) return;
|
|
1539
1539
|
if (i.index !== void 0)
|
|
1540
1540
|
if ("at" in r && "length" in r && typeof r.at == "function") {
|
|
1541
1541
|
const n = r.at(i.index);
|
|
@@ -1573,16 +1573,16 @@ class A extends M {
|
|
|
1573
1573
|
/**
|
|
1574
1574
|
* Связывает два поля: при изменении source автоматически обновляется target
|
|
1575
1575
|
*/
|
|
1576
|
-
linkFields(e,
|
|
1577
|
-
const i = this._fields.get(e), n = this._fields.get(
|
|
1576
|
+
linkFields(e, s, r) {
|
|
1577
|
+
const i = this._fields.get(e), n = this._fields.get(s);
|
|
1578
1578
|
if (!i || !n) {
|
|
1579
|
-
const d = i ?
|
|
1579
|
+
const d = i ? s : e;
|
|
1580
1580
|
throw new Error(`GroupNode.linkFields: field "${String(d)}" not found`);
|
|
1581
1581
|
}
|
|
1582
1582
|
const a = _(() => {
|
|
1583
1583
|
const d = i.value.value, u = r ? r(d) : d;
|
|
1584
1584
|
n.setValue(u, { emitEvent: !1 });
|
|
1585
|
-
}), l =
|
|
1585
|
+
}), l = O(F.LinkFields);
|
|
1586
1586
|
return this.disposers.add(l, a);
|
|
1587
1587
|
}
|
|
1588
1588
|
/**
|
|
@@ -1613,26 +1613,26 @@ class A extends M {
|
|
|
1613
1613
|
* ```
|
|
1614
1614
|
*/
|
|
1615
1615
|
/** Подписка на top-level поле — value типизирован как `T[K]`. */
|
|
1616
|
-
watchField(e,
|
|
1616
|
+
watchField(e, s) {
|
|
1617
1617
|
const r = this.getFieldByPath(e);
|
|
1618
1618
|
if (!r)
|
|
1619
1619
|
throw new Error(`GroupNode.watchField: field "${e}" not found`);
|
|
1620
1620
|
const i = _(() => {
|
|
1621
|
-
|
|
1622
|
-
}), n =
|
|
1621
|
+
s(r.value.value);
|
|
1622
|
+
}), n = O(F.WatchField);
|
|
1623
1623
|
return this.disposers.add(n, i);
|
|
1624
1624
|
}
|
|
1625
1625
|
/**
|
|
1626
1626
|
* Подписка на вложенное поле по строковому пути ("address.city").
|
|
1627
1627
|
* Путь нельзя выразить в типах узла → value честно `unknown`, потребитель сужает.
|
|
1628
1628
|
*/
|
|
1629
|
-
watchFieldByPath(e,
|
|
1629
|
+
watchFieldByPath(e, s) {
|
|
1630
1630
|
const r = this.getFieldByPath(e);
|
|
1631
1631
|
if (!r)
|
|
1632
1632
|
throw new Error(`GroupNode.watchFieldByPath: field "${e}" not found`);
|
|
1633
1633
|
const i = _(() => {
|
|
1634
|
-
|
|
1635
|
-
}), n =
|
|
1634
|
+
s(r.value.value);
|
|
1635
|
+
}), n = O(F.WatchField);
|
|
1636
1636
|
return this.disposers.add(n, i);
|
|
1637
1637
|
}
|
|
1638
1638
|
/**
|
|
@@ -1660,8 +1660,8 @@ class A extends M {
|
|
|
1660
1660
|
* @internal
|
|
1661
1661
|
*/
|
|
1662
1662
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1663
|
-
registerFieldSignal(e,
|
|
1664
|
-
this._fieldSignals.set(e,
|
|
1663
|
+
registerFieldSignal(e, s) {
|
|
1664
|
+
this._fieldSignals.set(e, s);
|
|
1665
1665
|
}
|
|
1666
1666
|
/**
|
|
1667
1667
|
* Очистить все ресурсы узла
|
|
@@ -1683,7 +1683,7 @@ class W extends M {
|
|
|
1683
1683
|
* Менеджер подписок для централизованного cleanup
|
|
1684
1684
|
* Использует SubscriptionManager вместо массива для управления подписками
|
|
1685
1685
|
*/
|
|
1686
|
-
disposers = new
|
|
1686
|
+
disposers = new R();
|
|
1687
1687
|
/** Array-level validation errors (e.g., "минимум 1 элемент") */
|
|
1688
1688
|
_arrayErrors = g([]);
|
|
1689
1689
|
// ============================================================================
|
|
@@ -1701,12 +1701,12 @@ class W extends M {
|
|
|
1701
1701
|
// ============================================================================
|
|
1702
1702
|
// Конструктор
|
|
1703
1703
|
// ============================================================================
|
|
1704
|
-
constructor(e,
|
|
1705
|
-
super(), this.itemSchema = e, this.initialItems =
|
|
1706
|
-
for (const i of
|
|
1704
|
+
constructor(e, s = []) {
|
|
1705
|
+
super(), this.itemSchema = e, this.initialItems = s, this.items = g([]);
|
|
1706
|
+
for (const i of s)
|
|
1707
1707
|
this.push(i);
|
|
1708
1708
|
this.length = m(() => this.items.value.length), this.value = m(() => this.items.value.map((i) => i.value.value));
|
|
1709
|
-
const r =
|
|
1709
|
+
const r = L({
|
|
1710
1710
|
getChildren: () => this.items.value,
|
|
1711
1711
|
ownErrors: this._arrayErrors
|
|
1712
1712
|
});
|
|
@@ -1720,8 +1720,8 @@ class W extends M {
|
|
|
1720
1720
|
* @param initialValue - Начальные значения для нового элемента
|
|
1721
1721
|
*/
|
|
1722
1722
|
push(e) {
|
|
1723
|
-
const
|
|
1724
|
-
this.items.value = [...this.items.value,
|
|
1723
|
+
const s = this.createItem(e);
|
|
1724
|
+
this.items.value = [...this.items.value, s];
|
|
1725
1725
|
}
|
|
1726
1726
|
/**
|
|
1727
1727
|
* Удалить элемент по индексу
|
|
@@ -1732,7 +1732,7 @@ class W extends M {
|
|
|
1732
1732
|
*/
|
|
1733
1733
|
removeAt(e) {
|
|
1734
1734
|
if (e < 0 || e >= this.items.value.length) {
|
|
1735
|
-
|
|
1735
|
+
k.handle(
|
|
1736
1736
|
new Error(
|
|
1737
1737
|
`ArrayNode.removeAt: index ${e} out of bounds (length: ${this.items.value.length})`
|
|
1738
1738
|
),
|
|
@@ -1741,17 +1741,17 @@ class W extends M {
|
|
|
1741
1741
|
);
|
|
1742
1742
|
return;
|
|
1743
1743
|
}
|
|
1744
|
-
const
|
|
1745
|
-
this.items.value = this.items.value.filter((r, i) => i !== e),
|
|
1744
|
+
const s = this.items.value[e];
|
|
1745
|
+
this.items.value = this.items.value.filter((r, i) => i !== e), s && "dispose" in s && typeof s.dispose == "function" && s.dispose();
|
|
1746
1746
|
}
|
|
1747
1747
|
/**
|
|
1748
1748
|
* Вставить элемент в массив
|
|
1749
1749
|
* @param index - Индекс для вставки
|
|
1750
1750
|
* @param initialValue - Начальные значения для нового элемента
|
|
1751
1751
|
*/
|
|
1752
|
-
insert(e,
|
|
1752
|
+
insert(e, s) {
|
|
1753
1753
|
if (e < 0 || e > this.items.value.length) {
|
|
1754
|
-
|
|
1754
|
+
k.handle(
|
|
1755
1755
|
new Error(
|
|
1756
1756
|
`ArrayNode.insert: index ${e} out of bounds (length: ${this.items.value.length})`
|
|
1757
1757
|
),
|
|
@@ -1760,7 +1760,7 @@ class W extends M {
|
|
|
1760
1760
|
);
|
|
1761
1761
|
return;
|
|
1762
1762
|
}
|
|
1763
|
-
const r = this.createItem(
|
|
1763
|
+
const r = this.createItem(s), i = [...this.items.value];
|
|
1764
1764
|
i.splice(e, 0, r), this.items.value = i;
|
|
1765
1765
|
}
|
|
1766
1766
|
/**
|
|
@@ -1779,19 +1779,19 @@ class W extends M {
|
|
|
1779
1779
|
* form.items.move(2, 1);
|
|
1780
1780
|
* ```
|
|
1781
1781
|
*/
|
|
1782
|
-
move(e,
|
|
1782
|
+
move(e, s) {
|
|
1783
1783
|
const r = this.items.value.length;
|
|
1784
|
-
if (e < 0 || e >= r ||
|
|
1785
|
-
|
|
1786
|
-
new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${
|
|
1784
|
+
if (e < 0 || e >= r || s < 0 || s >= r) {
|
|
1785
|
+
k.handle(
|
|
1786
|
+
new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${s}, length=${r})`),
|
|
1787
1787
|
"ArrayNode.move",
|
|
1788
1788
|
S.LOG
|
|
1789
1789
|
);
|
|
1790
1790
|
return;
|
|
1791
1791
|
}
|
|
1792
|
-
if (e ===
|
|
1792
|
+
if (e === s) return;
|
|
1793
1793
|
const i = [...this.items.value], [n] = i.splice(e, 1);
|
|
1794
|
-
i.splice(
|
|
1794
|
+
i.splice(s, 0, n), this.items.value = i;
|
|
1795
1795
|
}
|
|
1796
1796
|
/**
|
|
1797
1797
|
* Поменять местами два элемента массива
|
|
@@ -1807,19 +1807,19 @@ class W extends M {
|
|
|
1807
1807
|
* form.items.swap(0, 2);
|
|
1808
1808
|
* ```
|
|
1809
1809
|
*/
|
|
1810
|
-
swap(e,
|
|
1810
|
+
swap(e, s) {
|
|
1811
1811
|
const r = this.items.value.length;
|
|
1812
|
-
if (e < 0 || e >= r ||
|
|
1813
|
-
|
|
1814
|
-
new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${
|
|
1812
|
+
if (e < 0 || e >= r || s < 0 || s >= r) {
|
|
1813
|
+
k.handle(
|
|
1814
|
+
new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${s}, length=${r})`),
|
|
1815
1815
|
"ArrayNode.swap",
|
|
1816
1816
|
S.LOG
|
|
1817
1817
|
);
|
|
1818
1818
|
return;
|
|
1819
1819
|
}
|
|
1820
|
-
if (e ===
|
|
1820
|
+
if (e === s) return;
|
|
1821
1821
|
const i = [...this.items.value];
|
|
1822
|
-
[i[e], i[
|
|
1822
|
+
[i[e], i[s]] = [i[s], i[e]], this.items.value = i;
|
|
1823
1823
|
}
|
|
1824
1824
|
/**
|
|
1825
1825
|
* Удалить все элементы массива
|
|
@@ -1829,8 +1829,8 @@ class W extends M {
|
|
|
1829
1829
|
*/
|
|
1830
1830
|
clear() {
|
|
1831
1831
|
const e = [...this.items.value];
|
|
1832
|
-
this.items.value = [], e.forEach((
|
|
1833
|
-
"dispose" in
|
|
1832
|
+
this.items.value = [], e.forEach((s) => {
|
|
1833
|
+
"dispose" in s && typeof s.dispose == "function" && s.dispose();
|
|
1834
1834
|
});
|
|
1835
1835
|
}
|
|
1836
1836
|
/**
|
|
@@ -1839,9 +1839,9 @@ class W extends M {
|
|
|
1839
1839
|
* @returns Типизированный GroupNode proxy или undefined если индекс вне границ
|
|
1840
1840
|
*/
|
|
1841
1841
|
at(e) {
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
return
|
|
1842
|
+
const s = this.items.value[e];
|
|
1843
|
+
if (s)
|
|
1844
|
+
return s.getProxy();
|
|
1845
1845
|
}
|
|
1846
1846
|
// ============================================================================
|
|
1847
1847
|
// Реализация абстрактных методов
|
|
@@ -1849,14 +1849,14 @@ class W extends M {
|
|
|
1849
1849
|
getValue() {
|
|
1850
1850
|
return this.items.value.map((e) => e.getValue());
|
|
1851
1851
|
}
|
|
1852
|
-
setValue(e,
|
|
1853
|
-
this.clear(), e.forEach((r) => this.push(r)),
|
|
1854
|
-
|
|
1852
|
+
setValue(e, s) {
|
|
1853
|
+
this.clear(), e.forEach((r) => this.push(r)), s?.emitEvent !== !1 && this.validate().catch((r) => {
|
|
1854
|
+
k.handle(r, "ArrayNode.setValue", S.LOG);
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
1857
|
patchValue(e) {
|
|
1858
|
-
e.forEach((
|
|
1859
|
-
this.items.value[r] &&
|
|
1858
|
+
e.forEach((s, r) => {
|
|
1859
|
+
this.items.value[r] && s !== void 0 && this.items.value[r].patchValue(s);
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
1862
|
/**
|
|
@@ -1877,7 +1877,7 @@ class W extends M {
|
|
|
1877
1877
|
* ```
|
|
1878
1878
|
*/
|
|
1879
1879
|
reset(e) {
|
|
1880
|
-
this._arrayErrors.value = [], this.clear(), e && e.forEach((
|
|
1880
|
+
this._arrayErrors.value = [], this.clear(), e && e.forEach((s) => this.push(s));
|
|
1881
1881
|
}
|
|
1882
1882
|
/**
|
|
1883
1883
|
* Сбросить массив к исходным значениям (initialItems)
|
|
@@ -1894,7 +1894,7 @@ class W extends M {
|
|
|
1894
1894
|
* @example
|
|
1895
1895
|
* ```typescript
|
|
1896
1896
|
* const arrayNode = new ArrayNode(
|
|
1897
|
-
* { name: { value: '', component:
|
|
1897
|
+
* { name: { value: '', component: Input } },
|
|
1898
1898
|
* [{ name: 'Initial 1' }, { name: 'Initial 2' }]
|
|
1899
1899
|
* );
|
|
1900
1900
|
*
|
|
@@ -1911,7 +1911,7 @@ class W extends M {
|
|
|
1911
1911
|
this._arrayErrors.value = [], this.clear(), this.initialItems.forEach((e) => this.push(e));
|
|
1912
1912
|
}
|
|
1913
1913
|
async validate() {
|
|
1914
|
-
return (await Promise.all(this.items.value.map((
|
|
1914
|
+
return (await Promise.all(this.items.value.map((s) => s.validate()))).every(Boolean) && this._arrayErrors.value.length === 0;
|
|
1915
1915
|
}
|
|
1916
1916
|
/**
|
|
1917
1917
|
* Установить array-level validation errors
|
|
@@ -1984,8 +1984,8 @@ class W extends M {
|
|
|
1984
1984
|
* @param callback - Функция, вызываемая для каждого элемента с типизированным GroupNode proxy
|
|
1985
1985
|
*/
|
|
1986
1986
|
forEach(e) {
|
|
1987
|
-
this.items.value.forEach((
|
|
1988
|
-
const i =
|
|
1987
|
+
this.items.value.forEach((s, r) => {
|
|
1988
|
+
const i = s.getProxy();
|
|
1989
1989
|
e(i, r);
|
|
1990
1990
|
});
|
|
1991
1991
|
}
|
|
@@ -1995,8 +1995,8 @@ class W extends M {
|
|
|
1995
1995
|
* @returns Новый массив результатов
|
|
1996
1996
|
*/
|
|
1997
1997
|
map(e) {
|
|
1998
|
-
return this.items.value.map((
|
|
1999
|
-
const i =
|
|
1998
|
+
return this.items.value.map((s, r) => {
|
|
1999
|
+
const i = s.getProxy();
|
|
2000
2000
|
return e(i, r);
|
|
2001
2001
|
});
|
|
2002
2002
|
}
|
|
@@ -2009,8 +2009,8 @@ class W extends M {
|
|
|
2009
2009
|
*/
|
|
2010
2010
|
createItem(e) {
|
|
2011
2011
|
if (this.isGroupSchema(this.itemSchema)) {
|
|
2012
|
-
const
|
|
2013
|
-
return e &&
|
|
2012
|
+
const s = new w(this.itemSchema);
|
|
2013
|
+
return e && s.patchValue(e), s;
|
|
2014
2014
|
}
|
|
2015
2015
|
throw new Error(
|
|
2016
2016
|
"ArrayNode поддерживает только GroupNode элементы. Для массива примитивов используйте обычное поле с типом массива."
|
|
@@ -2087,7 +2087,7 @@ class W extends M {
|
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
|
-
class
|
|
2090
|
+
class pe {
|
|
2091
2091
|
/**
|
|
2092
2092
|
* Создает узел формы на основе конфигурации
|
|
2093
2093
|
*
|
|
@@ -2110,25 +2110,25 @@ class ve {
|
|
|
2110
2110
|
* // FieldNode
|
|
2111
2111
|
* const field = factory.createNode({
|
|
2112
2112
|
* value: 'test@mail.com',
|
|
2113
|
-
* component:
|
|
2113
|
+
* component: Input,
|
|
2114
2114
|
* validators: [required, email]
|
|
2115
2115
|
* });
|
|
2116
2116
|
*
|
|
2117
2117
|
* // GroupNode
|
|
2118
2118
|
* const group = factory.createNode({
|
|
2119
|
-
* email: { value: '', component:
|
|
2120
|
-
* password: { value: '', component:
|
|
2119
|
+
* email: { value: '', component: Input },
|
|
2120
|
+
* password: { value: '', component: Input }
|
|
2121
2121
|
* });
|
|
2122
2122
|
*
|
|
2123
2123
|
* // ArrayNode (объект)
|
|
2124
2124
|
* const array = factory.createNode({
|
|
2125
|
-
* schema: { title: { value: '', component:
|
|
2125
|
+
* schema: { title: { value: '', component: Input } },
|
|
2126
2126
|
* initialItems: [{ title: 'Item 1' }]
|
|
2127
2127
|
* });
|
|
2128
2128
|
*
|
|
2129
2129
|
* // ArrayNode (массив) - новый формат
|
|
2130
2130
|
* const array2 = factory.createNode([
|
|
2131
|
-
* { title: { value: '', component:
|
|
2131
|
+
* { title: { value: '', component: Input } }, // schema
|
|
2132
2132
|
* { title: 'Item 1' }, // initial item 1
|
|
2133
2133
|
* { title: 'Item 2' } // initial item 2
|
|
2134
2134
|
* ]);
|
|
@@ -2138,14 +2138,14 @@ class ve {
|
|
|
2138
2138
|
if (Array.isArray(e) && e.length >= 1)
|
|
2139
2139
|
return this.createArrayNodeFromArray(e);
|
|
2140
2140
|
if (this.isFieldConfig(e))
|
|
2141
|
-
return new
|
|
2141
|
+
return new he(e);
|
|
2142
2142
|
if (this.isArrayConfig(e))
|
|
2143
2143
|
return new W(
|
|
2144
2144
|
e.schema,
|
|
2145
2145
|
e.initialItems
|
|
2146
2146
|
);
|
|
2147
2147
|
if (this.isGroupConfig(e))
|
|
2148
|
-
return new
|
|
2148
|
+
return new w(e);
|
|
2149
2149
|
throw new Error(
|
|
2150
2150
|
`NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(
|
|
2151
2151
|
e
|
|
@@ -2170,7 +2170,7 @@ class ve {
|
|
|
2170
2170
|
*
|
|
2171
2171
|
* // Массив с начальными элементами
|
|
2172
2172
|
* const array = factory.createArrayNodeFromArray([
|
|
2173
|
-
* { title: { value: '', component:
|
|
2173
|
+
* { title: { value: '', component: Input } }, // schema
|
|
2174
2174
|
* { title: 'Item 1' }, // initial value
|
|
2175
2175
|
* { title: 'Item 2' } // initial value
|
|
2176
2176
|
* ]);
|
|
@@ -2179,11 +2179,11 @@ class ve {
|
|
|
2179
2179
|
*/
|
|
2180
2180
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2181
2181
|
createArrayNodeFromArray(e) {
|
|
2182
|
-
const [
|
|
2183
|
-
this.isGroupConfig(
|
|
2182
|
+
const [s, ...r] = e, i = [];
|
|
2183
|
+
this.isGroupConfig(s) && i.push(this.extractValues(s));
|
|
2184
2184
|
for (const n of r)
|
|
2185
2185
|
this.isGroupConfig(n) ? i.push(this.extractValues(n)) : i.push(n);
|
|
2186
|
-
return new W(
|
|
2186
|
+
return new W(s, i);
|
|
2187
2187
|
}
|
|
2188
2188
|
/**
|
|
2189
2189
|
* Извлечь значения из схемы (рекурсивно)
|
|
@@ -2191,7 +2191,7 @@ class ve {
|
|
|
2191
2191
|
* ✅ НОВОЕ: Извлечено из GroupNode для централизации логики
|
|
2192
2192
|
*
|
|
2193
2193
|
* Преобразует схему формы в объект со значениями:
|
|
2194
|
-
* - `{ name: { value: 'John', component:
|
|
2194
|
+
* - `{ name: { value: 'John', component: Input } } → { name: 'John' }`
|
|
2195
2195
|
* - Поддерживает вложенные группы
|
|
2196
2196
|
* - Поддерживает массивы
|
|
2197
2197
|
*
|
|
@@ -2203,10 +2203,10 @@ class ve {
|
|
|
2203
2203
|
* const factory = new NodeFactory();
|
|
2204
2204
|
*
|
|
2205
2205
|
* const schema = {
|
|
2206
|
-
* name: { value: 'John', component:
|
|
2207
|
-
* age: { value: 30, component:
|
|
2206
|
+
* name: { value: 'John', component: Input },
|
|
2207
|
+
* age: { value: 30, component: Input },
|
|
2208
2208
|
* address: {
|
|
2209
|
-
* city: { value: 'Moscow', component:
|
|
2209
|
+
* city: { value: 'Moscow', component: Input }
|
|
2210
2210
|
* }
|
|
2211
2211
|
* };
|
|
2212
2212
|
*
|
|
@@ -2218,12 +2218,12 @@ class ve {
|
|
|
2218
2218
|
if (this.isFieldConfig(e))
|
|
2219
2219
|
return e.value;
|
|
2220
2220
|
if (Array.isArray(e))
|
|
2221
|
-
return e.map((
|
|
2221
|
+
return e.map((s) => this.extractValues(s));
|
|
2222
2222
|
if (this.isGroupConfig(e)) {
|
|
2223
|
-
const
|
|
2223
|
+
const s = {};
|
|
2224
2224
|
for (const [r, i] of Object.entries(e))
|
|
2225
|
-
|
|
2226
|
-
return
|
|
2225
|
+
s[r] = this.extractValues(i);
|
|
2226
|
+
return s;
|
|
2227
2227
|
}
|
|
2228
2228
|
return e;
|
|
2229
2229
|
}
|
|
@@ -2241,7 +2241,7 @@ class ve {
|
|
|
2241
2241
|
* ```typescript
|
|
2242
2242
|
* const factory = new NodeFactory();
|
|
2243
2243
|
*
|
|
2244
|
-
* factory.isFieldConfig({ value: '', component:
|
|
2244
|
+
* factory.isFieldConfig({ value: '', component: Input }); // true
|
|
2245
2245
|
* factory.isFieldConfig({ email: { value: '' } }); // false
|
|
2246
2246
|
* factory.isFieldConfig(null); // false
|
|
2247
2247
|
* ```
|
|
@@ -2266,7 +2266,7 @@ class ve {
|
|
|
2266
2266
|
* const factory = new NodeFactory();
|
|
2267
2267
|
*
|
|
2268
2268
|
* factory.isArrayConfig({ schema: {}, initialItems: [] }); // true
|
|
2269
|
-
* factory.isArrayConfig({ value: '', component:
|
|
2269
|
+
* factory.isArrayConfig({ value: '', component: Input }); // false
|
|
2270
2270
|
* factory.isArrayConfig({ email: { value: '' } }); // false
|
|
2271
2271
|
* ```
|
|
2272
2272
|
*/
|
|
@@ -2289,11 +2289,11 @@ class ve {
|
|
|
2289
2289
|
* const factory = new NodeFactory();
|
|
2290
2290
|
*
|
|
2291
2291
|
* factory.isGroupConfig({
|
|
2292
|
-
* email: { value: '', component:
|
|
2293
|
-
* password: { value: '', component:
|
|
2292
|
+
* email: { value: '', component: Input },
|
|
2293
|
+
* password: { value: '', component: Input }
|
|
2294
2294
|
* }); // true
|
|
2295
2295
|
*
|
|
2296
|
-
* factory.isGroupConfig({ value: '', component:
|
|
2296
|
+
* factory.isGroupConfig({ value: '', component: Input }); // false
|
|
2297
2297
|
* factory.isGroupConfig({ schema: {} }); // false
|
|
2298
2298
|
* factory.isGroupConfig(null); // false
|
|
2299
2299
|
* ```
|
|
@@ -2302,20 +2302,20 @@ class ve {
|
|
|
2302
2302
|
return e != null && typeof e == "object" && !this.isFieldConfig(e) && !this.isArrayConfig(e);
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
|
-
class
|
|
2305
|
+
class ye extends M {
|
|
2306
2306
|
/**
|
|
2307
2307
|
* @param control Реактивный массив модели (`model.<path>`).
|
|
2308
2308
|
* @param buildItem Строитель формы элемента по его под-модели (инъекция, чтобы избежать цикла
|
|
2309
2309
|
* импорта с `create-form`). Обычно `(item) => createForm({ model: item, schema: itemSchema(item) })`.
|
|
2310
2310
|
*/
|
|
2311
|
-
constructor(e,
|
|
2312
|
-
super(), this.control = e, this.buildItem =
|
|
2311
|
+
constructor(e, s) {
|
|
2312
|
+
super(), this.control = e, this.buildItem = s, this.initial = e.toArray(), this.disposeSync = _(() => {
|
|
2313
2313
|
const i = e.length, n = [], a = [];
|
|
2314
2314
|
for (let u = 0; u < i; u++) {
|
|
2315
2315
|
const h = e.at(u);
|
|
2316
2316
|
if (!h) continue;
|
|
2317
2317
|
let o = this.cache.get(h);
|
|
2318
|
-
o || (o =
|
|
2318
|
+
o || (o = s(h), this.cache.set(h, o)), n.push(h), a.push(o);
|
|
2319
2319
|
}
|
|
2320
2320
|
const l = new Set(n), d = [];
|
|
2321
2321
|
for (const u of this.mountedModels) {
|
|
@@ -2325,7 +2325,7 @@ class me extends M {
|
|
|
2325
2325
|
}
|
|
2326
2326
|
this.mountedModels = n, this.itemNodes.value = a, d.forEach((u) => this.disposeItemNode(u));
|
|
2327
2327
|
}), this.length = m(() => this.itemNodes.value.length), this.value = m(() => this.itemNodes.value.map((i) => i.value.value));
|
|
2328
|
-
const r =
|
|
2328
|
+
const r = L({
|
|
2329
2329
|
getChildren: () => this.itemNodes.value,
|
|
2330
2330
|
ownErrors: this._arrayErrors
|
|
2331
2331
|
});
|
|
@@ -2361,17 +2361,17 @@ class me extends M {
|
|
|
2361
2361
|
return this.itemNodes.value[e];
|
|
2362
2362
|
}
|
|
2363
2363
|
map(e) {
|
|
2364
|
-
return this.itemNodes.value.map((
|
|
2364
|
+
return this.itemNodes.value.map((s, r) => e(s, r));
|
|
2365
2365
|
}
|
|
2366
2366
|
forEach(e) {
|
|
2367
|
-
this.itemNodes.value.forEach((
|
|
2367
|
+
this.itemNodes.value.forEach((s, r) => e(s, r));
|
|
2368
2368
|
}
|
|
2369
2369
|
// ── Мутации (делегируют массиву модели; effect пересоберёт itemNodes) ──────
|
|
2370
2370
|
push(e) {
|
|
2371
2371
|
this.control.push(e ?? {});
|
|
2372
2372
|
}
|
|
2373
|
-
insert(e,
|
|
2374
|
-
this.control.insertAt(e,
|
|
2373
|
+
insert(e, s) {
|
|
2374
|
+
this.control.insertAt(e, s ?? {});
|
|
2375
2375
|
}
|
|
2376
2376
|
removeAt(e) {
|
|
2377
2377
|
this.control.removeAt(e);
|
|
@@ -2380,12 +2380,12 @@ class me extends M {
|
|
|
2380
2380
|
* Переместить элемент модель-массива. Делегирует мутацию массиву модели; внутренний `effect`
|
|
2381
2381
|
* пересоберёт `itemNodes` в новом порядке (per-item формы сохраняются по кешу идентичности).
|
|
2382
2382
|
*/
|
|
2383
|
-
move(e,
|
|
2384
|
-
this.control.move(e,
|
|
2383
|
+
move(e, s) {
|
|
2384
|
+
this.control.move(e, s);
|
|
2385
2385
|
}
|
|
2386
2386
|
/** Поменять местами два элемента модель-массива (см. {@link move}). */
|
|
2387
|
-
swap(e,
|
|
2388
|
-
this.control.swap(e,
|
|
2387
|
+
swap(e, s) {
|
|
2388
|
+
this.control.swap(e, s);
|
|
2389
2389
|
}
|
|
2390
2390
|
clear() {
|
|
2391
2391
|
this.control.clear();
|
|
@@ -2395,7 +2395,7 @@ class me extends M {
|
|
|
2395
2395
|
return this.control.toArray();
|
|
2396
2396
|
}
|
|
2397
2397
|
setValue(e) {
|
|
2398
|
-
this.control.clear(), (e ?? []).forEach((
|
|
2398
|
+
this.control.clear(), (e ?? []).forEach((s) => this.control.push(s));
|
|
2399
2399
|
}
|
|
2400
2400
|
patchValue(e) {
|
|
2401
2401
|
this.setValue(e);
|
|
@@ -2409,7 +2409,7 @@ class me extends M {
|
|
|
2409
2409
|
async validate() {
|
|
2410
2410
|
return (await Promise.all(
|
|
2411
2411
|
this.itemNodes.value.map(
|
|
2412
|
-
(
|
|
2412
|
+
(s) => s.validate()
|
|
2413
2413
|
)
|
|
2414
2414
|
)).every(Boolean) && this._arrayErrors.value.length === 0;
|
|
2415
2415
|
}
|
|
@@ -2464,25 +2464,25 @@ class me extends M {
|
|
|
2464
2464
|
this.disposeSync(), this.itemNodes.value.forEach((e) => this.disposeItemNode(e)), this.mountedModels = [];
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
|
-
const
|
|
2468
|
-
function I(
|
|
2469
|
-
if (
|
|
2470
|
-
if (typeof
|
|
2467
|
+
const Q = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date) && !(typeof Blob < "u" && t instanceof Blob) && !(typeof File < "u" && t instanceof File);
|
|
2468
|
+
function I(t, e, s) {
|
|
2469
|
+
if (t == null || typeof t != "object" || t instanceof G) return;
|
|
2470
|
+
if (typeof t.getProxy == "function") {
|
|
2471
2471
|
process.env.NODE_ENV !== "production" && console.warn(
|
|
2472
2472
|
"[reformer] createForm({ schema }): в схему попал узел формы (FormProxy) — он пропущен. Стройте дерево для createForm БЕЗ формы, а форму донесите до узла вторым проходом (билдер `(model, form?) => …`) либо через render-behavior `patchProps({ form })`."
|
|
2473
2473
|
);
|
|
2474
2474
|
return;
|
|
2475
2475
|
}
|
|
2476
|
-
if (Array.isArray(
|
|
2477
|
-
for (const n of
|
|
2476
|
+
if (Array.isArray(t)) {
|
|
2477
|
+
for (const n of t) I(n, e, s);
|
|
2478
2478
|
return;
|
|
2479
2479
|
}
|
|
2480
|
-
const r =
|
|
2480
|
+
const r = t, i = r.array;
|
|
2481
2481
|
if (i && typeof i.__path == "string" && typeof r.item == "function") {
|
|
2482
|
-
|
|
2482
|
+
s.set(i.__path, r.item);
|
|
2483
2483
|
return;
|
|
2484
2484
|
}
|
|
2485
|
-
r.value instanceof
|
|
2485
|
+
r.value instanceof G ? e.set(r.value, {
|
|
2486
2486
|
component: r.component,
|
|
2487
2487
|
componentProps: r.componentProps,
|
|
2488
2488
|
updateOn: r.updateOn,
|
|
@@ -2492,68 +2492,68 @@ function I(s, e, t) {
|
|
|
2492
2492
|
"[reformer] createForm({ schema }): узел с `component` не распознан как поле — `value` не является сигналом модели. Ожидается `value: model.$.<path>`; проверьте, что не передан `value: model.<path>` (value-прокси) или `valueSignal:`."
|
|
2493
2493
|
);
|
|
2494
2494
|
for (const [n, a] of Object.entries(r))
|
|
2495
|
-
n !== "value" && I(a, e,
|
|
2495
|
+
n !== "value" && I(a, e, s);
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function X(t, e, s, r) {
|
|
2498
2498
|
const i = {};
|
|
2499
2499
|
for (const [n, a] of Object.entries(e)) {
|
|
2500
|
-
const l =
|
|
2500
|
+
const l = s === "" ? n : `${s}.${n}`;
|
|
2501
2501
|
if (Array.isArray(a))
|
|
2502
2502
|
continue;
|
|
2503
|
-
if (
|
|
2504
|
-
i[n] =
|
|
2503
|
+
if (Q(a)) {
|
|
2504
|
+
i[n] = X(t, a, l, r);
|
|
2505
2505
|
continue;
|
|
2506
2506
|
}
|
|
2507
|
-
const d =
|
|
2507
|
+
const d = t.signalAt(l);
|
|
2508
2508
|
if (!d) throw new Error(`createForm({ model }): не найден сигнал для пути "${l}"`);
|
|
2509
2509
|
const u = r.get(d) ?? {};
|
|
2510
2510
|
i[n] = { ...u, valueSignal: d };
|
|
2511
2511
|
}
|
|
2512
2512
|
return i;
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2515
|
-
for (const [r, i] of Object.entries(
|
|
2514
|
+
function Z(t, e, s) {
|
|
2515
|
+
for (const [r, i] of Object.entries(t)) {
|
|
2516
2516
|
const n = e === "" ? r : `${e}.${r}`;
|
|
2517
|
-
Array.isArray(i) || (
|
|
2517
|
+
Array.isArray(i) || (Q(i) ? Z(i, n, s) : s.push(n));
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2521
|
-
const { model: e, schema:
|
|
2522
|
-
|
|
2523
|
-
const a =
|
|
2520
|
+
function ee(t) {
|
|
2521
|
+
const { model: e, schema: s, behavior: r } = t, i = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
2522
|
+
s !== void 0 && I(s, i, n);
|
|
2523
|
+
const a = X(e, e.get(), "", i), l = new w(a), d = e.get();
|
|
2524
2524
|
for (const [o, f] of Object.entries(d)) {
|
|
2525
2525
|
if (!Array.isArray(f)) continue;
|
|
2526
2526
|
const c = n.get(o);
|
|
2527
2527
|
if (!c) continue;
|
|
2528
|
-
const v = e[o], p = (y) =>
|
|
2528
|
+
const v = e[o], p = (y) => ee({ model: y, schema: c(y) }), b = new ye(v, p);
|
|
2529
2529
|
l.fields.set(o, b);
|
|
2530
2530
|
}
|
|
2531
2531
|
const u = l.getProxy(), h = [];
|
|
2532
|
-
|
|
2532
|
+
Z(e.get(), "", h);
|
|
2533
2533
|
for (const o of h) {
|
|
2534
2534
|
const f = e.signalAt(o), c = l.getFieldByPath(o);
|
|
2535
2535
|
if (f && c) {
|
|
2536
|
-
|
|
2536
|
+
re(f, c);
|
|
2537
2537
|
const v = o.lastIndexOf("."), p = v === -1 ? l : l.getFieldByPath(o.slice(0, v));
|
|
2538
|
-
p instanceof
|
|
2538
|
+
p instanceof w && p.registerFieldSignal(c, f);
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
2541
|
return r && l.attachBehaviorCleanup(r.__run(e, u)), u;
|
|
2542
2542
|
}
|
|
2543
|
-
const
|
|
2544
|
-
function
|
|
2545
|
-
return
|
|
2543
|
+
const ge = (t) => t != null && typeof t == "object" && "model" in t && typeof t.model?.signalAt == "function";
|
|
2544
|
+
function be(t) {
|
|
2545
|
+
return ge(t) ? ee(t) : new w(t).getProxy();
|
|
2546
2546
|
}
|
|
2547
|
-
const
|
|
2547
|
+
const Ee = () => {
|
|
2548
2548
|
};
|
|
2549
|
-
function
|
|
2549
|
+
function _e(t, e) {
|
|
2550
2550
|
if (!e) return;
|
|
2551
|
-
const
|
|
2552
|
-
() =>
|
|
2551
|
+
const s = typeof e == "function" ? { schema: e } : e, r = Object.keys(s.steps ?? {}), i = r.map((o) => s.steps?.[o]).filter((o) => o != null), n = s.schema ?? ie(
|
|
2552
|
+
() => ae(...i, ...s.extras ? [s.extras] : [])
|
|
2553
2553
|
), a = (o) => {
|
|
2554
2554
|
const f = typeof o == "number" ? r[o - 1] : o;
|
|
2555
|
-
return (f != null ?
|
|
2556
|
-
}, { strategy: l, debounce: d, liveAfterSubmit: u } =
|
|
2555
|
+
return (f != null ? s.steps?.[f] : null) ?? null;
|
|
2556
|
+
}, { strategy: l, debounce: d, liveAfterSubmit: u } = s, h = D(t, n, {
|
|
2557
2557
|
strategy: l,
|
|
2558
2558
|
debounce: d,
|
|
2559
2559
|
liveAfterSubmit: u
|
|
@@ -2563,59 +2563,59 @@ function be(s, e) {
|
|
|
2563
2563
|
stepSelectors: r,
|
|
2564
2564
|
validate: () => h.validate(),
|
|
2565
2565
|
validateAll: () => h.validate(),
|
|
2566
|
-
validateStep: (o) =>
|
|
2566
|
+
validateStep: (o) => ne(t, a(o) ?? Ee, { touch: !0 }),
|
|
2567
2567
|
createStepController: (o) => {
|
|
2568
2568
|
if (!l || l === "submit") return null;
|
|
2569
2569
|
const f = a(o);
|
|
2570
|
-
return f ? D(
|
|
2570
|
+
return f ? D(t, f, { strategy: l, debounce: d, liveAfterSubmit: u }) : null;
|
|
2571
2571
|
},
|
|
2572
2572
|
controller: h,
|
|
2573
2573
|
validating: h.validating
|
|
2574
2574
|
};
|
|
2575
2575
|
}
|
|
2576
|
-
function
|
|
2577
|
-
if (!
|
|
2576
|
+
function je(t) {
|
|
2577
|
+
if (!t.model && t.initial === void 0)
|
|
2578
2578
|
throw new Error("createCoreForm: provide either `initial` (to create a model) or `model`.");
|
|
2579
|
-
const e =
|
|
2580
|
-
|
|
2581
|
-
const
|
|
2579
|
+
const e = t.model ?? te(t.initial);
|
|
2580
|
+
t.seed?.(e);
|
|
2581
|
+
const s = be({
|
|
2582
2582
|
model: e,
|
|
2583
|
-
...
|
|
2584
|
-
...
|
|
2585
|
-
}), r =
|
|
2586
|
-
return
|
|
2583
|
+
...t.schema ? { schema: t.schema(e) } : {},
|
|
2584
|
+
...t.behavior ? { behavior: t.behavior } : {}
|
|
2585
|
+
}), r = _e(e, t.validation), i = { model: e, form: s, ...r ? { validation: r } : {} };
|
|
2586
|
+
return t.setup?.(i), i;
|
|
2587
2587
|
}
|
|
2588
|
-
function
|
|
2589
|
-
return
|
|
2588
|
+
function C(t) {
|
|
2589
|
+
return t == null ? !1 : typeof t == "object" && "value" in t && "setValue" in t && "getValue" in t && "validate" in t;
|
|
2590
2590
|
}
|
|
2591
|
-
function
|
|
2592
|
-
return
|
|
2591
|
+
function Se(t) {
|
|
2592
|
+
return C(t) && "validators" in t && "asyncValidators" in t && // FieldNode имеет markAsTouched метод
|
|
2593
2593
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2594
|
-
typeof
|
|
2595
|
-
!("fields" in
|
|
2594
|
+
typeof t.markAsTouched == "function" && // У FieldNode нет fields или items
|
|
2595
|
+
!("fields" in t) && !("items" in t);
|
|
2596
2596
|
}
|
|
2597
|
-
function
|
|
2598
|
-
return
|
|
2599
|
-
!("items" in
|
|
2597
|
+
function Ae(t) {
|
|
2598
|
+
return C(t) && "getFieldByPath" in t && "fields" in t && // GroupNode НЕ имеет items/push/removeAt (это ArrayNode/ModelArrayNode)
|
|
2599
|
+
!("items" in t) && !("push" in t) && !("removeAt" in t);
|
|
2600
2600
|
}
|
|
2601
|
-
function
|
|
2602
|
-
return
|
|
2603
|
-
typeof
|
|
2604
|
-
typeof
|
|
2601
|
+
function we(t) {
|
|
2602
|
+
return C(t) && "items" in t && "length" in t && "push" in t && "removeAt" in t && "at" in t && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2603
|
+
typeof t.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2604
|
+
typeof t.removeAt == "function";
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2607
|
-
return
|
|
2606
|
+
function Ue(t) {
|
|
2607
|
+
return Se(t) ? "FieldNode" : Ae(t) ? "GroupNode" : we(t) ? "ArrayNode" : C(t) ? "FormNode" : "Unknown";
|
|
2608
2608
|
}
|
|
2609
|
-
var
|
|
2609
|
+
var N = { exports: {} }, P = {};
|
|
2610
2610
|
var q;
|
|
2611
|
-
function
|
|
2611
|
+
function Ve() {
|
|
2612
2612
|
if (q) return P;
|
|
2613
2613
|
q = 1;
|
|
2614
|
-
var
|
|
2614
|
+
var t = Y;
|
|
2615
2615
|
function e(o, f) {
|
|
2616
2616
|
return o === f && (o !== 0 || 1 / o === 1 / f) || o !== o && f !== f;
|
|
2617
2617
|
}
|
|
2618
|
-
var
|
|
2618
|
+
var s = typeof Object.is == "function" ? Object.is : e, r = t.useState, i = t.useEffect, n = t.useLayoutEffect, a = t.useDebugValue;
|
|
2619
2619
|
function l(o, f) {
|
|
2620
2620
|
var c = f(), v = r({ inst: { value: c, getSnapshot: f } }), p = v[0].inst, b = v[1];
|
|
2621
2621
|
return n(
|
|
@@ -2637,7 +2637,7 @@ function Ae() {
|
|
|
2637
2637
|
o = o.value;
|
|
2638
2638
|
try {
|
|
2639
2639
|
var c = f();
|
|
2640
|
-
return !
|
|
2640
|
+
return !s(o, c);
|
|
2641
2641
|
} catch {
|
|
2642
2642
|
return !0;
|
|
2643
2643
|
}
|
|
@@ -2646,13 +2646,13 @@ function Ae() {
|
|
|
2646
2646
|
return f();
|
|
2647
2647
|
}
|
|
2648
2648
|
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : l;
|
|
2649
|
-
return P.useSyncExternalStore =
|
|
2649
|
+
return P.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : h, P;
|
|
2650
2650
|
}
|
|
2651
2651
|
var T = {};
|
|
2652
|
-
var
|
|
2653
|
-
function
|
|
2654
|
-
return
|
|
2655
|
-
function
|
|
2652
|
+
var H;
|
|
2653
|
+
function ke() {
|
|
2654
|
+
return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
2655
|
+
function t(c, v) {
|
|
2656
2656
|
return c === v && (c !== 0 || 1 / c === 1 / v) || c !== c && v !== v;
|
|
2657
2657
|
}
|
|
2658
2658
|
function e(c, v) {
|
|
@@ -2669,22 +2669,22 @@ function we() {
|
|
|
2669
2669
|
b = a({
|
|
2670
2670
|
inst: { value: p, getSnapshot: v }
|
|
2671
2671
|
});
|
|
2672
|
-
var y = b[0].inst,
|
|
2672
|
+
var y = b[0].inst, V = b[1];
|
|
2673
2673
|
return d(
|
|
2674
2674
|
function() {
|
|
2675
|
-
y.value = p, y.getSnapshot = v,
|
|
2675
|
+
y.value = p, y.getSnapshot = v, s(y) && V({ inst: y });
|
|
2676
2676
|
},
|
|
2677
2677
|
[c, p, v]
|
|
2678
2678
|
), l(
|
|
2679
2679
|
function() {
|
|
2680
|
-
return
|
|
2681
|
-
|
|
2680
|
+
return s(y) && V({ inst: y }), c(function() {
|
|
2681
|
+
s(y) && V({ inst: y });
|
|
2682
2682
|
});
|
|
2683
2683
|
},
|
|
2684
2684
|
[c]
|
|
2685
2685
|
), u(p), p;
|
|
2686
2686
|
}
|
|
2687
|
-
function
|
|
2687
|
+
function s(c) {
|
|
2688
2688
|
var v = c.getSnapshot;
|
|
2689
2689
|
c = c.value;
|
|
2690
2690
|
try {
|
|
@@ -2698,32 +2698,32 @@ function we() {
|
|
|
2698
2698
|
return v();
|
|
2699
2699
|
}
|
|
2700
2700
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
2701
|
-
var i =
|
|
2701
|
+
var i = Y, n = typeof Object.is == "function" ? Object.is : t, a = i.useState, l = i.useEffect, d = i.useLayoutEffect, u = i.useDebugValue, h = !1, o = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : e;
|
|
2702
2702
|
T.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
2703
2703
|
})()), T;
|
|
2704
2704
|
}
|
|
2705
|
-
var
|
|
2706
|
-
function
|
|
2707
|
-
return
|
|
2705
|
+
var K;
|
|
2706
|
+
function Fe() {
|
|
2707
|
+
return K || (K = 1, process.env.NODE_ENV === "production" ? N.exports = Ve() : N.exports = ke()), N.exports;
|
|
2708
2708
|
}
|
|
2709
|
-
var
|
|
2710
|
-
function
|
|
2711
|
-
if (
|
|
2712
|
-
if (
|
|
2713
|
-
for (let
|
|
2714
|
-
if (s
|
|
2709
|
+
var x = Fe();
|
|
2710
|
+
function Oe(t, e) {
|
|
2711
|
+
if (t === e) return !0;
|
|
2712
|
+
if (t.length !== e.length) return !1;
|
|
2713
|
+
for (let s = 0; s < t.length; s++)
|
|
2714
|
+
if (t[s] !== e[s]) return !1;
|
|
2715
2715
|
return !0;
|
|
2716
2716
|
}
|
|
2717
|
-
function $(
|
|
2718
|
-
const i =
|
|
2719
|
-
n.current =
|
|
2720
|
-
const a =
|
|
2717
|
+
function $(t, e, s, r) {
|
|
2718
|
+
const i = A(null), n = A(t);
|
|
2719
|
+
n.current = t;
|
|
2720
|
+
const a = A(e);
|
|
2721
2721
|
a.current = e;
|
|
2722
|
-
const l =
|
|
2723
|
-
if (l.current =
|
|
2722
|
+
const l = A(s);
|
|
2723
|
+
if (l.current = s, i.current === null) {
|
|
2724
2724
|
const h = {};
|
|
2725
|
-
for (const o in
|
|
2726
|
-
h[o] =
|
|
2725
|
+
for (const o in t)
|
|
2726
|
+
h[o] = t[o].value;
|
|
2727
2727
|
i.current = { ...h, __snapshot: null };
|
|
2728
2728
|
}
|
|
2729
2729
|
const d = E(
|
|
@@ -2752,13 +2752,13 @@ function $(s, e, t, r) {
|
|
|
2752
2752
|
f[v] = o[v].value;
|
|
2753
2753
|
let c = !1;
|
|
2754
2754
|
for (const v of a.current) {
|
|
2755
|
-
const { key: p, useShallowArrayEqual: b } = v, y = f[p],
|
|
2755
|
+
const { key: p, useShallowArrayEqual: b } = v, y = f[p], V = h[p];
|
|
2756
2756
|
if (b) {
|
|
2757
|
-
if (!
|
|
2757
|
+
if (!Oe(V, y)) {
|
|
2758
2758
|
c = !0;
|
|
2759
2759
|
break;
|
|
2760
2760
|
}
|
|
2761
|
-
} else if (
|
|
2761
|
+
} else if (V !== y) {
|
|
2762
2762
|
c = !0;
|
|
2763
2763
|
break;
|
|
2764
2764
|
}
|
|
@@ -2769,21 +2769,21 @@ function $(s, e, t, r) {
|
|
|
2769
2769
|
h[v] = f[v];
|
|
2770
2770
|
return h.__snapshot = l.current(f), h.__snapshot;
|
|
2771
2771
|
}, [r]);
|
|
2772
|
-
return
|
|
2772
|
+
return x.useSyncExternalStore(d, u, u);
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function Ne(t) {
|
|
2775
2775
|
const e = {
|
|
2776
|
-
value:
|
|
2777
|
-
disabled:
|
|
2778
|
-
errors:
|
|
2779
|
-
pending:
|
|
2780
|
-
valid:
|
|
2781
|
-
invalid:
|
|
2782
|
-
touched:
|
|
2783
|
-
dirty:
|
|
2784
|
-
shouldShowError:
|
|
2785
|
-
componentProps:
|
|
2786
|
-
},
|
|
2776
|
+
value: t.value,
|
|
2777
|
+
disabled: t.disabled,
|
|
2778
|
+
errors: t.errors,
|
|
2779
|
+
pending: t.pending,
|
|
2780
|
+
valid: t.valid,
|
|
2781
|
+
invalid: t.invalid,
|
|
2782
|
+
touched: t.touched,
|
|
2783
|
+
dirty: t.dirty,
|
|
2784
|
+
shouldShowError: t.shouldShowError,
|
|
2785
|
+
componentProps: t.componentProps
|
|
2786
|
+
}, s = [
|
|
2787
2787
|
{ key: "value" },
|
|
2788
2788
|
{ key: "disabled" },
|
|
2789
2789
|
{ key: "errors", useShallowArrayEqual: !0 },
|
|
@@ -2809,20 +2809,20 @@ function Oe(s) {
|
|
|
2809
2809
|
}),
|
|
2810
2810
|
[]
|
|
2811
2811
|
);
|
|
2812
|
-
return $(e,
|
|
2812
|
+
return $(e, s, r, t);
|
|
2813
2813
|
}
|
|
2814
|
-
function
|
|
2814
|
+
function Me(t) {
|
|
2815
2815
|
const e = {
|
|
2816
|
-
value:
|
|
2817
|
-
length:
|
|
2818
|
-
errors:
|
|
2819
|
-
pending:
|
|
2820
|
-
valid:
|
|
2821
|
-
invalid:
|
|
2822
|
-
touched:
|
|
2823
|
-
dirty:
|
|
2824
|
-
disabled:
|
|
2825
|
-
},
|
|
2816
|
+
value: t.value,
|
|
2817
|
+
length: t.length,
|
|
2818
|
+
errors: t.errors,
|
|
2819
|
+
pending: t.pending,
|
|
2820
|
+
valid: t.valid,
|
|
2821
|
+
invalid: t.invalid,
|
|
2822
|
+
touched: t.touched,
|
|
2823
|
+
dirty: t.dirty,
|
|
2824
|
+
disabled: t.disabled
|
|
2825
|
+
}, s = [
|
|
2826
2826
|
{ key: "value" },
|
|
2827
2827
|
{ key: "length" },
|
|
2828
2828
|
{ key: "errors", useShallowArrayEqual: !0 },
|
|
@@ -2846,10 +2846,10 @@ function Ne(s) {
|
|
|
2846
2846
|
}),
|
|
2847
2847
|
[]
|
|
2848
2848
|
);
|
|
2849
|
-
return $(e,
|
|
2849
|
+
return $(e, s, r, t);
|
|
2850
2850
|
}
|
|
2851
|
-
function
|
|
2852
|
-
const
|
|
2851
|
+
function Ce() {
|
|
2852
|
+
const t = E(
|
|
2853
2853
|
() => ({
|
|
2854
2854
|
value: [],
|
|
2855
2855
|
length: 0,
|
|
@@ -2863,57 +2863,57 @@ function Fe() {
|
|
|
2863
2863
|
}),
|
|
2864
2864
|
[]
|
|
2865
2865
|
);
|
|
2866
|
-
return $({}, [],
|
|
2866
|
+
return $({}, [], t);
|
|
2867
2867
|
}
|
|
2868
|
-
function
|
|
2869
|
-
const e =
|
|
2870
|
-
return
|
|
2868
|
+
function We(t) {
|
|
2869
|
+
const e = t && "length" in t && "map" in t;
|
|
2870
|
+
return t ? e ? Me(t) : Ne(t) : Ce();
|
|
2871
2871
|
}
|
|
2872
|
-
function
|
|
2873
|
-
const e =
|
|
2872
|
+
function qe(t) {
|
|
2873
|
+
const e = A({ value: t.value.value }), s = E(
|
|
2874
2874
|
(i) => {
|
|
2875
2875
|
let n = !0;
|
|
2876
2876
|
return _(() => {
|
|
2877
|
-
if (
|
|
2877
|
+
if (t.value.value, n) {
|
|
2878
2878
|
n = !1;
|
|
2879
2879
|
return;
|
|
2880
2880
|
}
|
|
2881
2881
|
i();
|
|
2882
2882
|
});
|
|
2883
2883
|
},
|
|
2884
|
-
[
|
|
2884
|
+
[t]
|
|
2885
2885
|
), r = E(() => {
|
|
2886
|
-
const i =
|
|
2886
|
+
const i = t.value.value;
|
|
2887
2887
|
return e.current.value === i ? e.current.value : (e.current.value = i, i);
|
|
2888
|
-
}, [
|
|
2889
|
-
return
|
|
2888
|
+
}, [t]);
|
|
2889
|
+
return x.useSyncExternalStore(s, r, r);
|
|
2890
2890
|
}
|
|
2891
|
-
function
|
|
2892
|
-
const e =
|
|
2891
|
+
function He(t) {
|
|
2892
|
+
const e = A({ length: t.length.value }), s = E(
|
|
2893
2893
|
(i) => {
|
|
2894
2894
|
let n = !0;
|
|
2895
2895
|
return _(() => {
|
|
2896
|
-
if (
|
|
2896
|
+
if (t.length.value, n) {
|
|
2897
2897
|
n = !1;
|
|
2898
2898
|
return;
|
|
2899
2899
|
}
|
|
2900
2900
|
i();
|
|
2901
2901
|
});
|
|
2902
2902
|
},
|
|
2903
|
-
[
|
|
2903
|
+
[t]
|
|
2904
2904
|
), r = E(() => {
|
|
2905
|
-
const i =
|
|
2905
|
+
const i = t.length.value;
|
|
2906
2906
|
return e.current.length === i ? e.current.length : (e.current.length = i, i);
|
|
2907
|
-
}, [
|
|
2908
|
-
return
|
|
2907
|
+
}, [t]);
|
|
2908
|
+
return x.useSyncExternalStore(s, r, r);
|
|
2909
2909
|
}
|
|
2910
|
-
function
|
|
2911
|
-
const { model: e, schema:
|
|
2912
|
-
() => D(e,
|
|
2913
|
-
[e,
|
|
2910
|
+
function Ke(t) {
|
|
2911
|
+
const { model: e, schema: s, strategy: r, debounce: i, liveAfterSubmit: n } = t, a = oe(
|
|
2912
|
+
() => D(e, s, { strategy: r, debounce: i, liveAfterSubmit: n }),
|
|
2913
|
+
[e, s, r, i, n]
|
|
2914
2914
|
);
|
|
2915
|
-
|
|
2916
|
-
const l =
|
|
2915
|
+
J(() => a.start(), [a]);
|
|
2916
|
+
const l = x.useSyncExternalStore(
|
|
2917
2917
|
E((u) => a.validating.subscribe(u), [a]),
|
|
2918
2918
|
() => a.validating.peek(),
|
|
2919
2919
|
() => !1
|
|
@@ -2921,55 +2921,99 @@ function je(s) {
|
|
|
2921
2921
|
), d = E(() => a.validate(), [a]);
|
|
2922
2922
|
return { submit: d, validate: d, isValidating: l };
|
|
2923
2923
|
}
|
|
2924
|
-
function
|
|
2925
|
-
const [e] =
|
|
2926
|
-
return
|
|
2924
|
+
function ze(t) {
|
|
2925
|
+
const [e] = le(t), s = e.validation?.controller;
|
|
2926
|
+
return J(() => s?.start(), [s]), e;
|
|
2927
|
+
}
|
|
2928
|
+
const xe = ["labelTooltip"];
|
|
2929
|
+
function Ye(t) {
|
|
2930
|
+
if (!(t == null || typeof t != "function" && typeof t != "object"))
|
|
2931
|
+
return t.reformerAdapter;
|
|
2932
|
+
}
|
|
2933
|
+
const z = (t) => t;
|
|
2934
|
+
function Je(t, e, s = {}) {
|
|
2935
|
+
const r = { ...s };
|
|
2936
|
+
for (const n of xe) delete r[n];
|
|
2937
|
+
for (const n of t?.strip ?? []) delete r[n];
|
|
2938
|
+
if (!t)
|
|
2939
|
+
return { ...r, value: e.value, onChange: e.onChange, onBlur: e.onBlur };
|
|
2940
|
+
const i = t.fromEmit ?? z;
|
|
2941
|
+
return {
|
|
2942
|
+
...r,
|
|
2943
|
+
[t.valueProp ?? "value"]: (t.toValue ?? z)(e.value),
|
|
2944
|
+
[t.changeProp ?? "onChange"]: (n) => e.onChange(i(n, r)),
|
|
2945
|
+
...t.bindBlur ? t.bindBlur(e.onBlur) : { onBlur: e.onBlur }
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
function Pe(t) {
|
|
2949
|
+
return {
|
|
2950
|
+
focus: () => t.current?.focus(),
|
|
2951
|
+
blur: () => t.current?.blur(),
|
|
2952
|
+
scrollIntoView: (e) => t.current?.scrollIntoView(e),
|
|
2953
|
+
getElement: () => t.current
|
|
2954
|
+
};
|
|
2955
|
+
}
|
|
2956
|
+
function Te(t) {
|
|
2957
|
+
return typeof t == "object" && t !== null && t.nodeType === 1;
|
|
2958
|
+
}
|
|
2959
|
+
function Qe(t) {
|
|
2960
|
+
const e = A(null);
|
|
2961
|
+
return ue(t, () => De(e)), e;
|
|
2962
|
+
}
|
|
2963
|
+
function De(t) {
|
|
2964
|
+
const e = t.current;
|
|
2965
|
+
return e == null || Te(e) ? Pe(t) : e;
|
|
2927
2966
|
}
|
|
2928
|
-
const
|
|
2967
|
+
const Xe = Object.freeze({ runtime: "reformer-core", v: 1 });
|
|
2929
2968
|
export {
|
|
2930
2969
|
W as ArrayNode,
|
|
2931
|
-
|
|
2970
|
+
Xe as CORE_RUNTIME_TOKEN,
|
|
2932
2971
|
S as ErrorStrategy,
|
|
2933
|
-
|
|
2934
|
-
|
|
2972
|
+
xe as FIELD_WRAPPER_ONLY_PROPS,
|
|
2973
|
+
he as FieldNode,
|
|
2974
|
+
k as FormErrorHandler,
|
|
2935
2975
|
M as FormNode,
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
ee as
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2976
|
+
ve as FormSubmitter,
|
|
2977
|
+
w as GroupNode,
|
|
2978
|
+
ye as ModelArrayNode,
|
|
2979
|
+
pe as NodeFactory,
|
|
2980
|
+
R as SubscriptionManager,
|
|
2981
|
+
Je as bindFieldProps,
|
|
2982
|
+
_e as buildValidation,
|
|
2983
|
+
ot as computeFrom,
|
|
2984
|
+
lt as copyFrom,
|
|
2985
|
+
je as createCoreForm,
|
|
2986
|
+
be as createForm,
|
|
2987
|
+
ee as createFormFromModel,
|
|
2988
|
+
te as createModel,
|
|
2989
|
+
Et as disableWhen,
|
|
2990
|
+
tt as eachLeafSignal,
|
|
2991
|
+
_t as enableWhen,
|
|
2992
|
+
Ye as getFieldAdapter,
|
|
2993
|
+
gt as getNodeForSignal,
|
|
2994
|
+
Ue as getNodeType,
|
|
2995
|
+
we as isArrayNode,
|
|
2996
|
+
B as isDerived,
|
|
2997
|
+
Se as isFieldNode,
|
|
2998
|
+
C as isFormNode,
|
|
2999
|
+
Ae as isGroupNode,
|
|
3000
|
+
rt as isModelContainerSignal,
|
|
3001
|
+
Pe as makeElementFieldHandle,
|
|
3002
|
+
it as markDerived,
|
|
3003
|
+
re as registerSignalNode,
|
|
3004
|
+
ut as resetWhen,
|
|
3005
|
+
dt as revalidateWhen,
|
|
3006
|
+
ct as runOutsideEffect,
|
|
3007
|
+
ht as safeCallback,
|
|
3008
|
+
ft as safeDebouncedCallback,
|
|
3009
|
+
vt as syncFields,
|
|
3010
|
+
mt as transformValue,
|
|
3011
|
+
nt as unmarkDerived,
|
|
3012
|
+
He as useArrayLength,
|
|
3013
|
+
Qe as useFieldHandleRef,
|
|
3014
|
+
ze as useFormBundle,
|
|
3015
|
+
We as useFormControl,
|
|
3016
|
+
qe as useFormControlValue,
|
|
3017
|
+
Ke as useFormValidation,
|
|
3018
|
+
pt as watchField
|
|
2975
3019
|
};
|