@reformer/core 7.0.0 → 9.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/core/factories/node-factory.d.ts +5 -4
  2. package/dist/core/model/types.d.ts +41 -12
  3. package/dist/core/model/validate-model.d.ts +8 -4
  4. package/dist/core/nodes/field-node.d.ts +2 -2
  5. package/dist/core/nodes/group-node.d.ts +7 -1
  6. package/dist/core/nodes/model-array-node.d.ts +5 -0
  7. package/dist/core/types/deep-schema.d.ts +16 -4
  8. package/dist/core/types/form-proxy.d.ts +1 -1
  9. package/dist/core/types/index.d.ts +4 -10
  10. package/dist/core/types/schema-node.d.ts +79 -0
  11. package/dist/core/types/validation-schema.d.ts +22 -11
  12. package/dist/core/utils/create-form.d.ts +4 -3
  13. package/dist/core/utils/error-handler.d.ts +4 -1
  14. package/dist/core/utils/form-submitter.d.ts +2 -3
  15. package/dist/core/utils/type-guards.d.ts +3 -3
  16. package/dist/core/validation/validators/date-utils.d.ts +5 -1
  17. package/dist/core/validation/validators/integer.d.ts +1 -1
  18. package/dist/core/validation/validators/is-number.d.ts +1 -1
  19. package/dist/core/validation/validators/max.d.ts +1 -1
  20. package/dist/core/validation/validators/min.d.ts +1 -1
  21. package/dist/core/validation/validators/multiple-of.d.ts +1 -1
  22. package/dist/core/validation/validators/non-negative.d.ts +1 -1
  23. package/dist/core/validation/validators/non-zero.d.ts +1 -1
  24. package/dist/{date-utils-xUWFslTj.js → date-utils-dTT_x_Be.js} +12 -10
  25. package/dist/hooks/types.d.ts +1 -1
  26. package/dist/hooks/useArrayLength.d.ts +1 -2
  27. package/dist/hooks/useFormControl.d.ts +2 -2
  28. package/dist/index.js +514 -514
  29. package/dist/signals.d.ts +13 -0
  30. package/dist/signals.js +9 -0
  31. package/dist/validators/future-date.js +1 -1
  32. package/dist/validators/is-date.js +1 -1
  33. package/dist/validators/max-age.js +1 -1
  34. package/dist/validators/max-date.js +1 -1
  35. package/dist/validators/min-age.js +1 -1
  36. package/dist/validators/min-date.js +1 -1
  37. package/dist/validators/multiple-of.js +11 -7
  38. package/dist/validators/past-date.js +1 -1
  39. package/llms.txt +586 -164
  40. package/package.json +7 -3
@@ -1,4 +1,4 @@
1
- function r(t) {
1
+ function i(t) {
2
2
  if (t == null || t === "")
3
3
  return null;
4
4
  if (t instanceof Date)
@@ -9,21 +9,23 @@ function r(t) {
9
9
  }
10
10
  return null;
11
11
  }
12
- function e() {
12
+ function s() {
13
13
  const t = /* @__PURE__ */ new Date();
14
14
  return t.setHours(0, 0, 0, 0), t;
15
15
  }
16
- function o(t) {
16
+ function a(t) {
17
17
  const n = new Date(t);
18
18
  return n.setHours(0, 0, 0, 0), n;
19
19
  }
20
- function i(t) {
21
- const n = e();
22
- return Math.floor((n.getTime() - t.getTime()) / (365.25 * 24 * 60 * 60 * 1e3));
20
+ function c(t) {
21
+ const n = s(), e = a(t);
22
+ let r = n.getFullYear() - e.getFullYear();
23
+ const o = n.getMonth() - e.getMonth();
24
+ return (o < 0 || o === 0 && n.getDate() < e.getDate()) && (r -= 1), r;
23
25
  }
24
26
  export {
25
- i as c,
26
- e as g,
27
- o as n,
28
- r as p
27
+ c,
28
+ s as g,
29
+ a as n,
30
+ i as p
29
31
  };
@@ -190,7 +190,7 @@ export interface FieldControlState<T> {
190
190
  * );
191
191
  * ```
192
192
  */
193
- componentProps: Record<string, any>;
193
+ componentProps: Record<string, unknown>;
194
194
  }
195
195
  /**
196
196
  * Состояние массива формы, возвращаемое хуком {@link useFormControl} для {@link ArrayNode}.
@@ -1,5 +1,4 @@
1
1
  import { ArrayNode } from '../core/nodes/array-node';
2
- import { FormFields } from '../core/types';
3
2
  /**
4
3
  * React-хук для подписки только на длину массива.
5
4
  *
@@ -28,4 +27,4 @@ import { FormFields } from '../core/types';
28
27
  *
29
28
  * @group React Hooks
30
29
  */
31
- export declare function useArrayLength<T extends FormFields>(control: ArrayNode<T>): number;
30
+ export declare function useArrayLength<T extends object>(control: ArrayNode<T>): number;
@@ -1,6 +1,6 @@
1
1
  import { FieldNode } from '../core/nodes/field-node';
2
2
  import { ArrayNode } from '../core/nodes/array-node';
3
- import { FormValue, FormFields } from '../core/types';
3
+ import { FormValue } from '../core/types';
4
4
  import { FieldControlState, ArrayControlState } from './types';
5
5
  /**
6
6
  * React-хук для подписки на состояние {@link ArrayNode}.
@@ -11,7 +11,7 @@ import { FieldControlState, ArrayControlState } from './types';
11
11
  *
12
12
  * @group React Hooks
13
13
  */
14
- export declare function useFormControl<T extends FormFields>(control: ArrayNode<T> | undefined): ArrayControlState<T>;
14
+ export declare function useFormControl<T extends object>(control: ArrayNode<T> | undefined): ArrayControlState<T>;
15
15
  /**
16
16
  * React-хук для подписки на состояние {@link FieldNode}.
17
17
  *