tabula-vue 1.0.0 → 1.0.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.
Files changed (180) hide show
  1. package/es/component.mjs +2 -0
  2. package/es/components/dialog/index.d.ts +30 -30
  3. package/es/components/dialog/src/index.vue.d.ts +2 -2
  4. package/es/components/dialog-form/index.d.ts +2 -2
  5. package/es/components/dialog-form/src/index.vue.d.ts +2 -2
  6. package/es/components/display-item/index.d.ts +25 -25
  7. package/es/components/display-item/src/index.vue.d.ts +7 -7
  8. package/es/components/drawer-form/index.d.ts +50 -50
  9. package/es/components/drawer-form/src/index.vue.d.ts +10 -10
  10. package/es/components/form/index.d.ts +99 -99
  11. package/es/components/form/src/form-content.vue.d.ts +12 -12
  12. package/es/components/form/src/index.vue.d.ts +11 -11
  13. package/es/components/form-item/index.d.ts +80 -80
  14. package/es/components/form-item/src/index.vue.d.ts +9 -9
  15. package/es/components/index.d.ts +1 -0
  16. package/es/components/index.mjs +5 -0
  17. package/es/components/input-tag/index.d.ts +6 -6
  18. package/es/components/input-tag/src/index.vue.d.ts +6 -6
  19. package/es/components/layout/index.d.ts +30 -30
  20. package/es/components/layout/src/index.vue.d.ts +10 -10
  21. package/es/components/page/index.d.ts +1613 -1123
  22. package/es/components/page/src/index.vue.d.ts +618 -430
  23. package/es/components/page/src/index.vue2.mjs +31 -10
  24. package/es/components/popover/index.d.ts +49 -49
  25. package/es/components/popover/src/index.vue.d.ts +3 -3
  26. package/es/components/render/index.d.ts +14 -14
  27. package/es/components/render/src/index.vue.d.ts +1 -1
  28. package/es/components/search/index.d.ts +298 -298
  29. package/es/components/search/src/index.vue.d.ts +84 -84
  30. package/es/components/sidebar/index.d.ts +31 -31
  31. package/es/components/sidebar/src/index.vue.d.ts +5 -5
  32. package/es/components/table/index.d.ts +165 -180
  33. package/es/components/table/index.mjs +3 -0
  34. package/es/components/table/src/index.vue.d.ts +12 -21
  35. package/es/components/table/src/index.vue2.mjs +11 -34
  36. package/es/components/table/src/table-action-bar-content.vue.d.ts +78 -0
  37. package/es/components/table/src/table-action-bar-content.vue.mjs +6 -0
  38. package/es/components/table/src/table-action-bar-content.vue2.mjs +395 -0
  39. package/es/components/table/src/table-action-bar.vue.d.ts +4 -4
  40. package/es/components/table/src/table-action-bar.vue2.mjs +30 -353
  41. package/es/components/table/src/table-column-drag-sort.vue.d.ts +1 -1
  42. package/es/components/table/src/table-column-index.vue.d.ts +1 -1
  43. package/es/components/table/src/table-column.vue.d.ts +22 -29
  44. package/es/components/table/src/table-column.vue2.mjs +4 -57
  45. package/es/components/table/src/table-title-bar.vue.d.ts +2 -2
  46. package/es/components/table/src/type.d.ts +0 -11
  47. package/es/components/table/src/use-columns.d.ts +26 -0
  48. package/es/components/table/src/use-columns.mjs +40 -0
  49. package/es/components/table-v2/index.d.ts +174 -0
  50. package/es/components/table-v2/index.mjs +7 -0
  51. package/es/components/table-v2/src/column-converter.d.ts +27 -0
  52. package/es/components/table-v2/src/column-converter.mjs +42 -0
  53. package/es/components/table-v2/src/index.vue.d.ts +157 -0
  54. package/es/components/table-v2/src/index.vue.mjs +6 -0
  55. package/es/components/table-v2/src/index.vue2.mjs +491 -0
  56. package/es/components/table-v2/src/special-columns.d.ts +61 -0
  57. package/es/components/table-v2/src/special-columns.mjs +76 -0
  58. package/es/components/table-v2/src/table-v2-cell.d.ts +104 -0
  59. package/es/components/table-v2/src/table-v2-cell.mjs +139 -0
  60. package/es/components/table-v2/src/table-v2-header-cell.vue.d.ts +61 -0
  61. package/es/components/table-v2/src/table-v2-header-cell.vue.mjs +6 -0
  62. package/es/components/table-v2/src/table-v2-header-cell.vue2.mjs +92 -0
  63. package/es/components/table-v2/src/type.d.ts +95 -0
  64. package/es/components/table-v2/src/type.mjs +1 -0
  65. package/es/components/table-v2/src/use-table-v2-columns.d.ts +43 -0
  66. package/es/components/table-v2/src/use-table-v2-columns.mjs +47 -0
  67. package/es/components/table-v2/style/css.d.ts +17 -0
  68. package/es/components/table-v2/style/css.mjs +17 -0
  69. package/es/components/table-v2/style/index.d.ts +17 -0
  70. package/es/components/table-v2/style/index.mjs +17 -0
  71. package/es/index.mjs +5 -0
  72. package/es/version.d.ts +1 -1
  73. package/es/version.mjs +1 -1
  74. package/index.css +1 -1
  75. package/index.js +1111 -218
  76. package/index.min.js +5 -6
  77. package/index.min.mjs +5 -6
  78. package/index.mjs +1109 -221
  79. package/lib/component.js +40 -38
  80. package/lib/components/dialog/index.d.ts +30 -30
  81. package/lib/components/dialog/src/index.vue.d.ts +2 -2
  82. package/lib/components/dialog-form/index.d.ts +2 -2
  83. package/lib/components/dialog-form/src/index.vue.d.ts +2 -2
  84. package/lib/components/display-item/index.d.ts +25 -25
  85. package/lib/components/display-item/src/index.vue.d.ts +7 -7
  86. package/lib/components/drawer-form/index.d.ts +50 -50
  87. package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
  88. package/lib/components/form/index.d.ts +99 -99
  89. package/lib/components/form/src/form-content.vue.d.ts +12 -12
  90. package/lib/components/form/src/index.vue.d.ts +11 -11
  91. package/lib/components/form-item/index.d.ts +80 -80
  92. package/lib/components/form-item/src/index.vue.d.ts +9 -9
  93. package/lib/components/index.d.ts +1 -0
  94. package/lib/components/index.js +49 -39
  95. package/lib/components/input-tag/index.d.ts +6 -6
  96. package/lib/components/input-tag/src/index.vue.d.ts +6 -6
  97. package/lib/components/layout/index.d.ts +30 -30
  98. package/lib/components/layout/src/index.vue.d.ts +10 -10
  99. package/lib/components/page/index.d.ts +1613 -1123
  100. package/lib/components/page/src/index.vue.d.ts +618 -430
  101. package/lib/components/page/src/index.vue2.js +34 -13
  102. package/lib/components/popover/index.d.ts +49 -49
  103. package/lib/components/popover/src/index.vue.d.ts +3 -3
  104. package/lib/components/render/index.d.ts +14 -14
  105. package/lib/components/render/src/index.vue.d.ts +1 -1
  106. package/lib/components/search/index.d.ts +298 -298
  107. package/lib/components/search/src/index.vue.d.ts +84 -84
  108. package/lib/components/sidebar/index.d.ts +31 -31
  109. package/lib/components/sidebar/src/index.vue.d.ts +5 -5
  110. package/lib/components/table/index.d.ts +165 -180
  111. package/lib/components/table/index.js +6 -0
  112. package/lib/components/table/src/index.vue.d.ts +12 -21
  113. package/lib/components/table/src/index.vue2.js +10 -33
  114. package/lib/components/table/src/table-action-bar-content.vue.d.ts +78 -0
  115. package/lib/components/table/src/table-action-bar-content.vue.js +10 -0
  116. package/lib/components/table/src/table-action-bar-content.vue2.js +399 -0
  117. package/lib/components/table/src/table-action-bar.vue.d.ts +4 -4
  118. package/lib/components/table/src/table-action-bar.vue2.js +28 -351
  119. package/lib/components/table/src/table-column-drag-sort.vue.d.ts +1 -1
  120. package/lib/components/table/src/table-column-index.vue.d.ts +1 -1
  121. package/lib/components/table/src/table-column.vue.d.ts +22 -29
  122. package/lib/components/table/src/table-column.vue2.js +2 -55
  123. package/lib/components/table/src/table-title-bar.vue.d.ts +2 -2
  124. package/lib/components/table/src/type.d.ts +0 -11
  125. package/lib/components/table/src/use-columns.d.ts +26 -0
  126. package/lib/components/table/src/use-columns.js +42 -0
  127. package/lib/components/table-v2/index.d.ts +174 -0
  128. package/lib/components/table-v2/index.js +10 -0
  129. package/lib/components/table-v2/src/column-converter.d.ts +27 -0
  130. package/lib/components/table-v2/src/column-converter.js +44 -0
  131. package/lib/components/table-v2/src/index.vue.d.ts +157 -0
  132. package/lib/components/table-v2/src/index.vue.js +10 -0
  133. package/lib/components/table-v2/src/index.vue2.js +495 -0
  134. package/lib/components/table-v2/src/special-columns.d.ts +61 -0
  135. package/lib/components/table-v2/src/special-columns.js +80 -0
  136. package/lib/components/table-v2/src/table-v2-cell.d.ts +104 -0
  137. package/lib/components/table-v2/src/table-v2-cell.js +143 -0
  138. package/lib/components/table-v2/src/table-v2-header-cell.vue.d.ts +61 -0
  139. package/lib/components/table-v2/src/table-v2-header-cell.vue.js +10 -0
  140. package/lib/components/table-v2/src/table-v2-header-cell.vue2.js +96 -0
  141. package/lib/components/table-v2/src/type.d.ts +95 -0
  142. package/lib/components/table-v2/src/type.js +2 -0
  143. package/lib/components/table-v2/src/use-table-v2-columns.d.ts +43 -0
  144. package/lib/components/table-v2/src/use-table-v2-columns.js +51 -0
  145. package/lib/components/table-v2/style/css.d.ts +17 -0
  146. package/lib/components/table-v2/style/css.js +20 -0
  147. package/lib/components/table-v2/style/index.d.ts +17 -0
  148. package/lib/components/table-v2/style/index.js +20 -0
  149. package/lib/index.js +49 -39
  150. package/lib/version.d.ts +1 -1
  151. package/lib/version.js +1 -1
  152. package/locale/en.js +1 -1
  153. package/locale/en.min.js +1 -1
  154. package/locale/en.min.mjs +1 -1
  155. package/locale/en.mjs +1 -1
  156. package/locale/ja.js +1 -1
  157. package/locale/ja.min.js +1 -1
  158. package/locale/ja.min.mjs +1 -1
  159. package/locale/ja.mjs +1 -1
  160. package/locale/ko.js +1 -1
  161. package/locale/ko.min.js +1 -1
  162. package/locale/ko.min.mjs +1 -1
  163. package/locale/ko.mjs +1 -1
  164. package/locale/zh-cn.js +1 -1
  165. package/locale/zh-cn.min.js +1 -1
  166. package/locale/zh-cn.min.mjs +1 -1
  167. package/locale/zh-cn.mjs +1 -1
  168. package/locale/zh-hk.js +1 -1
  169. package/locale/zh-hk.min.js +1 -1
  170. package/locale/zh-hk.min.mjs +1 -1
  171. package/locale/zh-hk.mjs +1 -1
  172. package/locale/zh-tw.js +1 -1
  173. package/locale/zh-tw.min.js +1 -1
  174. package/locale/zh-tw.min.mjs +1 -1
  175. package/locale/zh-tw.mjs +1 -1
  176. package/package.json +1 -1
  177. package/theme-chalk/index.css +1 -1
  178. package/theme-chalk/plus-table-v2.css +1 -0
  179. package/theme-chalk/src/index.scss +1 -0
  180. package/theme-chalk/src/table-v2.scss +71 -0
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! tabula-vue v1.0.0 */
1
+ /*! tabula-vue v1.0.1 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
@@ -350,7 +350,7 @@
350
350
  * _.toNumber('3.2');
351
351
  * // => 3.2
352
352
  */
