@tmagic/table 1.3.0-alpha.1 → 1.3.0-alpha.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.
@@ -5,13 +5,11 @@ import { MForm } from '@tmagic/form';
5
5
  import { datetimeFormatter } from '@tmagic/utils';
6
6
 
7
7
  const _hoisted_1$2 = ["innerHTML"];
8
- const _hoisted_2$1 = /* @__PURE__ */ createTextVNode("保存");
9
- const _hoisted_3$1 = /* @__PURE__ */ createTextVNode("取消");
10
- const __default__$4 = defineComponent({
11
- name: "MTableActionsColumn"
12
- });
13
8
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
14
- ...__default__$4,
9
+ ...{
10
+ name: "MTableActionsColumn"
11
+ },
12
+ __name: "ActionsColumn",
15
13
  props: {
16
14
  columns: { default: () => [] },
17
15
  config: { default: () => ({}) },
@@ -69,12 +67,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
69
67
  };
70
68
  return (_ctx, _cache) => {
71
69
  return openBlock(), createBlock(unref(TMagicTableColumn), {
72
- label: __props.config.label,
73
- width: __props.config.width,
74
- fixed: __props.config.fixed
70
+ label: _ctx.config.label,
71
+ width: _ctx.config.width,
72
+ fixed: _ctx.config.fixed
75
73
  }, {
76
74
  default: withCtx((scope) => [
77
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.config.actions, (action, actionIndex) => {
75
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.actions, (action, actionIndex) => {
78
76
  return withDirectives((openBlock(), createBlock(unref(TMagicButton), {
79
77
  class: "action-btn",
80
78
  text: "",
@@ -91,7 +89,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
91
89
  ]),
92
90
  _: 2
93
91
  }, 1032, ["type", "icon", "onClick"])), [
94
- [vShow, display(action.display, scope.row) && !__props.editState[scope.$index]]
92
+ [vShow, display(action.display, scope.row) && !_ctx.editState[scope.$index]]
95
93
  ]);
96
94
  }), 128)),
97
95
  withDirectives(createVNode(unref(TMagicButton), {
@@ -99,28 +97,28 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
99
97
  text: "",
100
98
  type: "primary",
101
99
  size: "small",
102
- onClick: ($event) => save(scope.$index, __props.config)
100
+ onClick: ($event) => save(scope.$index, _ctx.config)
103
101
  }, {
104
102
  default: withCtx(() => [
105
- _hoisted_2$1
103
+ createTextVNode("保存")
106
104
  ]),
107
105
  _: 2
108
106
  }, 1032, ["onClick"]), [
109
- [vShow, __props.editState[scope.$index]]
107
+ [vShow, _ctx.editState[scope.$index]]
110
108
  ]),
111
109
  withDirectives(createVNode(unref(TMagicButton), {
112
110
  class: "action-btn",
113
111
  text: "",
114
112
  type: "primary",
115
113
  size: "small",
116
- onClick: ($event) => __props.editState[scope.$index] = void 0
114
+ onClick: ($event) => _ctx.editState[scope.$index] = void 0
117
115
  }, {
118
116
  default: withCtx(() => [
119
- _hoisted_3$1
117
+ createTextVNode("取消")
120
118
  ]),
121
119
  _: 2
122
120
  }, 1032, ["onClick"]), [
123
- [vShow, __props.editState[scope.$index]]
121
+ [vShow, _ctx.editState[scope.$index]]
124
122
  ])
125
123
  ]),
126
124
  _: 1
@@ -130,11 +128,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
130
128
  });
131
129
 
132
130
  const _hoisted_1$1 = ["innerHTML"];
133
- const __default__$3 = defineComponent({
134
- name: "MTableExpandColumn"
135
- });
136
131
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
137
- ...__default__$3,
132
+ ...{
133
+ name: "MTableExpandColumn"
134
+ },
135
+ __name: "ExpandColumn",
138
136
  props: {
139
137
  config: { default: () => ({}) }
140
138
  },
