@tmagic/form 1.0.0-beta.6 → 1.0.0-rc.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/LICENSE +5432 -0
- package/README.md +1 -0
- package/coverage/clover.xml +1360 -0
- package/coverage/coverage-final.json +38 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +176 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/Form.vue.html +676 -0
- package/coverage/lcov-report/src/FormDialog.vue.html +583 -0
- package/coverage/lcov-report/src/containers/Col.vue.html +253 -0
- package/coverage/lcov-report/src/containers/Container.vue.html +925 -0
- package/coverage/lcov-report/src/containers/Fieldset.vue.html +499 -0
- package/coverage/lcov-report/src/containers/GroupList.vue.html +541 -0
- package/coverage/lcov-report/src/containers/GroupListItem.vue.html +562 -0
- package/coverage/lcov-report/src/containers/Panel.vue.html +403 -0
- package/coverage/lcov-report/src/containers/Row.vue.html +277 -0
- package/coverage/lcov-report/src/containers/Step.vue.html +331 -0
- package/coverage/lcov-report/src/containers/Table.vue.html +1987 -0
- package/coverage/lcov-report/src/containers/Tabs.vue.html +625 -0
- package/coverage/lcov-report/src/containers/index.html +251 -0
- package/coverage/lcov-report/src/fields/Cascader.vue.html +526 -0
- package/coverage/lcov-report/src/fields/Checkbox.vue.html +286 -0
- package/coverage/lcov-report/src/fields/CheckboxGroup.vue.html +217 -0
- package/coverage/lcov-report/src/fields/ColorPicker.vue.html +199 -0
- package/coverage/lcov-report/src/fields/Date.vue.html +238 -0
- package/coverage/lcov-report/src/fields/DateTime.vue.html +262 -0
- package/coverage/lcov-report/src/fields/Daterange.vue.html +310 -0
- package/coverage/lcov-report/src/fields/Display.vue.html +187 -0
- package/coverage/lcov-report/src/fields/DynamicField.vue.html +412 -0
- package/coverage/lcov-report/src/fields/Hidden.vue.html +172 -0
- package/coverage/lcov-report/src/fields/Link.vue.html +421 -0
- package/coverage/lcov-report/src/fields/Number.vue.html +244 -0
- package/coverage/lcov-report/src/fields/RadioGroup.vue.html +184 -0
- package/coverage/lcov-report/src/fields/Select.vue.html +1243 -0
- package/coverage/lcov-report/src/fields/Switch.vue.html +280 -0
- package/coverage/lcov-report/src/fields/Text.vue.html +487 -0
- package/coverage/lcov-report/src/fields/Textarea.vue.html +265 -0
- package/coverage/lcov-report/src/fields/Time.vue.html +229 -0
- package/coverage/lcov-report/src/fields/index.html +371 -0
- package/coverage/lcov-report/src/index.html +146 -0
- package/coverage/lcov-report/src/index.ts.html +466 -0
- package/coverage/lcov-report/src/theme/index.html +116 -0
- package/coverage/lcov-report/src/theme/index.scss.html +112 -0
- package/coverage/lcov-report/src/utils/config.ts.html +166 -0
- package/coverage/lcov-report/src/utils/createForm.ts.html +160 -0
- package/coverage/lcov-report/src/utils/fieldProps.ts.html +202 -0
- package/coverage/lcov-report/src/utils/form.ts.html +895 -0
- package/coverage/lcov-report/src/utils/index.html +176 -0
- package/coverage/lcov-report/src/utils/useAddField.ts.html +205 -0
- package/coverage/lcov.info +3061 -0
- package/dist/style.css +9 -11
- package/dist/tmagic-form.es.js +188 -127
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +191 -131
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +181 -120
- package/dist/types/src/FormDialog.vue.d.ts +357 -238
- package/dist/types/src/containers/Col.vue.d.ts +42 -0
- package/dist/types/src/containers/Container.vue.d.ts +1 -0
- package/dist/types/src/containers/Row.vue.d.ts +0 -1
- package/dist/types/src/containers/Table.vue.d.ts +1742 -544
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +710 -472
- package/dist/types/src/schema.d.ts +2 -0
- package/package.json +29 -9
- package/src/Form.vue +7 -2
- package/src/FormDialog.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Container.vue +28 -11
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Row.vue +13 -17
- package/src/containers/Table.vue +14 -6
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Link.vue +1 -1
- package/src/fields/Select.vue +8 -15
- package/src/fields/Text.vue +4 -4
- package/src/fields/Textarea.vue +11 -13
- package/src/schema.ts +2 -0
- package/src/theme/form.scss +24 -17
- package/src/utils/form.ts +5 -1
- package/dist/types/src/fields/Cascader.vue.d.ts +0 -1748
- package/dist/types/src/fields/Select.vue.d.ts +0 -975
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -27
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { LooseRequired } from '@vue/shared';
|
|
2
|
+
import type { FormItemRule, FormItemProp, FormItemContext, FormValidateCallback, FormValidationResult } from 'element-plus';
|
|
3
|
+
import type { BuildPropType, Arrayable, BuildPropReturn, PropWrapper } from 'element-plus/es/utils';
|
|
4
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
5
|
import type { FormState, FormConfig } from './schema';
|
|
6
6
|
declare const _default: DefineComponent<{
|
|
@@ -17,7 +17,7 @@ declare const _default: DefineComponent<{
|
|
|
17
17
|
default: () => never[];
|
|
18
18
|
};
|
|
19
19
|
labelWidth: (StringConstructor | NumberConstructor)[];
|
|
20
|
-
size: PropType<"small" | "
|
|
20
|
+
size: PropType<"small" | "default" | "large">;
|
|
21
21
|
confirmText: {
|
|
22
22
|
type: StringConstructor;
|
|
23
23
|
default: string;
|
|
@@ -69,7 +69,7 @@ declare const _default: DefineComponent<{
|
|
|
69
69
|
default: () => number;
|
|
70
70
|
};
|
|
71
71
|
size: {
|
|
72
|
-
type:
|
|
72
|
+
type: PropType<"small" | "default" | "large">;
|
|
73
73
|
};
|
|
74
74
|
inline: {
|
|
75
75
|
type: BooleanConstructor;
|
|
@@ -83,6 +83,9 @@ declare const _default: DefineComponent<{
|
|
|
83
83
|
type: StringConstructor;
|
|
84
84
|
default: string;
|
|
85
85
|
};
|
|
86
|
+
popperClass: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
};
|
|
86
89
|
}>> & {
|
|
87
90
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
88
91
|
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
@@ -133,7 +136,7 @@ declare const _default: DefineComponent<{
|
|
|
133
136
|
default: () => number;
|
|
134
137
|
};
|
|
135
138
|
size: {
|
|
136
|
-
type:
|
|
139
|
+
type: PropType<"small" | "default" | "large">;
|
|
137
140
|
};
|
|
138
141
|
inline: {
|
|
139
142
|
type: BooleanConstructor;
|
|
@@ -147,6 +150,9 @@ declare const _default: DefineComponent<{
|
|
|
147
150
|
type: StringConstructor;
|
|
148
151
|
default: string;
|
|
149
152
|
};
|
|
153
|
+
popperClass: {
|
|
154
|
+
type: StringConstructor;
|
|
155
|
+
};
|
|
150
156
|
}>> & {
|
|
151
157
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
152
158
|
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
@@ -161,49 +167,36 @@ declare const _default: DefineComponent<{
|
|
|
161
167
|
$: ComponentInternalInstance;
|
|
162
168
|
$data: {};
|
|
163
169
|
$props: Partial<{
|
|
170
|
+
size: BuildPropType<StringConstructor, "" | "small" | "default" | "large", unknown>;
|
|
164
171
|
disabled: boolean;
|
|
165
|
-
|
|
166
|
-
labelWidth:
|
|
172
|
+
rules: Partial<Record<string, Arrayable<FormItemRule>>>;
|
|
173
|
+
labelWidth: BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
167
174
|
labelSuffix: string;
|
|
175
|
+
showMessage: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
176
|
+
validateOnRuleChange: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
177
|
+
hideRequiredAsterisk: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
178
|
+
inline: boolean;
|
|
168
179
|
inlineMessage: boolean;
|
|
169
180
|
statusIcon: boolean;
|
|
170
|
-
showMessage: boolean;
|
|
171
|
-
validateOnRuleChange: boolean;
|
|
172
|
-
hideRequiredAsterisk: boolean;
|
|
173
181
|
scrollToError: boolean;
|
|
174
182
|
}> & Omit<Readonly<ExtractPropTypes<{
|
|
175
|
-
model: ObjectConstructor;
|
|
176
|
-
rules:
|
|
177
|
-
labelPosition: StringConstructor;
|
|
178
|
-
labelWidth:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
showMessage: {
|
|
190
|
-
type: BooleanConstructor;
|
|
191
|
-
default: boolean;
|
|
192
|
-
};
|
|
193
|
-
size: PropType<"small" | "default" | "large">;
|
|
194
|
-
disabled: BooleanConstructor;
|
|
195
|
-
validateOnRuleChange: {
|
|
196
|
-
type: BooleanConstructor;
|
|
197
|
-
default: boolean;
|
|
198
|
-
};
|
|
199
|
-
hideRequiredAsterisk: {
|
|
200
|
-
type: BooleanConstructor;
|
|
201
|
-
default: boolean;
|
|
202
|
-
};
|
|
203
|
-
scrollToError: BooleanConstructor;
|
|
183
|
+
readonly model: ObjectConstructor;
|
|
184
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
185
|
+
readonly labelPosition: StringConstructor;
|
|
186
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
187
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
188
|
+
readonly inline: BooleanConstructor;
|
|
189
|
+
readonly inlineMessage: BooleanConstructor;
|
|
190
|
+
readonly statusIcon: BooleanConstructor;
|
|
191
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
192
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
193
|
+
readonly disabled: BooleanConstructor;
|
|
194
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
195
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
196
|
+
readonly scrollToError: BooleanConstructor;
|
|
204
197
|
}>> & {
|
|
205
|
-
onValidate?: ((
|
|
206
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "labelWidth" | "disabled" | "inline" | "labelSuffix" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError">;
|
|
198
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
199
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "labelWidth" | "disabled" | "size" | "inline" | "rules" | "labelSuffix" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError">;
|
|
207
200
|
$attrs: {
|
|
208
201
|
[x: string]: unknown;
|
|
209
202
|
};
|
|
@@ -215,57 +208,93 @@ declare const _default: DefineComponent<{
|
|
|
215
208
|
}>;
|
|
216
209
|
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
217
210
|
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
218
|
-
$emit: (event: "validate",
|
|
211
|
+
$emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
|
|
219
212
|
$el: any;
|
|
220
213
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
221
|
-
model: ObjectConstructor;
|
|
222
|
-
rules:
|
|
223
|
-
labelPosition: StringConstructor;
|
|
224
|
-
labelWidth:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
showMessage: {
|
|
236
|
-
type: BooleanConstructor;
|
|
237
|
-
default: boolean;
|
|
238
|
-
};
|
|
239
|
-
size: PropType<"small" | "default" | "large">;
|
|
240
|
-
disabled: BooleanConstructor;
|
|
241
|
-
validateOnRuleChange: {
|
|
242
|
-
type: BooleanConstructor;
|
|
243
|
-
default: boolean;
|
|
244
|
-
};
|
|
245
|
-
hideRequiredAsterisk: {
|
|
246
|
-
type: BooleanConstructor;
|
|
247
|
-
default: boolean;
|
|
248
|
-
};
|
|
249
|
-
scrollToError: BooleanConstructor;
|
|
214
|
+
readonly model: ObjectConstructor;
|
|
215
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
216
|
+
readonly labelPosition: StringConstructor;
|
|
217
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
218
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
219
|
+
readonly inline: BooleanConstructor;
|
|
220
|
+
readonly inlineMessage: BooleanConstructor;
|
|
221
|
+
readonly statusIcon: BooleanConstructor;
|
|
222
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
223
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
224
|
+
readonly disabled: BooleanConstructor;
|
|
225
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
226
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
227
|
+
readonly scrollToError: BooleanConstructor;
|
|
250
228
|
}>> & {
|
|
251
|
-
onValidate?: ((
|
|
229
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
252
230
|
}, {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
231
|
+
COMPONENT_NAME: string;
|
|
232
|
+
props: Readonly<LooseRequired<Readonly<ExtractPropTypes<{
|
|
233
|
+
readonly model: ObjectConstructor;
|
|
234
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
235
|
+
readonly labelPosition: StringConstructor;
|
|
236
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
237
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
238
|
+
readonly inline: BooleanConstructor;
|
|
239
|
+
readonly inlineMessage: BooleanConstructor;
|
|
240
|
+
readonly statusIcon: BooleanConstructor;
|
|
241
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
242
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
243
|
+
readonly disabled: BooleanConstructor;
|
|
244
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
245
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
246
|
+
readonly scrollToError: BooleanConstructor;
|
|
247
|
+
}>> & {
|
|
248
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
249
|
+
}>>;
|
|
250
|
+
emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
|
|
251
|
+
fields: FormItemContext[];
|
|
252
|
+
formSize: ComputedRef<"" | "small" | "default" | "large">;
|
|
253
|
+
ns: {
|
|
254
|
+
namespace: ComputedRef<string>;
|
|
255
|
+
b: (blockSuffix?: string | undefined) => string;
|
|
256
|
+
e: (element?: string | undefined) => string;
|
|
257
|
+
m: (modifier?: string | undefined) => string;
|
|
258
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
259
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
260
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
261
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
262
|
+
is: {
|
|
263
|
+
(name: string, state: boolean | undefined): string;
|
|
264
|
+
(name: string): string;
|
|
265
|
+
};
|
|
266
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
267
|
+
cssVarName: (name: string) => string;
|
|
268
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
269
|
+
cssVarBlockName: (name: string) => string;
|
|
270
|
+
};
|
|
271
|
+
formClasses: ComputedRef<(string | {
|
|
272
|
+
[x: string]: string | boolean | undefined;
|
|
273
|
+
})[]>;
|
|
274
|
+
addField: (field: FormItemContext) => void;
|
|
275
|
+
removeField: (field: FormItemContext) => void;
|
|
276
|
+
resetFields: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
277
|
+
clearValidate: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
278
|
+
isValidatable: ComputedRef<boolean>;
|
|
279
|
+
obtainValidateFields: (props: Arrayable<FormItemProp>) => FormItemContext[];
|
|
280
|
+
validate: (callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
281
|
+
doValidateField: (props?: Arrayable<FormItemProp> | undefined) => Promise<boolean>;
|
|
282
|
+
validateField: (props?: Arrayable<FormItemProp> | undefined, callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
283
|
+
scrollToField: (prop: FormItemProp) => void;
|
|
284
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
285
|
+
validate: (prop: FormItemProp, isValid: boolean, message: string) => boolean;
|
|
286
|
+
}, string, {
|
|
287
|
+
size: BuildPropType<StringConstructor, "" | "small" | "default" | "large", unknown>;
|
|
260
288
|
disabled: boolean;
|
|
261
|
-
|
|
262
|
-
labelWidth:
|
|
289
|
+
rules: Partial<Record<string, Arrayable<FormItemRule>>>;
|
|
290
|
+
labelWidth: BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
263
291
|
labelSuffix: string;
|
|
292
|
+
showMessage: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
293
|
+
validateOnRuleChange: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
294
|
+
hideRequiredAsterisk: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
295
|
+
inline: boolean;
|
|
264
296
|
inlineMessage: boolean;
|
|
265
297
|
statusIcon: boolean;
|
|
266
|
-
showMessage: boolean;
|
|
267
|
-
validateOnRuleChange: boolean;
|
|
268
|
-
hideRequiredAsterisk: boolean;
|
|
269
298
|
scrollToError: boolean;
|
|
270
299
|
}> & {
|
|
271
300
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -288,44 +317,76 @@ declare const _default: DefineComponent<{
|
|
|
288
317
|
$nextTick: typeof nextTick;
|
|
289
318
|
$watch(source: string | Function, cb: Function, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
290
319
|
} & Readonly<ExtractPropTypes<{
|
|
291
|
-
model: ObjectConstructor;
|
|
292
|
-
rules:
|
|
293
|
-
labelPosition: StringConstructor;
|
|
294
|
-
labelWidth:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
showMessage: {
|
|
306
|
-
type: BooleanConstructor;
|
|
307
|
-
default: boolean;
|
|
308
|
-
};
|
|
309
|
-
size: PropType<"small" | "default" | "large">;
|
|
310
|
-
disabled: BooleanConstructor;
|
|
311
|
-
validateOnRuleChange: {
|
|
312
|
-
type: BooleanConstructor;
|
|
313
|
-
default: boolean;
|
|
314
|
-
};
|
|
315
|
-
hideRequiredAsterisk: {
|
|
316
|
-
type: BooleanConstructor;
|
|
317
|
-
default: boolean;
|
|
318
|
-
};
|
|
319
|
-
scrollToError: BooleanConstructor;
|
|
320
|
+
readonly model: ObjectConstructor;
|
|
321
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
322
|
+
readonly labelPosition: StringConstructor;
|
|
323
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
324
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
325
|
+
readonly inline: BooleanConstructor;
|
|
326
|
+
readonly inlineMessage: BooleanConstructor;
|
|
327
|
+
readonly statusIcon: BooleanConstructor;
|
|
328
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
329
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
330
|
+
readonly disabled: BooleanConstructor;
|
|
331
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
332
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
333
|
+
readonly scrollToError: BooleanConstructor;
|
|
320
334
|
}>> & {
|
|
321
|
-
onValidate?: ((
|
|
335
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
322
336
|
} & ShallowUnwrapRef<{
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
337
|
+
COMPONENT_NAME: string;
|
|
338
|
+
props: Readonly<LooseRequired<Readonly<ExtractPropTypes<{
|
|
339
|
+
readonly model: ObjectConstructor;
|
|
340
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
341
|
+
readonly labelPosition: StringConstructor;
|
|
342
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
343
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
344
|
+
readonly inline: BooleanConstructor;
|
|
345
|
+
readonly inlineMessage: BooleanConstructor;
|
|
346
|
+
readonly statusIcon: BooleanConstructor;
|
|
347
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
348
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
349
|
+
readonly disabled: BooleanConstructor;
|
|
350
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
351
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
352
|
+
readonly scrollToError: BooleanConstructor;
|
|
353
|
+
}>> & {
|
|
354
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
355
|
+
}>>;
|
|
356
|
+
emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
|
|
357
|
+
fields: FormItemContext[];
|
|
358
|
+
formSize: ComputedRef<"" | "small" | "default" | "large">;
|
|
359
|
+
ns: {
|
|
360
|
+
namespace: ComputedRef<string>;
|
|
361
|
+
b: (blockSuffix?: string | undefined) => string;
|
|
362
|
+
e: (element?: string | undefined) => string;
|
|
363
|
+
m: (modifier?: string | undefined) => string;
|
|
364
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
365
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
366
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
367
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
368
|
+
is: {
|
|
369
|
+
(name: string, state: boolean | undefined): string;
|
|
370
|
+
(name: string): string;
|
|
371
|
+
};
|
|
372
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
373
|
+
cssVarName: (name: string) => string;
|
|
374
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
375
|
+
cssVarBlockName: (name: string) => string;
|
|
376
|
+
};
|
|
377
|
+
formClasses: ComputedRef<(string | {
|
|
378
|
+
[x: string]: string | boolean | undefined;
|
|
379
|
+
})[]>;
|
|
380
|
+
addField: (field: FormItemContext) => void;
|
|
381
|
+
removeField: (field: FormItemContext) => void;
|
|
382
|
+
resetFields: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
383
|
+
clearValidate: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
384
|
+
isValidatable: ComputedRef<boolean>;
|
|
385
|
+
obtainValidateFields: (props: Arrayable<FormItemProp>) => FormItemContext[];
|
|
386
|
+
validate: (callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
387
|
+
doValidateField: (props?: Arrayable<FormItemProp> | undefined) => Promise<boolean>;
|
|
388
|
+
validateField: (props?: Arrayable<FormItemProp> | undefined, callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
389
|
+
scrollToField: (prop: FormItemProp) => void;
|
|
329
390
|
}> & {} & {} & ComponentCustomProperties) | undefined>;
|
|
330
391
|
formState: FormState;
|
|
331
392
|
changeHandler: () => void;
|
|
@@ -394,7 +455,7 @@ declare const _default: DefineComponent<{
|
|
|
394
455
|
default: () => number;
|
|
395
456
|
};
|
|
396
457
|
size: {
|
|
397
|
-
type:
|
|
458
|
+
type: PropType<"small" | "default" | "large">;
|
|
398
459
|
};
|
|
399
460
|
inline: {
|
|
400
461
|
type: BooleanConstructor;
|
|
@@ -408,6 +469,9 @@ declare const _default: DefineComponent<{
|
|
|
408
469
|
type: StringConstructor;
|
|
409
470
|
default: string;
|
|
410
471
|
};
|
|
472
|
+
popperClass: {
|
|
473
|
+
type: StringConstructor;
|
|
474
|
+
};
|
|
411
475
|
}>> & {
|
|
412
476
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
413
477
|
"onField-input"?: ((...args: any[]) => any) | undefined;
|
|
@@ -422,49 +486,36 @@ declare const _default: DefineComponent<{
|
|
|
422
486
|
$: ComponentInternalInstance;
|
|
423
487
|
$data: {};
|
|
424
488
|
$props: Partial<{
|
|
489
|
+
size: BuildPropType<StringConstructor, "" | "small" | "default" | "large", unknown>;
|
|
425
490
|
disabled: boolean;
|
|
426
|
-
|
|
427
|
-
labelWidth:
|
|
491
|
+
rules: Partial<Record<string, Arrayable<FormItemRule>>>;
|
|
492
|
+
labelWidth: BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
428
493
|
labelSuffix: string;
|
|
494
|
+
showMessage: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
495
|
+
validateOnRuleChange: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
496
|
+
hideRequiredAsterisk: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
497
|
+
inline: boolean;
|
|
429
498
|
inlineMessage: boolean;
|
|
430
499
|
statusIcon: boolean;
|
|
431
|
-
showMessage: boolean;
|
|
432
|
-
validateOnRuleChange: boolean;
|
|
433
|
-
hideRequiredAsterisk: boolean;
|
|
434
500
|
scrollToError: boolean;
|
|
435
501
|
}> & Omit<Readonly<ExtractPropTypes<{
|
|
436
|
-
model: ObjectConstructor;
|
|
437
|
-
rules:
|
|
438
|
-
labelPosition: StringConstructor;
|
|
439
|
-
labelWidth:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
showMessage: {
|
|
451
|
-
type: BooleanConstructor;
|
|
452
|
-
default: boolean;
|
|
453
|
-
};
|
|
454
|
-
size: PropType<"small" | "default" | "large">;
|
|
455
|
-
disabled: BooleanConstructor;
|
|
456
|
-
validateOnRuleChange: {
|
|
457
|
-
type: BooleanConstructor;
|
|
458
|
-
default: boolean;
|
|
459
|
-
};
|
|
460
|
-
hideRequiredAsterisk: {
|
|
461
|
-
type: BooleanConstructor;
|
|
462
|
-
default: boolean;
|
|
463
|
-
};
|
|
464
|
-
scrollToError: BooleanConstructor;
|
|
502
|
+
readonly model: ObjectConstructor;
|
|
503
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
504
|
+
readonly labelPosition: StringConstructor;
|
|
505
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
506
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
507
|
+
readonly inline: BooleanConstructor;
|
|
508
|
+
readonly inlineMessage: BooleanConstructor;
|
|
509
|
+
readonly statusIcon: BooleanConstructor;
|
|
510
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
511
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
512
|
+
readonly disabled: BooleanConstructor;
|
|
513
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
514
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
515
|
+
readonly scrollToError: BooleanConstructor;
|
|
465
516
|
}>> & {
|
|
466
|
-
onValidate?: ((
|
|
467
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "labelWidth" | "disabled" | "inline" | "labelSuffix" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError">;
|
|
517
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
518
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "labelWidth" | "disabled" | "size" | "inline" | "rules" | "labelSuffix" | "inlineMessage" | "statusIcon" | "showMessage" | "validateOnRuleChange" | "hideRequiredAsterisk" | "scrollToError">;
|
|
468
519
|
$attrs: {
|
|
469
520
|
[x: string]: unknown;
|
|
470
521
|
};
|
|
@@ -476,57 +527,93 @@ declare const _default: DefineComponent<{
|
|
|
476
527
|
}>;
|
|
477
528
|
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
478
529
|
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
479
|
-
$emit: (event: "validate",
|
|
530
|
+
$emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
|
|
480
531
|
$el: any;
|
|
481
532
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
482
|
-
model: ObjectConstructor;
|
|
483
|
-
rules:
|
|
484
|
-
labelPosition: StringConstructor;
|
|
485
|
-
labelWidth:
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
showMessage: {
|
|
497
|
-
type: BooleanConstructor;
|
|
498
|
-
default: boolean;
|
|
499
|
-
};
|
|
500
|
-
size: PropType<"small" | "default" | "large">;
|
|
501
|
-
disabled: BooleanConstructor;
|
|
502
|
-
validateOnRuleChange: {
|
|
503
|
-
type: BooleanConstructor;
|
|
504
|
-
default: boolean;
|
|
505
|
-
};
|
|
506
|
-
hideRequiredAsterisk: {
|
|
507
|
-
type: BooleanConstructor;
|
|
508
|
-
default: boolean;
|
|
509
|
-
};
|
|
510
|
-
scrollToError: BooleanConstructor;
|
|
533
|
+
readonly model: ObjectConstructor;
|
|
534
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
535
|
+
readonly labelPosition: StringConstructor;
|
|
536
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
537
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
538
|
+
readonly inline: BooleanConstructor;
|
|
539
|
+
readonly inlineMessage: BooleanConstructor;
|
|
540
|
+
readonly statusIcon: BooleanConstructor;
|
|
541
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
542
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
543
|
+
readonly disabled: BooleanConstructor;
|
|
544
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
545
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
546
|
+
readonly scrollToError: BooleanConstructor;
|
|
511
547
|
}>> & {
|
|
512
|
-
onValidate?: ((
|
|
548
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
513
549
|
}, {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
550
|
+
COMPONENT_NAME: string;
|
|
551
|
+
props: Readonly<LooseRequired<Readonly<ExtractPropTypes<{
|
|
552
|
+
readonly model: ObjectConstructor;
|
|
553
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
554
|
+
readonly labelPosition: StringConstructor;
|
|
555
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
556
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
557
|
+
readonly inline: BooleanConstructor;
|
|
558
|
+
readonly inlineMessage: BooleanConstructor;
|
|
559
|
+
readonly statusIcon: BooleanConstructor;
|
|
560
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
561
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
562
|
+
readonly disabled: BooleanConstructor;
|
|
563
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
564
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
565
|
+
readonly scrollToError: BooleanConstructor;
|
|
566
|
+
}>> & {
|
|
567
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
568
|
+
}>>;
|
|
569
|
+
emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
|
|
570
|
+
fields: FormItemContext[];
|
|
571
|
+
formSize: ComputedRef<"" | "small" | "default" | "large">;
|
|
572
|
+
ns: {
|
|
573
|
+
namespace: ComputedRef<string>;
|
|
574
|
+
b: (blockSuffix?: string | undefined) => string;
|
|
575
|
+
e: (element?: string | undefined) => string;
|
|
576
|
+
m: (modifier?: string | undefined) => string;
|
|
577
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
578
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
579
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
580
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
581
|
+
is: {
|
|
582
|
+
(name: string, state: boolean | undefined): string;
|
|
583
|
+
(name: string): string;
|
|
584
|
+
};
|
|
585
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
586
|
+
cssVarName: (name: string) => string;
|
|
587
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
588
|
+
cssVarBlockName: (name: string) => string;
|
|
589
|
+
};
|
|
590
|
+
formClasses: ComputedRef<(string | {
|
|
591
|
+
[x: string]: string | boolean | undefined;
|
|
592
|
+
})[]>;
|
|
593
|
+
addField: (field: FormItemContext) => void;
|
|
594
|
+
removeField: (field: FormItemContext) => void;
|
|
595
|
+
resetFields: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
596
|
+
clearValidate: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
597
|
+
isValidatable: ComputedRef<boolean>;
|
|
598
|
+
obtainValidateFields: (props: Arrayable<FormItemProp>) => FormItemContext[];
|
|
599
|
+
validate: (callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
600
|
+
doValidateField: (props?: Arrayable<FormItemProp> | undefined) => Promise<boolean>;
|
|
601
|
+
validateField: (props?: Arrayable<FormItemProp> | undefined, callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
602
|
+
scrollToField: (prop: FormItemProp) => void;
|
|
603
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
604
|
+
validate: (prop: FormItemProp, isValid: boolean, message: string) => boolean;
|
|
605
|
+
}, string, {
|
|
606
|
+
size: BuildPropType<StringConstructor, "" | "small" | "default" | "large", unknown>;
|
|
521
607
|
disabled: boolean;
|
|
522
|
-
|
|
523
|
-
labelWidth:
|
|
608
|
+
rules: Partial<Record<string, Arrayable<FormItemRule>>>;
|
|
609
|
+
labelWidth: BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
524
610
|
labelSuffix: string;
|
|
611
|
+
showMessage: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
612
|
+
validateOnRuleChange: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
613
|
+
hideRequiredAsterisk: BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
614
|
+
inline: boolean;
|
|
525
615
|
inlineMessage: boolean;
|
|
526
616
|
statusIcon: boolean;
|
|
527
|
-
showMessage: boolean;
|
|
528
|
-
validateOnRuleChange: boolean;
|
|
529
|
-
hideRequiredAsterisk: boolean;
|
|
530
617
|
scrollToError: boolean;
|
|
531
618
|
}> & {
|
|
532
619
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -549,44 +636,76 @@ declare const _default: DefineComponent<{
|
|
|
549
636
|
$nextTick: typeof nextTick;
|
|
550
637
|
$watch(source: string | Function, cb: Function, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
551
638
|
} & Readonly<ExtractPropTypes<{
|
|
552
|
-
model: ObjectConstructor;
|
|
553
|
-
rules:
|
|
554
|
-
labelPosition: StringConstructor;
|
|
555
|
-
labelWidth:
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
showMessage: {
|
|
567
|
-
type: BooleanConstructor;
|
|
568
|
-
default: boolean;
|
|
569
|
-
};
|
|
570
|
-
size: PropType<"small" | "default" | "large">;
|
|
571
|
-
disabled: BooleanConstructor;
|
|
572
|
-
validateOnRuleChange: {
|
|
573
|
-
type: BooleanConstructor;
|
|
574
|
-
default: boolean;
|
|
575
|
-
};
|
|
576
|
-
hideRequiredAsterisk: {
|
|
577
|
-
type: BooleanConstructor;
|
|
578
|
-
default: boolean;
|
|
579
|
-
};
|
|
580
|
-
scrollToError: BooleanConstructor;
|
|
639
|
+
readonly model: ObjectConstructor;
|
|
640
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
641
|
+
readonly labelPosition: StringConstructor;
|
|
642
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
643
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
644
|
+
readonly inline: BooleanConstructor;
|
|
645
|
+
readonly inlineMessage: BooleanConstructor;
|
|
646
|
+
readonly statusIcon: BooleanConstructor;
|
|
647
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
648
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
649
|
+
readonly disabled: BooleanConstructor;
|
|
650
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
651
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
652
|
+
readonly scrollToError: BooleanConstructor;
|
|
581
653
|
}>> & {
|
|
582
|
-
onValidate?: ((
|
|
654
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
583
655
|
} & ShallowUnwrapRef<{
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
656
|
+
COMPONENT_NAME: string;
|
|
657
|
+
props: Readonly<LooseRequired<Readonly<ExtractPropTypes<{
|
|
658
|
+
readonly model: ObjectConstructor;
|
|
659
|
+
readonly rules: BuildPropReturn<PropWrapper<Partial<Record<string, Arrayable<FormItemRule>>>>, unknown, unknown, unknown, unknown>;
|
|
660
|
+
readonly labelPosition: StringConstructor;
|
|
661
|
+
readonly labelWidth: BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
662
|
+
readonly labelSuffix: BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
663
|
+
readonly inline: BooleanConstructor;
|
|
664
|
+
readonly inlineMessage: BooleanConstructor;
|
|
665
|
+
readonly statusIcon: BooleanConstructor;
|
|
666
|
+
readonly showMessage: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
667
|
+
readonly size: BuildPropReturn<StringConstructor, unknown, unknown, "" | "small" | "default" | "large", unknown>;
|
|
668
|
+
readonly disabled: BooleanConstructor;
|
|
669
|
+
readonly validateOnRuleChange: BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
670
|
+
readonly hideRequiredAsterisk: BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
671
|
+
readonly scrollToError: BooleanConstructor;
|
|
672
|
+
}>> & {
|
|
673
|
+
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
674
|
+
}>>;
|
|
675
|
+
emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
|
|
676
|
+
fields: FormItemContext[];
|
|
677
|
+
formSize: ComputedRef<"" | "small" | "default" | "large">;
|
|
678
|
+
ns: {
|
|
679
|
+
namespace: ComputedRef<string>;
|
|
680
|
+
b: (blockSuffix?: string | undefined) => string;
|
|
681
|
+
e: (element?: string | undefined) => string;
|
|
682
|
+
m: (modifier?: string | undefined) => string;
|
|
683
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
684
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
685
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
686
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
687
|
+
is: {
|
|
688
|
+
(name: string, state: boolean | undefined): string;
|
|
689
|
+
(name: string): string;
|
|
690
|
+
};
|
|
691
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
692
|
+
cssVarName: (name: string) => string;
|
|
693
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
694
|
+
cssVarBlockName: (name: string) => string;
|
|
695
|
+
};
|
|
696
|
+
formClasses: ComputedRef<(string | {
|
|
697
|
+
[x: string]: string | boolean | undefined;
|
|
698
|
+
})[]>;
|
|
699
|
+
addField: (field: FormItemContext) => void;
|
|
700
|
+
removeField: (field: FormItemContext) => void;
|
|
701
|
+
resetFields: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
702
|
+
clearValidate: (props?: Arrayable<FormItemProp> | undefined) => void;
|
|
703
|
+
isValidatable: ComputedRef<boolean>;
|
|
704
|
+
obtainValidateFields: (props: Arrayable<FormItemProp>) => FormItemContext[];
|
|
705
|
+
validate: (callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
706
|
+
doValidateField: (props?: Arrayable<FormItemProp> | undefined) => Promise<boolean>;
|
|
707
|
+
validateField: (props?: Arrayable<FormItemProp> | undefined, callback?: FormValidateCallback | undefined) => FormValidationResult;
|
|
708
|
+
scrollToField: (prop: FormItemProp) => void;
|
|
590
709
|
}> & {} & {} & ComponentCustomProperties) | undefined>;
|
|
591
710
|
formState: FormState;
|
|
592
711
|
changeHandler: () => void;
|
|
@@ -619,7 +738,7 @@ declare const _default: DefineComponent<{
|
|
|
619
738
|
default: () => never[];
|
|
620
739
|
};
|
|
621
740
|
labelWidth: (StringConstructor | NumberConstructor)[];
|
|
622
|
-
size: PropType<"small" | "
|
|
741
|
+
size: PropType<"small" | "default" | "large">;
|
|
623
742
|
confirmText: {
|
|
624
743
|
type: StringConstructor;
|
|
625
744
|
default: string;
|