@tmagic/form 1.0.0-beta.6 → 1.0.0-rc.10
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/README.md +1 -0
- package/dist/style.css +9 -11
- package/dist/tmagic-form.es.js +240 -145
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +243 -149
- package/dist/tmagic-form.umd.js.map +1 -1
- 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/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/DynamicField.vue.d.ts +2 -2
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/schema.d.ts +10 -0
- package/package.json +17 -7
- package/src/Form.vue +7 -2
- package/src/FormDialog.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Container.vue +42 -12
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Row.vue +13 -17
- package/src/containers/Table.vue +15 -7
- package/src/containers/Tabs.vue +13 -5
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Daterange.vue +8 -0
- package/src/fields/Link.vue +1 -1
- package/src/fields/Select.vue +11 -15
- package/src/fields/Text.vue +4 -4
- package/src/fields/Textarea.vue +11 -13
- package/src/schema.ts +10 -0
- package/src/theme/form.scss +24 -17
- package/src/utils/form.ts +7 -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/Table.vue.d.ts +0 -1403
- package/dist/types/src/fields/Cascader.vue.d.ts +0 -1748
- package/dist/types/src/fields/Link.vue.d.ts +0 -1358
- package/dist/types/src/fields/Select.vue.d.ts +0 -975
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -27
package/src/fields/Checkbox.vue
CHANGED
|
@@ -43,7 +43,7 @@ export default defineComponent({
|
|
|
43
43
|
return props.config.activeValue;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return undefined;
|
|
47
47
|
}),
|
|
48
48
|
|
|
49
49
|
inactiveValue: computed(() => {
|
|
@@ -55,7 +55,7 @@ export default defineComponent({
|
|
|
55
55
|
return props.config.inactiveValue;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
return
|
|
58
|
+
return undefined;
|
|
59
59
|
}),
|
|
60
60
|
|
|
61
61
|
changeHandler(value: number | boolean) {
|
package/src/fields/Daterange.vue
CHANGED
|
@@ -60,6 +60,14 @@ export default defineComponent({
|
|
|
60
60
|
});
|
|
61
61
|
} else if (props.model && props.name && v instanceof Date) {
|
|
62
62
|
props.model[props.name] = datetimeFormatter(v.toString(), '');
|
|
63
|
+
} else if (names?.length) {
|
|
64
|
+
names.forEach((item) => {
|
|
65
|
+
if (props.model) {
|
|
66
|
+
props.model[item] = undefined;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
} else if (props.name) {
|
|
70
|
+
props.model[props.name] = undefined;
|
|
63
71
|
}
|
|
64
72
|
};
|
|
65
73
|
|
package/src/fields/Link.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<a v-if="config.href && !disabled" target="_blank" :href="href" :style="config.css || {}">{{ displayText }}</a>
|
|
3
3
|
<span v-else-if="config.href && disabled" :style="config.disabledCss || {}">{{ displayText }}</span>
|
|
4
4
|
<div v-else class="m-fields-link">
|
|
5
|
-
<el-button type="
|
|
5
|
+
<el-button text type="primary" @click="editHandler">点击编辑</el-button>
|
|
6
6
|
<m-form-dialog
|
|
7
7
|
ref="editor"
|
|
8
8
|
:title="config.formTitle || '编辑扩展配置'"
|
package/src/fields/Select.vue
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
ref="select"
|
|
8
8
|
clearable
|
|
9
9
|
filterable
|
|
10
|
+
:popper-class="`m-select-popper ${popperClass}`"
|
|
10
11
|
:size="size"
|
|
11
12
|
:remote="remote"
|
|
12
13
|
:placeholder="config.placeholder"
|
|
@@ -14,20 +15,15 @@
|
|
|
14
15
|
:value-key="config.valueKey || 'value'"
|
|
15
16
|
:allow-create="config.allowCreate"
|
|
16
17
|
:disabled="disabled"
|
|
17
|
-
:remote-method="remoteMethod"
|
|
18
|
+
:remote-method="config.remote && remoteMethod"
|
|
18
19
|
@change="changeHandler"
|
|
19
20
|
@visible-change="visibleHandler"
|
|
20
21
|
>
|
|
21
22
|
<template v-if="config.group">
|
|
22
|
-
<el-option-group
|
|
23
|
-
v-for="(group, index) in options"
|
|
24
|
-
:key="group.label + index"
|
|
25
|
-
:label="group.label"
|
|
26
|
-
:disabled="group.disabled"
|
|
27
|
-
>
|
|
23
|
+
<el-option-group v-for="(group, index) in options" :key="index" :label="group.label" :disabled="group.disabled">
|
|
28
24
|
<el-option
|
|
29
25
|
v-for="(item, index) in group.options"
|
|
30
|
-
:key="
|
|
26
|
+
:key="index"
|
|
31
27
|
:label="item.label"
|
|
32
28
|
:value="item.value"
|
|
33
29
|
:disabled="item.disabled"
|
|
@@ -138,6 +134,7 @@ export default defineComponent({
|
|
|
138
134
|
model: props.model,
|
|
139
135
|
formValue: mForm?.values,
|
|
140
136
|
formValues: mForm?.values,
|
|
137
|
+
config: props.config,
|
|
141
138
|
}) as Record<string, any>;
|
|
142
139
|
}
|
|
143
140
|
|
|
@@ -167,6 +164,7 @@ export default defineComponent({
|
|
|
167
164
|
model: props.model,
|
|
168
165
|
formValue: mForm?.values,
|
|
169
166
|
formValues: mForm?.values,
|
|
167
|
+
config: props.config,
|
|
170
168
|
});
|
|
171
169
|
}
|
|
172
170
|
|
|
@@ -288,8 +286,10 @@ export default defineComponent({
|
|
|
288
286
|
Promise.resolve(
|
|
289
287
|
props.config.options(mForm, {
|
|
290
288
|
model: props.model,
|
|
289
|
+
prop: props.prop,
|
|
291
290
|
formValues: mForm?.values,
|
|
292
291
|
formValue: mForm?.values,
|
|
292
|
+
config: props.config,
|
|
293
293
|
}),
|
|
294
294
|
).then((data) => {
|
|
295
295
|
options.value = data;
|
|
@@ -346,13 +346,14 @@ export default defineComponent({
|
|
|
346
346
|
remote,
|
|
347
347
|
options,
|
|
348
348
|
moreLoadingVisible,
|
|
349
|
+
popperClass: mForm?.popperClass,
|
|
350
|
+
|
|
351
|
+
getOptions,
|
|
349
352
|
|
|
350
353
|
getRequestFuc() {
|
|
351
354
|
return getConfig('request');
|
|
352
355
|
},
|
|
353
356
|
|
|
354
|
-
async getInitOption() {},
|
|
355
|
-
|
|
356
357
|
changeHandler(value: any) {
|
|
357
358
|
emit('change', value);
|
|
358
359
|
},
|
|
@@ -370,11 +371,6 @@ export default defineComponent({
|
|
|
370
371
|
}
|
|
371
372
|
},
|
|
372
373
|
|
|
373
|
-
async editAfterAction() {
|
|
374
|
-
pgIndex.value = 0;
|
|
375
|
-
options.value = await getOptions();
|
|
376
|
-
},
|
|
377
|
-
|
|
378
374
|
async remoteMethod(q: string) {
|
|
379
375
|
if (!localOptions.value.length) {
|
|
380
376
|
query.value = q;
|
package/src/fields/Text.vue
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
<el-button
|
|
15
15
|
v-if="typeof config.append === 'object' && config.append.type === 'button'"
|
|
16
16
|
style="color: #409eff"
|
|
17
|
-
|
|
17
|
+
:size="size"
|
|
18
|
+
@click.prevent="buttonClickHandler"
|
|
18
19
|
>
|
|
19
20
|
{{ config.append.text }}
|
|
20
21
|
</el-button>
|
|
@@ -43,6 +44,8 @@ export default defineComponent({
|
|
|
43
44
|
emits: ['change', 'input'],
|
|
44
45
|
|
|
45
46
|
setup(props, { emit }) {
|
|
47
|
+
const mForm = inject<FormState | undefined>('mForm');
|
|
48
|
+
|
|
46
49
|
useAddField(props.prop);
|
|
47
50
|
|
|
48
51
|
const modelName = computed(() => props.name || props.config.name || '');
|
|
@@ -54,14 +57,11 @@ export default defineComponent({
|
|
|
54
57
|
},
|
|
55
58
|
|
|
56
59
|
inputHandler(v: string | number) {
|
|
57
|
-
const mForm = inject<FormState | undefined>('mForm');
|
|
58
60
|
emit('input', v);
|
|
59
61
|
mForm?.$emit('field-input', props.prop, v);
|
|
60
62
|
},
|
|
61
63
|
|
|
62
64
|
buttonClickHandler() {
|
|
63
|
-
const mForm = inject<FormState | undefined>('mForm');
|
|
64
|
-
|
|
65
65
|
if (typeof props.config.append === 'string') return;
|
|
66
66
|
|
|
67
67
|
if (props.config.append?.handler) {
|
package/src/fields/Textarea.vue
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</el-input>
|
|
14
|
-
</div>
|
|
2
|
+
<el-input
|
|
3
|
+
v-model="model[name]"
|
|
4
|
+
type="textarea"
|
|
5
|
+
:size="size"
|
|
6
|
+
clearable
|
|
7
|
+
:placeholder="config.placeholder"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
@change="changeHandler"
|
|
10
|
+
@input="inputHandler"
|
|
11
|
+
>
|
|
12
|
+
</el-input>
|
|
15
13
|
</template>
|
|
16
14
|
|
|
17
15
|
<script lang="ts">
|
package/src/schema.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export type FormState = {
|
|
23
23
|
config: FormConfig;
|
|
24
|
+
popperClass?: string;
|
|
24
25
|
initValues: FormValue;
|
|
25
26
|
values: FormValue;
|
|
26
27
|
$emit: (event: string, ...args: any[]) => void;
|
|
@@ -119,6 +120,7 @@ export interface Rule {
|
|
|
119
120
|
/** 整个表单的值 */
|
|
120
121
|
formValue: FormValue;
|
|
121
122
|
prop: string;
|
|
123
|
+
config: any;
|
|
122
124
|
},
|
|
123
125
|
mForm: FormState | undefined,
|
|
124
126
|
) => void;
|
|
@@ -144,6 +146,7 @@ type FilterFunction = (
|
|
|
144
146
|
parent?: Record<any, any>;
|
|
145
147
|
formValue: Record<any, any>;
|
|
146
148
|
prop: string;
|
|
149
|
+
config: any;
|
|
147
150
|
},
|
|
148
151
|
) => boolean;
|
|
149
152
|
|
|
@@ -155,6 +158,7 @@ type OnChangeHandler = (
|
|
|
155
158
|
values: Record<any, any>;
|
|
156
159
|
parent?: Record<any, any>;
|
|
157
160
|
formValue: Record<any, any>;
|
|
161
|
+
config: any;
|
|
158
162
|
},
|
|
159
163
|
) => any;
|
|
160
164
|
|
|
@@ -187,8 +191,10 @@ type SelectOptionFunction = (
|
|
|
187
191
|
mForm: FormState | undefined,
|
|
188
192
|
data: {
|
|
189
193
|
model: any;
|
|
194
|
+
prop?: string;
|
|
190
195
|
formValues: any;
|
|
191
196
|
formValue: any;
|
|
197
|
+
config: any;
|
|
192
198
|
},
|
|
193
199
|
) => SelectOption[] | SelectGroupOption[];
|
|
194
200
|
|
|
@@ -198,6 +204,7 @@ type RemoteSelectOptionBodyFunction = (
|
|
|
198
204
|
model: any;
|
|
199
205
|
formValue: any;
|
|
200
206
|
formValues: any;
|
|
207
|
+
config: any;
|
|
201
208
|
},
|
|
202
209
|
) => Record<string, any>;
|
|
203
210
|
|
|
@@ -208,6 +215,7 @@ type RemoteSelectOptionRequestFunction = (
|
|
|
208
215
|
model: any;
|
|
209
216
|
formValue: any;
|
|
210
217
|
formValues: any;
|
|
218
|
+
config: any;
|
|
211
219
|
},
|
|
212
220
|
) => any;
|
|
213
221
|
|
|
@@ -498,6 +506,7 @@ export interface TabPaneConfig {
|
|
|
498
506
|
lazy?: boolean;
|
|
499
507
|
labelWidth?: string;
|
|
500
508
|
items: FormConfig;
|
|
509
|
+
[key: string]: any;
|
|
501
510
|
}
|
|
502
511
|
export interface TabConfig extends FormItem, ContainerCommonConfig {
|
|
503
512
|
type: 'tab' | 'dynamic-tab';
|
|
@@ -538,6 +547,7 @@ export interface ColumnConfig extends FormItem, ContainerCommonConfig {
|
|
|
538
547
|
label: string;
|
|
539
548
|
width: string | number;
|
|
540
549
|
sortable: boolean;
|
|
550
|
+
[key: string]: any;
|
|
541
551
|
}
|
|
542
552
|
|
|
543
553
|
/**
|
package/src/theme/form.scss
CHANGED
|
@@ -2,29 +2,36 @@
|
|
|
2
2
|
.fade-leave-active {
|
|
3
3
|
transition: opacity 0.5s;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
|
6
7
|
opacity: 0;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
.m-form
|
|
10
|
-
.m-form-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
.m-form {
|
|
11
|
+
.m-form-tip {
|
|
12
|
+
color: rgba(0, 0, 0, 0.45);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
15
|
+
}
|
|
14
16
|
|
|
15
|
-
.m-form
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
.m-form-schematic {
|
|
18
|
+
max-width: 50%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
.el-table {
|
|
23
|
+
.cell > div.m-form-container {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.el-tabs {
|
|
29
|
+
margin-bottom: 10px;
|
|
30
|
+
}
|
|
25
31
|
|
|
26
|
-
.el-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
.el-form-item.hidden {
|
|
33
|
+
.el-form-item__label {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
29
36
|
}
|
|
30
37
|
}
|
package/src/utils/form.ts
CHANGED
|
@@ -122,7 +122,11 @@ const initValueItem = function (
|
|
|
122
122
|
// 这种情况比较多,提前结束
|
|
123
123
|
if (name && !items && typeof initValue[name] !== 'undefined') {
|
|
124
124
|
if (typeof value[name] === 'undefined') {
|
|
125
|
-
|
|
125
|
+
if (type === 'number') {
|
|
126
|
+
value[name] = Number(initValue[name]);
|
|
127
|
+
} else {
|
|
128
|
+
value[name] = typeof initValue[name] === 'object' ? cloneDeep(initValue[name]) : initValue[name];
|
|
129
|
+
}
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
return value;
|
|
@@ -197,6 +201,7 @@ export const filterFunction = (mForm: FormState | undefined, config: any, props:
|
|
|
197
201
|
parent: mForm?.parentValues || {},
|
|
198
202
|
formValue: mForm?.values || props.model,
|
|
199
203
|
prop: props.prop,
|
|
204
|
+
config: props.config,
|
|
200
205
|
});
|
|
201
206
|
};
|
|
202
207
|
|
|
@@ -238,6 +243,7 @@ export const getRules = function (mForm: FormState | undefined, rules: Rule[] |
|
|
|
238
243
|
parent: mForm?.parentValues || {},
|
|
239
244
|
formValue: mForm?.values || props.model,
|
|
240
245
|
prop: props.prop,
|
|
246
|
+
config: props.config,
|
|
241
247
|
},
|
|
242
248
|
mForm,
|
|
243
249
|
);
|
|
@@ -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;
|