353
- function toNumber(value) {
353
+ function toNumber$1(value) {
354
354
  if (typeof value == 'number') {
355
355
  return value;
356
356
  }
@@ -1546,7 +1546,7 @@
1546
1546
  ListCache.prototype.set = listCacheSet;
1547
1547
 
1548
1548
  /* Built-in method references that are verified to be native. */
1549
- var Map = getNative(root$1, 'Map');
1549
+ var Map$1 = getNative(root$1, 'Map');
1550
1550
 
1551
1551
  /**
1552
1552
  * Removes all key-value entries from the map.
@@ -1559,7 +1559,7 @@
1559
1559
  this.size = 0;
1560
1560
  this.__data__ = {
1561
1561
  'hash': new Hash,
1562
- 'map': new (Map || ListCache),
1562
+ 'map': new (Map$1 || ListCache),
1563
1563
  'string': new Hash
1564
1564
  };
1565
1565
  }
@@ -1997,7 +1997,7 @@
1997
1997
  var data = this.__data__;
1998
1998
  if (data instanceof ListCache) {
1999
1999
  var pairs = data.__data__;
2000
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
2000
+ if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
2001
2001
  pairs.push([key, value]);
2002
2002
  this.size = ++data.size;
2003
2003
  return this;
@@ -2247,7 +2247,7 @@
2247
2247
  var Promise$1 = getNative(root$1, 'Promise');
2248
2248
 
2249
2249
  /* Built-in method references that are verified to be native. */
2250
- var Set$1 = getNative(root$1, 'Set');
2250
+ var Set = getNative(root$1, 'Set');
2251
2251
 
2252
2252
  /** `Object#toString` result references. */
2253
2253
  var mapTag$4 = '[object Map]',
@@ -2260,9 +2260,9 @@
2260
2260
 
2261
2261
  /** Used to detect maps, sets, and weakmaps. */
2262
2262
  var dataViewCtorString = toSource(DataView),
2263
- mapCtorString = toSource(Map),
2263
+ mapCtorString = toSource(Map$1),
2264
2264
  promiseCtorString = toSource(Promise$1),
2265
- setCtorString = toSource(Set$1),
2265
+ setCtorString = toSource(Set),
2266
2266
  weakMapCtorString = toSource(WeakMap);
2267
2267
 
2268
2268
  /**
@@ -2276,9 +2276,9 @@
2276
2276
 
2277
2277
  // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2278
2278
  if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$3) ||
2279
- (Map && getTag(new Map) != mapTag$4) ||
2279
+ (Map$1 && getTag(new Map$1) != mapTag$4) ||
2280
2280
  (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
2281
- (Set$1 && getTag(new Set$1) != setTag$4) ||
2281
+ (Set && getTag(new Set) != setTag$4) ||
2282
2282
  (WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
2283
2283
  getTag = function(value) {
2284
2284
  var result = baseGetTag(value),
@@ -3692,11 +3692,11 @@
3692
3692
  if (typeof func != 'function') {
3693
3693
  throw new TypeError(FUNC_ERROR_TEXT);
3694
3694
  }
3695
- wait = toNumber(wait) || 0;
3695
+ wait = toNumber$1(wait) || 0;
3696
3696
  if (isObject$1(options)) {
3697
3697
  leading = !!options.leading;
3698
3698
  maxing = 'maxWait' in options;
3699
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
3699
+ maxWait = maxing ? nativeMax(toNumber$1(options.maxWait) || 0, wait) : maxWait;
3700
3700
  trailing = 'trailing' in options ? !!options.trailing : trailing;
3701
3701
  }
3702
3702
 
@@ -4481,8 +4481,8 @@
4481
4481
  };
4482
4482
  }
4483
4483
 
4484
- const _hoisted_1$j = { class: "plus-dialog-body" };
4485
- var _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
4484
+ const _hoisted_1$k = { class: "plus-dialog-body" };
4485
+ var _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
4486
4486
  ...{
4487
4487
  name: "PlusDialog",
4488
4488
  inheritAttrs: false
@@ -4532,7 +4532,7 @@
4532
4532
  class: "plus-dialog"
4533
4533
  }, _ctx.$attrs), vue.createSlots({
4534
4534
  default: vue.withCtx(() => [
4535
- vue.createElementVNode("div", _hoisted_1$j, [
4535
+ vue.createElementVNode("div", _hoisted_1$k, [
4536
4536
  vue.renderSlot(_ctx.$slots, "default")
4537
4537
  ])
4538
4538
  ]),
@@ -4604,25 +4604,25 @@
4604
4604
  return target;
4605
4605
  };
4606
4606
 
4607
- var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "index.vue"]]);
4607
+ var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "index.vue"]]);
4608
4608
 
4609
4609
  const PlusDialog = Dialog;
4610
4610
 
4611
- const _hoisted_1$i = /* @__PURE__ */ vue.createElementVNode(
4611
+ const _hoisted_1$j = /* @__PURE__ */ vue.createElementVNode(
4612
4612
  "span",
4613
4613
  null,
4614
4614
  null,
4615
4615
  -1
4616
4616
  /* HOISTED */
4617
4617
  );
4618
- const _hoisted_2$a = /* @__PURE__ */ vue.createElementVNode(
4618
+ const _hoisted_2$9 = /* @__PURE__ */ vue.createElementVNode(
4619
4619
  "span",
4620
4620
  null,
4621
4621
  null,
4622
4622
  -1
4623
4623
  /* HOISTED */
4624
4624
  );
4625
- var _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
4625
+ var _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
4626
4626
  ...{
4627
4627
  name: "PlusPagination"
4628
4628
  },
@@ -4664,7 +4664,7 @@
4664
4664
  },
4665
4665
  [
4666
4666
  _ctx.align === "right" || _ctx.align === "center" ? vue.renderSlot(_ctx.$slots, "pagination-left", { key: 0 }, () => [
4667
- _hoisted_1$i
4667
+ _hoisted_1$j
4668
4668
  ]) : vue.createCommentVNode("v-if", true),
4669
4669
  vue.createVNode(vue.unref(elementPlus.ElPagination), vue.mergeProps({
4670
4670
  layout: "total, sizes, prev, pager, next, jumper",
@@ -4678,7 +4678,7 @@
4678
4678
  onCurrentChange: handleCurrentChange
4679
4679
  }), null, 16, ["current-page", "page-size", "total", "page-sizes"]),
4680
4680
  _ctx.align === "left" || _ctx.align === "center" ? vue.renderSlot(_ctx.$slots, "pagination-right", { key: 1 }, () => [
4681
- _hoisted_2$a
4681
+ _hoisted_2$9
4682
4682
  ]) : vue.createCommentVNode("v-if", true)
4683
4683
  ],
4684
4684
  2
@@ -4688,11 +4688,11 @@
4688
4688
  }
4689
4689
  });
4690
4690
 
4691
- var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "index.vue"]]);
4691
+ var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "index.vue"]]);
4692
4692
 
4693
4693
  const PlusPagination = Pagination;
4694
4694
 
4695
- var _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
4695
+ var _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
4696
4696
  ...{
4697
4697
  name: "PlusRadio"
4698
4698
  },
@@ -4877,7 +4877,7 @@
4877
4877
  }
4878
4878
  });
4879
4879
 
4880
- var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "index.vue"]]);
4880
+ var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "index.vue"]]);
4881
4881
 
4882
4882
  const PlusRadio = Radio;
4883
4883
 
@@ -5118,26 +5118,25 @@
5118
5118
  // src/components/user.vue
5119
5119
  var user_default = user_vue_vue_type_script_setup_true_lang_default;
5120
5120
 
5121
- const _hoisted_1$h = {
5121
+ const _hoisted_1$i = {
5122
5122
  key: 0,
5123
5123
  class: "plus-table-action-bar__dropdown__link"
5124
5124
  };
5125
- const _hoisted_2$9 = { class: "plus-table-action-bar__dropdown__link" };
5125
+ const _hoisted_2$8 = { class: "plus-table-action-bar__dropdown__link" };
5126
5126
  const _hoisted_3$4 = { class: "plus-table-action-bar__more-text" };
5127
- var _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
5127
+ var _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
5128
5128
  ...{
5129
- name: "PlusTableActionBar"
5129
+ name: "PlusTableActionBarContent"
5130
5130
  },
5131
- __name: "table-action-bar",
5131
+ __name: "table-action-bar-content",
5132
5132
  props: {
5133
- label: { default: "" },
5134
- fixed: { default: "right" },
5133
+ row: {},
5134
+ index: {},
5135
+ rest: { default: () => ({}) },
5135
5136
  showNumber: { type: [Number, Function], default: 3 },
5136
5137
  showLimitIncludeMore: { type: Boolean, default: false },
5137
5138
  type: { default: "link" },
5138
5139
  buttons: { default: () => [] },
5139
- width: { default: 200 },
5140
- actionBarTableColumnProps: { default: () => ({}) },
5141
5140
  confirmType: { default: "messageBox" },
5142
5141
  moreType: { default: "text" }
5143
5142
  },
@@ -5184,20 +5183,23 @@
5184
5183
  nextButtons: data.slice(showNumber)
5185
5184
  };
5186
5185
  };
5187
- const createCallbackParams = (params, e) => ({
5188
- /**
5189
- * 解析后的按钮数据中的text
5190
- * @version v0.1.17
5191
- */
5192
- text: params.text,
5193
- row: params.row,
5194
- buttonRow: params.buttonRow,
5195
- index: params.index,
5196
- rowIndex: params.index,
5197
- e,
5198
- formRefs: formRefs.value[params.index],
5199
- ...params.rest
5200
- });
5186
+ const createCallbackParams = (params, e) => {
5187
+ var _a;
5188
+ return {
5189
+ /**
5190
+ * 解析后的按钮数据中的text
5191
+ * @version v0.1.17
5192
+ */
5193
+ text: params.text,
5194
+ row: params.row,
5195
+ buttonRow: params.buttonRow,
5196
+ index: params.index,
5197
+ rowIndex: params.index,
5198
+ e,
5199
+ formRefs: (_a = formRefs == null ? void 0 : formRefs.value) == null ? void 0 : _a[params.index],
5200
+ ...params.rest
5201
+ };
5202
+ };
5201
5203
  const getConfirmMsg = (buttonRow, callbackParams) => {
5202
5204
  var _a, _b;
5203
5205
  let message = t("plus.table.confirmToPerformThisOperation");
@@ -5370,30 +5372,28 @@
5370
5372
  }
5371
5373
  };
