@reformer/core 8.0.0 → 9.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.
- package/dist/core/factories/node-factory.d.ts +5 -4
- package/dist/core/model/types.d.ts +41 -12
- package/dist/core/model/validate-model.d.ts +8 -4
- package/dist/core/nodes/field-node.d.ts +2 -2
- package/dist/core/nodes/group-node.d.ts +7 -1
- package/dist/core/nodes/model-array-node.d.ts +5 -0
- package/dist/core/types/deep-schema.d.ts +16 -4
- package/dist/core/types/form-proxy.d.ts +1 -1
- package/dist/core/types/index.d.ts +4 -10
- package/dist/core/types/schema-node.d.ts +79 -0
- package/dist/core/types/validation-schema.d.ts +22 -11
- package/dist/core/utils/create-form.d.ts +4 -3
- package/dist/core/utils/error-handler.d.ts +4 -1
- package/dist/core/utils/form-submitter.d.ts +2 -3
- package/dist/core/utils/type-guards.d.ts +3 -3
- package/dist/core/validation/validators/date-utils.d.ts +5 -1
- package/dist/core/validation/validators/integer.d.ts +1 -1
- package/dist/core/validation/validators/is-number.d.ts +1 -1
- package/dist/core/validation/validators/max.d.ts +1 -1
- package/dist/core/validation/validators/min.d.ts +1 -1
- package/dist/core/validation/validators/multiple-of.d.ts +1 -1
- package/dist/core/validation/validators/non-negative.d.ts +1 -1
- package/dist/core/validation/validators/non-zero.d.ts +1 -1
- package/dist/{date-utils-xUWFslTj.js → date-utils-dTT_x_Be.js} +12 -10
- package/dist/hooks/types.d.ts +1 -1
- package/dist/hooks/useArrayLength.d.ts +1 -2
- package/dist/hooks/useFormControl.d.ts +2 -2
- package/dist/index.js +514 -514
- package/dist/signals.d.ts +13 -0
- package/dist/signals.js +9 -0
- package/dist/validators/future-date.js +1 -1
- package/dist/validators/is-date.js +1 -1
- package/dist/validators/max-age.js +1 -1
- package/dist/validators/max-date.js +1 -1
- package/dist/validators/min-age.js +1 -1
- package/dist/validators/min-date.js +1 -1
- package/dist/validators/multiple-of.js +11 -7
- package/dist/validators/past-date.js +1 -1
- package/llms.txt +568 -155
- package/package.json +6 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
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
|
|
12
|
+
function s() {
|
|
13
13
|
const t = /* @__PURE__ */ new Date();
|
|
14
14
|
return t.setHours(0, 0, 0, 0), t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
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
|
|
21
|
-
const n = e();
|
|
22
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
c,
|
|
28
|
+
s as g,
|
|
29
|
+
a as n,
|
|
30
|
+
i as p
|
|
29
31
|
};
|
package/dist/hooks/types.d.ts
CHANGED
|
@@ -190,7 +190,7 @@ export interface FieldControlState<T> {
|
|
|
190
190
|
* );
|
|
191
191
|
* ```
|
|
192
192
|
*/
|
|
193
|
-
componentProps: Record<string,
|
|
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
|
|
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
|
|
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
|
|
14
|
+
export declare function useFormControl<T extends object>(control: ArrayNode<T> | undefined): ArrayControlState<T>;
|
|
15
15
|
/**
|
|
16
16
|
* React-хук для подписки на состояние {@link FieldNode}.
|
|
17
17
|
*
|