@tmagic/form 1.3.0 → 1.3.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/dist/style.css +18 -0
- package/dist/tmagic-form.js +304 -159
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +334 -188
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +6 -6
- package/src/FormBox.vue +106 -0
- package/src/index.ts +1 -0
- package/src/schema.ts +9 -9
- package/src/theme/form-box.scss +18 -0
- package/src/theme/index.scss +1 -0
- package/src/utils/form.ts +1 -1
- package/types/FormBox.vue.d.ts +363 -0
- package/types/FormDialog.vue.d.ts +93 -60
- package/types/FormDrawer.vue.d.ts +93 -60
- package/types/index.d.ts +1 -0
- package/types/schema.d.ts +9 -9
- package/types/utils/form.d.ts +1 -1
|
@@ -21,70 +21,103 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
21
21
|
form: import("vue").Ref<({
|
|
22
22
|
$: import("vue").ComponentInternalInstance;
|
|
23
23
|
$data: {};
|
|
24
|
-
$props: {
|
|
25
|
-
config
|
|
26
|
-
initValues
|
|
27
|
-
lastValues
|
|
28
|
-
isCompare
|
|
29
|
-
keyProp
|
|
30
|
-
parentValues
|
|
31
|
-
labelWidth
|
|
32
|
-
disabled
|
|
33
|
-
stepActive
|
|
34
|
-
height
|
|
35
|
-
inline
|
|
36
|
-
labelPosition
|
|
24
|
+
$props: Partial<{
|
|
25
|
+
config: FormConfig;
|
|
26
|
+
initValues: Record<string, any>;
|
|
27
|
+
lastValues: Record<string, any>;
|
|
28
|
+
isCompare: boolean;
|
|
29
|
+
keyProp: string;
|
|
30
|
+
parentValues: Record<string, any>;
|
|
31
|
+
labelWidth: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
stepActive: string | number;
|
|
34
|
+
height: string;
|
|
35
|
+
inline: boolean;
|
|
36
|
+
labelPosition: string;
|
|
37
|
+
}> & Omit<{
|
|
38
|
+
readonly config: FormConfig;
|
|
39
|
+
readonly initValues: Record<string, any>;
|
|
40
|
+
readonly lastValues: Record<string, any>;
|
|
41
|
+
readonly isCompare: boolean;
|
|
42
|
+
readonly keyProp: string;
|
|
43
|
+
readonly parentValues: Record<string, any>;
|
|
44
|
+
readonly labelWidth: string;
|
|
45
|
+
readonly disabled: boolean;
|
|
46
|
+
readonly stepActive: string | number;
|
|
47
|
+
readonly height: string;
|
|
48
|
+
readonly inline: boolean;
|
|
49
|
+
readonly labelPosition: string;
|
|
37
50
|
readonly popperClass?: string | undefined;
|
|
38
|
-
key?: string | number | symbol | undefined;
|
|
39
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
40
51
|
readonly size?: "large" | "default" | "small" | undefined;
|
|
41
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
42
|
-
ref_for?: boolean | undefined;
|
|
43
|
-
ref_key?: string | undefined;
|
|
44
|
-
onVnodeBeforeMount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
47
|
-
[key: string]: any;
|
|
48
|
-
}>) => void)[] | undefined;
|
|
49
|
-
onVnodeMounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
50
|
-
[key: string]: any;
|
|
51
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
52
|
-
[key: string]: any;
|
|
53
|
-
}>) => void)[] | undefined;
|
|
54
|
-
onVnodeBeforeUpdate?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
}>) => void)[] | undefined;
|
|
63
|
-
onVnodeUpdated?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
64
|
-
[key: string]: any;
|
|
65
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
68
|
-
[key: string]: any;
|
|
69
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
}>) => void)[] | undefined;
|
|
72
|
-
onVnodeBeforeUnmount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
73
|
-
[key: string]: any;
|
|
74
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
75
|
-
[key: string]: any;
|
|
76
|
-
}>) => void)[] | undefined;
|
|
77
|
-
onVnodeUnmounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
78
|
-
[key: string]: any;
|
|
79
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
}>) => void)[] | undefined;
|
|
82
|
-
class?: unknown;
|
|
83
|
-
style?: unknown;
|
|
84
52
|
readonly extendState?: ((state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
53
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
85
54
|
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
86
55
|
"onField-change"?: ((...args: any[]) => any) | undefined;
|
|
87
|
-
}
|
|
56
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
config: {
|
|
58
|
+
type: import("vue").PropType<FormConfig>;
|
|
59
|
+
required: true;
|
|
60
|
+
default: () => never[];
|
|
61
|
+
};
|
|
62
|
+
popperClass: {
|
|
63
|
+
type: import("vue").PropType<string>;
|
|
64
|
+
};
|
|
65
|
+
initValues: {
|
|
66
|
+
type: import("vue").PropType<Record<string, any>>;
|
|
67
|
+
required: true;
|
|
68
|
+
default: () => {};
|
|
69
|
+
};
|
|
70
|
+
lastValues: {
|
|
71
|
+
type: import("vue").PropType<Record<string, any>>;
|
|
72
|
+
default: () => {};
|
|
73
|
+
};
|
|
74
|
+
isCompare: {
|
|
75
|
+
type: import("vue").PropType<boolean>;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
keyProp: {
|
|
79
|
+
type: import("vue").PropType<string>;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
parentValues: {
|
|
83
|
+
type: import("vue").PropType<Record<string, any>>;
|
|
84
|
+
default: () => {};
|
|
85
|
+
};
|
|
86
|
+
labelWidth: {
|
|
87
|
+
type: import("vue").PropType<string>;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
90
|
+
disabled: {
|
|
91
|
+
type: import("vue").PropType<boolean>;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
94
|
+
stepActive: {
|
|
95
|
+
type: import("vue").PropType<string | number>;
|
|
96
|
+
default: number;
|
|
97
|
+
};
|
|
98
|
+
size: {
|
|
99
|
+
type: import("vue").PropType<"large" | "default" | "small">;
|
|
100
|
+
};
|
|
101
|
+
height: {
|
|
102
|
+
type: import("vue").PropType<string>;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
inline: {
|
|
106
|
+
type: import("vue").PropType<boolean>;
|
|
107
|
+
default: boolean;
|
|
108
|
+
};
|
|
109
|
+
labelPosition: {
|
|
110
|
+
type: import("vue").PropType<string>;
|
|
111
|
+
default: string;
|
|
112
|
+
};
|
|
113
|
+
extendState: {
|
|
114
|
+
type: import("vue").PropType<(state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
115
|
+
};
|
|
116
|
+
}>> & {
|
|
117
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
119
|
+
"onField-change"?: ((...args: any[]) => any) | undefined;
|
|
120
|
+
}, "config" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "labelWidth" | "disabled" | "stepActive" | "height" | "inline" | "labelPosition">;
|
|
88
121
|
$attrs: {
|
|
89
122
|
[x: string]: unknown;
|
|
90
123
|
};
|
|
@@ -282,7 +315,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
282
315
|
save: () => Promise<void>;
|
|
283
316
|
show: () => void;
|
|
284
317
|
hide: () => void;
|
|
285
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "
|
|
318
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "submit" | "error" | "close")[], "change" | "submit" | "error" | "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
286
319
|
config?: FormConfig | undefined;
|
|
287
320
|
values?: Object | undefined;
|
|
288
321
|
parentValues?: Object | undefined;
|
|
@@ -24,70 +24,103 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
24
24
|
form: import("vue").Ref<({
|
|
25
25
|
$: import("vue").ComponentInternalInstance;
|
|
26
26
|
$data: {};
|
|
27
|
-
$props: {
|
|
28
|
-
config
|
|
29
|
-
initValues
|
|
30
|
-
lastValues
|
|
31
|
-
isCompare
|
|
32
|
-
keyProp
|
|
33
|
-
parentValues
|
|
34
|
-
labelWidth
|
|
35
|
-
disabled
|
|
36
|
-
stepActive
|
|
37
|
-
height
|
|
38
|
-
inline
|
|
39
|
-
labelPosition
|
|
27
|
+
$props: Partial<{
|
|
28
|
+
config: FormConfig;
|
|
29
|
+
initValues: Record<string, any>;
|
|
30
|
+
lastValues: Record<string, any>;
|
|
31
|
+
isCompare: boolean;
|
|
32
|
+
keyProp: string;
|
|
33
|
+
parentValues: Record<string, any>;
|
|
34
|
+
labelWidth: string;
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
stepActive: string | number;
|
|
37
|
+
height: string;
|
|
38
|
+
inline: boolean;
|
|
39
|
+
labelPosition: string;
|
|
40
|
+
}> & Omit<{
|
|
41
|
+
readonly config: FormConfig;
|
|
42
|
+
readonly initValues: Record<string, any>;
|
|
43
|
+
readonly lastValues: Record<string, any>;
|
|
44
|
+
readonly isCompare: boolean;
|
|
45
|
+
readonly keyProp: string;
|
|
46
|
+
readonly parentValues: Record<string, any>;
|
|
47
|
+
readonly labelWidth: string;
|
|
48
|
+
readonly disabled: boolean;
|
|
49
|
+
readonly stepActive: string | number;
|
|
50
|
+
readonly height: string;
|
|
51
|
+
readonly inline: boolean;
|
|
52
|
+
readonly labelPosition: string;
|
|
40
53
|
readonly popperClass?: string | undefined;
|
|
41
|
-
key?: string | number | symbol | undefined;
|
|
42
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
43
54
|
readonly size?: "large" | "default" | "small" | undefined;
|
|
44
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
45
|
-
ref_for?: boolean | undefined;
|
|
46
|
-
ref_key?: string | undefined;
|
|
47
|
-
onVnodeBeforeMount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
|
-
[key: string]: any;
|
|
49
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
50
|
-
[key: string]: any;
|
|
51
|
-
}>) => void)[] | undefined;
|
|
52
|
-
onVnodeMounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
-
[key: string]: any;
|
|
54
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
}>) => void)[] | undefined;
|
|
57
|
-
onVnodeBeforeUpdate?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
60
|
-
[key: string]: any;
|
|
61
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
64
|
-
[key: string]: any;
|
|
65
|
-
}>) => void)[] | undefined;
|
|
66
|
-
onVnodeUpdated?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
69
|
-
[key: string]: any;
|
|
70
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
73
|
-
[key: string]: any;
|
|
74
|
-
}>) => void)[] | undefined;
|
|
75
|
-
onVnodeBeforeUnmount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
76
|
-
[key: string]: any;
|
|
77
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
78
|
-
[key: string]: any;
|
|
79
|
-
}>) => void)[] | undefined;
|
|
80
|
-
onVnodeUnmounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
83
|
-
[key: string]: any;
|
|
84
|
-
}>) => void)[] | undefined;
|
|
85
|
-
class?: unknown;
|
|
86
|
-
style?: unknown;
|
|
87
55
|
readonly extendState?: ((state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
56
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
88
57
|
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
89
58
|
"onField-change"?: ((...args: any[]) => any) | undefined;
|
|
90
|
-
}
|
|
59
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
60
|
+
config: {
|
|
61
|
+
type: import("vue").PropType<FormConfig>;
|
|
62
|
+
required: true;
|
|
63
|
+
default: () => never[];
|
|
64
|
+
};
|
|
65
|
+
popperClass: {
|
|
66
|
+
type: import("vue").PropType<string>;
|
|
67
|
+
};
|
|
68
|
+
initValues: {
|
|
69
|
+
type: import("vue").PropType<Record<string, any>>;
|
|
70
|
+
required: true;
|
|
71
|
+
default: () => {};
|
|
72
|
+
};
|
|
73
|
+
lastValues: {
|
|
74
|
+
type: import("vue").PropType<Record<string, any>>;
|
|
75
|
+
default: () => {};
|
|
76
|
+
};
|
|
77
|
+
isCompare: {
|
|
78
|
+
type: import("vue").PropType<boolean>;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
81
|
+
keyProp: {
|
|
82
|
+
type: import("vue").PropType<string>;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
parentValues: {
|
|
86
|
+
type: import("vue").PropType<Record<string, any>>;
|
|
87
|
+
default: () => {};
|
|
88
|
+
};
|
|
89
|
+
labelWidth: {
|
|
90
|
+
type: import("vue").PropType<string>;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
disabled: {
|
|
94
|
+
type: import("vue").PropType<boolean>;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
97
|
+
stepActive: {
|
|
98
|
+
type: import("vue").PropType<string | number>;
|
|
99
|
+
default: number;
|
|
100
|
+
};
|
|
101
|
+
size: {
|
|
102
|
+
type: import("vue").PropType<"large" | "default" | "small">;
|
|
103
|
+
};
|
|
104
|
+
height: {
|
|
105
|
+
type: import("vue").PropType<string>;
|
|
106
|
+
default: string;
|
|
107
|
+
};
|
|
108
|
+
inline: {
|
|
109
|
+
type: import("vue").PropType<boolean>;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
labelPosition: {
|
|
113
|
+
type: import("vue").PropType<string>;
|
|
114
|
+
default: string;
|
|
115
|
+
};
|
|
116
|
+
extendState: {
|
|
117
|
+
type: import("vue").PropType<(state: import("./schema").FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
118
|
+
};
|
|
119
|
+
}>> & {
|
|
120
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
121
|
+
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
122
|
+
"onField-change"?: ((...args: any[]) => any) | undefined;
|
|
123
|
+
}, "config" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "labelWidth" | "disabled" | "stepActive" | "height" | "inline" | "labelPosition">;
|
|
91
124
|
$attrs: {
|
|
92
125
|
[x: string]: unknown;
|
|
93
126
|
};
|
|
@@ -284,7 +317,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
284
317
|
show: () => void;
|
|
285
318
|
hide: () => void;
|
|
286
319
|
handleClose: () => void;
|
|
287
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "
|
|
320
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "submit" | "error" | "close" | "closed" | "open" | "opened")[], "change" | "submit" | "error" | "close" | "closed" | "open" | "opened", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
288
321
|
config?: FormConfig | undefined;
|
|
289
322
|
values?: Object | undefined;
|
|
290
323
|
parentValues?: Object | undefined;
|
package/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './utils/useAddField';
|
|
|
6
6
|
export { default as MForm } from './Form.vue';
|
|
7
7
|
export { default as MFormDialog } from './FormDialog.vue';
|
|
8
8
|
export { default as MFormDrawer } from './FormDrawer.vue';
|
|
9
|
+
export { default as MFormBox } from './FormBox.vue';
|
|
9
10
|
export { default as MContainer } from './containers/Container.vue';
|
|
10
11
|
export { default as MFieldset } from './containers/Fieldset.vue';
|
|
11
12
|
export { default as MPanel } from './containers/Panel.vue';
|
package/types/schema.d.ts
CHANGED
|
@@ -50,19 +50,19 @@ export interface FormItem {
|
|
|
50
50
|
/** 字段名 */
|
|
51
51
|
name?: string | number;
|
|
52
52
|
/** 额外的提示信息,和 help 类似,当提示文案同时出现时,可以使用这个。 */
|
|
53
|
-
extra?: string | FilterFunction
|
|
53
|
+
extra?: string | FilterFunction<string>;
|
|
54
54
|
/** 配置提示信息 */
|
|
55
|
-
tooltip?: string | FilterFunction
|
|
55
|
+
tooltip?: string | FilterFunction<string>;
|
|
56
56
|
/** 是否置灰 */
|
|
57
57
|
disabled?: boolean | FilterFunction;
|
|
58
58
|
/** 使用表单中的值作为key,例如配置了text,则使用model.text作为key */
|
|
59
59
|
key?: string;
|
|
60
60
|
/** 是否显示 */
|
|
61
|
-
display?: boolean | 'expand' | FilterFunction
|
|
61
|
+
display?: boolean | 'expand' | FilterFunction<boolean | 'expand'>;
|
|
62
62
|
/** 值发生改变时调用的方法 */
|
|
63
63
|
onChange?: OnChangeHandler;
|
|
64
64
|
/** label 标签的文本 */
|
|
65
|
-
text?: string | FilterFunction
|
|
65
|
+
text?: string | FilterFunction<string>;
|
|
66
66
|
/** 右侧感叹号 */
|
|
67
67
|
tip?: string;
|
|
68
68
|
filter?: 'number' | OnChangeHandler;
|
|
@@ -120,14 +120,14 @@ export interface Input {
|
|
|
120
120
|
export type TypeFunction = (mForm: FormState | undefined, data: {
|
|
121
121
|
model: Record<any, any>;
|
|
122
122
|
}) => string;
|
|
123
|
-
export type FilterFunction = (mForm: FormState | undefined, data: {
|
|
123
|
+
export type FilterFunction<T = boolean> = (mForm: FormState | undefined, data: {
|
|
124
124
|
model: Record<any, any>;
|
|
125
125
|
values: Record<any, any>;
|
|
126
126
|
parent?: Record<any, any>;
|
|
127
127
|
formValue: Record<any, any>;
|
|
128
128
|
prop: string;
|
|
129
129
|
config: any;
|
|
130
|
-
}) =>
|
|
130
|
+
}) => T;
|
|
131
131
|
type OnChangeHandler = (mForm: FormState | undefined, value: any, data: {
|
|
132
132
|
model: Record<any, any>;
|
|
133
133
|
values: Record<any, any>;
|
|
@@ -550,7 +550,7 @@ export interface TableConfig extends FormItem {
|
|
|
550
550
|
/** 是否显示全屏按钮 */
|
|
551
551
|
enableFullscreen?: boolean;
|
|
552
552
|
fixed?: boolean;
|
|
553
|
-
itemExtra?: string | FilterFunction
|
|
553
|
+
itemExtra?: string | FilterFunction<string>;
|
|
554
554
|
rowKey?: string;
|
|
555
555
|
}
|
|
556
556
|
export interface GroupListConfig extends FormItem {
|
|
@@ -562,8 +562,8 @@ export interface GroupListConfig extends FormItem {
|
|
|
562
562
|
tableItems?: FormConfig;
|
|
563
563
|
titleKey?: string;
|
|
564
564
|
titlePrefix?: string;
|
|
565
|
-
title?: string | FilterFunction
|
|
566
|
-
itemExtra?: string | FilterFunction
|
|
565
|
+
title?: string | FilterFunction<string>;
|
|
566
|
+
itemExtra?: string | FilterFunction<string>;
|
|
567
567
|
expandAll?: boolean;
|
|
568
568
|
addable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
|
|
569
569
|
defaultAdd?: (mForm: FormState | undefined, data: any) => any;
|
package/types/utils/form.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormConfig, FormState, FormValue, Rule, TabPaneConfig } from '../schema';
|
|
2
2
|
export declare const createValues: (mForm: FormState | undefined, config?: FormConfig | TabPaneConfig[], initValue?: FormValue, value?: FormValue) => FormValue;
|
|
3
|
-
export declare const filterFunction: (mForm: FormState | undefined, config:
|
|
3
|
+
export declare const filterFunction: <T = any>(mForm: FormState | undefined, config: T, props: any) => any;
|
|
4
4
|
export declare const display: (mForm: FormState | undefined, config: any, props: any) => any;
|
|
5
5
|
export declare const getRules: (mForm: FormState | undefined, rules: Rule | Rule[] | undefined, props: any) => Rule[];
|
|
6
6
|
export declare const initValue: (mForm: FormState | undefined, { initValues, config }: {
|