@@ -149,22 +147,22 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
149
147
  return (_ctx, _cache) => {
150
148
  return openBlock(), createBlock(unref(TMagicTableColumn), { type: "expand" }, {
151
149
  default: withCtx((scope) => [
152
- __props.config.table ? (openBlock(), createBlock(_sfc_main, {
150
+ _ctx.config.table ? (openBlock(), createBlock(_sfc_main, {
153
151
  key: 0,
154
152
  "show-header": false,
155
- columns: __props.config.table,
156
- data: __props.config.prop && scope.row[__props.config.prop] || []
153
+ columns: _ctx.config.table,
154
+ data: _ctx.config.prop && scope.row[_ctx.config.prop] || []
157
155
  }, null, 8, ["columns", "data"])) : createCommentVNode("", true),
158
- __props.config.form ? (openBlock(), createBlock(unref(MForm), {
156
+ _ctx.config.form ? (openBlock(), createBlock(unref(MForm), {
159
157
  key: 1,
160
- config: __props.config.form,
161
- "init-values": __props.config.values || __props.config.prop && scope.row[__props.config.prop] || {}
158
+ config: _ctx.config.form,
159
+ "init-values": _ctx.config.values || _ctx.config.prop && scope.row[_ctx.config.prop] || {}
162
160
  }, null, 8, ["config", "init-values"])) : createCommentVNode("", true),
163
- __props.config.expandContent ? (openBlock(), createElementBlock("div", {
161
+ _ctx.config.expandContent ? (openBlock(), createElementBlock("div", {
164
162
  key: 2,
165
- innerHTML: __props.config.expandContent(scope.row, __props.config.prop)
163
+ innerHTML: _ctx.config.expandContent(scope.row, _ctx.config.prop)
166
164
  }, null, 8, _hoisted_1$1)) : createCommentVNode("", true),
167
- __props.config.component ? (openBlock(), createBlock(resolveDynamicComponent(__props.config.component), normalizeProps(mergeProps({ key: 3 }, componentProps(scope.row))), null, 16)) : createCommentVNode("", true)
165
+ _ctx.config.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.config.component), normalizeProps(mergeProps({ key: 3 }, componentProps(scope.row))), null, 16)) : createCommentVNode("", true)
168
166
  ]),
169
167
  _: 1
170
168
  });
@@ -189,27 +187,27 @@ const formatter = (item, row) => {
189
187
  }
190
188
  };
191
189
 
192
- const __default__$2 = defineComponent({
193
- name: "MTablePopoverColumn"
194
- });
195
190
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
196
- ...__default__$2,
191
+ ...{
192
+ name: "MTablePopoverColumn"
193
+ },
194
+ __name: "PopoverColumn",
197
195
  props: {
198
196
  config: { default: () => ({}) }
199
197
  },
200
198
  setup(__props) {
201
199
  return (_ctx, _cache) => {
202
200
  return openBlock(), createBlock(unref(TMagicTableColumn), {
203
- label: __props.config.label,
204
- width: __props.config.width,
205
- fixed: __props.config.fixed
201
+ label: _ctx.config.label,
202
+ width: _ctx.config.width,
203
+ fixed: _ctx.config.fixed
206
204
  }, {
207
205
  default: withCtx((scope) => [
208
- __props.config.popover ? (openBlock(), createBlock(unref(TMagicPopover), {
206
+ _ctx.config.popover ? (openBlock(), createBlock(unref(TMagicPopover), {
209
207
  key: 0,
210
- placement: __props.config.popover.placement,
211
- width: __props.config.popover.width,
212
- trigger: __props.config.popover.trigger
208
+ placement: _ctx.config.popover.placement,
209
+ width: _ctx.config.popover.width,
210
+ trigger: _ctx.config.popover.trigger
213
211
  }, {
214
212
  reference: withCtx(() => [
215
213
  createVNode(unref(TMagicButton), {
@@ -217,17 +215,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
217
215
  type: "primary"
218
216
  }, {
219
217
  default: withCtx(() => [
220
- createTextVNode(toDisplayString(__props.config.text || unref(formatter)(__props.config, scope.row)), 1)
218
+ createTextVNode(toDisplayString(_ctx.config.text || unref(formatter)(_ctx.config, scope.row)), 1)
221
219
  ]),
222
220
  _: 2
223
221
  }, 1024)
224
222
  ]),
225
223
  default: withCtx(() => [
226
- __props.config.popover.tableEmbed ? (openBlock(), createBlock(_sfc_main, {
224
+ _ctx.config.popover.tableEmbed ? (openBlock(), createBlock(_sfc_main, {
227
225
  key: 0,
228
- "show-header": __props.config.showHeader,
229
- columns: __props.config.table,
230
- data: __props.config.prop && scope.row[__props.config.prop] || []
226
+ "show-header": _ctx.config.showHeader,
227
+ columns: _ctx.config.table,
228
+ data: _ctx.config.prop && scope.row[_ctx.config.prop] || []
231
229
  }, null, 8, ["show-header", "columns", "data"])) : createCommentVNode("", true)
232
230
  ]),
233
231
  _: 2
@@ -243,13 +241,12 @@ const _hoisted_1 = ["innerHTML"];
243
241
  const _hoisted_2 = ["href"];
244
242
  const _hoisted_3 = ["src"];
245
243
  const _hoisted_4 = ["href"];
246
- const _hoisted_5 = /* @__PURE__ */ createTextVNode("扩展配置");
247
- const _hoisted_6 = ["innerHTML"];
248
- const __default__$1 = defineComponent({
249
- name: "MTableColumn"
250
- });
244
+ const _hoisted_5 = ["innerHTML"];
251
245
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
252
- ...__default__$1,
246
+ ...{
247
+ name: "MTableColumn"
248
+ },
249
+ __name: "TextColumn",
253
250
  props: {
254
251
  config: { default: () => ({}) },
255
252
  editState: { default: () => ({}) }
@@ -260,60 +257,60 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
260
257
  const _component_el_tooltip = resolveComponent("el-tooltip");
261
258
  return openBlock(), createBlock(unref(TMagicTableColumn), {
262
259
  "show-overflow-tooltip": "",
263
- label: __props.config.label,
264
- width: __props.config.width,
265
- fixed: __props.config.fixed,
266
- sortable: __props.config.sortable,
267
- prop: __props.config.prop
260
+ label: _ctx.config.label,
261
+ width: _ctx.config.width,
262
+ fixed: _ctx.config.fixed,
263
+ sortable: _ctx.config.sortable,
264
+ prop: _ctx.config.prop
268
265
  }, {
269
266
  default: withCtx((scope) => [
270
- __props.config.type && __props.editState[scope.$index] ? (openBlock(), createBlock(unref(TMagicForm), {
267
+ _ctx.config.type && _ctx.editState[scope.$index] ? (openBlock(), createBlock(unref(TMagicForm), {
271
268
  key: 0,
272
269
  "label-width": "0",
273
- model: __props.editState[scope.$index]
270
+ model: _ctx.editState[scope.$index]
274
271
  }, {
275
272
  default: withCtx(() => [
276
273
  createVNode(_component_m_form_container, {
277
- prop: __props.config.prop,
278
- rules: __props.config.rules,
279
- config: __props.config,
280
- name: __props.config.prop,
281
- model: __props.editState[scope.$index]
274
+ prop: _ctx.config.prop,
275
+ rules: _ctx.config.rules,
276
+ config: _ctx.config,
277
+ name: _ctx.config.prop,
278
+ model: _ctx.editState[scope.$index]
282
279
  }, null, 8, ["prop", "rules", "config", "name", "model"])
283
280
  ]),
284
281
  _: 2
285
- }, 1032, ["model"])) : __props.config.action === "actionLink" && __props.config.prop ? (openBlock(), createBlock(unref(TMagicButton), {
282
+ }, 1032, ["model"])) : _ctx.config.action === "actionLink" && _ctx.config.prop ? (openBlock(), createBlock(unref(TMagicButton), {
286
283
  key: 1,
287
284
  text: "",
288
285
  type: "primary",
289
- onClick: ($event) => __props.config.handler?.(scope.row)
286
+ onClick: ($event) => _ctx.config.handler?.(scope.row)
290
287
  }, {
291
288
  default: withCtx(() => [
292
289
  createElementVNode("span", {
293
- innerHTML: unref(formatter)(__props.config, scope.row)
290
+ innerHTML: unref(formatter)(_ctx.config, scope.row)
294
291
  }, null, 8, _hoisted_1)
295
292
  ]),
296
293
  _: 2
297
- }, 1032, ["onClick"])) : __props.config.action === "img" && __props.config.prop ? (openBlock(), createElementBlock("a", {
294
+ }, 1032, ["onClick"])) : _ctx.config.action === "img" && _ctx.config.prop ? (openBlock(), createElementBlock("a", {
298
295
  key: 2,
299
296
  target: "_blank",
300
- href: scope.row[__props.config.prop]
297
+ href: scope.row[_ctx.config.prop]
301
298
  }, [
302
299
  createElementVNode("img", {
303
- src: scope.row[__props.config.prop],
300
+ src: scope.row[_ctx.config.prop],
304
301
  height: "50"
305
302
  }, null, 8, _hoisted_3)
306
- ], 8, _hoisted_2)) : __props.config.action === "link" && __props.config.prop ? (openBlock(), createElementBlock("a", {
303
+ ], 8, _hoisted_2)) : _ctx.config.action === "link" && _ctx.config.prop ? (openBlock(), createElementBlock("a", {
307
304
  key: 3,
308
305
  target: "_blank",
309
- href: scope.row[__props.config.prop],
306
+ href: scope.row[_ctx.config.prop],
310
307
  class: "keep-all"
311
- }, toDisplayString(scope.row[__props.config.prop]), 9, _hoisted_4)) : __props.config.action === "tip" ? (openBlock(), createBlock(_component_el_tooltip, {
308
+ }, toDisplayString(scope.row[_ctx.config.prop]), 9, _hoisted_4)) : _ctx.config.action === "tip" ? (openBlock(), createBlock(_component_el_tooltip, {
312
309
  key: 4,
313
310
  placement: "left"
314
311
  }, {
315
312
  content: withCtx(() => [
316
- createElementVNode("div", null, toDisplayString(unref(formatter)(__props.config, scope.row)), 1)
313
+ createElementVNode("div", null, toDisplayString(unref(formatter)(_ctx.config, scope.row)), 1)
317
314
  ]),
318
315
  default: withCtx(() => [
319
316
  createVNode(unref(TMagicButton), {
@@ -321,25 +318,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
321
318
  type: "primary"
322
319
  }, {
323
320
  default: withCtx(() => [
324
- _hoisted_5
321
+ createTextVNode("扩展配置")
325
322
  ]),
326
323
  _: 1
327
324
  })
328
325
  ]),
329
326
  _: 2
330
- }, 1024)) : __props.config.action === "tag" && __props.config.prop ? (openBlock(), createBlock(unref(TMagicTag), {
327
+ }, 1024)) : _ctx.config.action === "tag" && _ctx.config.prop ? (openBlock(), createBlock(unref(TMagicTag), {
331
328
  key: 5,
332
- type: typeof __props.config.type === "function" ? __props.config.type(scope.row[__props.config.prop], scope.row) : __props.config.type,
329
+ type: typeof _ctx.config.type === "function" ? _ctx.config.type(scope.row[_ctx.config.prop], scope.row) : _ctx.config.type,
333
330
  "close-transition": ""
334
331
  }, {
335
332
  default: withCtx(() => [
336
- createTextVNode(toDisplayString(unref(formatter)(__props.config, scope.row)), 1)
333
+ createTextVNode(toDisplayString(unref(formatter)(_ctx.config, scope.row)), 1)
337
334
  ]),
338
335
  _: 2
339
336
  }, 1032, ["type"])) : (openBlock(), createElementBlock("div", {
340
337
  key: 6,
341
- innerHTML: unref(formatter)(__props.config, scope.row)
342
- }, null, 8, _hoisted_6))
338
+ innerHTML: unref(formatter)(_ctx.config, scope.row)
339
+ }, null, 8, _hoisted_5))
343
340
  ]),
344
341
  _: 1
345
342
  }, 8, ["label", "width", "fixed", "sortable", "prop"]);
@@ -347,21 +344,21 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
347
344
  }
348
345
  });
349
346
 
350
- const __default__ = defineComponent({
351
- name: "MTable"
352
- });
353
347
  const _sfc_main = /* @__PURE__ */ defineComponent({
354
- ...__default__,
348
+ ...{
349
+ name: "MTable"
350
+ },
351
+ __name: "Table",
355
352
  props: {
356
- data: null,
353
+ data: {},
357
354
  columns: { default: () => [] },
358
- spanMethod: null,
355
+ spanMethod: {},
359
356
  loading: { type: Boolean, default: false },
360
- bodyHeight: null,
357
+ bodyHeight: {},
361
358
  showHeader: { type: Boolean, default: true },
362
- emptyText: null,
359
+ emptyText: {},
363
360
  defaultExpandAll: { type: Boolean, default: false },
364
- rowkeyName: null,
361
+ rowkeyName: {},
365
362
  border: { type: Boolean, default: false }
366
363
  },
367
364
  emits: [
@@ -373,11 +370,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
373
370
  "expand-change",
374
371
  "cell-click"
375
372
  ],
376
- setup(__props, { expose, emit }) {
373
+ setup(__props, { expose: __expose, emit }) {
377
374
  const props = __props;
378
375
  const tMagicTable = ref();
379
376
  const editState = ref([]);
380
- const tableColumnComponent = getConfig("components").tableColumn;
377
+ const tableColumnComponent = getConfig("components")?.tableColumn;
381
378
  const selectionColumn = computed(() => {
382
379
  const column = props.columns.filter((item) => item.selection);
383
380
  return column.length ? column[0] : null;
@@ -430,7 +427,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
430
427
  colspan: 0
431
428
  });
432
429
  };
433
- expose({
430
+ __expose({
434
431
  toggleRowSelection,
435
432
  toggleRowExpansion,
436
433
  clearSelection
@@ -442,14 +439,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
442
439
  class: "m-table",
443
440
  ref_key: "tMagicTable",
444
441
  ref: tMagicTable,
445
- data: unref(tableData),
446
- "show-header": __props.showHeader,
447
- "max-height": __props.bodyHeight,
448
- "default-expand-all": __props.defaultExpandAll,
449
- border: unref(hasBorder),
450
- "row-key": __props.rowkeyName || "id",
442
+ data: tableData.value,
443
+ "show-header": _ctx.showHeader,
444
+ "max-height": _ctx.bodyHeight,
445
+ "default-expand-all": _ctx.defaultExpandAll,
446
+ border: hasBorder.value,
447
+ "row-key": _ctx.rowkeyName || "id",
451
448
  "tree-props": { children: "children" },
452
- "empty-text": __props.emptyText || "暂无数据",
449
+ "empty-text": _ctx.emptyText || "暂无数据",
453
450
  "span-method": objectSpanMethod,
454
451
  onSortChange: sortChange,
455
452
  onSelect: selectHandler,
@@ -459,20 +456,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
459
456
  onExpandChange: expandChange
460
457
  }, {
461
458
  default: withCtx(() => [
462
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (item, columnIndex) => {
459
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (item, columnIndex) => {
463
460
  return openBlock(), createElementBlock(Fragment, null, [
464
461
  item.type === "expand" ? (openBlock(), createBlock(_sfc_main$3, {
465
462
  config: item,
466
463
  key: columnIndex
467
- }, null, 8, ["config"])) : item.selection ? (openBlock(), createBlock(resolveDynamicComponent(unref(tableColumnComponent).component), {
464
+ }, null, 8, ["config"])) : item.selection ? (openBlock(), createBlock(resolveDynamicComponent(unref(tableColumnComponent)?.component || "el-table-column"), {
468
465
  width: "40",
469
466
  type: "selection",
470
467
  key: columnIndex,
471
468
  selectable: item.selectable
472
469
  }, null, 8, ["selectable"])) : item.actions ? (openBlock(), createBlock(_sfc_main$4, {
473
- columns: __props.columns,
470
+ columns: _ctx.columns,
474
471
  config: item,
475
- "rowkey-name": __props.rowkeyName,
472
+ "rowkey-name": _ctx.rowkeyName,
476
473
  "edit-state": editState.value,
477
474
  key: columnIndex,
478
475
  onAfterAction: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("after-action"))
@@ -489,7 +486,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
489
486
  ]),
490
487
  _: 1
491
488
  }, 8, ["data", "show-header", "max-height", "default-expand-all", "border", "row-key", "empty-text"])), [
492
- [_directive_loading, __props.loading]
489
+ [_directive_loading, _ctx.loading]
493
490
  ]);
494
491
  };
495
492
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tmagic-table.js","sources":["../src/ActionsColumn.vue","../src/ExpandColumn.vue","../src/utils.ts","../src/PopoverColumn.vue","../src/TextColumn.vue","../src/Table.vue","../src/index.ts"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nexport default defineComponent({\n name: 'MTableActionsColumn',\n})\n</script>\n<template>\n <TMagicTableColumn :label=\"config.label\" :width=\"config.width\" :fixed=\"config.fixed\">\n <template v-slot=\"scope\">\n <TMagicButton\n v-for=\"(action, actionIndex) in config.actions\"\n v-show=\"display(action.display, scope.row) && !editState[scope.$index]\"\n class=\"action-btn\"\n text\n :type=\"action.buttonType || 'primary'\"\n size=\"small\"\n :icon=\"action.icon\"\n :key=\"actionIndex\"\n @click=\"actionHandler(action, scope.row, scope.$index)\"\n ><span v-html=\"formatter(action.text, scope.row)\"></span\n ></TMagicButton>\n <TMagicButton\n class=\"action-btn\"\n v-show=\"editState[scope.$index]\"\n text\n type=\"primary\"\n size=\"small\"\n @click=\"save(scope.$index, config)\"\n >保存</TMagicButton\n >\n <TMagicButton\n class=\"action-btn\"\n v-show=\"editState[scope.$index]\"\n text\n type=\"primary\"\n size=\"small\"\n @click=\"editState[scope.$index] = undefined\"\n >取消</TMagicButton\n >\n </template>\n </TMagicTableColumn>\n</template>\n\n<script lang=\"ts\" setup name=\"MTableActionsColumn\">\nimport { TMagicButton, tMagicMessage, TMagicTableColumn } from '@tmagic/design';\n\nimport { ColumnActionConfig, ColumnConfig } from './schema';\n\nconst props = withDefaults(\n defineProps<{\n columns: any[];\n config: ColumnConfig;\n rowkeyName?: string;\n editState?: any;\n }>(),\n {\n columns: () => [],\n config: () => ({}),\n rowkeyName: 'c_id',\n editState: () => [],\n },\n);\n\nconst emit = defineEmits(['after-action']);\n\nconst display = (fuc: boolean | Function | undefined, row: any) => {\n if (typeof fuc === 'function') {\n return fuc(row);\n }\n return true;\n};\n\nconst formatter = (fuc: string | Function | undefined, row: any) => {\n if (typeof fuc === 'function') {\n return fuc(row);\n }\n return fuc;\n};\n\nconst actionHandler = async (action: ColumnActionConfig, row: any, index: number) => {\n await action.before?.(row, index);\n if (action.type === 'edit') {\n props.editState[index] = row;\n } else {\n await action.handler?.(row, index);\n }\n action.after?.(row, index);\n};\n\nconst save = async (index: number, config: ColumnConfig) => {\n const action = config.actions?.find((item) => item.type === 'edit')?.action;\n if (!action) return;\n\n const data: any = {};\n const row = props.editState[index];\n props.columns\n .filter((item) => item.type)\n .forEach((column) => {\n data[column.prop] = row[column.prop];\n });\n\n const res: any = await action({\n data,\n });\n\n if (res) {\n if (res.ret === 0) {\n tMagicMessage.success('保存成功');\n props.editState[index] = undefined;\n emit('after-action');\n } else {\n tMagicMessage.error(res.msg || '保存失败');\n }\n } else {\n props.editState[index] = undefined;\n emit('after-action');\n }\n};\n</script>\n","<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nexport default defineComponent({\n name: 'MTableExpandColumn',\n})\n</script>\n<template>\n <TMagicTableColumn type=\"expand\">\n <template #default=\"scope\">\n <MTable\n v-if=\"config.table\"\n :show-header=\"false\"\n :columns=\"config.table\"\n :data=\"(config.prop && scope.row[config.prop]) || []\"\n ></MTable>\n <MForm\n v-if=\"config.form\"\n :config=\"config.form\"\n :init-values=\"config.values || (config.prop && scope.row[config.prop]) || {}\"\n ></MForm>\n <div v-if=\"config.expandContent\" v-html=\"config.expandContent(scope.row, config.prop)\"></div>\n <component v-if=\"config.component\" :is=\"config.component\" v-bind=\"componentProps(scope.row)\"></component>\n </template>\n </TMagicTableColumn>\n</template>\n\n<script lang=\"ts\" setup name=\"MTableExpandColumn\">\nimport { TMagicTableColumn } from '@tmagic/design';\nimport { MForm } from '@tmagic/form';\n\nimport { ColumnConfig } from './schema';\nimport MTable from './Table.vue';\n\nconst props = withDefaults(\n defineProps<{\n config: ColumnConfig;\n }>(),\n {\n config: () => ({}),\n },\n);\n\nconst componentProps = (row: any) => {\n if (typeof props.config.props === 'function') {\n return props.config.props(row) || {};\n }\n return props.config.props || {};\n};\n</script>\n","/*\n * Tencent is pleased to support the open source community by making TMagicEditor available.\n *\n * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { datetimeFormatter } from '@tmagic/utils';\n\nimport { ColumnConfig } from './schema';\n\nexport const formatter = (item: ColumnConfig, row: any) => {\n if (!item.prop) return '';\n\n if (item.formatter) {\n if (item.formatter === 'datetime') {\n // eslint-disable-next-line no-param-reassign\n item.formatter = (value: string) => datetimeFormatter(value);\n }\n try {\n return item.formatter(row[item.prop], row);\n } catch (e) {\n return row[item.prop];\n }\n } else {\n return row[item.prop];\n }\n};\n","<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nexport default defineComponent({\n name: 'MTablePopoverColumn',\n})\n</script>\n<template>\n <TMagicTableColumn :label=\"config.label\" :width=\"config.width\" :fixed=\"config.fixed\">\n <template v-slot=\"scope\">\n <TMagicPopover\n v-if=\"config.popover\"\n :placement=\"config.popover.placement\"\n :width=\"config.popover.width\"\n :trigger=\"config.popover.trigger\"\n >\n <MTable\n v-if=\"config.popover.tableEmbed\"\n :show-header=\"config.showHeader\"\n :columns=\"config.table\"\n :data=\"(config.prop && scope.row[config.prop]) || []\"\n ></MTable>\n <template #reference>\n <TMagicButton text type=\"primary\"> {{ config.text || formatter(config, scope.row) }}</TMagicButton>\n </template>\n </TMagicPopover>\n </template>\n </TMagicTableColumn>\n</template>\n\n<script lang=\"ts\" setup name=\"MTablePopoverColumn\">\nimport { TMagicButton, TMagicPopover, TMagicTableColumn } from '@tmagic/design';\n\nimport { ColumnConfig } from './schema';\nimport MTable from './Table.vue';\nimport { formatter } from './utils';\n\nwithDefaults(\n defineProps<{\n config: ColumnConfig;\n }>(),\n {\n config: () => ({}),\n },\n);\n</script>\n","<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nexport default defineComponent({\n name: 'MTableColumn',\n})\n</script>\n<template>\n <TMagicTableColumn\n show-overflow-tooltip\n :label=\"config.label\"\n :width=\"config.width\"\n :fixed=\"config.fixed\"\n :sortable=\"config.sortable\"\n :prop=\"config.prop\"\n >\n <template v-slot=\"scope\">\n <TMagicForm v-if=\"config.type && editState[scope.$index]\" label-width=\"0\" :model=\"editState[scope.$index]\">\n <m-form-container\n :prop=\"config.prop\"\n :rules=\"config.rules\"\n :config=\"config\"\n :name=\"config.prop\"\n :model=\"editState[scope.$index]\"\n ></m-form-container>\n </TMagicForm>\n\n <TMagicButton\n v-else-if=\"config.action === 'actionLink' && config.prop\"\n text\n type=\"primary\"\n @click=\"config.handler?.(scope.row)\"\n >\n <span v-html=\"formatter(config, scope.row)\"></span>\n </TMagicButton>\n\n <a v-else-if=\"config.action === 'img' && config.prop\" target=\"_blank\" :href=\"scope.row[config.prop]\"\n ><img :src=\"scope.row[config.prop]\" height=\"50\"\n /></a>\n\n <a\n v-else-if=\"config.action === 'link' && config.prop\"\n target=\"_blank\"\n :href=\"scope.row[config.prop]\"\n class=\"keep-all\"\n >{{ scope.row[config.prop] }}</a\n >\n\n <el-tooltip v-else-if=\"config.action === 'tip'\" placement=\"left\">\n <template #content>\n <div>{{ formatter(config, scope.row) }}</div>\n </template>\n <TMagicButton text type=\"primary\">扩展配置</TMagicButton>\n </el-tooltip>\n\n <TMagicTag\n v-else-if=\"config.action === 'tag' && config.prop\"\n :type=\"typeof config.type === 'function' ? config.type(scope.row[config.prop], scope.row) : config.type\"\n close-transition\n >{{ formatter(config, scope.row) }}</TMagicTag\n >\n <div v-else v-html=\"formatter(config, scope.row)\"></div>\n </template>\n </TMagicTableColumn>\n</template>\n\n<script lang=\"ts\" setup name=\"MTableColumn\">\nimport { TMagicButton, TMagicForm, TMagicTableColumn, TMagicTag } from '@tmagic/design';\n\nimport { ColumnConfig } from './schema';\nimport { formatter } from './utils';\n\nwithDefaults(\n defineProps<{\n config: ColumnConfig;\n editState?: any;\n }>(),\n {\n config: () => ({}),\n editState: () => ({}),\n },\n);\n</script>\n","<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nexport default defineComponent({\n name: 'MTable',\n})\n</script>\n<template>\n <TMagicTable\n tooltip-effect=\"dark\"\n class=\"m-table\"\n ref=\"tMagicTable\"\n v-loading=\"loading\"\n :data=\"tableData\"\n :show-header=\"showHeader\"\n :max-height=\"bodyHeight\"\n :default-expand-all=\"defaultExpandAll\"\n :border=\"hasBorder\"\n :row-key=\"rowkeyName || 'id'\"\n :tree-props=\"{ children: 'children' }\"\n :empty-text=\"emptyText || '暂无数据'\"\n :span-method=\"objectSpanMethod\"\n @sort-change=\"sortChange\"\n @select=\"selectHandler\"\n @select-all=\"selectAllHandler\"\n @selection-change=\"selectionChangeHandler\"\n @cell-click=\"cellClickHandler\"\n @expand-change=\"expandChange\"\n >\n <template v-for=\"(item, columnIndex) in columns\">\n <template v-if=\"item.type === 'expand'\">\n <ExpandColumn :config=\"item\" :key=\"columnIndex\"></ExpandColumn>\n </template>\n\n <template v-else-if=\"item.selection\">\n <component\n width=\"40\"\n type=\"selection\"\n :is=\"tableColumnComponent.component\"\n :key=\"columnIndex\"\n :selectable=\"item.selectable\"\n ></component>\n </template>\n\n <template v-else-if=\"item.actions\">\n <ActionsColumn\n :columns=\"columns\"\n :config=\"item\"\n :rowkey-name=\"rowkeyName\"\n :edit-state=\"editState\"\n :key=\"columnIndex\"\n @after-action=\"$emit('after-action')\"\n ></ActionsColumn>\n </template>\n\n <template v-else-if=\"item.type === 'popover'\">\n <PopoverColumn :key=\"columnIndex\" :config=\"item\"></PopoverColumn>\n </template>\n\n <template v-else>\n <TextColumn :key=\"columnIndex\" :config=\"item\" :edit-state=\"editState\"></TextColumn>\n </template>\n </template>\n </TMagicTable>\n</template>\n\n<script lang=\"ts\" setup name=\"MTable\">\nimport { computed, ref } from 'vue';\nimport { cloneDeep } from 'lodash-es';\n\nimport { getConfig, TMagicTable } from '@tmagic/design';\n\nimport ActionsColumn from './ActionsColumn.vue';\nimport ExpandColumn from './ExpandColumn.vue';\nimport PopoverColumn from './PopoverColumn.vue';\nimport TextColumn from './TextColumn.vue';\n\nconst props = withDefaults(\n defineProps<{\n data: any[];\n columns?: any[];\n /** 合并行或列的计算方法 */\n spanMethod?: (data: { row: any; column: any; rowIndex: number; columnIndex: number }) => [number, number];\n loading?: boolean;\n /** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */\n bodyHeight?: string | number;\n /** 是否显示表头 */\n showHeader?: boolean;\n /** 空数据时显示的文本内容 */\n emptyText?: string;\n /** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */\n defaultExpandAll?: boolean;\n rowkeyName?: string;\n /** 是否带有纵向边框 */\n border?: boolean;\n }>(),\n {\n columns: () => [],\n loading: false,\n showHeader: true,\n defaultExpandAll: false,\n border: false,\n },\n);\n\nconst emit = defineEmits([\n 'sort-change',\n 'after-action',\n 'select',\n 'select-all',\n 'selection-change',\n 'expand-change',\n 'cell-click',\n]);\n\nconst tMagicTable = ref<InstanceType<typeof TMagicTable>>();\n\nconst editState = ref([]);\n\nconst tableColumnComponent = getConfig('components').tableColumn;\nconst selectionColumn = computed(() => {\n const column = props.columns.filter((item) => item.selection);\n return column.length ? column[0] : null;\n});\n\nconst tableData = computed(() => {\n if (selectionColumn.value) {\n return props.data || [];\n }\n\n return cloneDeep(props.data) || [];\n});\n\nconst hasBorder = computed(() => (typeof props.border !== 'undefined' ? props.border : true));\n\nconst sortChange = (data: any) => {\n emit('sort-change', data);\n};\n\nconst selectHandler = (selection: any, row: any) => {\n const column = selectionColumn.value;\n if (!column) {\n return;\n }\n\n if (column.selection === 'single') {\n // this.clearSelection()\n // this.toggleRowSelection(row, true)\n }\n emit('select', selection, row);\n};\n\nconst selectAllHandler = (selection: any) => {\n emit('select-all', selection);\n};\n\nconst selectionChangeHandler = (selection: any) => {\n emit('selection-change', selection);\n};\n\nconst cellClickHandler = (...args: any[]) => {\n emit('cell-click', ...args);\n};\n\nconst expandChange = (...args: any[]) => {\n emit('expand-change', ...args);\n};\n\nconst toggleRowSelection = (row: any, selected: boolean) => {\n tMagicTable.value?.toggleRowSelection(row, selected);\n};\n\nconst toggleRowExpansion = (row: any, expanded: boolean) => {\n tMagicTable.value?.toggleRowExpansion(row, expanded);\n};\n\nconst clearSelection = () => {\n tMagicTable.value?.clearSelection();\n};\n\nconst objectSpanMethod = (data: any) => {\n if (typeof props.spanMethod === 'function') {\n return props.spanMethod(data);\n }\n return () => ({\n rowspan: 0,\n colspan: 0,\n });\n};\n\ndefineExpose({\n toggleRowSelection,\n toggleRowExpansion,\n clearSelection,\n});\n</script>\n\n<style lang=\"scss\">\n.m-table {\n .el-button.action-btn + .el-button.action-btn {\n margin-left: 0;\n }\n .keep-all {\n word-break: keep-all;\n }\n .el-table .cell > div {\n display: inline-block;\n vertical-align: middle;\n }\n .el-table__row.el-table__row--level-1 {\n color: #999;\n }\n}\n</style>\n","/*\n * Tencent is pleased to support the open source community by making TMagicEditor available.\n *\n * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { App } from 'vue';\n\nimport Table from './Table.vue';\n\nexport { default as MagicTable } from './Table.vue';\n\nexport default {\n install(app: App) {\n app.component('m-table', Table);\n },\n};\n"],"names":["__default__","Table"],"mappings":";;;;;;;;;AAEA,MAAAA,gBAAe,e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Aa,MAAA,CAAA;AAAA,MACX,kBAAA;AAAA,MACA,kBAAA;AAAA,MACA,cAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzKD,cAAe;AAAA,EACb,QAAQ,GAAU,EAAA;AAChB,IAAI,GAAA,CAAA,SAAA,CAAU,WAAWC,SAAK,CAAA,CAAA;AAAA,GAChC;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"tmagic-table.js","sources":["../src/ActionsColumn.vue","../src/ExpandColumn.vue","../src/utils.ts","../src/Table.vue","../src/index.ts"],"sourcesContent":["<template>\n <TMagicTableColumn :label=\"config.label\" :width=\"config.width\" :fixed=\"config.fixed\">\n <template v-slot=\"scope\">\n <TMagicButton\n v-for=\"(action, actionIndex) in config.actions\"\n v-show=\"display(action.display, scope.row) && !editState[scope.$index]\"\n class=\"action-btn\"\n text\n :type=\"action.buttonType || 'primary'\"\n size=\"small\"\n :icon=\"action.icon\"\n :key=\"actionIndex\"\n @click=\"actionHandler(action, scope.row, scope.$index)\"\n ><span v-html=\"formatter(action.text, scope.row)\"></span\n ></TMagicButton>\n <TMagicButton\n class=\"action-btn\"\n v-show=\"editState[scope.$index]\"\n text\n type=\"primary\"\n size=\"small\"\n @click=\"save(scope.$index, config)\"\n >保存</TMagicButton\n >\n <TMagicButton\n class=\"action-btn\"\n v-show=\"editState[scope.$index]\"\n text\n type=\"primary\"\n size=\"small\"\n @click=\"editState[scope.$index] = undefined\"\n >取消</TMagicButton\n >\n </template>\n </TMagicTableColumn>\n</template>\n\n<script lang=\"ts\" setup>\nimport { TMagicButton, tMagicMessage, TMagicTableColumn } from '@tmagic/design';\n\nimport { ColumnActionConfig, ColumnConfig } from './schema';\n\ndefineOptions({\n name: 'MTableActionsColumn',\n});\n\nconst props = withDefaults(\n defineProps<{\n columns: any[];\n config: ColumnConfig;\n rowkeyName?: string;\n editState?: any;\n }>(),\n {\n columns: () => [],\n config: () => ({}),\n rowkeyName: 'c_id',\n editState: () => [],\n },\n);\n\nconst emit = defineEmits(['after-action']);\n\nconst display = (fuc: boolean | Function | undefined, row: any) => {\n if (typeof fuc === 'function') {\n return fuc(row);\n }\n return true;\n};\n\nconst formatter = (fuc: string | Function | undefined, row: any) => {\n if (typeof fuc === 'function') {\n return fuc(row);\n }\n return fuc;\n};\n\nconst actionHandler = async (action: ColumnActionConfig, row: any, index: number) => {\n await action.before?.(row, index);\n if (action.type === 'edit') {\n props.editState[index] = row;\n } else {\n await action.handler?.(row, index);\n }\n action.after?.(row, index);\n};\n\nconst save = async (index: number, config: ColumnConfig) => {\n const action = config.actions?.find((item) => item.type === 'edit')?.action;\n if (!action) return;\n\n const data: any = {};\n const row = props.editState[index];\n props.columns\n .filter((item) => item.type)\n .forEach((column) => {\n data[column.prop] = row[column.prop];\n });\n\n const res: any = await action({\n data,\n });\n\n if (res) {\n if (res.ret === 0) {\n tMagicMessage.success('保存成功');\n props.editState[index] = undefined;\n emit('after-action');\n } else {\n tMagicMessage.error(res.msg || '保存失败');\n }\n } else {\n props.editState[index] = undefined;\n emit('after-action');\n }\n};\n</script>\n","<template>\n <TMagicTableColumn type=\"expand\">\n <template #default=\"scope\">\n <MTable\n v-if=\"config.table\"\n :show-header=\"false\"\n :columns=\"config.table\"\n :data=\"(config.prop && scope.row[config.prop]) || []\"\n ></MTable>\n <MForm\n v-if=\"config.form\"\n :config=\"config.form\"\n :init-values=\"config.values || (config.prop && scope.row[config.prop]) || {}\"\n ></MForm>\n <div v-if=\"config.expandContent\" v-html=\"config.expandContent(scope.row, config.prop)\"></div>\n <component v-if=\"config.component\" :is=\"config.component\" v-bind=\"componentProps(scope.row)\"></component>\n </template>\n </TMagicTableColumn>\n</template>\n\n<script lang=\"ts\" setup>\nimport { TMagicTableColumn } from '@tmagic/design';\nimport { MForm } from '@tmagic/form';\n\nimport { ColumnConfig } from './schema';\nimport MTable from './Table.vue';\n\ndefineOptions({\n name: 'MTableExpandColumn',\n});\n\nconst props = withDefaults(\n defineProps<{\n config: ColumnConfig;\n }>(),\n {\n config: () => ({}),\n },\n);\n\nconst componentProps = (row: any) => {\n if (typeof props.config.props === 'function') {\n return props.config.props(row) || {};\n }\n return props.config.props || {};\n};\n</script>\n","/*\n * Tencent is pleased to support the open source community by making TMagicEditor available.\n *\n * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { datetimeFormatter } from '@tmagic/utils';\n\nimport { ColumnConfig } from './schema';\n\nexport const formatter = (item: ColumnConfig, row: any) => {\n if (!item.prop) return '';\n\n if (item.formatter) {\n if (item.formatter === 'datetime') {\n // eslint-disable-next-line no-param-reassign\n item.formatter = (value: string) => datetimeFormatter(value);\n }\n try {\n return item.formatter(row[item.prop], row);\n } catch (e) {\n return row[item.prop];\n }\n } else {\n return row[item.prop];\n }\n};\n","<template>\n <TMagicTable\n tooltip-effect=\"dark\"\n class=\"m-table\"\n ref=\"tMagicTable\"\n v-loading=\"loading\"\n :data=\"tableData\"\n :show-header=\"showHeader\"\n :max-height=\"bodyHeight\"\n :default-expand-all=\"defaultExpandAll\"\n :border=\"hasBorder\"\n :row-key=\"rowkeyName || 'id'\"\n :tree-props=\"{ children: 'children' }\"\n :empty-text=\"emptyText || '暂无数据'\"\n :span-method=\"objectSpanMethod\"\n @sort-change=\"sortChange\"\n @select=\"selectHandler\"\n @select-all=\"selectAllHandler\"\n @selection-change=\"selectionChangeHandler\"\n @cell-click=\"cellClickHandler\"\n @expand-change=\"expandChange\"\n >\n <template v-for=\"(item, columnIndex) in columns\">\n <template v-if=\"item.type === 'expand'\">\n <ExpandColumn :config=\"item\" :key=\"columnIndex\"></ExpandColumn>\n </template>\n\n <template v-else-if=\"item.selection\">\n <component\n width=\"40\"\n type=\"selection\"\n :is=\"tableColumnComponent?.component || 'el-table-column'\"\n :key=\"columnIndex\"\n :selectable=\"item.selectable\"\n ></component>\n </template>\n\n <template v-else-if=\"item.actions\">\n <ActionsColumn\n :columns=\"columns\"\n :config=\"item\"\n :rowkey-name=\"rowkeyName\"\n :edit-state=\"editState\"\n :key=\"columnIndex\"\n @after-action=\"$emit('after-action')\"\n ></ActionsColumn>\n </template>\n\n <template v-else-if=\"item.type === 'popover'\">\n <PopoverColumn :key=\"columnIndex\" :config=\"item\"></PopoverColumn>\n </template>\n\n <template v-else>\n <TextColumn :key=\"columnIndex\" :config=\"item\" :edit-state=\"editState\"></TextColumn>\n </template>\n </template>\n </TMagicTable>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue';\nimport { cloneDeep } from 'lodash-es';\n\nimport { getConfig, TMagicTable } from '@tmagic/design';\n\nimport ActionsColumn from './ActionsColumn.vue';\nimport ExpandColumn from './ExpandColumn.vue';\nimport PopoverColumn from './PopoverColumn.vue';\nimport TextColumn from './TextColumn.vue';\n\ndefineOptions({\n name: 'MTable',\n});\n\nconst props = withDefaults(\n defineProps<{\n data: any[];\n columns?: any[];\n /** 合并行或列的计算方法 */\n spanMethod?: (data: { row: any; column: any; rowIndex: number; columnIndex: number }) => [number, number];\n loading?: boolean;\n /** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */\n bodyHeight?: string | number;\n /** 是否显示表头 */\n showHeader?: boolean;\n /** 空数据时显示的文本内容 */\n emptyText?: string;\n /** 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 */\n defaultExpandAll?: boolean;\n rowkeyName?: string;\n /** 是否带有纵向边框 */\n border?: boolean;\n }>(),\n {\n columns: () => [],\n loading: false,\n showHeader: true,\n defaultExpandAll: false,\n border: false,\n },\n);\n\nconst emit = defineEmits([\n 'sort-change',\n 'after-action',\n 'select',\n 'select-all',\n 'selection-change',\n 'expand-change',\n 'cell-click',\n]);\n\nconst tMagicTable = ref<InstanceType<typeof TMagicTable>>();\n\nconst editState = ref([]);\n\nconst tableColumnComponent = getConfig('components')?.tableColumn;\nconst selectionColumn = computed(() => {\n const column = props.columns.filter((item) => item.selection);\n return column.length ? column[0] : null;\n});\n\nconst tableData = computed(() => {\n if (selectionColumn.value) {\n return props.data || [];\n }\n\n return cloneDeep(props.data) || [];\n});\n\nconst hasBorder = computed(() => (typeof props.border !== 'undefined' ? props.border : true));\n\nconst sortChange = (data: any) => {\n emit('sort-change', data);\n};\n\nconst selectHandler = (selection: any, row: any) => {\n const column = selectionColumn.value;\n if (!column) {\n return;\n }\n\n if (column.selection === 'single') {\n // this.clearSelection()\n // this.toggleRowSelection(row, true)\n }\n emit('select', selection, row);\n};\n\nconst selectAllHandler = (selection: any) => {\n emit('select-all', selection);\n};\n\nconst selectionChangeHandler = (selection: any) => {\n emit('selection-change', selection);\n};\n\nconst cellClickHandler = (...args: any[]) => {\n emit('cell-click', ...args);\n};\n\nconst expandChange = (...args: any[]) => {\n emit('expand-change', ...args);\n};\n\nconst toggleRowSelection = (row: any, selected: boolean) => {\n tMagicTable.value?.toggleRowSelection(row, selected);\n};\n\nconst toggleRowExpansion = (row: any, expanded: boolean) => {\n tMagicTable.value?.toggleRowExpansion(row, expanded);\n};\n\nconst clearSelection = () => {\n tMagicTable.value?.clearSelection();\n};\n\nconst objectSpanMethod = (data: any) => {\n if (typeof props.spanMethod === 'function') {\n return props.spanMethod(data);\n }\n return () => ({\n rowspan: 0,\n colspan: 0,\n });\n};\n\ndefineExpose({\n toggleRowSelection,\n toggleRowExpansion,\n clearSelection,\n});\n</script>\n\n<style lang=\"scss\">\n.m-table {\n .el-button.action-btn + .el-button.action-btn {\n margin-left: 0;\n }\n .keep-all {\n word-break: keep-all;\n }\n .el-table .cell > div {\n display: inline-block;\n vertical-align: middle;\n }\n .el-table__row.el-table__row--level-1 {\n color: #999;\n }\n}\n</style>\n","/*\n * Tencent is pleased to support the open source community by making TMagicEditor available.\n *\n * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { App } from 'vue';\n\nimport Table from './Table.vue';\n\nexport { default as MagicTable } from './Table.vue';\n\nexport default {\n install(app: App) {\n app.component('m-table', Table);\n },\n};\n"],"names":["Table"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+DA,IAAM,MAAA,OAAA,GAAU,CAAC,GAAA,EAAqC,GAAa,KAAA;AACjE,MAAI,IAAA,OAAO,QAAQ,UAAY,EAAA;AAC7B,QAAA,OAAO,IAAI,GAAG,CAAA,CAAA;AAAA,OAChB;AACA,MAAO,OAAA,IAAA,CAAA;AAAA,KACT,CAAA;AAEA,IAAM,MAAA,SAAA,GAAY,CAAC,GAAA,EAAoC,GAAa,KAAA;AAClE,MAAI,IAAA,OAAO,QAAQ,UAAY,EAAA;AAC7B,QAAA,OAAO,IAAI,GAAG,CAAA,CAAA;AAAA,OAChB;AACA,MAAO,OAAA,GAAA,CAAA;AAAA,KACT,CAAA;AAEA,IAAA,MAAM,aAAgB,GAAA,OAAO,MAA4B,EAAA,GAAA,EAAU,KAAkB,KAAA;AACnF,MAAM,MAAA,MAAA,CAAO,MAAS,GAAA,GAAA,EAAK,KAAK,CAAA,CAAA;AAChC,MAAI,IAAA,MAAA,CAAO,SAAS,MAAQ,EAAA;AAC1B,QAAM,KAAA,CAAA,SAAA,CAAU,KAAK,CAAI,GAAA,GAAA,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