@reformer/core 11.0.0-beta.6 → 11.0.0-beta.8
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/README.md +7 -3
- package/dist/behaviors.js +216 -179
- package/dist/create-model-BBRHhHwK.js +30 -0
- package/dist/en-CjAqn7h0.js +41 -0
- package/dist/form/behaviors/collections.d.ts +14 -1
- package/dist/form/behaviors/context.d.ts +18 -2
- package/dist/form/behaviors/index.d.ts +3 -1
- package/dist/form/behaviors/internals.d.ts +9 -1
- package/dist/form/behaviors/schema-operators.d.ts +76 -0
- package/dist/form/behaviors/types.d.ts +15 -3
- package/dist/form/create-core-form.d.ts +5 -3
- package/dist/form/create-form.d.ts +28 -53
- package/dist/form/form-bundle.d.ts +136 -0
- package/dist/form/index.d.ts +6 -1
- package/dist/form/nodes/field-node.d.ts +2 -2
- package/dist/form/nodes/group-node.d.ts +1 -1
- package/dist/form/nodes/model-array-node.d.ts +10 -5
- package/dist/form/schema-controller.d.ts +137 -0
- package/dist/form/schema-subtree.d.ts +28 -0
- package/dist/form/signal-node-registry.d.ts +22 -16
- package/dist/form/types/contracts.d.ts +6 -0
- package/dist/form/types/deep-schema.d.ts +2 -2
- package/dist/form/types/form-proxy.d.ts +1 -1
- package/dist/form/types/schema-node.d.ts +37 -12
- package/dist/form/types/validation-schema.d.ts +13 -1
- package/dist/form/validation/context.d.ts +6 -1
- package/dist/form/validation/index.d.ts +1 -1
- package/dist/form/validation/operators.d.ts +74 -7
- package/dist/form/validation/types.d.ts +2 -1
- package/dist/form/validators/validation-error.d.ts +8 -0
- package/dist/i18n/descriptor.d.ts +54 -0
- package/dist/i18n/en.json.d.ts +45 -0
- package/dist/i18n/loader.d.ts +71 -0
- package/dist/i18n/locale-store.d.ts +39 -0
- package/dist/i18n/locale.d.ts +90 -0
- package/dist/i18n/message-format.d.ts +116 -0
- package/dist/i18n/resolve-localized.d.ts +17 -0
- package/dist/i18n/ru.json.d.ts +45 -0
- package/dist/i18n/translator.d.ts +50 -0
- package/dist/i18n/validation-message.d.ts +18 -0
- package/dist/i18n.d.ts +31 -0
- package/dist/i18n.js +303 -0
- package/dist/index-BrNkQj1y.js +105 -0
- package/dist/index.js +737 -743
- package/dist/loader-Dv_Hl7JC.js +216 -0
- package/dist/locale/en.d.ts +2 -0
- package/dist/locale/en.js +5 -0
- package/dist/locale/en.json +42 -0
- package/dist/locale/index.d.ts +18 -0
- package/dist/locale/ru.d.ts +2 -0
- package/dist/locale/ru.js +41 -0
- package/dist/locale/ru.json +42 -0
- package/dist/locale.d.ts +2 -0
- package/dist/locale.js +9 -0
- package/dist/model/create-model.d.ts +17 -3
- package/dist/model/index.d.ts +8 -3
- package/dist/model/model-nodes.d.ts +67 -4
- package/dist/model/model-signals-proxy.d.ts +33 -1
- package/dist/model/model-value-proxy.d.ts +76 -0
- package/dist/model/types.d.ts +26 -9
- package/dist/model-value-proxy-caTmAiUd.js +419 -0
- package/dist/model.js +21 -17
- package/dist/node-BeV_lV5i.js +100 -0
- package/dist/platforms/react/form-bundle-context.d.ts +27 -0
- package/dist/platforms/react/hooks/types.d.ts +6 -3
- package/dist/platforms/react/hooks/useFormControlValue.d.ts +2 -1
- package/dist/platforms/react/i18n/context.d.ts +13 -0
- package/dist/platforms/react/i18n/hooks.d.ts +59 -0
- package/dist/platforms/react/i18n/provider.d.ts +52 -0
- package/dist/platforms/react/index.d.ts +1 -0
- package/dist/strategy-DgzELWno.js +204 -0
- package/dist/validation-error-B-U3RsV0.js +11 -0
- package/dist/validation.js +7 -6
- package/dist/validators/email.js +5 -8
- package/dist/validators/future-date.js +8 -11
- package/dist/validators/integer.js +4 -7
- package/dist/validators/is-date.js +5 -8
- package/dist/validators/is-number.js +4 -7
- package/dist/validators/max-age.js +8 -11
- package/dist/validators/max-date.js +8 -11
- package/dist/validators/max-length.js +5 -8
- package/dist/validators/max.js +4 -7
- package/dist/validators/min-age.js +8 -11
- package/dist/validators/min-date.js +8 -11
- package/dist/validators/min-length.js +5 -8
- package/dist/validators/min.js +4 -7
- package/dist/validators/multiple-of.js +5 -8
- package/dist/validators/non-negative.js +4 -7
- package/dist/validators/non-zero.js +4 -7
- package/dist/validators/past-date.js +8 -11
- package/dist/validators/pattern.js +5 -8
- package/dist/validators/phone.js +6 -9
- package/dist/validators/required.js +4 -7
- package/dist/validators/url.js +9 -14
- package/dist/validators.js +84 -106
- package/docs/llms/03-api-signatures.md +10 -4
- package/docs/llms/09-formschema.md +5 -5
- package/docs/llms/10-arrays.md +52 -3
- package/docs/llms/16-ui-components.md +2 -2
- package/docs/llms/18-conditional-fields.md +1 -1
- package/docs/llms/21-array-operations.md +26 -0
- package/docs/llms/28-submit-and-reset.md +3 -3
- package/docs/llms/29-async-preload.md +4 -4
- package/docs/llms/33-validation-strategy.md +2 -2
- package/docs/llms/34-i18n.md +272 -0
- package/docs/llms/35-unified-contract.md +246 -0
- package/llms-index.json +1 -1
- package/llms.txt +2746 -229
- package/package.json +22 -3
- package/dist/create-model-Dxh9cfLp.js +0 -97
- package/dist/model-signals-proxy-mV3WGdlO.js +0 -233
- package/dist/node-DGEFMTQu.js +0 -18
- package/dist/strategy-DA3JwxsR.js +0 -170
package/dist/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { c as te } from "./create-model-
|
|
2
|
-
import { e as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import { signal as
|
|
7
|
-
import { r as
|
|
8
|
-
import { g as
|
|
9
|
-
import {
|
|
10
|
-
import { d as
|
|
11
|
-
import
|
|
12
|
-
|
|
1
|
+
import { c as te } from "./create-model-BBRHhHwK.js";
|
|
2
|
+
import { e as dt, a as ct } from "./create-model-BBRHhHwK.js";
|
|
3
|
+
import { d as G, m as Y, b as D, i as j, f as W, h as L, p as se, g as re, j as ie } from "./model-value-proxy-caTmAiUd.js";
|
|
4
|
+
import { a as ft, c as vt, u as mt } from "./model-value-proxy-caTmAiUd.js";
|
|
5
|
+
import { c as yt, a as gt, r as bt, b as Et, d as _t, e as wt, f as At, s as Vt, t as kt, w as St } from "./behaviors-value-C7dSEhCc.js";
|
|
6
|
+
import { signal as m, computed as h, effect as g, batch as ne, Signal as ae } from "@preact/signals-core";
|
|
7
|
+
import { r as N } from "./signal-node-registry-tiwel-TV.js";
|
|
8
|
+
import { g as Nt } from "./signal-node-registry-tiwel-TV.js";
|
|
9
|
+
import { c as oe, u as le } from "./node-BeV_lV5i.js";
|
|
10
|
+
import { b as Ct, a as Pt, d as xt, e as Ot } from "./node-BeV_lV5i.js";
|
|
11
|
+
import { g as ue, i as I, h as de, d as ce } from "./strategy-DgzELWno.js";
|
|
12
|
+
import { useRef as E, useCallback as y, useMemo as he, useEffect as Q, useState as fe, createContext as ve, useContext as me, useImperativeHandle as pe } from "react";
|
|
13
|
+
import { s as P } from "./index-BrNkQj1y.js";
|
|
14
|
+
class x {
|
|
13
15
|
// ============================================================================
|
|
14
16
|
// Protected состояние (для Template Method паттерна)
|
|
15
17
|
// ============================================================================
|
|
@@ -17,17 +19,17 @@ class M {
|
|
|
17
19
|
* Пользователь взаимодействовал с узлом (touched)
|
|
18
20
|
* Protected: наследники могут читать/изменять через методы
|
|
19
21
|
*/
|
|
20
|
-
_touched =
|
|
22
|
+
_touched = m(!1);
|
|
21
23
|
/**
|
|
22
24
|
* Значение узла было изменено (dirty)
|
|
23
25
|
* Protected: наследники могут читать/изменять через методы
|
|
24
26
|
*/
|
|
25
|
-
_dirty =
|
|
27
|
+
_dirty = m(!1);
|
|
26
28
|
/**
|
|
27
29
|
* Текущий статус узла
|
|
28
30
|
* Protected: наследники могут читать/изменять через методы
|
|
29
31
|
*/
|
|
30
|
-
_status =
|
|
32
|
+
_status = m("valid");
|
|
31
33
|
// ============================================================================
|
|
32
34
|
// Публичные computed signals (readonly для внешнего мира)
|
|
33
35
|
// ============================================================================
|
|
@@ -35,21 +37,21 @@ class M {
|
|
|
35
37
|
* Пользователь взаимодействовал с узлом (touched)
|
|
36
38
|
* Computed из _touched для предоставления readonly интерфейса
|
|
37
39
|
*/
|
|
38
|
-
touched =
|
|
40
|
+
touched = h(() => this._touched.value);
|
|
39
41
|
/**
|
|
40
42
|
* Значение узла было изменено (dirty)
|
|
41
43
|
* Computed из _dirty для предоставления readonly интерфейса
|
|
42
44
|
*/
|
|
43
|
-
dirty =
|
|
45
|
+
dirty = h(() => this._dirty.value);
|
|
44
46
|
/**
|
|
45
47
|
* Текущий статус узла
|
|
46
48
|
* Computed из _status для предоставления readonly интерфейса
|
|
47
49
|
*/
|
|
48
|
-
status =
|
|
50
|
+
status = h(() => this._status.value);
|
|
49
51
|
/**
|
|
50
52
|
* Узел отключен (disabled)
|
|
51
53
|
*/
|
|
52
|
-
disabled =
|
|
54
|
+
disabled = h(() => this._status.value === "disabled");
|
|
53
55
|
/**
|
|
54
56
|
* Получить ошибки валидации с фильтрацией
|
|
55
57
|
*
|
|
@@ -90,19 +92,19 @@ class M {
|
|
|
90
92
|
* ```
|
|
91
93
|
*/
|
|
92
94
|
getErrors(e) {
|
|
93
|
-
const
|
|
94
|
-
return e ?
|
|
95
|
-
if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(
|
|
95
|
+
const t = this.errors.value;
|
|
96
|
+
return e ? t.filter((i) => {
|
|
97
|
+
if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(i.code) || e.message !== void 0 && !i.message.toLowerCase().includes(e.message.toLowerCase()))
|
|
96
98
|
return !1;
|
|
97
99
|
if (e.params !== void 0) {
|
|
98
|
-
if (!
|
|
100
|
+
if (!i.params)
|
|
99
101
|
return !1;
|
|
100
|
-
for (const [
|
|
101
|
-
if (
|
|
102
|
+
for (const [r, n] of Object.entries(e.params))
|
|
103
|
+
if (i.params[r] !== n)
|
|
102
104
|
return !1;
|
|
103
105
|
}
|
|
104
|
-
return !(e.predicate !== void 0 && !e.predicate(
|
|
105
|
-
}) :
|
|
106
|
+
return !(e.predicate !== void 0 && !e.predicate(i));
|
|
107
|
+
}) : t;
|
|
106
108
|
}
|
|
107
109
|
// ============================================================================
|
|
108
110
|
// Методы управления состоянием (Template Method)
|
|
@@ -274,7 +276,7 @@ class M {
|
|
|
274
276
|
onEnable() {
|
|
275
277
|
}
|
|
276
278
|
}
|
|
277
|
-
class
|
|
279
|
+
class $ {
|
|
278
280
|
/**
|
|
279
281
|
* Хранилище подписок
|
|
280
282
|
* Ключ: уникальный идентификатор подписки
|
|
@@ -309,8 +311,8 @@ class R {
|
|
|
309
311
|
* manager.remove('anotherSub');
|
|
310
312
|
* ```
|
|
311
313
|
*/
|
|
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,
|
|
314
|
+
add(e, t) {
|
|
315
|
+
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, t), () => this.remove(e);
|
|
314
316
|
}
|
|
315
317
|
/**
|
|
316
318
|
* Удаляет подписку по ключу
|
|
@@ -334,8 +336,8 @@ class R {
|
|
|
334
336
|
* ```
|
|
335
337
|
*/
|
|
336
338
|
remove(e) {
|
|
337
|
-
const
|
|
338
|
-
return
|
|
339
|
+
const t = this.subscriptions.get(e);
|
|
340
|
+
return t ? (t(), this.subscriptions.delete(e), !0) : !1;
|
|
339
341
|
}
|
|
340
342
|
/**
|
|
341
343
|
* Очищает все подписки
|
|
@@ -442,7 +444,7 @@ class R {
|
|
|
442
444
|
this.clear();
|
|
443
445
|
}
|
|
444
446
|
}
|
|
445
|
-
const
|
|
447
|
+
const k = {
|
|
446
448
|
/** FieldNode.watch() */
|
|
447
449
|
Watch: "watch",
|
|
448
450
|
/** FieldNode.computeFrom() */
|
|
@@ -452,15 +454,15 @@ const F = {
|
|
|
452
454
|
/** GroupNode.watchField() */
|
|
453
455
|
WatchField: "watchField"
|
|
454
456
|
};
|
|
455
|
-
let
|
|
456
|
-
function
|
|
457
|
-
return `${
|
|
457
|
+
let ye = 0;
|
|
458
|
+
function S(s) {
|
|
459
|
+
return `${s}-${++ye}`;
|
|
458
460
|
}
|
|
459
|
-
var
|
|
460
|
-
class
|
|
461
|
-
static handle(e,
|
|
462
|
-
const
|
|
463
|
-
switch (process.env.NODE_ENV !== "production" && console.error(`[${
|
|
461
|
+
var b = /* @__PURE__ */ ((s) => (s.THROW = "throw", s.LOG = "log", s.CONVERT = "convert", s))(b || {});
|
|
462
|
+
class w {
|
|
463
|
+
static handle(e, t, i = "throw") {
|
|
464
|
+
const r = this.extractMessage(e);
|
|
465
|
+
switch (process.env.NODE_ENV !== "production" && console.error(`[${t}]`, e), i) {
|
|
464
466
|
case "throw":
|
|
465
467
|
throw e;
|
|
466
468
|
case "log":
|
|
@@ -468,8 +470,8 @@ class k {
|
|
|
468
470
|
case "convert":
|
|
469
471
|
return {
|
|
470
472
|
code: "validator_error",
|
|
471
|
-
message:
|
|
472
|
-
params: { field:
|
|
473
|
+
message: r,
|
|
474
|
+
params: { field: t }
|
|
473
475
|
};
|
|
474
476
|
}
|
|
475
477
|
}
|
|
@@ -524,11 +526,11 @@ class k {
|
|
|
524
526
|
* // { code: 'required', message: 'This field is required', field: 'email' }
|
|
525
527
|
* ```
|
|
526
528
|
*/
|
|
527
|
-
static createValidationError(e,
|
|
529
|
+
static createValidationError(e, t, i) {
|
|
528
530
|
return {
|
|
529
531
|
code: e,
|
|
530
|
-
message:
|
|
531
|
-
params:
|
|
532
|
+
message: t,
|
|
533
|
+
params: i ? { field: i } : void 0
|
|
532
534
|
};
|
|
533
535
|
}
|
|
534
536
|
/**
|
|
@@ -550,7 +552,7 @@ class k {
|
|
|
550
552
|
return typeof e == "object" && e !== null && "code" in e && "message" in e && typeof e.code == "string" && typeof e.message == "string";
|
|
551
553
|
}
|
|
552
554
|
}
|
|
553
|
-
class
|
|
555
|
+
class ge {
|
|
554
556
|
/** Внутренний сигнал статуса */
|
|
555
557
|
_status;
|
|
556
558
|
/** Публичный read-only сигнал статуса */
|
|
@@ -567,7 +569,7 @@ class ce {
|
|
|
567
569
|
* @param initial - Начальный статус (по умолчанию 'valid')
|
|
568
570
|
*/
|
|
569
571
|
constructor(e = "valid") {
|
|
570
|
-
this._status =
|
|
572
|
+
this._status = m(e), this.status = h(() => this._status.value), this.valid = h(() => this._status.value === "valid"), this.invalid = h(() => this._status.value === "invalid"), this.pending = h(() => this._status.value === "pending"), this.disabled = h(() => this._status.value === "disabled");
|
|
571
573
|
}
|
|
572
574
|
/**
|
|
573
575
|
* Начать валидацию
|
|
@@ -650,7 +652,7 @@ class ce {
|
|
|
650
652
|
this._status.value = e ? "invalid" : "valid";
|
|
651
653
|
}
|
|
652
654
|
}
|
|
653
|
-
class
|
|
655
|
+
class be extends x {
|
|
654
656
|
// ============================================================================
|
|
655
657
|
// Приватные сигналы
|
|
656
658
|
// ============================================================================
|
|
@@ -702,13 +704,13 @@ class he extends M {
|
|
|
702
704
|
* Менеджер подписок для централизованного cleanup
|
|
703
705
|
* Использует SubscriptionManager вместо массива для управления подписками
|
|
704
706
|
*/
|
|
705
|
-
disposers = new
|
|
707
|
+
disposers = new $();
|
|
706
708
|
component;
|
|
707
709
|
// ============================================================================
|
|
708
710
|
// Конструктор
|
|
709
711
|
// ============================================================================
|
|
710
712
|
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 ??
|
|
713
|
+
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 ?? m(e.value), this.initialValue = this._value.peek(), this._errors = m([]), this._componentProps = m(e.componentProps || {}), this.statusMachine = new ge(e.disabled ? "disabled" : "valid"), this.value = h(() => this._value.value), this.valid = h(() => this.statusMachine.valid.value), this.invalid = h(() => this.statusMachine.invalid.value), this.pending = h(() => this.statusMachine.pending.value), this.status = h(() => this.statusMachine.status.value), this.disabled = h(() => this.statusMachine.disabled.value), this.errors = h(() => this._errors.value), this.componentProps = h(() => this._componentProps.value), this.shouldShowError = h(
|
|
712
714
|
() => this.statusMachine.invalid.value && (this._touched.value || this._dirty.value)
|
|
713
715
|
);
|
|
714
716
|
}
|
|
@@ -718,15 +720,15 @@ class he extends M {
|
|
|
718
720
|
getValue() {
|
|
719
721
|
return this._value.peek();
|
|
720
722
|
}
|
|
721
|
-
setValue(e,
|
|
722
|
-
if (this._value.value = e, this._dirty.value = !0,
|
|
723
|
+
setValue(e, t) {
|
|
724
|
+
if (this._value.value = e, this._dirty.value = !0, t?.emitEvent === !1)
|
|
723
725
|
return;
|
|
724
|
-
const
|
|
726
|
+
const i = this.validators.length > 0 || this.asyncValidators.length > 0, r = this._errors.value.length > 0;
|
|
725
727
|
if (this.updateOn === "change") {
|
|
726
728
|
this.validate();
|
|
727
729
|
return;
|
|
728
730
|
}
|
|
729
|
-
|
|
731
|
+
r && i && this.validate();
|
|
730
732
|
}
|
|
731
733
|
patchValue(e) {
|
|
732
734
|
this.setValue(e);
|
|
@@ -816,23 +818,23 @@ class he extends M {
|
|
|
816
818
|
* ```
|
|
817
819
|
*/
|
|
818
820
|
async validate(e) {
|
|
819
|
-
const
|
|
820
|
-
if (this.cancelPendingValidation(),
|
|
821
|
+
const t = e?.debounce ?? this.debounceMs;
|
|
822
|
+
if (this.cancelPendingValidation(), t <= 0 || this.asyncValidators.length === 0)
|
|
821
823
|
return this.validateImmediate();
|
|
822
|
-
const
|
|
823
|
-
return new Promise((
|
|
824
|
-
this.pendingValidation = { resolve:
|
|
825
|
-
if (this.validateDebounceTimer = void 0,
|
|
826
|
-
|
|
824
|
+
const i = new AbortController();
|
|
825
|
+
return new Promise((r) => {
|
|
826
|
+
this.pendingValidation = { resolve: r, abortController: i }, this.validateDebounceTimer = setTimeout(async () => {
|
|
827
|
+
if (this.validateDebounceTimer = void 0, i.signal.aborted) {
|
|
828
|
+
r(!1);
|
|
827
829
|
return;
|
|
828
830
|
}
|
|
829
831
|
this.pendingValidation = void 0;
|
|
830
|
-
const n = await this.validateImmediate(
|
|
831
|
-
|
|
832
|
-
},
|
|
832
|
+
const n = await this.validateImmediate(i);
|
|
833
|
+
r(n);
|
|
834
|
+
}, t), i.signal.addEventListener(
|
|
833
835
|
"abort",
|
|
834
836
|
() => {
|
|
835
|
-
this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0),
|
|
837
|
+
this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0), r(!1);
|
|
836
838
|
},
|
|
837
839
|
{ once: !0 }
|
|
838
840
|
);
|
|
@@ -849,52 +851,52 @@ class he extends M {
|
|
|
849
851
|
* - Проверяет signal.aborted в ключевых точках
|
|
850
852
|
*/
|
|
851
853
|
async validateImmediate(e) {
|
|
852
|
-
const
|
|
853
|
-
e || this.currentAbortController?.abort(), this.currentAbortController =
|
|
854
|
-
const { signal:
|
|
854
|
+
const t = e ?? new AbortController();
|
|
855
|
+
e || this.currentAbortController?.abort(), this.currentAbortController = t;
|
|
856
|
+
const { signal: i } = t, r = [];
|
|
855
857
|
for (const a of this.validators) {
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
+
const u = a(this._value.value);
|
|
859
|
+
u && r.push(u);
|
|
858
860
|
}
|
|
859
|
-
if (
|
|
861
|
+
if (i.aborted)
|
|
860
862
|
return !1;
|
|
861
|
-
if (
|
|
862
|
-
this._errors.value =
|
|
863
|
-
const a =
|
|
863
|
+
if (r.length > 0) {
|
|
864
|
+
this._errors.value = r;
|
|
865
|
+
const a = r.some((u) => u.severity !== "warning");
|
|
864
866
|
if (this.statusMachine.setErrors(a), a)
|
|
865
867
|
return !1;
|
|
866
868
|
}
|
|
867
869
|
if (this.asyncValidators.length > 0) {
|
|
868
|
-
if (
|
|
870
|
+
if (i.aborted)
|
|
869
871
|
return !1;
|
|
870
872
|
this.statusMachine.startValidation();
|
|
871
873
|
try {
|
|
872
874
|
const a = await Promise.all(
|
|
873
875
|
this.asyncValidators.map(async (d) => {
|
|
874
|
-
if (
|
|
876
|
+
if (i.aborted)
|
|
875
877
|
throw new DOMException("Validation aborted", "AbortError");
|
|
876
878
|
try {
|
|
877
|
-
const
|
|
878
|
-
if (
|
|
879
|
+
const l = await d(this._value.value, { signal: i });
|
|
880
|
+
if (i.aborted)
|
|
879
881
|
throw new DOMException("Validation aborted", "AbortError");
|
|
880
|
-
return
|
|
881
|
-
} catch (
|
|
882
|
-
if (
|
|
883
|
-
throw
|
|
884
|
-
return
|
|
885
|
-
|
|
882
|
+
return l;
|
|
883
|
+
} catch (l) {
|
|
884
|
+
if (l instanceof DOMException && l.name === "AbortError")
|
|
885
|
+
throw l;
|
|
886
|
+
return w.handle(
|
|
887
|
+
l,
|
|
886
888
|
"FieldNode AsyncValidator",
|
|
887
|
-
|
|
889
|
+
b.CONVERT
|
|
888
890
|
);
|
|
889
891
|
}
|
|
890
892
|
})
|
|
891
893
|
);
|
|
892
|
-
if (
|
|
894
|
+
if (i.aborted)
|
|
893
895
|
return !1;
|
|
894
|
-
const
|
|
895
|
-
if (
|
|
896
|
-
this._errors.value =
|
|
897
|
-
const d =
|
|
896
|
+
const u = a.filter((d) => d !== null);
|
|
897
|
+
if (u.length > 0) {
|
|
898
|
+
this._errors.value = u;
|
|
899
|
+
const d = u.some((l) => l.severity !== "warning");
|
|
898
900
|
if (this.statusMachine.completeValidation(d), d)
|
|
899
901
|
return !1;
|
|
900
902
|
}
|
|
@@ -904,12 +906,12 @@ class he extends M {
|
|
|
904
906
|
throw a;
|
|
905
907
|
}
|
|
906
908
|
}
|
|
907
|
-
return
|
|
909
|
+
return i.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"));
|
|
908
910
|
}
|
|
909
911
|
setErrors(e) {
|
|
910
912
|
this._errors.value = e;
|
|
911
|
-
const
|
|
912
|
-
this.statusMachine.setErrors(
|
|
913
|
+
const t = e.some((i) => i.severity !== "warning");
|
|
914
|
+
this.statusMachine.setErrors(t);
|
|
913
915
|
}
|
|
914
916
|
clearErrors() {
|
|
915
917
|
this._errors.value = [], this.statusMachine.setErrors(!1);
|
|
@@ -966,10 +968,10 @@ class he extends M {
|
|
|
966
968
|
*
|
|
967
969
|
* @example
|
|
968
970
|
* Пример node-level: плоская схема с инлайн-значениями (back-compat путь до M1). В layout-схеме
|
|
969
|
-
* `
|
|
971
|
+
* `createFormFromModel({ model, schema })` поля `validators` нет — правила живут в `defineValidationSchema`.
|
|
970
972
|
* ```typescript
|
|
971
973
|
* // Сценарий 1: Instant feedback после submit
|
|
972
|
-
* const form =
|
|
974
|
+
* const form = createLegacyForm({
|
|
973
975
|
* email: {
|
|
974
976
|
* value: '',
|
|
975
977
|
* component: Input,
|
|
@@ -1027,12 +1029,12 @@ class he extends M {
|
|
|
1027
1029
|
* ```
|
|
1028
1030
|
*/
|
|
1029
1031
|
watch(e) {
|
|
1030
|
-
const
|
|
1032
|
+
const t = new AbortController(), i = g(() => {
|
|
1031
1033
|
const n = this.value.value;
|
|
1032
|
-
e(n,
|
|
1033
|
-
}),
|
|
1034
|
-
return this.disposers.add(
|
|
1035
|
-
|
|
1034
|
+
e(n, t.signal);
|
|
1035
|
+
}), r = S(k.Watch);
|
|
1036
|
+
return this.disposers.add(r, () => {
|
|
1037
|
+
t.abort(), i();
|
|
1036
1038
|
});
|
|
1037
1039
|
}
|
|
1038
1040
|
/**
|
|
@@ -1057,12 +1059,12 @@ class he extends M {
|
|
|
1057
1059
|
* useEffect(() => dispose, []);
|
|
1058
1060
|
* ```
|
|
1059
1061
|
*/
|
|
1060
|
-
computeFrom(e,
|
|
1061
|
-
const
|
|
1062
|
-
const n = e.map((
|
|
1062
|
+
computeFrom(e, t) {
|
|
1063
|
+
const i = g(() => {
|
|
1064
|
+
const n = e.map((u) => u.value), a = t(...n);
|
|
1063
1065
|
this.setValue(a, { emitEvent: !1 });
|
|
1064
|
-
}),
|
|
1065
|
-
return this.disposers.add(
|
|
1066
|
+
}), r = S(k.ComputeFrom);
|
|
1067
|
+
return this.disposers.add(r, i);
|
|
1066
1068
|
}
|
|
1067
1069
|
/**
|
|
1068
1070
|
* Очистить все ресурсы и таймеры
|
|
@@ -1092,59 +1094,59 @@ class he extends M {
|
|
|
1092
1094
|
}
|
|
1093
1095
|
}
|
|
1094
1096
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const { getChildren: e, ownErrors:
|
|
1097
|
-
const o = [...
|
|
1097
|
+
function R(s) {
|
|
1098
|
+
const { getChildren: e, ownErrors: t, disabled: i } = s, r = h(() => t.value.length > 0 ? !1 : e().every((o) => o.disabled.value || o.valid.value)), n = h(() => !r.value), a = h(() => e().some((o) => o.pending.value)), u = h(() => e().some((o) => o.touched.value)), d = h(() => e().some((o) => o.dirty.value)), l = h(() => {
|
|
1099
|
+
const o = [...t.value];
|
|
1098
1100
|
for (const f of e())
|
|
1099
1101
|
o.push(...f.errors.value);
|
|
1100
1102
|
return o;
|
|
1101
|
-
}),
|
|
1103
|
+
}), c = h(() => i?.value ? "disabled" : a.value ? "pending" : n.value ? "invalid" : "valid");
|
|
1102
1104
|
return {
|
|
1103
|
-
valid:
|
|
1105
|
+
valid: r,
|
|
1104
1106
|
invalid: n,
|
|
1105
1107
|
pending: a,
|
|
1106
|
-
touched:
|
|
1108
|
+
touched: u,
|
|
1107
1109
|
dirty: d,
|
|
1108
|
-
errors:
|
|
1109
|
-
status:
|
|
1110
|
+
errors: l,
|
|
1111
|
+
status: c
|
|
1110
1112
|
};
|
|
1111
1113
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return typeof
|
|
1114
|
+
function U(s) {
|
|
1115
|
+
return typeof s == "object" && s !== null && "getProxy" in s && typeof s.getProxy == "function";
|
|
1114
1116
|
}
|
|
1115
|
-
const
|
|
1116
|
-
function
|
|
1117
|
-
let
|
|
1118
|
-
const
|
|
1119
|
-
if (!
|
|
1120
|
-
const
|
|
1117
|
+
const H = "$";
|
|
1118
|
+
function Ee(s, e) {
|
|
1119
|
+
let t;
|
|
1120
|
+
const i = () => {
|
|
1121
|
+
if (!t) {
|
|
1122
|
+
const r = {};
|
|
1121
1123
|
e.forEach((n, a) => {
|
|
1122
|
-
|
|
1123
|
-
}),
|
|
1124
|
+
r[a] = n && U(n) ? n.getProxy() : n;
|
|
1125
|
+
}), t = r;
|
|
1124
1126
|
}
|
|
1125
|
-
return
|
|
1127
|
+
return t;
|
|
1126
1128
|
};
|
|
1127
|
-
return new Proxy(
|
|
1128
|
-
get: (
|
|
1129
|
-
if (n ===
|
|
1130
|
-
return
|
|
1131
|
-
if (n in
|
|
1132
|
-
return
|
|
1129
|
+
return new Proxy(s, {
|
|
1130
|
+
get: (r, n) => {
|
|
1131
|
+
if (n === H)
|
|
1132
|
+
return i();
|
|
1133
|
+
if (n in r)
|
|
1134
|
+
return r[n];
|
|
1133
1135
|
if (typeof n == "string" && e.has(n)) {
|
|
1134
1136
|
const a = e.get(n);
|
|
1135
|
-
return a &&
|
|
1137
|
+
return a && U(a) ? a.getProxy() : a;
|
|
1136
1138
|
}
|
|
1137
1139
|
},
|
|
1138
|
-
set: (
|
|
1139
|
-
has: (
|
|
1140
|
-
ownKeys: (
|
|
1141
|
-
const n = Reflect.ownKeys(
|
|
1140
|
+
set: (r, n, a) => typeof n == "string" && e.has(n) ? !1 : (r[n] = a, !0),
|
|
1141
|
+
has: (r, n) => n === H || typeof n == "string" && e.has(n) ? !0 : n in r,
|
|
1142
|
+
ownKeys: (r) => {
|
|
1143
|
+
const n = Reflect.ownKeys(r), a = Array.from(e.keys());
|
|
1142
1144
|
return [.../* @__PURE__ */ new Set([...n, ...a])];
|
|
1143
1145
|
},
|
|
1144
|
-
getOwnPropertyDescriptor: (
|
|
1146
|
+
getOwnPropertyDescriptor: (r, n) => typeof n == "string" && e.has(n) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(r, n)
|
|
1145
1147
|
});
|
|
1146
1148
|
}
|
|
1147
|
-
class
|
|
1149
|
+
class _e {
|
|
1148
1150
|
/**
|
|
1149
1151
|
* @param form - Форма для отправки
|
|
1150
1152
|
*/
|
|
@@ -1152,9 +1154,9 @@ class ve {
|
|
|
1152
1154
|
this.form = e;
|
|
1153
1155
|
}
|
|
1154
1156
|
/** Внутренний сигнал состояния отправки */
|
|
1155
|
-
_submitting =
|
|
1157
|
+
_submitting = m(!1);
|
|
1156
1158
|
/** Публичный read-only сигнал состояния отправки */
|
|
1157
|
-
submitting =
|
|
1159
|
+
submitting = h(() => this._submitting.value);
|
|
1158
1160
|
/**
|
|
1159
1161
|
* Отправить форму
|
|
1160
1162
|
*
|
|
@@ -1188,9 +1190,9 @@ class ve {
|
|
|
1188
1190
|
* }
|
|
1189
1191
|
* ```
|
|
1190
1192
|
*/
|
|
1191
|
-
async submit(e,
|
|
1192
|
-
const { skipValidation:
|
|
1193
|
-
if (
|
|
1193
|
+
async submit(e, t) {
|
|
1194
|
+
const { skipValidation: i = !1, skipTouch: r = !1 } = t || {};
|
|
1195
|
+
if (r || this.form.markAsTouched(), !i && !await this.form.validate())
|
|
1194
1196
|
return null;
|
|
1195
1197
|
this._submitting.value = !0;
|
|
1196
1198
|
try {
|
|
@@ -1223,9 +1225,9 @@ class ve {
|
|
|
1223
1225
|
* }
|
|
1224
1226
|
* ```
|
|
1225
1227
|
*/
|
|
1226
|
-
async submitWithResult(e,
|
|
1227
|
-
const { skipValidation:
|
|
1228
|
-
if (
|
|
1228
|
+
async submitWithResult(e, t) {
|
|
1229
|
+
const { skipValidation: i = !1, skipTouch: r = !1 } = t || {};
|
|
1230
|
+
if (r || this.form.markAsTouched(), !i && !await this.form.validate())
|
|
1229
1231
|
return { success: !1, data: null };
|
|
1230
1232
|
this._submitting.value = !0;
|
|
1231
1233
|
try {
|
|
@@ -1241,16 +1243,16 @@ class ve {
|
|
|
1241
1243
|
}
|
|
1242
1244
|
}
|
|
1243
1245
|
}
|
|
1244
|
-
function
|
|
1246
|
+
function we(s) {
|
|
1245
1247
|
const e = [];
|
|
1246
|
-
for (const
|
|
1247
|
-
const
|
|
1248
|
-
if (!
|
|
1249
|
-
e.push(
|
|
1248
|
+
for (const t of s.split(".")) {
|
|
1249
|
+
const i = /^([^[\]]+)(?:\[(\d+)\])?$/.exec(t);
|
|
1250
|
+
if (!i) return [];
|
|
1251
|
+
e.push(i[2] !== void 0 ? { key: i[1], index: Number(i[2]) } : { key: i[1] });
|
|
1250
1252
|
}
|
|
1251
1253
|
return e;
|
|
1252
1254
|
}
|
|
1253
|
-
class
|
|
1255
|
+
class _ extends x {
|
|
1254
1256
|
// ============================================================================
|
|
1255
1257
|
// Приватные поля
|
|
1256
1258
|
// ============================================================================
|
|
@@ -1263,7 +1265,7 @@ class w extends M {
|
|
|
1263
1265
|
/**
|
|
1264
1266
|
* Менеджер подписок для централизованного cleanup
|
|
1265
1267
|
*/
|
|
1266
|
-
disposers = new
|
|
1268
|
+
disposers = new $();
|
|
1267
1269
|
/**
|
|
1268
1270
|
* Ссылка на Proxy-инстанс
|
|
1269
1271
|
*/
|
|
@@ -1275,7 +1277,7 @@ class w extends M {
|
|
|
1275
1277
|
/**
|
|
1276
1278
|
* Фабрика для создания узлов формы
|
|
1277
1279
|
*/
|
|
1278
|
-
nodeFactory = new
|
|
1280
|
+
nodeFactory = new Ae();
|
|
1279
1281
|
// ============================================================================
|
|
1280
1282
|
// Приватные сигналы состояния (inline из StateManager)
|
|
1281
1283
|
// ============================================================================
|
|
@@ -1283,9 +1285,9 @@ class w extends M {
|
|
|
1283
1285
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1284
1286
|
formSubmitter;
|
|
1285
1287
|
/** Флаг disabled состояния */
|
|
1286
|
-
_disabled =
|
|
1288
|
+
_disabled = m(!1);
|
|
1287
1289
|
/** Form-level validation errors */
|
|
1288
|
-
_formErrors =
|
|
1290
|
+
_formErrors = m([]);
|
|
1289
1291
|
/**
|
|
1290
1292
|
* M1: связь листовой ноды-ребёнка → её сигнал модели (тот, что помечает `markDerived`).
|
|
1291
1293
|
* Нужна bulk-сеттерам (`setValue`/`patchValue`), чтобы корректно определять derived-поля:
|
|
@@ -1306,19 +1308,19 @@ class w extends M {
|
|
|
1306
1308
|
status;
|
|
1307
1309
|
submitting;
|
|
1308
1310
|
constructor(e) {
|
|
1309
|
-
super(), this.formSubmitter = new
|
|
1310
|
-
const
|
|
1311
|
-
for (const [
|
|
1312
|
-
const
|
|
1313
|
-
this._fields.set(
|
|
1311
|
+
super(), this.formSubmitter = new _e(this);
|
|
1312
|
+
const t = e.form, i = t != null && typeof t == "object" && ("valueSignal" in t || "value" in t), n = "form" in e && !i ? e.form : e;
|
|
1313
|
+
for (const [u, d] of Object.entries(n)) {
|
|
1314
|
+
const l = this.createNode(d);
|
|
1315
|
+
this._fields.set(u, l);
|
|
1314
1316
|
}
|
|
1315
|
-
this.value =
|
|
1316
|
-
const
|
|
1317
|
-
return this._fields.forEach((d,
|
|
1318
|
-
l
|
|
1319
|
-
}),
|
|
1317
|
+
this.value = h(() => {
|
|
1318
|
+
const u = {};
|
|
1319
|
+
return this._fields.forEach((d, l) => {
|
|
1320
|
+
u[l] = d.value.value;
|
|
1321
|
+
}), u;
|
|
1320
1322
|
});
|
|
1321
|
-
const a =
|
|
1323
|
+
const a = R({
|
|
1322
1324
|
getChildren: () => Array.from(this._fields.values()),
|
|
1323
1325
|
ownErrors: this._formErrors,
|
|
1324
1326
|
disabled: this._disabled
|
|
@@ -1333,35 +1335,35 @@ class w extends M {
|
|
|
1333
1335
|
* @see buildFormProxy
|
|
1334
1336
|
*/
|
|
1335
1337
|
buildProxy() {
|
|
1336
|
-
return
|
|
1338
|
+
return Ee(this, this._fields);
|
|
1337
1339
|
}
|
|
1338
1340
|
// ============================================================================
|
|
1339
1341
|
// Реализация абстрактных методов FormNode
|
|
1340
1342
|
// ============================================================================
|
|
1341
1343
|
getValue() {
|
|
1342
1344
|
const e = {};
|
|
1343
|
-
return this._fields.forEach((
|
|
1344
|
-
e[
|
|
1345
|
+
return this._fields.forEach((t, i) => {
|
|
1346
|
+
e[i] = t.getValue();
|
|
1345
1347
|
}), e;
|
|
1346
1348
|
}
|
|
1347
|
-
setValue(e,
|
|
1348
|
-
for (const [
|
|
1349
|
-
const n = this._fields.get(
|
|
1349
|
+
setValue(e, t) {
|
|
1350
|
+
for (const [i, r] of Object.entries(e)) {
|
|
1351
|
+
const n = this._fields.get(i);
|
|
1350
1352
|
if (n) {
|
|
1351
1353
|
const a = this._fieldSignals.get(n) ?? n.value;
|
|
1352
|
-
if (
|
|
1353
|
-
n.setValue(
|
|
1354
|
+
if (G(a)) continue;
|
|
1355
|
+
n.setValue(r, t);
|
|
1354
1356
|
}
|
|
1355
1357
|
}
|
|
1356
1358
|
}
|
|
1357
1359
|
patchValue(e) {
|
|
1358
|
-
|
|
1359
|
-
for (const [
|
|
1360
|
-
const
|
|
1361
|
-
if (
|
|
1362
|
-
const n = this._fieldSignals.get(
|
|
1363
|
-
if (
|
|
1364
|
-
|
|
1360
|
+
ne(() => {
|
|
1361
|
+
for (const [t, i] of Object.entries(e)) {
|
|
1362
|
+
const r = this._fields.get(t);
|
|
1363
|
+
if (r && i !== void 0) {
|
|
1364
|
+
const n = this._fieldSignals.get(r) ?? r.value;
|
|
1365
|
+
if (G(n)) continue;
|
|
1366
|
+
r.setValue(i, { emitEvent: !1 });
|
|
1365
1367
|
}
|
|
1366
1368
|
}
|
|
1367
1369
|
});
|
|
@@ -1384,9 +1386,9 @@ class w extends M {
|
|
|
1384
1386
|
* ```
|
|
1385
1387
|
*/
|
|
1386
1388
|
reset(e) {
|
|
1387
|
-
this._formErrors.value = [], this._fields.forEach((
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1389
|
+
this._formErrors.value = [], this._fields.forEach((t, i) => {
|
|
1390
|
+
const r = e?.[i];
|
|
1391
|
+
t.reset(r);
|
|
1390
1392
|
});
|
|
1391
1393
|
}
|
|
1392
1394
|
/**
|
|
@@ -1398,8 +1400,8 @@ class w extends M {
|
|
|
1398
1400
|
});
|
|
1399
1401
|
}
|
|
1400
1402
|
async validate() {
|
|
1401
|
-
return this.clearErrors(), await Promise.all(Array.from(this._fields.values()).map((
|
|
1402
|
-
(
|
|
1403
|
+
return this.clearErrors(), await Promise.all(Array.from(this._fields.values()).map((t) => t.validate())), Array.from(this._fields.values()).every(
|
|
1404
|
+
(t) => t.valid.value || t.disabled.value
|
|
1403
1405
|
);
|
|
1404
1406
|
}
|
|
1405
1407
|
/**
|
|
@@ -1485,8 +1487,8 @@ class w extends M {
|
|
|
1485
1487
|
* `onSubmit` (или void-обработчик). Если вызывающей стороне нужно различать эти случаи —
|
|
1486
1488
|
* используйте {@link submitWithResult}, который возвращает явный флаг `success`.
|
|
1487
1489
|
*/
|
|
1488
|
-
async submit(e,
|
|
1489
|
-
return this.formSubmitter.submit(e,
|
|
1490
|
+
async submit(e, t) {
|
|
1491
|
+
return this.formSubmitter.submit(e, t);
|
|
1490
1492
|
}
|
|
1491
1493
|
/**
|
|
1492
1494
|
* Отправить форму с расширенным результатом
|
|
@@ -1495,8 +1497,8 @@ class w extends M {
|
|
|
1495
1497
|
* @param options - Опции submit
|
|
1496
1498
|
* @returns Объект SubmitResult с данными, статусом и возможной ошибкой
|
|
1497
1499
|
*/
|
|
1498
|
-
async submitWithResult(e,
|
|
1499
|
-
return this.formSubmitter.submitWithResult(e,
|
|
1500
|
+
async submitWithResult(e, t) {
|
|
1501
|
+
return this.formSubmitter.submitWithResult(e, t);
|
|
1500
1502
|
}
|
|
1501
1503
|
/**
|
|
1502
1504
|
* Получить вложенное поле по пути
|
|
@@ -1530,21 +1532,21 @@ class w extends M {
|
|
|
1530
1532
|
getFieldByPath(e) {
|
|
1531
1533
|
if (e.startsWith(".") || e.endsWith("."))
|
|
1532
1534
|
return;
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1535
|
+
const t = we(e);
|
|
1536
|
+
if (t.length === 0)
|
|
1535
1537
|
return;
|
|
1536
|
-
let
|
|
1537
|
-
for (const
|
|
1538
|
-
if (!(
|
|
1539
|
-
if (
|
|
1540
|
-
if ("at" in
|
|
1541
|
-
const n =
|
|
1538
|
+
let i = this;
|
|
1539
|
+
for (const r of t) {
|
|
1540
|
+
if (!(i instanceof _) || (i = i.getField(r.key), !i)) return;
|
|
1541
|
+
if (r.index !== void 0)
|
|
1542
|
+
if ("at" in i && "length" in i && typeof i.at == "function") {
|
|
1543
|
+
const n = i.at(r.index);
|
|
1542
1544
|
if (!n) return;
|
|
1543
|
-
|
|
1545
|
+
i = n;
|
|
1544
1546
|
} else
|
|
1545
1547
|
return;
|
|
1546
1548
|
}
|
|
1547
|
-
return
|
|
1549
|
+
return i;
|
|
1548
1550
|
}
|
|
1549
1551
|
// ============================================================================
|
|
1550
1552
|
// Private методы для создания узлов
|
|
@@ -1573,17 +1575,17 @@ class w extends M {
|
|
|
1573
1575
|
/**
|
|
1574
1576
|
* Связывает два поля: при изменении source автоматически обновляется target
|
|
1575
1577
|
*/
|
|
1576
|
-
linkFields(e,
|
|
1577
|
-
const
|
|
1578
|
-
if (!
|
|
1579
|
-
const d =
|
|
1578
|
+
linkFields(e, t, i) {
|
|
1579
|
+
const r = this._fields.get(e), n = this._fields.get(t);
|
|
1580
|
+
if (!r || !n) {
|
|
1581
|
+
const d = r ? t : e;
|
|
1580
1582
|
throw new Error(`GroupNode.linkFields: field "${String(d)}" not found`);
|
|
1581
1583
|
}
|
|
1582
|
-
const a =
|
|
1583
|
-
const d =
|
|
1584
|
-
n.setValue(
|
|
1585
|
-
}),
|
|
1586
|
-
return this.disposers.add(
|
|
1584
|
+
const a = g(() => {
|
|
1585
|
+
const d = r.value.value, l = i ? i(d) : d;
|
|
1586
|
+
n.setValue(l, { emitEvent: !1 });
|
|
1587
|
+
}), u = S(k.LinkFields);
|
|
1588
|
+
return this.disposers.add(u, a);
|
|
1587
1589
|
}
|
|
1588
1590
|
/**
|
|
1589
1591
|
* Подписка на изменения вложенного поля по строковому пути
|
|
@@ -1613,27 +1615,27 @@ class w extends M {
|
|
|
1613
1615
|
* ```
|
|
1614
1616
|
*/
|
|
1615
1617
|
/** Подписка на top-level поле — value типизирован как `T[K]`. */
|
|
1616
|
-
watchField(e,
|
|
1617
|
-
const
|
|
1618
|
-
if (!
|
|
1618
|
+
watchField(e, t) {
|
|
1619
|
+
const i = this.getFieldByPath(e);
|
|
1620
|
+
if (!i)
|
|
1619
1621
|
throw new Error(`GroupNode.watchField: field "${e}" not found`);
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
}), n =
|
|
1623
|
-
return this.disposers.add(n,
|
|
1622
|
+
const r = g(() => {
|
|
1623
|
+
t(i.value.value);
|
|
1624
|
+
}), n = S(k.WatchField);
|
|
1625
|
+
return this.disposers.add(n, r);
|
|
1624
1626
|
}
|
|
1625
1627
|
/**
|
|
1626
1628
|
* Подписка на вложенное поле по строковому пути ("address.city").
|
|
1627
1629
|
* Путь нельзя выразить в типах узла → value честно `unknown`, потребитель сужает.
|
|
1628
1630
|
*/
|
|
1629
|
-
watchFieldByPath(e,
|
|
1630
|
-
const
|
|
1631
|
-
if (!
|
|
1631
|
+
watchFieldByPath(e, t) {
|
|
1632
|
+
const i = this.getFieldByPath(e);
|
|
1633
|
+
if (!i)
|
|
1632
1634
|
throw new Error(`GroupNode.watchFieldByPath: field "${e}" not found`);
|
|
1633
|
-
const
|
|
1634
|
-
|
|
1635
|
-
}), n =
|
|
1636
|
-
return this.disposers.add(n,
|
|
1635
|
+
const r = g(() => {
|
|
1636
|
+
t(i.value.value);
|
|
1637
|
+
}), n = S(k.WatchField);
|
|
1638
|
+
return this.disposers.add(n, r);
|
|
1637
1639
|
}
|
|
1638
1640
|
/**
|
|
1639
1641
|
* Hook: вызывается после disable()
|
|
@@ -1660,8 +1662,8 @@ class w extends M {
|
|
|
1660
1662
|
* @internal
|
|
1661
1663
|
*/
|
|
1662
1664
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1663
|
-
registerFieldSignal(e,
|
|
1664
|
-
this._fieldSignals.set(e,
|
|
1665
|
+
registerFieldSignal(e, t) {
|
|
1666
|
+
this._fieldSignals.set(e, t);
|
|
1665
1667
|
}
|
|
1666
1668
|
/**
|
|
1667
1669
|
* Очистить все ресурсы узла
|
|
@@ -1672,7 +1674,7 @@ class w extends M {
|
|
|
1672
1674
|
});
|
|
1673
1675
|
}
|
|
1674
1676
|
}
|
|
1675
|
-
class
|
|
1677
|
+
class q extends x {
|
|
1676
1678
|
// ============================================================================
|
|
1677
1679
|
// Приватные поля
|
|
1678
1680
|
// ============================================================================
|
|
@@ -1683,9 +1685,9 @@ class W extends M {
|
|
|
1683
1685
|
* Менеджер подписок для централизованного cleanup
|
|
1684
1686
|
* Использует SubscriptionManager вместо массива для управления подписками
|
|
1685
1687
|
*/
|
|
1686
|
-
disposers = new
|
|
1688
|
+
disposers = new $();
|
|
1687
1689
|
/** Array-level validation errors (e.g., "минимум 1 элемент") */
|
|
1688
|
-
_arrayErrors =
|
|
1690
|
+
_arrayErrors = m([]);
|
|
1689
1691
|
// ============================================================================
|
|
1690
1692
|
// Публичные computed signals
|
|
1691
1693
|
// ============================================================================
|
|
@@ -1701,16 +1703,16 @@ class W extends M {
|
|
|
1701
1703
|
// ============================================================================
|
|
1702
1704
|
// Конструктор
|
|
1703
1705
|
// ============================================================================
|
|
1704
|
-
constructor(e,
|
|
1705
|
-
super(), this.itemSchema = e, this.initialItems =
|
|
1706
|
-
for (const
|
|
1707
|
-
this.push(
|
|
1708
|
-
this.length =
|
|
1709
|
-
const
|
|
1706
|
+
constructor(e, t = []) {
|
|
1707
|
+
super(), this.itemSchema = e, this.initialItems = t, this.items = m([]);
|
|
1708
|
+
for (const r of t)
|
|
1709
|
+
this.push(r);
|
|
1710
|
+
this.length = h(() => this.items.value.length), this.value = h(() => this.items.value.map((r) => r.value.value));
|
|
1711
|
+
const i = R({
|
|
1710
1712
|
getChildren: () => this.items.value,
|
|
1711
1713
|
ownErrors: this._arrayErrors
|
|
1712
1714
|
});
|
|
1713
|
-
this.valid =
|
|
1715
|
+
this.valid = i.valid, this.invalid = i.invalid, this.pending = i.pending, this.touched = i.touched, this.dirty = i.dirty, this.errors = i.errors, this.status = i.status;
|
|
1714
1716
|
}
|
|
1715
1717
|
// ============================================================================
|
|
1716
1718
|
// CRUD операции
|
|
@@ -1720,8 +1722,8 @@ class W extends M {
|
|
|
1720
1722
|
* @param initialValue - Начальные значения для нового элемента
|
|
1721
1723
|
*/
|
|
1722
1724
|
push(e) {
|
|
1723
|
-
const
|
|
1724
|
-
this.items.value = [...this.items.value,
|
|
1725
|
+
const t = this.createItem(e);
|
|
1726
|
+
this.items.value = [...this.items.value, t];
|
|
1725
1727
|
}
|
|
1726
1728
|
/**
|
|
1727
1729
|
* Удалить элемент по индексу
|
|
@@ -1732,36 +1734,36 @@ class W extends M {
|
|
|
1732
1734
|
*/
|
|
1733
1735
|
removeAt(e) {
|
|
1734
1736
|
if (e < 0 || e >= this.items.value.length) {
|
|
1735
|
-
|
|
1737
|
+
w.handle(
|
|
1736
1738
|
new Error(
|
|
1737
1739
|
`ArrayNode.removeAt: index ${e} out of bounds (length: ${this.items.value.length})`
|
|
1738
1740
|
),
|
|
1739
1741
|
"ArrayNode.removeAt",
|
|
1740
|
-
|
|
1742
|
+
b.LOG
|
|
1741
1743
|
);
|
|
1742
1744
|
return;
|
|
1743
1745
|
}
|
|
1744
|
-
const
|
|
1745
|
-
this.items.value = this.items.value.filter((
|
|
1746
|
+
const t = this.items.value[e];
|
|
1747
|
+
this.items.value = this.items.value.filter((i, r) => r !== e), t && "dispose" in t && typeof t.dispose == "function" && t.dispose();
|
|
1746
1748
|
}
|
|
1747
1749
|
/**
|
|
1748
1750
|
* Вставить элемент в массив
|
|
1749
1751
|
* @param index - Индекс для вставки
|
|
1750
1752
|
* @param initialValue - Начальные значения для нового элемента
|
|
1751
1753
|
*/
|
|
1752
|
-
insert(e,
|
|
1754
|
+
insert(e, t) {
|
|
1753
1755
|
if (e < 0 || e > this.items.value.length) {
|
|
1754
|
-
|
|
1756
|
+
w.handle(
|
|
1755
1757
|
new Error(
|
|
1756
1758
|
`ArrayNode.insert: index ${e} out of bounds (length: ${this.items.value.length})`
|
|
1757
1759
|
),
|
|
1758
1760
|
"ArrayNode.insert",
|
|
1759
|
-
|
|
1761
|
+
b.LOG
|
|
1760
1762
|
);
|
|
1761
1763
|
return;
|
|
1762
1764
|
}
|
|
1763
|
-
const
|
|
1764
|
-
|
|
1765
|
+
const i = this.createItem(t), r = [...this.items.value];
|
|
1766
|
+
r.splice(e, 0, i), this.items.value = r;
|
|
1765
1767
|
}
|
|
1766
1768
|
/**
|
|
1767
1769
|
* Переместить элемент массива с позиции `from` на позицию `to`
|
|
@@ -1779,19 +1781,19 @@ class W extends M {
|
|
|
1779
1781
|
* form.items.move(2, 1);
|
|
1780
1782
|
* ```
|
|
1781
1783
|
*/
|
|
1782
|
-
move(e,
|
|
1783
|
-
const
|
|
1784
|
-
if (e < 0 || e >=
|
|
1785
|
-
|
|
1786
|
-
new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${
|
|
1784
|
+
move(e, t) {
|
|
1785
|
+
const i = this.items.value.length;
|
|
1786
|
+
if (e < 0 || e >= i || t < 0 || t >= i) {
|
|
1787
|
+
w.handle(
|
|
1788
|
+
new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${t}, length=${i})`),
|
|
1787
1789
|
"ArrayNode.move",
|
|
1788
|
-
|
|
1790
|
+
b.LOG
|
|
1789
1791
|
);
|
|
1790
1792
|
return;
|
|
1791
1793
|
}
|
|
1792
|
-
if (e ===
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1794
|
+
if (e === t) return;
|
|
1795
|
+
const r = [...this.items.value], [n] = r.splice(e, 1);
|
|
1796
|
+
r.splice(t, 0, n), this.items.value = r;
|
|
1795
1797
|
}
|
|
1796
1798
|
/**
|
|
1797
1799
|
* Поменять местами два элемента массива
|
|
@@ -1807,19 +1809,19 @@ class W extends M {
|
|
|
1807
1809
|
* form.items.swap(0, 2);
|
|
1808
1810
|
* ```
|
|
1809
1811
|
*/
|
|
1810
|
-
swap(e,
|
|
1811
|
-
const
|
|
1812
|
-
if (e < 0 || e >=
|
|
1813
|
-
|
|
1814
|
-
new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${
|
|
1812
|
+
swap(e, t) {
|
|
1813
|
+
const i = this.items.value.length;
|
|
1814
|
+
if (e < 0 || e >= i || t < 0 || t >= i) {
|
|
1815
|
+
w.handle(
|
|
1816
|
+
new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${t}, length=${i})`),
|
|
1815
1817
|
"ArrayNode.swap",
|
|
1816
|
-
|
|
1818
|
+
b.LOG
|
|
1817
1819
|
);
|
|
1818
1820
|
return;
|
|
1819
1821
|
}
|
|
1820
|
-
if (e ===
|
|
1821
|
-
const
|
|
1822
|
-
[
|
|
1822
|
+
if (e === t) return;
|
|
1823
|
+
const r = [...this.items.value];
|
|
1824
|
+
[r[e], r[t]] = [r[t], r[e]], this.items.value = r;
|
|
1823
1825
|
}
|
|
1824
1826
|
/**
|
|
1825
1827
|
* Удалить все элементы массива
|
|
@@ -1829,8 +1831,8 @@ class W extends M {
|
|
|
1829
1831
|
*/
|
|
1830
1832
|
clear() {
|
|
1831
1833
|
const e = [...this.items.value];
|
|
1832
|
-
this.items.value = [], e.forEach((
|
|
1833
|
-
"dispose" in
|
|
1834
|
+
this.items.value = [], e.forEach((t) => {
|
|
1835
|
+
"dispose" in t && typeof t.dispose == "function" && t.dispose();
|
|
1834
1836
|
});
|
|
1835
1837
|
}
|
|
1836
1838
|
/**
|
|
@@ -1839,9 +1841,9 @@ class W extends M {
|
|
|
1839
1841
|
* @returns Типизированный GroupNode proxy или undefined если индекс вне границ
|
|
1840
1842
|
*/
|
|
1841
1843
|
at(e) {
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
return
|
|
1844
|
+
const t = this.items.value[e];
|
|
1845
|
+
if (t)
|
|
1846
|
+
return t.getProxy();
|
|
1845
1847
|
}
|
|
1846
1848
|
// ============================================================================
|
|
1847
1849
|
// Реализация абстрактных методов
|
|
@@ -1849,14 +1851,14 @@ class W extends M {
|
|
|
1849
1851
|
getValue() {
|
|
1850
1852
|
return this.items.value.map((e) => e.getValue());
|
|
1851
1853
|
}
|
|
1852
|
-
setValue(e,
|
|
1853
|
-
this.clear(), e.forEach((
|
|
1854
|
-
|
|
1854
|
+
setValue(e, t) {
|
|
1855
|
+
this.clear(), e.forEach((i) => this.push(i)), t?.emitEvent !== !1 && this.validate().catch((i) => {
|
|
1856
|
+
w.handle(i, "ArrayNode.setValue", b.LOG);
|
|
1855
1857
|
});
|
|
1856
1858
|
}
|
|
1857
1859
|
patchValue(e) {
|
|
1858
|
-
e.forEach((
|
|
1859
|
-
this.items.value[
|
|
1860
|
+
e.forEach((t, i) => {
|
|
1861
|
+
this.items.value[i] && t !== void 0 && this.items.value[i].patchValue(t);
|
|
1860
1862
|
});
|
|
1861
1863
|
}
|
|
1862
1864
|
/**
|
|
@@ -1877,7 +1879,7 @@ class W extends M {
|
|
|
1877
1879
|
* ```
|
|
1878
1880
|
*/
|
|
1879
1881
|
reset(e) {
|
|
1880
|
-
this._arrayErrors.value = [], this.clear(), e && e.forEach((
|
|
1882
|
+
this._arrayErrors.value = [], this.clear(), e && e.forEach((t) => this.push(t));
|
|
1881
1883
|
}
|
|
1882
1884
|
/**
|
|
1883
1885
|
* Сбросить массив к исходным значениям (initialItems)
|
|
@@ -1911,7 +1913,7 @@ class W extends M {
|
|
|
1911
1913
|
this._arrayErrors.value = [], this.clear(), this.initialItems.forEach((e) => this.push(e));
|
|
1912
1914
|
}
|
|
1913
1915
|
async validate() {
|
|
1914
|
-
return (await Promise.all(this.items.value.map((
|
|
1916
|
+
return (await Promise.all(this.items.value.map((t) => t.validate()))).every(Boolean) && this._arrayErrors.value.length === 0;
|
|
1915
1917
|
}
|
|
1916
1918
|
/**
|
|
1917
1919
|
* Установить array-level validation errors
|
|
@@ -1984,9 +1986,9 @@ class W extends M {
|
|
|
1984
1986
|
* @param callback - Функция, вызываемая для каждого элемента с типизированным GroupNode proxy
|
|
1985
1987
|
*/
|
|
1986
1988
|
forEach(e) {
|
|
1987
|
-
this.items.value.forEach((
|
|
1988
|
-
const
|
|
1989
|
-
e(
|
|
1989
|
+
this.items.value.forEach((t, i) => {
|
|
1990
|
+
const r = t.getProxy();
|
|
1991
|
+
e(r, i);
|
|
1990
1992
|
});
|
|
1991
1993
|
}
|
|
1992
1994
|
/**
|
|
@@ -1995,9 +1997,9 @@ class W extends M {
|
|
|
1995
1997
|
* @returns Новый массив результатов
|
|
1996
1998
|
*/
|
|
1997
1999
|
map(e) {
|
|
1998
|
-
return this.items.value.map((
|
|
1999
|
-
const
|
|
2000
|
-
return e(
|
|
2000
|
+
return this.items.value.map((t, i) => {
|
|
2001
|
+
const r = t.getProxy();
|
|
2002
|
+
return e(r, i);
|
|
2001
2003
|
});
|
|
2002
2004
|
}
|
|
2003
2005
|
// ============================================================================
|
|
@@ -2009,8 +2011,8 @@ class W extends M {
|
|
|
2009
2011
|
*/
|
|
2010
2012
|
createItem(e) {
|
|
2011
2013
|
if (this.isGroupSchema(this.itemSchema)) {
|
|
2012
|
-
const
|
|
2013
|
-
return e &&
|
|
2014
|
+
const t = new _(this.itemSchema);
|
|
2015
|
+
return e && t.patchValue(e), t;
|
|
2014
2016
|
}
|
|
2015
2017
|
throw new Error(
|
|
2016
2018
|
"ArrayNode поддерживает только GroupNode элементы. Для массива примитивов используйте обычное поле с типом массива."
|
|
@@ -2087,7 +2089,7 @@ class W extends M {
|
|
|
2087
2089
|
});
|
|
2088
2090
|
}
|
|
2089
2091
|
}
|
|
2090
|
-
class
|
|
2092
|
+
class Ae {
|
|
2091
2093
|
/**
|
|
2092
2094
|
* Создает узел формы на основе конфигурации
|
|
2093
2095
|
*
|
|
@@ -2138,14 +2140,14 @@ class pe {
|
|
|
2138
2140
|
if (Array.isArray(e) && e.length >= 1)
|
|
2139
2141
|
return this.createArrayNodeFromArray(e);
|
|
2140
2142
|
if (this.isFieldConfig(e))
|
|
2141
|
-
return new
|
|
2143
|
+
return new be(e);
|
|
2142
2144
|
if (this.isArrayConfig(e))
|
|
2143
|
-
return new
|
|
2145
|
+
return new q(
|
|
2144
2146
|
e.schema,
|
|
2145
2147
|
e.initialItems
|
|
2146
2148
|
);
|
|
2147
2149
|
if (this.isGroupConfig(e))
|
|
2148
|
-
return new
|
|
2150
|
+
return new _(e);
|
|
2149
2151
|
throw new Error(
|
|
2150
2152
|
`NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(
|
|
2151
2153
|
e
|
|
@@ -2179,11 +2181,11 @@ class pe {
|
|
|
2179
2181
|
*/
|
|
2180
2182
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2181
2183
|
createArrayNodeFromArray(e) {
|
|
2182
|
-
const [
|
|
2183
|
-
this.isGroupConfig(
|
|
2184
|
-
for (const n of
|
|
2185
|
-
this.isGroupConfig(n) ?
|
|
2186
|
-
return new
|
|
2184
|
+
const [t, ...i] = e, r = [];
|
|
2185
|
+
this.isGroupConfig(t) && r.push(this.extractValues(t));
|
|
2186
|
+
for (const n of i)
|
|
2187
|
+
this.isGroupConfig(n) ? r.push(this.extractValues(n)) : r.push(n);
|
|
2188
|
+
return new q(t, r);
|
|
2187
2189
|
}
|
|
2188
2190
|
/**
|
|
2189
2191
|
* Извлечь значения из схемы (рекурсивно)
|
|
@@ -2218,12 +2220,12 @@ class pe {
|
|
|
2218
2220
|
if (this.isFieldConfig(e))
|
|
2219
2221
|
return e.value;
|
|
2220
2222
|
if (Array.isArray(e))
|
|
2221
|
-
return e.map((
|
|
2223
|
+
return e.map((t) => this.extractValues(t));
|
|
2222
2224
|
if (this.isGroupConfig(e)) {
|
|
2223
|
-
const
|
|
2224
|
-
for (const [
|
|
2225
|
-
|
|
2226
|
-
return
|
|
2225
|
+
const t = {};
|
|
2226
|
+
for (const [i, r] of Object.entries(e))
|
|
2227
|
+
t[i] = this.extractValues(r);
|
|
2228
|
+
return t;
|
|
2227
2229
|
}
|
|
2228
2230
|
return e;
|
|
2229
2231
|
}
|
|
@@ -2302,43 +2304,43 @@ class pe {
|
|
|
2302
2304
|
return e != null && typeof e == "object" && !this.isFieldConfig(e) && !this.isArrayConfig(e);
|
|
2303
2305
|
}
|
|
2304
2306
|
}
|
|
2305
|
-
class
|
|
2307
|
+
class Ve extends x {
|
|
2306
2308
|
/**
|
|
2307
2309
|
* @param control Реактивный массив модели (`model.<path>`).
|
|
2308
2310
|
* @param buildItem Строитель формы элемента по его под-модели (инъекция, чтобы избежать цикла
|
|
2309
|
-
* импорта с `create-form`). Обычно `(item) =>
|
|
2310
|
-
*/
|
|
2311
|
-
constructor(e,
|
|
2312
|
-
super(), this.control = e, this.buildItem =
|
|
2313
|
-
const
|
|
2314
|
-
for (let
|
|
2315
|
-
const
|
|
2316
|
-
if (!
|
|
2317
|
-
let o = this.cache.get(
|
|
2318
|
-
o || (o =
|
|
2311
|
+
* импорта с `create-form`). Обычно `(item) => createFormFromModel({ model: item, schema: itemSchema(item) })`.
|
|
2312
|
+
*/
|
|
2313
|
+
constructor(e, t) {
|
|
2314
|
+
super(), this.control = e, this.buildItem = t, this.initial = e.toArray(), this.disposeSync = g(() => {
|
|
2315
|
+
const r = e.length, n = [], a = [];
|
|
2316
|
+
for (let l = 0; l < r; l++) {
|
|
2317
|
+
const c = e.at(l);
|
|
2318
|
+
if (!c) continue;
|
|
2319
|
+
let o = this.cache.get(c);
|
|
2320
|
+
o || (o = t(c), this.cache.set(c, o)), n.push(c), a.push(o);
|
|
2319
2321
|
}
|
|
2320
|
-
const
|
|
2321
|
-
for (const
|
|
2322
|
-
if (
|
|
2323
|
-
const
|
|
2324
|
-
this.cache.delete(
|
|
2322
|
+
const u = new Set(n), d = [];
|
|
2323
|
+
for (const l of this.mountedModels) {
|
|
2324
|
+
if (u.has(l)) continue;
|
|
2325
|
+
const c = this.cache.get(l);
|
|
2326
|
+
this.cache.delete(l), c && d.push(c);
|
|
2325
2327
|
}
|
|
2326
|
-
this.mountedModels = n, this.itemNodes.value = a, d.forEach((
|
|
2327
|
-
}), this.length =
|
|
2328
|
-
const
|
|
2328
|
+
this.mountedModels = n, this.itemNodes.value = a, d.forEach((l) => this.disposeItemNode(l));
|
|
2329
|
+
}), this.length = h(() => this.itemNodes.value.length), this.value = h(() => this.itemNodes.value.map((r) => r.value.value));
|
|
2330
|
+
const i = R({
|
|
2329
2331
|
getChildren: () => this.itemNodes.value,
|
|
2330
2332
|
ownErrors: this._arrayErrors
|
|
2331
2333
|
});
|
|
2332
|
-
this.valid =
|
|
2334
|
+
this.valid = i.valid, this.invalid = i.invalid, this.pending = i.pending, this.touched = i.touched, this.dirty = i.dirty, this.errors = i.errors, this.status = i.status;
|
|
2333
2335
|
}
|
|
2334
|
-
itemNodes =
|
|
2336
|
+
itemNodes = m([]);
|
|
2335
2337
|
// Кэш per-item формы по идентичности фасада под-модели (фасады кэшируются в core).
|
|
2336
2338
|
cache = /* @__PURE__ */ new WeakMap();
|
|
2337
2339
|
// Фасады под-моделей, для которых сейчас смонтированы формы — «предыдущий» набор для
|
|
2338
2340
|
// реконсиляции в disposeSync. Выпавшие из массива элементы диспозятся и вытесняются из кэша.
|
|
2339
2341
|
mountedModels = [];
|
|
2340
2342
|
initial;
|
|
2341
|
-
_arrayErrors =
|
|
2343
|
+
_arrayErrors = m([]);
|
|
2342
2344
|
disposeSync;
|
|
2343
2345
|
/**
|
|
2344
2346
|
* Сигнал per-item форм. Публичен в т.ч. чтобы `isArrayNode` распознавал узел как массив
|
|
@@ -2361,17 +2363,22 @@ class ye extends M {
|
|
|
2361
2363
|
return this.itemNodes.value[e];
|
|
2362
2364
|
}
|
|
2363
2365
|
map(e) {
|
|
2364
|
-
return this.itemNodes.value.map((
|
|
2366
|
+
return this.itemNodes.value.map((t, i) => e(t, i));
|
|
2365
2367
|
}
|
|
2366
2368
|
forEach(e) {
|
|
2367
|
-
this.itemNodes.value.forEach((
|
|
2369
|
+
this.itemNodes.value.forEach((t, i) => e(t, i));
|
|
2368
2370
|
}
|
|
2369
2371
|
// ── Мутации (делегируют массиву модели; effect пересоберёт itemNodes) ──────
|
|
2372
|
+
/**
|
|
2373
|
+
* Добавить элемент. Без значения — элемент по шаблону массива модели (`arrayOf(blank)` либо
|
|
2374
|
+
* `initialValue` узла-массива схемы); шаблона нет — ошибка модели.
|
|
2375
|
+
*/
|
|
2370
2376
|
push(e) {
|
|
2371
|
-
this.control.push(e
|
|
2377
|
+
this.control.push(e);
|
|
2372
2378
|
}
|
|
2373
|
-
|
|
2374
|
-
|
|
2379
|
+
/** Вставить элемент по индексу; без значения — по шаблону, как у {@link push}. */
|
|
2380
|
+
insert(e, t) {
|
|
2381
|
+
this.control.insertAt(e, t);
|
|
2375
2382
|
}
|
|
2376
2383
|
removeAt(e) {
|
|
2377
2384
|
this.control.removeAt(e);
|
|
@@ -2380,12 +2387,12 @@ class ye extends M {
|
|
|
2380
2387
|
* Переместить элемент модель-массива. Делегирует мутацию массиву модели; внутренний `effect`
|
|
2381
2388
|
* пересоберёт `itemNodes` в новом порядке (per-item формы сохраняются по кешу идентичности).
|
|
2382
2389
|
*/
|
|
2383
|
-
move(e,
|
|
2384
|
-
this.control.move(e,
|
|
2390
|
+
move(e, t) {
|
|
2391
|
+
this.control.move(e, t);
|
|
2385
2392
|
}
|
|
2386
2393
|
/** Поменять местами два элемента модель-массива (см. {@link move}). */
|
|
2387
|
-
swap(e,
|
|
2388
|
-
this.control.swap(e,
|
|
2394
|
+
swap(e, t) {
|
|
2395
|
+
this.control.swap(e, t);
|
|
2389
2396
|
}
|
|
2390
2397
|
clear() {
|
|
2391
2398
|
this.control.clear();
|
|
@@ -2395,7 +2402,7 @@ class ye extends M {
|
|
|
2395
2402
|
return this.control.toArray();
|
|
2396
2403
|
}
|
|
2397
2404
|
setValue(e) {
|
|
2398
|
-
this.control.clear(), (e ?? []).forEach((
|
|
2405
|
+
this.control.clear(), (e ?? []).forEach((t) => this.control.push(t));
|
|
2399
2406
|
}
|
|
2400
2407
|
patchValue(e) {
|
|
2401
2408
|
this.setValue(e);
|
|
@@ -2409,7 +2416,7 @@ class ye extends M {
|
|
|
2409
2416
|
async validate() {
|
|
2410
2417
|
return (await Promise.all(
|
|
2411
2418
|
this.itemNodes.value.map(
|
|
2412
|
-
(
|
|
2419
|
+
(t) => t.validate()
|
|
2413
2420
|
)
|
|
2414
2421
|
)).every(Boolean) && this._arrayErrors.value.length === 0;
|
|
2415
2422
|
}
|
|
@@ -2464,280 +2471,251 @@ class ye extends M {
|
|
|
2464
2471
|
this.disposeSync(), this.itemNodes.value.forEach((e) => this.disposeItemNode(e)), this.mountedModels = [];
|
|
2465
2472
|
}
|
|
2466
2473
|
}
|
|
2467
|
-
const
|
|
2468
|
-
function
|
|
2469
|
-
|
|
2470
|
-
|
|
2474
|
+
const K = /* @__PURE__ */ new WeakMap();
|
|
2475
|
+
function X(s, e) {
|
|
2476
|
+
let t = K.get(e);
|
|
2477
|
+
return t || (t = /* @__PURE__ */ new Map(), K.set(e, t)), t.has(s) || t.set(s, s(e)), t.get(s);
|
|
2478
|
+
}
|
|
2479
|
+
function M(s, e, t, i) {
|
|
2480
|
+
if (s == null || typeof s != "object" || D(s) || j(s) || W(s) || s.$$typeof !== void 0 || i.has(s)) return;
|
|
2481
|
+
if (i.add(s), typeof s.getProxy == "function") {
|
|
2471
2482
|
process.env.NODE_ENV !== "production" && console.warn(
|
|
2472
2483
|
"[reformer] createForm({ schema }): в схему попал узел формы (FormProxy) — он пропущен. Стройте дерево для createForm БЕЗ формы, а форму донесите до узла вторым проходом (билдер `(model, form?) => …`) либо через render-behavior `patchProps({ form })`."
|
|
2473
2484
|
);
|
|
2474
2485
|
return;
|
|
2475
2486
|
}
|
|
2476
|
-
if (Array.isArray(
|
|
2477
|
-
for (const
|
|
2487
|
+
if (Array.isArray(s)) {
|
|
2488
|
+
for (const a of s) M(a, e, t, i);
|
|
2478
2489
|
return;
|
|
2479
2490
|
}
|
|
2480
|
-
const r =
|
|
2481
|
-
if (
|
|
2482
|
-
|
|
2483
|
-
|
|
2491
|
+
const r = s;
|
|
2492
|
+
if (typeof r.item == "function") {
|
|
2493
|
+
const a = L(r.model) ?? L(r.array);
|
|
2494
|
+
if (a) {
|
|
2495
|
+
t.set(a, r.item), r.initialValue !== void 0 && se(a, r.initialValue);
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
if (r.array != null) {
|
|
2499
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
2500
|
+
"[reformer] createForm({ schema }): у узла-массива `array` — не массив модели, узел пропущен. Ожидается `model: model.$.<массив>`."
|
|
2501
|
+
);
|
|
2502
|
+
return;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
if (typeof r.part == "function") {
|
|
2506
|
+
const a = re(r.model);
|
|
2507
|
+
if (a) {
|
|
2508
|
+
const u = Y(a), d = X(r.part, u);
|
|
2509
|
+
M(d, e, t, i);
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2484
2512
|
}
|
|
2485
|
-
r.
|
|
2513
|
+
const n = D(r.model) ? r.model : r.value;
|
|
2514
|
+
D(n) ? e.set(n, {
|
|
2486
2515
|
component: r.component,
|
|
2487
2516
|
componentProps: r.componentProps,
|
|
2488
2517
|
updateOn: r.updateOn,
|
|
2489
2518
|
disabled: r.disabled,
|
|
2490
2519
|
debounce: r.debounce
|
|
2491
|
-
}) : process.env.NODE_ENV !== "production" && r.component !== void 0 && ("valueSignal" in r || r.value != null) && console.warn(
|
|
2492
|
-
"[reformer] createForm({ schema }): узел с `component` не распознан как поле —
|
|
2520
|
+
}) : process.env.NODE_ENV !== "production" && r.component !== void 0 && ("valueSignal" in r || r.value != null || W(r.model) || j(r.model)) && console.warn(
|
|
2521
|
+
"[reformer] createForm({ schema }): узел с `component` не распознан как поле — привязка не является сигналом модели. Ожидается `model: model.$.<path>` (лист или массив); проверьте, что не передан `model: model.<path>` (value-прокси), группа без `part` или `valueSignal:`."
|
|
2493
2522
|
);
|
|
2494
|
-
for (const
|
|
2495
|
-
n !== "value" && I(a, e, s);
|
|
2523
|
+
for (const a of Object.values(r)) M(a, e, t, i);
|
|
2496
2524
|
}
|
|
2497
|
-
function
|
|
2498
|
-
const
|
|
2499
|
-
for (const
|
|
2500
|
-
const
|
|
2501
|
-
if (
|
|
2525
|
+
function Z(s, e, t, i, r) {
|
|
2526
|
+
const n = {};
|
|
2527
|
+
for (const a of Object.keys(s)) {
|
|
2528
|
+
const u = e === "" ? a : `${e}.${a}`, d = s[a];
|
|
2529
|
+
if (ie(d)) {
|
|
2530
|
+
const l = i.get(d);
|
|
2531
|
+
if (l) {
|
|
2532
|
+
r.arrays.push({ path: u, handle: d, item: l });
|
|
2533
|
+
continue;
|
|
2534
|
+
}
|
|
2535
|
+
const c = t.get(d);
|
|
2536
|
+
if (c !== void 0) {
|
|
2537
|
+
const o = d;
|
|
2538
|
+
n[a] = { ...c, valueSignal: o }, r.fields.push({ path: u, signal: o });
|
|
2539
|
+
}
|
|
2502
2540
|
continue;
|
|
2503
|
-
|
|
2504
|
-
|
|
2541
|
+
}
|
|
2542
|
+
if (d instanceof ae) {
|
|
2543
|
+
n[a] = { ...t.get(d) ?? {}, valueSignal: d }, r.fields.push({ path: u, signal: d });
|
|
2505
2544
|
continue;
|
|
2506
2545
|
}
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2546
|
+
r.groups.push({ path: u, handle: d }), n[a] = Z(
|
|
2547
|
+
d,
|
|
2548
|
+
u,
|
|
2549
|
+
t,
|
|
2550
|
+
i,
|
|
2551
|
+
r
|
|
2552
|
+
);
|
|
2511
2553
|
}
|
|
2512
|
-
return
|
|
2554
|
+
return n;
|
|
2513
2555
|
}
|
|
2514
|
-
function
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2556
|
+
function z(s, e) {
|
|
2557
|
+
const t = e.lastIndexOf(".");
|
|
2558
|
+
if (t === -1) return s;
|
|
2559
|
+
const i = s.getFieldByPath(e.slice(0, t));
|
|
2560
|
+
return i instanceof _ ? i : void 0;
|
|
2519
2561
|
}
|
|
2520
|
-
function ee(
|
|
2521
|
-
const { model: e, schema:
|
|
2522
|
-
|
|
2523
|
-
const a =
|
|
2524
|
-
for (const
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
return r && l.attachBehaviorCleanup(r.__run(e, u)), u;
|
|
2562
|
+
function ee(s) {
|
|
2563
|
+
const { model: e, schema: t, behavior: i } = s, r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
2564
|
+
t !== void 0 && M(t, r, n, /* @__PURE__ */ new WeakSet());
|
|
2565
|
+
const a = e.$, u = { fields: [], groups: [], arrays: [] }, d = Z(a, "", r, n, u), l = new _(d);
|
|
2566
|
+
for (const { path: o, handle: f, item: v } of u.arrays) {
|
|
2567
|
+
const p = z(l, o);
|
|
2568
|
+
if (!p) continue;
|
|
2569
|
+
const F = (V) => ee({ model: V, schema: X(v, V) }), T = Y(f), A = new Ve(T, F);
|
|
2570
|
+
p.fields.set(o.slice(o.lastIndexOf(".") + 1), A), N(f, A);
|
|
2571
|
+
}
|
|
2572
|
+
const c = l.getProxy();
|
|
2573
|
+
N(e.$, l);
|
|
2574
|
+
for (const { path: o, handle: f } of u.groups) {
|
|
2575
|
+
const v = l.getFieldByPath(o);
|
|
2576
|
+
v && N(f, v);
|
|
2577
|
+
}
|
|
2578
|
+
for (const { path: o, signal: f } of u.fields) {
|
|
2579
|
+
const v = l.getFieldByPath(o);
|
|
2580
|
+
v && (N(f, v), z(l, o)?.registerFieldSignal(v, f));
|
|
2581
|
+
}
|
|
2582
|
+
return i && l.attachBehaviorCleanup(i.__run(e, c, s.schemaController)), c;
|
|
2542
2583
|
}
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
return ge(t) ? ee(t) : new w(t).getProxy();
|
|
2584
|
+
function Je(s) {
|
|
2585
|
+
return new _(s).getProxy();
|
|
2546
2586
|
}
|
|
2547
|
-
const
|
|
2587
|
+
const ke = () => {
|
|
2548
2588
|
};
|
|
2549
|
-
function
|
|
2589
|
+
function Se(s, e) {
|
|
2550
2590
|
if (!e) return;
|
|
2551
|
-
const
|
|
2552
|
-
() =>
|
|
2591
|
+
const t = typeof e == "function" ? { schema: e } : e, i = Object.keys(t.steps ?? {}), r = i.map((o) => t.steps?.[o]).filter((o) => o != null), n = t.schema ?? ue(
|
|
2592
|
+
() => ce(...r, ...t.extras ? [t.extras] : [])
|
|
2553
2593
|
), a = (o) => {
|
|
2554
|
-
const f = typeof o == "number" ?
|
|
2555
|
-
return (f != null ?
|
|
2556
|
-
}, { strategy:
|
|
2557
|
-
strategy:
|
|
2594
|
+
const f = typeof o == "number" ? i[o - 1] : o;
|
|
2595
|
+
return (f != null ? t.steps?.[f] : null) ?? null;
|
|
2596
|
+
}, { strategy: u, debounce: d, liveAfterSubmit: l } = t, c = I(s, n, {
|
|
2597
|
+
strategy: u,
|
|
2558
2598
|
debounce: d,
|
|
2559
|
-
liveAfterSubmit:
|
|
2599
|
+
liveAfterSubmit: l
|
|
2560
2600
|
});
|
|
2561
2601
|
return {
|
|
2562
2602
|
schema: n,
|
|
2563
|
-
stepSelectors:
|
|
2564
|
-
validate: () =>
|
|
2565
|
-
validateAll: () =>
|
|
2566
|
-
validateStep: (o) =>
|
|
2603
|
+
stepSelectors: i,
|
|
2604
|
+
validate: () => c.validate(),
|
|
2605
|
+
validateAll: () => c.validate(),
|
|
2606
|
+
validateStep: (o) => de(s, a(o) ?? ke, { touch: !0 }),
|
|
2567
2607
|
createStepController: (o) => {
|
|
2568
|
-
if (!
|
|
2608
|
+
if (!u || u === "submit") return null;
|
|
2569
2609
|
const f = a(o);
|
|
2570
|
-
return f ?
|
|
2610
|
+
return f ? I(s, f, { strategy: u, debounce: d, liveAfterSubmit: l }) : null;
|
|
2571
2611
|
},
|
|
2572
|
-
controller:
|
|
2573
|
-
validating:
|
|
2612
|
+
controller: c,
|
|
2613
|
+
validating: c.validating
|
|
2574
2614
|
};
|
|
2575
2615
|
}
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
t
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2616
|
+
const C = "[@reformer/core] createForm";
|
|
2617
|
+
function Fe(s, e) {
|
|
2618
|
+
const { schema: t, registry: i } = s;
|
|
2619
|
+
if (t == null) return {};
|
|
2620
|
+
if (typeof t == "function")
|
|
2621
|
+
return { tree: t(e) };
|
|
2622
|
+
if (i == null)
|
|
2623
|
+
throw new Error(
|
|
2624
|
+
`${C}: \`schema\` — готовое дерево, а не билдер \`(model) => узел\`. Передайте билдер; документу схемы (JSON) нужен \`registry\`. Форму из модели и готового дерева без сборки собирает \`createFormFromModel({ model, schema })\`.`
|
|
2625
|
+
);
|
|
2626
|
+
if (typeof i.resolveSchema != "function")
|
|
2627
|
+
throw new Error(
|
|
2628
|
+
`${C}: \`registry\` не умеет собирать дерево из документа схемы — у него нет метода \`resolveSchema\`. Возьмите реестр \`@reformer/renderer-json\` (\`createComponentRegistry\`).`
|
|
2629
|
+
);
|
|
2630
|
+
return i.resolveSchema(t, e);
|
|
2590
2631
|
}
|
|
2591
|
-
function
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2632
|
+
function Ne(s) {
|
|
2633
|
+
if (typeof s?.model?.signalAt != "function" && s?.initial === void 0)
|
|
2634
|
+
throw new Error(
|
|
2635
|
+
`${C}: нужна модель — \`model\` либо \`initial\`. Форму без модели — из плоской схемы полей (\`{ email: { value: '', component } }\`) или конфига группы — собирает \`createLegacyForm(...)\`.`
|
|
2636
|
+
);
|
|
2637
|
+
const t = s.model ?? te(s.initial);
|
|
2638
|
+
s.seed?.(t);
|
|
2639
|
+
const { tree: i, fieldWrapper: r, errorBoundary: n } = Fe(s, t), a = oe(), u = a.scopeOf(t), d = ee({
|
|
2640
|
+
model: t,
|
|
2641
|
+
...i !== void 0 ? { schema: i } : {},
|
|
2642
|
+
...s.behavior ? { behavior: s.behavior, schemaController: a } : {}
|
|
2643
|
+
});
|
|
2644
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2645
|
+
const o = le(u.__overrideMaps, i);
|
|
2646
|
+
o.length > 0 && console.warn(
|
|
2647
|
+
`${C}: поведение обращается к узлам схемы, которых нет в корневом дереве: ${o.map((f) => `"${f}"`).join(", ")}. Правило ничего не сделает. Узлы строки массива и подформы адресуются из их поведения — через \`applyEach\` / \`apply\`.`
|
|
2648
|
+
);
|
|
2649
|
+
}
|
|
2650
|
+
const l = Se(t, s.validation), c = {
|
|
2651
|
+
model: t,
|
|
2652
|
+
form: d,
|
|
2653
|
+
...l ? { validation: l } : {},
|
|
2654
|
+
render: {
|
|
2655
|
+
tree: i,
|
|
2656
|
+
controller: a,
|
|
2657
|
+
node: (o) => u.node(o),
|
|
2658
|
+
...r !== void 0 ? { fieldWrapper: r } : {},
|
|
2659
|
+
...n !== void 0 ? { errorBoundary: n } : {}
|
|
2660
|
+
}
|
|
2661
|
+
};
|
|
2662
|
+
return s.setup?.(c), c;
|
|
2596
2663
|
}
|
|
2597
|
-
function
|
|
2598
|
-
return
|
|
2599
|
-
!("items" in t) && !("push" in t) && !("removeAt" in t);
|
|
2664
|
+
function Ye(s) {
|
|
2665
|
+
return Ne(s);
|
|
2600
2666
|
}
|
|
2601
|
-
function
|
|
2602
|
-
return
|
|
2603
|
-
typeof t.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2604
|
-
typeof t.removeAt == "function";
|
|
2667
|
+
function O(s) {
|
|
2668
|
+
return s == null ? !1 : typeof s == "object" && "value" in s && "setValue" in s && "getValue" in s && "validate" in s;
|
|
2605
2669
|
}
|
|
2606
|
-
function
|
|
2607
|
-
return
|
|
2670
|
+
function Me(s) {
|
|
2671
|
+
return O(s) && "validators" in s && "asyncValidators" in s && // FieldNode имеет markAsTouched метод
|
|
2672
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2673
|
+
typeof s.markAsTouched == "function" && // У FieldNode нет fields или items
|
|
2674
|
+
!("fields" in s) && !("items" in s);
|
|
2608
2675
|
}
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
if (q) return P;
|
|
2613
|
-
q = 1;
|
|
2614
|
-
var t = Y;
|
|
2615
|
-
function e(o, f) {
|
|
2616
|
-
return o === f && (o !== 0 || 1 / o === 1 / f) || o !== o && f !== f;
|
|
2617
|
-
}
|
|
2618
|
-
var s = typeof Object.is == "function" ? Object.is : e, r = t.useState, i = t.useEffect, n = t.useLayoutEffect, a = t.useDebugValue;
|
|
2619
|
-
function l(o, f) {
|
|
2620
|
-
var c = f(), v = r({ inst: { value: c, getSnapshot: f } }), p = v[0].inst, b = v[1];
|
|
2621
|
-
return n(
|
|
2622
|
-
function() {
|
|
2623
|
-
p.value = c, p.getSnapshot = f, d(p) && b({ inst: p });
|
|
2624
|
-
},
|
|
2625
|
-
[o, c, f]
|
|
2626
|
-
), i(
|
|
2627
|
-
function() {
|
|
2628
|
-
return d(p) && b({ inst: p }), o(function() {
|
|
2629
|
-
d(p) && b({ inst: p });
|
|
2630
|
-
});
|
|
2631
|
-
},
|
|
2632
|
-
[o]
|
|
2633
|
-
), a(c), c;
|
|
2634
|
-
}
|
|
2635
|
-
function d(o) {
|
|
2636
|
-
var f = o.getSnapshot;
|
|
2637
|
-
o = o.value;
|
|
2638
|
-
try {
|
|
2639
|
-
var c = f();
|
|
2640
|
-
return !s(o, c);
|
|
2641
|
-
} catch {
|
|
2642
|
-
return !0;
|
|
2643
|
-
}
|
|
2644
|
-
}
|
|
2645
|
-
function u(o, f) {
|
|
2646
|
-
return f();
|
|
2647
|
-
}
|
|
2648
|
-
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : l;
|
|
2649
|
-
return P.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : h, P;
|
|
2676
|
+
function Ce(s) {
|
|
2677
|
+
return O(s) && "getFieldByPath" in s && "fields" in s && // GroupNode НЕ имеет items/push/removeAt (это ArrayNode/ModelArrayNode)
|
|
2678
|
+
!("items" in s) && !("push" in s) && !("removeAt" in s);
|
|
2650
2679
|
}
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
function
|
|
2654
|
-
|
|
2655
|
-
function t(c, v) {
|
|
2656
|
-
return c === v && (c !== 0 || 1 / c === 1 / v) || c !== c && v !== v;
|
|
2657
|
-
}
|
|
2658
|
-
function e(c, v) {
|
|
2659
|
-
h || i.startTransition === void 0 || (h = !0, console.error(
|
|
2660
|
-
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
2661
|
-
));
|
|
2662
|
-
var p = v();
|
|
2663
|
-
if (!o) {
|
|
2664
|
-
var b = v();
|
|
2665
|
-
n(p, b) || (console.error(
|
|
2666
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
2667
|
-
), o = !0);
|
|
2668
|
-
}
|
|
2669
|
-
b = a({
|
|
2670
|
-
inst: { value: p, getSnapshot: v }
|
|
2671
|
-
});
|
|
2672
|
-
var y = b[0].inst, V = b[1];
|
|
2673
|
-
return d(
|
|
2674
|
-
function() {
|
|
2675
|
-
y.value = p, y.getSnapshot = v, s(y) && V({ inst: y });
|
|
2676
|
-
},
|
|
2677
|
-
[c, p, v]
|
|
2678
|
-
), l(
|
|
2679
|
-
function() {
|
|
2680
|
-
return s(y) && V({ inst: y }), c(function() {
|
|
2681
|
-
s(y) && V({ inst: y });
|
|
2682
|
-
});
|
|
2683
|
-
},
|
|
2684
|
-
[c]
|
|
2685
|
-
), u(p), p;
|
|
2686
|
-
}
|
|
2687
|
-
function s(c) {
|
|
2688
|
-
var v = c.getSnapshot;
|
|
2689
|
-
c = c.value;
|
|
2690
|
-
try {
|
|
2691
|
-
var p = v();
|
|
2692
|
-
return !n(c, p);
|
|
2693
|
-
} catch {
|
|
2694
|
-
return !0;
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
function r(c, v) {
|
|
2698
|
-
return v();
|
|
2699
|
-
}
|
|
2700
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
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
|
-
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
|
-
})()), T;
|
|
2680
|
+
function Pe(s) {
|
|
2681
|
+
return O(s) && "items" in s && "length" in s && "push" in s && "removeAt" in s && "at" in s && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2682
|
+
typeof s.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2683
|
+
typeof s.removeAt == "function";
|
|
2704
2684
|
}
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
return K || (K = 1, process.env.NODE_ENV === "production" ? N.exports = Ve() : N.exports = ke()), N.exports;
|
|
2685
|
+
function Qe(s) {
|
|
2686
|
+
return Me(s) ? "FieldNode" : Ce(s) ? "GroupNode" : Pe(s) ? "ArrayNode" : O(s) ? "FormNode" : "Unknown";
|
|
2708
2687
|
}
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
if (
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
if (t[s] !== e[s]) return !1;
|
|
2688
|
+
function xe(s, e) {
|
|
2689
|
+
if (s === e) return !0;
|
|
2690
|
+
if (s.length !== e.length) return !1;
|
|
2691
|
+
for (let t = 0; t < s.length; t++)
|
|
2692
|
+
if (s[t] !== e[t]) return !1;
|
|
2715
2693
|
return !0;
|
|
2716
2694
|
}
|
|
2717
|
-
function
|
|
2718
|
-
const
|
|
2719
|
-
n.current =
|
|
2720
|
-
const a =
|
|
2695
|
+
function B(s, e, t, i) {
|
|
2696
|
+
const r = E(null), n = E(s);
|
|
2697
|
+
n.current = s;
|
|
2698
|
+
const a = E(e);
|
|
2721
2699
|
a.current = e;
|
|
2722
|
-
const
|
|
2723
|
-
if (
|
|
2724
|
-
const
|
|
2725
|
-
for (const o in
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
}
|
|
2729
|
-
const d =
|
|
2730
|
-
(
|
|
2700
|
+
const u = E(t);
|
|
2701
|
+
if (u.current = t, r.current === null) {
|
|
2702
|
+
const c = {};
|
|
2703
|
+
for (const o in s)
|
|
2704
|
+
c[o] = s[o].value;
|
|
2705
|
+
r.current = { ...c, __snapshot: null };
|
|
2706
|
+
}
|
|
2707
|
+
const d = y(
|
|
2708
|
+
(c) => {
|
|
2731
2709
|
let o = !0;
|
|
2732
|
-
return
|
|
2733
|
-
const
|
|
2734
|
-
for (const
|
|
2735
|
-
|
|
2710
|
+
return g(() => {
|
|
2711
|
+
const v = n.current;
|
|
2712
|
+
for (const p in v)
|
|
2713
|
+
v[p].value;
|
|
2736
2714
|
if (o) {
|
|
2737
2715
|
o = !1;
|
|
2738
2716
|
return;
|
|
2739
2717
|
}
|
|
2740
|
-
|
|
2718
|
+
c();
|
|
2741
2719
|
});
|
|
2742
2720
|
},
|
|
2743
2721
|
// subscriptionKey намеренно не читается в теле — он здесь КЛЮЧ ИДЕНТИЧНОСТИ подписки (см. JSDoc
|
|
@@ -2745,45 +2723,45 @@ function $(t, e, s, r) {
|
|
|
2745
2723
|
// навсегда: подмена контрола на другой узел перестанет пересоздавать effect. Тот же приём ниже
|
|
2746
2724
|
// у getSnapshot.
|
|
2747
2725
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2748
|
-
[
|
|
2749
|
-
),
|
|
2750
|
-
const
|
|
2751
|
-
for (const
|
|
2752
|
-
f[
|
|
2753
|
-
let
|
|
2754
|
-
for (const
|
|
2755
|
-
const { key:
|
|
2756
|
-
if (
|
|
2757
|
-
if (!
|
|
2758
|
-
|
|
2726
|
+
[i]
|
|
2727
|
+
), l = y(() => {
|
|
2728
|
+
const c = r.current, o = n.current, f = {};
|
|
2729
|
+
for (const p in o)
|
|
2730
|
+
f[p] = o[p].value;
|
|
2731
|
+
let v = !1;
|
|
2732
|
+
for (const p of a.current) {
|
|
2733
|
+
const { key: F, useShallowArrayEqual: T } = p, A = f[F], V = c[F];
|
|
2734
|
+
if (T) {
|
|
2735
|
+
if (!xe(V, A)) {
|
|
2736
|
+
v = !0;
|
|
2759
2737
|
break;
|
|
2760
2738
|
}
|
|
2761
|
-
} else if (V !==
|
|
2762
|
-
|
|
2739
|
+
} else if (V !== A) {
|
|
2740
|
+
v = !0;
|
|
2763
2741
|
break;
|
|
2764
2742
|
}
|
|
2765
2743
|
}
|
|
2766
|
-
if (!
|
|
2767
|
-
return
|
|
2768
|
-
for (const
|
|
2769
|
-
|
|
2770
|
-
return
|
|
2771
|
-
}, [
|
|
2772
|
-
return
|
|
2744
|
+
if (!v && c.__snapshot)
|
|
2745
|
+
return c.__snapshot;
|
|
2746
|
+
for (const p in o)
|
|
2747
|
+
c[p] = f[p];
|
|
2748
|
+
return c.__snapshot = u.current(f), c.__snapshot;
|
|
2749
|
+
}, [i]);
|
|
2750
|
+
return P.useSyncExternalStore(d, l, l);
|
|
2773
2751
|
}
|
|
2774
|
-
function
|
|
2752
|
+
function Oe(s) {
|
|
2775
2753
|
const e = {
|
|
2776
|
-
value:
|
|
2777
|
-
disabled:
|
|
2778
|
-
errors:
|
|
2779
|
-
pending:
|
|
2780
|
-
valid:
|
|
2781
|
-
invalid:
|
|
2782
|
-
touched:
|
|
2783
|
-
dirty:
|
|
2784
|
-
shouldShowError:
|
|
2785
|
-
componentProps:
|
|
2786
|
-
},
|
|
2754
|
+
value: s.value,
|
|
2755
|
+
disabled: s.disabled,
|
|
2756
|
+
errors: s.errors,
|
|
2757
|
+
pending: s.pending,
|
|
2758
|
+
valid: s.valid,
|
|
2759
|
+
invalid: s.invalid,
|
|
2760
|
+
touched: s.touched,
|
|
2761
|
+
dirty: s.dirty,
|
|
2762
|
+
shouldShowError: s.shouldShowError,
|
|
2763
|
+
componentProps: s.componentProps
|
|
2764
|
+
}, t = [
|
|
2787
2765
|
{ key: "value" },
|
|
2788
2766
|
{ key: "disabled" },
|
|
2789
2767
|
{ key: "errors", useShallowArrayEqual: !0 },
|
|
@@ -2794,35 +2772,35 @@ function Ne(t) {
|
|
|
2794
2772
|
{ key: "dirty" },
|
|
2795
2773
|
{ key: "shouldShowError" },
|
|
2796
2774
|
{ key: "componentProps" }
|
|
2797
|
-
],
|
|
2798
|
-
(
|
|
2799
|
-
value:
|
|
2800
|
-
pending:
|
|
2801
|
-
disabled:
|
|
2802
|
-
errors:
|
|
2803
|
-
valid:
|
|
2804
|
-
invalid:
|
|
2805
|
-
touched:
|
|
2806
|
-
dirty:
|
|
2807
|
-
shouldShowError:
|
|
2808
|
-
componentProps:
|
|
2775
|
+
], i = y(
|
|
2776
|
+
(r) => ({
|
|
2777
|
+
value: r.value,
|
|
2778
|
+
pending: r.pending,
|
|
2779
|
+
disabled: r.disabled,
|
|
2780
|
+
errors: r.errors,
|
|
2781
|
+
valid: r.valid,
|
|
2782
|
+
invalid: r.invalid,
|
|
2783
|
+
touched: r.touched,
|
|
2784
|
+
dirty: r.dirty,
|
|
2785
|
+
shouldShowError: r.shouldShowError,
|
|
2786
|
+
componentProps: r.componentProps
|
|
2809
2787
|
}),
|
|
2810
2788
|
[]
|
|
2811
2789
|
);
|
|
2812
|
-
return
|
|
2790
|
+
return B(e, t, i, s);
|
|
2813
2791
|
}
|
|
2814
|
-
function
|
|
2792
|
+
function Te(s) {
|
|
2815
2793
|
const e = {
|
|
2816
|
-
value:
|
|
2817
|
-
length:
|
|
2818
|
-
errors:
|
|
2819
|
-
pending:
|
|
2820
|
-
valid:
|
|
2821
|
-
invalid:
|
|
2822
|
-
touched:
|
|
2823
|
-
dirty:
|
|
2824
|
-
disabled:
|
|
2825
|
-
},
|
|
2794
|
+
value: s.value,
|
|
2795
|
+
length: s.length,
|
|
2796
|
+
errors: s.errors,
|
|
2797
|
+
pending: s.pending,
|
|
2798
|
+
valid: s.valid,
|
|
2799
|
+
invalid: s.invalid,
|
|
2800
|
+
touched: s.touched,
|
|
2801
|
+
dirty: s.dirty,
|
|
2802
|
+
disabled: s.disabled
|
|
2803
|
+
}, t = [
|
|
2826
2804
|
{ key: "value" },
|
|
2827
2805
|
{ key: "length" },
|
|
2828
2806
|
{ key: "errors", useShallowArrayEqual: !0 },
|
|
@@ -2832,24 +2810,24 @@ function Me(t) {
|
|
|
2832
2810
|
{ key: "touched" },
|
|
2833
2811
|
{ key: "dirty" },
|
|
2834
2812
|
{ key: "disabled" }
|
|
2835
|
-
],
|
|
2836
|
-
(
|
|
2837
|
-
value:
|
|
2838
|
-
length:
|
|
2839
|
-
pending:
|
|
2840
|
-
errors:
|
|
2841
|
-
valid:
|
|
2842
|
-
invalid:
|
|
2843
|
-
touched:
|
|
2844
|
-
dirty:
|
|
2845
|
-
disabled:
|
|
2813
|
+
], i = y(
|
|
2814
|
+
(r) => ({
|
|
2815
|
+
value: r.value,
|
|
2816
|
+
length: r.length,
|
|
2817
|
+
pending: r.pending,
|
|
2818
|
+
errors: r.errors,
|
|
2819
|
+
valid: r.valid,
|
|
2820
|
+
invalid: r.invalid,
|
|
2821
|
+
touched: r.touched,
|
|
2822
|
+
dirty: r.dirty,
|
|
2823
|
+
disabled: r.disabled
|
|
2846
2824
|
}),
|
|
2847
2825
|
[]
|
|
2848
2826
|
);
|
|
2849
|
-
return
|
|
2827
|
+
return B(e, t, i, s);
|
|
2850
2828
|
}
|
|
2851
|
-
function
|
|
2852
|
-
const
|
|
2829
|
+
function De() {
|
|
2830
|
+
const s = y(
|
|
2853
2831
|
() => ({
|
|
2854
2832
|
value: [],
|
|
2855
2833
|
length: 0,
|
|
@@ -2863,157 +2841,173 @@ function Ce() {
|
|
|
2863
2841
|
}),
|
|
2864
2842
|
[]
|
|
2865
2843
|
);
|
|
2866
|
-
return
|
|
2844
|
+
return B({}, [], s);
|
|
2867
2845
|
}
|
|
2868
|
-
function
|
|
2869
|
-
const e =
|
|
2870
|
-
return
|
|
2846
|
+
function Xe(s) {
|
|
2847
|
+
const e = s && "length" in s && "map" in s;
|
|
2848
|
+
return s ? e ? Te(s) : Oe(s) : De();
|
|
2871
2849
|
}
|
|
2872
|
-
function
|
|
2873
|
-
const e =
|
|
2874
|
-
(
|
|
2850
|
+
function Ze(s) {
|
|
2851
|
+
const e = E({ value: s.value.value }), t = y(
|
|
2852
|
+
(r) => {
|
|
2875
2853
|
let n = !0;
|
|
2876
|
-
return
|
|
2877
|
-
if (
|
|
2854
|
+
return g(() => {
|
|
2855
|
+
if (s.value.value, n) {
|
|
2878
2856
|
n = !1;
|
|
2879
2857
|
return;
|
|
2880
2858
|
}
|
|
2881
|
-
|
|
2859
|
+
r();
|
|
2882
2860
|
});
|
|
2883
2861
|
},
|
|
2884
|
-
[
|
|
2885
|
-
),
|
|
2886
|
-
const
|
|
2887
|
-
return e.current.value ===
|
|
2888
|
-
}, [
|
|
2889
|
-
return
|
|
2862
|
+
[s]
|
|
2863
|
+
), i = y(() => {
|
|
2864
|
+
const r = s.value.value;
|
|
2865
|
+
return e.current.value === r ? e.current.value : (e.current.value = r, r);
|
|
2866
|
+
}, [s]);
|
|
2867
|
+
return P.useSyncExternalStore(t, i, i);
|
|
2890
2868
|
}
|
|
2891
|
-
function
|
|
2892
|
-
const e =
|
|
2893
|
-
(
|
|
2869
|
+
function et(s) {
|
|
2870
|
+
const e = E({ length: s.length.value }), t = y(
|
|
2871
|
+
(r) => {
|
|
2894
2872
|
let n = !0;
|
|
2895
|
-
return
|
|
2896
|
-
if (
|
|
2873
|
+
return g(() => {
|
|
2874
|
+
if (s.length.value, n) {
|
|
2897
2875
|
n = !1;
|
|
2898
2876
|
return;
|
|
2899
2877
|
}
|
|
2900
|
-
|
|
2878
|
+
r();
|
|
2901
2879
|
});
|
|
2902
2880
|
},
|
|
2903
|
-
[
|
|
2904
|
-
),
|
|
2905
|
-
const
|
|
2906
|
-
return e.current.length ===
|
|
2907
|
-
}, [
|
|
2908
|
-
return
|
|
2881
|
+
[s]
|
|
2882
|
+
), i = y(() => {
|
|
2883
|
+
const r = s.length.value;
|
|
2884
|
+
return e.current.length === r ? e.current.length : (e.current.length = r, r);
|
|
2885
|
+
}, [s]);
|
|
2886
|
+
return P.useSyncExternalStore(t, i, i);
|
|
2909
2887
|
}
|
|
2910
|
-
function
|
|
2911
|
-
const { model: e, schema:
|
|
2912
|
-
() =>
|
|
2913
|
-
[e,
|
|
2888
|
+
function tt(s) {
|
|
2889
|
+
const { model: e, schema: t, strategy: i, debounce: r, liveAfterSubmit: n } = s, a = he(
|
|
2890
|
+
() => I(e, t, { strategy: i, debounce: r, liveAfterSubmit: n }),
|
|
2891
|
+
[e, t, i, r, n]
|
|
2914
2892
|
);
|
|
2915
|
-
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2893
|
+
Q(() => a.start(), [a]);
|
|
2894
|
+
const u = P.useSyncExternalStore(
|
|
2895
|
+
y((l) => a.validating.subscribe(l), [a]),
|
|
2918
2896
|
() => a.validating.peek(),
|
|
2919
2897
|
() => !1
|
|
2920
2898
|
// SSR: прогон не идёт
|
|
2921
|
-
), d =
|
|
2922
|
-
return { submit: d, validate: d, isValidating:
|
|
2899
|
+
), d = y(() => a.validate(), [a]);
|
|
2900
|
+
return { submit: d, validate: d, isValidating: u };
|
|
2901
|
+
}
|
|
2902
|
+
function st(s) {
|
|
2903
|
+
const [e] = fe(s), t = e.validation?.controller;
|
|
2904
|
+
return Q(() => t?.start(), [t]), e;
|
|
2923
2905
|
}
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
return
|
|
2906
|
+
const Ie = ve(null);
|
|
2907
|
+
function rt() {
|
|
2908
|
+
return me(Ie);
|
|
2927
2909
|
}
|
|
2928
|
-
const
|
|
2929
|
-
function
|
|
2930
|
-
if (!(
|
|
2931
|
-
return
|
|
2910
|
+
const $e = ["labelTooltip"];
|
|
2911
|
+
function it(s) {
|
|
2912
|
+
if (!(s == null || typeof s != "function" && typeof s != "object"))
|
|
2913
|
+
return s.reformerAdapter;
|
|
2932
2914
|
}
|
|
2933
|
-
const
|
|
2934
|
-
function
|
|
2935
|
-
const
|
|
2936
|
-
for (const n of
|
|
2937
|
-
for (const n of
|
|
2938
|
-
if (!
|
|
2939
|
-
return { ...
|
|
2940
|
-
const
|
|
2915
|
+
const J = (s) => s;
|
|
2916
|
+
function nt(s, e, t = {}) {
|
|
2917
|
+
const i = { ...t };
|
|
2918
|
+
for (const n of $e) delete i[n];
|
|
2919
|
+
for (const n of s?.strip ?? []) delete i[n];
|
|
2920
|
+
if (!s)
|
|
2921
|
+
return { ...i, value: e.value, onChange: e.onChange, onBlur: e.onBlur };
|
|
2922
|
+
const r = s.fromEmit ?? J;
|
|
2941
2923
|
return {
|
|
2942
|
-
...
|
|
2943
|
-
[
|
|
2944
|
-
[
|
|
2945
|
-
...
|
|
2924
|
+
...i,
|
|
2925
|
+
[s.valueProp ?? "value"]: (s.toValue ?? J)(e.value),
|
|
2926
|
+
[s.changeProp ?? "onChange"]: (n) => e.onChange(r(n, i)),
|
|
2927
|
+
...s.bindBlur ? s.bindBlur(e.onBlur) : { onBlur: e.onBlur }
|
|
2946
2928
|
};
|
|
2947
2929
|
}
|
|
2948
|
-
function
|
|
2930
|
+
function Re(s) {
|
|
2949
2931
|
return {
|
|
2950
|
-
focus: () =>
|
|
2951
|
-
blur: () =>
|
|
2952
|
-
scrollIntoView: (e) =>
|
|
2953
|
-
getElement: () =>
|
|
2932
|
+
focus: () => s.current?.focus(),
|
|
2933
|
+
blur: () => s.current?.blur(),
|
|
2934
|
+
scrollIntoView: (e) => s.current?.scrollIntoView(e),
|
|
2935
|
+
getElement: () => s.current
|
|
2954
2936
|
};
|
|
2955
2937
|
}
|
|
2956
|
-
function
|
|
2957
|
-
return typeof
|
|
2938
|
+
function Be(s) {
|
|
2939
|
+
return typeof s == "object" && s !== null && s.nodeType === 1;
|
|
2958
2940
|
}
|
|
2959
|
-
function
|
|
2960
|
-
const e =
|
|
2961
|
-
return
|
|
2941
|
+
function at(s) {
|
|
2942
|
+
const e = E(null);
|
|
2943
|
+
return pe(s, () => Ge(e)), e;
|
|
2962
2944
|
}
|
|
2963
|
-
function
|
|
2964
|
-
const e =
|
|
2965
|
-
return e == null ||
|
|
2945
|
+
function Ge(s) {
|
|
2946
|
+
const e = s.current;
|
|
2947
|
+
return e == null || Be(e) ? Re(s) : e;
|
|
2966
2948
|
}
|
|
2967
|
-
const
|
|
2949
|
+
const ot = Object.freeze({ runtime: "reformer-core", v: 1 });
|
|
2968
2950
|
export {
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2951
|
+
q as ArrayNode,
|
|
2952
|
+
ot as CORE_RUNTIME_TOKEN,
|
|
2953
|
+
b as ErrorStrategy,
|
|
2954
|
+
$e as FIELD_WRAPPER_ONLY_PROPS,
|
|
2955
|
+
be as FieldNode,
|
|
2956
|
+
Ie as FormBundleContext,
|
|
2957
|
+
w as FormErrorHandler,
|
|
2958
|
+
x as FormNode,
|
|
2959
|
+
_e as FormSubmitter,
|
|
2960
|
+
_ as GroupNode,
|
|
2961
|
+
Ve as ModelArrayNode,
|
|
2962
|
+
Ae as NodeFactory,
|
|
2963
|
+
$ as SubscriptionManager,
|
|
2964
|
+
ft as arrayOf,
|
|
2965
|
+
nt as bindFieldProps,
|
|
2966
|
+
Se as buildValidation,
|
|
2967
|
+
yt as computeFrom,
|
|
2968
|
+
gt as copyFrom,
|
|
2969
|
+
Ye as createCoreForm,
|
|
2970
|
+
Ne as createForm,
|
|
2987
2971
|
ee as createFormFromModel,
|
|
2972
|
+
Je as createLegacyForm,
|
|
2988
2973
|
te as createModel,
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
2974
|
+
oe as createSchemaController,
|
|
2975
|
+
Ct as createSchemaOverrideMaps,
|
|
2976
|
+
Pt as createSchemaScope,
|
|
2977
|
+
xt as disableWhen,
|
|
2978
|
+
dt as eachLeafSignal,
|
|
2979
|
+
ct as eachValueSignal,
|
|
2980
|
+
Ot as enableWhen,
|
|
2981
|
+
it as getFieldAdapter,
|
|
2982
|
+
Nt as getNodeForSignal,
|
|
2983
|
+
Qe as getNodeType,
|
|
2984
|
+
Pe as isArrayNode,
|
|
2985
|
+
G as isDerived,
|
|
2986
|
+
Me as isFieldNode,
|
|
2987
|
+
O as isFormNode,
|
|
2988
|
+
Ce as isGroupNode,
|
|
2989
|
+
j as isModelContainerSignal,
|
|
2990
|
+
D as isValueSignal,
|
|
2991
|
+
Re as makeElementFieldHandle,
|
|
2992
|
+
vt as markDerived,
|
|
2993
|
+
Y as modelOf,
|
|
2994
|
+
N as registerSignalNode,
|
|
2995
|
+
bt as resetWhen,
|
|
2996
|
+
Et as revalidateWhen,
|
|
2997
|
+
_t as runOutsideEffect,
|
|
2998
|
+
wt as safeCallback,
|
|
2999
|
+
At as safeDebouncedCallback,
|
|
3000
|
+
X as schemaSubtree,
|
|
3001
|
+
Vt as syncFields,
|
|
3002
|
+
kt as transformValue,
|
|
3003
|
+
le as unknownSchemaSelectors,
|
|
3004
|
+
mt as unmarkDerived,
|
|
3005
|
+
et as useArrayLength,
|
|
3006
|
+
at as useFieldHandleRef,
|
|
3007
|
+
st as useFormBundle,
|
|
3008
|
+
rt as useFormBundleContext,
|
|
3009
|
+
Xe as useFormControl,
|
|
3010
|
+
Ze as useFormControlValue,
|
|
3011
|
+
tt as useFormValidation,
|
|
3012
|
+
St as watchField
|
|
3019
3013
|
};
|