@tmagic/form 1.3.0-alpha.1 → 1.3.0-alpha.11
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/tmagic-form.js +913 -917
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +911 -915
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +10 -11
- package/src/Form.vue +14 -2
- package/src/FormDialog.vue +5 -1
- package/src/containers/Col.vue +5 -1
- package/src/containers/Container.vue +5 -1
- package/src/containers/Fieldset.vue +5 -1
- package/src/containers/GroupList.vue +6 -2
- package/src/containers/GroupListItem.vue +7 -7
- package/src/containers/Panel.vue +5 -1
- package/src/containers/Row.vue +5 -1
- package/src/containers/Step.vue +5 -1
- package/src/containers/Table.vue +6 -2
- package/src/containers/Tabs.vue +14 -8
- package/src/fields/Cascader.vue +5 -1
- package/src/fields/Checkbox.vue +5 -1
- package/src/fields/CheckboxGroup.vue +6 -2
- package/src/fields/ColorPicker.vue +5 -1
- package/src/fields/Date.vue +5 -1
- package/src/fields/DateTime.vue +5 -1
- package/src/fields/Daterange.vue +5 -1
- package/src/fields/Display.vue +5 -1
- package/src/fields/DynamicField.vue +5 -1
- package/src/fields/Hidden.vue +5 -1
- package/src/fields/Link.vue +5 -1
- package/src/fields/Number.vue +5 -1
- package/src/fields/RadioGroup.vue +5 -1
- package/src/fields/Select.vue +26 -18
- package/src/fields/SelectOptionGroups.vue +7 -3
- package/src/fields/SelectOptions.vue +5 -1
- package/src/fields/Switch.vue +5 -1
- package/src/fields/Text.vue +5 -1
- package/src/fields/Textarea.vue +5 -1
- package/src/fields/Time.vue +5 -1
- package/src/index.ts +39 -37
- package/src/schema.ts +4 -3
- package/types/Form.vue.d.ts +9 -4
- package/types/FormDialog.vue.d.ts +83 -121
- package/types/containers/Col.vue.d.ts +1 -1
- package/types/containers/Container.vue.d.ts +6 -3
- package/types/containers/Fieldset.vue.d.ts +6 -3
- package/types/containers/GroupList.vue.d.ts +1 -1
- package/types/containers/GroupListItem.vue.d.ts +1 -1
- package/types/containers/Panel.vue.d.ts +3 -3
- package/types/containers/Row.vue.d.ts +1 -1
- package/types/containers/Step.vue.d.ts +6 -3
- package/types/containers/Table.vue.d.ts +9 -6
- package/types/containers/Tabs.vue.d.ts +6 -3
- package/types/fields/Cascader.vue.d.ts +1 -1
- package/types/fields/Checkbox.vue.d.ts +1 -1
- package/types/fields/CheckboxGroup.vue.d.ts +1 -1
- package/types/fields/ColorPicker.vue.d.ts +1 -1
- package/types/fields/Date.vue.d.ts +1 -1
- package/types/fields/DateTime.vue.d.ts +1 -1
- package/types/fields/Daterange.vue.d.ts +1 -1
- package/types/fields/Display.vue.d.ts +2 -2
- package/types/fields/DynamicField.vue.d.ts +1 -10
- package/types/fields/Hidden.vue.d.ts +2 -2
- package/types/fields/Link.vue.d.ts +1 -1
- package/types/fields/Number.vue.d.ts +1 -1
- package/types/fields/RadioGroup.vue.d.ts +1 -1
- package/types/fields/Select.vue.d.ts +1 -1
- package/types/fields/SelectOptionGroups.vue.d.ts +2 -2
- package/types/fields/SelectOptions.vue.d.ts +2 -2
- package/types/fields/Switch.vue.d.ts +1 -1
- package/types/fields/Text.vue.d.ts +1 -1
- package/types/fields/Textarea.vue.d.ts +1 -1
- package/types/fields/Time.vue.d.ts +1 -1
- package/types/index.d.ts +4 -1
- package/types/schema.d.ts +4 -3
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 动态表单,目前只支持input类型字段
|
|
3
|
-
* inputType: 'dynamic-field',
|
|
4
|
-
* text: '动态表单',
|
|
5
|
-
* dynamicKey: 'keyname', 如果model[dynamicKey]变化,表单字段变化
|
|
6
|
-
* returnFields(config,model,request): 函数,返回字段列表[{name:'',label:'',defaultValue:''}]
|
|
7
|
-
*
|
|
8
|
-
* 特别注意!!!field的上一级必须extensible: true,才能保存未声明的字段
|
|
9
|
-
*/
|
|
10
1
|
import { DynamicFieldConfig } from '../schema';
|
|
11
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
12
3
|
config: DynamicFieldConfig;
|
|
@@ -30,7 +21,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
30
21
|
lastValues?: Record<string, any> | undefined;
|
|
31
22
|
}>>> & {
|
|
32
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
33
|
-
}, {}>;
|
|
24
|
+
}, {}, {}>;
|
|
34
25
|
export default _default;
|
|
35
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
36
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
7
7
|
name: string;
|
|
8
8
|
prop: string;
|
|
9
9
|
lastValues?: Record<string, any> | undefined;
|
|
10
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
10
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
11
11
|
config: HiddenConfig;
|
|
12
12
|
model: any;
|
|
13
13
|
initValues?: any;
|
|
@@ -15,7 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
15
15
|
name: string;
|
|
16
16
|
prop: string;
|
|
17
17
|
lastValues?: Record<string, any> | undefined;
|
|
18
|
-
}>>>, {}>;
|
|
18
|
+
}>>>, {}, {}>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
21
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
21
21
|
lastValues?: Record<string, any> | undefined;
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}, {}>;
|
|
24
|
+
}, {}, {}>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
24
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
25
|
-
}, {}>;
|
|
25
|
+
}, {}, {}>;
|
|
26
26
|
export default _default;
|
|
27
27
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
28
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
21
21
|
lastValues?: Record<string, any> | undefined;
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}, {}>;
|
|
24
|
+
}, {}, {}>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
21
21
|
lastValues?: Record<string, any> | undefined;
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}, {}>;
|
|
24
|
+
}, {}, {}>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SelectGroupOption } from '../schema';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
options: SelectGroupOption[];
|
|
4
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
options: SelectGroupOption[];
|
|
6
|
-
}>>>, {}>;
|
|
6
|
+
}>>>, {}, {}>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
9
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -2,10 +2,10 @@ import { SelectOption } from '../schema';
|
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
options: SelectOption[];
|
|
4
4
|
valueKey?: string | undefined;
|
|
5
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
6
|
options: SelectOption[];
|
|
7
7
|
valueKey?: string | undefined;
|
|
8
|
-
}>>>, {}>;
|
|
8
|
+
}>>>, {}, {}>;
|
|
9
9
|
export default _default;
|
|
10
10
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
11
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
21
21
|
lastValues?: Record<string, any> | undefined;
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}, {}>;
|
|
24
|
+
}, {}, {}>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
24
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
25
|
-
}, {}>;
|
|
25
|
+
}, {}, {}>;
|
|
26
26
|
export default _default;
|
|
27
27
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
28
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
24
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
25
|
-
}, {}>;
|
|
25
|
+
}, {}, {}>;
|
|
26
26
|
export default _default;
|
|
27
27
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
28
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
21
21
|
lastValues?: Record<string, any> | undefined;
|
|
22
22
|
}>>> & {
|
|
23
23
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}, {}>;
|
|
24
|
+
}, {}, {}>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
27
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
package/types/index.d.ts
CHANGED
|
@@ -30,7 +30,10 @@ export { default as MLink } from './fields/Link.vue';
|
|
|
30
30
|
export { default as MSelect } from './fields/Select.vue';
|
|
31
31
|
export { default as MCascader } from './fields/Cascader.vue';
|
|
32
32
|
export { default as MDynamicField } from './fields/DynamicField.vue';
|
|
33
|
+
export interface InstallOptions {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
33
36
|
declare const _default: {
|
|
34
|
-
install
|
|
37
|
+
install(app: App, opt?: InstallOptions): void;
|
|
35
38
|
};
|
|
36
39
|
export default _default;
|
package/types/schema.d.ts
CHANGED
|
@@ -347,9 +347,9 @@ export interface SelectConfig extends FormItem, Input {
|
|
|
347
347
|
allowCreate?: boolean;
|
|
348
348
|
filterable?: boolean;
|
|
349
349
|
group?: boolean;
|
|
350
|
-
options
|
|
351
|
-
remote
|
|
352
|
-
option
|
|
350
|
+
options?: SelectConfigOption[] | SelectConfigGroupOption[] | SelectOptionFunction;
|
|
351
|
+
remote?: true;
|
|
352
|
+
option?: {
|
|
353
353
|
url: string | ((mForm: FormState | undefined, data: {
|
|
354
354
|
model: any;
|
|
355
355
|
formValue: any;
|
|
@@ -546,6 +546,7 @@ export interface GroupListConfig extends FormItem {
|
|
|
546
546
|
tableItems?: FormConfig;
|
|
547
547
|
titleKey?: string;
|
|
548
548
|
itemExtra?: string | FilterFunction;
|
|
549
|
+
expandAll?: boolean;
|
|
549
550
|
addable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
|
|
550
551
|
defaultAdd?: (mForm: FormState | undefined, data: any) => any;
|
|
551
552
|
delete?: (model: any, index: number | string | symbol, values: any) => boolean | boolean;
|