@maxtan/ez-ui 0.12.1 → 0.14.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.
Files changed (36) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +1074 -693
  4. package/dist/types/components/checkbox/index.d.ts +24 -3
  5. package/dist/types/components/checkbox/src/checkbox.d.ts +4 -5
  6. package/dist/types/components/checkbox/src/checkbox.vue.d.ts +12 -1
  7. package/dist/types/components/dialog/index.d.ts +0 -15
  8. package/dist/types/components/dialog/src/dialog.d.ts +1 -5
  9. package/dist/types/components/dialog/src/dialog.vue.d.ts +0 -5
  10. package/dist/types/components/dynamic-form/index.d.ts +245 -0
  11. package/dist/types/components/dynamic-form/src/dynamic-form.d.ts +128 -0
  12. package/dist/types/components/dynamic-form/src/dynamic-form.vue.d.ts +398 -0
  13. package/dist/types/components/fast-table/index.d.ts +8 -9
  14. package/dist/types/components/fast-table/src/column-config.vue.d.ts +1 -1
  15. package/dist/types/components/fast-table/src/fast-table.vue.d.ts +4 -4
  16. package/dist/types/components/icon/src/icon.d.ts +0 -1
  17. package/dist/types/components/image-upload/index.d.ts +257 -352
  18. package/dist/types/components/image-upload/src/image-upload.vue.d.ts +253 -348
  19. package/dist/types/components/index.d.ts +1 -0
  20. package/dist/types/components/pagination/index.d.ts +37 -21
  21. package/dist/types/components/pagination/src/pagination.d.ts +0 -10
  22. package/dist/types/components/pagination/src/pagination.vue.d.ts +15 -8
  23. package/dist/types/components/radio/index.d.ts +24 -3
  24. package/dist/types/components/radio/src/radio.d.ts +2 -5
  25. package/dist/types/components/radio/src/radio.vue.d.ts +11 -1
  26. package/dist/types/components/search-form/index.d.ts +3 -3
  27. package/dist/types/components/search-form/src/search-form.d.ts +1 -1
  28. package/dist/types/components/search-form/src/search-form.vue.d.ts +1 -1
  29. package/dist/types/components/select/index.d.ts +19 -6
  30. package/dist/types/components/select/src/select.d.ts +0 -1
  31. package/dist/types/components/select/src/select.vue.d.ts +9 -2
  32. package/dist/types/components/table/index.d.ts +8 -9
  33. package/dist/types/components/table/src/table.d.ts +4 -5
  34. package/dist/types/components/table/src/table.vue.d.ts +4 -4
  35. package/dist/types/ez-ui/component.d.ts +1257 -583
  36. package/package.json +1 -7
@@ -1,6 +1,14 @@
1
1
  export type * from './src/checkbox';