5372
5374
  return (_ctx, _cache) => {
5373
- return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTableColumn), vue.mergeProps({
5374
- key: "actionBar",
5375
- "class-name": "plus-table-action-bar",
5376
- label: vue.unref(_ctx.label) || vue.unref(t)("plus.table.action"),
5377
- fixed: _ctx.fixed || "right",
5378
- width: _ctx.width || 200
5379
- }, _ctx.actionBarTableColumnProps), {
5380
- default: vue.withCtx(({ row, $index, ...rest }) => [
5381
- vue.createCommentVNode("\n \u7528\u5355\u5143\u7D20\u6570\u7EC4\u8BA9 getSubButtons \u6BCF\u884C\u53EA\u6267\u884C\u4E00\u6B21\uFF1A\n \u539F\u5148 preButtons / showMore / nextButtons \u5404\u8C03\u7528\u4E00\u6B21\uFF0C\n 500 \u884C \xD7 11 \u4E2A\u6309\u94AE \u2248 \u4E0A\u4E07\u6B21 show()\uFF08\u542B\u6743\u9650\u5224\u65AD\uFF09\u3002\n "),
5375
+ return vue.openBlock(), vue.createElementBlock(
5376
+ vue.Fragment,
5377
+ null,
5378
+ [
5379
+ vue.createCommentVNode("\n \u7528\u5355\u5143\u7D20\u6570\u7EC4\u8BA9 getSubButtons \u6BCF\u884C\u53EA\u6267\u884C\u4E00\u6B21\uFF1A\n preButtons / showMore / nextButtons \u5171\u7528\u540C\u4E00\u4EFD\u8BA1\u7B97\u7ED3\u679C\n "),
5382
5380
  (vue.openBlock(true), vue.createElementBlock(
5383
5381
  vue.Fragment,
5384
5382
  null,
5385
- vue.renderList([getSubButtons(row, $index)], (cell) => {
5383
+ vue.renderList([getSubButtons(_ctx.row, _ctx.index)], (cell) => {
5386
5384
  return vue.openBlock(), vue.createElementBlock(
5387
5385
  vue.Fragment,
5388
- { key: $index },
5386
+ {
5387
+ key: cell.preButtons.length
5388
+ },
5389
5389
  [
5390
5390
  vue.createCommentVNode(" \u663E\u793A\u51FA\u6765\u7684\u6309\u94AE "),
5391
5391
  (vue.openBlock(true), vue.createElementBlock(
5392
5392
  vue.Fragment,
5393
5393
  null,
5394
5394
  vue.renderList(cell.preButtons, (buttonRow) => {
5395
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(render(row, buttonRow, $index, rest)), {
5396
- key: getButtonKey(buttonRow, row, $index)
5395
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(render(_ctx.row, buttonRow, _ctx.index, _ctx.rest)), {
5396
+ key: getButtonKey(buttonRow, _ctx.row, _ctx.index)
5397
5397
  });
5398
5398
  }),
5399
5399
  128
@@ -5420,11 +5420,11 @@
5420
5420
  return vue.openBlock(), vue.createBlock(
5421
5421
  vue.unref(elementPlus.ElDropdownItem),
5422
5422
  {
5423
- key: getButtonKey(buttonRow, row, $index)
5423
+ key: getButtonKey(buttonRow, _ctx.row, _ctx.index)
5424
5424
  },
5425
5425
  {
5426
5426
  default: vue.withCtx(() => [
5427
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(render(row, buttonRow, $index, rest))))
5427
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(render(_ctx.row, buttonRow, _ctx.index, _ctx.rest))))
5428
5428
  ]),
5429
5429
  _: 2
5430
5430
  /* DYNAMIC */
@@ -5445,7 +5445,7 @@
5445
5445
  )
5446
5446
  ]),
5447
5447
  default: vue.withCtx(() => [
5448
- _ctx.moreType === "icon" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$h, [
5448
+ _ctx.moreType === "icon" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$i, [
5449
5449
  vue.renderSlot(_ctx.$slots, "action-bar-more-icon", {}, () => [
5450
5450
  vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
5451
5451
  default: vue.withCtx(() => [
@@ -5460,7 +5460,7 @@
5460
5460
  { key: 1 },
5461
5461
  [
5462
5462
  vue.createCommentVNode(" \u9ED8\u8BA4 "),
5463
- vue.createElementVNode("span", _hoisted_2$9, [
5463
+ vue.createElementVNode("span", _hoisted_2$8, [
5464
5464
  vue.createElementVNode(
5465
5465
  "span",
5466
5466
  _hoisted_3$4,
@@ -5494,6 +5494,73 @@
5494
5494
  128
5495
5495
  /* KEYED_FRAGMENT */
5496
5496
  ))
5497
+ ],
5498
+ 2112
5499
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
5500
+ );
5501
+ };
5502
+ }
5503
+ });
5504
+
5505
+ var PlusTableActionBarContent = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "table-action-bar-content.vue"]]);
5506
+
5507
+ var _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
5508
+ ...{
5509
+ name: "PlusTableActionBar"
5510
+ },
5511
+ __name: "table-action-bar",
5512
+ props: {
5513
+ label: { default: "" },
5514
+ fixed: { default: "right" },
5515
+ showNumber: { type: [Number, Function], default: 3 },
5516
+ showLimitIncludeMore: { type: Boolean, default: false },
5517
+ type: { default: "link" },
5518
+ buttons: { default: () => [] },
5519
+ width: { default: 200 },
5520
+ actionBarTableColumnProps: { default: () => ({}) },
5521
+ confirmType: { default: "messageBox" },
5522
+ moreType: { default: "text" }
5523
+ },
5524
+ emits: ["clickAction", "clickActionConfirmCancel"],
5525
+ setup(__props, { emit: __emit }) {
5526
+ const emit = __emit;
5527
+ const { t } = useLocale();
5528
+ const handleClickAction = (data) => emit("clickAction", data);
5529
+ const handleClickActionConfirmCancel = (data) => emit("clickActionConfirmCancel", data);
5530
+ return (_ctx, _cache) => {
5531
+ return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTableColumn), vue.mergeProps({
5532
+ key: "actionBar",
5533
+ "class-name": "plus-table-action-bar",
5534
+ label: vue.unref(_ctx.label) || vue.unref(t)("plus.table.action"),
5535
+ fixed: _ctx.fixed || "right",
5536
+ width: _ctx.width || 200
5537
+ }, _ctx.actionBarTableColumnProps), {
5538
+ default: vue.withCtx(({ row, $index, ...rest }) => [
5539
+ vue.createCommentVNode(" \u6309\u94AE\u5185\u5BB9\u903B\u8F91\u4E0E PlusTableV2 \u5171\u7528 "),
5540
+ vue.createVNode(PlusTableActionBarContent, {
5541
+ row,
5542
+ index: $index,
5543
+ rest,
5544
+ type: _ctx.type,
5545
+ buttons: _ctx.buttons,
5546
+ "show-number": _ctx.showNumber,
5547
+ "show-limit-include-more": _ctx.showLimitIncludeMore,
5548
+ "confirm-type": _ctx.confirmType,
5549
+ "more-type": _ctx.moreType,
5550
+ onClickAction: handleClickAction,
5551
+ onClickActionConfirmCancel: handleClickActionConfirmCancel
5552
+ }, vue.createSlots({
5553
+ _: 2
5554
+ /* DYNAMIC */
5555
+ }, [
5556
+ _ctx.$slots["action-bar-more-icon"] ? {
5557
+ name: "action-bar-more-icon",
5558
+ fn: vue.withCtx(() => [
5559
+ vue.renderSlot(_ctx.$slots, "action-bar-more-icon")
5560
+ ]),
5561
+ key: "0"
5562
+ } : void 0
5563
+ ]), 1032, ["row", "index", "rest", "type", "buttons", "show-number", "show-limit-include-more", "confirm-type", "more-type"])
5497
5564
  ]),
5498
5565
  _: 3
5499
5566
  /* FORWARDED */
@@ -5502,9 +5569,9 @@
5502
5569
  }
5503
5570
  });
5504
5571
 
5505
- var PlusTableActionBar = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "table-action-bar.vue"]]);
5572
+ var PlusTableActionBar = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "table-action-bar.vue"]]);
5506
5573
 
5507
- var _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
5574
+ var _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
5508
5575
  ...{
5509
5576
  name: "PlusRender"
5510
5577
  },
@@ -5574,12 +5641,12 @@
5574
5641
  }
5575
5642
  });
5576
5643
 
5577
- var Render = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "index.vue"]]);
5644
+ var Render = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "index.vue"]]);
5578
5645
 
5579
5646
  const PlusRender = Render;
5580
5647
 
5581
- const _hoisted_1$g = { class: "plus-date-picker__middle" };
5582
- var _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
5648
+ const _hoisted_1$h = { class: "plus-date-picker__middle" };
5649
+ var _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
5583
5650
  ...{
5584
5651
  name: "PlusDatePicker"
5585
5652
  },
@@ -5684,7 +5751,7 @@
5684
5751
  }), null, 16, ["modelValue", "type", "value-format", "placeholder", "disabled"]),
5685
5752
  vue.createElementVNode(
5686
5753
  "span",
5687
- _hoisted_1$g,
5754
+ _hoisted_1$h,
5688
5755
  vue.toDisplayString(_ctx.rangeSeparator),
5689
5756
  1
5690
5757
  /* TEXT */
@@ -5715,11 +5782,11 @@
5715
5782
  }
5716
5783
  });
5717
5784
 
5718
- var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "index.vue"]]);
5785
+ var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "index.vue"]]);
5719
5786
 
5720
5787
  const PlusDatePicker = DatePicker;
5721
5788
 
5722
- var _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
5789
+ var _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
5723
5790
  ...{
5724
5791
  name: "PlusInputTag"
5725
5792
  },
@@ -5856,7 +5923,7 @@
5856
5923
  }
5857
5924
  });
5858
5925
 
5859
- var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "index.vue"]]);
5926
+ var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "index.vue"]]);
5860
5927
 
5861
5928
  const PlusInputTag = InputTag;
5862
5929
 
@@ -5953,9 +6020,9 @@
5953
6020
  );
5954
6021
  const getFieldComponent = (valueType) => Reflect.get(FieldComponentMap, valueType) || {};
5955
6022
 
5956
- const _hoisted_1$f = { class: "el-form-item__error" };
5957
- const _hoisted_2$8 = { class: "plus-form-item__label" };
5958
- var _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
6023
+ const _hoisted_1$g = { class: "el-form-item__error" };
6024
+ const _hoisted_2$7 = { class: "plus-form-item__label" };
6025
+ var _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
5959
6026
  ...{
5960
6027
  name: "PlusFormItem"
5961
6028
  },
@@ -6510,7 +6577,7 @@
6510
6577
  vue.unref(isFunction)(_ctx.renderErrorMessage) ? {
6511
6578
  name: "error",
6512
6579
  fn: vue.withCtx(({ error }) => [
6513
- vue.createElementVNode("div", _hoisted_1$f, [
6580
+ vue.createElementVNode("div", _hoisted_1$g, [
6514
6581
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.renderErrorMessage), vue.mergeProps(props, {
6515
6582
  value: state.value,
6516
6583
  error,
@@ -6523,7 +6590,7 @@
6523
6590
  _ctx.hasLabel ? {
6524
6591
  name: "label",
6525
6592
  fn: vue.withCtx(({ label: currentLabel }) => [
6526
- vue.createElementVNode("span", _hoisted_2$8, [
6593
+ vue.createElementVNode("span", _hoisted_2$7, [
6527
6594
  _ctx.renderLabel && vue.unref(isFunction)(_ctx.renderLabel) ? (vue.openBlock(), vue.createElementBlock(
6528
6595
  vue.Fragment,
6529
6596
  { key: 0 },
@@ -6581,11 +6648,11 @@
6581
6648
  }
6582
6649
  });
6583
6650
 
6584
- var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "index.vue"]]);
6651
+ var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "index.vue"]]);
6585
6652
 
6586
6653
  const PlusFormItem = FormItem;
6587
6654
 
6588
- var _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
6655
+ var _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
6589
6656
  ...{
6590
6657
  name: "PlusCollapseTransition"
6591
6658
  },
@@ -6636,17 +6703,17 @@
6636
6703
  }
6637
6704
  });
6638
6705
 
6639
- var PlusCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "collapse-transition.vue"]]);
6706
+ var PlusCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "collapse-transition.vue"]]);
6640
6707
 
6641
- const _hoisted_1$e = {
6708
+ const _hoisted_1$f = {
6642
6709
  key: 0,
6643
6710
  class: "plus-form-item-previous"
6644
6711
  };
6645
- const _hoisted_2$7 = {
6712
+ const _hoisted_2$6 = {
6646
6713
  key: 1,
6647
6714
  class: "plus-form-item-extra"
6648
6715
  };
6649
- var _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
6716
+ var _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
6650
6717
  ...{
6651
6718
  name: "PlusFormContent"
6652
6719
  },
@@ -6711,7 +6778,7 @@
6711
6778
  {
6712
6779
  default: vue.withCtx(() => [
6713
6780
  vue.createCommentVNode(" el-form-item\u4E0A\u4E00\u884C\u7684\u5185\u5BB9 "),
6714
- item.renderPrevious || _ctx.$slots[vue.unref(getPreviousSlotName)(item.prop)] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
6781
+ item.renderPrevious || _ctx.$slots[vue.unref(getPreviousSlotName)(item.prop)] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
6715
6782
  vue.unref(isFunction)(item.renderPrevious) ? (vue.openBlock(), vue.createBlock(
6716
6783
  vue.resolveDynamicComponent(item.renderPrevious),
6717
6784
  vue.normalizeProps(vue.mergeProps({ key: 0 }, item)),
@@ -6753,7 +6820,7 @@
6753
6820
  } : void 0
6754
6821
  ]), 1040, ["model-value", "clearable", "has-label", "onChange"]),
6755
6822
  vue.createCommentVNode(" el-form-item \u4E0B\u4E00\u884C\u989D\u5916\u7684\u5185\u5BB9 "),
6756
- item.renderExtra || _ctx.$slots[vue.unref(getExtraSlotName)(item.prop)] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, [
6823
+ item.renderExtra || _ctx.$slots[vue.unref(getExtraSlotName)(item.prop)] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
6757
6824
  item.renderExtra && vue.unref(isFunction)(item.renderExtra) ? (vue.openBlock(), vue.createBlock(
6758
6825
  vue.resolveDynamicComponent(item.renderExtra),
6759
6826
  vue.normalizeProps(vue.mergeProps({ key: 0 }, item)),
@@ -6790,10 +6857,10 @@
6790
6857
  }
6791
6858
  });
6792
6859
 
6793
- var PlusFormContent = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "form-content.vue"]]);
6860
+ var PlusFormContent = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "form-content.vue"]]);
6794
6861
 
6795
- const _hoisted_1$d = { class: "plus-form__group__item__icon" };
6796
- var _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
6862
+ const _hoisted_1$e = { class: "plus-form__group__item__icon" };
6863
+ var _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
6797
6864
  ...{
6798
6865
  name: "PlusForm",
6799
6866
  inheritAttrs: false
@@ -6943,7 +7010,7 @@
6943
7010
  icon: groupItem.icon,
6944
7011
  index
6945
7012
  }, () => [
6946
- vue.createElementVNode("div", _hoisted_1$d, [
7013
+ vue.createElementVNode("div", _hoisted_1$e, [
6947
7014
  groupItem.icon ? (vue.openBlock(), vue.createBlock(
6948
7015
  vue.unref(elementPlus.ElIcon),
6949
7016
  { key: 0 },
@@ -7088,7 +7155,7 @@
7088
7155
  }
7089
7156
  });
7090
7157
 
7091
- var Form = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "index.vue"]]);
7158
+ var Form = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "index.vue"]]);
7092
7159
 
