vxe-table 3.15.46 → 3.15.48

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 (171) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +16 -2
  4. package/es/locale/lang/de-DE.js +16 -2
  5. package/es/locale/lang/en-US.js +16 -2
  6. package/es/locale/lang/es-ES.js +16 -2
  7. package/es/locale/lang/fr-FR.js +16 -2
  8. package/es/locale/lang/hu-HU.js +16 -2
  9. package/es/locale/lang/hy-AM.js +16 -2
  10. package/es/locale/lang/id-ID.js +16 -2
  11. package/es/locale/lang/it-IT.js +16 -2
  12. package/es/locale/lang/ja-JP.js +16 -2
  13. package/es/locale/lang/ko-KR.js +16 -2
  14. package/es/locale/lang/ms-MY.js +16 -2
  15. package/es/locale/lang/nb-NO.js +16 -2
  16. package/es/locale/lang/pt-BR.js +16 -2
  17. package/es/locale/lang/ru-RU.js +16 -2
  18. package/es/locale/lang/th-TH.js +16 -2
  19. package/es/locale/lang/ug-CN.js +16 -2
  20. package/es/locale/lang/uk-UA.js +16 -2
  21. package/es/locale/lang/uz-UZ.js +16 -2
  22. package/es/locale/lang/vi-VN.js +16 -2
  23. package/es/locale/lang/zh-CHT.js +17 -3
  24. package/es/locale/lang/zh-CN.js +16 -2
  25. package/es/style.css +1 -1
  26. package/es/style.min.css +1 -1
  27. package/es/table/module/custom/mixin.js +20 -5
  28. package/es/table/module/custom/panel.js +36 -15
  29. package/es/table/src/body.js +8 -5
  30. package/es/table/src/cell.js +21 -13
  31. package/es/table/src/columnInfo.js +1 -0
  32. package/es/table/src/methods.js +62 -17
  33. package/es/table/src/table.js +14 -3
  34. package/es/table/style.css +5 -1
  35. package/es/table/style.min.css +1 -1
  36. package/es/ui/index.js +9 -5
  37. package/es/ui/src/log.js +1 -1
  38. package/es/vxe-table/style.css +5 -1
  39. package/es/vxe-table/style.min.css +1 -1
  40. package/lib/index.css +1 -1
  41. package/lib/index.min.css +1 -1
  42. package/lib/index.umd.js +190 -66
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/locale/lang/ar-EG.js +16 -2
  45. package/lib/locale/lang/ar-EG.min.js +1 -1
  46. package/lib/locale/lang/ar-EG.umd.js +16 -2
  47. package/lib/locale/lang/de-DE.js +16 -2
  48. package/lib/locale/lang/de-DE.min.js +1 -1
  49. package/lib/locale/lang/de-DE.umd.js +16 -2
  50. package/lib/locale/lang/en-US.js +16 -2
  51. package/lib/locale/lang/en-US.min.js +1 -1
  52. package/lib/locale/lang/en-US.umd.js +16 -2
  53. package/lib/locale/lang/es-ES.js +16 -2
  54. package/lib/locale/lang/es-ES.min.js +1 -1
  55. package/lib/locale/lang/es-ES.umd.js +16 -2
  56. package/lib/locale/lang/fr-FR.js +16 -2
  57. package/lib/locale/lang/fr-FR.min.js +1 -1
  58. package/lib/locale/lang/fr-FR.umd.js +16 -2
  59. package/lib/locale/lang/hu-HU.js +16 -2
  60. package/lib/locale/lang/hu-HU.min.js +1 -1
  61. package/lib/locale/lang/hu-HU.umd.js +16 -2
  62. package/lib/locale/lang/hy-AM.js +16 -2
  63. package/lib/locale/lang/hy-AM.min.js +1 -1
  64. package/lib/locale/lang/hy-AM.umd.js +16 -2
  65. package/lib/locale/lang/id-ID.js +16 -2
  66. package/lib/locale/lang/id-ID.min.js +1 -1
  67. package/lib/locale/lang/id-ID.umd.js +16 -2
  68. package/lib/locale/lang/it-IT.js +16 -2
  69. package/lib/locale/lang/it-IT.min.js +1 -1
  70. package/lib/locale/lang/it-IT.umd.js +16 -2
  71. package/lib/locale/lang/ja-JP.js +16 -2
  72. package/lib/locale/lang/ja-JP.min.js +1 -1
  73. package/lib/locale/lang/ja-JP.umd.js +16 -2
  74. package/lib/locale/lang/ko-KR.js +16 -2
  75. package/lib/locale/lang/ko-KR.min.js +1 -1
  76. package/lib/locale/lang/ko-KR.umd.js +16 -2
  77. package/lib/locale/lang/ms-MY.js +16 -2
  78. package/lib/locale/lang/ms-MY.min.js +1 -1
  79. package/lib/locale/lang/ms-MY.umd.js +16 -2
  80. package/lib/locale/lang/nb-NO.js +16 -2
  81. package/lib/locale/lang/nb-NO.min.js +1 -1
  82. package/lib/locale/lang/nb-NO.umd.js +16 -2
  83. package/lib/locale/lang/pt-BR.js +16 -2
  84. package/lib/locale/lang/pt-BR.min.js +1 -1
  85. package/lib/locale/lang/pt-BR.umd.js +16 -2
  86. package/lib/locale/lang/ru-RU.js +16 -2
  87. package/lib/locale/lang/ru-RU.min.js +1 -1
  88. package/lib/locale/lang/ru-RU.umd.js +16 -2
  89. package/lib/locale/lang/th-TH.js +16 -2
  90. package/lib/locale/lang/th-TH.min.js +1 -1
  91. package/lib/locale/lang/th-TH.umd.js +16 -2
  92. package/lib/locale/lang/ug-CN.js +16 -2
  93. package/lib/locale/lang/ug-CN.min.js +1 -1
  94. package/lib/locale/lang/ug-CN.umd.js +16 -2
  95. package/lib/locale/lang/uk-UA.js +16 -2
  96. package/lib/locale/lang/uk-UA.min.js +1 -1
  97. package/lib/locale/lang/uk-UA.umd.js +16 -2
  98. package/lib/locale/lang/uz-UZ.js +16 -2
  99. package/lib/locale/lang/uz-UZ.min.js +1 -1
  100. package/lib/locale/lang/uz-UZ.umd.js +16 -2
  101. package/lib/locale/lang/vi-VN.js +16 -2
  102. package/lib/locale/lang/vi-VN.min.js +1 -1
  103. package/lib/locale/lang/vi-VN.umd.js +16 -2
  104. package/lib/locale/lang/zh-CHT.js +17 -3
  105. package/lib/locale/lang/zh-CHT.min.js +1 -1
  106. package/lib/locale/lang/zh-CHT.umd.js +17 -3
  107. package/lib/locale/lang/zh-CN.js +16 -2
  108. package/lib/locale/lang/zh-CN.min.js +1 -1
  109. package/lib/locale/lang/zh-CN.umd.js +16 -2
  110. package/lib/style.css +1 -1
  111. package/lib/style.min.css +1 -1
  112. package/lib/table/module/custom/mixin.js +20 -5
  113. package/lib/table/module/custom/mixin.min.js +1 -1
  114. package/lib/table/module/custom/panel.js +34 -15
  115. package/lib/table/module/custom/panel.min.js +1 -1
  116. package/lib/table/src/body.js +8 -5
  117. package/lib/table/src/body.min.js +1 -1
  118. package/lib/table/src/cell.js +20 -11
  119. package/lib/table/src/cell.min.js +1 -1
  120. package/lib/table/src/columnInfo.js +1 -0
  121. package/lib/table/src/columnInfo.min.js +1 -1
  122. package/lib/table/src/methods.js +67 -20
  123. package/lib/table/src/methods.min.js +1 -1
  124. package/lib/table/src/table.js +14 -3
  125. package/lib/table/src/table.min.js +1 -1
  126. package/lib/table/style/style.css +5 -1
  127. package/lib/table/style/style.min.css +1 -1
  128. package/lib/ui/index.js +9 -5
  129. package/lib/ui/index.min.js +1 -1
  130. package/lib/ui/src/log.js +1 -1
  131. package/lib/ui/src/log.min.js +1 -1
  132. package/lib/vxe-table/style/style.css +5 -1
  133. package/lib/vxe-table/style/style.min.css +1 -1
  134. package/package.json +1 -1
  135. package/packages/locale/lang/ar-EG.ts +16 -2
  136. package/packages/locale/lang/de-DE.ts +16 -2
  137. package/packages/locale/lang/en-US.ts +16 -2
  138. package/packages/locale/lang/es-ES.ts +16 -2
  139. package/packages/locale/lang/fr-FR.ts +16 -2
  140. package/packages/locale/lang/hu-HU.ts +16 -2
  141. package/packages/locale/lang/hy-AM.ts +16 -2
  142. package/packages/locale/lang/id-ID.ts +16 -2
  143. package/packages/locale/lang/it-IT.ts +16 -2
  144. package/packages/locale/lang/ja-JP.ts +16 -2
  145. package/packages/locale/lang/ko-KR.ts +16 -2
  146. package/packages/locale/lang/ms-MY.ts +16 -2
  147. package/packages/locale/lang/nb-NO.ts +16 -2
  148. package/packages/locale/lang/pt-BR.ts +16 -2
  149. package/packages/locale/lang/ru-RU.ts +16 -2
  150. package/packages/locale/lang/th-TH.ts +16 -2
  151. package/packages/locale/lang/ug-CN.ts +16 -2
  152. package/packages/locale/lang/uk-UA.ts +16 -2
  153. package/packages/locale/lang/uz-UZ.ts +16 -2
  154. package/packages/locale/lang/vi-VN.ts +16 -2
  155. package/packages/locale/lang/zh-CHT.ts +17 -3
  156. package/packages/locale/lang/zh-CN.ts +16 -2
  157. package/packages/table/module/custom/mixin.ts +18 -5
  158. package/packages/table/module/custom/panel.ts +34 -14
  159. package/packages/table/src/body.ts +8 -5
  160. package/packages/table/src/cell.ts +25 -13
  161. package/packages/table/src/columnInfo.ts +1 -0
  162. package/packages/table/src/methods.ts +64 -16
  163. package/packages/table/src/table.ts +14 -3
  164. package/packages/ui/index.ts +8 -4
  165. package/styles/components/table-module/custom.scss +5 -1
  166. /package/es/{iconfont.1750651550655.ttf → iconfont.1750813664386.ttf} +0 -0
  167. /package/es/{iconfont.1750651550655.woff → iconfont.1750813664386.woff} +0 -0
  168. /package/es/{iconfont.1750651550655.woff2 → iconfont.1750813664386.woff2} +0 -0
  169. /package/lib/{iconfont.1750651550655.ttf → iconfont.1750813664386.ttf} +0 -0
  170. /package/lib/{iconfont.1750651550655.woff → iconfont.1750813664386.woff} +0 -0
  171. /package/lib/{iconfont.1750651550655.woff2 → iconfont.1750813664386.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.15.46";
2005
+ const version = "3.15.48";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2105,6 +2105,7 @@ core_.VxeUI.setConfig({
2105
2105
  // rowGroup: false,
2106
2106
  // aggFunc: false
2107
2107
  },
2108
+ // autoAggGroupValues: false,
2108
2109
  // checkMethod () {},
2109
2110
  modalOptions: {
2110
2111
  showMaximize: true,
@@ -2144,7 +2145,9 @@ core_.VxeUI.setConfig({
2144
2145
  childrenField: '_X_ROW_CHILDREN',
2145
2146
  mapChildrenField: '_X_ROW_CHILD_LIST',
2146
2147
  indent: 20,
2147
- showIcon: true
2148
+ showIcon: true,
2149
+ maxGroupSize: 4,
2150
+ showAggFuncTitle: true
2148
2151
  },
2149
2152
  treeConfig: {
2150
2153
  padding: true,
@@ -2314,9 +2317,10 @@ core_.VxeUI.setIcon({
2314
2317
  TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
2315
2318
  TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
2316
2319
  TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
2317
- TABLE_AGGREGATION_GROUPING: iconPrefix + 'grouping',
2318
- TABLE_AGGREGATION_VALUES: iconPrefix + 'values',
2319
- TABLE_AGGREGATION_DELETE: iconPrefix + 'close',
2320
+ TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
2321
+ TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
2322
+ TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
2323
+ TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
2320
2324
  // toolbar
2321
2325
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
2322
2326
  TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
@@ -2662,7 +2666,7 @@ function isNodeElement(elem) {
2662
2666
  const {
2663
2667
  log: log_log
2664
2668
  } = core_.VxeUI;
2665
- const log_version = `table v${"3.15.46"}`;
2669
+ const log_version = `table v${"3.15.48"}`;
2666
2670
  const warnLog = log_log.create('warn', log_version);
2667
2671
  const errLog = log_log.create('error', log_version);
2668
2672
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2785,6 +2789,7 @@ class ColumnInfo {
2785
2789
  halfVisible: false,
2786
2790
  defaultVisible: visible,
2787
2791
  defaultFixed: _vm.fixed,
2792
+ defaultAggFunc: _vm.aggFunc,
2788
2793
  checked: false,
2789
2794
  halfChecked: false,
2790
2795
  disabled: false,
@@ -3650,13 +3655,25 @@ function renderHeaderCellBaseVNs(h, params, content) {
3650
3655
  const vns = [renderTitlePrefixIcon(h, params), renderHeaderCellDragIcon(h, params), ...(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content]), renderTitleSuffixIcon(h, params)];
3651
3656
  return vns;
3652
3657
  }
3658
+ function getRenderDefaultColumnTitle(h, column, content) {
3659
+ if (column.type === 'html' && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(content)) {
3660
+ return h('span', {
3661
+ key: 'ch',
3662
+ domProps: {
3663
+ innerHTML: content
3664
+ }
3665
+ });
3666
+ }
3667
+ return h('span', {
3668
+ key: 'ct'
3669
+ }, getSlotVNs(content));
3670
+ }
3653
3671
  function renderTitleContent(h, params, content) {
3654
3672
  const {
3655
3673
  $table,
3656
3674
  column
3657
3675
  } = params;
3658
3676
  const {
3659
- type,
3660
3677
  showHeaderOverflow
3661
3678
  } = column;
3662
3679
  const tableProps = $table;
@@ -3664,6 +3681,9 @@ function renderTitleContent(h, params, content) {
3664
3681
  const {
3665
3682
  showHeaderOverflow: allColumnHeaderOverflow
3666
3683
  } = tableProps;
3684
+ const {
3685
+ isRowGroupStatus
3686
+ } = tableReactData;
3667
3687
  const tooltipOpts = $table.computeTooltipOpts;
3668
3688
  const showAllTip = tooltipOpts.showAll;
3669
3689
  const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
@@ -3692,16 +3712,11 @@ function renderTitleContent(h, params, content) {
3692
3712
  }
3693
3713
  };
3694
3714
  }
3695
- return [type === 'html' && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(content) ? h('span', {
3696
- class: 'vxe-cell--title',
3697
- domProps: {
3698
- innerHTML: content
3699
- },
3700
- on: ons
3701
- }) : h('span', {
3715
+ const titleVN = getRenderDefaultColumnTitle(h, column, content);
3716
+ return [h('span', {
3702
3717
  class: 'vxe-cell--title',
3703
- on: ons
3704
- }, getSlotVNs(content))];
3718
+ ...ons
3719
+ }, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles ? $table.getPivotTableAggregateRenderColTitles(h, column, titleVN) : [titleVN])];
3705
3720
  }
3706
3721
  function getFooterContent(h, params) {
3707
3722
  const {
@@ -5350,7 +5365,8 @@ function restoreCustomStorage($xeTable) {
5350
5365
  const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
5351
5366
  const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
5352
5367
  const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
5353
- if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
5368
+ const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
5369
+ if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
5354
5370
  if (!tableId) {
5355
5371
  errLog('vxe.error.reqProp', ['id']);
5356
5372
  return;
@@ -8275,7 +8291,21 @@ function handleRecalculateLayout($xeTable, reFull) {
8275
8291
  }
8276
8292
  });
8277
8293
  }
8278
- const handleUpdateRowGroup = ($xeTable, groupFields) => {
8294
+ function handleUpdateAggValues($xeTable) {
8295
+ const reactData = $xeTable;
8296
+ const internalData = $xeTable;
8297
+ const {
8298
+ visibleColumn
8299
+ } = internalData;
8300
+ const aggCols = [];
8301
+ visibleColumn.forEach(column => {
8302
+ if (column.aggFunc) {
8303
+ aggCols.push(column);
8304
+ }
8305
+ });
8306
+ reactData.aggHandleAggColumns = aggCols;
8307
+ }
8308
+ function handleUpdateRowGroup($xeTable, groupFields) {
8279
8309
  const reactData = $xeTable;
8280
8310
  const aggFields = [];
8281
8311
  const aggConfs = [];
@@ -8289,7 +8319,8 @@ const handleUpdateRowGroup = ($xeTable, groupFields) => {
8289
8319
  }
8290
8320
  reactData.rowGroupList = aggConfs;
8291
8321
  reactData.aggHandleFields = aggFields;
8292
- };
8322
+ handleUpdateAggValues($xeTable);
8323
+ }
8293
8324
  function handleeGroupSummary($xeTable, aggList) {
8294
8325
  const aggregateOpts = $xeTable.computeAggregateOpts;
8295
8326
  const {
@@ -8843,6 +8874,7 @@ function parseColumns($xeTable, isReset) {
8843
8874
  }
8844
8875
  });
8845
8876
  handleTableColumn($xeTable);
8877
+ handleUpdateAggValues($xeTable);
8846
8878
  if (isReset) {
8847
8879
  return $xeTable.updateFooter().then(() => {
8848
8880
  return $xeTable.recalculate();
@@ -10964,15 +10996,18 @@ const Methods = {
10964
10996
  const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
10965
10997
  const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
10966
10998
  const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
10999
+ const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
10967
11000
  const resizableData = {};
10968
11001
  const sortData = {};
10969
11002
  const visibleData = {};
10970
11003
  const fixedData = {};
11004
+ const aggFuncData = {};
10971
11005
  const storeData = {
10972
11006
  resizableData: undefined,
10973
11007
  sortData: undefined,
10974
11008
  visibleData: undefined,
10975
- fixedData: undefined
11009
+ fixedData: undefined,
11010
+ aggFuncData: undefined
10976
11011
  };
10977
11012
  if (!id) {
10978
11013
  if (storage) {
@@ -10984,6 +11019,7 @@ const Methods = {
10984
11019
  let hasSort = 0;
10985
11020
  let hasFixed = 0;
10986
11021
  let hasVisible = 0;
11022
+ let hasAggFunc = 0;
10987
11023
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
10988
11024
  const colKey = column.getKey();
10989
11025
  if (!colKey) {
@@ -11017,6 +11053,10 @@ const Methods = {
11017
11053
  visibleData[colKey] = true;
11018
11054
  }
11019
11055
  }
11056
+ if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
11057
+ hasAggFunc = 1;
11058
+ aggFuncData[colKey] = column.aggFunc;
11059
+ }
11020
11060
  });
11021
11061
  if (hasResizable) {
11022
11062
  storeData.resizableData = resizableData;
@@ -11030,6 +11070,9 @@ const Methods = {
11030
11070
  if (hasVisible) {
11031
11071
  storeData.visibleData = visibleData;
11032
11072
  }
11073
+ if (hasAggFunc) {
11074
+ storeData.aggFuncData = aggFuncData;
11075
+ }
11033
11076
  return storeData;
11034
11077
  },
11035
11078
  saveCustomStore(type) {
@@ -11043,18 +11086,20 @@ const Methods = {
11043
11086
  const customOpts = $xeTable.computeCustomOpts;
11044
11087
  const {
11045
11088
  updateStore,
11046
- storage
11089
+ storage,
11090
+ storeOptions
11047
11091
  } = customOpts;
11048
11092
  const isAllCustom = storage === true;
11049
- const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
11050
- const isCustomResizable = isAllCustom || storageOpts.resizable;
11051
- const isCustomVisible = isAllCustom || storageOpts.visible;
11052
- const isCustomFixed = isAllCustom || storageOpts.fixed;
11053
- const isCustomSort = isAllCustom || storageOpts.sort;
11093
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {}, storeOptions);
11094
+ const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
11095
+ const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
11096
+ const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
11097
+ const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
11098
+ const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
11054
11099
  if (type !== 'reset') {
11055
11100
  reactData.isCustomStatus = true;
11056
11101
  }
11057
- if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
11102
+ if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
11058
11103
  if (!tableId) {
11059
11104
  errLog('vxe.error.reqProp', ['id']);
11060
11105
  return this.$nextTick();
@@ -11835,12 +11880,10 @@ const Methods = {
11835
11880
  const {
11836
11881
  actived
11837
11882
  } = editStore;
11838
- const {
11839
- customWrapper,
11840
- refValidTooltip
11841
- } = $refs;
11842
11883
  const tableFilter = $refs.refTableFilter;
11843
11884
  const tableMenu = $refs.refTableMenu;
11885
+ const tableCustom = $refs.refTableCustom;
11886
+ const validTooltip = $refs.refValidTooltip;
11844
11887
  // 筛选
11845
11888
  if (tableFilter) {
11846
11889
  if (getEventTargetNode(evnt, $el, 'vxe-cell--filter').flag) {
@@ -11854,10 +11897,10 @@ const Methods = {
11854
11897
  }
11855
11898
  }
11856
11899
  // 自定义列
11857
- if (customWrapper) {
11900
+ if (tableCustom) {
11858
11901
  if (customStore.btnEl === evnt.target || getEventTargetNode(evnt, document.body, 'vxe-toolbar-custom-target').flag) {
11859
11902
  // 如果点击了自定义列按钮
11860
- } else if (getEventTargetNode(evnt, customWrapper.$el).flag) {
11903
+ } else if (getEventTargetNode(evnt, tableCustom.$el).flag) {
11861
11904
  // 如果点击自定义列容器
11862
11905
  } else {
11863
11906
  if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
@@ -11871,7 +11914,7 @@ const Methods = {
11871
11914
  // 如果是激活状态,点击了单元格之外
11872
11915
  const cell = actived.args.cell;
11873
11916
  if (!cell || !getEventTargetNode(evnt, cell).flag) {
11874
- if (refValidTooltip && getEventTargetNode(evnt, refValidTooltip.$el).flag) {
11917
+ if (validTooltip && getEventTargetNode(evnt, validTooltip.$el).flag) {
11875
11918
  // 如果是激活状态,且点击了校验提示框
11876
11919
  } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
11877
11920
  if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
@@ -15530,12 +15573,26 @@ const Methods = {
15530
15573
  aggregateConfig,
15531
15574
  rowGroupConfig
15532
15575
  } = props;
15576
+ const aggregateOpts = $xeTable.computeAggregateOpts;
15577
+ const {
15578
+ maxGroupSize
15579
+ } = aggregateOpts;
15533
15580
  if (!(aggregateConfig || rowGroupConfig)) {
15534
15581
  errLog('vxe.error.reqProp', ['aggregate-config']);
15535
15582
  return $xeTable.$nextTick();
15536
15583
  }
15537
- if (fieldOrColumns) {
15538
- handleUpdateRowGroup($xeTable, (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns) ? fieldOrColumns : [fieldOrColumns]).map(fieldOrColumn => {
15584
+ const confList = fieldOrColumns ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns) ? fieldOrColumns : [fieldOrColumns] : [];
15585
+ if (maxGroupSize && confList.length > maxGroupSize) {
15586
+ if (core_.VxeUI.modal) {
15587
+ core_.VxeUI.modal.message({
15588
+ status: 'error',
15589
+ content: methods_getI18n('vxe.table.maxGroupCol', [maxGroupSize])
15590
+ });
15591
+ }
15592
+ return $xeTable.$nextTick();
15593
+ }
15594
+ if (confList.length) {
15595
+ handleUpdateRowGroup($xeTable, confList.map(fieldOrColumn => {
15539
15596
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field;
15540
15597
  }));
15541
15598
  return loadTableData($xeTable, internalData.tableSynchData, true);
@@ -17121,6 +17178,11 @@ const Methods = {
17121
17178
  return updateStyle($xeTable);
17122
17179
  });
17123
17180
  },
17181
+ handleUpdateAggData() {
17182
+ const $xeTable = this;
17183
+ const internalData = $xeTable;
17184
+ return loadTableData($xeTable, internalData.tableSynchData, true);
17185
+ },
17124
17186
  updateZindex() {
17125
17187
  if (this.zIndex) {
17126
17188
  this.tZindex = this.zIndex;
@@ -17509,6 +17571,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17509
17571
  $xeTable.triggerCellDblclickEvent(evnt, cellParams);
17510
17572
  };
17511
17573
  let isMergeCell = false;
17574
+ let mergeColspan = 1;
17512
17575
  let mergeRowspan = 1;
17513
17576
  // 合并行或列
17514
17577
  if (mergeBodyFlag && mergeBodyList.length) {
@@ -17528,6 +17591,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17528
17591
  }
17529
17592
  if (colspan > 1) {
17530
17593
  isMergeCell = true;
17594
+ mergeColspan = colspan;
17531
17595
  tdAttrs.colspan = colspan;
17532
17596
  }
17533
17597
  }
@@ -17547,6 +17611,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17547
17611
  }
17548
17612
  if (colspan > 1) {
17549
17613
  isMergeCell = true;
17614
+ mergeColspan = colspan;
17550
17615
  tdAttrs.colspan = colspan;
17551
17616
  }
17552
17617
  }
@@ -17585,16 +17650,16 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17585
17650
  }
17586
17651
  const tcStyle = {};
17587
17652
  if (hasEllipsis && resizeWidthFlag) {
17588
- let tsColspan = tdAttrs.colspan || 0;
17589
- if (tsColspan > 1) {
17590
- for (let index = 1; index < tsColspan; index++) {
17653
+ let mergeColWidth = 0;
17654
+ if (mergeColspan > 1) {
17655
+ for (let index = 1; index < mergeColspan; index++) {
17591
17656
  const nextColumn = visibleColumn[columnIndex + index];
17592
17657
  if (nextColumn) {
17593
- tsColspan += nextColumn.renderWidth;
17658
+ mergeColWidth += nextColumn.renderWidth;
17594
17659
  }
17595
17660
  }
17596
17661
  }
17597
- tcStyle.width = `${column.renderWidth - cellOffsetWidth * tsColspan}px`;
17662
+ tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`;
17598
17663
  }
17599
17664
  if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
17600
17665
  tcStyle.height = `${cellHeight}px`;
@@ -19484,8 +19549,8 @@ function panel_showDropTip($xeTableCustomPanel, evnt, optEl, showLine, dragPos)
19484
19549
  } = customPanelInternalData;
19485
19550
  const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
19486
19551
  const customBodyRect = customBodyElem.getBoundingClientRect();
19552
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
19487
19553
  if (optEl) {
19488
- const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem;
19489
19554
  if (dragLineEl) {
19490
19555
  if (showLine) {
19491
19556
  const optRect = optEl.getBoundingClientRect();
@@ -19500,6 +19565,10 @@ function panel_showDropTip($xeTableCustomPanel, evnt, optEl, showLine, dragPos)
19500
19565
  dragLineEl.style.display = '';
19501
19566
  }
19502
19567
  }
19568
+ } else {
19569
+ if (dragLineEl) {
19570
+ dragLineEl.style.display = 'node';
19571
+ }
19503
19572
  }
19504
19573
  const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem;
19505
19574
  if (dragTipEl) {
@@ -19736,7 +19805,7 @@ const renderSimplePanel = (h, _vm) => {
19736
19805
  } : {}
19737
19806
  }, customStore.visible ? [h('div', {
19738
19807
  ref: 'refBodyWrapperElem',
19739
- class: 'vxe-table-custom-body-wrapper'
19808
+ class: 'vxe-table-custom-simple--body-wrapper'
19740
19809
  }, [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? h($xeTable.getPivotTableAggregateSimplePanel(), {
19741
19810
  props: {
19742
19811
  customStore
@@ -19837,6 +19906,9 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
19837
19906
  customStore
19838
19907
  } = props;
19839
19908
  const {
19909
+ treeConfig,
19910
+ rowGroupConfig,
19911
+ aggregateConfig,
19840
19912
  resizable: allResizable
19841
19913
  } = tableProps;
19842
19914
  const {
@@ -20083,7 +20155,11 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20083
20155
  }
20084
20156
  }, trVNs)])]), bottomSlot ? h('div', {
20085
20157
  class: 'vxe-table-custom-popup--table-bottom'
20086
- }, $xeTable.callSlot(bottomSlot, params, h)) : panel_renderEmptyElement($xeTable), renderDragTip(h, _vm)])]);
20158
+ }, $xeTable.callSlot(bottomSlot, params, h)) : panel_renderEmptyElement($xeTable), renderDragTip(h, _vm)]), !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
20159
+ props: {
20160
+ customStore
20161
+ }
20162
+ }) : panel_renderEmptyElement($xeTable)]);
20087
20163
  },
20088
20164
  footer: () => {
20089
20165
  if (footerSlot) {
@@ -20201,12 +20277,14 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20201
20277
  data() {
20202
20278
  const reactData = {
20203
20279
  dragCol: null,
20280
+ dragGroupField: null,
20281
+ dragAggFnCol: null,
20204
20282
  dragTipText: ''
20205
20283
  };
20206
20284
  const internalData = {
20207
20285
  // prevDragCol: undefined,
20208
- // prevDragGroup: undefined,
20209
- // prevDragValues: undefined,
20286
+ // prevDragGroupField: undefined,
20287
+ // prevDragAggFnColid: undefined,
20210
20288
  // prevDragToChild: false,
20211
20289
  // prevDragPos: null
20212
20290
  };
@@ -20492,6 +20570,8 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20492
20570
  const column = $xeTable.getColumnById(colid);
20493
20571
  trEl.draggable = true;
20494
20572
  customPanelReactData.dragCol = column;
20573
+ customPanelReactData.dragGroupField = null;
20574
+ customPanelReactData.dragAggFnCol = null;
20495
20575
  this.updateColDropTipContent();
20496
20576
  addClass(trEl, 'active--drag-origin');
20497
20577
  },
@@ -20505,6 +20585,8 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20505
20585
  panel_hideDropTip($xeTableCustomPanel);
20506
20586
  trEl.draggable = false;
20507
20587
  customPanelReactData.dragCol = null;
20588
+ customPanelReactData.dragGroupField = null;
20589
+ customPanelReactData.dragAggFnCol = null;
20508
20590
  removeClass(trEl, 'active--drag-origin');
20509
20591
  },
20510
20592
  sortDragstartEvent(evnt) {
@@ -20513,8 +20595,8 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20513
20595
  if (evnt.dataTransfer) {
20514
20596
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
20515
20597
  }
20516
- customPanelInternalData.prevDragGroup = null;
20517
- customPanelInternalData.prevDragValues = null;
20598
+ customPanelInternalData.prevDragGroupField = null;
20599
+ customPanelInternalData.prevDragAggFnColid = null;
20518
20600
  },
20519
20601
  sortDragendEvent(evnt) {
20520
20602
  const $xeTableCustomPanel = this;
@@ -20550,13 +20632,13 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20550
20632
  } = customPanelReactData;
20551
20633
  const {
20552
20634
  prevDragCol,
20553
- prevDragGroup,
20554
- prevDragValues,
20635
+ prevDragGroupField,
20636
+ prevDragAggFnColid,
20555
20637
  prevDragPos,
20556
20638
  prevDragToChild
20557
20639
  } = customPanelInternalData;
20558
20640
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
20559
- if (prevDragGroup || prevDragValues) {
20641
+ if (prevDragGroupField || prevDragAggFnColid) {
20560
20642
  if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
20561
20643
  $xeTable.handlePivotTableAggregatePanelDragendEvent(evnt);
20562
20644
  }
@@ -20716,8 +20798,10 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20716
20798
  }
20717
20799
  panel_hideDropTip($xeTableCustomPanel);
20718
20800
  customPanelReactData.dragCol = null;
20719
- customPanelInternalData.prevDragGroup = null;
20720
- customPanelInternalData.prevDragValues = null;
20801
+ customPanelReactData.dragGroupField = null;
20802
+ customPanelReactData.dragAggFnCol = null;
20803
+ customPanelInternalData.prevDragGroupField = null;
20804
+ customPanelInternalData.prevDragAggFnColid = null;
20721
20805
  trEl.draggable = false;
20722
20806
  trEl.removeAttribute('drag-pos');
20723
20807
  removeClass(trEl, 'active--drag-target');
@@ -20744,14 +20828,14 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20744
20828
  const isControlKey = hasControlKey(evnt);
20745
20829
  const colid = optEl.getAttribute('colid');
20746
20830
  const column = $xeTable.getColumnById(colid);
20747
- customPanelInternalData.prevDragGroup = null;
20748
- customPanelInternalData.prevDragValues = null;
20831
+ customPanelInternalData.prevDragGroupField = null;
20832
+ customPanelInternalData.prevDragAggFnColid = null;
20749
20833
  // 是否移入有效列
20750
20834
  if (column && (isCrossDrag || column.level === 1)) {
20751
20835
  evnt.preventDefault();
20752
20836
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
20753
20837
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
20754
- if (dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1 || column.renderFixed) {
20838
+ if (!dragCol || dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1 || column.renderFixed) {
20755
20839
  panel_showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos);
20756
20840
  return;
20757
20841
  }
@@ -27155,7 +27239,9 @@ function emitCustomEvent($xeTable, type, evnt) {
27155
27239
  allowVisible,
27156
27240
  allowSort,
27157
27241
  allowFixed,
27158
- allowResizable
27242
+ allowResizable,
27243
+ allowGroup,
27244
+ allowValues
27159
27245
  } = customOpts;
27160
27246
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parentColumn) => {
27161
27247
  if (parentColumn) {
@@ -27181,6 +27267,9 @@ function emitCustomEvent($xeTable, type, evnt) {
27181
27267
  if (allowVisible) {
27182
27268
  column.visible = column.renderVisible;
27183
27269
  }
27270
+ if (allowGroup && allowValues) {
27271
+ column.aggFunc = column.renderAggFn;
27272
+ }
27184
27273
  });
27185
27274
  reactData.isCustomStatus = true;
27186
27275
  reactData.isDragColMove = true;
@@ -27188,14 +27277,17 @@ function emitCustomEvent($xeTable, type, evnt) {
27188
27277
  reactData.isDragColMove = false;
27189
27278
  }, 1000);
27190
27279
  return $xeTable.saveCustomStore('confirm').then(() => {
27191
- if ($xeTable.handlePivotTableAggregateData) {
27280
+ if (allowGroup && allowValues && $xeTable.handlePivotTableAggregateData) {
27192
27281
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
27193
- // 改动聚合分组
27282
+ // 更新数据分组
27194
27283
  if (aggHandleFields.length) {
27195
27284
  $xeTable.setRowGroups(aggHandleFields);
27196
27285
  } else {
27197
27286
  $xeTable.clearRowGroups();
27198
27287
  }
27288
+ } else {
27289
+ // 更新聚合函数
27290
+ $xeTable.handleUpdateAggData();
27199
27291
  }
27200
27292
  }
27201
27293
  });
@@ -27260,7 +27352,8 @@ function emitCustomEvent($xeTable, type, evnt) {
27260
27352
  visible: true,
27261
27353
  resizable: options === true,
27262
27354
  fixed: options === true,
27263
- sort: options === true
27355
+ sort: options === true,
27356
+ aggFunc: options === true
27264
27357
  }, options);
27265
27358
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
27266
27359
  if (opts.resizable) {
@@ -27278,12 +27371,16 @@ function emitCustomEvent($xeTable, type, evnt) {
27278
27371
  })) {
27279
27372
  column.visible = column.defaultVisible;
27280
27373
  }
27374
+ if (opts.aggFunc) {
27375
+ column.aggFunc = column.defaultAggFunc;
27376
+ column.renderAggFn = column.defaultAggFunc;
27377
+ }
27281
27378
  column.renderResizeWidth = column.renderWidth;
27282
27379
  });
27283
27380
  reactData.isCustomStatus = false;
27284
27381
  $xeTable.saveCustomStore('reset');
27285
27382
  return $xeTable.handleCustom().then(() => {
27286
- if ($xeTable.handlePivotTableAggregateData) {
27383
+ if (opts.aggFunc && $xeTable.handlePivotTableAggregateData) {
27287
27384
  const rowGroupFields = $xeTable.computeRowGroupFields;
27288
27385
  if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
27289
27386
  if (rowGroupFields && rowGroupFields.length) {
@@ -27291,6 +27388,8 @@ function emitCustomEvent($xeTable, type, evnt) {
27291
27388
  } else {
27292
27389
  $xeTable.clearRowGroups();
27293
27390
  }
27391
+ } else {
27392
+ $xeTable.handleUpdateAggData();
27294
27393
  }
27295
27394
  }
27296
27395
  });
@@ -28106,6 +28205,7 @@ function renderBody(h, $xeTable) {
28106
28205
  isRowGroupStatus: false,
28107
28206
  rowGroupList: [],
28108
28207
  aggHandleFields: [],
28208
+ aggHandleAggColumns: [],
28109
28209
  rowGroupExpandedFlag: 1,
28110
28210
  rowExpandedFlag: 1,
28111
28211
  treeExpandedFlag: 1,
@@ -29122,6 +29222,16 @@ function renderBody(h, $xeTable) {
29122
29222
  return;
29123
29223
  }
29124
29224
  }
29225
+ if (!$xeTable.handlePivotTableAggregateData) {
29226
+ if (customOpts.allowGroup) {
29227
+ errLog('vxe.error.notProp', ['custom-config.allowGroup']);
29228
+ return;
29229
+ }
29230
+ if (customOpts.allowValues) {
29231
+ errLog('vxe.error.notProp', ['custom-config.allowValues']);
29232
+ return;
29233
+ }
29234
+ }
29125
29235
  if (treeConfig && rowOpts.drag && !treeOpts.transform) {
29126
29236
  warnLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true']);
29127
29237
  }
@@ -29134,8 +29244,8 @@ function renderBody(h, $xeTable) {
29134
29244
  if (aggregateOpts.countFields) {
29135
29245
  warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func']);
29136
29246
  }
29137
- if (aggregateOpts.countMethod) {
29138
- warnLog('vxe.error.delProp', ['row-group-config.countMethod', 'aggregate-config.aggregateMethod']);
29247
+ if (aggregateOpts.aggregateMethod) {
29248
+ warnLog('vxe.error.delProp', ['row-group-config.aggregateMethod', 'aggregate-config.countMethod']);
29139
29249
  }
29140
29250
  if (props.treeConfig && treeOpts.children) {
29141
29251
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
@@ -29544,7 +29654,7 @@ function renderBody(h, $xeTable) {
29544
29654
  */
29545
29655
  initStore.custom ? h(panel, {
29546
29656
  key: 'cs',
29547
- ref: 'customWrapper',
29657
+ ref: 'refTableCustom',
29548
29658
  props: {
29549
29659
  customStore
29550
29660
  }
@@ -33651,6 +33761,7 @@ const Toolbar = VxeToolbar;
33651
33761
  customCancel: '取消',
33652
33762
  customRestore: '恢复默认',
33653
33763
  maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
33764
+ maxGroupCol: '最大分组字段的数量不能超过 {0} 个',
33654
33765
  dragTip: '移动:{0}',
33655
33766
  resizeColTip: '宽:{0} 像素',
33656
33767
  resizeRowTip: '高:{0} 像素',
@@ -33709,7 +33820,7 @@ const Toolbar = VxeToolbar;
33709
33820
  cstmDragTarget: '移动:{0}',
33710
33821
  setting: {
33711
33822
  colSort: '排序',
33712
- sortHelpTip: '点击并拖动图标可以调整列的排序',
33823
+ sortHelpTip: '点击并拖动图标可以调整顺序',
33713
33824
  colTitle: '列标题',
33714
33825
  colResizable: '列宽(像素)',
33715
33826
  colVisible: '是否显示',
@@ -34133,7 +34244,20 @@ const Toolbar = VxeToolbar;
34133
34244
  extendPivotTable: {
34134
34245
  aggregation: {
34135
34246
  grouping: '分组',
34136
- values: '值'
34247
+ values: '值',
34248
+ groupPlaceholder: '拖至此处进行分组',
34249
+ valuesPlaceholder: '拖至此处进行聚合',
34250
+ dragExistCol: '该列已存在',
34251
+ sortHelpTip: '点击并拖动图标可以调整顺序'
34252
+ },
34253
+ aggFuncs: {
34254
+ sum: '求和',
34255
+ count: '计数',
34256
+ avg: '平均值',
34257
+ min: '最小值',
34258
+ max: '最大值',
34259
+ first: '首个值',
34260
+ last: '末尾值'
34137
34261
  }
34138
34262
  },
34139
34263
  filterComplexInput: {