@douyinfe/semi-foundation 2.14.0-beta.1 → 2.14.0-beta.2
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/form/interface.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
1
2
|
/* eslint-disable max-len */
|
|
2
3
|
import { DefaultAdapter } from '../base/foundation';
|
|
3
4
|
import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
|
|
@@ -31,7 +32,9 @@ export interface FormState<T extends Record<string, any> = any> {
|
|
|
31
32
|
export interface setValuesConfig {
|
|
32
33
|
isOverride: boolean;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
|
|
36
|
+
// use object replace Record<string, any>, fix issue 933
|
|
37
|
+
export interface BaseFormApi<T extends object = any> {
|
|
35
38
|
/** get value of field */
|
|
36
39
|
getValue: <K extends keyof T>(field?: K) => T[K];
|
|
37
40
|
/** set value of field */
|
|
@@ -47,7 +50,7 @@ export interface BaseFormApi<T extends Record<string, unknown> = any> {
|
|
|
47
50
|
/** judge field exist */
|
|
48
51
|
getFieldExist: <K extends keyof T>(field: K) => boolean;
|
|
49
52
|
/** get formState of form */
|
|
50
|
-
getFormState: () => FormState<T extends
|
|
53
|
+
getFormState: () => FormState<T extends object ? T : object>;
|
|
51
54
|
/** submit form manual */
|
|
52
55
|
submitForm: () => void;
|
|
53
56
|
/** reset form manual */
|
|
@@ -29,7 +29,7 @@ export interface FormState<T extends Record<string, any> = any> {
|
|
|
29
29
|
export interface setValuesConfig {
|
|
30
30
|
isOverride: boolean;
|
|
31
31
|
}
|
|
32
|
-
export interface BaseFormApi<T extends
|
|
32
|
+
export interface BaseFormApi<T extends object = any> {
|
|
33
33
|
/** get value of field */
|
|
34
34
|
getValue: <K extends keyof T>(field?: K) => T[K];
|
|
35
35
|
/** set value of field */
|
|
@@ -45,7 +45,7 @@ export interface BaseFormApi<T extends Record<string, unknown> = any> {
|
|
|
45
45
|
/** judge field exist */
|
|
46
46
|
getFieldExist: <K extends keyof T>(field: K) => boolean;
|
|
47
47
|
/** get formState of form */
|
|
48
|
-
getFormState: () => FormState<T extends
|
|
48
|
+
getFormState: () => FormState<T extends object ? T : object>;
|
|
49
49
|
/** submit form manual */
|
|
50
50
|
submitForm: () => void;
|
|
51
51
|
/** reset form manual */
|
|
@@ -29,7 +29,7 @@ export interface FormState<T extends Record<string, any> = any> {
|
|
|
29
29
|
export interface setValuesConfig {
|
|
30
30
|
isOverride: boolean;
|
|
31
31
|
}
|
|
32
|
-
export interface BaseFormApi<T extends
|
|
32
|
+
export interface BaseFormApi<T extends object = any> {
|
|
33
33
|
/** get value of field */
|
|
34
34
|
getValue: <K extends keyof T>(field?: K) => T[K];
|
|
35
35
|
/** set value of field */
|
|
@@ -45,7 +45,7 @@ export interface BaseFormApi<T extends Record<string, unknown> = any> {
|
|
|
45
45
|
/** judge field exist */
|
|
46
46
|
getFieldExist: <K extends keyof T>(field: K) => boolean;
|
|
47
47
|
/** get formState of form */
|
|
48
|
-
getFormState: () => FormState<T extends
|
|
48
|
+
getFormState: () => FormState<T extends object ? T : object>;
|
|
49
49
|
/** submit form manual */
|
|
50
50
|
submitForm: () => void;
|
|
51
51
|
/** reset form manual */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.14.0-beta.
|
|
3
|
+
"version": "2.14.0-beta.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"*.scss",
|
|
25
25
|
"*.css"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "b95b9eb9d6ded3aac3dc53afc48534d4e748a2e6",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
30
30
|
"@babel/plugin-transform-runtime": "^7.15.8",
|