@reformer/core 11.0.0-beta.5 → 11.0.0-beta.7

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 (95) hide show
  1. package/dist/behaviors.js +124 -124
  2. package/dist/create-model-B8U-COv-.js +103 -0
  3. package/dist/en-CjAqn7h0.js +41 -0
  4. package/dist/form/behaviors/internals.d.ts +9 -0
  5. package/dist/form/create-form.d.ts +6 -6
  6. package/dist/form/factories/node-factory.d.ts +16 -16
  7. package/dist/form/nodes/array-node.d.ts +3 -3
  8. package/dist/form/nodes/field-node.d.ts +3 -3
  9. package/dist/form/nodes/group-node.d.ts +7 -7
  10. package/dist/form/nodes/model-array-node.d.ts +2 -2
  11. package/dist/form/types/contracts.d.ts +6 -0
  12. package/dist/form/types/deep-schema.d.ts +5 -5
  13. package/dist/form/types/validation-schema.d.ts +13 -1
  14. package/dist/form/validation/operators.d.ts +6 -1
  15. package/dist/form/validators/validation-error.d.ts +8 -0
  16. package/dist/i18n/descriptor.d.ts +54 -0
  17. package/dist/i18n/en.json.d.ts +45 -0
  18. package/dist/i18n/loader.d.ts +71 -0
  19. package/dist/i18n/locale-store.d.ts +39 -0
  20. package/dist/i18n/locale.d.ts +90 -0
  21. package/dist/i18n/message-format.d.ts +116 -0
  22. package/dist/i18n/resolve-localized.d.ts +17 -0
  23. package/dist/i18n/ru.json.d.ts +45 -0
  24. package/dist/i18n/translator.d.ts +50 -0
  25. package/dist/i18n/validation-message.d.ts +18 -0
  26. package/dist/i18n.d.ts +31 -0
  27. package/dist/i18n.js +303 -0
  28. package/dist/index-BrNkQj1y.js +105 -0
  29. package/dist/index.js +548 -601
  30. package/dist/loader-Dv_Hl7JC.js +216 -0
  31. package/dist/locale/en.d.ts +2 -0
  32. package/dist/locale/en.js +5 -0
  33. package/dist/locale/en.json +42 -0
  34. package/dist/locale/index.d.ts +18 -0
  35. package/dist/locale/ru.d.ts +2 -0
  36. package/dist/locale/ru.js +41 -0
  37. package/dist/locale/ru.json +42 -0
  38. package/dist/locale.d.ts +2 -0
  39. package/dist/locale.js +9 -0
  40. package/dist/model/create-model.d.ts +17 -3
  41. package/dist/model/index.d.ts +3 -3
  42. package/dist/model/model-signals-proxy.d.ts +25 -0
  43. package/dist/model/types.d.ts +19 -5
  44. package/dist/model-signals-proxy-2vqS243J.js +250 -0
  45. package/dist/model.js +18 -16
  46. package/dist/platforms/react/field-binding/field-adapter.d.ts +87 -0
  47. package/dist/platforms/react/field-binding/field-handle.d.ts +50 -0
  48. package/dist/platforms/react/hooks/types.d.ts +6 -3
  49. package/dist/platforms/react/hooks/useFormControlValue.d.ts +2 -1
  50. package/dist/platforms/react/i18n/context.d.ts +13 -0
  51. package/dist/platforms/react/i18n/hooks.d.ts +59 -0
  52. package/dist/platforms/react/i18n/provider.d.ts +52 -0
  53. package/dist/platforms/react/index.d.ts +4 -0
  54. package/dist/{strategy-DA3JwxsR.js → strategy-BXS_gBfz.js} +7 -7
  55. package/dist/validation-error-B-U3RsV0.js +11 -0
  56. package/dist/validation.js +1 -1
  57. package/dist/validators/email.js +5 -8
  58. package/dist/validators/future-date.js +8 -11
  59. package/dist/validators/integer.js +4 -7
  60. package/dist/validators/is-date.js +5 -8
  61. package/dist/validators/is-number.js +4 -7
  62. package/dist/validators/max-age.js +8 -11
  63. package/dist/validators/max-date.js +8 -11
  64. package/dist/validators/max-length.js +5 -8
  65. package/dist/validators/max.js +4 -7
  66. package/dist/validators/min-age.js +8 -11
  67. package/dist/validators/min-date.js +8 -11
  68. package/dist/validators/min-length.js +5 -8
  69. package/dist/validators/min.js +4 -7
  70. package/dist/validators/multiple-of.js +5 -8
  71. package/dist/validators/non-negative.js +4 -7
  72. package/dist/validators/non-zero.js +4 -7
  73. package/dist/validators/past-date.js +8 -11
  74. package/dist/validators/pattern.js +5 -8
  75. package/dist/validators/phone.js +6 -9
  76. package/dist/validators/required.js +4 -7
  77. package/dist/validators/url.js +9 -14
  78. package/dist/validators.js +84 -106
  79. package/docs/llms/02-quick-start.md +7 -7
  80. package/docs/llms/03-api-signatures.md +11 -5
  81. package/docs/llms/05-common-mistakes.md +1 -1
  82. package/docs/llms/09-formschema.md +12 -12
  83. package/docs/llms/10-arrays.md +34 -4
  84. package/docs/llms/14-extended-mistakes.md +1 -1
  85. package/docs/llms/15-project-structure.md +15 -13
  86. package/docs/llms/16-ui-components.md +36 -9
  87. package/docs/llms/17-nonexistent-api.md +16 -2
  88. package/docs/llms/29-async-preload.md +4 -4
  89. package/docs/llms/30-type-safety-recipes.md +1 -1
  90. package/docs/llms/34-i18n.md +272 -0
  91. package/llms-index.json +1 -1
  92. package/llms.txt +1925 -175
  93. package/package.json +22 -3
  94. package/dist/create-model-Dxh9cfLp.js +0 -97
  95. package/dist/model-signals-proxy-mV3WGdlO.js +0 -233
