vxe-table 3.21.0 → 3.21.2

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 +6 -4
  4. package/es/locale/lang/de-DE.js +6 -4
  5. package/es/locale/lang/en-US.js +6 -4
  6. package/es/locale/lang/es-ES.js +6 -4
  7. package/es/locale/lang/fr-FR.js +6 -4
  8. package/es/locale/lang/hu-HU.js +6 -4
  9. package/es/locale/lang/hy-AM.js +6 -4
  10. package/es/locale/lang/id-ID.js +6 -4
  11. package/es/locale/lang/it-IT.js +6 -4
  12. package/es/locale/lang/ja-JP.js +6 -4
  13. package/es/locale/lang/ko-KR.js +6 -4
  14. package/es/locale/lang/ms-MY.js +6 -4
  15. package/es/locale/lang/nb-NO.js +6 -4
  16. package/es/locale/lang/pt-BR.js +6 -4
  17. package/es/locale/lang/ru-RU.js +6 -4
  18. package/es/locale/lang/th-TH.js +6 -4
  19. package/es/locale/lang/ug-CN.js +6 -4
  20. package/es/locale/lang/uk-UA.js +6 -4
  21. package/es/locale/lang/uz-UZ.js +6 -4
  22. package/es/locale/lang/vi-VN.js +6 -4
  23. package/es/locale/lang/zh-CHT.js +6 -4
  24. package/es/locale/lang/zh-CN.js +6 -4
  25. package/es/style.css +1 -1
  26. package/es/style.min.css +1 -1
  27. package/es/table/module/custom/panel.js +45 -32
  28. package/es/table/module/menu/mixin.js +3 -2
  29. package/es/table/module/validator/mixin.js +4 -4
  30. package/es/table/src/cell.js +1 -1
  31. package/es/table/src/column.js +2 -0
  32. package/es/table/src/columnInfo.js +1 -0
  33. package/es/table/src/table.js +1 -1
  34. package/es/table/style.css +4 -1
  35. package/es/table/style.min.css +1 -1
  36. package/es/ui/index.js +2 -1
  37. package/es/ui/src/log.js +1 -1
  38. package/es/vxe-table/style.css +4 -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 +48 -30
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/locale/lang/ar-EG.js +6 -4
  45. package/lib/locale/lang/ar-EG.min.js +1 -1
  46. package/lib/locale/lang/ar-EG.umd.js +6 -4
  47. package/lib/locale/lang/de-DE.js +6 -4
  48. package/lib/locale/lang/de-DE.min.js +1 -1
  49. package/lib/locale/lang/de-DE.umd.js +6 -4
  50. package/lib/locale/lang/en-US.js +6 -4
  51. package/lib/locale/lang/en-US.min.js +1 -1
  52. package/lib/locale/lang/en-US.umd.js +6 -4
  53. package/lib/locale/lang/es-ES.js +6 -4
  54. package/lib/locale/lang/es-ES.min.js +1 -1
  55. package/lib/locale/lang/es-ES.umd.js +6 -4
  56. package/lib/locale/lang/fr-FR.js +6 -4
  57. package/lib/locale/lang/fr-FR.min.js +1 -1
  58. package/lib/locale/lang/fr-FR.umd.js +6 -4
  59. package/lib/locale/lang/hu-HU.js +6 -4
  60. package/lib/locale/lang/hu-HU.min.js +1 -1
  61. package/lib/locale/lang/hu-HU.umd.js +6 -4
  62. package/lib/locale/lang/hy-AM.js +6 -4
  63. package/lib/locale/lang/hy-AM.min.js +1 -1
  64. package/lib/locale/lang/hy-AM.umd.js +6 -4
  65. package/lib/locale/lang/id-ID.js +6 -4
  66. package/lib/locale/lang/id-ID.min.js +1 -1
  67. package/lib/locale/lang/id-ID.umd.js +6 -4
  68. package/lib/locale/lang/it-IT.js +6 -4
  69. package/lib/locale/lang/it-IT.min.js +1 -1
  70. package/lib/locale/lang/it-IT.umd.js +6 -4
  71. package/lib/locale/lang/ja-JP.js +6 -4
  72. package/lib/locale/lang/ja-JP.min.js +1 -1
  73. package/lib/locale/lang/ja-JP.umd.js +6 -4
  74. package/lib/locale/lang/ko-KR.js +6 -4
  75. package/lib/locale/lang/ko-KR.min.js +1 -1
  76. package/lib/locale/lang/ko-KR.umd.js +6 -4
  77. package/lib/locale/lang/ms-MY.js +6 -4
  78. package/lib/locale/lang/ms-MY.min.js +1 -1
  79. package/lib/locale/lang/ms-MY.umd.js +6 -4
  80. package/lib/locale/lang/nb-NO.js +6 -4
  81. package/lib/locale/lang/nb-NO.min.js +1 -1
  82. package/lib/locale/lang/nb-NO.umd.js +6 -4
  83. package/lib/locale/lang/pt-BR.js +6 -4
  84. package/lib/locale/lang/pt-BR.min.js +1 -1
  85. package/lib/locale/lang/pt-BR.umd.js +6 -4
  86. package/lib/locale/lang/ru-RU.js +6 -4
  87. package/lib/locale/lang/ru-RU.min.js +1 -1
  88. package/lib/locale/lang/ru-RU.umd.js +6 -4
  89. package/lib/locale/lang/th-TH.js +6 -4
  90. package/lib/locale/lang/th-TH.min.js +1 -1
  91. package/lib/locale/lang/th-TH.umd.js +6 -4
  92. package/lib/locale/lang/ug-CN.js +6 -4
  93. package/lib/locale/lang/ug-CN.min.js +1 -1
  94. package/lib/locale/lang/ug-CN.umd.js +6 -4
  95. package/lib/locale/lang/uk-UA.js +6 -4
  96. package/lib/locale/lang/uk-UA.min.js +1 -1
  97. package/lib/locale/lang/uk-UA.umd.js +6 -4
  98. package/lib/locale/lang/uz-UZ.js +6 -4
  99. package/lib/locale/lang/uz-UZ.min.js +1 -1
  100. package/lib/locale/lang/uz-UZ.umd.js +6 -4
  101. package/lib/locale/lang/vi-VN.js +6 -4
  102. package/lib/locale/lang/vi-VN.min.js +1 -1
  103. package/lib/locale/lang/vi-VN.umd.js +6 -4
  104. package/lib/locale/lang/zh-CHT.js +6 -4
  105. package/lib/locale/lang/zh-CHT.min.js +1 -1
  106. package/lib/locale/lang/zh-CHT.umd.js +6 -4
  107. package/lib/locale/lang/zh-CN.js +6 -4
  108. package/lib/locale/lang/zh-CN.min.js +1 -1
  109. package/lib/locale/lang/zh-CN.umd.js +6 -4
  110. package/lib/style.css +1 -1
  111. package/lib/style.min.css +1 -1
  112. package/lib/table/module/custom/panel.js +27 -16
  113. package/lib/table/module/custom/panel.min.js +1 -1
  114. package/lib/table/module/menu/mixin.js +3 -2
  115. package/lib/table/module/menu/mixin.min.js +1 -1
  116. package/lib/table/module/validator/mixin.js +4 -4
  117. package/lib/table/module/validator/mixin.min.js +1 -1
  118. package/lib/table/src/cell.js +1 -1
  119. package/lib/table/src/cell.min.js +1 -1
  120. package/lib/table/src/column.js +2 -0
  121. package/lib/table/src/column.min.js +1 -1
  122. package/lib/table/src/columnInfo.js +1 -0
  123. package/lib/table/src/columnInfo.min.js +1 -1
  124. package/lib/table/src/table.js +1 -1
  125. package/lib/table/src/table.min.js +1 -1
  126. package/lib/table/style/style.css +4 -1
  127. package/lib/table/style/style.min.css +1 -1
  128. package/lib/ui/index.js +2 -1
  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 +4 -1
  133. package/lib/vxe-table/style/style.min.css +1 -1
  134. package/package.json +2 -2
  135. package/packages/locale/lang/ar-EG.ts +6 -4
  136. package/packages/locale/lang/de-DE.ts +6 -4
  137. package/packages/locale/lang/en-US.ts +6 -4
  138. package/packages/locale/lang/es-ES.ts +6 -4
  139. package/packages/locale/lang/fr-FR.ts +6 -4
  140. package/packages/locale/lang/hu-HU.ts +6 -4
  141. package/packages/locale/lang/hy-AM.ts +6 -4
  142. package/packages/locale/lang/id-ID.ts +6 -4
  143. package/packages/locale/lang/it-IT.ts +6 -4
  144. package/packages/locale/lang/ja-JP.ts +6 -4
  145. package/packages/locale/lang/ko-KR.ts +6 -4
  146. package/packages/locale/lang/ms-MY.ts +6 -4
  147. package/packages/locale/lang/nb-NO.ts +6 -4
  148. package/packages/locale/lang/pt-BR.ts +6 -4
  149. package/packages/locale/lang/ru-RU.ts +6 -4
  150. package/packages/locale/lang/th-TH.ts +6 -4
  151. package/packages/locale/lang/ug-CN.ts +6 -4
  152. package/packages/locale/lang/uk-UA.ts +6 -4
  153. package/packages/locale/lang/uz-UZ.ts +6 -4
  154. package/packages/locale/lang/vi-VN.ts +6 -4
  155. package/packages/locale/lang/zh-CHT.ts +6 -4
  156. package/packages/locale/lang/zh-CN.ts +6 -4
  157. package/packages/table/module/custom/panel.ts +71 -54
  158. package/packages/table/module/menu/mixin.ts +3 -2
  159. package/packages/table/module/validator/mixin.ts +4 -4
  160. package/packages/table/src/cell.ts +1 -1
  161. package/packages/table/src/column.ts +2 -0
  162. package/packages/table/src/columnInfo.ts +1 -0
  163. package/packages/table/src/table.ts +1 -1
  164. package/packages/ui/index.ts +1 -0
  165. package/styles/components/table-module/custom.scss +5 -1
  166. /package/es/{iconfont.1779330830416.ttf → iconfont.1779778409753.ttf} +0 -0
  167. /package/es/{iconfont.1779330830416.woff → iconfont.1779778409753.woff} +0 -0
  168. /package/es/{iconfont.1779330830416.woff2 → iconfont.1779778409753.woff2} +0 -0
  169. /package/lib/{iconfont.1779330830416.ttf → iconfont.1779778409753.ttf} +0 -0
  170. /package/lib/{iconfont.1779330830416.woff → iconfont.1779778409753.woff} +0 -0
  171. /package/lib/{iconfont.1779330830416.woff2 → iconfont.1779778409753.woff2} +0 -0