7093
7160
  const PlusForm = Form;
7094
7161
 
@@ -7131,8 +7198,8 @@
7131
7198
  const hasDisplayComponent = (valueType) => Object.keys(DisplayComponentMap).includes(valueType);
7132
7199
  const getDisplayComponent = (valueType) => Reflect.get(DisplayComponentMap, valueType) || {};
7133
7200
 
7134
- const _hoisted_1$c = ["innerHTML"];
7135
- const _hoisted_2$6 = { class: "plus-display-item" };
7201
+ const _hoisted_1$d = ["innerHTML"];
7202
+ const _hoisted_2$5 = { class: "plus-display-item" };
7136
7203
  const _hoisted_3$3 = /* @__PURE__ */ vue.createElementVNode(
7137
7204
  "svg",
7138
7205
  {
@@ -7152,7 +7219,7 @@
7152
7219
  -1
7153
7220
  /* HOISTED */
7154
7221
  );
7155
- var _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
7222
+ var _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
7156
7223
  ...{
7157
7224
  name: "PlusDisplayItem"
7158
7225
  },
@@ -7523,7 +7590,7 @@
7523
7590
  vue.createElementVNode("span", {
7524
7591
  class: "plus-display-item",
7525
7592
  innerHTML: _ctx.column.renderHTML(displayValue.value, renderParams.value)
7526
- }, null, 8, _hoisted_1$c)
7593
+ }, null, 8, _hoisted_1$d)
7527
7594
  ],
7528
7595
  2112
7529
7596
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -7652,7 +7719,7 @@
7652
7719
  { key: 5 },
7653
7720
  [
7654
7721
  vue.createCommentVNode(" \u590D\u5236 "),
7655
- vue.createElementVNode("span", _hoisted_2$6, [
7722
+ vue.createElementVNode("span", _hoisted_2$5, [
7656
7723
  vue.createTextVNode(
7657
7724
  vue.toDisplayString(formatterValue.value) + " ",
7658
7725
  1
@@ -7790,13 +7857,12 @@
7790
7857
  }
7791
7858
  });
7792
7859
 
7793
- var DisplayItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "index.vue"]]);
7860
+ var DisplayItem = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "index.vue"]]);
7794
7861
 
7795
7862
  const PlusDisplayItem = DisplayItem;
7796
7863
 
7797
- const _hoisted_1$b = { class: "plus-table-column__header" };
7798
- const _hoisted_2$5 = { class: "plus-display-item" };
7799
- var _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
7864
+ const _hoisted_1$c = { class: "plus-table-column__header" };
7865
+ var _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
7800
7866
  ...{
7801
7867
  name: "PlusTableColumn"
7802
7868
  },
@@ -7806,14 +7872,12 @@
7806
7872
  editable: { type: [Boolean, String], default: false },
7807
7873
  tableDataLength: { default: 0 },
7808
7874
  subPageInfo: { default: () => ({}) },
7809
- emptyValue: { default: void 0 },
7810
- plainTextCell: { type: Boolean, default: false }
7875
+ emptyValue: { default: void 0 }
7811
7876
  },
7812
7877
  emits: ["formChange"],
7813
7878
  setup(__props, { expose: __expose, emit: __emit }) {
7814
7879
  const props = __props;
7815
7880
  const emit = __emit;
7816
- const slots = vue.useSlots();
7817
7881
  const instance = vue.getCurrentInstance();
7818
7882
  const store = vue.computed(() => {
7819
7883
  var _a;
@@ -7832,36 +7896,6 @@
7832
7896
  );
7833
7897
  const plusDisplayItemInstance = vue.ref();
7834
7898
  const formRefs = vue.inject(TableFormRefInjectionKey);
7835
- const PLAIN_VALUE_TYPE_SET = /* @__PURE__ */ new Set([void 0, "", "input"]);
7836
- const isPlainColumn = (item) => {
7837
- if (!props.plainTextCell) return false;
7838
- if (props.editable !== false) return false;
7839
- if (item.editable === true) return false;
7840
- if (!PLAIN_VALUE_TYPE_SET.has(item.valueType)) return false;
7841
- if (item.render || item.renderHTML || item.formatter || item.customGetStatus) return false;
7842
- if (item.fieldProps !== void 0 && item.fieldProps !== null) return false;
7843
- if (item.formProps !== void 0 && item.formProps !== null) return false;
7844
- if (item.fieldSlots && Object.keys(item.fieldSlots).length) return false;
7845
- if (slots && slots[getTableCellSlotName(item.prop)]) return false;
7846
- return true;
7847
- };
7848
- const plainColumnSet = vue.computed(() => {
7849
- const set2 = /* @__PURE__ */ new Set();
7850
- props.columns.forEach((item) => {
7851
- var _a;
7852
- if ((_a = item.children) == null ? void 0 : _a.length) return;
7853
- if (isPlainColumn(item)) set2.add(item);
7854
- });
7855
- return set2;
7856
- });
7857
- const getPlainValue = (item, row) => {
7858
- var _a, _b;
7859
- const value = getValue(row, item.prop);
7860
- if (value === null || value === void 0 || value === "") {
7861
- return (_b = (_a = item.emptyValue) != null ? _a : props.emptyValue) != null ? _b : "";
7862
- }
7863
- return value;
7864
- };
7865
7899
  const setFormRef = () => {
7866
7900
  var _a, _b;
7867
7901
  if (!((_a = plusDisplayItemInstance.value) == null ? void 0 : _a.length)) return;
@@ -7874,11 +7908,7 @@
7874
7908
  set(formRefs.value[item.rowIndex], item.cellIndex, item);
7875
7909
  }
7876
7910
  };
7877
- const needFormRefs = vue.computed(
7878
- () => props.editable !== false || !props.plainTextCell || props.columns.some((item) => item.editable === true)
7879
- );
7880
7911
  const cellInstanceSignature = vue.computed(() => {
7881
- if (!needFormRefs.value) return "";
7882
7912
  const list = plusDisplayItemInstance.value;
7883
7913
  if (!(list == null ? void 0 : list.length)) return "";
7884
7914
  return list.map((item) => {
@@ -7889,7 +7919,6 @@
7889
7919
  vue.watch(
7890
7920
  () => [props.tableDataLength, cellInstanceSignature.value, props.subPageInfo],
7891
7921
  () => {
7892
- if (!needFormRefs.value) return;
7893
7922
  setFormRef();
7894
7923
  },
7895
7924
  {
@@ -7931,7 +7960,7 @@
7931
7960
  "min-width": item.minWidth
7932
7961
  }), {
7933
7962
  header: vue.withCtx((scoped) => [
7934
- vue.createElementVNode("span", _hoisted_1$b, [
7963
+ vue.createElementVNode("span", _hoisted_1$c, [
7935
7964
  item.renderHeader && vue.unref(isFunction)(item.renderHeader) ? (vue.openBlock(), vue.createBlock(vue.unref(PlusRender), {
7936
7965
  key: 0,
7937
7966
  render: item.renderHeader,
@@ -8024,23 +8053,8 @@
8024
8053
  ],
8025
8054
  64
8026
8055
  /* STABLE_FRAGMENT */
8027
- )) : plainColumnSet.value.has(item) ? (vue.openBlock(), vue.createElementBlock(
8028
- vue.Fragment,
8029
- { key: 1 },
8030
- [
8031
- vue.createCommentVNode(" \u7EAF\u6587\u672C\u5217\u5FEB\u8DEF\u5F84\uFF1A\u4E0D\u521B\u5EFA\u7EC4\u4EF6\u5B9E\u4F8B\u3001\u4E0D\u6CE8\u518C\u4EFB\u4F55 watcher "),
8032
- vue.createElementVNode(
8033
- "span",
8034
- _hoisted_2$5,
8035
- vue.toDisplayString(getPlainValue(item, row)),
8036
- 1
8037
- /* TEXT */
8038
- )
8039
- ],
8040
- 2112
8041
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
8042
8056
  )) : (vue.openBlock(), vue.createBlock(vue.unref(PlusDisplayItem), {
8043
- key: 2,
8057
+ key: 1,
8044
8058
  ref_for: true,
8045
8059
  ref_key: "plusDisplayItemInstance",
8046
8060
  ref: plusDisplayItemInstance,
@@ -8077,9 +8091,9 @@
8077
8091
  }
8078
8092
  });
8079
8093
 
8080
- var PlusTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "table-column.vue"]]);
8094
+ var PlusTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "table-column.vue"]]);
8081
8095
 
8082
- var _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
8096
+ var _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
8083
8097
  ...{
8084
8098
  name: "PlusTableTableColumnIndex"
8085
8099
  },
@@ -8153,7 +8167,7 @@
8153
8167
  }
8154
8168
  });
8155
8169
 
8156
- var PlusTableTableColumnIndex = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "table-column-index.vue"]]);
8170
+ var PlusTableTableColumnIndex = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "table-column-index.vue"]]);
8157
8171
 
