@tmagic/form 1.6.1 → 1.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +23 -3
- package/dist/tmagic-form.js +1741 -1501
- package/dist/tmagic-form.umd.cjs +1774 -1530
- package/package.json +4 -4
- package/src/Form.vue +70 -9
- package/src/containers/Container.vue +109 -134
- package/src/containers/Fieldset.vue +31 -7
- package/src/containers/FlexLayout.vue +59 -0
- package/src/containers/Tabs.vue +11 -1
- package/src/fields/Cascader.vue +25 -16
- package/src/fields/Checkbox.vue +3 -3
- package/src/fields/CheckboxGroup.vue +1 -1
- package/src/fields/ColorPicker.vue +2 -2
- package/src/fields/Date.vue +2 -2
- package/src/fields/DateTime.vue +2 -2
- package/src/fields/Daterange.vue +2 -2
- package/src/fields/Number.vue +2 -2
- package/src/fields/NumberRange.vue +6 -6
- package/src/fields/RadioGroup.vue +7 -15
- package/src/fields/Select.vue +2 -2
- package/src/fields/Switch.vue +2 -2
- package/src/fields/Text.vue +20 -8
- package/src/fields/Textarea.vue +3 -2
- package/src/fields/Time.vue +2 -2
- package/src/fields/Timerange.vue +2 -2
- package/src/index.ts +5 -2
- package/src/table/ActionsColumn.vue +97 -0
- package/src/table/SortColumn.vue +101 -0
- package/src/table/Table.vue +170 -0
- package/src/table/type.ts +18 -0
- package/src/table/useAdd.ts +111 -0
- package/src/table/useFullscreen.ts +28 -0
- package/src/table/useImport.ts +68 -0
- package/src/table/usePagination.ts +30 -0
- package/src/table/useSelection.ts +34 -0
- package/src/table/useSortable.ts +48 -0
- package/src/table/useTableColumns.ts +194 -0
- package/src/theme/container.scss +17 -0
- package/src/theme/form.scss +15 -3
- package/src/utils/form.ts +56 -2
- package/types/index.d.ts +65 -36
- package/src/containers/Table.vue +0 -681
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { computed, h, inject, type Ref } from 'vue';
|
|
2
|
+
import { cloneDeep } from 'lodash-es';
|
|
3
|
+
|
|
4
|
+
import type { TableColumnOptions } from '@tmagic/design';
|
|
5
|
+
import type { FormState, TableColumnConfig } from '@tmagic/form-schema';
|
|
6
|
+
|
|
7
|
+
import Container from '../containers/Container.vue';
|
|
8
|
+
import type { ContainerChangeEventData } from '../schema';
|
|
9
|
+
import { display as displayFunc, getDataByPage, sortArray } from '../utils/form';
|
|
10
|
+
|
|
11
|
+
import ActionsColumn from './ActionsColumn.vue';
|
|
12
|
+
import SortColumn from './SortColumn.vue';
|
|
13
|
+
import type { TableProps } from './type';
|
|
14
|
+
|
|
15
|
+
export const useTableColumns = (
|
|
16
|
+
props: TableProps,
|
|
17
|
+
emit: (event: 'select' | 'change' | 'addDiffCount', ...args: any[]) => void,
|
|
18
|
+
currentPage: Ref<number>,
|
|
19
|
+
pageSize: Ref<number>,
|
|
20
|
+
modelName: Ref<string | number>,
|
|
21
|
+
) => {
|
|
22
|
+
const mForm = inject<FormState | undefined>('mForm');
|
|
23
|
+
|
|
24
|
+
const display = (fuc: any) => displayFunc(mForm, fuc, props);
|
|
25
|
+
|
|
26
|
+
const lastData = computed(() =>
|
|
27
|
+
props.config.pagination
|
|
28
|
+
? getDataByPage(props.lastValues[modelName.value], currentPage.value, pageSize.value)
|
|
29
|
+
: props.lastValues[modelName.value] || [],
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const itemExtra = (fuc: any, index: number) => {
|
|
33
|
+
if (typeof fuc === 'function') {
|
|
34
|
+
return fuc(mForm, {
|
|
35
|
+
values: mForm?.initValues,
|
|
36
|
+
model: props.model,
|
|
37
|
+
formValue: mForm ? mForm.values : props.model,
|
|
38
|
+
prop: props.prop,
|
|
39
|
+
index,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return fuc;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const selection = computed(() => {
|
|
47
|
+
if (typeof props.config.selection === 'function') {
|
|
48
|
+
return props.config.selection(mForm, { model: props.model[modelName.value] });
|
|
49
|
+
}
|
|
50
|
+
return props.config.selection;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const getProp = (index: number) => {
|
|
54
|
+
return `${props.prop}${props.prop ? '.' : ''}${index + 1 + currentPage.value * pageSize.value - 1}`;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const makeConfig = (config: TableColumnConfig, row: any) => {
|
|
58
|
+
const newConfig = cloneDeep(config);
|
|
59
|
+
if (typeof config.itemsFunction === 'function') {
|
|
60
|
+
newConfig.items = config.itemsFunction(row);
|
|
61
|
+
}
|
|
62
|
+
delete newConfig.display;
|
|
63
|
+
return newConfig;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const changeHandler = (v: any, eventData: ContainerChangeEventData) => {
|
|
67
|
+
emit('change', props.model, eventData);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const onAddDiffCount = () => emit('addDiffCount');
|
|
71
|
+
|
|
72
|
+
const columns = computed<TableColumnOptions[]>(() => {
|
|
73
|
+
const columns: TableColumnOptions[] = [];
|
|
74
|
+
|
|
75
|
+
if (props.config.itemExtra && !props.config.dropSort) {
|
|
76
|
+
columns.push({
|
|
77
|
+
props: {
|
|
78
|
+
fixed: 'left',
|
|
79
|
+
width: 30,
|
|
80
|
+
type: 'expand',
|
|
81
|
+
},
|
|
82
|
+
cell: ({ $index }: any) =>
|
|
83
|
+
h('span', {
|
|
84
|
+
innerHTML: itemExtra(props.config.itemExtra, $index),
|
|
85
|
+
class: 'm-form-tip',
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
columns.push({
|
|
91
|
+
props: {
|
|
92
|
+
label: '操作',
|
|
93
|
+
fixed: props.config.fixed === false ? undefined : 'left',
|
|
94
|
+
width: props.config.operateColWidth || 112,
|
|
95
|
+
align: 'center',
|
|
96
|
+
},
|
|
97
|
+
cell: ({ row, $index }: any) =>
|
|
98
|
+
h(ActionsColumn, {
|
|
99
|
+
row,
|
|
100
|
+
index: $index,
|
|
101
|
+
model: props.model,
|
|
102
|
+
config: props.config,
|
|
103
|
+
prop: props.prop,
|
|
104
|
+
disabled: props.disabled,
|
|
105
|
+
sortKey: props.sortKey,
|
|
106
|
+
name: modelName.value,
|
|
107
|
+
currentPage: currentPage.value,
|
|
108
|
+
pageSize: pageSize.value,
|
|
109
|
+
onChange: (v: any) => {
|
|
110
|
+
emit('change', v);
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
if (props.sort && props.model[modelName.value] && props.model[modelName.value].length > 1) {
|
|
116
|
+
columns.push({
|
|
117
|
+
props: {
|
|
118
|
+
label: '排序',
|
|
119
|
+
width: 80,
|
|
120
|
+
},
|
|
121
|
+
cell: ({ $index }: any) =>
|
|
122
|
+
h(SortColumn, {
|
|
123
|
+
index: $index,
|
|
124
|
+
model: props.model,
|
|
125
|
+
disabled: props.disabled,
|
|
126
|
+
name: modelName.value,
|
|
127
|
+
currentPage: currentPage.value,
|
|
128
|
+
pageSize: pageSize.value,
|
|
129
|
+
onSwap: (index1: number, index2: number) => {
|
|
130
|
+
const newData = sortArray(props.model[modelName.value], index1, index2, props.sortKey);
|
|
131
|
+
emit('change', newData);
|
|
132
|
+
mForm?.$emit('field-change', newData);
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (selection.value) {
|
|
139
|
+
columns.push({
|
|
140
|
+
props: {
|
|
141
|
+
align: 'center',
|
|
142
|
+
headerAlign: 'center',
|
|
143
|
+
type: 'selection',
|
|
144
|
+
width: 45,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (props.showIndex && props.config.showIndex) {
|
|
150
|
+
columns.push({
|
|
151
|
+
props: {
|
|
152
|
+
label: '序号',
|
|
153
|
+
width: 60,
|
|
154
|
+
},
|
|
155
|
+
cell: ({ $index }: any) => h('span', $index + 1 + currentPage.value * pageSize.value),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
for (const column of props.config.items) {
|
|
160
|
+
if (column.type !== 'hidden' && display(column.display)) {
|
|
161
|
+
columns.push({
|
|
162
|
+
props: {
|
|
163
|
+
prop: column.name,
|
|
164
|
+
label: column.label,
|
|
165
|
+
width: column.width,
|
|
166
|
+
sortable: column.sortable,
|
|
167
|
+
sortOrders: ['ascending', 'descending'],
|
|
168
|
+
class: props.config.dropSort === true ? 'el-table__column--dropable' : '',
|
|
169
|
+
},
|
|
170
|
+
cell: ({ row, $index }: any) =>
|
|
171
|
+
h(Container, {
|
|
172
|
+
labelWidth: '0',
|
|
173
|
+
disabled: props.disabled,
|
|
174
|
+
prop: getProp($index),
|
|
175
|
+
rules: column.rules,
|
|
176
|
+
config: makeConfig(column, row),
|
|
177
|
+
model: row,
|
|
178
|
+
lastValues: lastData.value[$index],
|
|
179
|
+
isCompare: props.isCompare,
|
|
180
|
+
size: props.size,
|
|
181
|
+
onChange: changeHandler,
|
|
182
|
+
onAddDiffCount,
|
|
183
|
+
}),
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return columns;
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
columns,
|
|
193
|
+
};
|
|
194
|
+
};
|
package/src/theme/container.scss
CHANGED
|
@@ -3,3 +3,20 @@
|
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
.m-form-container {
|
|
8
|
+
&.has-tip {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: baseline;
|
|
11
|
+
|
|
12
|
+
.tmagic-design-form-item {
|
|
13
|
+
flex: 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tmagic-design-form-item {
|
|
18
|
+
&.show-diff {
|
|
19
|
+
background: #f7dadd;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/theme/form.scss
CHANGED
|
@@ -19,17 +19,21 @@
|
|
|
19
19
|
height: 100%;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.
|
|
22
|
+
.tmagic-design-table {
|
|
23
23
|
.cell > div.m-form-container {
|
|
24
24
|
display: block;
|
|
25
|
+
|
|
26
|
+
&.has-tip {
|
|
27
|
+
display: flex;
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
.
|
|
32
|
+
.tmagic-design-tabs {
|
|
29
33
|
margin-bottom: 10px;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
|
-
.
|
|
36
|
+
.tmagic-design-form-item.tmagic-form-hidden {
|
|
33
37
|
> .el-form-item__label {
|
|
34
38
|
display: none;
|
|
35
39
|
}
|
|
@@ -39,5 +43,13 @@
|
|
|
39
43
|
> .t-form__label {
|
|
40
44
|
display: none;
|
|
41
45
|
}
|
|
46
|
+
|
|
47
|
+
> .t-form__controls {
|
|
48
|
+
margin-left: 0 !important;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.t-form:not(.t-form-inline) .t-form__item:last-of-type {
|
|
53
|
+
margin-bottom: var(--td-comp-margin-xxl);
|
|
42
54
|
}
|
|
43
55
|
}
|
package/src/utils/form.ts
CHANGED
|
@@ -21,6 +21,8 @@ import dayjs from 'dayjs';
|
|
|
21
21
|
import utc from 'dayjs/plugin/utc';
|
|
22
22
|
import { cloneDeep } from 'lodash-es';
|
|
23
23
|
|
|
24
|
+
import { getValueByKeyPath } from '@tmagic/utils';
|
|
25
|
+
|
|
24
26
|
import {
|
|
25
27
|
ChildConfig,
|
|
26
28
|
ContainerCommonConfig,
|
|
@@ -31,6 +33,7 @@ import {
|
|
|
31
33
|
FormValue,
|
|
32
34
|
HtmlField,
|
|
33
35
|
Rule,
|
|
36
|
+
SortProp,
|
|
34
37
|
TabPaneConfig,
|
|
35
38
|
TypeFunction,
|
|
36
39
|
} from '../schema';
|
|
@@ -89,8 +92,13 @@ const setValue = (mForm: FormState | undefined, value: FormValue, initValue: For
|
|
|
89
92
|
|
|
90
93
|
// 如果fieldset配置checkbox,checkbox的值保存在value中
|
|
91
94
|
if (type === 'fieldset' && checkbox) {
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
const checkboxName = typeof checkbox === 'object' && typeof checkbox.name === 'string' ? checkbox.name : 'value';
|
|
96
|
+
const checkboxFalseValue =
|
|
97
|
+
typeof checkbox === 'object' && typeof checkbox.falseValue !== 'undefined' ? checkbox.falseValue : 0;
|
|
98
|
+
|
|
99
|
+
if (name && typeof value[name] === 'object') {
|
|
100
|
+
value[name][checkboxName] =
|
|
101
|
+
typeof initValue[name] === 'object' ? initValue[name][checkboxName] || checkboxFalseValue : checkboxFalseValue;
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
};
|
|
@@ -136,6 +144,18 @@ const initValueItem = function (
|
|
|
136
144
|
|
|
137
145
|
setValue(mForm, value, initValue, item);
|
|
138
146
|
|
|
147
|
+
if (type === 'table') {
|
|
148
|
+
if (item.defautSort) {
|
|
149
|
+
sortChange(value[name], item.defautSort);
|
|
150
|
+
} else if (item.defaultSort) {
|
|
151
|
+
sortChange(value[name], item.defaultSort);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (item.sort && item.sortKey) {
|
|
155
|
+
value[name].sort((a: any, b: any) => b[item.sortKey] - a[item.sortKey]);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
139
159
|
return value;
|
|
140
160
|
};
|
|
141
161
|
|
|
@@ -197,6 +217,7 @@ export const filterFunction = <T = any>(
|
|
|
197
217
|
prop: props.prop,
|
|
198
218
|
config: props.config,
|
|
199
219
|
index: props.index,
|
|
220
|
+
getFormValue: (prop: string) => getValueByKeyPath(prop, mForm?.values || props.model),
|
|
200
221
|
});
|
|
201
222
|
}
|
|
202
223
|
|
|
@@ -297,3 +318,36 @@ export const datetimeFormatter = (
|
|
|
297
318
|
}
|
|
298
319
|
return defaultValue;
|
|
299
320
|
};
|
|
321
|
+
|
|
322
|
+
export const getDataByPage = (data: any[] = [], pagecontext: number, pagesize: number) =>
|
|
323
|
+
data.filter(
|
|
324
|
+
(item: any, index: number) => index >= pagecontext * pagesize && index + 1 <= (pagecontext + 1) * pagesize,
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
export const sortArray = (data: any[], newIndex: number, oldIndex: number, sortKey?: string) => {
|
|
328
|
+
if (newIndex === oldIndex) {
|
|
329
|
+
return data;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (newIndex < 0 || newIndex >= data.length || oldIndex < 0 || oldIndex >= data.length) {
|
|
333
|
+
return data;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const newData = data.toSpliced(newIndex, 0, ...data.splice(oldIndex, 1));
|
|
337
|
+
|
|
338
|
+
if (sortKey) {
|
|
339
|
+
for (let i = newData.length - 1, v = 0; i >= 0; i--, v++) {
|
|
340
|
+
newData[v][sortKey] = i;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return newData;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
export const sortChange = (data: any[], { prop, order }: SortProp) => {
|
|
348
|
+
if (order === 'ascending') {
|
|
349
|
+
data = data.sort((a: any, b: any) => a[prop] - b[prop]);
|
|
350
|
+
} else if (order === 'descending') {
|
|
351
|
+
data = data.sort((a: any, b: any) => b[prop] - a[prop]);
|
|
352
|
+
}
|
|
353
|
+
};
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
2
|
import * as _tmagic_form_schema from '@tmagic/form-schema';
|
|
3
|
-
import { FormState, FormConfig, TabPaneConfig, FormValue, FilterFunction, Rule, ChildConfig, FieldsetConfig, PanelConfig, RowConfig, TabConfig, TableConfig, GroupListConfig, FieldProps, TextConfig, NumberConfig, NumberRangeConfig, TextareaConfig, HiddenConfig, DateConfig, DateTimeConfig, TimeConfig, CheckboxConfig, SwitchConfig, DaterangeConfig, ColorPickConfig, CheckboxGroupConfig, RadioGroupConfig, DisplayConfig, LinkConfig, SelectConfig, SelectOption, SelectGroupOption, CascaderConfig, DynamicFieldConfig } from '@tmagic/form-schema';
|
|
3
|
+
import { FormState, FormConfig, TabPaneConfig, FormValue, FilterFunction, Rule, SortProp, ChildConfig, FieldsetConfig, FlexLayoutConfig, PanelConfig, RowConfig, TabConfig, TableConfig, GroupListConfig, FieldProps, TextConfig, NumberConfig, NumberRangeConfig, TextareaConfig, HiddenConfig, DateConfig, DateTimeConfig, TimeConfig, CheckboxConfig, SwitchConfig, DaterangeConfig, ColorPickConfig, CheckboxGroupConfig, RadioGroupConfig, DisplayConfig, LinkConfig, SelectConfig, SelectOption, SelectGroupOption, CascaderConfig, DynamicFieldConfig } from '@tmagic/form-schema';
|
|
4
4
|
export * from '@tmagic/form-schema';
|
|
5
5
|
import * as _vue_runtime_core from '@vue/runtime-core';
|
|
6
6
|
import * as _vue_reactivity from '@vue/reactivity';
|
|
@@ -28,6 +28,9 @@ declare const initValue: (mForm: FormState | undefined, { initValues, config }:
|
|
|
28
28
|
config: FormConfig;
|
|
29
29
|
}) => Promise<FormValue>;
|
|
30
30
|
declare const datetimeFormatter: (v: string | Date, defaultValue?: string, format?: string) => string | number;
|
|
31
|
+
declare const getDataByPage: (data: any[] | undefined, pagecontext: number, pagesize: number) => any[];
|
|
32
|
+
declare const sortArray: (data: any[], newIndex: number, oldIndex: number, sortKey?: string) => any[];
|
|
33
|
+
declare const sortChange: (data: any[], { prop, order }: SortProp) => void;
|
|
31
34
|
|
|
32
35
|
declare const useAddField: (prop?: string) => void;
|
|
33
36
|
|
|
@@ -53,7 +56,7 @@ type __VLS_Props$u = {
|
|
|
53
56
|
preventSubmitDefault?: boolean;
|
|
54
57
|
extendState?: (_state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
55
58
|
};
|
|
56
|
-
declare const __VLS_export$
|
|
59
|
+
declare const __VLS_export$v: _vue_runtime_core.DefineComponent<__VLS_Props$u, {
|
|
57
60
|
values: _vue_reactivity.Ref<FormValue, FormValue>;
|
|
58
61
|
lastValuesProcessed: _vue_reactivity.Ref<FormValue, FormValue>;
|
|
59
62
|
formState: FormState;
|
|
@@ -62,6 +65,7 @@ declare const __VLS_export$u: _vue_runtime_core.DefineComponent<__VLS_Props$u, {
|
|
|
62
65
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
63
66
|
resetForm: () => void;
|
|
64
67
|
submitForm: (native?: boolean) => Promise<any>;
|
|
68
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
65
69
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
66
70
|
change: (...args: any[]) => void;
|
|
67
71
|
error: (...args: any[]) => void;
|
|
@@ -88,7 +92,7 @@ declare const __VLS_export$u: _vue_runtime_core.DefineComponent<__VLS_Props$u, {
|
|
|
88
92
|
parentValues: Record<string, any>;
|
|
89
93
|
stepActive: string | number;
|
|
90
94
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
91
|
-
declare const _default$
|
|
95
|
+
declare const _default$w: typeof __VLS_export$v;
|
|
92
96
|
|
|
93
97
|
type __VLS_Props$t = {
|
|
94
98
|
config?: FormConfig;
|
|
@@ -149,6 +153,7 @@ declare const __VLS_base$4: _vue_runtime_core.DefineComponent<__VLS_Props$t, {
|
|
|
149
153
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
150
154
|
resetForm: () => void;
|
|
151
155
|
submitForm: (native?: boolean) => Promise<any>;
|
|
156
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
152
157
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
153
158
|
change: (...args: any[]) => void;
|
|
154
159
|
error: (...args: any[]) => void;
|
|
@@ -207,6 +212,7 @@ declare const __VLS_base$4: _vue_runtime_core.DefineComponent<__VLS_Props$t, {
|
|
|
207
212
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
208
213
|
resetForm: () => void;
|
|
209
214
|
submitForm: (native?: boolean) => Promise<any>;
|
|
215
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
210
216
|
}, {}, {}, {}, {
|
|
211
217
|
disabled: boolean;
|
|
212
218
|
labelWidth: string;
|
|
@@ -252,6 +258,7 @@ declare const __VLS_base$4: _vue_runtime_core.DefineComponent<__VLS_Props$t, {
|
|
|
252
258
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
253
259
|
resetForm: () => void;
|
|
254
260
|
submitForm: (native?: boolean) => Promise<any>;
|
|
261
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
255
262
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
256
263
|
change: (...args: any[]) => void;
|
|
257
264
|
error: (...args: any[]) => void;
|
|
@@ -310,6 +317,7 @@ declare const __VLS_base$4: _vue_runtime_core.DefineComponent<__VLS_Props$t, {
|
|
|
310
317
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
311
318
|
resetForm: () => void;
|
|
312
319
|
submitForm: (native?: boolean) => Promise<any>;
|
|
320
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
313
321
|
}, {}, {}, {}, {
|
|
314
322
|
disabled: boolean;
|
|
315
323
|
labelWidth: string;
|
|
@@ -345,8 +353,8 @@ declare const __VLS_base$4: _vue_runtime_core.DefineComponent<__VLS_Props$t, {
|
|
|
345
353
|
config: FormConfig;
|
|
346
354
|
confirmText: string;
|
|
347
355
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
348
|
-
declare const __VLS_export$
|
|
349
|
-
declare const _default$
|
|
356
|
+
declare const __VLS_export$u: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
|
|
357
|
+
declare const _default$v: typeof __VLS_export$u;
|
|
350
358
|
|
|
351
359
|
type __VLS_WithSlots$4<T, S> = T & {
|
|
352
360
|
new (): {
|
|
@@ -415,6 +423,7 @@ declare const __VLS_base$3: _vue_runtime_core.DefineComponent<__VLS_Props$s, {
|
|
|
415
423
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
416
424
|
resetForm: () => void;
|
|
417
425
|
submitForm: (native?: boolean) => Promise<any>;
|
|
426
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
418
427
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
419
428
|
change: (...args: any[]) => void;
|
|
420
429
|
error: (...args: any[]) => void;
|
|
@@ -473,6 +482,7 @@ declare const __VLS_base$3: _vue_runtime_core.DefineComponent<__VLS_Props$s, {
|
|
|
473
482
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
474
483
|
resetForm: () => void;
|
|
475
484
|
submitForm: (native?: boolean) => Promise<any>;
|
|
485
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
476
486
|
}, {}, {}, {}, {
|
|
477
487
|
disabled: boolean;
|
|
478
488
|
labelWidth: string;
|
|
@@ -518,6 +528,7 @@ declare const __VLS_base$3: _vue_runtime_core.DefineComponent<__VLS_Props$s, {
|
|
|
518
528
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
519
529
|
resetForm: () => void;
|
|
520
530
|
submitForm: (native?: boolean) => Promise<any>;
|
|
531
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
521
532
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
522
533
|
change: (...args: any[]) => void;
|
|
523
534
|
error: (...args: any[]) => void;
|
|
@@ -576,6 +587,7 @@ declare const __VLS_base$3: _vue_runtime_core.DefineComponent<__VLS_Props$s, {
|
|
|
576
587
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
577
588
|
resetForm: () => void;
|
|
578
589
|
submitForm: (native?: boolean) => Promise<any>;
|
|
590
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
579
591
|
}, {}, {}, {}, {
|
|
580
592
|
disabled: boolean;
|
|
581
593
|
labelWidth: string;
|
|
@@ -617,8 +629,8 @@ declare const __VLS_base$3: _vue_runtime_core.DefineComponent<__VLS_Props$s, {
|
|
|
617
629
|
config: FormConfig;
|
|
618
630
|
confirmText: string;
|
|
619
631
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
620
|
-
declare const __VLS_export$
|
|
621
|
-
declare const _default$
|
|
632
|
+
declare const __VLS_export$t: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
|
|
633
|
+
declare const _default$u: typeof __VLS_export$t;
|
|
622
634
|
|
|
623
635
|
type __VLS_WithSlots$3<T, S> = T & {
|
|
624
636
|
new (): {
|
|
@@ -683,6 +695,7 @@ declare const __VLS_base$2: _vue_runtime_core.DefineComponent<__VLS_Props$r, {
|
|
|
683
695
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
684
696
|
resetForm: () => void;
|
|
685
697
|
submitForm: (native?: boolean) => Promise<any>;
|
|
698
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
686
699
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
687
700
|
change: (...args: any[]) => void;
|
|
688
701
|
error: (...args: any[]) => void;
|
|
@@ -741,6 +754,7 @@ declare const __VLS_base$2: _vue_runtime_core.DefineComponent<__VLS_Props$r, {
|
|
|
741
754
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
742
755
|
resetForm: () => void;
|
|
743
756
|
submitForm: (native?: boolean) => Promise<any>;
|
|
757
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
744
758
|
}, {}, {}, {}, {
|
|
745
759
|
disabled: boolean;
|
|
746
760
|
labelWidth: string;
|
|
@@ -786,6 +800,7 @@ declare const __VLS_base$2: _vue_runtime_core.DefineComponent<__VLS_Props$r, {
|
|
|
786
800
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
787
801
|
resetForm: () => void;
|
|
788
802
|
submitForm: (native?: boolean) => Promise<any>;
|
|
803
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
789
804
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
790
805
|
change: (...args: any[]) => void;
|
|
791
806
|
error: (...args: any[]) => void;
|
|
@@ -844,6 +859,7 @@ declare const __VLS_base$2: _vue_runtime_core.DefineComponent<__VLS_Props$r, {
|
|
|
844
859
|
changeHandler: (v: FormValue, eventData: ContainerChangeEventData) => void;
|
|
845
860
|
resetForm: () => void;
|
|
846
861
|
submitForm: (native?: boolean) => Promise<any>;
|
|
862
|
+
getTextByName: (name: string, config?: FormConfig) => string | undefined;
|
|
847
863
|
}, {}, {}, {}, {
|
|
848
864
|
disabled: boolean;
|
|
849
865
|
labelWidth: string;
|
|
@@ -874,8 +890,8 @@ declare const __VLS_base$2: _vue_runtime_core.DefineComponent<__VLS_Props$r, {
|
|
|
874
890
|
config: FormConfig;
|
|
875
891
|
confirmText: string;
|
|
876
892
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
877
|
-
declare const __VLS_export$
|
|
878
|
-
declare const _default$
|
|
893
|
+
declare const __VLS_export$s: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
894
|
+
declare const _default$t: typeof __VLS_export$s;
|
|
879
895
|
|
|
880
896
|
type __VLS_WithSlots$2<T, S> = T & {
|
|
881
897
|
new (): {
|
|
@@ -898,7 +914,7 @@ type __VLS_Props$q = {
|
|
|
898
914
|
/** 是否开启对比模式 */
|
|
899
915
|
isCompare?: boolean;
|
|
900
916
|
};
|
|
901
|
-
declare const __VLS_export$
|
|
917
|
+
declare const __VLS_export$r: _vue_runtime_core.DefineComponent<__VLS_Props$q, {}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
902
918
|
change: (v: any, eventData: ContainerChangeEventData) => any;
|
|
903
919
|
addDiffCount: () => any;
|
|
904
920
|
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$q> & Readonly<{
|
|
@@ -911,7 +927,7 @@ declare const __VLS_export$q: _vue_runtime_core.DefineComponent<__VLS_Props$q, {
|
|
|
911
927
|
isCompare: boolean;
|
|
912
928
|
expandMore: boolean;
|
|
913
929
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
914
|
-
declare const _default$
|
|
930
|
+
declare const _default$s: typeof __VLS_export$r;
|
|
915
931
|
|
|
916
932
|
type __VLS_Props$p = {
|
|
917
933
|
labelWidth?: string;
|
|
@@ -924,7 +940,7 @@ type __VLS_Props$p = {
|
|
|
924
940
|
rules?: any;
|
|
925
941
|
disabled?: boolean;
|
|
926
942
|
};
|
|
927
|
-
declare const __VLS_export$
|
|
943
|
+
declare const __VLS_export$q: _vue_runtime_core.DefineComponent<__VLS_Props$p, {}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
928
944
|
change: (v: any, eventData: ContainerChangeEventData) => any;
|
|
929
945
|
addDiffCount: () => any;
|
|
930
946
|
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$p> & Readonly<{
|
|
@@ -936,9 +952,29 @@ declare const __VLS_export$p: _vue_runtime_core.DefineComponent<__VLS_Props$p, {
|
|
|
936
952
|
lastValues: Record<string, any>;
|
|
937
953
|
isCompare: boolean;
|
|
938
954
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
939
|
-
declare const _default$
|
|
955
|
+
declare const _default$r: typeof __VLS_export$q;
|
|
940
956
|
|
|
941
957
|
type __VLS_Props$o = {
|
|
958
|
+
model: any;
|
|
959
|
+
lastValues?: any;
|
|
960
|
+
isCompare?: boolean;
|
|
961
|
+
config: FlexLayoutConfig;
|
|
962
|
+
name?: string;
|
|
963
|
+
labelWidth?: string;
|
|
964
|
+
prop?: string;
|
|
965
|
+
size?: string;
|
|
966
|
+
disabled?: boolean;
|
|
967
|
+
};
|
|
968
|
+
declare const __VLS_export$p: _vue_runtime_core.DefineComponent<__VLS_Props$o, {}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
969
|
+
change: (v: any, eventData: ContainerChangeEventData) => any;
|
|
970
|
+
addDiffCount: () => any;
|
|
971
|
+
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$o> & Readonly<{
|
|
972
|
+
onChange?: ((v: any, eventData: ContainerChangeEventData) => any) | undefined;
|
|
973
|
+
onAddDiffCount?: (() => any) | undefined;
|
|
974
|
+
}>, {}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
975
|
+
declare const _default$q: typeof __VLS_export$p;
|
|
976
|
+
|
|
977
|
+
type __VLS_Props$n = {
|
|
942
978
|
model: any;
|
|
943
979
|
lastValues?: any;
|
|
944
980
|
isCompare?: boolean;
|
|
@@ -956,10 +992,10 @@ type __VLS_Slots$1 = {} & {
|
|
|
956
992
|
} & {
|
|
957
993
|
default?: (props: typeof __VLS_18) => any;
|
|
958
994
|
};
|
|
959
|
-
declare const __VLS_base$1: _vue_runtime_core.DefineComponent<__VLS_Props$
|
|
995
|
+
declare const __VLS_base$1: _vue_runtime_core.DefineComponent<__VLS_Props$n, {}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
960
996
|
change: (v: any, eventData: ContainerChangeEventData) => any;
|
|
961
997
|
addDiffCount: () => any;
|
|
962
|
-
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$
|
|
998
|
+
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$n> & Readonly<{
|
|
963
999
|
onChange?: ((v: any, eventData: ContainerChangeEventData) => any) | undefined;
|
|
964
1000
|
onAddDiffCount?: (() => any) | undefined;
|
|
965
1001
|
}>, {}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
@@ -972,7 +1008,7 @@ type __VLS_WithSlots$1<T, S> = T & {
|
|
|
972
1008
|
};
|
|
973
1009
|
};
|
|
974
1010
|
|
|
975
|
-
type __VLS_Props$
|
|
1011
|
+
type __VLS_Props$m = {
|
|
976
1012
|
model: any;
|
|
977
1013
|
lastValues?: any;
|
|
978
1014
|
isCompare?: boolean;
|
|
@@ -984,16 +1020,16 @@ type __VLS_Props$n = {
|
|
|
984
1020
|
expandMore?: boolean;
|
|
985
1021
|
disabled?: boolean;
|
|
986
1022
|
};
|
|
987
|
-
declare const __VLS_export$n: _vue_runtime_core.DefineComponent<__VLS_Props$
|
|
1023
|
+
declare const __VLS_export$n: _vue_runtime_core.DefineComponent<__VLS_Props$m, {}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
988
1024
|
change: (v: any, eventData: ContainerChangeEventData) => any;
|
|
989
1025
|
addDiffCount: () => any;
|
|
990
|
-
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$
|
|
1026
|
+
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$m> & Readonly<{
|
|
991
1027
|
onChange?: ((v: any, eventData: ContainerChangeEventData) => any) | undefined;
|
|
992
1028
|
onAddDiffCount?: (() => any) | undefined;
|
|
993
1029
|
}>, {}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
994
1030
|
declare const _default$o: typeof __VLS_export$n;
|
|
995
1031
|
|
|
996
|
-
type __VLS_Props$
|
|
1032
|
+
type __VLS_Props$l = {
|
|
997
1033
|
model: any;
|
|
998
1034
|
lastValues?: any;
|
|
999
1035
|
isCompare?: boolean;
|
|
@@ -1005,10 +1041,10 @@ type __VLS_Props$m = {
|
|
|
1005
1041
|
expandMore?: boolean;
|
|
1006
1042
|
disabled?: boolean;
|
|
1007
1043
|
};
|
|
1008
|
-
declare const __VLS_export$m: _vue_runtime_core.DefineComponent<__VLS_Props$
|
|
1044
|
+
declare const __VLS_export$m: _vue_runtime_core.DefineComponent<__VLS_Props$l, {}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
1009
1045
|
change: (v: any, eventData?: ContainerChangeEventData | undefined) => any;
|
|
1010
1046
|
addDiffCount: () => any;
|
|
1011
|
-
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$
|
|
1047
|
+
}, string, _vue_runtime_core.PublicProps, Readonly<__VLS_Props$l> & Readonly<{
|
|
1012
1048
|
onChange?: ((v: any, eventData?: ContainerChangeEventData | undefined) => any) | undefined;
|
|
1013
1049
|
onAddDiffCount?: (() => any) | undefined;
|
|
1014
1050
|
}>, {
|
|
@@ -1017,7 +1053,7 @@ declare const __VLS_export$m: _vue_runtime_core.DefineComponent<__VLS_Props$m, {
|
|
|
1017
1053
|
}, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
|
|
1018
1054
|
declare const _default$n: typeof __VLS_export$m;
|
|
1019
1055
|
|
|
1020
|
-
|
|
1056
|
+
interface TableProps {
|
|
1021
1057
|
model: any;
|
|
1022
1058
|
lastValues?: any;
|
|
1023
1059
|
isCompare?: boolean;
|
|
@@ -1032,26 +1068,19 @@ type __VLS_Props$l = {
|
|
|
1032
1068
|
size?: string;
|
|
1033
1069
|
enableToggleMode?: boolean;
|
|
1034
1070
|
showIndex?: boolean;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
$index: any;
|
|
1039
|
-
row: any;
|
|
1040
|
-
};
|
|
1041
|
-
};
|
|
1042
|
-
declare var __VLS_111: {};
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
declare var __VLS_22: {};
|
|
1043
1074
|
type __VLS_Slots = {} & {
|
|
1044
|
-
|
|
1045
|
-
} & {
|
|
1046
|
-
default?: (props: typeof __VLS_111) => any;
|
|
1075
|
+
default?: (props: typeof __VLS_22) => any;
|
|
1047
1076
|
};
|
|
1048
|
-
declare const __VLS_base: _vue_runtime_core.DefineComponent<
|
|
1077
|
+
declare const __VLS_base: _vue_runtime_core.DefineComponent<TableProps, {
|
|
1049
1078
|
toggleRowSelection: (row: any, selected: boolean) => void;
|
|
1050
1079
|
}, {}, {}, {}, _vue_runtime_core.ComponentOptionsMixin, _vue_runtime_core.ComponentOptionsMixin, {
|
|
1051
1080
|
change: (...args: any[]) => void;
|
|
1052
1081
|
select: (...args: any[]) => void;
|
|
1053
1082
|
addDiffCount: (...args: any[]) => void;
|
|
1054
|
-
}, string, _vue_runtime_core.PublicProps, Readonly<
|
|
1083
|
+
}, string, _vue_runtime_core.PublicProps, Readonly<TableProps> & Readonly<{
|
|
1055
1084
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
1056
1085
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
1057
1086
|
onAddDiffCount?: ((...args: any[]) => any) | undefined;
|
|
@@ -1287,5 +1316,5 @@ declare const _default: {
|
|
|
1287
1316
|
install(app: App, opt?: FormInstallOptions): void;
|
|
1288
1317
|
};
|
|
1289
1318
|
|
|
1290
|
-
export { _default$2 as MCascader, _default$c as MCheckbox, _default$7 as MCheckboxGroup, _default$8 as MColorPicker, _default$
|
|
1319
|
+
export { _default$2 as MCascader, _default$c as MCheckbox, _default$7 as MCheckboxGroup, _default$8 as MColorPicker, _default$s as MContainer, _default$f as MDate, _default$e as MDateTime, _default$a as MDaterange, _default$5 as MDisplay, _default$1 as MDynamicField, _default$r as MFieldset, _default$q as MFlexLayout, _default$w as MForm, _default$t as MFormBox, _default$v as MFormDialog, _default$u as MFormDrawer, _default$l as MGroupList, _default$g as MHidden, _default$4 as MLink, _default$j as MNumber, _default$i as MNumberRange, _default$p as MPanel, _default$6 as MRadioGroup, _default$o as MRow, _default$3 as MSelect, _default$b as MSwitch, _default$m as MTable, _default$n as MTabs, _default$k as MText, _default$h as MTextarea, _default$d as MTime, _default$9 as MTimerange, createForm, createValues, datetimeFormatter, _default as default, display, filterFunction, getDataByPage, getRules, initValue, sortArray, sortChange, useAddField };
|
|
1291
1320
|
export type { ChangeRecord, ContainerChangeEventData, FormInstallOptions, ValidateError };
|