@tmagic/table 1.5.0-beta.0 → 1.5.0-beta.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/dist/tmagic-table.js +18 -13
- package/dist/tmagic-table.umd.cjs +21 -14
- package/package.json +12 -9
- package/src/ExpandColumn.vue +1 -1
- package/src/PopoverColumn.vue +1 -0
- package/src/Table.vue +2 -20
- package/src/index.ts +2 -0
- package/src/schema.ts +7 -5
- package/src/theme/index.scss +15 -0
- package/src/utils.ts +4 -2
- package/types/index.d.ts +16 -43
package/dist/tmagic-table.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, withDirectives, createVNode, createElementVNode, vShow, createTextVNode, resolveDynamicComponent, mergeProps, toHandlers, createCommentVNode, normalizeProps, toDisplayString, resolveComponent, ref, computed, resolveDirective } from 'vue';
|
|
2
2
|
import { cloneDeep } from 'lodash-es';
|
|
3
|
-
import { TMagicTableColumn, TMagicTooltip, TMagicButton, tMagicMessage, TMagicPopover, TMagicForm, TMagicTag,
|
|
4
|
-
import { MForm } from '@tmagic/form';
|
|
5
|
-
import { datetimeFormatter } from '@tmagic/utils';
|
|
3
|
+
import { TMagicTableColumn, TMagicTooltip, TMagicButton, tMagicMessage, TMagicPopover, TMagicForm, TMagicTag, getDesignConfig, TMagicTable } from '@tmagic/design';
|
|
4
|
+
import { MForm, datetimeFormatter } from '@tmagic/form';
|
|
6
5
|
|
|
7
6
|
const _hoisted_1$2 = ["innerHTML"];
|
|
8
7
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
@@ -108,9 +107,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
108
107
|
size: "small",
|
|
109
108
|
onClick: ($event) => save(scope.$index, _ctx.config)
|
|
110
109
|
}, {
|
|
111
|
-
default: withCtx(() => [
|
|
110
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
112
111
|
createTextVNode("保存")
|
|
113
|
-
]),
|
|
112
|
+
])),
|
|
114
113
|
_: 2
|
|
115
114
|
}, 1032, ["onClick"]), [
|
|
116
115
|
[vShow, _ctx.editState[scope.$index]]
|
|
@@ -122,9 +121,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
122
121
|
size: "small",
|
|
123
122
|
onClick: ($event) => _ctx.editState[scope.$index] = void 0
|
|
124
123
|
}, {
|
|
125
|
-
default: withCtx(() => [
|
|
124
|
+
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
126
125
|
createTextVNode("取消")
|
|
127
|
-
]),
|
|
126
|
+
])),
|
|
128
127
|
_: 2
|
|
129
128
|
}, 1032, ["onClick"]), [
|
|
130
129
|
[vShow, _ctx.editState[scope.$index]]
|
|
@@ -194,7 +193,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
194
193
|
return props.config.props || {};
|
|
195
194
|
};
|
|
196
195
|
return (_ctx, _cache) => {
|
|
197
|
-
return openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
196
|
+
return openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
197
|
+
type: "expand",
|
|
198
|
+
width: _ctx.config.width,
|
|
199
|
+
fixed: _ctx.config.fixed
|
|
200
|
+
}, {
|
|
198
201
|
default: withCtx((scope) => [
|
|
199
202
|
_ctx.config.table ? (openBlock(), createBlock(_sfc_main, {
|
|
200
203
|
key: 0,
|
|
@@ -214,7 +217,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
214
217
|
_ctx.config.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.config.component), normalizeProps(mergeProps({ key: 3 }, componentProps(scope.row))), null, 16)) : createCommentVNode("", true)
|
|
215
218
|
]),
|
|
216
219
|
_: 1
|
|
217
|
-
});
|
|
220
|
+
}, 8, ["width", "fixed"]);
|
|
218
221
|
};
|
|
219
222
|
}
|
|
220
223
|
});
|
|
@@ -234,6 +237,7 @@ const formatter = (item, row) => {
|
|
|
234
237
|
return row[item.prop];
|
|
235
238
|
}
|
|
236
239
|
};
|
|
240
|
+
const createColumns = (columns) => columns;
|
|
237
241
|
|
|
238
242
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
239
243
|
...{
|
|
@@ -255,7 +259,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
255
259
|
key: 0,
|
|
256
260
|
placement: _ctx.config.popover.placement,
|
|
257
261
|
width: _ctx.config.popover.width,
|
|
258
|
-
trigger: _ctx.config.popover.trigger
|
|
262
|
+
trigger: _ctx.config.popover.trigger,
|
|
263
|
+
"destroy-on-close": _ctx.config.popover.destroyOnClose ?? true
|
|
259
264
|
}, {
|
|
260
265
|
reference: withCtx(() => [
|
|
261
266
|
createVNode(unref(TMagicButton), {
|
|
@@ -277,7 +282,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
277
282
|
}, null, 8, ["show-header", "columns", "data"])) : createCommentVNode("", true)
|
|
278
283
|
]),
|
|
279
284
|
_: 2
|
|
280
|
-
}, 1032, ["placement", "width", "trigger"])) : createCommentVNode("", true)
|
|
285
|
+
}, 1032, ["placement", "width", "trigger", "destroy-on-close"])) : createCommentVNode("", true)
|
|
281
286
|
]),
|
|
282
287
|
_: 1
|
|
283
288
|
}, 8, ["label", "width", "fixed"]);
|
|
@@ -423,7 +428,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
423
428
|
const emit = __emit;
|
|
424
429
|
const tMagicTable = ref();
|
|
425
430
|
const editState = ref([]);
|
|
426
|
-
const tableColumnComponent =
|
|
431
|
+
const tableColumnComponent = getDesignConfig("components")?.tableColumn;
|
|
427
432
|
const selectionColumn = computed(() => {
|
|
428
433
|
const column = props.columns.filter((item) => item.selection);
|
|
429
434
|
return column.length ? column[0] : null;
|
|
@@ -551,4 +556,4 @@ const index = {
|
|
|
551
556
|
}
|
|
552
557
|
};
|
|
553
558
|
|
|
554
|
-
export { _sfc_main as MagicTable, index as default, formatter };
|
|
559
|
+
export { _sfc_main as MagicTable, createColumns, index as default, formatter };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lodash-es'), require('@tmagic/design'), require('@tmagic/form')
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'lodash-es', '@tmagic/design', '@tmagic/form'
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicTable = {}, global.Vue, global.lodashEs, global.design, global.form
|
|
5
|
-
})(this, (function (exports, vue, lodashEs, design, form
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lodash-es'), require('@tmagic/design'), require('@tmagic/form')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'lodash-es', '@tmagic/design', '@tmagic/form'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicTable = {}, global.Vue, global.lodashEs, global.design, global.form));
|
|
5
|
+
})(this, (function (exports, vue, lodashEs, design, form) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const _hoisted_1$2 = ["innerHTML"];
|
|
8
8
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
size: "small",
|
|
109
109
|
onClick: ($event) => save(scope.$index, _ctx.config)
|
|
110
110
|
}, {
|
|
111
|
-
default: vue.withCtx(() => [
|
|
111
|
+
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
112
112
|
vue.createTextVNode("保存")
|
|
113
|
-
]),
|
|
113
|
+
])),
|
|
114
114
|
_: 2
|
|
115
115
|
}, 1032, ["onClick"]), [
|
|
116
116
|
[vue.vShow, _ctx.editState[scope.$index]]
|
|
@@ -122,9 +122,9 @@
|
|
|
122
122
|
size: "small",
|
|
123
123
|
onClick: ($event) => _ctx.editState[scope.$index] = void 0
|
|
124
124
|
}, {
|
|
125
|
-
default: vue.withCtx(() => [
|
|
125
|
+
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
126
126
|
vue.createTextVNode("取消")
|
|
127
|
-
]),
|
|
127
|
+
])),
|
|
128
128
|
_: 2
|
|
129
129
|
}, 1032, ["onClick"]), [
|
|
130
130
|
[vue.vShow, _ctx.editState[scope.$index]]
|
|
@@ -194,7 +194,11 @@
|
|
|
194
194
|
return props.config.props || {};
|
|
195
195
|
};
|
|
196
196
|
return (_ctx, _cache) => {
|
|
197
|
-
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
197
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
198
|
+
type: "expand",
|
|
199
|
+
width: _ctx.config.width,
|
|
200
|
+
fixed: _ctx.config.fixed
|
|
201
|
+
}, {
|
|
198
202
|
default: vue.withCtx((scope) => [
|
|
199
203
|
_ctx.config.table ? (vue.openBlock(), vue.createBlock(_sfc_main, {
|
|
200
204
|
key: 0,
|
|
@@ -214,7 +218,7 @@
|
|
|
214
218
|
_ctx.config.component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.config.component), vue.normalizeProps(vue.mergeProps({ key: 3 }, componentProps(scope.row))), null, 16)) : vue.createCommentVNode("", true)
|
|
215
219
|
]),
|
|
216
220
|
_: 1
|
|
217
|
-
});
|
|
221
|
+
}, 8, ["width", "fixed"]);
|
|
218
222
|
};
|
|
219
223
|
}
|
|
220
224
|
});
|
|
@@ -223,7 +227,7 @@
|
|
|
223
227
|
if (!item.prop) return "";
|
|
224
228
|
if (item.formatter) {
|
|
225
229
|
if (item.formatter === "datetime") {
|
|
226
|
-
item.formatter = (value) =>
|
|
230
|
+
item.formatter = (value) => form.datetimeFormatter(value);
|
|
227
231
|
}
|
|
228
232
|
try {
|
|
229
233
|
return item.formatter(row[item.prop], row);
|
|
@@ -234,6 +238,7 @@
|
|
|
234
238
|
return row[item.prop];
|
|
235
239
|
}
|
|
236
240
|
};
|
|
241
|
+
const createColumns = (columns) => columns;
|
|
237
242
|
|
|
238
243
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
239
244
|
...{
|
|
@@ -255,7 +260,8 @@
|
|
|
255
260
|
key: 0,
|
|
256
261
|
placement: _ctx.config.popover.placement,
|
|
257
262
|
width: _ctx.config.popover.width,
|
|
258
|
-
trigger: _ctx.config.popover.trigger
|
|
263
|
+
trigger: _ctx.config.popover.trigger,
|
|
264
|
+
"destroy-on-close": _ctx.config.popover.destroyOnClose ?? true
|
|
259
265
|
}, {
|
|
260
266
|
reference: vue.withCtx(() => [
|
|
261
267
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
@@ -277,7 +283,7 @@
|
|
|
277
283
|
}, null, 8, ["show-header", "columns", "data"])) : vue.createCommentVNode("", true)
|
|
278
284
|
]),
|
|
279
285
|
_: 2
|
|
280
|
-
}, 1032, ["placement", "width", "trigger"])) : vue.createCommentVNode("", true)
|
|
286
|
+
}, 1032, ["placement", "width", "trigger", "destroy-on-close"])) : vue.createCommentVNode("", true)
|
|
281
287
|
]),
|
|
282
288
|
_: 1
|
|
283
289
|
}, 8, ["label", "width", "fixed"]);
|
|
@@ -423,7 +429,7 @@
|
|
|
423
429
|
const emit = __emit;
|
|
424
430
|
const tMagicTable = vue.ref();
|
|
425
431
|
const editState = vue.ref([]);
|
|
426
|
-
const tableColumnComponent = design.
|
|
432
|
+
const tableColumnComponent = design.getDesignConfig("components")?.tableColumn;
|
|
427
433
|
const selectionColumn = vue.computed(() => {
|
|
428
434
|
const column = props.columns.filter((item) => item.selection);
|
|
429
435
|
return column.length ? column[0] : null;
|
|
@@ -552,6 +558,7 @@
|
|
|
552
558
|
};
|
|
553
559
|
|
|
554
560
|
exports.MagicTable = _sfc_main;
|
|
561
|
+
exports.createColumns = createColumns;
|
|
555
562
|
exports.default = index;
|
|
556
563
|
exports.formatter = formatter;
|
|
557
564
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.0-beta.
|
|
2
|
+
"version": "1.5.0-beta.10",
|
|
3
3
|
"name": "@tmagic/table",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"sideEffects": [
|
|
6
|
+
"dist/style.css",
|
|
7
|
+
"src/theme/*"
|
|
8
|
+
],
|
|
5
9
|
"main": "dist/tmagic-table.umd.cjs",
|
|
6
10
|
"module": "dist/tmagic-table.js",
|
|
7
11
|
"types": "types/index.d.ts",
|
|
@@ -36,19 +40,18 @@
|
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@types/lodash-es": "^4.17.4",
|
|
38
42
|
"@types/node": "^18.19.0",
|
|
39
|
-
"@vitejs/plugin-vue": "^5.1.
|
|
40
|
-
"@vue/compiler-sfc": "^3.
|
|
43
|
+
"@vitejs/plugin-vue": "^5.1.3",
|
|
44
|
+
"@vue/compiler-sfc": "^3.5.0",
|
|
41
45
|
"@vue/test-utils": "^2.4.6",
|
|
42
46
|
"rimraf": "^3.0.2",
|
|
43
|
-
"sass": "^1.
|
|
44
|
-
"vite": "^5.3
|
|
47
|
+
"sass": "^1.78.0",
|
|
48
|
+
"vite": "^5.4.3"
|
|
45
49
|
},
|
|
46
50
|
"peerDependencies": {
|
|
47
|
-
"vue": "^3.
|
|
51
|
+
"vue": "^3.5.0",
|
|
48
52
|
"typescript": "*",
|
|
49
|
-
"@tmagic/design": "1.5.0-beta.
|
|
50
|
-
"@tmagic/
|
|
51
|
-
"@tmagic/form": "1.5.0-beta.0"
|
|
53
|
+
"@tmagic/design": "1.5.0-beta.10",
|
|
54
|
+
"@tmagic/form": "1.5.0-beta.10"
|
|
52
55
|
},
|
|
53
56
|
"peerDependenciesMeta": {
|
|
54
57
|
"typescript": {
|
package/src/ExpandColumn.vue
CHANGED
package/src/PopoverColumn.vue
CHANGED
package/src/Table.vue
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
import { computed, ref } from 'vue';
|
|
67
67
|
import { cloneDeep } from 'lodash-es';
|
|
68
68
|
|
|
69
|
-
import {
|
|
69
|
+
import { getDesignConfig, TMagicTable } from '@tmagic/design';
|
|
70
70
|
|
|
71
71
|
import ActionsColumn from './ActionsColumn.vue';
|
|
72
72
|
import ComponentColumn from './ComponentColumn.vue';
|
|
@@ -121,7 +121,7 @@ const tMagicTable = ref<InstanceType<typeof TMagicTable>>();
|
|
|
121
121
|
|
|
122
122
|
const editState = ref([]);
|
|
123
123
|
|
|
124
|
-
const tableColumnComponent =
|
|
124
|
+
const tableColumnComponent = getDesignConfig('components')?.tableColumn;
|
|
125
125
|
const selectionColumn = computed(() => {
|
|
126
126
|
const column = props.columns.filter((item) => item.selection);
|
|
127
127
|
return column.length ? column[0] : null;
|
|
@@ -198,21 +198,3 @@ defineExpose({
|
|
|
198
198
|
clearSelection,
|
|
199
199
|
});
|
|
200
200
|
</script>
|
|
201
|
-
|
|
202
|
-
<style lang="scss">
|
|
203
|
-
.m-table {
|
|
204
|
-
.el-button.action-btn + .el-button.action-btn {
|
|
205
|
-
margin-left: 0;
|
|
206
|
-
}
|
|
207
|
-
.keep-all {
|
|
208
|
-
word-break: keep-all;
|
|
209
|
-
}
|
|
210
|
-
.el-table .cell > div {
|
|
211
|
-
display: inline-block;
|
|
212
|
-
vertical-align: middle;
|
|
213
|
-
}
|
|
214
|
-
.el-table__row.el-table__row--level-1 {
|
|
215
|
-
color: #999;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
</style>
|
package/src/index.ts
CHANGED
package/src/schema.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { FormConfig, FormValue } from '@tmagic/form';
|
|
20
20
|
|
|
21
21
|
export interface ColumnActionConfig {
|
|
22
|
-
type?: 'delete' | 'copy' | 'edit';
|
|
22
|
+
type?: 'delete' | 'copy' | 'edit' | string;
|
|
23
23
|
buttonType?: string;
|
|
24
24
|
display?: (row: any) => boolean;
|
|
25
25
|
text?: string | ((row: any) => string);
|
|
@@ -46,11 +46,12 @@ export interface ColumnConfig<T = any> {
|
|
|
46
46
|
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: T) => string);
|
|
47
47
|
text?: string;
|
|
48
48
|
prop?: string;
|
|
49
|
+
name?: string;
|
|
49
50
|
showHeader?: boolean;
|
|
50
51
|
table?: ColumnConfig[];
|
|
51
52
|
formatter?: 'datetime' | ((item: any, row: T) => any);
|
|
52
53
|
popover?: {
|
|
53
|
-
placement
|
|
54
|
+
placement?:
|
|
54
55
|
| 'auto'
|
|
55
56
|
| 'auto-start'
|
|
56
57
|
| 'auto-end'
|
|
@@ -66,9 +67,10 @@ export interface ColumnConfig<T = any> {
|
|
|
66
67
|
| 'right-end'
|
|
67
68
|
| 'left-start'
|
|
68
69
|
| 'left-end';
|
|
69
|
-
width
|
|
70
|
-
trigger
|
|
71
|
-
tableEmbed
|
|
70
|
+
width?: string | number;
|
|
71
|
+
trigger?: 'hover' | 'click';
|
|
72
|
+
tableEmbed?: boolean;
|
|
73
|
+
destroyOnClose?: boolean;
|
|
72
74
|
};
|
|
73
75
|
sortable?: boolean | 'custom';
|
|
74
76
|
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.m-table {
|
|
2
|
+
.el-button.action-btn + .el-button.action-btn {
|
|
3
|
+
margin-left: 0;
|
|
4
|
+
}
|
|
5
|
+
.keep-all {
|
|
6
|
+
word-break: keep-all;
|
|
7
|
+
}
|
|
8
|
+
.el-table .cell > div {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
}
|
|
12
|
+
.el-table__row.el-table__row--level-1 {
|
|
13
|
+
color: #999;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { datetimeFormatter } from '@tmagic/
|
|
19
|
+
import { datetimeFormatter } from '@tmagic/form';
|
|
20
20
|
|
|
21
|
-
import { ColumnConfig } from './schema';
|
|
21
|
+
import type { ColumnConfig } from './schema';
|
|
22
22
|
|
|
23
23
|
export const formatter = (item: ColumnConfig, row: any) => {
|
|
24
24
|
if (!item.prop) return '';
|
|
@@ -37,3 +37,5 @@ export const formatter = (item: ColumnConfig, row: any) => {
|
|
|
37
37
|
return row[item.prop];
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
+
|
|
41
|
+
export const createColumns = (columns: ColumnConfig[]) => columns;
|
package/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { App } from 'vue';
|
|
|
3
3
|
import { FormConfig, FormValue } from '@tmagic/form';
|
|
4
4
|
|
|
5
5
|
interface ColumnActionConfig {
|
|
6
|
-
type?: 'delete' | 'copy' | 'edit';
|
|
6
|
+
type?: 'delete' | 'copy' | 'edit' | string;
|
|
7
7
|
buttonType?: string;
|
|
8
8
|
display?: (row: any) => boolean;
|
|
9
9
|
text?: string | ((row: any) => string);
|
|
@@ -31,14 +31,16 @@ interface ColumnConfig<T = any> {
|
|
|
31
31
|
type?: 'popover' | 'expand' | 'component' | string | ((value: any, row: T) => string);
|
|
32
32
|
text?: string;
|
|
33
33
|
prop?: string;
|
|
34
|
+
name?: string;
|
|
34
35
|
showHeader?: boolean;
|
|
35
36
|
table?: ColumnConfig[];
|
|
36
37
|
formatter?: 'datetime' | ((item: any, row: T) => any);
|
|
37
38
|
popover?: {
|
|
38
|
-
placement
|
|
39
|
-
width
|
|
40
|
-
trigger
|
|
41
|
-
tableEmbed
|
|
39
|
+
placement?: 'auto' | 'auto-start' | 'auto-end' | 'left' | 'right' | 'top' | 'bottom' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
40
|
+
width?: string | number;
|
|
41
|
+
trigger?: 'hover' | 'click';
|
|
42
|
+
tableEmbed?: boolean;
|
|
43
|
+
destroyOnClose?: boolean;
|
|
42
44
|
};
|
|
43
45
|
sortable?: boolean | 'custom';
|
|
44
46
|
action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
|
|
@@ -55,7 +57,7 @@ interface ColumnConfig<T = any> {
|
|
|
55
57
|
buttonText?: string;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
declare const _default$1: vue.DefineComponent<
|
|
60
|
+
declare const _default$1: vue.DefineComponent<{
|
|
59
61
|
data: any[];
|
|
60
62
|
columns?: ColumnConfig[];
|
|
61
63
|
/** 合并行或列的计算方法 */
|
|
@@ -77,17 +79,11 @@ declare const _default$1: vue.DefineComponent<__VLS_WithDefaults<__VLS_TypeProps
|
|
|
77
79
|
rowkeyName?: string;
|
|
78
80
|
/** 是否带有纵向边框 */
|
|
79
81
|
border?: boolean;
|
|
80
|
-
}
|
|
81
|
-
columns: () => never[];
|
|
82
|
-
loading: boolean;
|
|
83
|
-
showHeader: boolean;
|
|
84
|
-
defaultExpandAll: boolean;
|
|
85
|
-
border: boolean;
|
|
86
|
-
}>, {
|
|
82
|
+
}, {
|
|
87
83
|
toggleRowSelection: (row: any, selected: boolean) => void;
|
|
88
84
|
toggleRowExpansion: (row: any, expanded: boolean) => void;
|
|
89
85
|
clearSelection: () => void;
|
|
90
|
-
},
|
|
86
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
91
87
|
select: (...args: any[]) => void;
|
|
92
88
|
"sort-change": (...args: any[]) => void;
|
|
93
89
|
"expand-change": (...args: any[]) => void;
|
|
@@ -95,7 +91,7 @@ declare const _default$1: vue.DefineComponent<__VLS_WithDefaults<__VLS_TypeProps
|
|
|
95
91
|
"after-action": (...args: any[]) => void;
|
|
96
92
|
"select-all": (...args: any[]) => void;
|
|
97
93
|
"selection-change": (...args: any[]) => void;
|
|
98
|
-
}, string, vue.PublicProps, Readonly<
|
|
94
|
+
}, string, vue.PublicProps, Readonly<{
|
|
99
95
|
data: any[];
|
|
100
96
|
columns?: ColumnConfig[];
|
|
101
97
|
/** 合并行或列的计算方法 */
|
|
@@ -117,13 +113,7 @@ declare const _default$1: vue.DefineComponent<__VLS_WithDefaults<__VLS_TypeProps
|
|
|
117
113
|
rowkeyName?: string;
|
|
118
114
|
/** 是否带有纵向边框 */
|
|
119
115
|
border?: boolean;
|
|
120
|
-
}
|
|
121
|
-
columns: () => never[];
|
|
122
|
-
loading: boolean;
|
|
123
|
-
showHeader: boolean;
|
|
124
|
-
defaultExpandAll: boolean;
|
|
125
|
-
border: boolean;
|
|
126
|
-
}>>> & {
|
|
116
|
+
}> & Readonly<{
|
|
127
117
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
128
118
|
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
129
119
|
"onExpand-change"?: ((...args: any[]) => any) | undefined;
|
|
@@ -131,36 +121,19 @@ declare const _default$1: vue.DefineComponent<__VLS_WithDefaults<__VLS_TypeProps
|
|
|
131
121
|
"onAfter-action"?: ((...args: any[]) => any) | undefined;
|
|
132
122
|
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
133
123
|
"onSelection-change"?: ((...args: any[]) => any) | undefined;
|
|
134
|
-
}
|
|
124
|
+
}>, {
|
|
135
125
|
loading: boolean;
|
|
136
126
|
border: boolean;
|
|
137
127
|
defaultExpandAll: boolean;
|
|
138
128
|
columns: ColumnConfig[];
|
|
139
129
|
showHeader: boolean;
|
|
140
|
-
}, {}>;
|
|
141
|
-
|
|
142
|
-
type __VLS_WithDefaults<P, D> = {
|
|
143
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
144
|
-
default: D[K];
|
|
145
|
-
}> : P[K];
|
|
146
|
-
};
|
|
147
|
-
type __VLS_Prettify<T> = {
|
|
148
|
-
[K in keyof T]: T[K];
|
|
149
|
-
} & {};
|
|
150
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
151
|
-
type __VLS_TypePropsToOption<T> = {
|
|
152
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
153
|
-
type: vue.PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
154
|
-
} : {
|
|
155
|
-
type: vue.PropType<T[K]>;
|
|
156
|
-
required: true;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
130
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}>;
|
|
159
131
|
|
|
160
132
|
declare const formatter: (item: ColumnConfig, row: any) => any;
|
|
133
|
+
declare const createColumns: (columns: ColumnConfig[]) => ColumnConfig<any>[];
|
|
161
134
|
|
|
162
135
|
declare const _default: {
|
|
163
136
|
install(app: App): void;
|
|
164
137
|
};
|
|
165
138
|
|
|
166
|
-
export { type ColumnActionConfig, type ColumnConfig, _default$1 as MagicTable, _default as default, formatter };
|
|
139
|
+
export { type ColumnActionConfig, type ColumnConfig, _default$1 as MagicTable, createColumns, _default as default, formatter };
|