8158
8172
  /**!
8159
8173
  * Sortable 1.15.0
@@ -11175,8 +11189,8 @@
11175
11189
  Sortable.mount(new AutoScrollPlugin());
11176
11190
  Sortable.mount(Remove, Revert);
11177
11191
 
11178
- const _hoisted_1$a = { class: "plus-table-column-drag-icon" };
11179
- var _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
11192
+ const _hoisted_1$b = { class: "plus-table-column-drag-icon" };
11193
+ var _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
11180
11194
  ...{
11181
11195
  name: "PlusTableColumnDragSort"
11182
11196
  },
@@ -11227,7 +11241,7 @@
11227
11241
  "class-name": "plus-table-column-drag-sort"
11228
11242
  }, _ctx.dragSortableTableColumnProps), {
11229
11243
  default: vue.withCtx(() => [
11230
- vue.createElementVNode("span", _hoisted_1$a, [
11244
+ vue.createElementVNode("span", _hoisted_1$b, [
11231
11245
  vue.renderSlot(_ctx.$slots, "drag-sort-icon", {}, () => [
11232
11246
  vue.createTextVNode("\u2637")
11233
11247
  ])
@@ -11240,13 +11254,13 @@
11240
11254
  }
11241
11255
  });
11242
11256
 
11243
- var PlusTableColumnDragSort = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "table-column-drag-sort.vue"]]);
11257
+ var PlusTableColumnDragSort = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "table-column-drag-sort.vue"]]);
11244
11258
 
11245
- const _hoisted_1$9 = {
11259
+ const _hoisted_1$a = {
11246
11260
  key: 0,
11247
11261
  style: { "padding-top": "12px" }
11248
11262
  };
11249
- var _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
11263
+ var _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11250
11264
  ...{
11251
11265
  name: "PlusPopover"
11252
11266
  },
@@ -11292,7 +11306,7 @@
11292
11306
  ]),
11293
11307
  default: vue.withCtx(() => [
11294
11308
  vue.renderSlot(_ctx.$slots, "default"),
11295
- _ctx.hasShowBottomButton ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
11309
+ _ctx.hasShowBottomButton ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
11296
11310
  vue.createVNode(vue.unref(elementPlus.ElButton), {
11297
11311
  size: "small",
11298
11312
  plain: "",
@@ -11333,11 +11347,11 @@
11333
11347
  }
11334
11348
  });
11335
11349
 
11336
- var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "index.vue"]]);
11350
+ var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "index.vue"]]);
11337
11351
 
11338
11352
  const PlusPopover = Popover;
11339
11353
 
11340
- const _hoisted_1$8 = { class: "plus-table-title-bar" };
11354
+ const _hoisted_1$9 = { class: "plus-table-title-bar" };
11341
11355
  const _hoisted_2$4 = { class: "plus-table-title-bar__title" };
11342
11356
  const _hoisted_3$2 = { class: "plus-table-title-bar__toolbar" };
11343
11357
  const _hoisted_4$2 = { class: "plus-table-title-bar__toolbar__density" };
@@ -11363,7 +11377,7 @@
11363
11377
  };
11364
11378
  const _hoisted_8$1 = { key: 1 };
11365
11379
  const _hoisted_9$1 = { key: 1 };
11366
- var _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
11380
+ var _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
11367
11381
  ...{
11368
11382
  name: "PlusTableToolbar"
11369
11383
  },
@@ -11514,7 +11528,7 @@
11514
11528
  });
11515
11529
  return (_ctx, _cache) => {
11516
11530
  var _a, _b, _c;
11517
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
11531
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
11518
11532
  vue.createElementVNode("div", _hoisted_2$4, [
11519
11533
  vue.renderSlot(_ctx.$slots, "title", {}, () => [
11520
11534
  vue.createTextVNode(
@@ -11816,10 +11830,46 @@
11816
11830
  }
11817
11831
  });
11818
11832
 
11819
- var PlusTableTitleBar = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "table-title-bar.vue"]]);
11833
+ var PlusTableTitleBar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "table-title-bar.vue"]]);
11834
+
11835
+ const useTableColumns = ({ columns, skipEqual = true }) => {
11836
+ const filterColumns = vue.shallowRef([]);
11837
+ const subColumns = vue.shallowRef([]);
11838
+ const columnsIsChange = vue.ref(false);
11839
+ const resolveSubColumns = (list) => list.filter((item) => vue.unref(item.hideInTable) !== true && item.headerIsChecked !== false);
11840
+ vue.watch(
11841
+ columns,
11842
+ (val, oldVal) => {
11843
+ if (skipEqual && oldVal && isEqual(val, oldVal)) return;
11844
+ const filterOriginColumns = val.filter((item) => vue.unref(item.hideInTable) !== true);
11845
+ filterColumns.value = filterOriginColumns.map((item) => {
11846
+ var _a;
11847
+ return {
11848
+ ...item,
11849
+ headerIsChecked: (_a = item.headerIsChecked) != null ? _a : true
11850
+ };
11851
+ });
11852
+ subColumns.value = filterOriginColumns.filter((item) => vue.unref(item.headerIsChecked) !== false);
11853
+ columnsIsChange.value = !columnsIsChange.value;
11854
+ },
11855
+ {
11856
+ immediate: true
11857
+ }
11858
+ );
11859
+ const setFilterColumns = (_columns) => {
11860
+ filterColumns.value = _columns;
11861
+ subColumns.value = resolveSubColumns(_columns);
11862
+ };
11863
+ return {
11864
+ filterColumns,
11865
+ subColumns,
11866
+ columnsIsChange,
11867
+ setFilterColumns
11868
+ };
11869
+ };
11820
11870
 
11821
- const _hoisted_1$7 = { class: "plus-table-expand-col" };
11822
- var _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
11871
+ const _hoisted_1$8 = { class: "plus-table-expand-col" };
11872
+ var _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
11823
11873
  ...{
11824
11874
  name: "PlusTable",
11825
11875
  inheritAttrs: false
@@ -11860,8 +11910,7 @@
11860
11910
  editable: { type: [Boolean, String], default: false },
11861
11911
  adaptive: { type: [Boolean, Object], default: false },
11862
11912
  filterTableHeaderOverflowLabelLength: {},
11863
- emptyValue: { default: void 0 },
11864
- plainTextCell: { type: Boolean, default: false }
11913
+ emptyValue: { default: void 0 }
11865
11914
  },
11866
11915
  emits: ["paginationChange", "clickAction", "clickActionConfirmCancel", "dragSortEnd", "formChange", "refresh", "edited", "cell-click", "cell-dblclick", "filterTableHeader", "radioChange"],
11867
11916
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -11869,9 +11918,6 @@
11869
11918
  const props = __props;
11870
11919
  const emit = __emit;
11871
11920
  const radioRow = vue.ref();
11872
- const subColumns = vue.shallowRef([]);
11873
- const columnsIsChange = vue.ref(false);
11874
- const filterColumns = vue.shallowRef([]);
11875
11921
  const tableInstance = vue.shallowRef(null);
11876
11922
  const tableWrapperInstance = vue.ref(null);
11877
11923
  const paginationInstance = vue.ref(null);
@@ -11914,25 +11960,9 @@
11914
11960
  vue.provide(TableFormRefInjectionKey, formRefs);
11915
11961
  const formFieldRefs = vue.shallowRef({});
11916
11962
  vue.provide(TableFormFieldRefInjectionKey, formFieldRefs);
11917
- vue.watch(
11918
- () => props.columns,
11919
- (val, oldVal) => {
11920
- if (oldVal && isEqual(val, oldVal)) return;
11921
- const filterOriginColumns = val.filter((item) => vue.unref(item.hideInTable) !== true);
11922
- filterColumns.value = filterOriginColumns.map((item) => {
11923
- var _a2;
11924
- return {
11925
- ...item,
11926
- headerIsChecked: (_a2 = item.headerIsChecked) != null ? _a2 : true
11927
- };
11928
- });
11929
- subColumns.value = filterOriginColumns.filter((item) => vue.unref(item.headerIsChecked) !== false);
11930
- columnsIsChange.value = !columnsIsChange.value;
11931
- },
11932
- {
11933
- immediate: true
11934
- }
11935
- );
11963
+ const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
11964
+ columns: () => props.columns
11965
+ });
11936
11966
  vue.watch(
11937
11967
  () => props.defaultSelectedRadioRow,
11938
11968
  (val) => {
@@ -11952,11 +11982,8 @@
11952
11982
  emit("clickActionConfirmCancel", callbackParams);
11953
11983
  };
11954
11984
  const handleFilterTableConfirm = (_columns, eventType) => {
11955
- filterColumns.value = _columns;
11985
+ setFilterColumns(_columns);
11956
11986
  emit("filterTableHeader", _columns, eventType);
11957
- subColumns.value = _columns.filter(
11958
- (item) => vue.unref(item.hideInTable) !== true && item.headerIsChecked !== false
11959
- );
11960
11987
  };
11961
11988
  const handleClickDensity = (size2) => {
11962
11989
  state.size = size2;
@@ -12072,9 +12099,9 @@
12072
12099
  _ctx.titleBar ? (vue.openBlock(), vue.createBlock(PlusTableTitleBar, {
12073
12100
  key: 0,
12074
12101
  "origin-columns": _ctx.columns,
12075
- columns: filterColumns.value,
12102
+ columns: vue.unref(filterColumns),
12076
12103
  "default-size": vue.unref(size),
12077
- "columns-is-change": columnsIsChange.value,
12104
+ "columns-is-change": vue.unref(columnsIsChange),
12078
12105
  "title-bar": _ctx.titleBar,
12079
12106
  onClickDensity: handleClickDensity,
12080
12107
  onFilterTableHeader: handleFilterTableConfirm,
@@ -12203,7 +12230,7 @@
12203
12230
  }, _ctx.expandTableColumnProps),
12204
12231
  {
12205
12232
  default: vue.withCtx((scoped) => [
12206
- vue.createElementVNode("div", _hoisted_1$7, [
12233
+ vue.createElementVNode("div", _hoisted_1$8, [
12207
12234
  vue.renderSlot(_ctx.$slots, "expand", vue.mergeProps({
12208
12235
  index: scoped.$index
12209
12236
  }, scoped))
@@ -12226,12 +12253,11 @@
12226
12253
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
12227
12254
  vue.createCommentVNode("\u914D\u7F6E\u6E32\u67D3\u680F "),
12228
12255
  vue.createVNode(PlusTableColumn, {
12229
- columns: subColumns.value,
12256
+ columns: vue.unref(subColumns),
12230
12257
  editable: _ctx.editable,
12231
12258
  "sub-page-info": vue.unref(subPageInfo),
12232
12259
  "table-data-length": tableDataLength.value,
12233
12260
  "empty-value": _ctx.emptyValue,
12234
- "plain-text-cell": _ctx.plainTextCell,
12235
12261
  onFormChange: handleFormChange
12236
12262
  }, vue.createSlots({
12237
12263
  _: 2
@@ -12245,7 +12271,7 @@
12245
12271
  ])
12246
12272
  };
12247
12273
  })
12248
- ]), 1032, ["columns", "editable", "sub-page-info", "table-data-length", "empty-value", "plain-text-cell"])
12274
+ ]), 1032, ["columns", "editable", "sub-page-info", "table-data-length", "empty-value"])
12249
12275
  ]),
12250
12276
  vue.createCommentVNode(" \u64CD\u4F5C\u680F "),
12251
12277
  _ctx.actionBar ? (vue.openBlock(), vue.createBlock(
@@ -12315,10 +12341,851 @@
12315
12341
  }
12316
12342
  });
12317
12343
 
12318
- var _Table = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "index.vue"]]);
12344
+ var _Table = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "index.vue"]]);
12319
12345
 
12320
12346
  const PlusTable = _Table;
12321
12347
 
12348
+ const _hoisted_1$7 = { class: "plus-table-v2-header" };
12349
+ var _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
12350
+ ...{
12351
+ name: "PlusTableV2HeaderCell"
12352
+ },
12353
+ __name: "table-v2-header-cell",
12354
+ props: {
12355
+ column: {},
12356
+ cellIndex: {}
12357
+ },
12358
+ setup(__props) {
12359
+ const props = __props;
12360
+ const labelText = vue.computed(() => getLabel(props.column.label));
12361
+ return (_ctx, _cache) => {
12362
+ return vue.openBlock(), vue.createElementBlock(
12363
+ vue.Fragment,
12364
+ null,
12365
+ [
12366
+ vue.createCommentVNode(" \u8868\u5934\u5355\u5143\u683C\uFF1A\u4E0E el-table \u7248\u672C\u7684 PlusTableColumn header \u903B\u8F91\u4FDD\u6301\u4E00\u81F4 "),
12367
+ vue.createElementVNode("span", _hoisted_1$7, [
12368
+ _ctx.column.renderHeader && vue.unref(isFunction)(_ctx.column.renderHeader) ? (vue.openBlock(), vue.createBlock(vue.unref(PlusRender), {
12369
+ key: 0,
12370
+ render: _ctx.column.renderHeader,
12371
+ params: { column: _ctx.column, cellIndex: _ctx.cellIndex },
12372
+ "callback-value": labelText.value
12373
+ }, null, 8, ["render", "params", "callback-value"])) : (vue.openBlock(), vue.createElementBlock(
12374
+ vue.Fragment,
12375
+ { key: 1 },
12376
+ [
12377
+ vue.createCommentVNode("\u8868\u683C\u5355\u5143\u683C Header \u7684\u63D2\u69FD "),
12378
+ vue.renderSlot(_ctx.$slots, vue.unref(getTableHeaderSlotName)(_ctx.column.prop), {
12379
+ prop: _ctx.column.prop,
12380
+ label: labelText.value,
12381
+ fieldProps: _ctx.column.fieldProps,
12382
+ valueType: _ctx.column.valueType,
12383
+ cellIndex: _ctx.cellIndex,
12384
+ column: _ctx.column
12385
+ }, () => [
12386
+ vue.createTextVNode(
12387
+ vue.toDisplayString(labelText.value),
12388
+ 1
12389
+ /* TEXT */
12390
+ )
12391
+ ])
12392
+ ],
12393
+ 2112
12394
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
12395
+ )),
12396
+ _ctx.column.tooltip ? (vue.openBlock(), vue.createBlock(
12397
+ vue.unref(elementPlus.ElTooltip),
12398
+ vue.mergeProps({
12399
+ key: 2,
12400
+ placement: "top"
12401
+ }, vue.unref(getTooltip)(_ctx.column.tooltip)),
12402
+ {
12403
+ default: vue.withCtx(() => [
12404
+ vue.renderSlot(_ctx.$slots, "tooltip-icon", {}, () => [
12405
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
12406
+ class: "plus-table-v2-header__icon",
12407
+ size: 16
12408
+ }, {
12409
+ default: vue.withCtx(() => [
12410
+ vue.createVNode(vue.unref(question_filled_default))
12411
+ ]),
12412
+ _: 1
12413
+ /* STABLE */
12414
+ })
12415
+ ])
12416
+ ]),
12417
+ _: 3
12418
+ /* FORWARDED */
12419
+ },
12420
+ 16
12421
+ /* FULL_PROPS */
12422
+ )) : vue.createCommentVNode("v-if", true)
12423
+ ])
12424
+ ],
12425
+ 2112
12426
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
12427
+ );
12428
+ };
12429
+ }
12430
+ });
12431
+
12432
+ var TableV2HeaderCell = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "table-v2-header-cell.vue"]]);
12433
+
12434
+ const buildDataColumns = ({
12435
+ columns,
12436
+ renderCell,
12437
+ slots
12438
+ }) => {
12439
+ const headerSlots = {};
12440
+ Object.keys(slots || {}).forEach((key) => {
12441
+ if (key.startsWith("plus-header-") || key === "tooltip-icon") {
12442
+ headerSlots[key] = slots == null ? void 0 : slots[key];
12443
+ }
12444
+ });
12445
+ return columns.filter((col) => {
12446
+ var _a;
12447
+ return !((_a = col.children) == null ? void 0 : _a.length);
12448
+ }).map((col, columnIndex) => {
12449
+ const tableColumnProps = col.tableColumnProps || {};
12450
+ const fixed = tableColumnProps.fixed === true ? "left" : tableColumnProps.fixed;
12451
+ return {
12452
+ key: getTableKey(col, true),
12453
+ dataKey: col.prop,
12454
+ title: getLabel(col.label),
12455
+ width: typeof col.width === "number" ? col.width : Number(col.width) || void 0,
12456
+ minWidth: typeof col.minWidth === "number" ? col.minWidth : Number(col.minWidth) || void 0,
12457
+ fixed,
12458
+ align: tableColumnProps.align,
12459
+ class: tableColumnProps.className,
12460
+ cellRenderer: ({ rowData, rowIndex }) => renderCell({
12461
+ column: col,
12462
+ row: rowData,
12463
+ rowIndex,
12464
+ columnIndex
12465
+ }),
12466
+ headerCellRenderer: () => vue.h(TableV2HeaderCell, { column: col, cellIndex: columnIndex }, headerSlots)
12467
+ };
12468
+ });
12469
+ };
12470
+
12471
+ const toNumber = (value, fallback) => {
12472
+ const num = Number(value);
12473
+ return Number.isFinite(num) && num > 0 ? num : fallback;
12474
+ };
12475
+ const buildIndexColumn = ({
12476
+ pageInfo,
12477
+ indexContentStyle,
12478
+ columnProps = {}
12479
+ }) => {
12480
+ const getIndex = isNumber(columnProps.index) ? () => columnProps.index : isFunction(columnProps.index) ? columnProps.index : (index) => (((pageInfo == null ? void 0 : pageInfo.page) || 1) - 1) * ((pageInfo == null ? void 0 : pageInfo.pageSize) || 10) + index + 1;
12481
+ const resolveStyle = (row, index) => {
12482
+ if (isFunction(indexContentStyle)) return indexContentStyle(row, index);
12483
+ if (isPlainObject(indexContentStyle)) return indexContentStyle;
12484
+ return {};
12485
+ };
12486
+ return {
12487
+ key: "index",
12488
+ title: "#",
12489
+ width: toNumber(columnProps.width, 60),
12490
+ fixed: elementPlus.TableV2FixedDir.LEFT,
12491
+ align: "center",
12492
+ cellRenderer: ({ rowData, rowIndex }) => vue.h("div", { class: "plus-table-v2-index", style: resolveStyle(rowData, rowIndex) }, [
12493
+ String(getIndex(rowIndex))
12494
+ ])
12495
+ };
12496
+ };
12497
+ const buildRadioColumn = ({
12498
+ radioRow,
12499
+ onChange,
12500
+ radioProps,
12501
+ columnProps = {}
12502
+ }) => ({
12503
+ key: "radio",
12504
+ title: "",
12505
+ width: toNumber(columnProps.width, 50),
12506
+ fixed: elementPlus.TableV2FixedDir.LEFT,
12507
+ align: "center",
12508
+ cellRenderer: ({ rowData }) => vue.h(PlusRadio, {
12509
+ modelValue: isEqual(radioRow(), rowData),
12510
+ options: [{ value: true }],
12511
+ ...radioProps,
12512
+ onChange: (value) => onChange(value, rowData)
12513
+ })
12514
+ });
12515
+ const buildSelectionColumn = ({
12516
+ isSelected,
12517
+ isAllSelected,
12518
+ isIndeterminate,
12519
+ onToggleRow,
12520
+ onToggleAll,
12521
+ columnProps = {}
12522
+ }) => ({
12523
+ key: "selection",
12524
+ title: "",
12525
+ width: toNumber(columnProps.width, 40),
12526
+ fixed: elementPlus.TableV2FixedDir.LEFT,
12527
+ align: "center",
12528
+ headerCellRenderer: () => vue.h(elementPlus.ElCheckbox, {
12529
+ modelValue: isAllSelected(),
12530
+ indeterminate: isIndeterminate(),
12531
+ "onUpdate:modelValue": (checked) => onToggleAll(Boolean(checked))
12532
+ }),
12533
+ cellRenderer: ({ rowData }) => vue.h(elementPlus.ElCheckbox, {
12534
+ modelValue: isSelected(rowData),
12535
+ "onUpdate:modelValue": (checked) => onToggleRow(rowData, Boolean(checked))
12536
+ })
12537
+ });
12538
+
12539
+ const DEFAULT_TABLE_V2_MIN_WIDTH = 100;
12540
+ const toColumnNumber = (value) => {
12541
+ if (typeof value === "number") return Number.isFinite(value) ? value : 0;
12542
+ if (typeof value === "string") return Number.parseFloat(value) || 0;
12543
+ return 0;
12544
+ };
12545
+ const useTableV2Columns = ({
12546
+ columns,
12547
+ containerWidth,
12548
+ excludeKeys = [],
12549
+ defaultMinWidth = DEFAULT_TABLE_V2_MIN_WIDTH
12550
+ }) => {
12551
+ const resolvedColumns = vue.computed(() => {
12552
+ const cols = columns();
12553
+ const floors = cols.map(
12554
+ (col) => toColumnNumber(col.minWidth) || toColumnNumber(col.width) || defaultMinWidth
12555
+ );
12556
+ const sumFloor = floors.reduce((total, item) => total + item, 0);
12557
+ const target = Math.max(sumFloor, containerWidth());
12558
+ const stretchableIndexes = cols.map(
12559
+ (col, index) => col.fixed || col.key !== void 0 && excludeKeys.includes(String(col.key)) ? -1 : index
12560
+ ).filter((index) => index >= 0);
12561
+ const extra = target - sumFloor;
12562
+ const stretchCount = stretchableIndexes.length;
12563
+ const base = stretchCount ? Math.floor(extra / stretchCount) : 0;
12564
+ let remainder = stretchCount ? extra % stretchCount : 0;
12565
+ const widths = floors.map((floor, index) => {
12566
+ if (!stretchableIndexes.includes(index)) return floor;
12567
+ let width = floor + base;
12568
+ if (remainder > 0) {
12569
+ width += 1;
12570
+ remainder -= 1;
12571
+ }
12572
+ return width;
12573
+ });
12574
+ return cols.map((col, index) => ({
12575
+ ...col,
12576
+ minWidth: floors[index],
12577
+ width: widths[index]
12578
+ }));
12579
+ });
12580
+ return { resolvedColumns };
12581
+ };
12582
+
12583
+ const TableV2Cell = vue.defineComponent({
12584
+ name: "PlusTableV2Cell",
12585
+ props: {
12586
+ /** 列配置 */
12587
+ column: {
12588
+ type: Object,
12589
+ required: true
12590
+ },
12591
+ /** 行数据 */
12592
+ row: {
12593
+ type: Object,
12594
+ required: true
12595
+ },
12596
+ /** 行索引 */
12597
+ index: {
12598
+ type: Number,
12599
+ default: 0
12600
+ },
12601
+ /** 单元格列索引 */
12602
+ cellIndex: {
12603
+ type: Number,
12604
+ default: 0
12605
+ },
12606
+ /** 是否可编辑 */
12607
+ editable: {
12608
+ type: [Boolean, String],
12609
+ default: false
12610
+ },
12611
+ /** 空值默认值 */
12612
+ emptyValue: {
12613
+ type: [String, Number],
12614
+ default: void 0
12615
+ },
12616
+ /** 透传给展示组件的额外参数 */
12617
+ rest: {
12618
+ type: Object,
12619
+ default: () => ({})
12620
+ }
12621
+ },
12622
+ emits: {
12623
+ /** 单元格点击 */
12624
+ cellClick: (_row, _column, _event) => true,
12625
+ /** 单元格双击 */
12626
+ cellDblclick: (_row, _column, _event) => true,
12627
+ /** 表单值变化 */
12628
+ formChange: (_data) => true
12629
+ },
12630
+ setup(props, { emit, slots, expose }) {
12631
+ const displayItemInstance = vue.ref(null);
12632
+ const cellInstance = vue.ref(null);
12633
+ const formRefs = vue.inject(
12634
+ TableFormRefInjectionKey,
12635
+ null
12636
+ );
12637
+ const handleClick = (event) => {
12638
+ emit("cellClick", props.row, props.column, event);
12639
+ };
12640
+ const handleDblclick = (event) => {
12641
+ emit("cellDblclick", props.row, props.column, event);
12642
+ };
12643
+ const handleChange = (data) => {
12644
+ emit("formChange", {
12645
+ ...data,
12646
+ index: props.index,
12647
+ rowIndex: props.index,
12648
+ cellIndex: props.cellIndex,
12649
+ column: { ...props.rest.column, ...props.column }
12650
+ });
12651
+ };
12652
+ const syncFormRef = () => {
12653
+ const instance = displayItemInstance.value;
12654
+ if (!formRefs || !instance) return;
12655
+ const info = {
12656
+ ...instance,
12657
+ ...instance.getDisplayItemInstance(),
12658
+ index: props.index,
12659
+ rowIndex: props.index,
12660
+ cellIndex: props.cellIndex
12661
+ };
12662
+ set(formRefs.value, [props.index, props.cellIndex], info);
12663
+ };
12664
+ vue.watch(
12665
+ () => [props.index, props.cellIndex, props.column.prop, displayItemInstance.value],
12666
+ syncFormRef,
12667
+ {
12668
+ flush: "post",
12669
+ immediate: true
12670
+ }
12671
+ );
12672
+ expose({
12673
+ cellInstance,
12674
+ startCellEdit: () => {
12675
+ var _a;
12676
+ return (_a = displayItemInstance.value) == null ? void 0 : _a.startCellEdit();
12677
+ },
12678
+ stopCellEdit: () => {
12679
+ var _a;
12680
+ return (_a = displayItemInstance.value) == null ? void 0 : _a.stopCellEdit();
12681
+ },
12682
+ getDisplayItemInstance: () => {
12683
+ var _a;
12684
+ return (_a = displayItemInstance.value) == null ? void 0 : _a.getDisplayItemInstance();
12685
+ }
12686
+ });
12687
+ return () => vue.h(
12688
+ "div",
12689
+ {
12690
+ ref: cellInstance,
12691
+ class: "plus-table-v2-cell",
12692
+ onClick: handleClick,
12693
+ onDblclick: handleDblclick
12694
+ },
12695
+ [
12696
+ vue.h(
12697
+ PlusDisplayItem,
12698
+ {
12699
+ ref: displayItemInstance,
12700
+ column: props.column,
12701
+ row: props.row,
12702
+ index: props.index,
12703
+ editable: props.editable,
12704
+ rest: props.rest,
12705
+ emptyValue: props.emptyValue,
12706
+ onChange: handleChange
12707
+ },
12708
+ slots
12709
+ )
12710
+ ]
12711
+ );
12712
+ }
12713
+ });
12714
+
12715
+ var _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
12716
+ ...{
12717
+ name: "PlusTableV2",
12718
+ inheritAttrs: false
12719
+ },
12720
+ __name: "index",
12721
+ props: {
12722
+ tableData: { default: () => [] },
12723
+ data: { default: () => [] },
12724
+ columns: { default: () => [] },
12725
+ defaultSize: { default: "default" },
12726
+ pagination: { type: [Boolean, Object], default: false },
12727
+ actionBar: { type: [Boolean, Object], default: false },
12728
+ hasIndexColumn: { type: Boolean, default: false },
12729
+ titleBar: { type: [Boolean, Object], default: true },
12730
+ isSelection: { type: Boolean, default: false },
12731
+ isRadio: { type: Boolean, default: false },
12732
+ specialColumnsOrder: { default: () => ["radio", "selection", "index"] },
12733
+ loadingStatus: { type: Boolean, default: false },
12734
+ height: { default: void 0 },
12735
+ width: { default: void 0 },
12736
+ rowHeight: { default: void 0 },
12737
+ headerHeight: { default: 50 },
12738
+ headerCellStyle: { default: () => ({
12739
+ "background-color": "var(--el-fill-color-light)"
12740
+ }) },
12741
+ rowKey: { default: "id" },
12742
+ defaultSelectedRadioRow: { default: void 0 },
12743
+ radioProps: { default: void 0 },
12744
+ selectionTableColumnProps: { default: () => ({ width: 40 }) },
12745
+ radioTableColumnProps: { default: () => ({ width: 50 }) },
12746
+ indexTableColumnProps: { default: () => ({}) },
12747
+ indexContentStyle: { type: [Object, Function], default: () => ({}) },
12748
+ editable: { type: [Boolean, String], default: false },
12749
+ adaptive: { type: [Boolean, Object], default: false },
12750
+ emptyValue: { default: void 0 }
12751
+ },
12752
+ emits: ["paginationChange", "clickAction", "clickActionConfirmCancel", "formChange", "refresh", "edited", "cell-click", "cell-dblclick", "filterTableHeader", "radioChange", "selection-change", "row-click", "row-dblclick"],
12753
+ setup(__props, { expose: __expose, emit: __emit }) {
12754
+ var _a, _b;
12755
+ const props = __props;
12756
+ const emit = __emit;
12757
+ const { t } = useLocale();
12758
+ const slots = vue.useSlots();
12759
+ const tableWrapperInstance = vue.ref(null);
12760
+ const tableInstance = vue.shallowRef(null);
12761
+ const paginationInstance = vue.ref(null);
12762
+ const state = vue.reactive({
12763
+ size: props.defaultSize,
12764
+ subPageInfo: {
12765
+ ...((_a = props.pagination) == null ? void 0 : _a.modelValue) || DefaultPageInfo
12766
+ }
12767
+ });
12768
+ const __tableData = vue.computed(
12769
+ () => {
12770
+ var _a2;
12771
+ return ((_a2 = props.tableData) == null ? void 0 : _a2.length) ? props.tableData : props.data;
12772
+ }
12773
+ );
12774
+ const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
12775
+ columns: () => props.columns
12776
+ });
12777
+ const formRefs = vue.shallowRef({});
12778
+ const formFieldRefs = vue.shallowRef({});
12779
+ const sizeRowHeightMap = {
12780
+ default: 50,
12781
+ large: 60,
12782
+ small: 40
12783
+ };
12784
+ const currentRowHeight = vue.computed(() => {
12785
+ var _a2, _b2;
12786
+ return (_b2 = (_a2 = props.rowHeight) != null ? _a2 : sizeRowHeightMap[state.size]) != null ? _b2 : 50;
12787
+ });
12788
+ const containerWidth = vue.ref(0);
12789
+ const fillHeight = vue.ref(400);
12790
+ const tableWidth = vue.computed(() => {
12791
+ if (props.width !== void 0) return toColumnNumber(props.width);
12792
+ return Math.max(containerWidth.value, 1);
12793
+ });
12794
+ const tableHeight = vue.computed(() => {
12795
+ if (props.height !== void 0) return toColumnNumber(props.height);
12796
+ return fillHeight.value;
12797
+ });
12798
+ const bodyHeight = vue.computed(() => `${tableHeight.value}px`);
12799
+ const calcFillHeight = () => {
12800
+ var _a2;
12801
+ if (!tableWrapperInstance.value) return;
12802
+ let offsetBottom = 20;
12803
+ if (isPlainObject(props.adaptive)) {
12804
+ offsetBottom = (_a2 = props.adaptive.offsetBottom) != null ? _a2 : offsetBottom;
12805
+ }
12806
+ const paginationHeight = paginationInstance.value && props.pagination ? paginationInstance.value.$el.offsetHeight : 0;
12807
+ const top = tableWrapperInstance.value.getBoundingClientRect().top;
12808
+ fillHeight.value = Math.max(window.innerHeight - top - offsetBottom - paginationHeight, 100);
12809
+ };
12810
+ const handleResize = ({ width }) => {
12811
+ containerWidth.value = width;
12812
+ };
12813
+ const debounceCalcFillHeight = debounce(
12814
+ calcFillHeight,
12815
+ isPlainObject(props.adaptive) ? (_b = props.adaptive.timeout) != null ? _b : 60 : 60
12816
+ );
12817
+ const radioRow = vue.ref({});
12818
+ vue.watch(
12819
+ () => props.defaultSelectedRadioRow,
12820
+ (val) => {
12821
+ radioRow.value = val != null ? val : {};
12822
+ },
12823
+ { immediate: true }
12824
+ );
12825
+ const selectedRows = vue.ref([]);
12826
+ const getRowKeyValue = (row) => row == null ? void 0 : row[props.rowKey];
12827
+ const isRowSelected = (row) => {
12828
+ const key = getRowKeyValue(row);
12829
+ return selectedRows.value.some((item) => getRowKeyValue(item) === key);
12830
+ };
12831
+ const isAllSelected = () => __tableData.value.length > 0 && selectedRows.value.length === __tableData.value.length;
12832
+ const isIndeterminate = () => selectedRows.value.length > 0 && selectedRows.value.length < __tableData.value.length;
12833
+ const handleToggleRow = (row, checked) => {
12834
+ const key = getRowKeyValue(row);
12835
+ const rest = selectedRows.value.filter((item) => getRowKeyValue(item) !== key);
12836
+ selectedRows.value = checked ? [...rest, row] : rest;
12837
+ emit("selection-change", selectedRows.value);
12838
+ };
12839
+ const handleToggleAll = (checked) => {
12840
+ selectedRows.value = checked ? [...__tableData.value] : [];
12841
+ emit("selection-change", selectedRows.value);
12842
+ };
12843
+ const handleRadioChange = (value, row) => {
12844
+ radioRow.value = value ? row : {};
12845
+ emit("radioChange", row, __tableData.value.indexOf(row), !!value);
12846
+ };
12847
+ const handleFormChange = (data) => {
12848
+ emit("formChange", data);
12849
+ };
12850
+ const handleRefresh = () => {
12851
+ emit("refresh");
12852
+ };
12853
+ const handleClickDensity = (size) => {
12854
+ state.size = size;
12855
+ };
12856
+ const handleFilterTableConfirm = (list, eventType) => {
12857
+ setFilterColumns(list);
12858
+ emit("filterTableHeader", list, eventType);
12859
+ };
12860
+ const handlePaginationChange = () => {
12861
+ emit("paginationChange", { ...state.subPageInfo });
12862
+ };
12863
+ const getCellForm = (row, column) => {
12864
+ var _a2;
12865
+ const rowIndex = __tableData.value.indexOf(row);
12866
+ const columnIndex = subColumns.value.findIndex((item) => item.prop === column.prop);
12867
+ if (rowIndex < 0 || columnIndex < 0) return null;
12868
+ return ((_a2 = formRefs.value[rowIndex]) == null ? void 0 : _a2[columnIndex]) || null;
12869
+ };
12870
+ const currentForm = vue.shallowRef(null);
12871
+ const startCellEdit = (row, column) => {
12872
+ var _a2;
12873
+ const cellForm = getCellForm(row, column);
12874
+ if (!cellForm) return;
12875
+ document.addEventListener("click", handleStopEditClick);
12876
+ (_a2 = currentForm.value) == null ? void 0 : _a2.stopCellEdit();
12877
+ currentForm.value = cellForm;
12878
+ cellForm.startCellEdit();
12879
+ const unwatch = vue.watch(
12880
+ () => formFieldRefs.value.valueIsReady,
12881
+ (val) => {
12882
+ var _a3, _b2;
12883
+ if ((val == null ? void 0 : val.value) && ((_b2 = (_a3 = formFieldRefs.value) == null ? void 0 : _a3.fieldInstance) == null ? void 0 : _b2.focus)) {
12884
+ formFieldRefs.value.fieldInstance.focus();
12885
+ unwatch();
12886
+ }
12887
+ }
12888
+ );
12889
+ };
12890
+ const handleStopEditClick = (event) => {
12891
+ var _a2;
12892
+ if (!tableWrapperInstance.value || !currentForm.value) return;
12893
+ const target = event == null ? void 0 : event.target;
12894
+ if ((_a2 = target == null ? void 0 : target.classList) == null ? void 0 : _a2.contains("el-icon")) return;
12895
+ if (tableWrapperInstance.value.contains(target)) return;
12896
+ currentForm.value.stopCellEdit();
12897
+ currentForm.value = null;
12898
+ emit("edited");
12899
+ document.removeEventListener("click", handleStopEditClick);
12900
+ };
12901
+ const handleCellClick = (row, column, event) => {
12902
+ if (props.editable === "click") startCellEdit(row, column);
12903
+ emit("cell-click", row, column, event.currentTarget, event);
12904
+ };
12905
+ const handleCellDblclick = (row, column, event) => {
12906
+ if (props.editable === "dblclick") startCellEdit(row, column);
12907
+ emit("cell-dblclick", row, column, event.currentTarget, event);
12908
+ };
12909
+ const getCellSlots = () => {
12910
+ const cellSlots = {};
12911
+ Object.keys(slots).forEach((key) => {
12912
+ if (key.startsWith("plus-") || key === "edit-icon") {
12913
+ cellSlots[key] = slots[key];
12914
+ }
12915
+ });
12916
+ return cellSlots;
12917
+ };
12918
+ const renderCell = ({
12919
+ column,
12920
+ row,
12921
+ rowIndex,
12922
+ columnIndex
12923
+ }) => vue.h(
12924
+ TableV2Cell,
12925
+ {
12926
+ column,
12927
+ row,
12928
+ index: rowIndex,
12929
+ cellIndex: columnIndex,
12930
+ editable: props.editable,
12931
+ emptyValue: props.emptyValue,
12932
+ onCellClick: handleCellClick,
12933
+ onCellDblclick: handleCellDblclick,
12934
+ onFormChange: handleFormChange
12935
+ },
12936
+ getCellSlots()
12937
+ );
12938
+ const dataColumns = vue.computed(
12939
+ () => buildDataColumns({
12940
+ columns: subColumns.value,
12941
+ renderCell,
12942
+ slots
12943
+ })
12944
+ );
12945
+ const actionBarColumn = vue.computed(() => {
12946
+ var _a2;
12947
+ if (!props.actionBar) return null;
12948
+ const actionBar = props.actionBar;
12949
+ return {
12950
+ key: "actionBar",
12951
+ title: actionBar.label || t("plus.table.action"),
12952
+ width: toColumnNumber(actionBar.width) || 200,
12953
+ fixed: actionBar.fixed || "right",
12954
+ align: (_a2 = actionBar.actionBarTableColumnProps) == null ? void 0 : _a2.align,
12955
+ cellRenderer: ({ rowData, rowIndex }) => vue.h(
12956
+ PlusTableActionBarContent,
12957
+ {
12958
+ row: rowData,
12959
+ index: rowIndex,
12960
+ type: actionBar.type,
12961
+ buttons: actionBar.buttons,
12962
+ showNumber: actionBar.showNumber,
12963
+ showLimitIncludeMore: actionBar.showLimitIncludeMore,
12964
+ confirmType: actionBar.confirmType,
12965
+ moreType: actionBar.moreType,
12966
+ onClickAction: (data) => emit("clickAction", data),
12967
+ onClickActionConfirmCancel: (data) => emit("clickActionConfirmCancel", data)
12968
+ },
12969
+ {
12970
+ "action-bar-more-icon": () => {
12971
+ var _a3;
12972
+ return (_a3 = slots["action-bar-more-icon"]) == null ? void 0 : _a3.call(slots);
12973
+ }
12974
+ }
12975
+ )
12976
+ };
12977
+ });
12978
+ const specialColumns = vue.computed(() => {
12979
+ const activeList = [];
12980
+ if (props.isRadio) activeList.push("radio");
12981
+ if (props.isSelection) activeList.push("selection");
12982
+ if (props.hasIndexColumn) activeList.push("index");
12983
+ const defaultOrder = ["radio", "selection", "index"];
12984
+ const order = [...props.specialColumnsOrder || [], ...defaultOrder].filter(
12985
+ (item, index, array) => array.indexOf(item) === index
12986
+ );
12987
+ return order.filter((item) => activeList.includes(item)).map((item) => {
12988
+ if (item === "radio") {
12989
+ return buildRadioColumn({
12990
+ radioRow: () => radioRow.value,
12991
+ onChange: handleRadioChange,
12992
+ radioProps: props.radioProps,
12993
+ columnProps: props.radioTableColumnProps
12994
+ });
12995
+ }
12996
+ if (item === "selection") {
12997
+ return buildSelectionColumn({
12998
+ isSelected: isRowSelected,
12999
+ isAllSelected,
13000
+ isIndeterminate,
13001
+ onToggleRow: handleToggleRow,
13002
+ onToggleAll: handleToggleAll,
13003
+ columnProps: props.selectionTableColumnProps
13004
+ });
13005
+ }
13006
+ return buildIndexColumn({
13007
+ pageInfo: state.subPageInfo,
13008
+ indexContentStyle: props.indexContentStyle,
13009
+ columnProps: props.indexTableColumnProps
13010
+ });
13011
+ });
13012
+ });
13013
+ const allColumns = vue.computed(() => {
13014
+ const list = [...specialColumns.value, ...dataColumns.value];
13015
+ if (actionBarColumn.value) list.push(actionBarColumn.value);
13016
+ return list;
13017
+ });
13018
+ const { resolvedColumns } = useTableV2Columns({
13019
+ columns: () => allColumns.value,
13020
+ containerWidth: () => tableWidth.value
13021
+ });
13022
+ const headerCellProps = () => ({ style: props.headerCellStyle });
13023
+ const rowEventHandlers = vue.computed(() => ({
13024
+ onClick: ({ rowData, rowIndex, event }) => {
13025
+ emit("row-click", rowData, rowIndex, event);
13026
+ },
13027
+ onDblclick: ({ rowData, rowIndex, event }) => {
13028
+ emit("row-dblclick", rowData, rowIndex, event);
13029
+ }
13030
+ }));
13031
+ vue.onMounted(() => {
13032
+ calcFillHeight();
13033
+ window.addEventListener("resize", debounceCalcFillHeight);
13034
+ });
13035
+ vue.onBeforeUnmount(() => {
13036
+ window.removeEventListener("resize", debounceCalcFillHeight);
13037
+ document.removeEventListener("click", handleStopEditClick);
13038
+ });
13039
+ vue.provide(TableFormRefInjectionKey, formRefs);
13040
+ vue.provide(TableFormFieldRefInjectionKey, formFieldRefs);
13041
+ __expose({
13042
+ formRefs,
13043
+ tableInstance,
13044
+ /** 滚动到指定垂直位置 */
13045
+ scrollToTop: (top) => {
13046
+ var _a2;
13047
+ return (_a2 = tableInstance.value) == null ? void 0 : _a2.scrollToTop(top);
13048
+ },
13049
+ /** 滚动到指定水平位置 */
13050
+ scrollToLeft: (left) => {
13051
+ var _a2;
13052
+ return (_a2 = tableInstance.value) == null ? void 0 : _a2.scrollToLeft(left);
13053
+ },
13054
+ /** 滚动到指定行 */
13055
+ scrollToRow: (row, strategy) => {
13056
+ var _a2;
13057
+ return (_a2 = tableInstance.value) == null ? void 0 : _a2.scrollToRow(row, strategy);
13058
+ }
13059
+ });
13060
+ return (_ctx, _cache) => {
13061
+ return vue.openBlock(), vue.createElementBlock(
13062
+ "div",
13063
+ {
13064
+ ref_key: "tableWrapperInstance",
13065
+ ref: tableWrapperInstance,
13066
+ class: "plus-table-v2"
13067
+ },
13068
+ [
13069
+ vue.createCommentVNode(" \u6807\u9898\u680F\uFF1A\u5237\u65B0 / \u5BC6\u5EA6 / \u5217\u8BBE\u7F6E\uFF0C\u4E0E el-table \u7248\u672C\u590D\u7528\u540C\u4E00\u7EC4\u4EF6 "),
13070
+ _ctx.titleBar ? (vue.openBlock(), vue.createBlock(vue.unref(PlusTableTitleBar), {
13071
+ key: 0,
13072
+ "origin-columns": _ctx.columns,
13073
+ columns: vue.unref(filterColumns),
13074
+ "default-size": state.size,
13075
+ "columns-is-change": vue.unref(columnsIsChange),
13076
+ "title-bar": _ctx.titleBar,
13077
+ onClickDensity: handleClickDensity,
13078
+ onFilterTableHeader: handleFilterTableConfirm,
13079
+ onRefresh: handleRefresh
13080
+ }, vue.createSlots({
13081
+ title: vue.withCtx(() => [
13082
+ vue.renderSlot(_ctx.$slots, "title")
13083
+ ]),
13084
+ toolbar: vue.withCtx(() => [
13085
+ vue.renderSlot(_ctx.$slots, "toolbar")
13086
+ ]),
13087
+ _: 2
13088
+ /* DYNAMIC */
13089
+ }, [
13090
+ _ctx.$slots["column-settings-icon"] ? {
13091
+ name: "column-settings-icon",
13092
+ fn: vue.withCtx(() => [
13093
+ vue.renderSlot(_ctx.$slots, "column-settings-icon")
13094
+ ]),
13095
+ key: "0"
13096
+ } : void 0,
13097
+ _ctx.$slots["density-icon"] ? {
13098
+ name: "density-icon",
13099
+ fn: vue.withCtx(() => [
13100
+ vue.renderSlot(_ctx.$slots, "density-icon")
13101
+ ]),
13102
+ key: "1"
13103
+ } : void 0
13104
+ ]), 1032, ["origin-columns", "columns", "default-size", "columns-is-change", "title-bar"])) : vue.createCommentVNode("v-if", true),
13105
+ vue.createCommentVNode(" \u865A\u62DF\u8868\u683C\u4E3B\u4F53\uFF1A\u5BBD\u5EA6\u6491\u6EE1\u7236\u5BB9\u5668\uFF0C\u9AD8\u5EA6\u6309 props.height / adaptive \u8BA1\u7B97 "),
13106
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock(
13107
+ "div",
13108
+ {
13109
+ class: "plus-table-v2__body",
13110
+ style: vue.normalizeStyle({ height: bodyHeight.value })
13111
+ },
13112
+ [
13113
+ vue.createVNode(vue.unref(elementPlus.ElAutoResizer), {
13114
+ "disable-height": true,
13115
+ "on-resize": handleResize
13116
+ }, {
13117
+ default: vue.withCtx(() => [
13118
+ vue.createVNode(vue.unref(elementPlus.ElTableV2), vue.mergeProps({
13119
+ ref_key: "tableInstance",
13120
+ ref: tableInstance,
13121
+ columns: vue.unref(resolvedColumns),
13122
+ data: __tableData.value,
13123
+ width: tableWidth.value,
13124
+ height: tableHeight.value,
13125
+ "row-height": currentRowHeight.value,
13126
+ "header-height": _ctx.headerHeight,
13127
+ "row-key": _ctx.rowKey,
13128
+ "header-cell-props": headerCellProps,
13129
+ "row-event-handlers": rowEventHandlers.value,
13130
+ fixed: true,
13131
+ "scrollbar-always-on": true
13132
+ }, _ctx.$attrs), {
13133
+ empty: vue.withCtx(() => [
13134
+ vue.renderSlot(_ctx.$slots, "empty", {}, () => [
13135
+ vue.createVNode(vue.unref(elementPlus.ElEmpty))
13136
+ ])
13137
+ ]),
13138
+ _: 3
13139
+ /* FORWARDED */
13140
+ }, 16, ["columns", "data", "width", "height", "row-height", "header-height", "row-key", "row-event-handlers"])
13141
+ ]),
13142
+ _: 3
13143
+ /* FORWARDED */
13144
+ })
13145
+ ],
13146
+ 4
13147
+ /* STYLE */
13148
+ )), [
13149
+ [vue.unref(elementPlus.vLoading), _ctx.loadingStatus]
13150
+ ]),
13151
+ vue.createCommentVNode(" \u5206\u9875 "),
13152
+ _ctx.pagination ? (vue.openBlock(), vue.createBlock(vue.unref(PlusPagination), vue.mergeProps({
13153
+ key: 1,
13154
+ ref_key: "paginationInstance",
13155
+ ref: paginationInstance,
13156
+ modelValue: state.subPageInfo,
13157
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.subPageInfo = $event)
13158
+ }, _ctx.pagination, { onChange: handlePaginationChange }), vue.createSlots({
13159
+ _: 2
13160
+ /* DYNAMIC */
13161
+ }, [
13162
+ _ctx.$slots["pagination-left"] ? {
13163
+ name: "pagination-left",
13164
+ fn: vue.withCtx(() => [
13165
+ vue.renderSlot(_ctx.$slots, "pagination-left")
13166
+ ]),
13167
+ key: "0"
13168
+ } : void 0,
13169
+ _ctx.$slots["pagination-right"] ? {
13170
+ name: "pagination-right",
13171
+ fn: vue.withCtx(() => [
13172
+ vue.renderSlot(_ctx.$slots, "pagination-right")
13173
+ ]),
13174
+ key: "1"
13175
+ } : void 0
13176
+ ]), 1040, ["modelValue"])) : vue.createCommentVNode("v-if", true)
13177
+ ],
13178
+ 512
13179
+ /* NEED_PATCH */
13180
+ );
13181
+ };
13182
+ }
13183
+ });
13184
+
13185
+ var TableV2 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "index.vue"]]);
13186
+
13187
+ const PlusTableV2 = TableV2;
13188
+
12322
13189
  var _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