package/dist/behaviors.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { effect as j } from "@preact/signals-core";
2
- import { d as $, a as C, w as F, t as M, r as O, s as A, b as D } from "./behaviors-value-C7dSEhCc.js";
3
- import { i as G, m as k, u as x } from "./model-signals-proxy-mV3WGdlO.js";
4
- import { e as T } from "./node-DGEFMTQu.js";
5
- let p = null;
6
- function P(e) {
7
- if (!p)
2
+ import { d as k, a as A, w as $, t as C, r as O, s as D, b as G } from "./behaviors-value-C7dSEhCc.js";
3
+ import { d as T, i as I, m as x, u as P } from "./model-signals-proxy-2vqS243J.js";
4
+ import { e as R } from "./node-DGEFMTQu.js";
5
+ let h = null;
6
+ function B(e) {
7
+ if (!h)
8
8
  throw new Error(
9
9
  `[@reformer/core/behaviors] "${e}" вызван вне defineFormBehavior(...) — операторы поведения можно вызывать только внутри схемы.`
10
10
  );
11
- return p;
11
+ return h;
12
12
  }
13
- function s(e) {
14
- P("onDispose").cleanups.push(e);
13
+ function a(e) {
14
+ B("onDispose").cleanups.push(e);
15
15
  }
16
- function y() {
17
- const e = P("getScope");
16
+ function p() {
17
+ const e = B("getScope");
18
18
  return { model: e.model, form: e.form };
19
19
  }
20
- function I(e) {
20
+ function q(e) {
21
21
  return {
22
22
  __run(t, n) {
23
- const o = { cleanups: [], model: t, form: n }, r = p;
24
- p = o;
23
+ const o = { cleanups: [], model: t, form: n }, r = h;
24
+ h = o;
25
25
  try {
26
26
  e({ model: t, form: n });
27
27
  } finally {
28
- p = r;
28
+ h = r;
29
29
  }
30
30
  return () => {
31
31
  for (const c of o.cleanups) c();
@@ -33,28 +33,28 @@ function I(e) {
33
33
  }
34
34
  };
35
35
  }
36
- function h(e) {
37
- s(j(e));
36
+ function m(e) {
37
+ a(j(e));
38
38
  }
39
39
  function g(e) {
40
- $(e);
40
+ k(e);
41
41
  }
42
- const m = (e) => typeof e == "object" && e !== null && typeof e.peek == "function" && !G(e), B = (e) => Array.isArray(e) ? e : [e];
43
- function E(e) {
42
+ const _ = (e) => typeof e == "object" && e !== null && typeof e.peek == "function" && !I(e), b = (e) => _(e) || T(e), E = (e) => Array.isArray(e) ? e : [e];
43
+ function S(e) {
44
44
  const t = {};
45
45
  for (const n of Object.keys(e)) {
46
46
  const o = e[n];
47
- t[n] = m(o) ? o.value : E(o);
47
+ t[n] = b(o) ? o.value : S(o);
48
48
  }
49
49
  return t;
50
50
  }
51
- function W(e, t) {
51
+ function V(e, t) {
52
52
  for (const n of Object.keys(e)) {
53
53
  const o = e[n];
54
- m(o) ? o.value = t?.[n] : W(o, t?.[n] ?? {});
54
+ b(o) ? o.value = t?.[n] : V(o, t?.[n] ?? {});
55
55
  }
56
56
  }
57
- function S(e) {
57
+ function W(e) {
58
58
  return (t) => {
59
59
  try {
60
60
  t();
@@ -69,18 +69,18 @@ function S(e) {
69
69
  }
70
70
  };
71
71
  }
72
- function _(e, t) {
72
+ function F(e, t) {
73
73
  return t.split(".").reduce((n, o) => n?.[o], e);
74
74
  }
75
- function R(e) {
75
+ function z(e) {
76
76
  if (!e) return;
77
- const { form: t } = y();
77
+ const { form: t } = p();
78
78
  return t.getFieldByPath(e);
79
79
  }
80
- function X(e, t, n) {
81
- k(e), s(() => x(e));
82
- const o = S(e);
83
- h(() => {
80
+ function Z(e, t, n) {
81
+ x(e), a(() => P(e));
82
+ const o = W(e);
83
+ m(() => {
84
84
  if (n?.when && !n.when()) return;
85
85
  const r = t();
86
86
  e.peek() !== r && o(() => {
@@ -88,11 +88,11 @@ function X(e, t, n) {
88
88
  });
89
89
  });
90
90
  }
91
- function Y(e, t, n, o) {
92
- k(t), s(() => x(t));
93
- const r = S(t);
94
- h(() => {
95
- const c = e.map((f) => f.value);
91
+ function ee(e, t, n, o) {
92
+ x(t), a(() => P(t));
93
+ const r = W(t);
94
+ m(() => {
95
+ const c = e.map((s) => s.value);
96
96
  if (o?.when && !o.when(...c)) return;
97
97
  const i = n(...c);
98
98
  t.peek() !== i && r(() => {
@@ -100,70 +100,70 @@ function Y(e, t, n, o) {
100
100
  });
101
101
  });
102
102
  }
103
- function Z(e, t, n) {
104
- if (m(e) && m(t)) {
105
- s(C(e, t, n));
103
+ function ne(e, t, n) {
104
+ if (b(e) && b(t)) {
105
+ a(A(e, t, n));
106
106
  return;
107
107
  }
108
108
  const o = e, r = t;
109
- h(() => {
110
- const c = E(o);
111
- n?.when && !n.when() || g(() => W(r, c));
109
+ m(() => {
110
+ const c = S(o);
111
+ n?.when && !n.when() || g(() => V(r, c));
112
112
  });
113
113
  }
114
- function q(e, t, n) {
114
+ function H(e, t, n) {
115
115
  let o;
116
116
  const r = (c) => {
117
117
  o?.abort(), o = new AbortController();
118
118
  const { signal: i } = o;
119
- $(() => t(c, { signal: i }));
119
+ k(() => t(c, { signal: i }));
120
120
  };
121
121
  if (!n?.debounce)
122
- s(F(e, r, { immediate: n?.immediate }));
122
+ a($(e, r, { immediate: n?.immediate }));
123
123
  else {
124
124
  let c;
125
- const i = F(
125
+ const i = $(
126
126
  e,
127
- (f) => {
128
- c && clearTimeout(c), c = setTimeout(() => r(f), n.debounce);
127
+ (s) => {
128
+ c && clearTimeout(c), c = setTimeout(() => r(s), n.debounce);
129
129
  },
130
130
  { immediate: n?.immediate }
131
131
  );
132
- s(() => {
132
+ a(() => {
133
133
  c && clearTimeout(c), i();
134
134
  });
135
135
  }
136
- s(() => o?.abort());
136
+ a(() => o?.abort());
137
137
  }
138
- function z(e, t, n) {
139
- for (const o of B(e))
140
- m(o) ? s(T(o, t, n)) : L(o, t, n);
138
+ function L(e, t, n) {
139
+ for (const o of E(e))
140
+ _(o) ? a(R(o, t, n)) : N(o, t, n);
141
141
  }
142
- function ee(e, t, n) {
143
- z(e, () => !t(), n);
142
+ function te(e, t, n) {
143
+ L(e, () => !t(), n);
144
144
  }
145
- function L(e, t, n) {
146
- const o = R(e.__path);
147
- o && h(() => {
145
+ function N(e, t, n) {
146
+ const o = z(e.__path);
147
+ o && m(() => {
148
148
  const r = t();
149
149
  g(() => {
150
150
  r ? o.enable() : (o.disable(), n?.resetOnDisable && o.reset());
151
151
  });
152
152
  });
153
153
  }
154
- function ne(e, t) {
155
- s(M(e, t));
154
+ function oe(e, t) {
155
+ a(C(e, t));
156
156
  }
157
- function te(e, t, n) {
158
- s(O(e, t, n));
157
+ function re(e, t, n) {
158
+ a(O(e, t, n));
159
159
  }
160
- function oe(e, t, n) {
161
- s(A(e, t, n));
160
+ function ce(e, t, n) {
161
+ a(D(e, t, n));
162
162
  }
163
- function re(e, t) {
164
- s(D(e, t));
163
+ function ie(e, t) {
164
+ a(G(e, t));
165
165
  }
166
- function V(e) {
166
+ function M(e) {
167
167
  return new Proxy(
168
168
  {},
169
169
  {
@@ -172,12 +172,12 @@ function V(e) {
172
172
  if (typeof n != "string") return;
173
173
  const o = e[n];
174
174
  if (o != null)
175
- return m(o) ? o.value : V(o);
175
+ return _(o) ? o.value : M(o);
176
176
  }
177
177
  }
178
178
  );
179
179
  }
180
- function N(e) {
180
+ function J(e) {
181
181
  return new Proxy(
182
182
  {},
183
183
  {
@@ -192,28 +192,28 @@ function N(e) {
192
192
  }
193
193
  );
194
194
  }
195
- function H(e, t) {
196
- const { model: n, form: o } = y(), r = e.__path;
195
+ function K(e, t) {
196
+ const { model: n, form: o } = p(), r = e.__path;
197
197
  if (!r) return;
198
- const c = _(n, r);
198
+ const c = F(n, r);
199
199
  if (!c) return;
200
200
  const i = o.getFieldByPath(
201
201
  r
202
- ), f = i?.length, a = /* @__PURE__ */ new Map();
203
- h(() => {
204
- const d = f ? f.value : c.length, w = /* @__PURE__ */ new Set();
202
+ ), s = i?.length, f = /* @__PURE__ */ new Map();
203
+ m(() => {
204
+ const d = s ? s.value : c.length, y = /* @__PURE__ */ new Set();
205
205
  for (let u = 0; u < d; u++) {
206
206
  const l = c.at(u);
207
- if (l != null && (w.add(l), !a.has(l))) {
208
- const b = i?.at?.(u) ?? N(r);
209
- a.set(l, t.__run(l, b));
207
+ if (l != null && (y.add(l), !f.has(l))) {
208
+ const w = i?.at?.(u) ?? J(r);
209
+ f.set(l, t.__run(l, w));
210
210
  }
211
211
  }
212
- for (const [u, l] of a)
213
- w.has(u) || (l(), a.delete(u));
214
- }), s(() => {
215
- for (const d of a.values()) d();
216
- a.clear();
212
+ for (const [u, l] of f)
213
+ y.has(u) || (l(), f.delete(u));
214
+ }), a(() => {
215
+ for (const d of f.values()) d();
216
+ f.clear();
217
217
  });
218
218
  }
219
219
  function v(e) {
@@ -226,19 +226,19 @@ function v(e) {
226
226
  }
227
227
  for (const n of Object.keys(e)) v(e[n]);
228
228
  }
229
- function ce(e, t) {
230
- const { model: n } = y(), o = e.__path;
229
+ function se(e, t) {
230
+ const { model: n } = p(), o = e.__path;
231
231
  if (!o) return;
232
- const r = _(n, o);
233
- r && H(
232
+ const r = F(n, o);
233
+ r && K(
234
234
  e,
235
- I(({ model: c }) => {
236
- q(t(c), (i) => {
235
+ q(({ model: c }) => {
236
+ H(t(c), (i) => {
237
237
  if (i)
238
- for (let f = 0; f < r.length; f++) {
239
- const a = r.at(f);
240
- if (a && a !== c) {
241
- const d = t(a);
238
+ for (let s = 0; s < r.length; s++) {
239
+ const f = r.at(s);
240
+ if (f && f !== c) {
241
+ const d = t(f);
242
242
  d.peek() && (d.value = !1);
243
243
  }
244
244
  }
@@ -246,24 +246,24 @@ function ce(e, t) {
246
246
  })
247
247
  );
248
248
  }
249
- function ie(e, t) {
250
- const { model: n } = y(), o = e.__path;
249
+ function ae(e, t) {
250
+ const { model: n } = p(), o = e.__path;
251
251
  if (!o) return;
252
- const r = _(n, o);
252
+ const r = F(n, o);
253
253
  if (!r) return;
254
254
  let c = !1, i = 0;
255
- h(() => {
255
+ m(() => {
256
256
  v(r), !c && (c = !0, g(() => {
257
257
  c = !1;
258
- const f = t(r.toArray());
259
- let a = !1;
260
- for (const { index: d, patch: w } of f) {
258
+ const s = t(r.toArray());
259
+ let f = !1;
260
+ for (const { index: d, patch: y } of s) {
261
261
  const u = r.at(d);
262
262
  if (u)
263
- for (const [l, b] of Object.entries(w))
264
- u[l] !== b && (u[l] = b, a = !0);
263
+ for (const [l, w] of Object.entries(y))
264
+ u[l] !== w && (u[l] = w, f = !0);
265
265
  }
266
- if (i = a ? i + 1 : 0, i > 50)
266
+ if (i = f ? i + 1 : 0, i > 50)
267
267
  throw i = 0, new Error(
268
268
  `[@reformer/core/behaviors] aggregateInto("${o}"): запись не сходится (>50 проходов) — derive должна быть идемпотентной на фикспоинте.`
269
269
  );
@@ -271,32 +271,32 @@ function ie(e, t) {
271
271
  });
272
272
  }
273
273
  function fe(e, t) {
274
- const { form: n } = y();
275
- for (const o of B(e)) {
274
+ const { form: n } = p();
275
+ for (const o of E(e)) {
276
276
  const r = o, c = r.__path;
277
277
  if (!c) continue;
278
- const i = n ? n.getFieldByPath(c) : void 0, f = i ? i.getProxy?.() ?? i : void 0;
279
- s(t.__run(V(r), f));
278
+ const i = n ? n.getFieldByPath(c) : void 0, s = i ? i.getProxy?.() ?? i : void 0;
279
+ a(t.__run(M(r), s));
280
280
  }
281
281
  }
282
282
  export {
283
- ie as aggregateInto,
283
+ ae as aggregateInto,
284
284
  fe as apply,
285
- H as applyEach,
286
- X as compute,
287
- Y as computeFrom,
288
- Z as copyFrom,
285
+ K as applyEach,
286
+ Z as compute,
287
+ ee as computeFrom,
288
+ ne as copyFrom,
289
289
  g as defer,
290
- I as defineFormBehavior,
291
- ee as disableWhen,
292
- h as effect,
293
- z as enableWhen,
294
- ce as exclusiveFlag,
295
- y as getScope,
296
- q as onChange,
297
- s as onDispose,
298
- te as resetWhen,
299
- re as revalidateWhen,
300
- oe as syncFields,
301
- ne as transformValue
290
+ q as defineFormBehavior,
291
+ te as disableWhen,
292
+ m as effect,
293
+ L as enableWhen,
294
+ se as exclusiveFlag,
295
+ p as getScope,
296
+ H as onChange,
297
+ a as onDispose,
298
+ re as resetWhen,
299
+ ie as revalidateWhen,
300
+ ce as syncFields,
301
+ oe as transformValue
302
302
  };
@@ -0,0 +1,103 @@
1
+ import { s as p, r as g, c as u, G as v } from "./model-signals-proxy-2vqS243J.js";
2
+ function r(t) {
3
+ if (t)
4
+ return t.kind === "group" ? d(t) : t.kind === "array" ? w(t) : t.read();
5
+ }
6
+ function w(t) {
7
+ const i = {
8
+ get length() {
9
+ return t.items.value.length;
10
+ },
11
+ push: (e) => t.push(e),
12
+ insertAt: (e, n) => t.insertAt(e, n),
13
+ removeAt: (e) => t.removeAt(e),
14
+ move: (e, n) => t.move(e, n),
15
+ swap: (e, n) => t.swap(e, n),
16
+ clear: () => t.clear(),
17
+ at: (e) => r(t.items.value[e]),
18
+ map: (e) => t.items.value.map((n, s) => e(r(n), s)),
19
+ forEach: (e) => t.items.value.forEach((n, s) => e(r(n), s)),
20
+ toArray: () => t.peek(),
21
+ [Symbol.iterator]: function* () {
22
+ const e = t.items.value;
23
+ for (let n = 0; n < e.length; n++) yield r(e[n]);
24
+ }
25
+ };
26
+ return new Proxy(i, {
27
+ get: (e, n, s) => n === "__path" ? t.path : typeof n == "string" && u(n) ? r(t.items.value[Number(n)]) : Reflect.get(e, n, s),
28
+ has: (e, n) => typeof n == "string" && u(n) ? Number(n) < t.items.value.length : Reflect.has(e, n)
29
+ });
30
+ }
31
+ const h = /* @__PURE__ */ new Set([
32
+ "$",
33
+ "get",
34
+ "set",
35
+ "patch",
36
+ "isDirty",
37
+ "reset",
38
+ "captureInitial",
39
+ "signalAt"
40
+ ]), m = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap();
41
+ function d(t) {
42
+ const i = m.get(t);
43
+ if (i) return i;
44
+ const e = {
45
+ $: p(t),
46
+ get: () => t.peek(),
47
+ set: (s) => t.set(s),
48
+ patch: (s) => t.set(s),
49
+ isDirty: () => t.dirty(),
50
+ reset: () => t.resetToInitial(),
51
+ captureInitial: () => t.captureInitial(),
52
+ signalAt: (s) => g(t, s)
53
+ }, n = new Proxy(
54
+ {},
55
+ {
56
+ get: (s, a) => {
57
+ if (a === "__path") return t.path;
58
+ if (typeof a != "string") return;
59
+ const c = t.children.get(a);
60
+ if (c) return r(c);
61
+ if (h.has(a)) return e[a];
62
+ },
63
+ set: (s, a, c) => {
64
+ if (typeof a != "string") return !1;
65
+ const f = t.children.get(a);
66
+ return f ? (f.set(c), !0) : !1;
67
+ },
68
+ has: (s, a) => typeof a == "string" && (t.children.has(a) || h.has(a)),
69
+ ownKeys: () => [...t.children.keys()],
70
+ getOwnPropertyDescriptor: (s, a) => typeof a == "string" && t.children.has(a) ? { enumerable: !0, configurable: !0 } : void 0
71
+ }
72
+ );
73
+ return m.set(t, n), o.set(n, t), n;
74
+ }
75
+ function l(t, i, e) {
76
+ if (t.kind === "leaf") {
77
+ i(t.signal);
78
+ return;
79
+ }
80
+ if (t.kind === "group") {
81
+ for (const n of t.children.values()) l(n, i, e);
82
+ return;
83
+ }
84
+ e && i(p(t));
85
+ for (const n of t.items.value) l(n, i, e);
86
+ }
87
+ function x(t, i) {
88
+ const e = o.get(t);
89
+ e && l(e, i, !1);
90
+ }
91
+ function y(t, i) {
92
+ const e = o.get(t);
93
+ e && l(e, i, !0);
94
+ }
95
+ function A(t) {
96
+ const i = new v(t, "");
97
+ return d(i);
98
+ }
99
+ export {
100
+ y as a,
101
+ A as c,
102
+ x as e
103
+ };
@@ -0,0 +1,41 @@
1
+ const a = {
2
+ "format.fileSize.b": "{value} B",
3
+ "format.fileSize.kb": "{value} KB",
4
+ "format.fileSize.mb": "{value} MB",
5
+ "format.fileSize.gb": "{value} GB",
6
+ "format.fileSize.tb": "{value} TB",
7
+ "validation.required": "This field is required",
8
+ "validation.pattern": "Invalid format",
9
+ "validation.email": "Enter a valid email address",
10
+ "validation.url": "Enter a valid URL",
11
+ "validation.url_protocol": "The URL must use one of these protocols: {allowedProtocols}",
12
+ "validation.phone": "Enter a valid phone number",
13
+ "validation.min": "Must be at least {min}",
14
+ "validation.max": "Must be at most {max}",
15
+ "validation.minLength": "Enter at least {minLength, plural, one{# character} other{# characters}}",
16
+ "validation.maxLength": "Enter no more than {maxLength, plural, one{# character} other{# characters}}",
17
+ "validation.isNumber": "Enter a number",
18
+ "validation.integer": "Enter a whole number",
19
+ "validation.multipleOf": "Must be a multiple of {multipleOf}",
20
+ "validation.nonNegative": "Must not be negative",
21
+ "validation.nonZero": "Must not be zero",
22
+ "validation.date_invalid": "Enter a valid date",
23
+ "validation.date_min": "The date must not be earlier than {minDate}",
24
+ "validation.date_max": "The date must not be later than {maxDate}",
25
+ "validation.date_past": "The date must not be in the past",
26
+ "validation.date_future": "The date must not be in the future",
27
+ "validation.date_min_age": "Age must be at least {minAge}",
28
+ "validation.date_max_age": "Age must be at most {maxAge}",
29
+ "validation.fileType": "File {fileName} has a type that is not allowed. Allowed: {accept}",
30
+ "validation.maxFileSize": "File {fileName} is larger than {maxFileSize}",
31
+ "validation.minFileSize": "File {fileName} is smaller than {minFileSize}",
32
+ "validation.maxFiles": "No more than {maxFiles, plural, one{# file} other{# files}}",
33
+ "validation.minFiles": "At least {minFiles, plural, one{# file} other{# files}}",
34
+ "validation.maxTotalFileSize": "The total size of the files exceeds {maxTotalFileSize}",
35
+ "validation.fileExists": "File {fileName} has already been added",
36
+ "validation.uploadAborted": "Upload cancelled",
37
+ "validation.uploadFailed": "Failed to upload {fileName}"
38
+ };
39
+ export {
40
+ a as m
41
+ };
@@ -13,6 +13,15 @@ export type GroupSignals = Record<string, unknown> & {
13
13
  * read-only агрегат вместо рекурсивного `writeGroup`.
14
14
  */
15
15
  export declare const isLeafSignal: (v: unknown) => v is Signal<unknown>;
16
+ /**
17
+ * Ручка значения целиком: лист либо узел-массив дерева `$`.
18
+ *
19
+ * Массив копируется и читается ЗНАЧЕНИЕМ — заменой целиком, а не обходом по ключам: у его узла
20
+ * собственный ключ один (`length`), и обход, годный для группы, отдавал бы вместо массива мусор.
21
+ * Для `enableWhen` массив при этом остаётся НЕ листом ({@link isLeafSignal}): его нода ищется по
22
+ * пути, а она бывает и полем, и массивом под-форм.
23
+ */
24
+ export declare const isValueHandle: (v: unknown) => v is Signal<unknown>;
16
25
  export declare const asArray: <X>(v: X | X[]) => X[];
17
26
  export declare function readGroup(g: GroupSignals): Record<string, unknown>;
18
27
  export declare function writeGroup(g: GroupSignals, val: Record<string, unknown>): void;
@@ -52,9 +52,9 @@ export interface CreateFormFromModelArgs<T> {
52
52
  * component: Section,
53
53
  * children: [
54
54
  * // Layout несёт только component/componentProps; правила — в отдельной ValidationSchema.
55
- * { value: model.$.email, component: InputField },
55
+ * { value: model.$.email, component: Input },
56
56
  * // вложенная группа: `model.$.profile.name` (≡ под-модель `model.profile.$.name` — тот же сигнал)
57
- * { value: model.$.profile.name, component: InputField },
57
+ * { value: model.$.profile.name, component: Input },
58
58
  * ],
59
59
  * };
60
60
  *
@@ -93,8 +93,8 @@ export declare function createFormFromModel<T>(args: CreateFormFromModelArgs<T>)
93
93
  * // Layout-схема НЕ несёт validators — только component/componentProps.
94
94
  * const schema = {
95
95
  * children: [
96
- * { value: model.$.email, component: InputField },
97
- * { value: model.$.password, component: InputField },
96
+ * { value: model.$.email, component: Input },
97
+ * { value: model.$.password, component: Input },
98
98
  * ],
99
99
  * };
100
100
  *
@@ -125,8 +125,8 @@ export declare function createForm<T>(config: GroupNodeConfig<T>): FormProxy<T>;
125
125
  * @example Legacy (back-compat) — плоская схема без модели
126
126
  * ```typescript
127
127
  * const form = createForm<UserForm>({
128
- * email: { value: '', component: InputField },
129
- * password: { value: '', component: InputField },
128
+ * email: { value: '', component: Input },
129
+ * password: { value: '', component: Input },
130
130
  * });
131
131
  * ```
132
132
  */