@reformer/core 2.0.1 → 4.0.0

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.
Files changed (147) hide show
  1. package/dist/behaviors/compute-from.d.ts +2 -0
  2. package/dist/behaviors/compute-from.js +31 -0
  3. package/dist/behaviors/copy-from.d.ts +2 -0
  4. package/dist/behaviors/copy-from.js +29 -0
  5. package/dist/behaviors/enable-when.d.ts +2 -0
  6. package/dist/behaviors/enable-when.js +25 -0
  7. package/dist/behaviors/reset-when.d.ts +2 -0
  8. package/dist/behaviors/reset-when.js +24 -0
  9. package/dist/behaviors/revalidate-when.d.ts +2 -0
  10. package/dist/behaviors/revalidate-when.js +18 -0
  11. package/dist/behaviors/sync-fields.d.ts +2 -0
  12. package/dist/behaviors/sync-fields.js +41 -0
  13. package/dist/behaviors/transform-value.d.ts +2 -0
  14. package/dist/behaviors/transform-value.js +45 -0
  15. package/dist/behaviors/watch-field.d.ts +2 -0
  16. package/dist/behaviors/watch-field.js +21 -0
  17. package/dist/behaviors.js +26 -19
  18. package/dist/core/behavior/behavior-context.d.ts +27 -13
  19. package/dist/core/behavior/behavior-registry.d.ts +15 -27
  20. package/dist/core/behavior/behaviors/compute-from.d.ts +50 -21
  21. package/dist/core/behavior/behaviors/copy-from.d.ts +39 -14
  22. package/dist/core/behavior/behaviors/enable-when.d.ts +88 -19
  23. package/dist/core/behavior/behaviors/reset-when.d.ts +31 -18
  24. package/dist/core/behavior/behaviors/revalidate-when.d.ts +40 -17
  25. package/dist/core/behavior/behaviors/sync-fields.d.ts +34 -14
  26. package/dist/core/behavior/behaviors/transform-value.d.ts +116 -44
  27. package/dist/core/behavior/behaviors/watch-field.d.ts +66 -21
  28. package/dist/core/behavior/compose-behavior.d.ts +2 -12
  29. package/dist/core/behavior/index.d.ts +0 -1
  30. package/dist/core/behavior/types.d.ts +2 -8
  31. package/dist/core/factories/node-factory.d.ts +6 -29
  32. package/dist/core/nodes/array-node.d.ts +42 -22
  33. package/dist/core/nodes/field-node.d.ts +51 -26
  34. package/dist/core/nodes/form-node.d.ts +18 -20
  35. package/dist/core/nodes/group-node.d.ts +26 -22
  36. package/dist/core/types/deep-schema.d.ts +2 -12
  37. package/dist/core/types/field-path.d.ts +1 -1
  38. package/dist/core/types/form-context.d.ts +27 -27
  39. package/dist/core/types/{group-node-proxy.d.ts → form-proxy.d.ts} +12 -42
  40. package/dist/core/types/index.d.ts +52 -6
  41. package/dist/core/types/validation-schema.d.ts +3 -12
  42. package/dist/core/utils/abstract-registry.d.ts +74 -0
  43. package/dist/core/utils/aggregate-signals.d.ts +71 -0
  44. package/dist/core/utils/create-form.d.ts +3 -20
  45. package/dist/core/utils/error-handler.d.ts +1 -18
  46. package/dist/core/utils/field-path-navigator.d.ts +1 -1
  47. package/dist/core/utils/field-path.d.ts +23 -11
  48. package/dist/core/utils/form-observer.d.ts +176 -0
  49. package/dist/core/utils/form-proxy-builder.d.ts +25 -0
  50. package/dist/core/utils/form-submitter.d.ts +121 -0
  51. package/dist/core/utils/index.d.ts +9 -2
  52. package/dist/core/utils/registry-helpers.d.ts +0 -7
  53. package/dist/core/utils/safe-effect.d.ts +73 -0
  54. package/dist/core/utils/status-machine.d.ts +153 -0
  55. package/dist/core/utils/type-guards.d.ts +5 -23
  56. package/dist/core/utils/unique-id.d.ts +53 -0
  57. package/dist/core/validation/core/apply-when.d.ts +3 -9
  58. package/dist/core/validation/core/apply.d.ts +2 -13
  59. package/dist/core/validation/core/validate-async.d.ts +2 -8
  60. package/dist/core/validation/core/validate-tree.d.ts +0 -6
  61. package/dist/core/validation/core/validate.d.ts +1 -7
  62. package/dist/core/validation/index.d.ts +8 -2
  63. package/dist/core/validation/validate-form.d.ts +1 -38
  64. package/dist/core/validation/validation-applicator.d.ts +2 -21
  65. package/dist/core/validation/validation-context.d.ts +59 -43
  66. package/dist/core/validation/validation-registry.d.ts +11 -25
  67. package/dist/core/validation/validators/array-validators.d.ts +2 -12
  68. package/dist/core/validation/validators/date-utils.d.ts +26 -0
  69. package/dist/core/validation/validators/email.d.ts +2 -9
  70. package/dist/core/validation/validators/future-date.d.ts +35 -0
  71. package/dist/core/validation/validators/index.d.ts +7 -1
  72. package/dist/core/validation/validators/is-date.d.ts +36 -0
  73. package/dist/core/validation/validators/max-age.d.ts +36 -0
  74. package/dist/core/validation/validators/max-date.d.ts +36 -0
  75. package/dist/core/validation/validators/max-length.d.ts +3 -10
  76. package/dist/core/validation/validators/max.d.ts +3 -10
  77. package/dist/core/validation/validators/min-age.d.ts +36 -0
  78. package/dist/core/validation/validators/min-date.d.ts +36 -0
  79. package/dist/core/validation/validators/min-length.d.ts +3 -10
  80. package/dist/core/validation/validators/min.d.ts +3 -10
  81. package/dist/core/validation/validators/number.d.ts +2 -9
  82. package/dist/core/validation/validators/past-date.d.ts +35 -0
  83. package/dist/core/validation/validators/pattern.d.ts +2 -9
  84. package/dist/core/validation/validators/phone.d.ts +2 -9
  85. package/dist/core/validation/validators/required.d.ts +2 -9
  86. package/dist/core/validation/validators/url.d.ts +2 -9
  87. package/dist/date-utils-xUWFslTj.js +29 -0
  88. package/dist/field-path-DuKdGcIE.js +66 -0
  89. package/dist/hooks/types.d.ts +1 -1
  90. package/dist/hooks/useArrayLength.d.ts +31 -0
  91. package/dist/hooks/useFormControl.d.ts +4 -4
  92. package/dist/hooks/useFormControlValue.d.ts +2 -2
  93. package/dist/hooks/useHiddenCondition.d.ts +25 -0
  94. package/dist/hooks/useSignalSubscription.d.ts +1 -1
  95. package/dist/index-D25LsbRm.js +73 -0
  96. package/dist/index.d.ts +2 -0
  97. package/dist/index.js +1171 -786
  98. package/dist/registry-helpers-Bv_BJ1s-.js +615 -0
  99. package/dist/safe-effect-Dh8uw81c.js +20 -0
  100. package/dist/validate-C3XiA_zf.js +10 -0
  101. package/dist/validators/email.d.ts +2 -0
  102. package/dist/validators/email.js +13 -0
  103. package/dist/validators/future-date.d.ts +2 -0
  104. package/dist/validators/future-date.js +20 -0
  105. package/dist/validators/is-date.d.ts +2 -0
  106. package/dist/validators/is-date.js +12 -0
  107. package/dist/validators/max-age.d.ts +2 -0
  108. package/dist/validators/max-age.js +20 -0
  109. package/dist/validators/max-date.d.ts +2 -0
  110. package/dist/validators/max-date.js +20 -0
  111. package/dist/validators/max-length.d.ts +2 -0
  112. package/dist/validators/max-length.js +11 -0
  113. package/dist/validators/max.d.ts +2 -0
  114. package/dist/validators/max.js +11 -0
  115. package/dist/validators/min-age.d.ts +2 -0
  116. package/dist/validators/min-age.js +20 -0
  117. package/dist/validators/min-date.d.ts +2 -0
  118. package/dist/validators/min-date.js +20 -0
  119. package/dist/validators/min-length.d.ts +2 -0
  120. package/dist/validators/min-length.js +11 -0
  121. package/dist/validators/min.d.ts +2 -0
  122. package/dist/validators/min.js +11 -0
  123. package/dist/validators/number.d.ts +2 -0
  124. package/dist/validators/number.js +35 -0
  125. package/dist/validators/past-date.d.ts +2 -0
  126. package/dist/validators/past-date.js +20 -0
  127. package/dist/validators/pattern.d.ts +2 -0
  128. package/dist/validators/pattern.js +11 -0
  129. package/dist/validators/phone.d.ts +2 -0
  130. package/dist/validators/phone.js +35 -0
  131. package/dist/validators/required.d.ts +2 -0
  132. package/dist/validators/required.js +15 -0
  133. package/dist/validators/url.d.ts +2 -0
  134. package/dist/validators/url.js +19 -0
  135. package/dist/validators-BGsNOgT1.js +207 -0
  136. package/dist/validators.js +54 -29
  137. package/llms.txt +7885 -318
  138. package/package.json +83 -8
  139. package/dist/behaviors-DzYL8kY_.js +0 -499
  140. package/dist/core/behavior/create-field-path.d.ts +0 -7
  141. package/dist/core/context/form-context-impl.d.ts +0 -29
  142. package/dist/core/utils/debounce.d.ts +0 -160
  143. package/dist/core/utils/resources.d.ts +0 -41
  144. package/dist/core/validation/field-path.d.ts +0 -7
  145. package/dist/core/validation/validators/date.d.ts +0 -38
  146. package/dist/registry-helpers-BRxAr6nG.js +0 -490
  147. package/dist/validators-gXoHPdqM.js +0 -418
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/max-age'
2
+ export {}
@@ -0,0 +1,20 @@
1
+ import { v as m } from "../validate-C3XiA_zf.js";
2
+ import { p as c, c as o } from "../date-utils-xUWFslTj.js";
3
+ function l(a, e, n) {
4
+ a && m(a, (r) => {
5
+ if (r == null || r === "")
6
+ return null;
7
+ const t = c(r);
8
+ if (t === null)
9
+ return null;
10
+ const s = o(t);
11
+ return s > e ? {
12
+ code: "date_max_age",
13
+ message: n?.message || `Максимальный возраст: ${e} лет`,
14
+ params: { maxAge: e, currentAge: s, ...n?.params }
15
+ } : null;
16
+ });
17
+ }
18
+ export {
19
+ l as maxAge
20
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/max-date'
2
+ export {}
@@ -0,0 +1,20 @@
1
+ import { v as i } from "../validate-C3XiA_zf.js";
2
+ import { p as l, n as m } from "../date-utils-xUWFslTj.js";
3
+ function c(a, e, n) {
4
+ a && i(a, (r) => {
5
+ if (r == null || r === "")
6
+ return null;
7
+ const t = l(r);
8
+ if (t === null)
9
+ return null;
10
+ const s = m(t), o = m(e);
11
+ return s > o ? {
12
+ code: "date_max",
13
+ message: n?.message || `Дата должна быть не позднее ${o.toLocaleDateString()}`,
14
+ params: { maxDate: e, ...n?.params }
15
+ } : null;
16
+ });
17
+ }
18
+ export {
19
+ c as maxDate
20
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/max-length'
2
+ export {}
@@ -0,0 +1,11 @@
1
+ import { v as a } from "../validate-C3XiA_zf.js";
2
+ function m(e, r, n) {
3
+ e && a(e, (t) => t && t.length > r ? {
4
+ code: "maxLength",
5
+ message: n?.message || `Максимальная длина: ${r} символов`,
6
+ params: { maxLength: r, actualLength: t.length, ...n?.params }
7
+ } : null);
8
+ }
9
+ export {
10
+ m as maxLength
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/max'
2
+ export {}
@@ -0,0 +1,11 @@
1
+ import { v as a } from "../validate-C3XiA_zf.js";
2
+ function e(m, n, t) {
3
+ m && a(m, (r) => r == null ? null : r > n ? {
4
+ code: "max",
5
+ message: t?.message || `Максимальное значение: ${n}`,
6
+ params: { max: n, actual: r, ...t?.params }
7
+ } : null);
8
+ }
9
+ export {
10
+ e as max
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/min-age'
2
+ export {}
@@ -0,0 +1,20 @@
1
+ import { v as m } from "../validate-C3XiA_zf.js";
2
+ import { p as c, c as i } from "../date-utils-xUWFslTj.js";
3
+ function l(n, e, t) {
4
+ n && m(n, (r) => {
5
+ if (r == null || r === "")
6
+ return null;
7
+ const a = c(r);
8
+ if (a === null)
9
+ return null;
10
+ const s = i(a);
11
+ return s < e ? {
12
+ code: "date_min_age",
13
+ message: t?.message || `Минимальный возраст: ${e} лет`,
14
+ params: { minAge: e, currentAge: s, ...t?.params }
15
+ } : null;
16
+ });
17
+ }
18
+ export {
19
+ l as minAge
20
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/min-date'
2
+ export {}
@@ -0,0 +1,20 @@
1
+ import { v as s } from "../validate-C3XiA_zf.js";
2
+ import { p as l, n as o } from "../date-utils-xUWFslTj.js";
3
+ function c(n, e, a) {
4
+ n && s(n, (r) => {
5
+ if (r == null || r === "")
6
+ return null;
7
+ const t = l(r);
8
+ if (t === null)
9
+ return null;
10
+ const m = o(t), i = o(e);
11
+ return m < i ? {
12
+ code: "date_min",
13
+ message: a?.message || `Дата должна быть не ранее ${i.toLocaleDateString()}`,
14
+ params: { minDate: e, ...a?.params }
15
+ } : null;
16
+ });
17
+ }
18
+ export {
19
+ c as minDate
20
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/min-length'
2
+ export {}
@@ -0,0 +1,11 @@
1
+ import { v as a } from "../validate-C3XiA_zf.js";
2
+ function m(e, r, n) {
3
+ e && a(e, (t) => t && t.length < r ? {
4
+ code: "minLength",
5
+ message: n?.message || `Минимальная длина: ${r} символов`,
6
+ params: { minLength: r, actualLength: t.length, ...n?.params }
7
+ } : null);
8
+ }
9
+ export {
10
+ m as minLength
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/min'
2
+ export {}
@@ -0,0 +1,11 @@
1
+ import { v as i } from "../validate-C3XiA_zf.js";
2
+ function a(m, n, t) {
3
+ m && i(m, (r) => r == null ? null : r < n ? {
4
+ code: "min",
5
+ message: t?.message || `Минимальное значение: ${n}`,
6
+ params: { min: n, actual: r, ...t?.params }
7
+ } : null);
8
+ }
9
+ export {
10
+ a as min
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/number'
2
+ export {}
@@ -0,0 +1,35 @@
1
+ import { v as a } from "../validate-C3XiA_zf.js";
2
+ function g(r, e) {
3
+ r && a(r, (m) => m == null ? null : typeof m != "number" || isNaN(m) ? {
4
+ code: "number",
5
+ message: e?.message || "Значение должно быть числом",
6
+ params: e?.params
7
+ } : e?.integer && !Number.isInteger(m) ? {
8
+ code: "number_integer",
9
+ message: e?.message || "Значение должно быть целым числом",
10
+ params: e?.params
11
+ } : e?.min !== void 0 && m < e.min ? {
12
+ code: "number_min",
13
+ message: e?.message || `Значение должно быть не менее ${e.min}`,
14
+ params: { min: e.min, ...e?.params }
15
+ } : e?.max !== void 0 && m > e.max ? {
16
+ code: "number_max",
17
+ message: e?.message || `Значение должно быть не более ${e.max}`,
18
+ params: { max: e.max, ...e?.params }
19
+ } : e?.multipleOf !== void 0 && m % e.multipleOf !== 0 ? {
20
+ code: "number_multiple",
21
+ message: e?.message || `Значение должно быть кратно ${e.multipleOf}`,
22
+ params: { multipleOf: e.multipleOf, ...e?.params }
23
+ } : e?.allowNegative === !1 && m < 0 ? {
24
+ code: "number_negative",
25
+ message: e?.message || "Отрицательные числа не допускаются",
26
+ params: e?.params
27
+ } : e?.allowZero === !1 && m === 0 ? {
28
+ code: "number_zero",
29
+ message: e?.message || "Ноль не допускается",
30
+ params: e?.params
31
+ } : null);
32
+ }
33
+ export {
34
+ g as number
35
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/past-date'
2
+ export {}
@@ -0,0 +1,20 @@
1
+ import { v as o } from "../validate-C3XiA_zf.js";
2
+ import { p as u, n as l, g as m } from "../date-utils-xUWFslTj.js";
3
+ function d(a, e) {
4
+ a && o(a, (r) => {
5
+ if (r == null || r === "")
6
+ return null;
7
+ const t = u(r);
8
+ if (t === null)
9
+ return null;
10
+ const n = l(t), s = m();
11
+ return n > s ? {
12
+ code: "date_future",
13
+ message: e?.message || "Дата не может быть в будущем",
14
+ params: e?.params
15
+ } : null;
16
+ });
17
+ }
18
+ export {
19
+ d as pastDate
20
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/pattern'
2
+ export {}
@@ -0,0 +1,11 @@
1
+ import { v as n } from "../validate-C3XiA_zf.js";
2
+ function u(r, t, e) {
3
+ r && n(r, (a) => a ? t.test(a) ? null : {
4
+ code: "pattern",
5
+ message: e?.message || "Значение не соответствует требуемому формату",
6
+ params: { pattern: t.source, ...e?.params }
7
+ } : null);
8
+ }
9
+ export {
10
+ u as pattern
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/phone'
2
+ export {}
@@ -0,0 +1,35 @@
1
+ import { v as o } from "../validate-C3XiA_zf.js";
2
+ function f(n, s) {
3
+ if (!n) return;
4
+ const r = s?.format || "any", t = {
5
+ // Международный формат: +1234567890 или +1 234 567 8900
6
+ international: /^\+?[1-9]\d{1,14}$/,
7
+ // Российский формат: +7 (XXX) XXX-XX-XX, 8 (XXX) XXX-XX-XX, и вариации
8
+ ru: /^(\+7|7|8)?[\s-]?\(?[489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,
9
+ // US формат: (123) 456-7890, 123-456-7890, 1234567890
10
+ us: /^(\+?1)?[\s-]?\(?[2-9]\d{2}\)?[\s-]?\d{3}[\s-]?\d{4}$/,
11
+ // Любой формат: минимум 10 цифр с возможными разделителями
12
+ any: /^[+]?[(]?[0-9]{1,4}[)]?[-\s.]?[(]?[0-9]{1,4}[)]?[-\s.]?[0-9]{1,9}$/
13
+ };
14
+ o(n, (e) => {
15
+ if (!e)
16
+ return null;
17
+ if (!t[r].test(e)) {
18
+ const a = {
19
+ international: "Введите телефон в международном формате (например, +1234567890)",
20
+ ru: "Введите российский номер телефона (например, +7 900 123-45-67)",
21
+ us: "Введите американский номер телефона (например, (123) 456-7890)",
22
+ any: "Неверный формат телефона"
23
+ };
24
+ return {
25
+ code: "phone",
26
+ message: s?.message || a[r],
27
+ params: { format: r, ...s?.params }
28
+ };
29
+ }
30
+ return null;
31
+ });
32
+ }
33
+ export {
34
+ f as phone
35
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/required'
2
+ export {}
@@ -0,0 +1,15 @@
1
+ import { v as m } from "../validate-C3XiA_zf.js";
2
+ function u(a, e) {
3
+ a && m(a, (r) => r == null || r === "" ? {
4
+ code: "required",
5
+ message: e?.message || "Поле обязательно для заполнения",
6
+ params: e?.params
7
+ } : typeof r == "boolean" && r !== !0 ? {
8
+ code: "required",
9
+ message: e?.message || "Поле обязательно для заполнения",
10
+ params: e?.params
11
+ } : null);
12
+ }
13
+ export {
14
+ u as required
15
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../core/validation/validators/url'
2
+ export {}
@@ -0,0 +1,19 @@
1
+ import { v as s } from "../validate-C3XiA_zf.js";
2
+ function m(e, r) {
3
+ if (!e) return;
4
+ const l = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i, t = /^https?:\/\/([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i;
5
+ s(e, (o) => o ? (r?.requireProtocol ? t : l).test(o) ? r?.allowedProtocols && r.allowedProtocols.length > 0 && !r.allowedProtocols.some(
6
+ (a) => o.toLowerCase().startsWith(`${a}://`)
7
+ ) ? {
8
+ code: "url_protocol",
9
+ message: r?.message || `URL должен использовать один из протоколов: ${r.allowedProtocols.join(", ")}`,
10
+ params: { allowedProtocols: r.allowedProtocols, ...r?.params }
11
+ } : null : {
12
+ code: "url",
13
+ message: r?.message || "Неверный формат URL",
14
+ params: r?.params
15
+ } : null);
16
+ }
17
+ export {
18
+ m as url
19
+ };
@@ -0,0 +1,207 @@
1
+ import { g as a, V as u } from "./registry-helpers-Bv_BJ1s-.js";
2
+ import { e as m, t as y, c, a as _ } from "./field-path-DuKdGcIE.js";
3
+ import { v as N } from "./validate-C3XiA_zf.js";
4
+ import { required as C } from "./validators/required.js";
5
+ import { min as P } from "./validators/min.js";
6
+ import { max as F } from "./validators/max.js";
7
+ import { minLength as d } from "./validators/min-length.js";
8
+ import { maxLength as b } from "./validators/max-length.js";
9
+ import { email as B } from "./validators/email.js";
10
+ import { pattern as T } from "./validators/pattern.js";
11
+ import { url as I } from "./validators/url.js";
12
+ import { phone as R } from "./validators/phone.js";
13
+ import { number as w } from "./validators/number.js";
14
+ import { isDate as D } from "./validators/is-date.js";
15
+ import { minDate as j } from "./validators/min-date.js";
16
+ import { maxDate as k } from "./validators/max-date.js";
17
+ import { pastDate as E } from "./validators/past-date.js";
18
+ import { futureDate as K } from "./validators/future-date.js";
19
+ import { minAge as L } from "./validators/min-age.js";
20
+ import { maxAge as G } from "./validators/max-age.js";
21
+ function M(t, r, i) {
22
+ const e = m(t);
23
+ a().registerAsync(e, r, i);
24
+ }
25
+ function q(t, r) {
26
+ a().registerTree(t, r);
27
+ }
28
+ function z(t, r) {
29
+ if (!Array.isArray(t) && !Array.isArray(r) && t && !("__key" in t) && !("__path" in t)) {
30
+ r(t);
31
+ return;
32
+ }
33
+ const i = (Array.isArray(t) ? t : [t]).filter(
34
+ Boolean
35
+ ), e = Array.isArray(r) ? r : [r];
36
+ for (const n of i) {
37
+ const o = y(n);
38
+ for (const p of e)
39
+ p(o);
40
+ }
41
+ }
42
+ function S(t, r, i) {
43
+ const e = m(t);
44
+ a().enterCondition(e, r);
45
+ try {
46
+ const n = c();
47
+ i(n);
48
+ } finally {
49
+ a().exitCondition();
50
+ }
51
+ }
52
+ function U(t, r) {
53
+ t && d(t, 1, {
54
+ message: r?.message || "Массив не должен быть пустым",
55
+ params: { minLength: 1, ...r?.params }
56
+ });
57
+ }
58
+ function W(t, r) {
59
+ if (!t) return;
60
+ const i = m(t);
61
+ a().registerArrayItemValidation(i, r);
62
+ }
63
+ function s(t) {
64
+ return t == null ? !1 : typeof t == "object" && "value" in t && "setValue" in t && "getValue" in t && "validate" in t;
65
+ }
66
+ function g(t) {
67
+ return t == null ? !1 : s(t) && "validators" in t && "asyncValidators" in t && // FieldNode имеет markAsTouched метод
68
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
+ typeof t.markAsTouched == "function" && // У FieldNode нет fields или items
70
+ !("fields" in t) && !("items" in t);
71
+ }
72
+ function h(t) {
73
+ return t == null ? !1 : s(t) && "applyValidationSchema" in t && "applyBehaviorSchema" in t && "getFieldByPath" in t && // GroupNode НЕ имеет items/push/removeAt (это ArrayNode)
74
+ !("items" in t) && !("push" in t) && !("removeAt" in t);
75
+ }
76
+ function A(t) {
77
+ return t == null ? !1 : s(t) && "items" in t && "length" in t && "push" in t && "removeAt" in t && "at" in t && // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
+ typeof t.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
+ typeof t.removeAt == "function";
80
+ }
81
+ function yt(t) {
82
+ return g(t) ? "FieldNode" : h(t) ? "GroupNode" : A(t) ? "ArrayNode" : s(t) ? "FormNode" : "Unknown";
83
+ }
84
+ function f(t) {
85
+ return g(t) ? [t] : h(t) ? Array.from(t.getAllFields()).flatMap(f) : A(t) ? t.map((r) => f(r)).flat() : [];
86
+ }
87
+ async function H(t, r) {
88
+ const i = new u();
89
+ i.beginRegistration();
90
+ let e = [], n = !1;
91
+ try {
92
+ const o = c();
93
+ r(o), e = i.getCurrentContext()?.getValidators() || [], i.cancelRegistration(), n = !0, t.clearErrors();
94
+ const x = f(t);
95
+ return await Promise.allSettled(x.map((V) => V.validate())), e.length > 0 && await t.applyContextualValidators(e), t.valid.value;
96
+ } catch (o) {
97
+ throw n || i.cancelRegistration(), o;
98
+ }
99
+ }
100
+ class l {
101
+ _form;
102
+ /**
103
+ * Форма с типизированным Proxy-доступом к полям
104
+ */
105
+ form;
106
+ constructor(r) {
107
+ this._form = r, this.form = r._proxyInstance || r.getProxy();
108
+ }
109
+ /**
110
+ * Безопасно установить значение поля по строковому пути
111
+ * Автоматически использует emitEvent: false для предотвращения циклов
112
+ */
113
+ setFieldValue(r, i) {
114
+ const e = this._form.getFieldByPath(r);
115
+ e && s(e) && e.setValue(i, { emitEvent: !1 });
116
+ }
117
+ /**
118
+ * Получить поле формы по строковому пути
119
+ */
120
+ getFieldByPath(r) {
121
+ return this._form.getFieldByPath(r);
122
+ }
123
+ }
124
+ class J extends l {
125
+ control;
126
+ constructor(r, i, e) {
127
+ super(r), this.control = e;
128
+ }
129
+ /**
130
+ * Получить текущее значение поля (внутренний метод для validation-applicator)
131
+ * @internal
132
+ */
133
+ value() {
134
+ return this.control.value.value;
135
+ }
136
+ }
137
+ class Q extends l {
138
+ constructor(r) {
139
+ super(r);
140
+ }
141
+ }
142
+ class dt extends l {
143
+ arrayValue;
144
+ constructor(r, i, e) {
145
+ super(r), this.arrayValue = e;
146
+ }
147
+ /**
148
+ * Получить текущее значение массива (для валидатора)
149
+ * @internal
150
+ */
151
+ value() {
152
+ return this.arrayValue;
153
+ }
154
+ }
155
+ const gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
156
+ __proto__: null,
157
+ TreeValidationContextImpl: Q,
158
+ ValidationContextImpl: J,
159
+ ValidationRegistry: u,
160
+ apply: z,
161
+ applyWhen: S,
162
+ createFieldPath: c,
163
+ email: B,
164
+ extractKey: _,
165
+ extractPath: m,
166
+ futureDate: K,
167
+ isDate: D,
168
+ max: F,
169
+ maxAge: G,
170
+ maxDate: k,
171
+ maxLength: b,
172
+ min: P,
173
+ minAge: L,
174
+ minDate: j,
175
+ minLength: d,
176
+ notEmpty: U,
177
+ number: w,
178
+ pastDate: E,
179
+ pattern: T,
180
+ phone: R,
181
+ required: C,
182
+ toFieldPath: y,
183
+ url: I,
184
+ validate: N,
185
+ validateAsync: M,
186
+ validateForm: H,
187
+ validateItems: W,
188
+ validateTree: q
189
+ }, Symbol.toStringTag, { value: "Module" }));
190
+ export {
191
+ dt as A,
192
+ Q as T,
193
+ J as V,
194
+ A as a,
195
+ gt as b,
196
+ s as c,
197
+ h as d,
198
+ M as e,
199
+ q as f,
200
+ yt as g,
201
+ z as h,
202
+ g as i,
203
+ S as j,
204
+ W as k,
205
+ U as n,
206
+ H as v
207
+ };
@@ -1,31 +1,56 @@
1
- import { T as t, V as s, j as i, k as l, w as r, b as n, p as m, l as o, o as d, m as p, n as x, x as h, t as y, q as v, s as c, r as u, u as V, e as f, f as g, v as F, y as I, h as P } from "./validators-gXoHPdqM.js";
2
- import { V as b, c as q, a as C, e as L, t as j } from "./registry-helpers-BRxAr6nG.js";
1
+ import { T as r, V as a, h as o, j as m, b as p, n as x, e as f, v as i, k as s, f as n } from "./validators-BGsNOgT1.js";
2
+ import { v as d } from "./validate-C3XiA_zf.js";
3
+ import { required as v } from "./validators/required.js";
4
+ import { min as y } from "./validators/min.js";
5
+ import { max as g } from "./validators/max.js";
6
+ import { minLength as V } from "./validators/min-length.js";
7
+ import { maxLength as F } from "./validators/max-length.js";
8
+ import { email as P } from "./validators/email.js";
9
+ import { pattern as b } from "./validators/pattern.js";
10
+ import { url as L } from "./validators/url.js";
11
+ import { phone as k } from "./validators/phone.js";
12
+ import { number as E } from "./validators/number.js";
13
+ import { isDate as R } from "./validators/is-date.js";
14
+ import { minDate as w } from "./validators/min-date.js";
15
+ import { maxDate as B } from "./validators/max-date.js";
16
+ import { pastDate as H } from "./validators/past-date.js";
17
+ import { futureDate as M } from "./validators/future-date.js";
18
+ import { minAge as O } from "./validators/min-age.js";
19
+ import { maxAge as S } from "./validators/max-age.js";
20
+ import { c as X, a as Y, e as Z, t as _ } from "./field-path-DuKdGcIE.js";
21
+ import { V as ee } from "./registry-helpers-Bv_BJ1s-.js";
3
22
  export {
4
- t as TreeValidationContextImpl,
5
- s as ValidationContextImpl,
6
- b as ValidationRegistry,
7
- i as apply,
8
- l as applyWhen,
9
- q as createFieldPath,
10
- r as date,
11
- n as default,
12
- m as email,
13
- C as extractKey,
14
- L as extractPath,
15
- o as max,
16
- d as maxLength,
17
- p as min,
18
- x as minLength,
19
- h as notEmpty,
20
- y as number,
21
- v as pattern,
22
- c as phone,
23
- u as required,
24
- j as toFieldPath,
25
- V as url,
26
- f as validate,
27
- g as validateAsync,
28
- F as validateForm,
29
- I as validateItems,
30
- P as validateTree
23
+ r as TreeValidationContextImpl,
24
+ a as ValidationContextImpl,
25
+ ee as ValidationRegistry,
26
+ o as apply,
27
+ m as applyWhen,
28
+ X as createFieldPath,
29
+ p as default,
30
+ P as email,
31
+ Y as extractKey,
32
+ Z as extractPath,
33
+ M as futureDate,
34
+ R as isDate,
35
+ g as max,
36
+ S as maxAge,
37
+ B as maxDate,
38
+ F as maxLength,
39
+ y as min,
40
+ O as minAge,
41
+ w as minDate,
42
+ V as minLength,
43
+ x as notEmpty,
44
+ E as number,
45
+ H as pastDate,
46
+ b as pattern,
47
+ k as phone,
48
+ v as required,
49
+ _ as toFieldPath,
50
+ L as url,
51
+ d as validate,
52
+ f as validateAsync,
53
+ i as validateForm,
54
+ s as validateItems,
55
+ n as validateTree
31
56
  };