12323
13190
  ...{
12324
13191
  name: "PlusDescriptions"
@@ -13099,6 +13966,8 @@
13099
13966
  request: {},
13100
13967
  search: { type: [Boolean, Object], default: () => ({}) },
13101
13968
  table: { default: () => ({}) },
13969
+ tableType: { default: "table" },
13970
+ tableV2: { default: void 0 },
13102
13971
  params: { default: () => ({}) },
13103
13972
  postData: { type: Function, default: void 0 },
13104
13973
  beforeSearchSubmit: { type: Function, default: void 0 },
@@ -13152,6 +14021,26 @@
13152
14021
  const values = vue.ref(
13153
14022
  (_b = props.searchValues) != null ? _b : { ...(_a = props.search) == null ? void 0 : _a.defaultValues }
13154
14023
  );
14024
+ const tableComponentMap = /* @__PURE__ */ new Map([
14025
+ ["table", PlusTable],
14026
+ ["table-v2", PlusTableV2]
14027
+ ]);
14028
+ const tableComponent = vue.computed(() => tableComponentMap.get(props.tableType) || PlusTable);
14029
+ const tableProps = vue.computed(() => {
14030
+ if (props.tableType === "table-v2") {
14031
+ return { ...props.table, ...props.tableV2 };
14032
+ }
14033
+ return props.table;
14034
+ });
14035
+ const tablePagination = vue.computed(() => {
14036
+ if (props.pagination === false) return void 0;
14037
+ return {
14038
+ ...props.pagination,
14039
+ total: total.value,
14040
+ modelValue: pageInfo.value,
14041
+ pageSizeList: computedDefaultPageSizeList.value
14042
+ };
14043
+ });
13155
14044
  vue.watch(
13156
14045
  () => props.searchValues,
13157
14046
  (val) => {
@@ -13201,6 +14090,9 @@
13201
14090
  getList();
13202
14091
  emit("paginationChange", _pageInfo);
13203
14092
  };
14093
+ const handleTablePaginationChange = (data) => {
14094
+ handlePaginationChange(data);
14095
+ };
13204
14096
  const handleSearchChange = (val, column) => {
13205
14097
  emit("update:searchValues", val);
13206
14098
  emit("searchChange", val, column);
@@ -13315,21 +14207,16 @@
13315
14207
  class: "plus-page__table_wrapper"
13316
14208
  }, {
13317
14209
  default: vue.withCtx(() => [
13318
- vue.createVNode(vue.unref(PlusTable), vue.mergeProps({
14210
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tableComponent.value), vue.mergeProps({
13319
14211
  ref_key: "plusTableInstance",
13320
14212
  ref: plusTableInstance,
13321
14213
  "title-bar": { refresh: true }
13322
- }, _ctx.table, {
14214
+ }, tableProps.value, {
13323
14215
  "table-data": vue.unref(tableData),
13324
14216
  "loading-status": vue.unref(loadingStatus),
13325
14217
  columns: _ctx.columns,
13326
- pagination: _ctx.pagination === false ? void 0 : {
13327
- ..._ctx.pagination,
13328
- total: vue.unref(total),
13329
- modelValue: vue.unref(pageInfo),
13330
- pageSizeList: computedDefaultPageSizeList.value
13331
- },
13332
- onPaginationChange: handlePaginationChange,
14218
+ pagination: tablePagination.value,
14219
+ onPaginationChange: handleTablePaginationChange,
13333
14220
  onRefresh: handleRefresh
13334
14221
  }), vue.createSlots({
13335
14222
  _: 2
@@ -13378,7 +14265,7 @@
13378
14265
  ])
13379
14266
  };
13380
14267
  })
13381
- ]), 1040, ["table-data", "loading-status", "columns", "pagination"])
14268
+ ]), 1040, ["table-data", "loading-status", "columns", "pagination"]))
13382
14269
  ]),
