@reformer/core 7.0.0 → 9.0.0-beta.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/core/factories/node-factory.d.ts +5 -4
- package/dist/core/model/types.d.ts +41 -12
- package/dist/core/model/validate-model.d.ts +8 -4
- package/dist/core/nodes/field-node.d.ts +2 -2
- package/dist/core/nodes/group-node.d.ts +7 -1
- package/dist/core/nodes/model-array-node.d.ts +5 -0
- package/dist/core/types/deep-schema.d.ts +16 -4
- package/dist/core/types/form-proxy.d.ts +1 -1
- package/dist/core/types/index.d.ts +4 -10
- package/dist/core/types/schema-node.d.ts +79 -0
- package/dist/core/types/validation-schema.d.ts +22 -11
- package/dist/core/utils/create-form.d.ts +4 -3
- package/dist/core/utils/error-handler.d.ts +4 -1
- package/dist/core/utils/form-submitter.d.ts +2 -3
- package/dist/core/utils/type-guards.d.ts +3 -3
- package/dist/core/validation/validators/date-utils.d.ts +5 -1
- package/dist/core/validation/validators/integer.d.ts +1 -1
- package/dist/core/validation/validators/is-number.d.ts +1 -1
- package/dist/core/validation/validators/max.d.ts +1 -1
- package/dist/core/validation/validators/min.d.ts +1 -1
- package/dist/core/validation/validators/multiple-of.d.ts +1 -1
- package/dist/core/validation/validators/non-negative.d.ts +1 -1
- package/dist/core/validation/validators/non-zero.d.ts +1 -1
- package/dist/{date-utils-xUWFslTj.js → date-utils-dTT_x_Be.js} +12 -10
- package/dist/hooks/types.d.ts +1 -1
- package/dist/hooks/useArrayLength.d.ts +1 -2
- package/dist/hooks/useFormControl.d.ts +2 -2
- package/dist/index.js +514 -514
- package/dist/signals.d.ts +13 -0
- package/dist/signals.js +9 -0
- package/dist/validators/future-date.js +1 -1
- package/dist/validators/is-date.js +1 -1
- package/dist/validators/max-age.js +1 -1
- package/dist/validators/max-date.js +1 -1
- package/dist/validators/min-age.js +1 -1
- package/dist/validators/min-date.js +1 -1
- package/dist/validators/multiple-of.js +11 -7
- package/dist/validators/past-date.js +1 -1
- package/llms.txt +586 -164
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { signal as y, computed as h, effect as _, batch as me, Signal as
|
|
2
|
-
import { i as B, d as ye, g as
|
|
3
|
-
import { j as
|
|
4
|
-
import
|
|
5
|
-
import { default as
|
|
6
|
-
class
|
|
1
|
+
import { signal as y, computed as h, effect as _, batch as me, Signal as re } from "@preact/signals-core";
|
|
2
|
+
import { i as B, d as ye, g as Q } from "./behaviors-O9a1Djj9.js";
|
|
3
|
+
import { j as nt, c as at, k as ot, e as lt, m as ut, a as ct, b as ht, r as dt, f as ft, h as pt, s as vt, t as mt, w as yt } from "./behaviors-O9a1Djj9.js";
|
|
4
|
+
import ne, { useRef as q, useCallback as E } from "react";
|
|
5
|
+
import { default as bt } from "./validators.js";
|
|
6
|
+
class D {
|
|
7
7
|
// ============================================================================
|
|
8
8
|
// Protected состояние (для Template Method паттерна)
|
|
9
9
|
// ============================================================================
|
|
@@ -97,17 +97,17 @@ class I {
|
|
|
97
97
|
*/
|
|
98
98
|
getErrors(e) {
|
|
99
99
|
const t = this.errors.value;
|
|
100
|
-
return e ? t.filter((
|
|
101
|
-
if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(
|
|
100
|
+
return e ? t.filter((s) => {
|
|
101
|
+
if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(s.code) || e.message !== void 0 && !s.message.toLowerCase().includes(e.message.toLowerCase()))
|
|
102
102
|
return !1;
|
|
103
103
|
if (e.params !== void 0) {
|
|
104
|
-
if (!
|
|
104
|
+
if (!s.params)
|
|
105
105
|
return !1;
|
|
106
106
|
for (const [r, n] of Object.entries(e.params))
|
|
107
|
-
if (
|
|
107
|
+
if (s.params[r] !== n)
|
|
108
108
|
return !1;
|
|
109
109
|
}
|
|
110
|
-
return !(e.predicate !== void 0 && !e.predicate(
|
|
110
|
+
return !(e.predicate !== void 0 && !e.predicate(s));
|
|
111
111
|
}) : t;
|
|
112
112
|
}
|
|
113
113
|
// ============================================================================
|
|
@@ -448,7 +448,7 @@ class K {
|
|
|
448
448
|
this.clear();
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const
|
|
451
|
+
const k = {
|
|
452
452
|
/** FieldNode.watch() */
|
|
453
453
|
Watch: "watch",
|
|
454
454
|
/** FieldNode.computeFrom() */
|
|
@@ -463,53 +463,14 @@ const O = {
|
|
|
463
463
|
WatchLength: "watchLength"
|
|
464
464
|
};
|
|
465
465
|
let ge = 0;
|
|
466
|
-
function
|
|
467
|
-
return `${
|
|
466
|
+
function V(i) {
|
|
467
|
+
return `${i}-${++ge}`;
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
class
|
|
471
|
-
|
|
472
|
-
* Обработать ошибку согласно заданной стратегии
|
|
473
|
-
*
|
|
474
|
-
* @param error Ошибка для обработки (Error | string | unknown)
|
|
475
|
-
* @param context Контекст ошибки для логирования (например, 'AsyncValidator', 'BehaviorRegistry')
|
|
476
|
-
* @param strategy Стратегия обработки (THROW | LOG | CONVERT)
|
|
477
|
-
* @returns ValidationError если strategy = CONVERT, undefined если strategy = LOG, никогда не возвращается если strategy = THROW
|
|
478
|
-
*
|
|
479
|
-
* @example
|
|
480
|
-
* ```typescript
|
|
481
|
-
* // THROW - пробросить ошибку
|
|
482
|
-
* try {
|
|
483
|
-
* riskyOperation();
|
|
484
|
-
* } catch (error) {
|
|
485
|
-
* FormErrorHandler.handle(error, 'RiskyOperation', ErrorStrategy.THROW);
|
|
486
|
-
* // Этот код никогда не выполнится
|
|
487
|
-
* }
|
|
488
|
-
*
|
|
489
|
-
* // LOG - залогировать и продолжить
|
|
490
|
-
* try {
|
|
491
|
-
* nonCriticalOperation();
|
|
492
|
-
* } catch (error) {
|
|
493
|
-
* FormErrorHandler.handle(error, 'NonCritical', ErrorStrategy.LOG);
|
|
494
|
-
* // Продолжаем выполнение
|
|
495
|
-
* }
|
|
496
|
-
*
|
|
497
|
-
* // CONVERT - конвертировать в ValidationError
|
|
498
|
-
* try {
|
|
499
|
-
* await validator(value);
|
|
500
|
-
* } catch (error) {
|
|
501
|
-
* const validationError = FormErrorHandler.handle(
|
|
502
|
-
* error,
|
|
503
|
-
* 'AsyncValidator',
|
|
504
|
-
* ErrorStrategy.CONVERT
|
|
505
|
-
* );
|
|
506
|
-
* return validationError;
|
|
507
|
-
* }
|
|
508
|
-
* ```
|
|
509
|
-
*/
|
|
510
|
-
static handle(e, t, i = "throw") {
|
|
469
|
+
var S = /* @__PURE__ */ ((i) => (i.THROW = "throw", i.LOG = "log", i.CONVERT = "convert", i))(S || {});
|
|
470
|
+
class O {
|
|
471
|
+
static handle(e, t, s = "throw") {
|
|
511
472
|
const r = this.extractMessage(e);
|
|
512
|
-
switch (
|
|
473
|
+
switch (s) {
|
|
513
474
|
case "throw":
|
|
514
475
|
throw e;
|
|
515
476
|
case "log":
|
|
@@ -573,11 +534,11 @@ class k {
|
|
|
573
534
|
* // { code: 'required', message: 'This field is required', field: 'email' }
|
|
574
535
|
* ```
|
|
575
536
|
*/
|
|
576
|
-
static createValidationError(e, t,
|
|
537
|
+
static createValidationError(e, t, s) {
|
|
577
538
|
return {
|
|
578
539
|
code: e,
|
|
579
540
|
message: t,
|
|
580
|
-
params:
|
|
541
|
+
params: s ? { field: s } : void 0
|
|
581
542
|
};
|
|
582
543
|
}
|
|
583
544
|
/**
|
|
@@ -649,7 +610,7 @@ class be {
|
|
|
649
610
|
* ```
|
|
650
611
|
*/
|
|
651
612
|
completeValidation(e) {
|
|
652
|
-
|
|
613
|
+
this._status.value !== "disabled" && (this._status.value = e ? "invalid" : "valid");
|
|
653
614
|
}
|
|
654
615
|
/**
|
|
655
616
|
* Установить ошибки напрямую (без перехода через pending)
|
|
@@ -744,7 +705,7 @@ class be {
|
|
|
744
705
|
return this._status.value !== "disabled";
|
|
745
706
|
}
|
|
746
707
|
}
|
|
747
|
-
class _e extends
|
|
708
|
+
class _e extends D {
|
|
748
709
|
// ============================================================================
|
|
749
710
|
// Приватные сигналы
|
|
750
711
|
// ============================================================================
|
|
@@ -752,7 +713,6 @@ class _e extends I {
|
|
|
752
713
|
_errors;
|
|
753
714
|
// _touched, _dirty наследуются от FormNode (protected)
|
|
754
715
|
// _status управляется через statusMachine
|
|
755
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
756
716
|
_componentProps;
|
|
757
717
|
/**
|
|
758
718
|
* State machine для управления статусом поля
|
|
@@ -772,7 +732,6 @@ class _e extends I {
|
|
|
772
732
|
disabled;
|
|
773
733
|
// touched, dirty наследуются от FormNode
|
|
774
734
|
errors;
|
|
775
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
776
735
|
componentProps;
|
|
777
736
|
/**
|
|
778
737
|
* Вычисляемое свойство: нужно ли показывать ошибку
|
|
@@ -817,12 +776,12 @@ class _e extends I {
|
|
|
817
776
|
setValue(e, t) {
|
|
818
777
|
if (this._value.value = e, this._dirty.value = !0, t?.emitEvent === !1)
|
|
819
778
|
return;
|
|
820
|
-
const
|
|
779
|
+
const s = this.validators.length > 0 || this.asyncValidators.length > 0, r = this._errors.value.length > 0;
|
|
821
780
|
if (this.updateOn === "change") {
|
|
822
781
|
this.validate();
|
|
823
782
|
return;
|
|
824
783
|
}
|
|
825
|
-
r &&
|
|
784
|
+
r && s && this.validate();
|
|
826
785
|
}
|
|
827
786
|
patchValue(e) {
|
|
828
787
|
this.setValue(e);
|
|
@@ -915,17 +874,17 @@ class _e extends I {
|
|
|
915
874
|
const t = e?.debounce ?? this.debounceMs;
|
|
916
875
|
if (this.cancelPendingValidation(), t <= 0 || this.asyncValidators.length === 0)
|
|
917
876
|
return this.validateImmediate();
|
|
918
|
-
const
|
|
877
|
+
const s = new AbortController();
|
|
919
878
|
return new Promise((r) => {
|
|
920
|
-
this.pendingValidation = { resolve: r, abortController:
|
|
921
|
-
if (this.validateDebounceTimer = void 0,
|
|
879
|
+
this.pendingValidation = { resolve: r, abortController: s }, this.validateDebounceTimer = setTimeout(async () => {
|
|
880
|
+
if (this.validateDebounceTimer = void 0, s.signal.aborted) {
|
|
922
881
|
r(!1);
|
|
923
882
|
return;
|
|
924
883
|
}
|
|
925
884
|
this.pendingValidation = void 0;
|
|
926
|
-
const n = await this.validateImmediate(
|
|
885
|
+
const n = await this.validateImmediate(s);
|
|
927
886
|
r(n);
|
|
928
|
-
}, t),
|
|
887
|
+
}, t), s.signal.addEventListener(
|
|
929
888
|
"abort",
|
|
930
889
|
() => {
|
|
931
890
|
this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0), r(!1);
|
|
@@ -947,12 +906,12 @@ class _e extends I {
|
|
|
947
906
|
async validateImmediate(e) {
|
|
948
907
|
const t = e ?? new AbortController();
|
|
949
908
|
e || this.currentAbortController?.abort(), this.currentAbortController = t;
|
|
950
|
-
const { signal:
|
|
909
|
+
const { signal: s } = t, r = [];
|
|
951
910
|
for (const a of this.validators) {
|
|
952
911
|
const o = a(this._value.value);
|
|
953
912
|
o && r.push(o);
|
|
954
913
|
}
|
|
955
|
-
if (
|
|
914
|
+
if (s.aborted)
|
|
956
915
|
return !1;
|
|
957
916
|
if (r.length > 0) {
|
|
958
917
|
this._errors.value = r;
|
|
@@ -961,33 +920,33 @@ class _e extends I {
|
|
|
961
920
|
return !1;
|
|
962
921
|
}
|
|
963
922
|
if (this.asyncValidators.length > 0) {
|
|
964
|
-
if (
|
|
923
|
+
if (s.aborted)
|
|
965
924
|
return !1;
|
|
966
925
|
this.statusMachine.startValidation();
|
|
967
926
|
try {
|
|
968
927
|
const a = await Promise.all(
|
|
969
928
|
this.asyncValidators.map(async (l) => {
|
|
970
|
-
if (
|
|
929
|
+
if (s.aborted)
|
|
971
930
|
throw new DOMException("Validation aborted", "AbortError");
|
|
972
931
|
try {
|
|
973
|
-
const u = await l(this._value.value, { signal:
|
|
974
|
-
if (
|
|
932
|
+
const u = await l(this._value.value, { signal: s });
|
|
933
|
+
if (s.aborted)
|
|
975
934
|
throw new DOMException("Validation aborted", "AbortError");
|
|
976
935
|
return u;
|
|
977
936
|
} catch (u) {
|
|
978
937
|
if (u instanceof DOMException && u.name === "AbortError")
|
|
979
938
|
throw u;
|
|
980
|
-
return
|
|
939
|
+
return O.handle(
|
|
981
940
|
u,
|
|
982
941
|
"FieldNode AsyncValidator",
|
|
983
|
-
|
|
942
|
+
S.CONVERT
|
|
984
943
|
);
|
|
985
944
|
}
|
|
986
945
|
})
|
|
987
946
|
);
|
|
988
|
-
if (
|
|
947
|
+
if (s.aborted)
|
|
989
948
|
return !1;
|
|
990
|
-
const o = a.filter(
|
|
949
|
+
const o = a.filter((l) => l !== null);
|
|
991
950
|
if (o.length > 0) {
|
|
992
951
|
this._errors.value = o;
|
|
993
952
|
const l = o.some((u) => u.severity !== "warning");
|
|
@@ -1000,11 +959,11 @@ class _e extends I {
|
|
|
1000
959
|
throw a;
|
|
1001
960
|
}
|
|
1002
961
|
}
|
|
1003
|
-
return
|
|
962
|
+
return s.aborted ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this.statusMachine.completeValidation(!1)), !this._errors.value.some((a) => a.severity !== "warning"));
|
|
1004
963
|
}
|
|
1005
964
|
setErrors(e) {
|
|
1006
965
|
this._errors.value = e;
|
|
1007
|
-
const t = e.some((
|
|
966
|
+
const t = e.some((s) => s.severity !== "warning");
|
|
1008
967
|
this.statusMachine.setErrors(t);
|
|
1009
968
|
}
|
|
1010
969
|
clearErrors() {
|
|
@@ -1048,7 +1007,6 @@ class _e extends I {
|
|
|
1048
1007
|
* });
|
|
1049
1008
|
* ```
|
|
1050
1009
|
*/
|
|
1051
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1052
1010
|
updateComponentProps(e) {
|
|
1053
1011
|
this._componentProps.value = {
|
|
1054
1012
|
...this._componentProps.value,
|
|
@@ -1122,12 +1080,12 @@ class _e extends I {
|
|
|
1122
1080
|
* ```
|
|
1123
1081
|
*/
|
|
1124
1082
|
watch(e) {
|
|
1125
|
-
const t = new AbortController(),
|
|
1083
|
+
const t = new AbortController(), s = _(() => {
|
|
1126
1084
|
const n = this.value.value;
|
|
1127
1085
|
e(n, t.signal);
|
|
1128
|
-
}), r =
|
|
1086
|
+
}), r = V(k.Watch);
|
|
1129
1087
|
return this.disposers.add(r, () => {
|
|
1130
|
-
t.abort(),
|
|
1088
|
+
t.abort(), s();
|
|
1131
1089
|
});
|
|
1132
1090
|
}
|
|
1133
1091
|
/**
|
|
@@ -1153,11 +1111,11 @@ class _e extends I {
|
|
|
1153
1111
|
* ```
|
|
1154
1112
|
*/
|
|
1155
1113
|
computeFrom(e, t) {
|
|
1156
|
-
const
|
|
1114
|
+
const s = _(() => {
|
|
1157
1115
|
const n = e.map((o) => o.value), a = t(...n);
|
|
1158
1116
|
this.setValue(a, { emitEvent: !1 });
|
|
1159
|
-
}), r =
|
|
1160
|
-
return this.disposers.add(r,
|
|
1117
|
+
}), r = V(k.ComputeFrom);
|
|
1118
|
+
return this.disposers.add(r, s);
|
|
1161
1119
|
}
|
|
1162
1120
|
/**
|
|
1163
1121
|
* Очистить все ресурсы и таймеры
|
|
@@ -1187,13 +1145,13 @@ class _e extends I {
|
|
|
1187
1145
|
}
|
|
1188
1146
|
}
|
|
1189
1147
|
}
|
|
1190
|
-
function H(
|
|
1191
|
-
const { getChildren: e, ownErrors: t, disabled:
|
|
1148
|
+
function H(i) {
|
|
1149
|
+
const { getChildren: e, ownErrors: t, disabled: s } = i, r = h(() => t.value.length > 0 ? !1 : e().every((c) => c.disabled.value || c.valid.value)), n = h(() => !r.value), a = h(() => e().some((c) => c.pending.value)), o = h(() => e().some((c) => c.touched.value)), l = h(() => e().some((c) => c.dirty.value)), u = h(() => {
|
|
1192
1150
|
const c = [...t.value];
|
|
1193
1151
|
for (const f of e())
|
|
1194
1152
|
c.push(...f.errors.value);
|
|
1195
1153
|
return c;
|
|
1196
|
-
}), m = h(() =>
|
|
1154
|
+
}), m = h(() => s?.value ? "disabled" : a.value ? "pending" : n.value ? "invalid" : "valid");
|
|
1197
1155
|
return {
|
|
1198
1156
|
valid: r,
|
|
1199
1157
|
invalid: n,
|
|
@@ -1204,29 +1162,29 @@ function H(s) {
|
|
|
1204
1162
|
status: m
|
|
1205
1163
|
};
|
|
1206
1164
|
}
|
|
1207
|
-
function Ee(
|
|
1208
|
-
return typeof
|
|
1165
|
+
function Ee(i) {
|
|
1166
|
+
return typeof i == "object" && i !== null && "getProxy" in i && typeof i.getProxy == "function";
|
|
1209
1167
|
}
|
|
1210
|
-
function Ae(
|
|
1211
|
-
return new Proxy(
|
|
1212
|
-
get: (t,
|
|
1213
|
-
if (
|
|
1214
|
-
return t[
|
|
1215
|
-
if (typeof
|
|
1216
|
-
const r = e.get(
|
|
1168
|
+
function Ae(i, e) {
|
|
1169
|
+
return new Proxy(i, {
|
|
1170
|
+
get: (t, s) => {
|
|
1171
|
+
if (s in t)
|
|
1172
|
+
return t[s];
|
|
1173
|
+
if (typeof s == "string" && e.has(s)) {
|
|
1174
|
+
const r = e.get(s);
|
|
1217
1175
|
return r && Ee(r) ? r.getProxy() : r;
|
|
1218
1176
|
}
|
|
1219
1177
|
},
|
|
1220
|
-
set: (t,
|
|
1221
|
-
has: (t,
|
|
1178
|
+
set: (t, s, r) => typeof s == "string" && e.has(s) ? !1 : (t[s] = r, !0),
|
|
1179
|
+
has: (t, s) => typeof s == "string" && e.has(s) ? !0 : s in t,
|
|
1222
1180
|
ownKeys: (t) => {
|
|
1223
|
-
const
|
|
1224
|
-
return [.../* @__PURE__ */ new Set([...
|
|
1181
|
+
const s = Reflect.ownKeys(t), r = Array.from(e.keys());
|
|
1182
|
+
return [.../* @__PURE__ */ new Set([...s, ...r])];
|
|
1225
1183
|
},
|
|
1226
|
-
getOwnPropertyDescriptor: (t,
|
|
1184
|
+
getOwnPropertyDescriptor: (t, s) => typeof s == "string" && e.has(s) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(t, s)
|
|
1227
1185
|
});
|
|
1228
1186
|
}
|
|
1229
|
-
class
|
|
1187
|
+
class we {
|
|
1230
1188
|
/**
|
|
1231
1189
|
* @param form - Форма для отправки
|
|
1232
1190
|
*/
|
|
@@ -1266,8 +1224,8 @@ class Se {
|
|
|
1266
1224
|
* ```
|
|
1267
1225
|
*/
|
|
1268
1226
|
async submit(e, t) {
|
|
1269
|
-
const { skipValidation:
|
|
1270
|
-
if (r || this.form.markAsTouched(), !
|
|
1227
|
+
const { skipValidation: s = !1, skipTouch: r = !1 } = t || {};
|
|
1228
|
+
if (r || this.form.markAsTouched(), !s && !await this.form.validate())
|
|
1271
1229
|
return null;
|
|
1272
1230
|
this._submitting.value = !0;
|
|
1273
1231
|
try {
|
|
@@ -1301,8 +1259,8 @@ class Se {
|
|
|
1301
1259
|
* ```
|
|
1302
1260
|
*/
|
|
1303
1261
|
async submitWithResult(e, t) {
|
|
1304
|
-
const { skipValidation:
|
|
1305
|
-
if (r || this.form.markAsTouched(), !
|
|
1262
|
+
const { skipValidation: s = !1, skipTouch: r = !1 } = t || {};
|
|
1263
|
+
if (r || this.form.markAsTouched(), !s && !await this.form.validate())
|
|
1306
1264
|
return { success: !1, data: null };
|
|
1307
1265
|
this._submitting.value = !0;
|
|
1308
1266
|
try {
|
|
@@ -1324,16 +1282,16 @@ class Se {
|
|
|
1324
1282
|
return this._submitting.value;
|
|
1325
1283
|
}
|
|
1326
1284
|
}
|
|
1327
|
-
function
|
|
1285
|
+
function Se(i) {
|
|
1328
1286
|
const e = [];
|
|
1329
|
-
for (const t of
|
|
1330
|
-
const
|
|
1331
|
-
if (!
|
|
1332
|
-
e.push(
|
|
1287
|
+
for (const t of i.split(".")) {
|
|
1288
|
+
const s = /^([^[\]]+)(?:\[(\d+)\])?$/.exec(t);
|
|
1289
|
+
if (!s) return [];
|
|
1290
|
+
e.push(s[2] !== void 0 ? { key: s[1], index: Number(s[2]) } : { key: s[1] });
|
|
1333
1291
|
}
|
|
1334
1292
|
return e;
|
|
1335
1293
|
}
|
|
1336
|
-
let x = class
|
|
1294
|
+
let x = class ae extends D {
|
|
1337
1295
|
// ============================================================================
|
|
1338
1296
|
// Приватные поля
|
|
1339
1297
|
// ============================================================================
|
|
@@ -1382,9 +1340,9 @@ let x = class ne extends I {
|
|
|
1382
1340
|
status;
|
|
1383
1341
|
submitting;
|
|
1384
1342
|
constructor(e) {
|
|
1385
|
-
super(), this.formSubmitter = new
|
|
1386
|
-
const
|
|
1387
|
-
for (const [n, a] of Object.entries(
|
|
1343
|
+
super(), this.formSubmitter = new we(this);
|
|
1344
|
+
const s = "form" in e ? e.form : e;
|
|
1345
|
+
for (const [n, a] of Object.entries(s)) {
|
|
1388
1346
|
const o = this.createNode(a);
|
|
1389
1347
|
this._fields.set(n, o);
|
|
1390
1348
|
}
|
|
@@ -1416,13 +1374,13 @@ let x = class ne extends I {
|
|
|
1416
1374
|
// ============================================================================
|
|
1417
1375
|
getValue() {
|
|
1418
1376
|
const e = {};
|
|
1419
|
-
return this._fields.forEach((t,
|
|
1420
|
-
e[
|
|
1377
|
+
return this._fields.forEach((t, s) => {
|
|
1378
|
+
e[s] = t.getValue();
|
|
1421
1379
|
}), e;
|
|
1422
1380
|
}
|
|
1423
1381
|
setValue(e, t) {
|
|
1424
|
-
for (const [
|
|
1425
|
-
const n = this._fields.get(
|
|
1382
|
+
for (const [s, r] of Object.entries(e)) {
|
|
1383
|
+
const n = this._fields.get(s);
|
|
1426
1384
|
if (n) {
|
|
1427
1385
|
if (B(n.value)) continue;
|
|
1428
1386
|
n.setValue(r, t);
|
|
@@ -1431,11 +1389,11 @@ let x = class ne extends I {
|
|
|
1431
1389
|
}
|
|
1432
1390
|
patchValue(e) {
|
|
1433
1391
|
me(() => {
|
|
1434
|
-
for (const [t,
|
|
1392
|
+
for (const [t, s] of Object.entries(e)) {
|
|
1435
1393
|
const r = this._fields.get(t);
|
|
1436
|
-
if (r &&
|
|
1394
|
+
if (r && s !== void 0) {
|
|
1437
1395
|
if (B(r.value)) continue;
|
|
1438
|
-
r.setValue(
|
|
1396
|
+
r.setValue(s, { emitEvent: !1 });
|
|
1439
1397
|
}
|
|
1440
1398
|
}
|
|
1441
1399
|
});
|
|
@@ -1458,8 +1416,8 @@ let x = class ne extends I {
|
|
|
1458
1416
|
* ```
|
|
1459
1417
|
*/
|
|
1460
1418
|
reset(e) {
|
|
1461
|
-
this._fields.forEach((t,
|
|
1462
|
-
const r = e?.[
|
|
1419
|
+
this._fields.forEach((t, s) => {
|
|
1420
|
+
const r = e?.[s];
|
|
1463
1421
|
t.reset(r);
|
|
1464
1422
|
});
|
|
1465
1423
|
}
|
|
@@ -1603,21 +1561,21 @@ let x = class ne extends I {
|
|
|
1603
1561
|
getFieldByPath(e) {
|
|
1604
1562
|
if (e.startsWith(".") || e.endsWith("."))
|
|
1605
1563
|
return;
|
|
1606
|
-
const t =
|
|
1564
|
+
const t = Se(e);
|
|
1607
1565
|
if (t.length === 0)
|
|
1608
1566
|
return;
|
|
1609
|
-
let
|
|
1567
|
+
let s = this;
|
|
1610
1568
|
for (const r of t) {
|
|
1611
|
-
if (!(
|
|
1569
|
+
if (!(s instanceof ae) || (s = s.getField(r.key), !s)) return;
|
|
1612
1570
|
if (r.index !== void 0)
|
|
1613
|
-
if ("at" in
|
|
1614
|
-
const n =
|
|
1571
|
+
if ("at" in s && "length" in s && typeof s.at == "function") {
|
|
1572
|
+
const n = s.at(r.index);
|
|
1615
1573
|
if (!n) return;
|
|
1616
|
-
|
|
1574
|
+
s = n;
|
|
1617
1575
|
} else
|
|
1618
1576
|
return;
|
|
1619
1577
|
}
|
|
1620
|
-
return
|
|
1578
|
+
return s;
|
|
1621
1579
|
}
|
|
1622
1580
|
// ============================================================================
|
|
1623
1581
|
// Private методы для создания узлов
|
|
@@ -1646,16 +1604,16 @@ let x = class ne extends I {
|
|
|
1646
1604
|
/**
|
|
1647
1605
|
* Связывает два поля: при изменении source автоматически обновляется target
|
|
1648
1606
|
*/
|
|
1649
|
-
linkFields(e, t,
|
|
1607
|
+
linkFields(e, t, s) {
|
|
1650
1608
|
const r = this._fields.get(e), n = this._fields.get(t);
|
|
1651
1609
|
if (!r || !n) {
|
|
1652
1610
|
const l = r ? t : e;
|
|
1653
1611
|
throw new Error(`GroupNode.linkFields: field "${String(l)}" not found`);
|
|
1654
1612
|
}
|
|
1655
1613
|
const a = _(() => {
|
|
1656
|
-
const l = r.value.value, u =
|
|
1614
|
+
const l = r.value.value, u = s ? s(l) : l;
|
|
1657
1615
|
n.setValue(u, { emitEvent: !1 });
|
|
1658
|
-
}), o =
|
|
1616
|
+
}), o = V(k.LinkFields);
|
|
1659
1617
|
return this.disposers.add(o, a);
|
|
1660
1618
|
}
|
|
1661
1619
|
/**
|
|
@@ -1685,14 +1643,27 @@ let x = class ne extends I {
|
|
|
1685
1643
|
* useEffect(() => dispose, []);
|
|
1686
1644
|
* ```
|
|
1687
1645
|
*/
|
|
1646
|
+
/** Подписка на top-level поле — value типизирован как `T[K]`. */
|
|
1688
1647
|
watchField(e, t) {
|
|
1689
|
-
const
|
|
1690
|
-
if (!
|
|
1648
|
+
const s = this.getFieldByPath(e);
|
|
1649
|
+
if (!s)
|
|
1691
1650
|
throw new Error(`GroupNode.watchField: field "${e}" not found`);
|
|
1692
1651
|
const r = _(() => {
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1652
|
+
t(s.value.value);
|
|
1653
|
+
}), n = V(k.WatchField);
|
|
1654
|
+
return this.disposers.add(n, r);
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Подписка на вложенное поле по строковому пути ("address.city").
|
|
1658
|
+
* Путь нельзя выразить в типах узла → value честно `unknown`, потребитель сужает.
|
|
1659
|
+
*/
|
|
1660
|
+
watchFieldByPath(e, t) {
|
|
1661
|
+
const s = this.getFieldByPath(e);
|
|
1662
|
+
if (!s)
|
|
1663
|
+
throw new Error(`GroupNode.watchFieldByPath: field "${e}" not found`);
|
|
1664
|
+
const r = _(() => {
|
|
1665
|
+
t(s.value.value);
|
|
1666
|
+
}), n = V(k.WatchField);
|
|
1696
1667
|
return this.disposers.add(n, r);
|
|
1697
1668
|
}
|
|
1698
1669
|
/**
|
|
@@ -1722,7 +1693,7 @@ let x = class ne extends I {
|
|
|
1722
1693
|
"dispose" in e && typeof e.dispose == "function" && e.dispose();
|
|
1723
1694
|
});
|
|
1724
1695
|
}
|
|
1725
|
-
},
|
|
1696
|
+
}, X = class extends D {
|
|
1726
1697
|
// ============================================================================
|
|
1727
1698
|
// Приватные поля
|
|
1728
1699
|
// ============================================================================
|
|
@@ -1761,11 +1732,11 @@ let x = class ne extends I {
|
|
|
1761
1732
|
for (const r of t)
|
|
1762
1733
|
this.push(r);
|
|
1763
1734
|
this.length = h(() => this.items.value.length), this.value = h(() => this.items.value.map((r) => r.value.value));
|
|
1764
|
-
const
|
|
1735
|
+
const s = H({
|
|
1765
1736
|
getChildren: () => this.items.value,
|
|
1766
1737
|
ownErrors: this._arrayErrors
|
|
1767
1738
|
});
|
|
1768
|
-
this.valid =
|
|
1739
|
+
this.valid = s.valid, this.invalid = s.invalid, this.pending = s.pending, this.touched = s.touched, this.dirty = s.dirty, this.errors = s.errors, this.status = s.status;
|
|
1769
1740
|
}
|
|
1770
1741
|
// ============================================================================
|
|
1771
1742
|
// CRUD операции
|
|
@@ -1787,17 +1758,17 @@ let x = class ne extends I {
|
|
|
1787
1758
|
*/
|
|
1788
1759
|
removeAt(e) {
|
|
1789
1760
|
if (e < 0 || e >= this.items.value.length) {
|
|
1790
|
-
|
|
1761
|
+
O.handle(
|
|
1791
1762
|
new Error(
|
|
1792
1763
|
`ArrayNode.removeAt: index ${e} out of bounds (length: ${this.items.value.length})`
|
|
1793
1764
|
),
|
|
1794
1765
|
"ArrayNode.removeAt",
|
|
1795
|
-
|
|
1766
|
+
S.LOG
|
|
1796
1767
|
);
|
|
1797
1768
|
return;
|
|
1798
1769
|
}
|
|
1799
1770
|
const t = this.items.value[e];
|
|
1800
|
-
this.items.value = this.items.value.filter((
|
|
1771
|
+
this.items.value = this.items.value.filter((s, r) => r !== e), t && "dispose" in t && typeof t.dispose == "function" && t.dispose();
|
|
1801
1772
|
}
|
|
1802
1773
|
/**
|
|
1803
1774
|
* Вставить элемент в массив
|
|
@@ -1806,17 +1777,17 @@ let x = class ne extends I {
|
|
|
1806
1777
|
*/
|
|
1807
1778
|
insert(e, t) {
|
|
1808
1779
|
if (e < 0 || e > this.items.value.length) {
|
|
1809
|
-
|
|
1780
|
+
O.handle(
|
|
1810
1781
|
new Error(
|
|
1811
1782
|
`ArrayNode.insert: index ${e} out of bounds (length: ${this.items.value.length})`
|
|
1812
1783
|
),
|
|
1813
1784
|
"ArrayNode.insert",
|
|
1814
|
-
|
|
1785
|
+
S.LOG
|
|
1815
1786
|
);
|
|
1816
1787
|
return;
|
|
1817
1788
|
}
|
|
1818
|
-
const
|
|
1819
|
-
r.splice(e, 0,
|
|
1789
|
+
const s = this.createItem(t), r = [...this.items.value];
|
|
1790
|
+
r.splice(e, 0, s), this.items.value = r;
|
|
1820
1791
|
}
|
|
1821
1792
|
/**
|
|
1822
1793
|
* Переместить элемент массива с позиции `from` на позицию `to`
|
|
@@ -1835,12 +1806,12 @@ let x = class ne extends I {
|
|
|
1835
1806
|
* ```
|
|
1836
1807
|
*/
|
|
1837
1808
|
move(e, t) {
|
|
1838
|
-
const
|
|
1839
|
-
if (e < 0 || e >=
|
|
1840
|
-
|
|
1841
|
-
new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${t}, length=${
|
|
1809
|
+
const s = this.items.value.length;
|
|
1810
|
+
if (e < 0 || e >= s || t < 0 || t >= s) {
|
|
1811
|
+
O.handle(
|
|
1812
|
+
new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${t}, length=${s})`),
|
|
1842
1813
|
"ArrayNode.move",
|
|
1843
|
-
|
|
1814
|
+
S.LOG
|
|
1844
1815
|
);
|
|
1845
1816
|
return;
|
|
1846
1817
|
}
|
|
@@ -1863,12 +1834,12 @@ let x = class ne extends I {
|
|
|
1863
1834
|
* ```
|
|
1864
1835
|
*/
|
|
1865
1836
|
swap(e, t) {
|
|
1866
|
-
const
|
|
1867
|
-
if (e < 0 || e >=
|
|
1868
|
-
|
|
1869
|
-
new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${t}, length=${
|
|
1837
|
+
const s = this.items.value.length;
|
|
1838
|
+
if (e < 0 || e >= s || t < 0 || t >= s) {
|
|
1839
|
+
O.handle(
|
|
1840
|
+
new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${t}, length=${s})`),
|
|
1870
1841
|
"ArrayNode.swap",
|
|
1871
|
-
|
|
1842
|
+
S.LOG
|
|
1872
1843
|
);
|
|
1873
1844
|
return;
|
|
1874
1845
|
}
|
|
@@ -1905,13 +1876,13 @@ let x = class ne extends I {
|
|
|
1905
1876
|
return this.items.value.map((e) => e.getValue());
|
|
1906
1877
|
}
|
|
1907
1878
|
setValue(e, t) {
|
|
1908
|
-
this.clear(), e.forEach((
|
|
1909
|
-
|
|
1879
|
+
this.clear(), e.forEach((s) => this.push(s)), t?.emitEvent !== !1 && this.validate().catch((s) => {
|
|
1880
|
+
O.handle(s, "ArrayNode.setValue", S.LOG);
|
|
1910
1881
|
});
|
|
1911
1882
|
}
|
|
1912
1883
|
patchValue(e) {
|
|
1913
|
-
e.forEach((t,
|
|
1914
|
-
this.items.value[
|
|
1884
|
+
e.forEach((t, s) => {
|
|
1885
|
+
this.items.value[s] && t !== void 0 && this.items.value[s].patchValue(t);
|
|
1915
1886
|
});
|
|
1916
1887
|
}
|
|
1917
1888
|
/**
|
|
@@ -2039,9 +2010,9 @@ let x = class ne extends I {
|
|
|
2039
2010
|
* @param callback - Функция, вызываемая для каждого элемента с типизированным GroupNode proxy
|
|
2040
2011
|
*/
|
|
2041
2012
|
forEach(e) {
|
|
2042
|
-
this.items.value.forEach((t,
|
|
2013
|
+
this.items.value.forEach((t, s) => {
|
|
2043
2014
|
const r = t.getProxy();
|
|
2044
|
-
e(r,
|
|
2015
|
+
e(r, s);
|
|
2045
2016
|
});
|
|
2046
2017
|
}
|
|
2047
2018
|
/**
|
|
@@ -2050,9 +2021,9 @@ let x = class ne extends I {
|
|
|
2050
2021
|
* @returns Новый массив результатов
|
|
2051
2022
|
*/
|
|
2052
2023
|
map(e) {
|
|
2053
|
-
return this.items.value.map((t,
|
|
2024
|
+
return this.items.value.map((t, s) => {
|
|
2054
2025
|
const r = t.getProxy();
|
|
2055
|
-
return e(r,
|
|
2026
|
+
return e(r, s);
|
|
2056
2027
|
});
|
|
2057
2028
|
}
|
|
2058
2029
|
// ============================================================================
|
|
@@ -2151,14 +2122,14 @@ let x = class ne extends I {
|
|
|
2151
2122
|
* ```
|
|
2152
2123
|
*/
|
|
2153
2124
|
watchItems(e, t) {
|
|
2154
|
-
const
|
|
2125
|
+
const s = _(() => {
|
|
2155
2126
|
const n = this.items.value.map((a) => {
|
|
2156
2127
|
if (a instanceof x)
|
|
2157
2128
|
return a.getFieldByPath(e)?.value.value;
|
|
2158
2129
|
});
|
|
2159
2130
|
t(n);
|
|
2160
|
-
}), r =
|
|
2161
|
-
return this.disposers.add(r,
|
|
2131
|
+
}), r = V(k.WatchItems);
|
|
2132
|
+
return this.disposers.add(r, s);
|
|
2162
2133
|
}
|
|
2163
2134
|
/**
|
|
2164
2135
|
* Подписка на изменение длины массива
|
|
@@ -2186,8 +2157,8 @@ let x = class ne extends I {
|
|
|
2186
2157
|
const t = _(() => {
|
|
2187
2158
|
const r = this.length.value;
|
|
2188
2159
|
e(r);
|
|
2189
|
-
}),
|
|
2190
|
-
return this.disposers.add(
|
|
2160
|
+
}), s = V(k.WatchLength);
|
|
2161
|
+
return this.disposers.add(s, t);
|
|
2191
2162
|
}
|
|
2192
2163
|
/**
|
|
2193
2164
|
* Очистить все ресурсы узла
|
|
@@ -2301,13 +2272,11 @@ class ke {
|
|
|
2301
2272
|
return this.createArrayNodeFromArray(e);
|
|
2302
2273
|
if (this.isFieldConfig(e))
|
|
2303
2274
|
return new _e(e);
|
|
2304
|
-
if (this.isArrayConfig(e))
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
t.initialItems
|
|
2275
|
+
if (this.isArrayConfig(e))
|
|
2276
|
+
return new X(
|
|
2277
|
+
e.schema,
|
|
2278
|
+
e.initialItems
|
|
2309
2279
|
);
|
|
2310
|
-
}
|
|
2311
2280
|
if (this.isGroupConfig(e))
|
|
2312
2281
|
return new x(e);
|
|
2313
2282
|
throw new Error(
|
|
@@ -2343,11 +2312,11 @@ class ke {
|
|
|
2343
2312
|
*/
|
|
2344
2313
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2345
2314
|
createArrayNodeFromArray(e) {
|
|
2346
|
-
const [t, ...
|
|
2315
|
+
const [t, ...s] = e, r = [];
|
|
2347
2316
|
this.isGroupConfig(t) && r.push(this.extractValues(t));
|
|
2348
|
-
for (const n of
|
|
2317
|
+
for (const n of s)
|
|
2349
2318
|
this.isGroupConfig(n) ? r.push(this.extractValues(n)) : r.push(n);
|
|
2350
|
-
return new
|
|
2319
|
+
return new X(t, r);
|
|
2351
2320
|
}
|
|
2352
2321
|
/**
|
|
2353
2322
|
* Извлечь значения из схемы (рекурсивно)
|
|
@@ -2385,8 +2354,8 @@ class ke {
|
|
|
2385
2354
|
return e.map((t) => this.extractValues(t));
|
|
2386
2355
|
if (this.isGroupConfig(e)) {
|
|
2387
2356
|
const t = {};
|
|
2388
|
-
for (const [
|
|
2389
|
-
t[
|
|
2357
|
+
for (const [s, r] of Object.entries(e))
|
|
2358
|
+
t[s] = this.extractValues(r);
|
|
2390
2359
|
return t;
|
|
2391
2360
|
}
|
|
2392
2361
|
return e;
|
|
@@ -2466,28 +2435,28 @@ class ke {
|
|
|
2466
2435
|
return e != null && typeof e == "object" && !this.isFieldConfig(e) && !this.isArrayConfig(e);
|
|
2467
2436
|
}
|
|
2468
2437
|
}
|
|
2469
|
-
function
|
|
2470
|
-
return
|
|
2438
|
+
function I(i) {
|
|
2439
|
+
return i == null ? !1 : typeof i == "object" && "value" in i && "setValue" in i && "getValue" in i && "validate" in i;
|
|
2471
2440
|
}
|
|
2472
|
-
function Ve(
|
|
2473
|
-
return
|
|
2441
|
+
function Ve(i) {
|
|
2442
|
+
return i == null ? !1 : I(i) && "validators" in i && "asyncValidators" in i && // FieldNode имеет markAsTouched метод
|
|
2474
2443
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2475
|
-
typeof
|
|
2476
|
-
!("fields" in
|
|
2444
|
+
typeof i.markAsTouched == "function" && // У FieldNode нет fields или items
|
|
2445
|
+
!("fields" in i) && !("items" in i);
|
|
2477
2446
|
}
|
|
2478
|
-
function Oe(
|
|
2479
|
-
return
|
|
2480
|
-
!("items" in
|
|
2447
|
+
function Oe(i) {
|
|
2448
|
+
return i == null ? !1 : I(i) && "getFieldByPath" in i && "fields" in i && // GroupNode НЕ имеет items/push/removeAt (это ArrayNode/ModelArrayNode)
|
|
2449
|
+
!("items" in i) && !("push" in i) && !("removeAt" in i);
|
|
2481
2450
|
}
|
|
2482
|
-
function Ne(
|
|
2483
|
-
return
|
|
2484
|
-
typeof
|
|
2485
|
-
typeof
|
|
2451
|
+
function Ne(i) {
|
|
2452
|
+
return i == null ? !1 : I(i) && "items" in i && "length" in i && "push" in i && "removeAt" in i && "at" in i && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2453
|
+
typeof i.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2454
|
+
typeof i.removeAt == "function";
|
|
2486
2455
|
}
|
|
2487
|
-
function
|
|
2488
|
-
return Ve(
|
|
2456
|
+
function ze(i) {
|
|
2457
|
+
return Ve(i) ? "FieldNode" : Oe(i) ? "GroupNode" : Ne(i) ? "ArrayNode" : I(i) ? "FormNode" : "Unknown";
|
|
2489
2458
|
}
|
|
2490
|
-
class Fe extends
|
|
2459
|
+
class Fe extends D {
|
|
2491
2460
|
/**
|
|
2492
2461
|
* @param control Реактивный массив модели (`model.<path>`).
|
|
2493
2462
|
* @param buildItem Строитель формы элемента по его под-модели (инъекция, чтобы избежать цикла
|
|
@@ -2504,11 +2473,11 @@ class Fe extends I {
|
|
|
2504
2473
|
}
|
|
2505
2474
|
this.itemNodes.value = n;
|
|
2506
2475
|
}), this.length = h(() => this.itemNodes.value.length), this.value = h(() => this.itemNodes.value.map((r) => r.value.value));
|
|
2507
|
-
const
|
|
2476
|
+
const s = H({
|
|
2508
2477
|
getChildren: () => this.itemNodes.value,
|
|
2509
2478
|
ownErrors: this._arrayErrors
|
|
2510
2479
|
});
|
|
2511
|
-
this.valid =
|
|
2480
|
+
this.valid = s.valid, this.invalid = s.invalid, this.pending = s.pending, this.touched = s.touched, this.dirty = s.dirty, this.errors = s.errors, this.status = s.status;
|
|
2512
2481
|
}
|
|
2513
2482
|
itemNodes = y([]);
|
|
2514
2483
|
// Кэш per-item формы по идентичности фасада под-модели (фасады кэшируются в core).
|
|
@@ -2537,10 +2506,10 @@ class Fe extends I {
|
|
|
2537
2506
|
return this.itemNodes.value[e];
|
|
2538
2507
|
}
|
|
2539
2508
|
map(e) {
|
|
2540
|
-
return this.itemNodes.value.map((t,
|
|
2509
|
+
return this.itemNodes.value.map((t, s) => e(t, s));
|
|
2541
2510
|
}
|
|
2542
2511
|
forEach(e) {
|
|
2543
|
-
this.itemNodes.value.forEach((t,
|
|
2512
|
+
this.itemNodes.value.forEach((t, s) => e(t, s));
|
|
2544
2513
|
}
|
|
2545
2514
|
// ── Мутации (делегируют массиву модели; effect пересоберёт itemNodes) ──────
|
|
2546
2515
|
push(e) {
|
|
@@ -2598,109 +2567,133 @@ class Fe extends I {
|
|
|
2598
2567
|
);
|
|
2599
2568
|
}
|
|
2600
2569
|
// ── Hooks (forward к элементам) ────────────────────────────────────────────
|
|
2570
|
+
// Агрегатное состояние (touched/dirty/status) выводится из детей (createAggregateSignals), поэтому
|
|
2571
|
+
// базовые сигналы бесполезны для чтения — состояние меняется ТОЛЬКО через per-item формы. Форвардим
|
|
2572
|
+
// ВСЕ hook'и (как ArrayNode), иначе markAsUntouched/Pristine/Dirty/disable/enable молча no-op.
|
|
2601
2573
|
onMarkAsTouched() {
|
|
2602
2574
|
this.itemNodes.value.forEach(
|
|
2603
2575
|
(e) => e.markAsTouched?.()
|
|
2604
2576
|
);
|
|
2605
2577
|
}
|
|
2578
|
+
onMarkAsUntouched() {
|
|
2579
|
+
this.itemNodes.value.forEach(
|
|
2580
|
+
(e) => e.markAsUntouched?.()
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
onMarkAsDirty() {
|
|
2584
|
+
this.itemNodes.value.forEach(
|
|
2585
|
+
(e) => e.markAsDirty?.()
|
|
2586
|
+
);
|
|
2587
|
+
}
|
|
2588
|
+
onMarkAsPristine() {
|
|
2589
|
+
this.itemNodes.value.forEach(
|
|
2590
|
+
(e) => e.markAsPristine?.()
|
|
2591
|
+
);
|
|
2592
|
+
}
|
|
2593
|
+
onDisable() {
|
|
2594
|
+
this.itemNodes.value.forEach((e) => e.disable?.());
|
|
2595
|
+
}
|
|
2596
|
+
onEnable() {
|
|
2597
|
+
this.itemNodes.value.forEach((e) => e.enable?.());
|
|
2598
|
+
}
|
|
2606
2599
|
/** Очистка подписки синхронизации. */
|
|
2607
2600
|
dispose() {
|
|
2608
2601
|
this.disposeSync();
|
|
2609
2602
|
}
|
|
2610
2603
|
}
|
|
2611
|
-
const
|
|
2612
|
-
function G(
|
|
2613
|
-
if (
|
|
2614
|
-
if (Array.isArray(
|
|
2615
|
-
for (const n of
|
|
2604
|
+
const oe = (i) => i !== null && typeof i == "object" && !Array.isArray(i) && !(i instanceof Date) && !(typeof Blob < "u" && i instanceof Blob) && !(typeof File < "u" && i instanceof File);
|
|
2605
|
+
function G(i, e, t) {
|
|
2606
|
+
if (i == null || typeof i != "object") return;
|
|
2607
|
+
if (Array.isArray(i)) {
|
|
2608
|
+
for (const n of i) G(n, e, t);
|
|
2616
2609
|
return;
|
|
2617
2610
|
}
|
|
2618
|
-
const
|
|
2619
|
-
if (r && typeof r.__path == "string" && typeof
|
|
2620
|
-
t.set(r.__path,
|
|
2611
|
+
const s = i, r = s.array;
|
|
2612
|
+
if (r && typeof r.__path == "string" && typeof s.item == "function") {
|
|
2613
|
+
t.set(r.__path, s.item);
|
|
2621
2614
|
return;
|
|
2622
2615
|
}
|
|
2623
|
-
|
|
2624
|
-
component:
|
|
2625
|
-
componentProps:
|
|
2626
|
-
validators:
|
|
2627
|
-
asyncValidators:
|
|
2628
|
-
updateOn:
|
|
2629
|
-
disabled:
|
|
2630
|
-
debounce:
|
|
2616
|
+
s.value instanceof re && e.set(s.value, {
|
|
2617
|
+
component: s.component,
|
|
2618
|
+
componentProps: s.componentProps,
|
|
2619
|
+
validators: s.validators,
|
|
2620
|
+
asyncValidators: s.asyncValidators,
|
|
2621
|
+
updateOn: s.updateOn,
|
|
2622
|
+
disabled: s.disabled,
|
|
2623
|
+
debounce: s.debounce
|
|
2631
2624
|
});
|
|
2632
|
-
for (const [n, a] of Object.entries(
|
|
2625
|
+
for (const [n, a] of Object.entries(s))
|
|
2633
2626
|
n !== "value" && G(a, e, t);
|
|
2634
2627
|
}
|
|
2635
|
-
function
|
|
2628
|
+
function le(i, e, t, s) {
|
|
2636
2629
|
const r = {};
|
|
2637
2630
|
for (const [n, a] of Object.entries(e)) {
|
|
2638
2631
|
const o = t === "" ? n : `${t}.${n}`;
|
|
2639
2632
|
if (Array.isArray(a))
|
|
2640
2633
|
continue;
|
|
2641
|
-
if (
|
|
2642
|
-
r[n] =
|
|
2634
|
+
if (oe(a)) {
|
|
2635
|
+
r[n] = le(i, a, o, s);
|
|
2643
2636
|
continue;
|
|
2644
2637
|
}
|
|
2645
|
-
const l =
|
|
2638
|
+
const l = i.signalAt(o);
|
|
2646
2639
|
if (!l) throw new Error(`createForm({ model }): не найден сигнал для пути "${o}"`);
|
|
2647
|
-
const u =
|
|
2640
|
+
const u = s.get(l) ?? {}, { validators: m, asyncValidators: c, ...f } = u;
|
|
2648
2641
|
r[n] = { ...f, valueSignal: l };
|
|
2649
2642
|
}
|
|
2650
2643
|
return r;
|
|
2651
2644
|
}
|
|
2652
|
-
function
|
|
2653
|
-
for (const [
|
|
2654
|
-
const n = e === "" ?
|
|
2655
|
-
Array.isArray(r) || (
|
|
2645
|
+
function ue(i, e, t) {
|
|
2646
|
+
for (const [s, r] of Object.entries(i)) {
|
|
2647
|
+
const n = e === "" ? s : `${e}.${s}`;
|
|
2648
|
+
Array.isArray(r) || (oe(r) ? ue(r, n, t) : t.push(n));
|
|
2656
2649
|
}
|
|
2657
2650
|
}
|
|
2658
|
-
function
|
|
2659
|
-
const { model: e, schema: t, behavior:
|
|
2651
|
+
function ce(i) {
|
|
2652
|
+
const { model: e, schema: t, behavior: s } = i, r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
2660
2653
|
t !== void 0 && G(t, r, n);
|
|
2661
|
-
const a =
|
|
2654
|
+
const a = le(e, e.get(), "", r), o = new x(a), l = e.get();
|
|
2662
2655
|
for (const [c, f] of Object.entries(l)) {
|
|
2663
2656
|
if (!Array.isArray(f)) continue;
|
|
2664
2657
|
const d = n.get(c);
|
|
2665
2658
|
if (!d) continue;
|
|
2666
|
-
const p = e[c], v = (b) =>
|
|
2659
|
+
const p = e[c], v = (b) => ce({ model: b, schema: d(b) }), g = new Fe(p, v);
|
|
2667
2660
|
o.fields.set(c, g);
|
|
2668
2661
|
}
|
|
2669
2662
|
const u = o.getProxy(), m = [];
|
|
2670
|
-
|
|
2663
|
+
ue(e.get(), "", m);
|
|
2671
2664
|
for (const c of m) {
|
|
2672
2665
|
const f = e.signalAt(c), d = o.getFieldByPath(c);
|
|
2673
2666
|
f && d && ye(f, d);
|
|
2674
2667
|
}
|
|
2675
|
-
return
|
|
2668
|
+
return s && o.attachBehaviorCleanup(s.__run(e, u)), u;
|
|
2676
2669
|
}
|
|
2677
|
-
const xe = (
|
|
2678
|
-
function
|
|
2679
|
-
return xe(
|
|
2670
|
+
const xe = (i) => i != null && typeof i == "object" && "model" in i && typeof i.model?.signalAt == "function";
|
|
2671
|
+
function Je(i) {
|
|
2672
|
+
return xe(i) ? ce(i) : new x(i).getProxy();
|
|
2680
2673
|
}
|
|
2681
|
-
const
|
|
2682
|
-
if (Array.isArray(
|
|
2683
|
-
if (
|
|
2674
|
+
const M = (i) => !(i === null || typeof i != "object" || Array.isArray(i) || i instanceof Date || typeof Blob < "u" && i instanceof Blob || typeof File < "u" && i instanceof File), A = (i, e) => i === "" ? String(e) : `${i}.${e}`, U = (i) => /^\d+$/.test(i), w = (i) => {
|
|
2675
|
+
if (Array.isArray(i)) return i.map(w);
|
|
2676
|
+
if (M(i)) {
|
|
2684
2677
|
const e = {};
|
|
2685
|
-
for (const t of Object.keys(
|
|
2678
|
+
for (const t of Object.keys(i)) e[t] = w(i[t]);
|
|
2686
2679
|
return e;
|
|
2687
2680
|
}
|
|
2688
|
-
return
|
|
2689
|
-
}, C = (
|
|
2690
|
-
if (
|
|
2691
|
-
if (Array.isArray(
|
|
2692
|
-
return
|
|
2693
|
-
if (
|
|
2694
|
-
const t = Object.keys(
|
|
2695
|
-
return t.length !==
|
|
2681
|
+
return i;
|
|
2682
|
+
}, C = (i, e) => {
|
|
2683
|
+
if (i === e) return !0;
|
|
2684
|
+
if (Array.isArray(i) && Array.isArray(e))
|
|
2685
|
+
return i.length !== e.length ? !1 : i.every((t, s) => C(t, e[s]));
|
|
2686
|
+
if (M(i) && M(e)) {
|
|
2687
|
+
const t = Object.keys(i), s = Object.keys(e);
|
|
2688
|
+
return t.length !== s.length ? !1 : t.every((r) => C(i[r], e[r]));
|
|
2696
2689
|
}
|
|
2697
2690
|
return !1;
|
|
2698
2691
|
};
|
|
2699
|
-
class
|
|
2692
|
+
class Pe {
|
|
2700
2693
|
constructor(e, t) {
|
|
2701
2694
|
this.path = t;
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2695
|
+
const s = y(e);
|
|
2696
|
+
s.__path = t, this.signal = s, this.initial = w(e);
|
|
2704
2697
|
}
|
|
2705
2698
|
kind = "leaf";
|
|
2706
2699
|
signal;
|
|
@@ -2720,37 +2713,37 @@ class Me {
|
|
|
2720
2713
|
this.signal.value = e;
|
|
2721
2714
|
}
|
|
2722
2715
|
resetToInitial() {
|
|
2723
|
-
this.signal.value =
|
|
2716
|
+
this.signal.value = w(this.initial);
|
|
2724
2717
|
}
|
|
2725
2718
|
captureInitial() {
|
|
2726
|
-
this.initial =
|
|
2719
|
+
this.initial = w(this.signal.peek());
|
|
2727
2720
|
}
|
|
2728
2721
|
dirty() {
|
|
2729
2722
|
return !C(this.signal.peek(), this.initial);
|
|
2730
2723
|
}
|
|
2731
2724
|
}
|
|
2732
|
-
class
|
|
2725
|
+
class he {
|
|
2733
2726
|
constructor(e, t) {
|
|
2734
2727
|
this.path = t;
|
|
2735
|
-
for (const
|
|
2736
|
-
this.children.set(
|
|
2728
|
+
for (const s of Object.keys(e))
|
|
2729
|
+
this.children.set(s, F(e[s], A(t, s)));
|
|
2737
2730
|
}
|
|
2738
2731
|
kind = "group";
|
|
2739
2732
|
children = /* @__PURE__ */ new Map();
|
|
2740
2733
|
rebase(e) {
|
|
2741
2734
|
this.path = e;
|
|
2742
|
-
for (const [t,
|
|
2735
|
+
for (const [t, s] of this.children) s.rebase(A(e, t));
|
|
2743
2736
|
}
|
|
2744
2737
|
peek() {
|
|
2745
2738
|
const e = {};
|
|
2746
|
-
for (const [t,
|
|
2739
|
+
for (const [t, s] of this.children) e[t] = s.peek();
|
|
2747
2740
|
return e;
|
|
2748
2741
|
}
|
|
2749
2742
|
set(e) {
|
|
2750
2743
|
if (e == null || typeof e != "object") return;
|
|
2751
2744
|
const t = e;
|
|
2752
|
-
for (const [
|
|
2753
|
-
|
|
2745
|
+
for (const [s, r] of this.children)
|
|
2746
|
+
s in t && (r.kind === "leaf" && B(r.signal) || r.set(t[s]));
|
|
2754
2747
|
}
|
|
2755
2748
|
resetToInitial() {
|
|
2756
2749
|
for (const e of this.children.values()) e.resetToInitial();
|
|
@@ -2763,38 +2756,38 @@ class ce {
|
|
|
2763
2756
|
return !1;
|
|
2764
2757
|
}
|
|
2765
2758
|
}
|
|
2766
|
-
class
|
|
2759
|
+
class Me {
|
|
2767
2760
|
constructor(e, t) {
|
|
2768
|
-
this.path = t, this.items = y(e.map((
|
|
2761
|
+
this.path = t, this.items = y(e.map((s, r) => F(s, A(t, r)))), this.initial = w(e);
|
|
2769
2762
|
}
|
|
2770
2763
|
kind = "array";
|
|
2771
2764
|
items;
|
|
2772
2765
|
initial;
|
|
2773
2766
|
rebase(e) {
|
|
2774
|
-
this.path = e, this.items.peek().forEach((t,
|
|
2767
|
+
this.path = e, this.items.peek().forEach((t, s) => t.rebase(A(e, s)));
|
|
2775
2768
|
}
|
|
2776
2769
|
reindex() {
|
|
2777
|
-
this.items.peek().forEach((e, t) => e.rebase(
|
|
2770
|
+
this.items.peek().forEach((e, t) => e.rebase(A(this.path, t)));
|
|
2778
2771
|
}
|
|
2779
2772
|
push(e) {
|
|
2780
2773
|
const t = this.items.peek();
|
|
2781
|
-
this.items.value = [...t, F(e,
|
|
2774
|
+
this.items.value = [...t, F(e, A(this.path, t.length))];
|
|
2782
2775
|
}
|
|
2783
2776
|
insertAt(e, t) {
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2777
|
+
const s = [...this.items.peek()];
|
|
2778
|
+
s.splice(e, 0, F(t, A(this.path, e))), this.items.value = s, this.reindex();
|
|
2786
2779
|
}
|
|
2787
2780
|
removeAt(e) {
|
|
2788
2781
|
const t = [...this.items.peek()];
|
|
2789
2782
|
t.splice(e, 1), this.items.value = t, this.reindex();
|
|
2790
2783
|
}
|
|
2791
2784
|
move(e, t) {
|
|
2792
|
-
const
|
|
2793
|
-
r &&
|
|
2785
|
+
const s = [...this.items.peek()], [r] = s.splice(e, 1);
|
|
2786
|
+
r && s.splice(t, 0, r), this.items.value = s, this.reindex();
|
|
2794
2787
|
}
|
|
2795
2788
|
swap(e, t) {
|
|
2796
|
-
const
|
|
2797
|
-
e < 0 || t < 0 || e >=
|
|
2789
|
+
const s = [...this.items.peek()];
|
|
2790
|
+
e < 0 || t < 0 || e >= s.length || t >= s.length || e === t || ([s[e], s[t]] = [s[t], s[e]], this.items.value = s, this.reindex());
|
|
2798
2791
|
}
|
|
2799
2792
|
clear() {
|
|
2800
2793
|
this.items.value = [];
|
|
@@ -2804,88 +2797,88 @@ class Pe {
|
|
|
2804
2797
|
}
|
|
2805
2798
|
set(e) {
|
|
2806
2799
|
const t = Array.isArray(e) ? e : [];
|
|
2807
|
-
this.items.value = t.map((
|
|
2800
|
+
this.items.value = t.map((s, r) => F(s, A(this.path, r)));
|
|
2808
2801
|
}
|
|
2809
2802
|
resetToInitial() {
|
|
2810
|
-
this.set(
|
|
2803
|
+
this.set(w(this.initial));
|
|
2811
2804
|
}
|
|
2812
2805
|
captureInitial() {
|
|
2813
|
-
this.initial =
|
|
2806
|
+
this.initial = w(this.peek());
|
|
2814
2807
|
}
|
|
2815
2808
|
dirty() {
|
|
2816
2809
|
return !C(this.peek(), this.initial);
|
|
2817
2810
|
}
|
|
2818
2811
|
}
|
|
2819
|
-
function F(
|
|
2820
|
-
return Array.isArray(
|
|
2812
|
+
function F(i, e) {
|
|
2813
|
+
return Array.isArray(i) ? new Me(i, e) : M(i) ? new he(i, e) : new Pe(i, e);
|
|
2821
2814
|
}
|
|
2822
|
-
function T(
|
|
2823
|
-
if (
|
|
2824
|
-
return
|
|
2815
|
+
function T(i) {
|
|
2816
|
+
if (i)
|
|
2817
|
+
return i.kind === "leaf" ? i.read() : i.kind === "group" ? Ce(i) : de(i);
|
|
2825
2818
|
}
|
|
2826
|
-
function Ce(
|
|
2819
|
+
function Ce(i) {
|
|
2827
2820
|
return new Proxy(
|
|
2828
2821
|
{},
|
|
2829
2822
|
{
|
|
2830
|
-
get: (e, t) => t === "__path" ?
|
|
2831
|
-
set: (e, t,
|
|
2823
|
+
get: (e, t) => t === "__path" ? i.path : typeof t == "string" ? T(i.children.get(t)) : void 0,
|
|
2824
|
+
set: (e, t, s) => {
|
|
2832
2825
|
if (typeof t != "string") return !1;
|
|
2833
|
-
const r =
|
|
2834
|
-
return r && r.set(
|
|
2826
|
+
const r = i.children.get(t);
|
|
2827
|
+
return r && r.set(s), !0;
|
|
2835
2828
|
},
|
|
2836
|
-
has: (e, t) => typeof t == "string" &&
|
|
2837
|
-
ownKeys: () => [...
|
|
2838
|
-
getOwnPropertyDescriptor: (e, t) => typeof t == "string" &&
|
|
2829
|
+
has: (e, t) => typeof t == "string" && i.children.has(t),
|
|
2830
|
+
ownKeys: () => [...i.children.keys()],
|
|
2831
|
+
getOwnPropertyDescriptor: (e, t) => typeof t == "string" && i.children.has(t) ? { enumerable: !0, configurable: !0 } : void 0
|
|
2839
2832
|
}
|
|
2840
2833
|
);
|
|
2841
2834
|
}
|
|
2842
|
-
function j(
|
|
2843
|
-
if (
|
|
2844
|
-
return
|
|
2835
|
+
function j(i) {
|
|
2836
|
+
if (i)
|
|
2837
|
+
return i.kind === "group" ? fe(i) : i.kind === "array" ? de(i) : i.read();
|
|
2845
2838
|
}
|
|
2846
|
-
function
|
|
2839
|
+
function de(i) {
|
|
2847
2840
|
const e = {
|
|
2848
2841
|
get length() {
|
|
2849
|
-
return
|
|
2842
|
+
return i.items.value.length;
|
|
2850
2843
|
},
|
|
2851
|
-
push: (t) =>
|
|
2852
|
-
insertAt: (t,
|
|
2853
|
-
removeAt: (t) =>
|
|
2854
|
-
move: (t,
|
|
2855
|
-
swap: (t,
|
|
2856
|
-
clear: () =>
|
|
2857
|
-
at: (t) => j(
|
|
2858
|
-
map: (t) =>
|
|
2859
|
-
forEach: (t) =>
|
|
2860
|
-
toArray: () =>
|
|
2844
|
+
push: (t) => i.push(t),
|
|
2845
|
+
insertAt: (t, s) => i.insertAt(t, s),
|
|
2846
|
+
removeAt: (t) => i.removeAt(t),
|
|
2847
|
+
move: (t, s) => i.move(t, s),
|
|
2848
|
+
swap: (t, s) => i.swap(t, s),
|
|
2849
|
+
clear: () => i.clear(),
|
|
2850
|
+
at: (t) => j(i.items.value[t]),
|
|
2851
|
+
map: (t) => i.items.value.map((s, r) => t(j(s), r)),
|
|
2852
|
+
forEach: (t) => i.items.value.forEach((s, r) => t(j(s), r)),
|
|
2853
|
+
toArray: () => i.peek(),
|
|
2861
2854
|
[Symbol.iterator]: function* () {
|
|
2862
|
-
const t =
|
|
2863
|
-
for (let
|
|
2855
|
+
const t = i.items.value;
|
|
2856
|
+
for (let s = 0; s < t.length; s++) yield T(t[s]);
|
|
2864
2857
|
}
|
|
2865
2858
|
};
|
|
2866
2859
|
return new Proxy(e, {
|
|
2867
|
-
get: (t,
|
|
2868
|
-
has: (t,
|
|
2860
|
+
get: (t, s, r) => s === "__path" ? i.path : typeof s == "string" && U(s) ? T(i.items.value[Number(s)]) : Reflect.get(t, s, r),
|
|
2861
|
+
has: (t, s) => typeof s == "string" && U(s) ? Number(s) < i.items.value.length : Reflect.has(t, s)
|
|
2869
2862
|
});
|
|
2870
2863
|
}
|
|
2871
|
-
function W(
|
|
2872
|
-
if (
|
|
2873
|
-
if (
|
|
2864
|
+
function W(i) {
|
|
2865
|
+
if (i.kind === "leaf") return i.signal;
|
|
2866
|
+
if (i.kind === "group")
|
|
2874
2867
|
return new Proxy(
|
|
2875
2868
|
{},
|
|
2876
2869
|
{
|
|
2877
|
-
get: (t,
|
|
2878
|
-
if (
|
|
2879
|
-
if (typeof
|
|
2880
|
-
const r =
|
|
2870
|
+
get: (t, s) => {
|
|
2871
|
+
if (s === "__path") return i.path;
|
|
2872
|
+
if (typeof s != "string") return;
|
|
2873
|
+
const r = i.children.get(s);
|
|
2881
2874
|
return r ? W(r) : void 0;
|
|
2882
2875
|
},
|
|
2883
|
-
has: (t,
|
|
2884
|
-
ownKeys: () => [...
|
|
2885
|
-
getOwnPropertyDescriptor: (t,
|
|
2876
|
+
has: (t, s) => typeof s == "string" && i.children.has(s),
|
|
2877
|
+
ownKeys: () => [...i.children.keys()],
|
|
2878
|
+
getOwnPropertyDescriptor: (t, s) => typeof s == "string" && i.children.has(s) ? { enumerable: !0, configurable: !0 } : void 0
|
|
2886
2879
|
}
|
|
2887
2880
|
);
|
|
2888
|
-
const e =
|
|
2881
|
+
const e = i;
|
|
2889
2882
|
return new Proxy(
|
|
2890
2883
|
{
|
|
2891
2884
|
get length() {
|
|
@@ -2893,29 +2886,29 @@ function W(s) {
|
|
|
2893
2886
|
}
|
|
2894
2887
|
},
|
|
2895
2888
|
{
|
|
2896
|
-
get: (t,
|
|
2897
|
-
if (
|
|
2898
|
-
if (typeof
|
|
2899
|
-
const n = e.items.value[Number(
|
|
2889
|
+
get: (t, s, r) => {
|
|
2890
|
+
if (s === "__path") return e.path;
|
|
2891
|
+
if (typeof s == "string" && U(s)) {
|
|
2892
|
+
const n = e.items.value[Number(s)];
|
|
2900
2893
|
return n ? W(n) : void 0;
|
|
2901
2894
|
}
|
|
2902
|
-
return Reflect.get(t,
|
|
2895
|
+
return Reflect.get(t, s, r);
|
|
2903
2896
|
}
|
|
2904
2897
|
}
|
|
2905
2898
|
);
|
|
2906
2899
|
}
|
|
2907
|
-
function Te(
|
|
2900
|
+
function Te(i, e) {
|
|
2908
2901
|
if (!e) return;
|
|
2909
|
-
let t =
|
|
2910
|
-
for (const
|
|
2902
|
+
let t = i;
|
|
2903
|
+
for (const s of e.split(".")) {
|
|
2911
2904
|
if (!t) return;
|
|
2912
|
-
if (t.kind === "group") t = t.children.get(
|
|
2913
|
-
else if (t.kind === "array") t = t.items.peek()[Number(
|
|
2905
|
+
if (t.kind === "group") t = t.children.get(s);
|
|
2906
|
+
else if (t.kind === "array") t = t.items.peek()[Number(s)];
|
|
2914
2907
|
else return;
|
|
2915
2908
|
}
|
|
2916
2909
|
return t && t.kind === "leaf" ? t.signal : void 0;
|
|
2917
2910
|
}
|
|
2918
|
-
const
|
|
2911
|
+
const Z = /* @__PURE__ */ new Set([
|
|
2919
2912
|
"$",
|
|
2920
2913
|
"get",
|
|
2921
2914
|
"set",
|
|
@@ -2924,131 +2917,131 @@ const X = /* @__PURE__ */ new Set([
|
|
|
2924
2917
|
"reset",
|
|
2925
2918
|
"captureInitial",
|
|
2926
2919
|
"signalAt"
|
|
2927
|
-
]),
|
|
2928
|
-
function
|
|
2929
|
-
const e =
|
|
2920
|
+
]), ee = /* @__PURE__ */ new WeakMap();
|
|
2921
|
+
function fe(i) {
|
|
2922
|
+
const e = ee.get(i);
|
|
2930
2923
|
if (e) return e;
|
|
2931
2924
|
const t = {
|
|
2932
|
-
$: W(
|
|
2933
|
-
get: () =>
|
|
2934
|
-
set: (r) =>
|
|
2935
|
-
patch: (r) =>
|
|
2936
|
-
isDirty: () =>
|
|
2937
|
-
reset: () =>
|
|
2938
|
-
captureInitial: () =>
|
|
2939
|
-
signalAt: (r) => Te(
|
|
2940
|
-
},
|
|
2925
|
+
$: W(i),
|
|
2926
|
+
get: () => i.peek(),
|
|
2927
|
+
set: (r) => i.set(r),
|
|
2928
|
+
patch: (r) => i.set(r),
|
|
2929
|
+
isDirty: () => i.dirty(),
|
|
2930
|
+
reset: () => i.resetToInitial(),
|
|
2931
|
+
captureInitial: () => i.captureInitial(),
|
|
2932
|
+
signalAt: (r) => Te(i, r)
|
|
2933
|
+
}, s = new Proxy(
|
|
2941
2934
|
{},
|
|
2942
2935
|
{
|
|
2943
2936
|
get: (r, n) => {
|
|
2944
2937
|
if (typeof n != "string") return;
|
|
2945
|
-
const a =
|
|
2938
|
+
const a = i.children.get(n);
|
|
2946
2939
|
if (a) return T(a);
|
|
2947
|
-
if (
|
|
2940
|
+
if (Z.has(n)) return t[n];
|
|
2948
2941
|
},
|
|
2949
2942
|
set: (r, n, a) => {
|
|
2950
2943
|
if (typeof n != "string") return !1;
|
|
2951
|
-
const o =
|
|
2944
|
+
const o = i.children.get(n);
|
|
2952
2945
|
return o ? (o.set(a), !0) : !1;
|
|
2953
2946
|
},
|
|
2954
|
-
has: (r, n) => typeof n == "string" && (
|
|
2955
|
-
ownKeys: () => [...
|
|
2956
|
-
getOwnPropertyDescriptor: (r, n) => typeof n == "string" &&
|
|
2947
|
+
has: (r, n) => typeof n == "string" && (i.children.has(n) || Z.has(n)),
|
|
2948
|
+
ownKeys: () => [...i.children.keys()],
|
|
2949
|
+
getOwnPropertyDescriptor: (r, n) => typeof n == "string" && i.children.has(n) ? { enumerable: !0, configurable: !0 } : void 0
|
|
2957
2950
|
}
|
|
2958
2951
|
);
|
|
2959
|
-
return
|
|
2952
|
+
return ee.set(i, s), s;
|
|
2960
2953
|
}
|
|
2961
|
-
function
|
|
2962
|
-
const e = new
|
|
2963
|
-
return
|
|
2954
|
+
function Ye(i) {
|
|
2955
|
+
const e = new he(i, "");
|
|
2956
|
+
return fe(e);
|
|
2964
2957
|
}
|
|
2965
|
-
const
|
|
2966
|
-
const e =
|
|
2958
|
+
const De = (i) => {
|
|
2959
|
+
const e = i.componentProps;
|
|
2967
2960
|
return e != null && typeof e == "object" && typeof e.itemComponent == "function" && e.control != null && typeof e.control.at == "function" && typeof e.control.length == "number";
|
|
2968
|
-
},
|
|
2969
|
-
function
|
|
2970
|
-
if (
|
|
2971
|
-
if (Array.isArray(
|
|
2972
|
-
for (const a of
|
|
2961
|
+
}, Ie = (i) => typeof i.when == "function" && Array.isArray(i.children);
|
|
2962
|
+
function N(i, e, t, s, r) {
|
|
2963
|
+
if (i == null || typeof i != "object") return;
|
|
2964
|
+
if (Array.isArray(i)) {
|
|
2965
|
+
for (const a of i) N(a, e, t, s, r);
|
|
2973
2966
|
return;
|
|
2974
2967
|
}
|
|
2975
|
-
const n =
|
|
2976
|
-
if (
|
|
2977
|
-
const a =
|
|
2978
|
-
for (const o of n.children)
|
|
2968
|
+
const n = i;
|
|
2969
|
+
if (Ie(n)) {
|
|
2970
|
+
const a = s && !!n.when(e, t);
|
|
2971
|
+
for (const o of n.children) N(o, e, t, a, r);
|
|
2979
2972
|
return;
|
|
2980
2973
|
}
|
|
2981
|
-
if (
|
|
2974
|
+
if (De(n)) {
|
|
2982
2975
|
const a = n.componentProps.control, o = n.componentProps.itemComponent, l = a.length;
|
|
2983
2976
|
for (let u = 0; u < l; u++) {
|
|
2984
2977
|
const m = a.at(u);
|
|
2985
|
-
|
|
2978
|
+
N(o(m), m, t, s, r);
|
|
2986
2979
|
}
|
|
2987
2980
|
return;
|
|
2988
2981
|
}
|
|
2989
|
-
if (n.value instanceof
|
|
2982
|
+
if (n.value instanceof re) {
|
|
2990
2983
|
const a = n.validators ?? [];
|
|
2991
|
-
a.length > 0 && (
|
|
2984
|
+
a.length > 0 && (s ? r.tasks.push({ signal: n.value, validators: a, scope: e }) : r.clearSignals.push(n.value));
|
|
2992
2985
|
for (const [o, l] of Object.entries(n))
|
|
2993
|
-
o === "value" || o === "validators" ||
|
|
2986
|
+
o === "value" || o === "validators" || N(l, e, t, s, r);
|
|
2994
2987
|
return;
|
|
2995
2988
|
}
|
|
2996
|
-
for (const a of Object.values(n))
|
|
2989
|
+
for (const a of Object.values(n)) N(a, e, t, s, r);
|
|
2997
2990
|
}
|
|
2998
|
-
function z(
|
|
2991
|
+
function z(i, e) {
|
|
2999
2992
|
const t = { tasks: [], clearSignals: [] };
|
|
3000
|
-
return
|
|
2993
|
+
return N(e, i, i, !0, t), t;
|
|
3001
2994
|
}
|
|
3002
|
-
const
|
|
3003
|
-
(
|
|
2995
|
+
const pe = (i, e, t) => {
|
|
2996
|
+
(i[e] ??= []).push(t);
|
|
3004
2997
|
};
|
|
3005
|
-
function
|
|
3006
|
-
const { tasks: t } = z(
|
|
2998
|
+
function Qe(i, e) {
|
|
2999
|
+
const { tasks: t } = z(i, e), s = {};
|
|
3007
3000
|
for (const { signal: r, validators: n, scope: a } of t) {
|
|
3008
3001
|
const o = r.peek();
|
|
3009
3002
|
for (const l of n) {
|
|
3010
|
-
const u = l(o, a,
|
|
3011
|
-
u && typeof u.then == "function" || u &&
|
|
3003
|
+
const u = l(o, a, i);
|
|
3004
|
+
u && typeof u.then == "function" || u && pe(s, r.__path, u);
|
|
3012
3005
|
}
|
|
3013
3006
|
}
|
|
3014
|
-
return { valid: Object.keys(
|
|
3007
|
+
return { valid: Object.keys(s).length === 0, errors: s };
|
|
3015
3008
|
}
|
|
3016
|
-
async function
|
|
3017
|
-
const { tasks: t } = z(
|
|
3018
|
-
return { valid: Object.keys(
|
|
3009
|
+
async function Xe(i, e) {
|
|
3010
|
+
const { tasks: t } = z(i, e), s = await ve(t, i);
|
|
3011
|
+
return { valid: Object.keys(s).length === 0, errors: s };
|
|
3019
3012
|
}
|
|
3020
|
-
async function
|
|
3013
|
+
async function ve(i, e) {
|
|
3021
3014
|
const t = {};
|
|
3022
3015
|
return await Promise.all(
|
|
3023
|
-
|
|
3024
|
-
const a =
|
|
3016
|
+
i.map(async ({ signal: s, validators: r, scope: n }) => {
|
|
3017
|
+
const a = s.peek();
|
|
3025
3018
|
for (const o of r) {
|
|
3026
3019
|
const l = await o(a, n, e);
|
|
3027
|
-
l &&
|
|
3020
|
+
l && pe(t, s.__path, l);
|
|
3028
3021
|
}
|
|
3029
3022
|
})
|
|
3030
3023
|
), t;
|
|
3031
3024
|
}
|
|
3032
|
-
async function
|
|
3033
|
-
const { tasks: t, clearSignals:
|
|
3025
|
+
async function Ze(i, e) {
|
|
3026
|
+
const { tasks: t, clearSignals: s } = z(i, e), r = await ve(t, i);
|
|
3034
3027
|
for (const { signal: n } of t)
|
|
3035
|
-
|
|
3036
|
-
for (const n of
|
|
3037
|
-
|
|
3028
|
+
Q(n)?.setErrors(r[n.__path] ?? []);
|
|
3029
|
+
for (const n of s)
|
|
3030
|
+
Q(n)?.setErrors([]);
|
|
3038
3031
|
return { valid: Object.keys(r).length === 0, errors: r };
|
|
3039
3032
|
}
|
|
3040
|
-
var
|
|
3041
|
-
var
|
|
3033
|
+
var P = { exports: {} }, R = {};
|
|
3034
|
+
var te;
|
|
3042
3035
|
function Le() {
|
|
3043
|
-
if (
|
|
3044
|
-
|
|
3045
|
-
var
|
|
3036
|
+
if (te) return R;
|
|
3037
|
+
te = 1;
|
|
3038
|
+
var i = ne;
|
|
3046
3039
|
function e(c, f) {
|
|
3047
3040
|
return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
|
|
3048
3041
|
}
|
|
3049
|
-
var t = typeof Object.is == "function" ? Object.is : e,
|
|
3042
|
+
var t = typeof Object.is == "function" ? Object.is : e, s = i.useState, r = i.useEffect, n = i.useLayoutEffect, a = i.useDebugValue;
|
|
3050
3043
|
function o(c, f) {
|
|
3051
|
-
var d = f(), p =
|
|
3044
|
+
var d = f(), p = s({ inst: { value: d, getSnapshot: f } }), v = p[0].inst, g = p[1];
|
|
3052
3045
|
return n(
|
|
3053
3046
|
function() {
|
|
3054
3047
|
v.value = d, v.getSnapshot = f, l(v) && g({ inst: v });
|
|
@@ -3077,13 +3070,13 @@ function Le() {
|
|
|
3077
3070
|
return f();
|
|
3078
3071
|
}
|
|
3079
3072
|
var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : o;
|
|
3080
|
-
return R.useSyncExternalStore =
|
|
3073
|
+
return R.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : m, R;
|
|
3081
3074
|
}
|
|
3082
3075
|
var $ = {};
|
|
3083
|
-
var
|
|
3076
|
+
var se;
|
|
3084
3077
|
function je() {
|
|
3085
|
-
return
|
|
3086
|
-
function
|
|
3078
|
+
return se || (se = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
3079
|
+
function i(d, p) {
|
|
3087
3080
|
return d === p && (d !== 0 || 1 / d === 1 / p) || d !== d && p !== p;
|
|
3088
3081
|
}
|
|
3089
3082
|
function e(d, p) {
|
|
@@ -3125,40 +3118,40 @@ function je() {
|
|
|
3125
3118
|
return !0;
|
|
3126
3119
|
}
|
|
3127
3120
|
}
|
|
3128
|
-
function
|
|
3121
|
+
function s(d, p) {
|
|
3129
3122
|
return p();
|
|
3130
3123
|
}
|
|
3131
3124
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
3132
|
-
var r =
|
|
3125
|
+
var r = ne, n = typeof Object.is == "function" ? Object.is : i, a = r.useState, o = r.useEffect, l = r.useLayoutEffect, u = r.useDebugValue, m = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : e;
|
|
3133
3126
|
$.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
3134
3127
|
})()), $;
|
|
3135
3128
|
}
|
|
3136
|
-
var
|
|
3129
|
+
var ie;
|
|
3137
3130
|
function Re() {
|
|
3138
|
-
return
|
|
3131
|
+
return ie || (ie = 1, process.env.NODE_ENV === "production" ? P.exports = Le() : P.exports = je()), P.exports;
|
|
3139
3132
|
}
|
|
3140
3133
|
var J = Re();
|
|
3141
|
-
function $e(
|
|
3142
|
-
if (
|
|
3143
|
-
if (
|
|
3144
|
-
for (let t = 0; t <
|
|
3145
|
-
if (
|
|
3134
|
+
function $e(i, e) {
|
|
3135
|
+
if (i === e) return !0;
|
|
3136
|
+
if (i.length !== e.length) return !1;
|
|
3137
|
+
for (let t = 0; t < i.length; t++)
|
|
3138
|
+
if (i[t] !== e[t]) return !1;
|
|
3146
3139
|
return !0;
|
|
3147
3140
|
}
|
|
3148
|
-
function
|
|
3149
|
-
const
|
|
3150
|
-
if (
|
|
3141
|
+
function Y(i, e, t) {
|
|
3142
|
+
const s = q(null);
|
|
3143
|
+
if (s.current === null) {
|
|
3151
3144
|
const a = {};
|
|
3152
|
-
for (const o in
|
|
3153
|
-
a[o] =
|
|
3154
|
-
|
|
3145
|
+
for (const o in i)
|
|
3146
|
+
a[o] = i[o].value;
|
|
3147
|
+
s.current = { ...a, __snapshot: null };
|
|
3155
3148
|
}
|
|
3156
|
-
const r =
|
|
3149
|
+
const r = E(
|
|
3157
3150
|
(a) => {
|
|
3158
3151
|
let o = !0;
|
|
3159
3152
|
return _(() => {
|
|
3160
|
-
for (const u in
|
|
3161
|
-
|
|
3153
|
+
for (const u in i)
|
|
3154
|
+
i[u].value;
|
|
3162
3155
|
if (o) {
|
|
3163
3156
|
o = !1;
|
|
3164
3157
|
return;
|
|
@@ -3166,11 +3159,11 @@ function ve(s, e, t) {
|
|
|
3166
3159
|
a();
|
|
3167
3160
|
});
|
|
3168
3161
|
},
|
|
3169
|
-
[
|
|
3170
|
-
), n =
|
|
3171
|
-
const a =
|
|
3172
|
-
for (const u in
|
|
3173
|
-
o[u] =
|
|
3162
|
+
[i]
|
|
3163
|
+
), n = E(() => {
|
|
3164
|
+
const a = s.current, o = {};
|
|
3165
|
+
for (const u in i)
|
|
3166
|
+
o[u] = i[u].value;
|
|
3174
3167
|
let l = !1;
|
|
3175
3168
|
for (const u of e) {
|
|
3176
3169
|
const { key: m, useShallowArrayEqual: c } = u, f = o[m], d = a[m];
|
|
@@ -3186,23 +3179,23 @@ function ve(s, e, t) {
|
|
|
3186
3179
|
}
|
|
3187
3180
|
if (!l && a.__snapshot)
|
|
3188
3181
|
return a.__snapshot;
|
|
3189
|
-
for (const u in
|
|
3182
|
+
for (const u in i)
|
|
3190
3183
|
a[u] = o[u];
|
|
3191
3184
|
return a.__snapshot = t(o), a.__snapshot;
|
|
3192
|
-
}, [
|
|
3185
|
+
}, [i, t]);
|
|
3193
3186
|
return J.useSyncExternalStore(r, n, n);
|
|
3194
3187
|
}
|
|
3195
|
-
function Be(
|
|
3188
|
+
function Be(i) {
|
|
3196
3189
|
const e = {
|
|
3197
|
-
value:
|
|
3198
|
-
disabled:
|
|
3199
|
-
errors:
|
|
3200
|
-
pending:
|
|
3201
|
-
valid:
|
|
3202
|
-
invalid:
|
|
3203
|
-
touched:
|
|
3204
|
-
shouldShowError:
|
|
3205
|
-
componentProps:
|
|
3190
|
+
value: i.value,
|
|
3191
|
+
disabled: i.disabled,
|
|
3192
|
+
errors: i.errors,
|
|
3193
|
+
pending: i.pending,
|
|
3194
|
+
valid: i.valid,
|
|
3195
|
+
invalid: i.invalid,
|
|
3196
|
+
touched: i.touched,
|
|
3197
|
+
shouldShowError: i.shouldShowError,
|
|
3198
|
+
componentProps: i.componentProps
|
|
3206
3199
|
}, t = [
|
|
3207
3200
|
{ key: "value" },
|
|
3208
3201
|
{ key: "disabled" },
|
|
@@ -3213,7 +3206,7 @@ function Be(s) {
|
|
|
3213
3206
|
{ key: "touched" },
|
|
3214
3207
|
{ key: "shouldShowError" },
|
|
3215
3208
|
{ key: "componentProps" }
|
|
3216
|
-
],
|
|
3209
|
+
], s = E(
|
|
3217
3210
|
(r) => ({
|
|
3218
3211
|
value: r.value,
|
|
3219
3212
|
pending: r.pending,
|
|
@@ -3227,18 +3220,18 @@ function Be(s) {
|
|
|
3227
3220
|
}),
|
|
3228
3221
|
[]
|
|
3229
3222
|
);
|
|
3230
|
-
return
|
|
3223
|
+
return Y(e, t, s);
|
|
3231
3224
|
}
|
|
3232
|
-
function Ge(
|
|
3225
|
+
function Ge(i) {
|
|
3233
3226
|
const e = {
|
|
3234
|
-
value:
|
|
3235
|
-
length:
|
|
3236
|
-
errors:
|
|
3237
|
-
pending:
|
|
3238
|
-
valid:
|
|
3239
|
-
invalid:
|
|
3240
|
-
touched:
|
|
3241
|
-
dirty:
|
|
3227
|
+
value: i.value,
|
|
3228
|
+
length: i.length,
|
|
3229
|
+
errors: i.errors,
|
|
3230
|
+
pending: i.pending,
|
|
3231
|
+
valid: i.valid,
|
|
3232
|
+
invalid: i.invalid,
|
|
3233
|
+
touched: i.touched,
|
|
3234
|
+
dirty: i.dirty
|
|
3242
3235
|
}, t = [
|
|
3243
3236
|
{ key: "value" },
|
|
3244
3237
|
{ key: "length" },
|
|
@@ -3248,7 +3241,7 @@ function Ge(s) {
|
|
|
3248
3241
|
{ key: "invalid" },
|
|
3249
3242
|
{ key: "touched" },
|
|
3250
3243
|
{ key: "dirty" }
|
|
3251
|
-
],
|
|
3244
|
+
], s = E(
|
|
3252
3245
|
(r) => ({
|
|
3253
3246
|
value: r.value,
|
|
3254
3247
|
length: r.length,
|
|
@@ -3261,101 +3254,108 @@ function Ge(s) {
|
|
|
3261
3254
|
}),
|
|
3262
3255
|
[]
|
|
3263
3256
|
);
|
|
3264
|
-
return
|
|
3257
|
+
return Y(e, t, s);
|
|
3265
3258
|
}
|
|
3266
|
-
function
|
|
3267
|
-
const
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3259
|
+
function Ue() {
|
|
3260
|
+
const i = E(
|
|
3261
|
+
() => ({
|
|
3262
|
+
value: [],
|
|
3263
|
+
length: 0,
|
|
3264
|
+
pending: !1,
|
|
3265
|
+
errors: [],
|
|
3266
|
+
valid: !0,
|
|
3267
|
+
invalid: !1,
|
|
3268
|
+
touched: !1,
|
|
3269
|
+
dirty: !1
|
|
3270
|
+
}),
|
|
3271
|
+
[]
|
|
3272
|
+
);
|
|
3273
|
+
return Y({}, [], i);
|
|
3274
|
+
}
|
|
3275
|
+
function et(i) {
|
|
3276
|
+
const e = i && "length" in i && "map" in i;
|
|
3277
|
+
return i ? e ? Ge(i) : Be(i) : Ue();
|
|
3278
3278
|
}
|
|
3279
|
-
function
|
|
3280
|
-
const e = q({ value:
|
|
3279
|
+
function tt(i) {
|
|
3280
|
+
const e = q({ value: i.value.value }), t = E(
|
|
3281
3281
|
(r) => {
|
|
3282
3282
|
let n = !0;
|
|
3283
3283
|
return _(() => {
|
|
3284
|
-
if (
|
|
3284
|
+
if (i.value.value, n) {
|
|
3285
3285
|
n = !1;
|
|
3286
3286
|
return;
|
|
3287
3287
|
}
|
|
3288
3288
|
r();
|
|
3289
3289
|
});
|
|
3290
3290
|
},
|
|
3291
|
-
[
|
|
3292
|
-
),
|
|
3293
|
-
const r =
|
|
3291
|
+
[i]
|
|
3292
|
+
), s = E(() => {
|
|
3293
|
+
const r = i.value.value;
|
|
3294
3294
|
return e.current.value === r ? e.current.value : (e.current.value = r, r);
|
|
3295
|
-
}, [
|
|
3296
|
-
return J.useSyncExternalStore(t,
|
|
3295
|
+
}, [i]);
|
|
3296
|
+
return J.useSyncExternalStore(t, s, s);
|
|
3297
3297
|
}
|
|
3298
|
-
function
|
|
3299
|
-
const e = q({ length:
|
|
3298
|
+
function st(i) {
|
|
3299
|
+
const e = q({ length: i.length.value }), t = E(
|
|
3300
3300
|
(r) => {
|
|
3301
3301
|
let n = !0;
|
|
3302
3302
|
return _(() => {
|
|
3303
|
-
if (
|
|
3303
|
+
if (i.length.value, n) {
|
|
3304
3304
|
n = !1;
|
|
3305
3305
|
return;
|
|
3306
3306
|
}
|
|
3307
3307
|
r();
|
|
3308
3308
|
});
|
|
3309
3309
|
},
|
|
3310
|
-
[
|
|
3311
|
-
),
|
|
3312
|
-
const r =
|
|
3310
|
+
[i]
|
|
3311
|
+
), s = E(() => {
|
|
3312
|
+
const r = i.length.value;
|
|
3313
3313
|
return e.current.length === r ? e.current.length : (e.current.length = r, r);
|
|
3314
|
-
}, [
|
|
3315
|
-
return J.useSyncExternalStore(t,
|
|
3314
|
+
}, [i]);
|
|
3315
|
+
return J.useSyncExternalStore(t, s, s);
|
|
3316
3316
|
}
|
|
3317
3317
|
export {
|
|
3318
|
-
|
|
3319
|
-
|
|
3318
|
+
X as ArrayNode,
|
|
3319
|
+
S as ErrorStrategy,
|
|
3320
3320
|
_e as FieldNode,
|
|
3321
|
-
|
|
3322
|
-
|
|
3321
|
+
O as FormErrorHandler,
|
|
3322
|
+
D as FormNode,
|
|
3323
3323
|
be as FormStatusMachine,
|
|
3324
|
-
|
|
3324
|
+
we as FormSubmitter,
|
|
3325
3325
|
x as GroupNode,
|
|
3326
3326
|
Fe as ModelArrayNode,
|
|
3327
3327
|
ke as NodeFactory,
|
|
3328
3328
|
K as SubscriptionManager,
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3329
|
+
nt as computeFrom,
|
|
3330
|
+
at as copyFrom,
|
|
3331
|
+
Je as createForm,
|
|
3332
|
+
ce as createFormFromModel,
|
|
3333
|
+
Ye as createModel,
|
|
3334
|
+
ot as disableWhen,
|
|
3335
|
+
lt as enableWhen,
|
|
3336
|
+
Q as getNodeForSignal,
|
|
3337
|
+
ze as getNodeType,
|
|
3338
3338
|
Ne as isArrayNode,
|
|
3339
3339
|
B as isDerived,
|
|
3340
3340
|
Ve as isFieldNode,
|
|
3341
|
-
|
|
3341
|
+
I as isFormNode,
|
|
3342
3342
|
Oe as isGroupNode,
|
|
3343
|
-
|
|
3343
|
+
ut as markDerived,
|
|
3344
3344
|
ye as registerSignalNode,
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3345
|
+
ct as resetWhen,
|
|
3346
|
+
ht as revalidateWhen,
|
|
3347
|
+
dt as runOutsideEffect,
|
|
3348
|
+
ft as safeCallback,
|
|
3349
|
+
pt as safeDebouncedCallback,
|
|
3350
|
+
vt as syncFields,
|
|
3351
|
+
mt as transformValue,
|
|
3352
|
+
V as uniqueId,
|
|
3353
|
+
st as useArrayLength,
|
|
3354
|
+
et as useFormControl,
|
|
3355
|
+
tt as useFormControlValue,
|
|
3356
|
+
Ze as validateFormModel,
|
|
3357
|
+
Xe as validateModel,
|
|
3358
|
+
Qe as validateModelSync,
|
|
3359
|
+
bt as validators,
|
|
3360
|
+
yt as watchField
|
|
3361
3361
|
};
|