@@ -574,7 +574,7 @@ export default {
574
574
  const customPanelInternalData = $xeTableCustomPanel.internalData;
575
575
  const { dragCol } = customPanelReactData;
576
576
  const customOpts = $xeTable.computeCustomOpts;
577
- const { immediate } = customOpts;
577
+ const { showSortDragButton, allowSort, immediate } = customOpts;
578
578
  const columnDragOpts = $xeTable.computeColumnDragOpts;
579
579
  const { isCrossDrag, isToChildDrag } = columnDragOpts;
580
580
  const optEl = evnt.currentTarget;
@@ -589,9 +589,12 @@ export default {
589
589
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
590
590
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
591
591
  if (!dragCol ||
592
+ !(showSortDragButton && allowSort) ||
592
593
  (dragCol && dragCol.id === column.id) ||
593
594
  (!isCrossDrag && column.level > 1) ||
594
- (!immediate && column.level > 1)) {
595
+ (!immediate && column.level > 1) ||
596
+ (!isCrossDrag && dragCol.level > 1) ||
597
+ (!immediate && dragCol.level > 1)) {
595
598
  showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos);
596
599
  return;
597
600
  }
@@ -744,10 +747,9 @@ export default {
744
747
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
745
748
  const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData;
746
749
  const customOpts = $xeTable.computeCustomOpts;
747
- const { immediate } = customOpts;
748
750
  const columnDragOpts = $xeTable.computeColumnDragOpts;
749
751
  const { popupStyle } = customStore;
750
- const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
752
+ const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
751
753
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
752
754
  const vSize = $xeTable.computeSize;
753
755
  const { isCrossDrag } = columnDragOpts;
@@ -826,29 +828,31 @@ export default {
826
828
  h('div', {
827
829
  class: 'vxe-table-custom--name-option'
828
830
  }, [
829
- allowSort && showSortDragButton && showSortBtn
830
- ? h('div', {
831
- class: 'vxe-table-custom--sort-option'
832
- }, [
833
- h('span', {
834
- class: ['vxe-table-custom--sort-btn', {
835
- 'is--disabled': isHidden
836
- }],
837
- attrs: {
838
- title: getI18n('vxe.custom.setting.sortHelpTip')
839
- },
840
- on: isHidden
841
- ? {}
842
- : {
843
- mousedown: $xeTableCustomPanel.sortMousedownEvent,
844
- mouseup: $xeTableCustomPanel.sortMouseupEvent
845
- }
831
+ (allowSort && showSortDragButton) || (allowGroup || allowValues)
832
+ ? (showSortBtn || ((allowGroup || allowValues) && !isColGroup)
833
+ ? h('div', {
834
+ class: 'vxe-table-custom--sort-option'
846
835
  }, [
847
- h('i', {
848
- class: getIcon().TABLE_CUSTOM_SORT
849
- })
836
+ h('span', {
837
+ class: ['vxe-table-custom--sort-btn', {
838
+ 'is--disabled': isHidden
839
+ }],
840
+ attrs: {
841
+ title: getI18n('vxe.custom.setting.sortHelpTip')
842
+ },
843
+ on: isHidden
844
+ ? {}
845
+ : {
846
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
847
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
848
+ }
849
+ }, [
850
+ h('i', {
851
+ class: getIcon().TABLE_CUSTOM_SORT
852
+ })
853
+ ])
850
854
  ])
851
- ])
855
+ : renderEmptyElement($xeTable))
852
856
  : renderEmptyElement($xeTable),
853
857
  column.type === 'html'
854
858
  ? h('div', {
@@ -1134,9 +1138,10 @@ export default {
1134
1138
  const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps;
1135
1139
  const { isCustomStatus, customColumnList } = tableReactData;
1136
1140
  const customOpts = $xeTable.computeCustomOpts;
1137
- const { immediate, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
1138
1141
  const columnDragOpts = $xeTable.computeColumnDragOpts;
1139
- const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts;
1142
+ const aggregateOpts = $xeTable.computeAggregateOpts;
1143
+ const { placement: aggPlacement } = aggregateOpts;
1144
+ const { mode, immediate, showSortDragButton, showSortMoveButton, showSortPutButton, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues, checkMethod, visibleMethod } = customOpts;
1140
1145
  const columnOpts = $xeTable.computeColumnOpts;
1141
1146
  const { maxFixedSize } = columnOpts;
1142
1147
  const resizableOpts = $xeTable.computeResizableOpts;
@@ -1154,6 +1159,7 @@ export default {
1154
1159
  const trVNs = [];
1155
1160
  const isAllChecked = customStore.isAll;
1156
1161
  const isAllIndeterminate = customStore.isIndeterminate;
1162
+ const isAggRtBmLayout = aggPlacement === 'right' || aggPlacement === 'bottom';
1157
1163
  const params = {
1158
1164
  $table: $xeTable,
1159
1165
  $grid: $xeGrid,
@@ -1238,8 +1244,8 @@ export default {
1238
1244
  h('div', {
1239
1245
  class: 'vxe-table-custom-popup--name'
1240
1246
  }, [
1241
- allowSort
1242
- ? showSortDragButton && (showSortBtn
1247
+ (allowSort && showSortDragButton) || (allowGroup || allowValues)
1248
+ ? (showSortBtn || ((allowGroup || allowValues) && !isColGroup)
1243
1249
  ? h('div', {
1244
1250
  class: ['vxe-table-custom-popup--column-sort-btn', {
1245
1251
  'is--disabled': isHidden
@@ -1409,11 +1415,11 @@ export default {
1409
1415
  default: () => {
1410
1416
  return h('div', {
1411
1417
  ref: 'refBodyWrapperElem',
1412
- class: 'vxe-table-custom-popup--body-wrapper'
1418
+ class: ['vxe-table-custom-popup--body-wrapper', `agg-layout--${aggPlacement}`]
1413
1419
  }, defaultSlot
1414
1420
  ? $xeTable.callSlot(defaultSlot, params, h)
1415
1421
  : [
1416
- !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1422
+ !isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1417
1423
  ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1418
1424
  props: {
1419
1425
  customStore
@@ -1502,7 +1508,14 @@ export default {
1502
1508
  }, $xeTable.callSlot(bottomSlot, params, h))
1503
1509
  : renderEmptyElement($xeTable),
1504
1510
  $xeTableCustomPanel.renderDragTip(h)
1505
- ])
1511
+ ]),
1512
+ isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1513
+ ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1514
+ props: {
1515
+ customStore
1516
+ }
1517
+ })
1518
+ : renderEmptyElement($xeTable)
1506
1519
  ]);
1507
1520
  },
1508
1521
  footer: () => {
@@ -309,8 +309,9 @@ export default {
309
309
  if (!menu.loading && !menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
310
310
  const gMenuOpts = menus.get(menu.code);
311
311
  const params = Object.assign({}, internalData._currMenuParams, { menu, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt });
312
- if (gMenuOpts && gMenuOpts.menuMethod) {
313
- gMenuOpts.menuMethod(params, evnt);
312
+ const tmMethod = gMenuOpts ? (gMenuOpts.tableMenuMethod || gMenuOpts.menuMethod) : null;
313
+ if (tmMethod) {
314
+ tmMethod(params, evnt);
314
315
  }
315
316
  // 在 v4 中废弃事件 context-menu-click
316
317
  if ($xeTable.$listeners['context-menu-click']) {
@@ -378,9 +378,9 @@ export default {
378
378
  },
379
379
  hasCellRules(type, row, column) {
380
380
  const { editRules } = this;
381
- const { property } = column;
382
- if (property && editRules) {
383
- const rules = XEUtils.get(editRules, property);
381
+ const { field } = column;
382
+ if (field && editRules) {
383
+ const rules = column.rules ? column.rules : XEUtils.get(editRules, field);
384
384
  return rules && XEUtils.find(rules, rule => type === 'all' || !rule.trigger || type === rule.trigger);
385
385
  }
386
386
  return false;
@@ -408,7 +408,7 @@ export default {
408
408
  const errorRules = [];
409
409
  const syncValidList = [];
410
410
  if (field && editRules) {
411
- const rules = XEUtils.get(editRules, field);
411
+ const rules = column.rules ? column.rules : XEUtils.get(editRules, field);
412
412
  if (rules) {
413
413
  const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, field) : val;
414
414
  rules.forEach((rule) => {
@@ -1110,7 +1110,7 @@ export const Cell = {
1110
1110
  const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1111
1111
  let isRequired = false;
1112
1112
  if (editRules) {
1113
- const columnRules = XEUtils.get(editRules, column.field);
1113
+ const columnRules = column.rules ? column.rules : XEUtils.get(editRules, column.field);
1114
1114
  if (columnRules) {
1115
1115
  isRequired = columnRules.some((rule) => rule.required);
1116
1116
  }
@@ -99,6 +99,8 @@ export const columnProps = {
99
99
  filterRender: Object,
100
100
  // 是否显示浮动筛选
101
101
  floatingFilters: Object,
102
+ // 列的校验规则
103
+ rules: Array,
102
104
  // 设置为分组节点
103
105
  rowGroupNode: Boolean,
104
106
  // 设置为树节点
@@ -108,6 +108,7 @@ export class ColumnInfo {
108
108
  filterRecoverMethod: _vm.filterRecoverMethod,
109
109
  filterRender: filterRender,
110
110
  floatingFilters: _vm.floatingFilters,
111
+ rules: _vm.rules,
111
112
  rowGroupNode: _vm.rowGroupNode,
112
113
  treeNode: _vm.treeNode,
113
114
  dragSort: _vm.dragSort,
@@ -1706,7 +1706,7 @@ export default {
1706
1706
  warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
1707
1707
  }
1708
1708
  if (mouseOpts.area && (props.treeConfig && !treeOpts.transform)) {
1709
- errLog('vxe.error.noTree', ['mouse-config.area']);
1709
+ errLog('vxe.error.notSupportProp', ['mouse-config.area', 'tree-config.transform=false', 'tree-config.transform=true']);
1710
1710
  }
1711
1711
  if (props.editConfig && editOpts.activeMethod) {
1712
1712
  warnLog('vxe.error.delProp', ['table.edit-config.activeMethod', 'table.edit-config.beforeEditMethod']);
@@ -1006,11 +1006,14 @@
1006
1006
  .vxe-table-custom-popup--body-wrapper {
1007
1007
  position: relative;
1008
1008
  display: flex;
1009
- flex-direction: column;
1009
+ flex-direction: row;
1010
1010
  overflow: hidden;
1011
1011
  height: 100%;
1012
1012
  outline: 0;
1013
1013
  }
1014
+ .vxe-table-custom-popup--body-wrapper.agg-layout--top, .vxe-table-custom-popup--body-wrapper.agg-layout--bottom {
1015
+ flex-direction: column;
1016
+ }
1014
1017
 
1015
1018
  .vxe-table-custom-popup--handle-wrapper {
1016
1019
  flex-grow: 1;