13383
14270
  _: 3
13384
14271
  /* FORWARDED */
@@ -14773,6 +15660,7 @@
14773
15660
  PlusDialog,
14774
15661
  PlusPagination,
14775
15662
  PlusTable,
15663
+ PlusTableV2,
14776
15664
  PlusRadio,
14777
15665
  PlusDatePicker,
14778
15666
  PlusDescriptions,
@@ -14796,7 +15684,7 @@
14796
15684
 
14797
15685
  var installer = makeInstaller([...plugins]);
14798
15686
 
14799
- const version = "1.0.0";
15687
+ const version = "1.0.1";
14800
15688
 
14801
15689
  const install = installer.install;
14802
15690
 
@@ -14826,6 +15714,9 @@
14826
15714
  exports.PlusSidebarItem = PlusSidebarItem;
14827
15715
  exports.PlusStepsForm = PlusStepsForm;
14828
15716
  exports.PlusTable = PlusTable;
15717
+ exports.PlusTableActionBarContent = PlusTableActionBarContent;
15718
+ exports.PlusTableTitleBar = PlusTableTitleBar;
15719
+ exports.PlusTableV2 = PlusTableV2;
14829
15720
  exports.TableFormFieldRefInjectionKey = TableFormFieldRefInjectionKey;
14830
15721
  exports.TableFormRefInjectionKey = TableFormRefInjectionKey;
14831
15722
  exports.TableFormRowInfoInjectionKey = TableFormRowInfoInjectionKey;
@@ -14842,6 +15733,8 @@
14842
15733
  exports.useGetOptions = useGetOptions;
14843
15734
  exports.useLocale = useLocale;
14844
15735
  exports.useTable = useTable;
15736
+ exports.useTableColumns = useTableColumns;
15737
+ exports.useTableV2Columns = useTableV2Columns;
14845
15738
  exports.version = version;
14846
15739
 
14847
15740
  Object.defineProperty(exports, '__esModule', { value: true });