@tmagic/form 1.0.0-beta.2 → 1.0.0-beta.3
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/package.json +3 -2
- package/src/containers/Table.vue +8 -6
- package/src/theme/table.scss +0 -1
- package/dist/style.css +0 -161
- package/dist/tmagic-form.es.js +0 -3751
- package/dist/tmagic-form.es.js.map +0 -1
- package/dist/tmagic-form.umd.js +0 -3792
- package/dist/tmagic-form.umd.js.map +0 -1
- package/dist/types/src/Form.vue.d.ts +0 -301
- package/dist/types/src/FormDialog.vue.d.ts +0 -638
- package/dist/types/src/containers/Container.vue.d.ts +0 -69
- package/dist/types/src/containers/Fieldset.vue.d.ts +0 -56
- package/dist/types/src/containers/GroupList.vue.d.ts +0 -56
- package/dist/types/src/containers/GroupListItem.vue.d.ts +0 -72
- package/dist/types/src/containers/Panel.vue.d.ts +0 -41
- package/dist/types/src/containers/Row.vue.d.ts +0 -42
- package/dist/types/src/containers/Step.vue.d.ts +0 -45
- package/dist/types/src/containers/Table.vue.d.ts +0 -1401
- package/dist/types/src/containers/Tabs.vue.d.ts +0 -45
- package/dist/types/src/fields/Cascader.vue.d.ts +0 -1748
- package/dist/types/src/fields/Checkbox.vue.d.ts +0 -59
- package/dist/types/src/fields/CheckboxGroup.vue.d.ts +0 -56
- package/dist/types/src/fields/Date.vue.d.ts +0 -58
- package/dist/types/src/fields/DateTime.vue.d.ts +0 -57
- package/dist/types/src/fields/Daterange.vue.d.ts +0 -57
- package/dist/types/src/fields/Display.vue.d.ts +0 -3
- package/dist/types/src/fields/DynamicField.vue.d.ts +0 -76
- package/dist/types/src/fields/Hidden.vue.d.ts +0 -3
- package/dist/types/src/fields/Link.vue.d.ts +0 -1358
- package/dist/types/src/fields/Number.vue.d.ts +0 -59
- package/dist/types/src/fields/RadioGroup.vue.d.ts +0 -55
- package/dist/types/src/fields/Select.vue.d.ts +0 -975
- package/dist/types/src/fields/Switch.vue.d.ts +0 -59
- package/dist/types/src/fields/Text.vue.d.ts +0 -61
- package/dist/types/src/fields/Textarea.vue.d.ts +0 -56
- package/dist/types/src/fields/Time.vue.d.ts +0 -54
- package/dist/types/src/index.d.ts +0 -36
- package/dist/types/src/schema.d.ts +0 -495
- package/dist/types/src/shims-vue.d.ts +0 -6
- package/dist/types/src/utils/config.d.ts +0 -3
- package/dist/types/src/utils/fieldProps.d.ts +0 -21
- package/dist/types/src/utils/form.d.ts +0 -8
- package/dist/types/src/utils/useAddField.d.ts +0 -1
- package/dist/types/src/vite-env.d.ts +0 -1
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import type { ValidateFieldCallback } from 'element-plus';
|
|
2
|
-
import type { Callback } from 'element-plus/es/components/form/src/form.vue';
|
|
3
|
-
import type { FormItemRule } from 'element-plus/es/components/form/src/form.type';
|
|
4
|
-
import type { DefineComponent, Ref, ComponentInternalInstance, ExtractPropTypes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComputedRef, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, PropType } from 'vue';
|
|
5
|
-
import { FormConfig, FormState } from './schema';
|
|
6
|
-
export interface ValidateError {
|
|
7
|
-
message: string;
|
|
8
|
-
field: string;
|
|
9
|
-
}
|
|
10
|
-
export interface FieldErrorList {
|
|
11
|
-
[field: string]: ValidateError[];
|
|
12
|
-
}
|
|
13
|
-
declare const _default: DefineComponent<{
|
|
14
|
-
initValues: {
|
|
15
|
-
type: ObjectConstructor;
|
|
16
|
-
required: true;
|
|
17
|
-
default: () => {};
|
|
18
|
-
};
|
|
19
|
-
parentValues: {
|
|
20
|
-
type: ObjectConstructor;
|
|
21
|
-
default: () => {};
|
|
22
|
-
};
|
|
23
|
-
config: {
|
|
24
|
-
type: PropType<FormConfig>;
|
|
25
|
-
required: true;
|
|
26
|
-
default: () => never[];
|
|
27
|
-
};
|
|
28
|
-
labelWidth: {
|
|
29
|
-
type: StringConstructor;
|
|
30
|
-
default: () => string;
|
|
31
|
-
};
|
|
32
|
-
disabled: {
|
|
33
|
-
type: BooleanConstructor;
|
|
34
|
-
default: () => boolean;
|
|
35
|
-
};
|
|
36
|
-
height: {
|
|
37
|
-
type: StringConstructor;
|
|
38
|
-
default: () => string;
|
|
39
|
-
};
|
|
40
|
-
stepActive: {
|
|
41
|
-
type: (StringConstructor | NumberConstructor)[];
|
|
42
|
-
default: () => number;
|
|
43
|
-
};
|
|
44
|
-
size: {
|
|
45
|
-
type: StringConstructor;
|
|
46
|
-
};
|
|
47
|
-
inline: {
|
|
48
|
-
type: BooleanConstructor;
|
|
49
|
-
default: boolean;
|
|
50
|
-
};
|
|
51
|
-
labelPosition: {
|
|
52
|
-
type: StringConstructor;
|
|
53
|
-
default: string;
|
|
54
|
-
};
|
|
55
|
-
keyProp: {
|
|
56
|
-
type: StringConstructor;
|
|
57
|
-
default: string;
|
|
58
|
-
};
|
|
59
|
-
}, {
|
|
60
|
-
initialized: Ref<boolean>;
|
|
61
|
-
values: Ref<{
|
|
62
|
-
[x: string]: any;
|
|
63
|
-
[x: number]: any;
|
|
64
|
-
}>;
|
|
65
|
-
elForm: Ref<({
|
|
66
|
-
$: ComponentInternalInstance;
|
|
67
|
-
$data: {};
|
|
68
|
-
$props: Partial<{
|
|
69
|
-
disabled: boolean;
|
|
70
|
-
inline: boolean;
|
|
71
|
-
labelWidth: string | number;
|
|
72
|
-
labelSuffix: string;
|
|
73
|
-
inlineMessage: boolean;
|
|
74
|
-
statusIcon: boolean;
|
|
75
|
-
showMessage: boolean;
|
|
76
|
-
validateOnRuleChange: boolean;
|
|
77
|
-
hideRequiredAsterisk: boolean;
|
|
78
|
-
scrollToError: boolean;
|
|
79
|
-
}> & Omit<Readonly<ExtractPropTypes<{
|
|
80
|
-
model: ObjectConstructor;
|
|
81
|
-
rules: PropType<Partial<Record<string, FormItemRule | FormItemRule[]>>>;
|
|
82
|
-
labelPosition: StringConstructor;
|
|
83
|
-
labelWidth: {
|
|
84
|
-
type: (StringConstructor | NumberConstructor)[];
|
|
85
|
-
default: string;
|
|
86
|
-
};
|
|
87
|
-
labelSuffix: {
|
|
88
|
-
type: StringConstructor;
|
|
89
|
-
default: string;
|
|
90
|
-
};
|
|
91
|
-
inline: BooleanConstructor;
|
|
92
|
-
inlineMessage: BooleanConstructor;
|
|
93
|
-
statusIcon: BooleanConstructor;
|
|
94
|
-
showMessage: {
|
|
95
|
-
type: BooleanConstructor;
|
|
96
|
-
default: boolean;
|
|
97
|
-
};
|
|
98
|
-
size: PropType<"small" | "default" | "large">;
|
|
99
|
-
disabled: BooleanConstructor;
|
|
100
|
-
validateOnRuleChange: {
|
|
101
|
-
type: BooleanConstructor;
|
|
102
|
-
default: boolean;
|
|
103
|
-
};
|
|
104
|
-
hideRequiredAsterisk: {
|
|
105
|
-
type: BooleanConstructor;
|
|
106
|
-
default: boolean;
|
|
107
|
-
};
|
|
108
|
-
scrollToError: BooleanConstructor;
|
|
109
|
-
}>> & {
|
|
110
|
-
onValidate?: ((...args: any[]) => any) | undefined;
|
|
111
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "labelWidth" | "disabled" | "inline" | "labelSuffix" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError">;
|
|
112
|
-
$attrs: {
|
|
113
|
-
[x: string]: unknown;
|
|
114
|
-
};
|
|
115
|
-
$refs: {
|
|
116
|
-
[x: string]: unknown;
|
|
117
|
-
};
|
|
118
|
-
$slots: Readonly<{
|
|
119
|
-
[name: string]: Slot | undefined;
|
|
120
|
-
}>;
|
|
121
|
-
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
122
|
-
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
123
|
-
$emit: (event: "validate", ...args: any[]) => void;
|
|
124
|
-
$el: any;
|
|
125
|
-
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
126
|
-
model: ObjectConstructor;
|
|
127
|
-
rules: PropType<Partial<Record<string, FormItemRule | FormItemRule[]>>>;
|
|
128
|
-
labelPosition: StringConstructor;
|
|
129
|
-
labelWidth: {
|
|
130
|
-
type: (StringConstructor | NumberConstructor)[];
|
|
131
|
-
default: string;
|
|
132
|
-
};
|
|
133
|
-
labelSuffix: {
|
|
134
|
-
type: StringConstructor;
|
|
135
|
-
default: string;
|
|
136
|
-
};
|
|
137
|
-
inline: BooleanConstructor;
|
|
138
|
-
inlineMessage: BooleanConstructor;
|
|
139
|
-
statusIcon: BooleanConstructor;
|
|
140
|
-
showMessage: {
|
|
141
|
-
type: BooleanConstructor;
|
|
142
|
-
default: boolean;
|
|
143
|
-
};
|
|
144
|
-
size: PropType<"small" | "default" | "large">;
|
|
145
|
-
disabled: BooleanConstructor;
|
|
146
|
-
validateOnRuleChange: {
|
|
147
|
-
type: BooleanConstructor;
|
|
148
|
-
default: boolean;
|
|
149
|
-
};
|
|
150
|
-
hideRequiredAsterisk: {
|
|
151
|
-
type: BooleanConstructor;
|
|
152
|
-
default: boolean;
|
|
153
|
-
};
|
|
154
|
-
scrollToError: BooleanConstructor;
|
|
155
|
-
}>> & {
|
|
156
|
-
onValidate?: ((...args: any[]) => any) | undefined;
|
|
157
|
-
}, {
|
|
158
|
-
formKls: ComputedRef<string[]>;
|
|
159
|
-
validate: (callback?: Callback | undefined) => Promise<boolean> | undefined;
|
|
160
|
-
resetFields: () => void;
|
|
161
|
-
clearValidate: (props?: string | string[] | undefined) => void;
|
|
162
|
-
validateField: (props: string | string[], cb: ValidateFieldCallback) => void;
|
|
163
|
-
scrollToField: (prop: string) => void;
|
|
164
|
-
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "validate"[], string, {
|
|
165
|
-
disabled: boolean;
|
|
166
|
-
inline: boolean;
|
|
167
|
-
labelWidth: string | number;
|
|
168
|
-
labelSuffix: string;
|
|
169
|
-
inlineMessage: boolean;
|
|
170
|
-
statusIcon: boolean;
|
|
171
|
-
showMessage: boolean;
|
|
172
|
-
validateOnRuleChange: boolean;
|
|
173
|
-
hideRequiredAsterisk: boolean;
|
|
174
|
-
scrollToError: boolean;
|
|
175
|
-
}> & {
|
|
176
|
-
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
177
|
-
created?: ((() => void) | (() => void)[]) | undefined;
|
|
178
|
-
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
179
|
-
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
180
|
-
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
181
|
-
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
182
|
-
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
183
|
-
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
184
|
-
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
185
|
-
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
186
|
-
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
187
|
-
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
188
|
-
renderTracked?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
189
|
-
renderTriggered?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
190
|
-
errorCaptured?: (((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
191
|
-
};
|
|
192
|
-
$forceUpdate: () => void;
|
|
193
|
-
$nextTick: typeof nextTick;
|
|
194
|
-
$watch(source: string | Function, cb: Function, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
195
|
-
} & Readonly<ExtractPropTypes<{
|
|
196
|
-
model: ObjectConstructor;
|
|
197
|
-
rules: PropType<Partial<Record<string, FormItemRule | FormItemRule[]>>>;
|
|
198
|
-
labelPosition: StringConstructor;
|
|
199
|
-
labelWidth: {
|
|
200
|
-
type: (StringConstructor | NumberConstructor)[];
|
|
201
|
-
default: string;
|
|
202
|
-
};
|
|
203
|
-
labelSuffix: {
|
|
204
|
-
type: StringConstructor;
|
|
205
|
-
default: string;
|
|
206
|
-
};
|
|
207
|
-
inline: BooleanConstructor;
|
|
208
|
-
inlineMessage: BooleanConstructor;
|
|
209
|
-
statusIcon: BooleanConstructor;
|
|
210
|
-
showMessage: {
|
|
211
|
-
type: BooleanConstructor;
|
|
212
|
-
default: boolean;
|
|
213
|
-
};
|
|
214
|
-
size: PropType<"small" | "default" | "large">;
|
|
215
|
-
disabled: BooleanConstructor;
|
|
216
|
-
validateOnRuleChange: {
|
|
217
|
-
type: BooleanConstructor;
|
|
218
|
-
default: boolean;
|
|
219
|
-
};
|
|
220
|
-
hideRequiredAsterisk: {
|
|
221
|
-
type: BooleanConstructor;
|
|
222
|
-
default: boolean;
|
|
223
|
-
};
|
|
224
|
-
scrollToError: BooleanConstructor;
|
|
225
|
-
}>> & {
|
|
226
|
-
onValidate?: ((...args: any[]) => any) | undefined;
|
|
227
|
-
} & ShallowUnwrapRef<{
|
|
228
|
-
formKls: ComputedRef<string[]>;
|
|
229
|
-
validate: (callback?: Callback | undefined) => Promise<boolean> | undefined;
|
|
230
|
-
resetFields: () => void;
|
|
231
|
-
clearValidate: (props?: string | string[] | undefined) => void;
|
|
232
|
-
validateField: (props: string | string[], cb: ValidateFieldCallback) => void;
|
|
233
|
-
scrollToField: (prop: string) => void;
|
|
234
|
-
}> & {} & {} & ComponentCustomProperties) | undefined>;
|
|
235
|
-
formState: FormState;
|
|
236
|
-
changeHandler: () => void;
|
|
237
|
-
resetForm: () => void | undefined;
|
|
238
|
-
submitForm: (native?: boolean | undefined) => Promise<any>;
|
|
239
|
-
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("change" | "field-input" | "field-change")[], "change" | "field-input" | "field-change", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
240
|
-
initValues: {
|
|
241
|
-
type: ObjectConstructor;
|
|
242
|
-
required: true;
|
|
243
|
-
default: () => {};
|
|
244
|
-
};
|
|
245
|
-
parentValues: {
|
|
246
|
-
type: ObjectConstructor;
|
|
247
|
-
default: () => {};
|
|
248
|
-
};
|
|
249
|
-
config: {
|
|
250
|
-
type: PropType<FormConfig>;
|
|
251
|
-
required: true;
|
|
252
|
-
default: () => never[];
|
|
253
|
-
};
|
|
254
|
-
labelWidth: {
|
|
255
|
-
type: StringConstructor;
|
|
256
|
-
default: () => string;
|
|
257
|
-
};
|
|
258
|
-
disabled: {
|
|
259
|
-
type: BooleanConstructor;
|
|
260
|
-
default: () => boolean;
|
|
261
|
-
};
|
|
262
|
-
height: {
|
|
263
|
-
type: StringConstructor;
|
|
264
|
-
default: () => string;
|
|
265
|
-
};
|
|
266
|
-
stepActive: {
|
|
267
|
-
type: (StringConstructor | NumberConstructor)[];
|
|
268
|
-
default: () => number;
|
|
269
|
-
};
|
|
270
|
-
size: {
|
|
271
|
-
type: StringConstructor;
|
|
272
|
-
};
|
|
273
|
-
inline: {
|
|
274
|
-
type: BooleanConstructor;
|
|
275
|
-
default: boolean;
|
|
276
|
-
};
|
|
277
|
-
labelPosition: {
|
|
278
|
-
type: StringConstructor;
|
|
279
|
-
default: string;
|
|
280
|
-
};
|
|
281
|
-
keyProp: {
|
|
282
|
-
type: StringConstructor;
|
|
283
|
-
default: string;
|
|
284
|
-
};
|
|
285
|
-
}>> & {
|
|
286
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
287
|
-
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
288
|
-
"onField-change"?: ((...args: any[]) => any) | undefined;
|
|
289
|
-
}, {
|
|
290
|
-
initValues: Record<string, any>;
|
|
291
|
-
parentValues: Record<string, any>;
|
|
292
|
-
config: FormConfig;
|
|
293
|
-
labelWidth: string;
|
|
294
|
-
disabled: boolean;
|
|
295
|
-
height: string;
|
|
296
|
-
stepActive: string | number;
|
|
297
|
-
inline: boolean;
|
|
298
|
-
labelPosition: string;
|
|
299
|
-
keyProp: string;
|
|
300
|
-
}>;
|
|
301
|
-
export default _default;
|