@tmagic/table 1.2.0-beta.2 → 1.2.0-beta.20
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/tmagic-table.mjs +353 -435
- package/dist/tmagic-table.mjs.map +1 -1
- package/dist/tmagic-table.umd.js +355 -437
- package/dist/tmagic-table.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/ActionsColumn.vue +35 -91
- package/src/ExpandColumn.vue +27 -21
- package/src/PopoverColumn.vue +23 -24
- package/src/Table.vue +125 -141
- package/src/TextColumn.vue +35 -36
- package/src/index.ts +1 -5
- package/src/schema.ts +20 -13
- package/src/utils.ts +2 -0
- package/types/ActionsColumn.vue.d.ts +69 -94
- package/types/ExpandColumn.vue.d.ts +78 -15
- package/types/PopoverColumn.vue.d.ts +78 -17
- package/types/Table.vue.d.ts +212 -111
- package/types/TextColumn.vue.d.ts +89 -26
- package/types/schema.d.ts +20 -13
package/types/Table.vue.d.ts
CHANGED
|
@@ -1,131 +1,232 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
new (...args: any[]): {
|
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
|
4
|
+
$data: {};
|
|
5
|
+
$props: Partial<{
|
|
6
|
+
columns: any[];
|
|
7
|
+
loading: boolean;
|
|
8
|
+
showHeader: boolean;
|
|
9
|
+
defaultExpandAll: boolean;
|
|
10
|
+
border: boolean;
|
|
11
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
data: any[];
|
|
13
|
+
columns?: any[] | undefined;
|
|
14
|
+
/** 合并行或列的计算方法 */
|
|
15
|
+
spanMethod?: ((data: {
|
|
16
|
+
row: any;
|
|
17
|
+
column: any;
|
|
18
|
+
rowIndex: number;
|
|
19
|
+
columnIndex: number;
|
|
20
|
+
}) => [number, number]) | undefined;
|
|
21
|
+
loading?: boolean | undefined;
|
|
22
|
+
/** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */
|
|
23
|
+
bodyHeight?: string | number | undefined;
|
|
24
|
+
/** 是否显示表头 */
|
|
25
|
+
showHeader?: boolean | undefined;
|
|
26
|
+
/** 空数据时显示的文本内容 */
|
|
27
|
+
emptyText?: string | undefined;
|
|
28
|
+
/** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */
|
|
29
|
+
defaultExpandAll?: boolean | undefined;
|
|
30
|
+
rowkeyName?: string | undefined;
|
|
31
|
+
/** 是否带有纵向边框 */
|
|
32
|
+
border?: boolean | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
columns: () => never[];
|
|
35
|
+
loading: boolean;
|
|
36
|
+
showHeader: boolean;
|
|
37
|
+
defaultExpandAll: boolean;
|
|
38
|
+
border: boolean;
|
|
39
|
+
}>>> & {
|
|
40
|
+
"onAfter-action"?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
43
|
+
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
44
|
+
"onSelection-change"?: ((...args: any[]) => any) | undefined;
|
|
45
|
+
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
46
|
+
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "columns" | "loading" | "showHeader" | "defaultExpandAll" | "border">;
|
|
48
|
+
$attrs: {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
$refs: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
$slots: Readonly<{
|
|
55
|
+
[name: string]: import("vue").Slot | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
58
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
59
|
+
$emit: (event: "after-action" | "sort-change" | "select" | "select-all" | "selection-change" | "expand-change" | "cell-click", ...args: any[]) => void;
|
|
60
|
+
$el: any;
|
|
61
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
62
|
+
data: any[];
|
|
63
|
+
columns?: any[] | undefined;
|
|
64
|
+
/** 合并行或列的计算方法 */
|
|
65
|
+
spanMethod?: ((data: {
|
|
66
|
+
row: any;
|
|
67
|
+
column: any;
|
|
68
|
+
rowIndex: number;
|
|
69
|
+
columnIndex: number;
|
|
70
|
+
}) => [number, number]) | undefined;
|
|
71
|
+
loading?: boolean | undefined;
|
|
72
|
+
/** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */
|
|
73
|
+
bodyHeight?: string | number | undefined;
|
|
74
|
+
/** 是否显示表头 */
|
|
75
|
+
showHeader?: boolean | undefined;
|
|
76
|
+
/** 空数据时显示的文本内容 */
|
|
77
|
+
emptyText?: string | undefined;
|
|
78
|
+
/** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */
|
|
79
|
+
defaultExpandAll?: boolean | undefined;
|
|
80
|
+
rowkeyName?: string | undefined;
|
|
81
|
+
/** 是否带有纵向边框 */
|
|
82
|
+
border?: boolean | undefined;
|
|
83
|
+
}>, {
|
|
84
|
+
columns: () => never[];
|
|
85
|
+
loading: boolean;
|
|
86
|
+
showHeader: boolean;
|
|
87
|
+
defaultExpandAll: boolean;
|
|
88
|
+
border: boolean;
|
|
89
|
+
}>>> & {
|
|
90
|
+
"onAfter-action"?: ((...args: any[]) => any) | undefined;
|
|
91
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
93
|
+
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
94
|
+
"onSelection-change"?: ((...args: any[]) => any) | undefined;
|
|
95
|
+
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
96
|
+
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
toggleRowSelection: (row: any, selected: boolean) => void;
|
|
99
|
+
toggleRowExpansion: (row: any, expanded: boolean) => void;
|
|
100
|
+
clearSelection: () => void;
|
|
101
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("after-action" | "sort-change" | "select" | "select-all" | "selection-change" | "expand-change" | "cell-click")[], string, {
|
|
102
|
+
columns: any[];
|
|
103
|
+
loading: boolean;
|
|
104
|
+
showHeader: boolean;
|
|
105
|
+
defaultExpandAll: boolean;
|
|
106
|
+
border: boolean;
|
|
107
|
+
}> & {
|
|
108
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
109
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
110
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
111
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
112
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
113
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
114
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
115
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
116
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
117
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
118
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
119
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
120
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
121
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
122
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
123
|
+
};
|
|
124
|
+
$forceUpdate: () => void;
|
|
125
|
+
$nextTick: typeof import("vue").nextTick;
|
|
126
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
127
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
128
|
+
data: any[];
|
|
129
|
+
columns?: any[] | undefined;
|
|
130
|
+
/** 合并行或列的计算方法 */
|
|
131
|
+
spanMethod?: ((data: {
|
|
15
132
|
row: any;
|
|
16
133
|
column: any;
|
|
17
134
|
rowIndex: number;
|
|
18
135
|
columnIndex: number;
|
|
19
|
-
}) => [number, number]
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, {
|
|
58
|
-
sortChange(data: any): void;
|
|
59
|
-
selectHandler(selection: any, row: any): void;
|
|
60
|
-
selectAllHandler(selection: any): void;
|
|
61
|
-
selectionChangeHandler(selection: any): void;
|
|
62
|
-
toggleRowSelection(row: any, selected: boolean): void;
|
|
63
|
-
toggleRowExpansion(row: any, expanded: boolean): void;
|
|
64
|
-
clearSelection(): void;
|
|
65
|
-
objectSpanMethod(data: any): [number, number] | (() => {
|
|
66
|
-
rowspan: number;
|
|
67
|
-
colspan: number;
|
|
68
|
-
});
|
|
69
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("afterAction" | "sort-change" | "select" | "select-all" | "selection-change")[], "select" | "afterAction" | "sort-change" | "select-all" | "selection-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
|
-
data: {
|
|
71
|
-
type: ArrayConstructor;
|
|
72
|
-
require: boolean;
|
|
73
|
-
};
|
|
74
|
-
columns: {
|
|
75
|
-
type: PropType<any[]>;
|
|
76
|
-
require: boolean;
|
|
77
|
-
default: () => never[];
|
|
78
|
-
};
|
|
136
|
+
}) => [number, number]) | undefined;
|
|
137
|
+
loading?: boolean | undefined;
|
|
138
|
+
/** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */
|
|
139
|
+
bodyHeight?: string | number | undefined;
|
|
140
|
+
/** 是否显示表头 */
|
|
141
|
+
showHeader?: boolean | undefined;
|
|
142
|
+
/** 空数据时显示的文本内容 */
|
|
143
|
+
emptyText?: string | undefined;
|
|
144
|
+
/** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */
|
|
145
|
+
defaultExpandAll?: boolean | undefined;
|
|
146
|
+
rowkeyName?: string | undefined;
|
|
147
|
+
/** 是否带有纵向边框 */
|
|
148
|
+
border?: boolean | undefined;
|
|
149
|
+
}>, {
|
|
150
|
+
columns: () => never[];
|
|
151
|
+
loading: boolean;
|
|
152
|
+
showHeader: boolean;
|
|
153
|
+
defaultExpandAll: boolean;
|
|
154
|
+
border: boolean;
|
|
155
|
+
}>>> & {
|
|
156
|
+
"onAfter-action"?: ((...args: any[]) => any) | undefined;
|
|
157
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
158
|
+
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
159
|
+
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
160
|
+
"onSelection-change"?: ((...args: any[]) => any) | undefined;
|
|
161
|
+
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
162
|
+
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
163
|
+
} & import("vue").ShallowUnwrapRef<{
|
|
164
|
+
toggleRowSelection: (row: any, selected: boolean) => void;
|
|
165
|
+
toggleRowExpansion: (row: any, expanded: boolean) => void;
|
|
166
|
+
clearSelection: () => void;
|
|
167
|
+
}> & {} & import("vue").ComponentCustomProperties;
|
|
168
|
+
__isFragment?: undefined;
|
|
169
|
+
__isTeleport?: undefined;
|
|
170
|
+
__isSuspense?: undefined;
|
|
171
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
172
|
+
data: any[];
|
|
173
|
+
columns?: any[] | undefined;
|
|
79
174
|
/** 合并行或列的计算方法 */
|
|
80
|
-
spanMethod: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
loading: {
|
|
89
|
-
type: BooleanConstructor;
|
|
90
|
-
default: boolean;
|
|
91
|
-
};
|
|
175
|
+
spanMethod?: ((data: {
|
|
176
|
+
row: any;
|
|
177
|
+
column: any;
|
|
178
|
+
rowIndex: number;
|
|
179
|
+
columnIndex: number;
|
|
180
|
+
}) => [number, number]) | undefined;
|
|
181
|
+
loading?: boolean | undefined;
|
|
92
182
|
/** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */
|
|
93
|
-
bodyHeight
|
|
94
|
-
type: (StringConstructor | NumberConstructor)[];
|
|
95
|
-
};
|
|
183
|
+
bodyHeight?: string | number | undefined;
|
|
96
184
|
/** 是否显示表头 */
|
|
97
|
-
showHeader
|
|
98
|
-
type: BooleanConstructor;
|
|
99
|
-
default: boolean;
|
|
100
|
-
};
|
|
185
|
+
showHeader?: boolean | undefined;
|
|
101
186
|
/** 空数据时显示的文本内容 */
|
|
102
|
-
emptyText
|
|
103
|
-
type: StringConstructor;
|
|
104
|
-
};
|
|
187
|
+
emptyText?: string | undefined;
|
|
105
188
|
/** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */
|
|
106
|
-
defaultExpandAll
|
|
107
|
-
|
|
108
|
-
default: boolean;
|
|
109
|
-
};
|
|
110
|
-
rowkeyName: {
|
|
111
|
-
type: StringConstructor;
|
|
112
|
-
};
|
|
189
|
+
defaultExpandAll?: boolean | undefined;
|
|
190
|
+
rowkeyName?: string | undefined;
|
|
113
191
|
/** 是否带有纵向边框 */
|
|
114
|
-
border
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
192
|
+
border?: boolean | undefined;
|
|
193
|
+
}>, {
|
|
194
|
+
columns: () => never[];
|
|
195
|
+
loading: boolean;
|
|
196
|
+
showHeader: boolean;
|
|
197
|
+
defaultExpandAll: boolean;
|
|
198
|
+
border: boolean;
|
|
199
|
+
}>>> & {
|
|
200
|
+
"onAfter-action"?: ((...args: any[]) => any) | undefined;
|
|
120
201
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
121
202
|
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
122
203
|
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
123
204
|
"onSelection-change"?: ((...args: any[]) => any) | undefined;
|
|
205
|
+
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
206
|
+
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
124
207
|
}, {
|
|
208
|
+
toggleRowSelection: (row: any, selected: boolean) => void;
|
|
209
|
+
toggleRowExpansion: (row: any, expanded: boolean) => void;
|
|
210
|
+
clearSelection: () => void;
|
|
211
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("after-action" | "sort-change" | "select" | "select-all" | "selection-change" | "expand-change" | "cell-click")[], "after-action" | "select" | "sort-change" | "select-all" | "selection-change" | "expand-change" | "cell-click", {
|
|
125
212
|
columns: any[];
|
|
126
|
-
showHeader: boolean;
|
|
127
213
|
loading: boolean;
|
|
214
|
+
showHeader: boolean;
|
|
128
215
|
defaultExpandAll: boolean;
|
|
129
216
|
border: boolean;
|
|
130
|
-
}
|
|
217
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
131
218
|
export default _default;
|
|
219
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
220
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
221
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
222
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
223
|
+
} : {
|
|
224
|
+
type: import('vue').PropType<T[K]>;
|
|
225
|
+
required: true;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
229
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
230
|
+
default: D[K];
|
|
231
|
+
} : P[K];
|
|
232
|
+
};
|
|
@@ -1,29 +1,92 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
1
|
import { ColumnConfig } from './schema';
|
|
3
|
-
declare const _default:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: Partial<{
|
|
7
|
+
config: ColumnConfig;
|
|
8
|
+
editState: any;
|
|
9
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
10
|
+
config: ColumnConfig;
|
|
11
|
+
editState?: any;
|
|
12
|
+
}>, {
|
|
13
|
+
config: () => {};
|
|
14
|
+
editState: () => {};
|
|
15
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "config" | "editState">;
|
|
16
|
+
$attrs: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
$refs: {
|
|
20
|
+
[x: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
$slots: Readonly<{
|
|
23
|
+
[name: string]: import("vue").Slot | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
26
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
27
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
28
|
+
$el: any;
|
|
29
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
30
|
+
config: ColumnConfig;
|
|
31
|
+
editState?: any;
|
|
32
|
+
}>, {
|
|
33
|
+
config: () => {};
|
|
34
|
+
editState: () => {};
|
|
35
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
36
|
+
config: ColumnConfig;
|
|
37
|
+
editState: any;
|
|
38
|
+
}> & {
|
|
39
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
40
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
41
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
42
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
43
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
44
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
45
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
46
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
47
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
48
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
49
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
50
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
51
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
52
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
53
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
54
|
+
};
|
|
55
|
+
$forceUpdate: () => void;
|
|
56
|
+
$nextTick: typeof import("vue").nextTick;
|
|
57
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
58
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
59
|
+
config: ColumnConfig;
|
|
60
|
+
editState?: any;
|
|
61
|
+
}>, {
|
|
62
|
+
config: () => {};
|
|
63
|
+
editState: () => {};
|
|
64
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
65
|
+
__isFragment?: undefined;
|
|
66
|
+
__isTeleport?: undefined;
|
|
67
|
+
__isSuspense?: undefined;
|
|
68
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
69
|
+
config: ColumnConfig;
|
|
70
|
+
editState?: any;
|
|
71
|
+
}>, {
|
|
72
|
+
config: () => {};
|
|
73
|
+
editState: () => {};
|
|
74
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
26
75
|
config: ColumnConfig;
|
|
27
|
-
editState:
|
|
28
|
-
}
|
|
76
|
+
editState: any;
|
|
77
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
29
78
|
export default _default;
|
|
79
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
80
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
81
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
82
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
83
|
+
} : {
|
|
84
|
+
type: import('vue').PropType<T[K]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
89
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
90
|
+
default: D[K];
|
|
91
|
+
} : P[K];
|
|
92
|
+
};
|
package/types/schema.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FormConfig, FormValue } from '@tmagic/form';
|
|
2
2
|
export interface ColumnActionConfig {
|
|
3
3
|
type?: 'delete' | 'copy' | 'edit';
|
|
4
|
-
display?: (
|
|
5
|
-
text: string;
|
|
4
|
+
display?: (row: any) => boolean;
|
|
5
|
+
text: string | ((row: any) => string);
|
|
6
6
|
name: string;
|
|
7
|
+
icon?: any;
|
|
7
8
|
handler?: (row: any) => Promise<any> | any;
|
|
8
9
|
before?: (row: any) => void;
|
|
9
10
|
after?: (row: any) => void;
|
|
@@ -17,23 +18,29 @@ export declare type ColumnConfig = {
|
|
|
17
18
|
values?: FormValue;
|
|
18
19
|
selection?: boolean | 'single';
|
|
19
20
|
selectable?: (row: any, index: number) => boolean;
|
|
20
|
-
label
|
|
21
|
+
label?: string;
|
|
21
22
|
fixed?: 'left' | 'right' | boolean;
|
|
22
23
|
width?: number | string;
|
|
23
24
|
actions?: ColumnActionConfig[];
|
|
24
|
-
type
|
|
25
|
-
text
|
|
26
|
-
prop
|
|
27
|
-
showHeader
|
|
25
|
+
type?: 'popover' | 'expand' | string | ((value: any, row: any) => string);
|
|
26
|
+
text?: string;
|
|
27
|
+
prop?: string;
|
|
28
|
+
showHeader?: boolean;
|
|
28
29
|
table?: ColumnConfig[];
|
|
29
30
|
formatter?: 'datetime' | ((item: any, row: Record<string, any>) => any);
|
|
30
|
-
popover
|
|
31
|
-
placement:
|
|
32
|
-
width:
|
|
33
|
-
trigger:
|
|
34
|
-
tableEmbed:
|
|
31
|
+
popover?: {
|
|
32
|
+
placement: string;
|
|
33
|
+
width: string;
|
|
34
|
+
trigger: string;
|
|
35
|
+
tableEmbed: string;
|
|
35
36
|
};
|
|
36
37
|
sortable?: boolean | 'custom';
|
|
37
38
|
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
|
38
|
-
handler
|
|
39
|
+
handler?: (row: any) => void;
|
|
40
|
+
/** 当type为expand时有效,展开为html */
|
|
41
|
+
expandContent?: (row: any, prop?: string) => string;
|
|
42
|
+
/** 当type为expand时有效,展开为vue组件 */
|
|
43
|
+
component?: any;
|
|
44
|
+
/** 当type为expand时有效,展开的vue组件props */
|
|
45
|
+
props?: any;
|
|
39
46
|
};
|