2
2
  export declare const EzCheckbox: ({
3
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('.').CheckboxProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
4
+ modelValue?: import('element-plus').CheckboxGroupValueType;
5
+ } & import('.').CheckboxProps> & Readonly<{
6
+ onChange?: (value: import('element-plus').CheckboxGroupValueType) => any;
7
+ "onUpdate:modelValue"?: (value: import('element-plus').CheckboxGroupValueType) => any;
8
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ change: (value: import('element-plus').CheckboxGroupValueType) => any;
10
+ "update:modelValue": (value: import('element-plus').CheckboxGroupValueType) => any;
11
+ }, import('vue').PublicProps, {
4
12
  type: import('.').CheckboxType;
5
13
  options: import('.').CheckboxOption[];
6
14
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
@@ -10,14 +18,27 @@ export declare const EzCheckbox: ({
10
18
  C: {};
11
19
  M: {};
12
20
  Defaults: {};
13
- }, Readonly<import('.').CheckboxProps> & Readonly<{}>, {}, {}, {}, {}, {
21
+ }, Readonly<{
22
+ modelValue?: import('element-plus').CheckboxGroupValueType;
23
+ } & import('.').CheckboxProps> & Readonly<{
24
+ onChange?: (value: import('element-plus').CheckboxGroupValueType) => any;
25
+ "onUpdate:modelValue"?: (value: import('element-plus').CheckboxGroupValueType) => any;
26
+ }>, {}, {}, {}, {}, {
14
27
  type: import('.').CheckboxType;
15
28
  options: import('.').CheckboxOption[];
16
29
  }>;
17
30
  __isFragment?: never;
18
31
  __isTeleport?: never;
19
32
  __isSuspense?: never;
20
- } & import('vue').ComponentOptionsBase<Readonly<import('.').CheckboxProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
33
+ } & import('vue').ComponentOptionsBase<Readonly<{
34
+ modelValue?: import('element-plus').CheckboxGroupValueType;
35
+ } & import('.').CheckboxProps> & Readonly<{
36
+ onChange?: (value: import('element-plus').CheckboxGroupValueType) => any;
37
+ "onUpdate:modelValue"?: (value: import('element-plus').CheckboxGroupValueType) => any;
38
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
39
+ change: (value: import('element-plus').CheckboxGroupValueType) => any;
40
+ "update:modelValue": (value: import('element-plus').CheckboxGroupValueType) => any;
41
+ }, string, {
21
42
  type: import('.').CheckboxType;
22
43
  options: import('.').CheckboxOption[];
23
44
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & import('vue').Plugin) & Record<string, any>;
@@ -1,13 +1,12 @@
1
- import { CheckboxProps as ElCheckboxProps } from 'element-plus';
2
- type PickProps = 'trueLabel' | 'falseLabel' | 'disabled';
3
- type InheritCheckboxProps = Pick<ElCheckboxProps, PickProps>;
4
- export interface CheckboxOption extends Partial<InheritCheckboxProps> {
1
+ export interface CheckboxOption {
5
2
  value: string | number | boolean | Record<string, unknown>;
6
3
  label: string;
4
+ disabled?: boolean;
5
+ trueLabel?: string | number;
6
+ falseLabel?: string | number;
7
7
  }
8
8
  export type CheckboxType = 'default' | 'button' | 'border';
9
9
  export interface CheckboxProps {
10
10
  type?: CheckboxType;
11
11
  options: CheckboxOption[];
12
12
  }
13
- export {};
@@ -1,5 +1,16 @@
1
1
  import { CheckboxProps } from './checkbox';
2
- declare const _default: import('vue').DefineComponent<CheckboxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CheckboxProps> & Readonly<{}>, {
2
+ import { CheckboxGroupValueType } from 'element-plus';
3
+ type __VLS_Props = CheckboxProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: CheckboxGroupValueType;
6
+ } & __VLS_Props;
7
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ change: (value: CheckboxGroupValueType) => any;
9
+ "update:modelValue": (value: CheckboxGroupValueType) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ onChange?: (value: CheckboxGroupValueType) => any;
12
+ "onUpdate:modelValue"?: (value: CheckboxGroupValueType) => any;
13
+ }>, {
3
14
  type: import('./checkbox').CheckboxType;
4
15
  options: import('./checkbox').CheckboxOption[];
5
16
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -12,11 +12,6 @@ export declare const EzDialog: ({
12
12
  }, import('vue').PublicProps, {
13
13
  loading: boolean;
14
14
  title: string;
15
- readonly width: string | number;
16
- readonly appendToBody: boolean;
17
- readonly destroyOnClose: boolean;
18
- readonly closeOnPressEscape: boolean;
19
- readonly closeOnClickModal: boolean;
20
15
  cancelText: string;
21
16
  confirmText: string;
22
17
  }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
@@ -35,11 +30,6 @@ export declare const EzDialog: ({
35
30
  }>, {}, {}, {}, {}, {
36
31
  loading: boolean;
37
32
  title: string;
38
- readonly width: string | number;
39
- readonly appendToBody: boolean;
40
- readonly destroyOnClose: boolean;
41
- readonly closeOnPressEscape: boolean;
42
- readonly closeOnClickModal: boolean;
43
33
  cancelText: string;
44
34
  confirmText: string;
45
35
  }>;
@@ -59,11 +49,6 @@ export declare const EzDialog: ({
59
49
  }, string, {
60
50
  loading: boolean;
61
51
  title: string;
62
- readonly width: string | number;
63
- readonly appendToBody: boolean;
64
- readonly destroyOnClose: boolean;
65
- readonly closeOnPressEscape: boolean;
66
- readonly closeOnClickModal: boolean;
67
52
  cancelText: string;
68
53
  confirmText: string;
69
54
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
@@ -1,8 +1,5 @@
1
- import { DialogProps as ElDialogProps } from 'element-plus';
2
1
  import { VNodeChild } from 'vue';
3
- type PickProps = 'width' | 'appendToBody' | 'destroyOnClose' | 'closeOnPressEscape' | 'closeOnClickModal';
4
- type InheritDialogProps = Pick<ElDialogProps, PickProps>;
5
- export interface DialogProps extends Partial<InheritDialogProps> {
2
+ export interface DialogProps {
6
3
  title?: string;
7
4
  loading?: boolean;
8
5
  cancelText?: string;
@@ -18,4 +15,3 @@ export declare enum DialogDefaultText {
18
15
  CANCEL = "\u53D6\u6D88",
19
16
  CONFIRM = "\u786E\u5B9A"
20
17
  }
21
- export {};
@@ -21,11 +21,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
21
21
  }>, {
22
22
  loading: boolean;
23
23
  title: string;
24
- readonly width: string | number;
25
- readonly appendToBody: boolean;
26
- readonly destroyOnClose: boolean;
27
- readonly closeOnPressEscape: boolean;
28
- readonly closeOnClickModal: boolean;
29
24
  cancelText: string;
30
25
  confirmText: string;
31
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,245 @@
1
+ export declare const EzDynamicForm: ({
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('.').DynamicFormProps> & Readonly<{
3
+ "onUpdate:modelValue"?: (value: Record<string, any>) => any;
4
+ }>, {
5
+ validate: () => Promise<boolean>;
6
+ validateField: (props: string | string[]) => Promise<boolean>;
7
+ clearValidate: (props?: string | string[]) => void;
8
+ resetFields: (props?: string | string[]) => void;
9
+ getFormData: () => Record<string, any>;
10
+ setFormData: (data: Record<string, any>, merge?: boolean) => void;
11
+ formRef: import('vue').ShallowRef<import('element-plus').FormInstance, import('element-plus').FormInstance>;
12
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ "update:modelValue": (value: Record<string, any>) => any;
14
+ }, import('vue').PublicProps, {
15
+ items: import('.').FormItemConfig[];
16
+ cols: number;
17
+ gutter: number;
18
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
19
+ formRef: {
20
+ $: import('vue').ComponentInternalInstance;
21
+ $data: {};
22
+ $props: Partial<{
23
+ readonly disabled: boolean;
24
+ readonly inline: boolean;
25
+ readonly labelWidth: import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
26
+ readonly labelPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
27
+ readonly inlineMessage: boolean;
28
+ readonly showMessage: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
29
+ readonly requireAsteriskPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right", unknown>;
30
+ readonly labelSuffix: string;
31
+ readonly validateOnRuleChange: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
32
+ readonly scrollIntoViewOptions: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | ((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions))[], unknown, unknown>;
33
+ readonly statusIcon: boolean;
34
+ readonly hideRequiredAsterisk: boolean;
35
+ readonly scrollToError: boolean;
36
+ }> & Omit<{
37
+ readonly disabled: boolean;
38
+ readonly labelPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "top" | "left" | "right", unknown>;
39
+ readonly requireAsteriskPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right", unknown>;
40
+ readonly labelWidth: import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
41
+ readonly labelSuffix: string;
42
+ readonly inline: boolean;
43
+ readonly inlineMessage: boolean;
44
+ readonly statusIcon: boolean;
45
+ readonly showMessage: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
46
+ readonly validateOnRuleChange: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
47
+ readonly hideRequiredAsterisk: boolean;
48
+ readonly scrollToError: boolean;
49
+ readonly scrollIntoViewOptions: true;
50
+ readonly size?: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", unknown>;
51
+ readonly model?: Record<string, any>;
52
+ readonly rules?: Partial<Record<string, import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemRule>>>;
53
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
54
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "labelPosition" | "requireAsteriskPosition" | "labelWidth" | "labelSuffix" | "inline" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError" | "scrollIntoViewOptions">;
55
+ $attrs: {
56
+ [x: string]: unknown;
57
+ };
58
+ $refs: {
59
+ [x: string]: unknown;
60
+ };
61
+ $slots: Readonly<{
62
+ [name: string]: import('vue').Slot<any>;
63
+ }>;
64
+ $root: import('vue').ComponentPublicInstance | null;
65
+ $parent: import('vue').ComponentPublicInstance | null;
66
+ $host: Element | null;
67
+ $emit: (event: "validate", prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
68
+ $el: any;
69
+ $options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
70
+ readonly model: ObjectConstructor;
71
+ readonly rules: {
72
+ readonly type: import('vue').PropType<Partial<Record<string, import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemRule>>>>;
73
+ readonly required: false;
74
+ readonly validator: ((val: unknown) => boolean) | undefined;
75
+ __epPropKey: true;
76
+ };
77
+ readonly labelPosition: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
78
+ readonly requireAsteriskPosition: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
79
+ readonly labelWidth: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
80
+ readonly labelSuffix: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
81
+ readonly inline: BooleanConstructor;
82
+ readonly inlineMessage: BooleanConstructor;
83
+ readonly statusIcon: BooleanConstructor;
84
+ readonly showMessage: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
85
+ readonly validateOnRuleChange: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
86
+ readonly hideRequiredAsterisk: BooleanConstructor;
87
+ readonly scrollToError: BooleanConstructor;
88
+ readonly scrollIntoViewOptions: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | ((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions))[], unknown, unknown, true, boolean>;
89
+ readonly size: {
90
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
91
+ readonly required: false;
92
+ readonly validator: ((val: unknown) => boolean) | undefined;
93
+ __epPropKey: true;
94
+ };
95
+ readonly disabled: BooleanConstructor;
96
+ }>> & {
97
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
98
+ }, {
99
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
100
+ validateField: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
101
+ resetFields: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
102
+ clearValidate: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
103
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
104
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
105
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
106
+ setInitialValues: (initModel: Record<string, any>) => void;
107
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
108
+ validate: (prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
109
+ }, string, {
110
+ readonly disabled: boolean;
111
+ readonly inline: boolean;
112
+ readonly labelWidth: import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
113
+ readonly labelPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
114
+ readonly inlineMessage: boolean;
115
+ readonly showMessage: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
116
+ readonly requireAsteriskPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right", unknown>;
117
+ readonly labelSuffix: string;
118
+ readonly validateOnRuleChange: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
119
+ readonly scrollIntoViewOptions: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | ((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions))[], unknown, unknown>;
120
+ readonly statusIcon: boolean;
121
+ readonly hideRequiredAsterisk: boolean;
122
+ readonly scrollToError: boolean;
123
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
124
+ beforeCreate?: (() => void) | (() => void)[];
125
+ created?: (() => void) | (() => void)[];
126
+ beforeMount?: (() => void) | (() => void)[];
127
+ mounted?: (() => void) | (() => void)[];
128
+ beforeUpdate?: (() => void) | (() => void)[];
129
+ updated?: (() => void) | (() => void)[];
130
+ activated?: (() => void) | (() => void)[];
131
+ deactivated?: (() => void) | (() => void)[];
132
+ beforeDestroy?: (() => void) | (() => void)[];
133
+ beforeUnmount?: (() => void) | (() => void)[];
134
+ destroyed?: (() => void) | (() => void)[];
135
+ unmounted?: (() => void) | (() => void)[];
136
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
137
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
138
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
139
+ };
140
+ $forceUpdate: () => void;
141
+ $nextTick: typeof import('vue').nextTick;
142
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
143
+ } & Readonly<{
144
+ readonly disabled: boolean;
145
+ readonly inline: boolean;
146
+ readonly labelWidth: import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
147
+ readonly labelPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
148
+ readonly inlineMessage: boolean;
149
+ readonly showMessage: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
150
+ readonly requireAsteriskPosition: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "left" | "right", unknown>;
151
+ readonly labelSuffix: string;
152
+ readonly validateOnRuleChange: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
153
+ readonly scrollIntoViewOptions: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | ((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions))[], unknown, unknown>;
154
+ readonly statusIcon: boolean;
155
+ readonly hideRequiredAsterisk: boolean;
156
+ readonly scrollToError: boolean;
157
+ }> & Omit<Readonly<import('vue').ExtractPropTypes<{
158
+ readonly model: ObjectConstructor;
159
+ readonly rules: {
160
+ readonly type: import('vue').PropType<Partial<Record<string, import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemRule>>>>;
161
+ readonly required: false;
162
+ readonly validator: ((val: unknown) => boolean) | undefined;
163
+ __epPropKey: true;
164
+ };
165
+ readonly labelPosition: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
166
+ readonly requireAsteriskPosition: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
167
+ readonly labelWidth: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
168
+ readonly labelSuffix: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
169
+ readonly inline: BooleanConstructor;
170
+ readonly inlineMessage: BooleanConstructor;
171
+ readonly statusIcon: BooleanConstructor;
172
+ readonly showMessage: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
173
+ readonly validateOnRuleChange: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
174
+ readonly hideRequiredAsterisk: BooleanConstructor;
175
+ readonly scrollToError: BooleanConstructor;
176
+ readonly scrollIntoViewOptions: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | ((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions))[], unknown, unknown, true, boolean>;
177
+ readonly size: {
178
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
179
+ readonly required: false;
180
+ readonly validator: ((val: unknown) => boolean) | undefined;
181
+ __epPropKey: true;
182
+ };
183
+ readonly disabled: BooleanConstructor;
184
+ }>> & {
185
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
186
+ }, "disabled" | "labelPosition" | "requireAsteriskPosition" | "labelWidth" | "labelSuffix" | "inline" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError" | "scrollIntoViewOptions" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & import('vue').ShallowUnwrapRef<{
187
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
188
+ validateField: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
189
+ resetFields: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
190
+ clearValidate: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
191
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
192
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
193
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
194
+ setInitialValues: (initModel: Record<string, any>) => void;
195
+ }> & {} & import('vue').ComponentCustomProperties & {} & {
196
+ $slots: {
197
+ default?: (props: {}) => any;
198
+ };
199
+ };
200
+ }, any, import('vue').ComponentProvideOptions, {
201
+ P: {};
202
+ B: {};
203
+ D: {};
204
+ C: {};
205
+ M: {};
206
+ Defaults: {};
207
+ }, Readonly<import('.').DynamicFormProps> & Readonly<{
208
+ "onUpdate:modelValue"?: (value: Record<string, any>) => any;
209
+ }>, {
210
+ validate: () => Promise<boolean>;
211
+ validateField: (props: string | string[]) => Promise<boolean>;
212
+ clearValidate: (props?: string | string[]) => void;
213
+ resetFields: (props?: string | string[]) => void;
214
+ getFormData: () => Record<string, any>;
215
+ setFormData: (data: Record<string, any>, merge?: boolean) => void;
216
+ formRef: import('vue').ShallowRef<import('element-plus').FormInstance, import('element-plus').FormInstance>;
217
+ }, {}, {}, {}, {
218
+ items: import('.').FormItemConfig[];
219
+ cols: number;
220
+ gutter: number;
221
+ }>;
222
+ __isFragment?: never;
223
+ __isTeleport?: never;
224
+ __isSuspense?: never;
225
+ } & import('vue').ComponentOptionsBase<Readonly<import('.').DynamicFormProps> & Readonly<{
226
+ "onUpdate:modelValue"?: (value: Record<string, any>) => any;
227
+ }>, {
228
+ validate: () => Promise<boolean>;
229
+ validateField: (props: string | string[]) => Promise<boolean>;
230
+ clearValidate: (props?: string | string[]) => void;
231
+ resetFields: (props?: string | string[]) => void;
232
+ getFormData: () => Record<string, any>;
233
+ setFormData: (data: Record<string, any>, merge?: boolean) => void;
234
+ formRef: import('vue').ShallowRef<import('element-plus').FormInstance, import('element-plus').FormInstance>;
235
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
236
+ "update:modelValue": (value: Record<string, any>) => any;
237
+ }, string, {
238
+ items: import('.').FormItemConfig[];
239
+ cols: number;
240
+ gutter: number;
241
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
242
+ $slots: Readonly<import('.').DynamicFormSlots> & import('.').DynamicFormSlots;
243
+ }) & import('vue').Plugin) & Record<string, any>;
244
+ export default EzDynamicForm;
245
+ export * from './src/dynamic-form';
@@ -0,0 +1,128 @@
1
+ import { FormItemRule, FormProps } from 'element-plus';
2
+ import { Component } from 'vue';
3
+ /**
4
+ * 表单项类型枚举
5
+ * 定义常用的表单组件类型,其他组件可通过 component 属性或字符串字面量指定
6
+ */
7
+ export declare enum FormItemType {
8
+ /** 输入框 */
9
+ INPUT = "input",
10
+ /** 多行文本 */
11
+ TEXTAREA = "textarea",
12
+ /** 数字输入 */
13
+ NUMBER = "number",
14
+ /** 密码输入 */
15
+ PASSWORD = "password",
16
+ /** 下拉选择(封装组件) */
17
+ SELECT = "select",
18
+ /** 单选框(封装组件) */
19
+ RADIO = "radio",
20
+ /** 多选框(封装组件) */
21
+ CHECKBOX = "checkbox",
22
+ /** 日期选择 */
23
+ DATE = "date",
24
+ /** 日期时间 */
25
+ DATETIME = "datetime",
26
+ /** 日期范围 */
27
+ DATERANGE = "daterange",
28
+ /** 日期时间范围 */
29
+ DATETIMERANGE = "datetimerange",
30
+ /** 时间选择 */
31
+ TIME = "time",
32
+ /** 时间范围 */
33
+ TIMERANGE = "timerange",
34
+ /** 图片上传(封装组件) */
35
+ UPLOAD_IMAGES = "upload-images",
36
+ /** 开关 */
37
+ SWITCH = "switch",
38
+ /** 树形选择 */
39
+ TREE_SELECT = "tree-select",
40
+ /** 级联选择 */
41
+ CASCADER = "cascader",
42
+ /** 树形控件 */
43
+ TREE = "tree",
44
+ /** 滑块 */
45
+ SLIDER = "slider",
46
+ /** 评分 */
47
+ RATE = "rate"
48
+ }
49
+ /**
50
+ * 选项配置
51
+ */
52
+ export interface FormItemOption {
53
+ label: string;
54
+ value: any;
55
+ disabled?: boolean;
56
+ [key: string]: any;
57
+ }
58
+ /**
59
+ * 表单项配置
60
+ */
61
+ export interface FormItemConfig {
62
+ /** 字段名(必填) */
63
+ prop: string;
64
+ /** 标签 */
65
+ label?: string;
66
+ /** 组件类型 */
67
+ type?: FormItemType | `${FormItemType}` | string;
68
+ /** 默认值 */
69
+ defaultValue?: any;
70
+ /** 验证规则 */
71
+ rules?: FormItemRule | FormItemRule[];
72
+ /** 是否必填(快捷配置,会自动生成 required 规则) */
73
+ required?: boolean;
74
+ /** 必填提示信息 */
75
+ requiredMessage?: string;
76
+ /** 占用栅格列数(1-24) */
77
+ span?: number;
78
+ /** 是否隐藏 */
79
+ hidden?: boolean;
80
+ /** 是否禁用 */
81
+ disabled?: boolean;
82
+ /** 占位符 */
83
+ placeholder?: string;
84
+ /** 选项配置(用于 select、radio、checkbox 等) */
85
+ options?: FormItemOption[];
86
+ /** 组件属性(透传给具体组件) */
87
+ attrs?: Record<string, any>;
88
+ /** 插槽名称(自定义渲染) */
89
+ slotName?: string;
90
+ /** 自定义组件 */
91
+ component?: Component;
92
+ /** 额外的 el-form-item 属性 */
93
+ itemAttrs?: Record<string, any>;
94
+ /** 联动显示条件(返回 true 显示,false 隐藏) */
95
+ show?: (formData: Record<string, any>) => boolean;
96
+ /** 联动禁用条件(返回 true 禁用,false 启用) */
97
+ disabledWhen?: (formData: Record<string, any>) => boolean;
98
+ }
99
+ /**
100
+ * 动态表单属性
101
+ */
102
+ export interface DynamicFormProps {
103
+ /** 表单配置项 */
104
+ items: FormItemConfig[];
105
+ /** 表单数据 */
106
+ modelValue?: Record<string, any>;
107
+ /** 栅格布局列数(默认 1) */
108
+ cols?: number;
109
+ /** 栅格间距(默认 20px) */
110
+ gutter?: number;
111
+ /** el-form 属性(不包含 model,避免冲突) */
112
+ formProps?: Partial<Omit<FormProps, 'model'>>;
113
+ }
114
+ /**
115
+ * 动态表单插槽
116
+ */
117
+ export interface DynamicFormSlots {
118
+ /** 表单项自定义插槽 */
119
+ [key: string]: (scope: {
120
+ item: FormItemConfig;
121
+ value: any;
122
+ formData: Record<string, any>;
123
+ }) => any;
124
+ /** 表单项标签插槽 */
125
+ [key: `label-${string}`]: (scope: {
126
+ item: FormItemConfig;
127
+ }) => any;
128
+ }