@tmagic/table 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,15 +66,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
66
66
  };
67
67
  return (_ctx, _cache) => {
68
68
  return openBlock(), createBlock(unref(TMagicTableColumn), {
69
- label: _ctx.config.label,
70
- width: _ctx.config.width,
71
- fixed: _ctx.config.fixed
69
+ label: __props.config.label,
70
+ width: __props.config.width,
71
+ fixed: __props.config.fixed
72
72
  }, {
73
73
  default: withCtx((scope) => [
74
74
  (openBlock(true), createElementBlock(
75
75
  Fragment,
76
76
  null,
77
- renderList(_ctx.config.actions, (action, actionIndex) => {
77
+ renderList(__props.config.actions, (action, actionIndex) => {
78
78
  return openBlock(), createBlock(unref(TMagicTooltip), {
79
79
  placement: action.tooltipPlacement || "top",
80
80
  key: actionIndex,
@@ -98,7 +98,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
98
98
  _: 2
99
99
  /* DYNAMIC */
100
100
  }, 1032, ["type", "icon", "onClick"]), [
101
- [vShow, display(action.display, scope.row) && !_ctx.editState[scope.$index]]
101
+ [vShow, display(action.display, scope.row) && !__props.editState[scope.$index]]
102
102
  ])
103
103
  ]),
104
104
  _: 2
@@ -113,7 +113,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
113
113
  link: "",
114
114
  type: "primary",
115
115
  size: "small",
116
- onClick: ($event) => save(scope.$index, _ctx.config)
116
+ onClick: ($event) => save(scope.$index, __props.config)
117
117
  }, {
118
118
  default: withCtx(() => [..._cache[0] || (_cache[0] = [
119
119
  createTextVNode(
@@ -122,17 +122,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
122
122
  /* CACHED */
123
123
  )
124
124
  ])]),
125
- _: 2
126
- /* DYNAMIC */
127
- }, 1032, ["onClick"]), [
128
- [vShow, _ctx.editState[scope.$index]]
125
+ _: 1
126
+ /* STABLE */
127
+ }, 8, ["onClick"]), [
128
+ [vShow, __props.editState[scope.$index]]
129
129
  ]),
130
130
  withDirectives(createVNode(unref(TMagicButton), {
131
131
  class: "action-btn",
132
132
  link: "",
133
133
  type: "primary",
134
134
  size: "small",
135
- onClick: ($event) => _ctx.editState[scope.$index] = void 0
135
+ onClick: ($event) => __props.editState[scope.$index] = void 0
136
136
  }, {
137
137
  default: withCtx(() => [..._cache[1] || (_cache[1] = [
138
138
  createTextVNode(
@@ -141,10 +141,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
141
141
  /* CACHED */
142
142
  )
143
143
  ])]),
144
- _: 2
145
- /* DYNAMIC */
146
- }, 1032, ["onClick"]), [
147
- [vShow, _ctx.editState[scope.$index]]
144
+ _: 1
145
+ /* STABLE */
146
+ }, 8, ["onClick"]), [
147
+ [vShow, __props.editState[scope.$index]]
148
148
  ])
149
149
  ]),
150
150
  _: 1
@@ -179,15 +179,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
179
179
  return (_ctx, _cache) => {
180
180
  return openBlock(), createBlock(unref(TMagicTableColumn), {
181
181
  "show-overflow-tooltip": "",
182
- label: _ctx.config.label,
183
- width: _ctx.config.width,
184
- fixed: _ctx.config.fixed,
185
- sortable: _ctx.config.sortable,
186
- prop: _ctx.config.prop
182
+ label: __props.config.label,
183
+ width: __props.config.width,
184
+ fixed: __props.config.fixed,
185
+ sortable: __props.config.sortable,
186
+ prop: __props.config.prop
187
187
  }, {
188
188
  default: withCtx((scope) => [
189
189
  (openBlock(), createBlock(
190
- resolveDynamicComponent(_ctx.config.component),
190
+ resolveDynamicComponent(__props.config.component),
191
191
  mergeProps(componentProps(scope.row, scope.$index), toHandlers(componentListeners(scope.row, scope.$index))),
192
192
  null,
193
193
  16
@@ -226,27 +226,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
226
226
  createCommentVNode(" @ts-nocheck "),
227
227
  createVNode(unref(TMagicTableColumn), {
228
228
  type: "expand",
229
- width: _ctx.config.width,
230
- fixed: _ctx.config.fixed
229
+ width: __props.config.width,
230
+ fixed: __props.config.fixed
231
231
  }, {
232
232
  default: withCtx((scope) => [
233
- _ctx.config.table ? (openBlock(), createBlock(_sfc_main, {
233
+ __props.config.table ? (openBlock(), createBlock(_sfc_main, {
234
234
  key: 0,
235
235
  "show-header": false,
236
- columns: _ctx.config.table,
237
- data: _ctx.config.prop && scope.row[_ctx.config.prop] || []
236
+ columns: __props.config.table,
237
+ data: __props.config.prop && scope.row[__props.config.prop] || []
238
238
  }, null, 8, ["columns", "data"])) : createCommentVNode("v-if", true),
239
- _ctx.config.form ? (openBlock(), createBlock(unref(MForm), {
239
+ __props.config.form ? (openBlock(), createBlock(unref(MForm), {
240
240
  key: 1,
241
- config: _ctx.config.form,
242
- "init-values": _ctx.config.values || _ctx.config.prop && scope.row[_ctx.config.prop] || {}
241
+ config: __props.config.form,
242
+ "init-values": __props.config.values || __props.config.prop && scope.row[__props.config.prop] || {}
243
243
  }, null, 8, ["config", "init-values"])) : createCommentVNode("v-if", true),
244
- _ctx.config.expandContent ? (openBlock(), createElementBlock("div", {
244
+ __props.config.expandContent ? (openBlock(), createElementBlock("div", {
245
245
  key: 2,
246
- innerHTML: _ctx.config.expandContent(scope.row, _ctx.config.prop)
246
+ innerHTML: __props.config.expandContent(scope.row, __props.config.prop)
247
247
  }, null, 8, _hoisted_1$1)) : createCommentVNode("v-if", true),
248
- _ctx.config.component ? (openBlock(), createBlock(
249
- resolveDynamicComponent(_ctx.config.component),
248
+ __props.config.component ? (openBlock(), createBlock(
249
+ resolveDynamicComponent(__props.config.component),
250
250
  normalizeProps(mergeProps({ key: 3 }, componentProps(scope.row))),
251
251
  null,
252
252
  16
@@ -298,17 +298,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
298
298
  [
299
299
  createCommentVNode(" @ts-nocheck "),
300
300
  createVNode(unref(TMagicTableColumn), {
301
- label: _ctx.config.label,
302
- width: _ctx.config.width,
303
- fixed: _ctx.config.fixed
301
+ label: __props.config.label,
302
+ width: __props.config.width,
303
+ fixed: __props.config.fixed
304
304
  }, {
305
305
  default: withCtx((scope) => [
306
- _ctx.config.popover ? (openBlock(), createBlock(unref(TMagicPopover), {
306
+ __props.config.popover ? (openBlock(), createBlock(unref(TMagicPopover), {
307
307
  key: 0,
308
- placement: _ctx.config.popover.placement,
309
- width: _ctx.config.popover.width,
310
- trigger: _ctx.config.popover.trigger,
311
- "destroy-on-close": _ctx.config.popover.destroyOnClose ?? true
308
+ placement: __props.config.popover.placement,
309
+ width: __props.config.popover.width,
310
+ trigger: __props.config.popover.trigger,
311
+ "destroy-on-close": __props.config.popover.destroyOnClose ?? true
312
312
  }, {
313
313
  reference: withCtx(() => [
314
314
  createVNode(
@@ -320,7 +320,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
320
320
  {
321
321
  default: withCtx(() => [
322
322
  createTextVNode(
323
- toDisplayString(_ctx.config.text || unref(formatter)(_ctx.config, scope.row, { index: scope.$index })),
323
+ toDisplayString(__props.config.text || unref(formatter)(__props.config, scope.row, { index: scope.$index })),
324
324
  1
325
325
  /* TEXT */
326
326
  )
@@ -333,11 +333,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
333
333
  )
334
334
  ]),
335
335
  default: withCtx(() => [
336
- _ctx.config.popover.tableEmbed ? (openBlock(), createBlock(_sfc_main, {
336
+ __props.config.popover.tableEmbed ? (openBlock(), createBlock(_sfc_main, {
337
337
  key: 0,
338
- "show-header": _ctx.config.showHeader,
339
- columns: _ctx.config.table,
340
- data: _ctx.config.prop && scope.row[_ctx.config.prop] || []
338
+ "show-header": __props.config.showHeader,
339
+ columns: __props.config.table,
340
+ data: __props.config.prop && scope.row[__props.config.prop] || []
341
341
  }, null, 8, ["show-header", "columns", "data"])) : createCommentVNode("v-if", true)
342
342
  ]),
343
343
  _: 2
@@ -376,63 +376,63 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
376
376
  const _component_el_tooltip = resolveComponent("el-tooltip");
377
377
  return openBlock(), createBlock(unref(TMagicTableColumn), {
378
378
  "show-overflow-tooltip": "",
379
- label: _ctx.config.label,
380
- width: _ctx.config.width,
381
- fixed: _ctx.config.fixed,
382
- sortable: _ctx.config.sortable,
383
- prop: _ctx.config.prop
379
+ label: __props.config.label,
380
+ width: __props.config.width,
381
+ fixed: __props.config.fixed,
382
+ sortable: __props.config.sortable,
383
+ prop: __props.config.prop
384
384
  }, {
385
385
  default: withCtx((scope) => [
386
- _ctx.config.type === "index" ? (openBlock(), createElementBlock(
386
+ __props.config.type === "index" ? (openBlock(), createElementBlock(
387
387
  "div",
388
388
  _hoisted_1,
389
- toDisplayString(_ctx.config.pageIndex && _ctx.config.pageSize ? _ctx.config.pageIndex * _ctx.config.pageSize + scope.$index + 1 : scope.$index + 1),
389
+ toDisplayString(__props.config.pageIndex && __props.config.pageSize ? __props.config.pageIndex * __props.config.pageSize + scope.$index + 1 : scope.$index + 1),
390
390
  1
391
391
  /* TEXT */
392
- )) : _ctx.config.type && _ctx.editState[scope.$index] ? (openBlock(), createBlock(unref(TMagicForm), {
392
+ )) : __props.config.type && __props.editState[scope.$index] ? (openBlock(), createBlock(unref(TMagicForm), {
393
393
  key: 1,
394
394
  "label-width": "0",
395
- model: _ctx.editState[scope.$index]
395
+ model: __props.editState[scope.$index]
396
396
  }, {
397
397
  default: withCtx(() => [
398
398
  createVNode(_component_m_form_container, {
399
- prop: _ctx.config.prop,
400
- rules: _ctx.config.rules,
401
- config: _ctx.config,
402
- name: _ctx.config.prop,
403
- model: _ctx.editState[scope.$index]
399
+ prop: __props.config.prop,
400
+ rules: __props.config.rules,
401
+ config: __props.config,
402
+ name: __props.config.prop,
403
+ model: __props.editState[scope.$index]
404
404
  }, null, 8, ["prop", "rules", "config", "name", "model"])
405
405
  ]),
406
406
  _: 2
407
407
  /* DYNAMIC */
408
- }, 1032, ["model"])) : _ctx.config.action === "actionLink" && _ctx.config.prop ? (openBlock(), createBlock(unref(TMagicButton), {
408
+ }, 1032, ["model"])) : __props.config.action === "actionLink" && __props.config.prop ? (openBlock(), createBlock(unref(TMagicButton), {
409
409
  key: 2,
410
410
  link: "",
411
411
  type: "primary",
412
- onClick: ($event) => _ctx.config.handler?.(scope.row)
412
+ onClick: ($event) => __props.config.handler?.(scope.row)
413
413
  }, {
414
414
  default: withCtx(() => [
415
415
  createElementVNode("span", {
416
- innerHTML: unref(formatter)(_ctx.config, scope.row, { index: scope.$index })
416
+ innerHTML: unref(formatter)(__props.config, scope.row, { index: scope.$index })
417
417
  }, null, 8, _hoisted_2)
418
418
  ]),
419
419
  _: 2
420
420
  /* DYNAMIC */
421
- }, 1032, ["onClick"])) : _ctx.config.action === "img" && _ctx.config.prop ? (openBlock(), createElementBlock("a", {
421
+ }, 1032, ["onClick"])) : __props.config.action === "img" && __props.config.prop ? (openBlock(), createElementBlock("a", {
422
422
  key: 3,
423
423
  target: "_blank",
424
- href: scope.row[_ctx.config.prop]
424
+ href: scope.row[__props.config.prop]
425
425
  }, [
426
426
  createElementVNode("img", {
427
- src: scope.row[_ctx.config.prop],
427
+ src: scope.row[__props.config.prop],
428
428
  height: "50"
429
429
  }, null, 8, _hoisted_4)
430
- ], 8, _hoisted_3)) : _ctx.config.action === "link" && _ctx.config.prop ? (openBlock(), createElementBlock("a", {
430
+ ], 8, _hoisted_3)) : __props.config.action === "link" && __props.config.prop ? (openBlock(), createElementBlock("a", {
431
431
  key: 4,
432
432
  target: "_blank",
433
- href: scope.row[_ctx.config.prop],
433
+ href: scope.row[__props.config.prop],
434
434
  class: "keep-all"
435
- }, toDisplayString(scope.row[_ctx.config.prop]), 9, _hoisted_5)) : _ctx.config.action === "tip" ? (openBlock(), createBlock(
435
+ }, toDisplayString(scope.row[__props.config.prop]), 9, _hoisted_5)) : __props.config.action === "tip" ? (openBlock(), createBlock(
436
436
  _component_el_tooltip,
437
437
  {
438
438
  key: 5,
@@ -443,7 +443,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
443
443
  createElementVNode(
444
444
  "div",
445
445
  null,
446
- toDisplayString(unref(formatter)(_ctx.config, scope.row, { index: scope.$index })),
446
+ toDisplayString(unref(formatter)(__props.config, scope.row, { index: scope.$index })),
447
447
  1
448
448
  /* TEXT */
449
449
  )
@@ -455,7 +455,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
455
455
  }, {
456
456
  default: withCtx(() => [
457
457
  createTextVNode(
458
- toDisplayString(_ctx.config.buttonText || "扩展配置"),
458
+ toDisplayString(__props.config.buttonText || "扩展配置"),
459
459
  1
460
460
  /* TEXT */
461
461
  )
@@ -469,14 +469,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
469
469
  },
470
470
  1024
471
471
  /* DYNAMIC_SLOTS */
472
- )) : _ctx.config.action === "tag" && _ctx.config.prop ? (openBlock(), createBlock(unref(TMagicTag), {
472
+ )) : __props.config.action === "tag" && __props.config.prop ? (openBlock(), createBlock(unref(TMagicTag), {
473
473
  key: 6,
474
- type: typeof _ctx.config.type === "function" ? _ctx.config.type(scope.row[_ctx.config.prop], scope.row) : _ctx.config.type,
474
+ type: typeof __props.config.type === "function" ? __props.config.type(scope.row[__props.config.prop], scope.row) : __props.config.type,
475
475
  "close-transition": ""
476
476
  }, {
477
477
  default: withCtx(() => [
478
478
  createTextVNode(
479
- toDisplayString(unref(formatter)(_ctx.config, scope.row, { index: scope.$index })),
479
+ toDisplayString(unref(formatter)(__props.config, scope.row, { index: scope.$index })),
480
480
  1
481
481
  /* TEXT */
482
482
  )
@@ -485,7 +485,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
485
485
  /* DYNAMIC */
486
486
  }, 1032, ["type"])) : (openBlock(), createElementBlock("div", {
487
487
  key: 7,
488
- innerHTML: unref(formatter)(_ctx.config, scope.row, { index: scope.$index })
488
+ innerHTML: unref(formatter)(__props.config, scope.row, { index: scope.$index })
489
489
  }, null, 8, _hoisted_6))
490
490
  ]),
491
491
  _: 1
@@ -593,13 +593,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
593
593
  ref_key: "tMagicTable",
594
594
  ref: tMagicTable,
595
595
  data: tableData.value,
596
- "show-header": _ctx.showHeader,
597
- "max-height": _ctx.bodyHeight,
598
- "default-expand-all": _ctx.defaultExpandAll,
596
+ "show-header": __props.showHeader,
597
+ "max-height": __props.bodyHeight,
598
+ "default-expand-all": __props.defaultExpandAll,
599
599
  border: hasBorder.value,
600
- "row-key": _ctx.rowkeyName || "id",
600
+ "row-key": __props.rowkeyName || "id",
601
601
  "tree-props": { children: "children" },
602
- "empty-text": _ctx.emptyText || "暂无数据",
602
+ "empty-text": __props.emptyText || "暂无数据",
603
603
  "span-method": objectSpanMethod,
604
604
  onSortChange: sortChange,
605
605
  onSelect: selectHandler,
@@ -612,7 +612,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
612
612
  (openBlock(true), createElementBlock(
613
613
  Fragment,
614
614
  null,
615
- renderList(_ctx.columns, (item, columnIndex) => {
615
+ renderList(__props.columns, (item, columnIndex) => {
616
616
  return openBlock(), createElementBlock(
617
617
  Fragment,
618
618
  null,
@@ -629,9 +629,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
629
629
  key: columnIndex,
630
630
  selectable: item.selectable
631
631
  }, null, 8, ["selectable"])) : item.actions ? (openBlock(), createBlock(_sfc_main$5, {
632
- columns: _ctx.columns,
632
+ columns: __props.columns,
633
633
  config: item,
634
- "rowkey-name": _ctx.rowkeyName,
634
+ "rowkey-name": __props.rowkeyName,
635
635
  "edit-state": editState.value,
636
636
  key: columnIndex,
637
637
  onAfterAction: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("after-action"))
@@ -655,7 +655,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
655
655
  _: 1
656
656
  /* STABLE */
657
657
  }, 8, ["data", "show-header", "max-height", "default-expand-all", "border", "row-key", "empty-text"])), [
658
- [_directive_loading, _ctx.loading]
658
+ [_directive_loading, __props.loading]
659
659
  ]);
660
660
  };
661
661
  }
@@ -2091,15 +2091,15 @@
2091
2091
  };
2092
2092
  return (_ctx, _cache) => {
2093
2093
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
2094
- label: _ctx.config.label,
2095
- width: _ctx.config.width,
2096
- fixed: _ctx.config.fixed
2094
+ label: __props.config.label,
2095
+ width: __props.config.width,
2096
+ fixed: __props.config.fixed
2097
2097
  }, {
2098
2098
  default: vue.withCtx((scope) => [
2099
2099
  (vue.openBlock(true), vue.createElementBlock(
2100
2100
  vue.Fragment,
2101
2101
  null,
2102
- vue.renderList(_ctx.config.actions, (action, actionIndex) => {
2102
+ vue.renderList(__props.config.actions, (action, actionIndex) => {
2103
2103
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
2104
2104
  placement: action.tooltipPlacement || "top",
2105
2105
  key: actionIndex,
@@ -2123,7 +2123,7 @@
2123
2123
  _: 2
2124
2124
  /* DYNAMIC */
2125
2125
  }, 1032, ["type", "icon", "onClick"]), [
2126
- [vue.vShow, display(action.display, scope.row) && !_ctx.editState[scope.$index]]
2126
+ [vue.vShow, display(action.display, scope.row) && !__props.editState[scope.$index]]
2127
2127
  ])
2128
2128
  ]),
2129
2129
  _: 2
@@ -2138,7 +2138,7 @@
2138
2138
  link: "",
2139
2139
  type: "primary",
2140
2140
  size: "small",
2141
- onClick: ($event) => save(scope.$index, _ctx.config)
2141
+ onClick: ($event) => save(scope.$index, __props.config)
2142
2142
  }, {
2143
2143
  default: vue.withCtx(() => [..._cache[0] || (_cache[0] = [
2144
2144
  vue.createTextVNode(
@@ -2147,17 +2147,17 @@
2147
2147
  /* CACHED */
2148
2148
  )
2149
2149
  ])]),
2150
- _: 2
2151
- /* DYNAMIC */
2152
- }, 1032, ["onClick"]), [
2153
- [vue.vShow, _ctx.editState[scope.$index]]
2150
+ _: 1
2151
+ /* STABLE */
2152
+ }, 8, ["onClick"]), [
2153
+ [vue.vShow, __props.editState[scope.$index]]
2154
2154
  ]),
2155
2155
  vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
2156
2156
  class: "action-btn",
2157
2157
  link: "",
2158
2158
  type: "primary",
2159
2159
  size: "small",
2160
- onClick: ($event) => _ctx.editState[scope.$index] = void 0
2160
+ onClick: ($event) => __props.editState[scope.$index] = void 0
2161
2161
  }, {
2162
2162
  default: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
2163
2163
  vue.createTextVNode(
@@ -2166,10 +2166,10 @@
2166
2166
  /* CACHED */
2167
2167
  )
2168
2168
  ])]),
2169
- _: 2
2170
- /* DYNAMIC */
2171
- }, 1032, ["onClick"]), [
2172
- [vue.vShow, _ctx.editState[scope.$index]]
2169
+ _: 1
2170
+ /* STABLE */
2171
+ }, 8, ["onClick"]), [
2172
+ [vue.vShow, __props.editState[scope.$index]]
2173
2173
  ])
2174
2174
  ]),
2175
2175
  _: 1
@@ -2204,15 +2204,15 @@
2204
2204
  return (_ctx, _cache) => {
2205
2205
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
2206
2206
  "show-overflow-tooltip": "",
2207
- label: _ctx.config.label,
2208
- width: _ctx.config.width,
2209
- fixed: _ctx.config.fixed,
2210
- sortable: _ctx.config.sortable,
2211
- prop: _ctx.config.prop
2207
+ label: __props.config.label,
2208
+ width: __props.config.width,
2209
+ fixed: __props.config.fixed,
2210
+ sortable: __props.config.sortable,
2211
+ prop: __props.config.prop
2212
2212
  }, {
2213
2213
  default: vue.withCtx((scope) => [
2214
2214
  (vue.openBlock(), vue.createBlock(
2215
- vue.resolveDynamicComponent(_ctx.config.component),
2215
+ vue.resolveDynamicComponent(__props.config.component),
2216
2216
  vue.mergeProps(componentProps(scope.row, scope.$index), vue.toHandlers(componentListeners(scope.row, scope.$index))),
2217
2217
  null,
2218
2218
  16
@@ -2251,27 +2251,27 @@
2251
2251
  vue.createCommentVNode(" @ts-nocheck "),
2252
2252
  vue.createVNode(vue.unref(design.TMagicTableColumn), {
2253
2253
  type: "expand",
2254
- width: _ctx.config.width,
2255
- fixed: _ctx.config.fixed
2254
+ width: __props.config.width,
2255
+ fixed: __props.config.fixed
2256
2256
  }, {
2257
2257
  default: vue.withCtx((scope) => [
2258
- _ctx.config.table ? (vue.openBlock(), vue.createBlock(_sfc_main, {
2258
+ __props.config.table ? (vue.openBlock(), vue.createBlock(_sfc_main, {
2259
2259
  key: 0,
2260
2260
  "show-header": false,
2261
- columns: _ctx.config.table,
2262
- data: _ctx.config.prop && scope.row[_ctx.config.prop] || []
2261
+ columns: __props.config.table,
2262
+ data: __props.config.prop && scope.row[__props.config.prop] || []
2263
2263
  }, null, 8, ["columns", "data"])) : vue.createCommentVNode("v-if", true),
2264
- _ctx.config.form ? (vue.openBlock(), vue.createBlock(vue.unref(form.MForm), {
2264
+ __props.config.form ? (vue.openBlock(), vue.createBlock(vue.unref(form.MForm), {
2265
2265
  key: 1,
2266
- config: _ctx.config.form,
2267
- "init-values": _ctx.config.values || _ctx.config.prop && scope.row[_ctx.config.prop] || {}
2266
+ config: __props.config.form,
2267
+ "init-values": __props.config.values || __props.config.prop && scope.row[__props.config.prop] || {}
2268
2268
  }, null, 8, ["config", "init-values"])) : vue.createCommentVNode("v-if", true),
2269
- _ctx.config.expandContent ? (vue.openBlock(), vue.createElementBlock("div", {
2269
+ __props.config.expandContent ? (vue.openBlock(), vue.createElementBlock("div", {
2270
2270
  key: 2,
2271
- innerHTML: _ctx.config.expandContent(scope.row, _ctx.config.prop)
2271
+ innerHTML: __props.config.expandContent(scope.row, __props.config.prop)
2272
2272
  }, null, 8, _hoisted_1$1)) : vue.createCommentVNode("v-if", true),
2273
- _ctx.config.component ? (vue.openBlock(), vue.createBlock(
2274
- vue.resolveDynamicComponent(_ctx.config.component),
2273
+ __props.config.component ? (vue.openBlock(), vue.createBlock(
2274
+ vue.resolveDynamicComponent(__props.config.component),
2275
2275
  vue.normalizeProps(vue.mergeProps({ key: 3 }, componentProps(scope.row))),
2276
2276
  null,
2277
2277
  16
@@ -2323,17 +2323,17 @@
2323
2323
  [
2324
2324
  vue.createCommentVNode(" @ts-nocheck "),
2325
2325
  vue.createVNode(vue.unref(design.TMagicTableColumn), {
2326
- label: _ctx.config.label,
2327
- width: _ctx.config.width,
2328
- fixed: _ctx.config.fixed
2326
+ label: __props.config.label,
2327
+ width: __props.config.width,
2328
+ fixed: __props.config.fixed
2329
2329
  }, {
2330
2330
  default: vue.withCtx((scope) => [
2331
- _ctx.config.popover ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
2331
+ __props.config.popover ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
2332
2332
  key: 0,
2333
- placement: _ctx.config.popover.placement,
2334
- width: _ctx.config.popover.width,
2335
- trigger: _ctx.config.popover.trigger,
2336
- "destroy-on-close": _ctx.config.popover.destroyOnClose ?? true
2333
+ placement: __props.config.popover.placement,
2334
+ width: __props.config.popover.width,
2335
+ trigger: __props.config.popover.trigger,
2336
+ "destroy-on-close": __props.config.popover.destroyOnClose ?? true
2337
2337
  }, {
2338
2338
  reference: vue.withCtx(() => [
2339
2339
  vue.createVNode(
@@ -2345,7 +2345,7 @@
2345
2345
  {
2346
2346
  default: vue.withCtx(() => [
2347
2347
  vue.createTextVNode(
2348
- vue.toDisplayString(_ctx.config.text || vue.unref(formatter)(_ctx.config, scope.row, { index: scope.$index })),
2348
+ vue.toDisplayString(__props.config.text || vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })),
2349
2349
  1
2350
2350
  /* TEXT */
2351
2351
  )
@@ -2358,11 +2358,11 @@
2358
2358
  )
2359
2359
  ]),
2360
2360
  default: vue.withCtx(() => [
2361
- _ctx.config.popover.tableEmbed ? (vue.openBlock(), vue.createBlock(_sfc_main, {
2361
+ __props.config.popover.tableEmbed ? (vue.openBlock(), vue.createBlock(_sfc_main, {
2362
2362
  key: 0,
2363
- "show-header": _ctx.config.showHeader,
2364
- columns: _ctx.config.table,
2365
- data: _ctx.config.prop && scope.row[_ctx.config.prop] || []
2363
+ "show-header": __props.config.showHeader,
2364
+ columns: __props.config.table,
2365
+ data: __props.config.prop && scope.row[__props.config.prop] || []
2366
2366
  }, null, 8, ["show-header", "columns", "data"])) : vue.createCommentVNode("v-if", true)
2367
2367
  ]),
2368
2368
  _: 2
@@ -2401,63 +2401,63 @@
2401
2401
  const _component_el_tooltip = vue.resolveComponent("el-tooltip");
2402
2402
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
2403
2403
  "show-overflow-tooltip": "",
2404
- label: _ctx.config.label,
2405
- width: _ctx.config.width,
2406
- fixed: _ctx.config.fixed,
2407
- sortable: _ctx.config.sortable,
2408
- prop: _ctx.config.prop
2404
+ label: __props.config.label,
2405
+ width: __props.config.width,
2406
+ fixed: __props.config.fixed,
2407
+ sortable: __props.config.sortable,
2408
+ prop: __props.config.prop
2409
2409
  }, {
2410
2410
  default: vue.withCtx((scope) => [
2411
- _ctx.config.type === "index" ? (vue.openBlock(), vue.createElementBlock(
2411
+ __props.config.type === "index" ? (vue.openBlock(), vue.createElementBlock(
2412
2412
  "div",
2413
2413
  _hoisted_1,
2414
- vue.toDisplayString(_ctx.config.pageIndex && _ctx.config.pageSize ? _ctx.config.pageIndex * _ctx.config.pageSize + scope.$index + 1 : scope.$index + 1),
2414
+ vue.toDisplayString(__props.config.pageIndex && __props.config.pageSize ? __props.config.pageIndex * __props.config.pageSize + scope.$index + 1 : scope.$index + 1),
2415
2415
  1
2416
2416
  /* TEXT */
2417
- )) : _ctx.config.type && _ctx.editState[scope.$index] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicForm), {
2417
+ )) : __props.config.type && __props.editState[scope.$index] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicForm), {
2418
2418
  key: 1,
2419
2419
  "label-width": "0",
2420
- model: _ctx.editState[scope.$index]
2420
+ model: __props.editState[scope.$index]
2421
2421
  }, {
2422
2422
  default: vue.withCtx(() => [
2423
2423
  vue.createVNode(_component_m_form_container, {
2424
- prop: _ctx.config.prop,
2425
- rules: _ctx.config.rules,
2426
- config: _ctx.config,
2427
- name: _ctx.config.prop,
2428
- model: _ctx.editState[scope.$index]
2424
+ prop: __props.config.prop,
2425
+ rules: __props.config.rules,
2426
+ config: __props.config,
2427
+ name: __props.config.prop,
2428
+ model: __props.editState[scope.$index]
2429
2429
  }, null, 8, ["prop", "rules", "config", "name", "model"])
2430
2430
  ]),
2431
2431
  _: 2
2432
2432
  /* DYNAMIC */
2433
- }, 1032, ["model"])) : _ctx.config.action === "actionLink" && _ctx.config.prop ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
2433
+ }, 1032, ["model"])) : __props.config.action === "actionLink" && __props.config.prop ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
2434
2434
  key: 2,
2435
2435
  link: "",
2436
2436
  type: "primary",
2437
- onClick: ($event) => _ctx.config.handler?.(scope.row)
2437
+ onClick: ($event) => __props.config.handler?.(scope.row)
2438
2438
  }, {
2439
2439
  default: vue.withCtx(() => [
2440
2440
  vue.createElementVNode("span", {
2441
- innerHTML: vue.unref(formatter)(_ctx.config, scope.row, { index: scope.$index })
2441
+ innerHTML: vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })
2442
2442
  }, null, 8, _hoisted_2)
2443
2443
  ]),
2444
2444
  _: 2
2445
2445
  /* DYNAMIC */
2446
- }, 1032, ["onClick"])) : _ctx.config.action === "img" && _ctx.config.prop ? (vue.openBlock(), vue.createElementBlock("a", {
2446
+ }, 1032, ["onClick"])) : __props.config.action === "img" && __props.config.prop ? (vue.openBlock(), vue.createElementBlock("a", {
2447
2447
  key: 3,
2448
2448
  target: "_blank",
2449
- href: scope.row[_ctx.config.prop]
2449
+ href: scope.row[__props.config.prop]
2450
2450
  }, [
2451
2451
  vue.createElementVNode("img", {
2452
- src: scope.row[_ctx.config.prop],
2452
+ src: scope.row[__props.config.prop],
2453
2453
  height: "50"
2454
2454
  }, null, 8, _hoisted_4)
2455
- ], 8, _hoisted_3)) : _ctx.config.action === "link" && _ctx.config.prop ? (vue.openBlock(), vue.createElementBlock("a", {
2455
+ ], 8, _hoisted_3)) : __props.config.action === "link" && __props.config.prop ? (vue.openBlock(), vue.createElementBlock("a", {
2456
2456
  key: 4,
2457
2457
  target: "_blank",
2458
- href: scope.row[_ctx.config.prop],
2458
+ href: scope.row[__props.config.prop],
2459
2459
  class: "keep-all"
2460
- }, vue.toDisplayString(scope.row[_ctx.config.prop]), 9, _hoisted_5)) : _ctx.config.action === "tip" ? (vue.openBlock(), vue.createBlock(
2460
+ }, vue.toDisplayString(scope.row[__props.config.prop]), 9, _hoisted_5)) : __props.config.action === "tip" ? (vue.openBlock(), vue.createBlock(
2461
2461
  _component_el_tooltip,
2462
2462
  {
2463
2463
  key: 5,
@@ -2468,7 +2468,7 @@
2468
2468
  vue.createElementVNode(
2469
2469
  "div",
2470
2470
  null,
2471
- vue.toDisplayString(vue.unref(formatter)(_ctx.config, scope.row, { index: scope.$index })),
2471
+ vue.toDisplayString(vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })),
2472
2472
  1
2473
2473
  /* TEXT */
2474
2474
  )
@@ -2480,7 +2480,7 @@
2480
2480
  }, {
2481
2481
  default: vue.withCtx(() => [
2482
2482
  vue.createTextVNode(
2483
- vue.toDisplayString(_ctx.config.buttonText || "扩展配置"),
2483
+ vue.toDisplayString(__props.config.buttonText || "扩展配置"),
2484
2484
  1
2485
2485
  /* TEXT */
2486
2486
  )
@@ -2494,14 +2494,14 @@
2494
2494
  },
2495
2495
  1024
2496
2496
  /* DYNAMIC_SLOTS */
2497
- )) : _ctx.config.action === "tag" && _ctx.config.prop ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTag), {
2497
+ )) : __props.config.action === "tag" && __props.config.prop ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTag), {
2498
2498
  key: 6,
2499
- type: typeof _ctx.config.type === "function" ? _ctx.config.type(scope.row[_ctx.config.prop], scope.row) : _ctx.config.type,
2499
+ type: typeof __props.config.type === "function" ? __props.config.type(scope.row[__props.config.prop], scope.row) : __props.config.type,
2500
2500
  "close-transition": ""
2501
2501
  }, {
2502
2502
  default: vue.withCtx(() => [
2503
2503
  vue.createTextVNode(
2504
- vue.toDisplayString(vue.unref(formatter)(_ctx.config, scope.row, { index: scope.$index })),
2504
+ vue.toDisplayString(vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })),
2505
2505
  1
2506
2506
  /* TEXT */
2507
2507
  )
@@ -2510,7 +2510,7 @@
2510
2510
  /* DYNAMIC */
2511
2511
  }, 1032, ["type"])) : (vue.openBlock(), vue.createElementBlock("div", {
2512
2512
  key: 7,
2513
- innerHTML: vue.unref(formatter)(_ctx.config, scope.row, { index: scope.$index })
2513
+ innerHTML: vue.unref(formatter)(__props.config, scope.row, { index: scope.$index })
2514
2514
  }, null, 8, _hoisted_6))
2515
2515
  ]),
2516
2516
  _: 1
@@ -2618,13 +2618,13 @@
2618
2618
  ref_key: "tMagicTable",
2619
2619
  ref: tMagicTable,
2620
2620
  data: tableData.value,
2621
- "show-header": _ctx.showHeader,
2622
- "max-height": _ctx.bodyHeight,
2623
- "default-expand-all": _ctx.defaultExpandAll,
2621
+ "show-header": __props.showHeader,
2622
+ "max-height": __props.bodyHeight,
2623
+ "default-expand-all": __props.defaultExpandAll,
2624
2624
  border: hasBorder.value,
2625
- "row-key": _ctx.rowkeyName || "id",
2625
+ "row-key": __props.rowkeyName || "id",
2626
2626
  "tree-props": { children: "children" },
2627
- "empty-text": _ctx.emptyText || "暂无数据",
2627
+ "empty-text": __props.emptyText || "暂无数据",
2628
2628
  "span-method": objectSpanMethod,
2629
2629
  onSortChange: sortChange,
2630
2630
  onSelect: selectHandler,
@@ -2637,7 +2637,7 @@
2637
2637
  (vue.openBlock(true), vue.createElementBlock(
2638
2638
  vue.Fragment,
2639
2639
  null,
2640
- vue.renderList(_ctx.columns, (item, columnIndex) => {
2640
+ vue.renderList(__props.columns, (item, columnIndex) => {
2641
2641
  return vue.openBlock(), vue.createElementBlock(
2642
2642
  vue.Fragment,
2643
2643
  null,
@@ -2654,9 +2654,9 @@
2654
2654
  key: columnIndex,
2655
2655
  selectable: item.selectable
2656
2656
  }, null, 8, ["selectable"])) : item.actions ? (vue.openBlock(), vue.createBlock(_sfc_main$5, {
2657
- columns: _ctx.columns,
2657
+ columns: __props.columns,
2658
2658
  config: item,
2659
- "rowkey-name": _ctx.rowkeyName,
2659
+ "rowkey-name": __props.rowkeyName,
2660
2660
  "edit-state": editState.value,
2661
2661
  key: columnIndex,
2662
2662
  onAfterAction: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("after-action"))
@@ -2680,7 +2680,7 @@
2680
2680
  _: 1
2681
2681
  /* STABLE */
2682
2682
  }, 8, ["data", "show-header", "max-height", "default-expand-all", "border", "row-key", "empty-text"])), [
2683
- [_directive_loading, _ctx.loading]
2683
+ [_directive_loading, __props.loading]
2684
2684
  ]);
2685
2685
  };
2686
2686
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.0",
2
+ "version": "1.6.1",
3
3
  "name": "@tmagic/table",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -42,10 +42,10 @@
42
42
  "@types/lodash-es": "^4.17.4"
43
43
  },
44
44
  "peerDependencies": {
45
- "vue": "^3.5.20",
46
- "typescript": "^5.9.2",
47
- "@tmagic/design": "1.6.0",
48
- "@tmagic/form": "1.6.0"
45
+ "vue": "^3.5.22",
46
+ "typescript": "^5.9.3",
47
+ "@tmagic/design": "1.6.1",
48
+ "@tmagic/form": "1.6.1"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "typescript": {
package/types/index.d.ts CHANGED
@@ -84,7 +84,7 @@ type __VLS_Props = {
84
84
  /** 是否带有纵向边框 */
85
85
  border?: boolean;
86
86
  };
87
- declare const _default$1: _vue_runtime_core.DefineComponent<__VLS_Props, {
87
+ declare const __VLS_export: _vue_runtime_core.DefineComponent<__VLS_Props, {
88
88
  toggleRowSelection: (row: any, selected: boolean) => void;
89
89
  toggleRowExpansion: (row: any, expanded: boolean) => void;
90
90
  clearSelection: () => void;
@@ -111,6 +111,7 @@ declare const _default$1: _vue_runtime_core.DefineComponent<__VLS_Props, {
111
111
  columns: ColumnConfig[];
112
112
  showHeader: boolean;
113
113
  }, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;
114
+ declare const _default$1: typeof __VLS_export;
114
115
 
115
116
  declare const formatter: (item: ColumnConfig, row: any, data: {
116
117
  index: number;