vxe-table 4.19.0 → 4.19.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 (170) hide show
  1. package/dist/all.esm.js +31751 -0
  2. package/dist/style.css +1 -0
  3. package/dist/style.min.css +1 -0
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/ar-EG.js +6 -4
  7. package/es/locale/lang/de-DE.js +6 -4
  8. package/es/locale/lang/en-US.js +6 -4
  9. package/es/locale/lang/es-ES.js +6 -4
  10. package/es/locale/lang/fr-FR.js +6 -4
  11. package/es/locale/lang/hu-HU.js +6 -4
  12. package/es/locale/lang/hy-AM.js +6 -4
  13. package/es/locale/lang/id-ID.js +6 -4
  14. package/es/locale/lang/it-IT.js +6 -4
  15. package/es/locale/lang/ja-JP.js +6 -4
  16. package/es/locale/lang/ko-KR.js +6 -4
  17. package/es/locale/lang/ms-MY.js +6 -4
  18. package/es/locale/lang/nb-NO.js +6 -4
  19. package/es/locale/lang/pt-BR.js +6 -4
  20. package/es/locale/lang/ru-RU.js +6 -4
  21. package/es/locale/lang/th-TH.js +6 -4
  22. package/es/locale/lang/ug-CN.js +6 -4
  23. package/es/locale/lang/uk-UA.js +6 -4
  24. package/es/locale/lang/uz-UZ.js +6 -4
  25. package/es/locale/lang/vi-VN.js +6 -4
  26. package/es/locale/lang/zh-CHT.js +6 -4
  27. package/es/locale/lang/zh-CN.js +6 -4
  28. package/es/style.css +1 -1
  29. package/es/style.min.css +1 -1
  30. package/es/table/module/custom/panel.js +39 -28
  31. package/es/table/module/validator/hook.js +2 -2
  32. package/es/table/src/cell.js +1 -1
  33. package/es/table/src/column.js +2 -0
  34. package/es/table/src/columnInfo.js +1 -0
  35. package/es/table/src/table.js +1 -1
  36. package/es/table/style.css +4 -1
  37. package/es/table/style.min.css +1 -1
  38. package/es/ui/index.js +2 -1
  39. package/es/ui/src/log.js +1 -1
  40. package/es/vxe-table/style.css +4 -1
  41. package/es/vxe-table/style.min.css +1 -1
  42. package/lib/index.css +1 -1
  43. package/lib/index.min.css +1 -1
  44. package/lib/index.umd.js +43 -27
  45. package/lib/index.umd.min.js +1 -1
  46. package/lib/locale/lang/ar-EG.js +6 -4
  47. package/lib/locale/lang/ar-EG.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.umd.js +6 -4
  49. package/lib/locale/lang/de-DE.js +6 -4
  50. package/lib/locale/lang/de-DE.min.js +1 -1
  51. package/lib/locale/lang/de-DE.umd.js +6 -4
  52. package/lib/locale/lang/en-US.js +6 -4
  53. package/lib/locale/lang/en-US.min.js +1 -1
  54. package/lib/locale/lang/en-US.umd.js +6 -4
  55. package/lib/locale/lang/es-ES.js +6 -4
  56. package/lib/locale/lang/es-ES.min.js +1 -1
  57. package/lib/locale/lang/es-ES.umd.js +6 -4
  58. package/lib/locale/lang/fr-FR.js +6 -4
  59. package/lib/locale/lang/fr-FR.min.js +1 -1
  60. package/lib/locale/lang/fr-FR.umd.js +6 -4
  61. package/lib/locale/lang/hu-HU.js +6 -4
  62. package/lib/locale/lang/hu-HU.min.js +1 -1
  63. package/lib/locale/lang/hu-HU.umd.js +6 -4
  64. package/lib/locale/lang/hy-AM.js +6 -4
  65. package/lib/locale/lang/hy-AM.min.js +1 -1
  66. package/lib/locale/lang/hy-AM.umd.js +6 -4
  67. package/lib/locale/lang/id-ID.js +6 -4
  68. package/lib/locale/lang/id-ID.min.js +1 -1
  69. package/lib/locale/lang/id-ID.umd.js +6 -4
  70. package/lib/locale/lang/it-IT.js +6 -4
  71. package/lib/locale/lang/it-IT.min.js +1 -1
  72. package/lib/locale/lang/it-IT.umd.js +6 -4
  73. package/lib/locale/lang/ja-JP.js +6 -4
  74. package/lib/locale/lang/ja-JP.min.js +1 -1
  75. package/lib/locale/lang/ja-JP.umd.js +6 -4
  76. package/lib/locale/lang/ko-KR.js +6 -4
  77. package/lib/locale/lang/ko-KR.min.js +1 -1
  78. package/lib/locale/lang/ko-KR.umd.js +6 -4
  79. package/lib/locale/lang/ms-MY.js +6 -4
  80. package/lib/locale/lang/ms-MY.min.js +1 -1
  81. package/lib/locale/lang/ms-MY.umd.js +6 -4
  82. package/lib/locale/lang/nb-NO.js +6 -4
  83. package/lib/locale/lang/nb-NO.min.js +1 -1
  84. package/lib/locale/lang/nb-NO.umd.js +6 -4
  85. package/lib/locale/lang/pt-BR.js +6 -4
  86. package/lib/locale/lang/pt-BR.min.js +1 -1
  87. package/lib/locale/lang/pt-BR.umd.js +6 -4
  88. package/lib/locale/lang/ru-RU.js +6 -4
  89. package/lib/locale/lang/ru-RU.min.js +1 -1
  90. package/lib/locale/lang/ru-RU.umd.js +6 -4
  91. package/lib/locale/lang/th-TH.js +6 -4
  92. package/lib/locale/lang/th-TH.min.js +1 -1
  93. package/lib/locale/lang/th-TH.umd.js +6 -4
  94. package/lib/locale/lang/ug-CN.js +6 -4
  95. package/lib/locale/lang/ug-CN.min.js +1 -1
  96. package/lib/locale/lang/ug-CN.umd.js +6 -4
  97. package/lib/locale/lang/uk-UA.js +6 -4
  98. package/lib/locale/lang/uk-UA.min.js +1 -1
  99. package/lib/locale/lang/uk-UA.umd.js +6 -4
  100. package/lib/locale/lang/uz-UZ.js +6 -4
  101. package/lib/locale/lang/uz-UZ.min.js +1 -1
  102. package/lib/locale/lang/uz-UZ.umd.js +6 -4
  103. package/lib/locale/lang/vi-VN.js +6 -4
  104. package/lib/locale/lang/vi-VN.min.js +1 -1
  105. package/lib/locale/lang/vi-VN.umd.js +6 -4
  106. package/lib/locale/lang/zh-CHT.js +6 -4
  107. package/lib/locale/lang/zh-CHT.min.js +1 -1
  108. package/lib/locale/lang/zh-CHT.umd.js +6 -4
  109. package/lib/locale/lang/zh-CN.js +6 -4
  110. package/lib/locale/lang/zh-CN.min.js +1 -1
  111. package/lib/locale/lang/zh-CN.umd.js +6 -4
  112. package/lib/style.css +1 -1
  113. package/lib/style.min.css +1 -1
  114. package/lib/table/module/custom/panel.js +27 -17
  115. package/lib/table/module/custom/panel.min.js +1 -1
  116. package/lib/table/module/validator/hook.js +2 -2
  117. package/lib/table/module/validator/hook.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 +5 -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 +66 -51
  158. package/packages/table/module/validator/hook.ts +2 -2
  159. package/packages/table/src/cell.ts +1 -1
  160. package/packages/table/src/column.ts +2 -0
  161. package/packages/table/src/columnInfo.ts +1 -0
  162. package/packages/table/src/table.ts +1 -1
  163. package/packages/ui/index.ts +1 -0
  164. package/styles/components/table-module/custom.scss +5 -1
  165. /package/es/{iconfont.1779330847998.ttf → iconfont.1779778422561.ttf} +0 -0
  166. /package/es/{iconfont.1779330847998.woff → iconfont.1779778422561.woff} +0 -0
  167. /package/es/{iconfont.1779330847998.woff2 → iconfont.1779778422561.woff2} +0 -0
  168. /package/lib/{iconfont.1779330847998.ttf → iconfont.1779778422561.ttf} +0 -0
  169. /package/lib/{iconfont.1779330847998.woff → iconfont.1779778422561.woff} +0 -0
  170. /package/lib/{iconfont.1779330847998.woff2 → iconfont.1779778422561.woff2} +0 -0
@@ -34,7 +34,7 @@ export default defineVxeComponent({
34
34
  const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
35
35
  const $xeTable = inject('$xeTable', {});
36
36
  const { props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
37
- const { computeSize, computeCustomOpts, computeColumnDragOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts } = $xeTable.getComputeMaps();
37
+ const { computeSize, computeCustomOpts, computeColumnDragOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts, computeAggregateOpts } = $xeTable.getComputeMaps();
38
38
  const refElem = ref();
39
39
  const refBodyWrapperElem = ref();
40
40
  const refCustomBodyElem = ref();
@@ -498,7 +498,7 @@ export default defineVxeComponent({
498
498
  };
499
499
  const sortDragoverEvent = (evnt) => {
500
500
  const customOpts = computeCustomOpts.value;
501
- const { immediate } = customOpts;
501
+ const { showSortDragButton, allowSort, immediate } = customOpts;
502
502
  const columnDragOpts = computeColumnDragOpts.value;
503
503
  const { isCrossDrag, isToChildDrag } = columnDragOpts;
504
504
  const optEl = evnt.currentTarget;
@@ -514,9 +514,12 @@ export default defineVxeComponent({
514
514
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
515
515
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
516
516
  if (!dragCol ||
517
+ !(showSortDragButton && allowSort) ||
517
518
  (dragCol && dragCol.id === column.id) ||
518
519
  (!isCrossDrag && column.level > 1) ||
519
- (!immediate && column.level > 1)) {
520
+ (!immediate && column.level > 1) ||
521
+ (!isCrossDrag && dragCol.level > 1) ||
522
+ (!immediate && dragCol.level > 1)) {
520
523
  showDropTip(evnt, optEl, false, dragPos);
521
524
  return;
522
525
  }
@@ -645,10 +648,9 @@ export default defineVxeComponent({
645
648
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
646
649
  const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData;
647
650
  const customOpts = computeCustomOpts.value;
648
- const { immediate } = customOpts;
649
651
  const columnDragOpts = computeColumnDragOpts.value;
650
652
  const { popupStyle } = customStore;
651
- const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
653
+ const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
652
654
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
653
655
  const vSize = computeSize.value;
654
656
  const { isCrossDrag } = columnDragOpts;
@@ -719,23 +721,25 @@ export default defineVxeComponent({
719
721
  h('div', {
720
722
  class: 'vxe-table-custom--name-option'
721
723
  }, [
722
- allowSort && showSortDragButton && showSortBtn
723
- ? h('div', {
724
- class: 'vxe-table-custom--sort-option'
725
- }, [
726
- h('span', Object.assign({ class: ['vxe-table-custom--sort-btn', {
727
- 'is--disabled': isHidden
728
- }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isHidden
729
- ? {}
730
- : {
731
- onMousedown: sortMousedownEvent,
732
- onMouseup: sortMouseupEvent
733
- })), [
734
- h('i', {
735
- class: getIcon().TABLE_CUSTOM_SORT
736
- })
724
+ (allowSort && showSortDragButton) || (allowGroup || allowValues)
725
+ ? (showSortBtn || ((allowGroup || allowValues) && !isColGroup)
726
+ ? h('div', {
727
+ class: 'vxe-table-custom--sort-option'
728
+ }, [
729
+ h('span', Object.assign({ class: ['vxe-table-custom--sort-btn', {
730
+ 'is--disabled': isHidden
731
+ }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isHidden
732
+ ? {}
733
+ : {
734
+ onMousedown: sortMousedownEvent,
735
+ onMouseup: sortMouseupEvent
736
+ })), [
737
+ h('i', {
738
+ class: getIcon().TABLE_CUSTOM_SORT
739
+ })
740
+ ])
737
741
  ])
738
- ])
742
+ : renderEmptyElement($xeTable))
739
743
  : renderEmptyElement($xeTable),
740
744
  column.type === 'html'
741
745
  ? h('div', {
@@ -968,9 +972,10 @@ export default defineVxeComponent({
968
972
  const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps;
969
973
  const { isCustomStatus, customColumnList } = tableReactData;
970
974
  const customOpts = computeCustomOpts.value;
971
- const { immediate, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
972
975
  const columnDragOpts = computeColumnDragOpts.value;
973
- const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts;
976
+ const aggregateOpts = computeAggregateOpts.value;
977
+ const { placement: aggPlacement } = aggregateOpts;
978
+ const { mode, immediate, showSortDragButton, showSortMoveButton, showSortPutButton, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues, checkMethod, visibleMethod } = customOpts;
974
979
  const columnOpts = computeColumnOpts.value;
975
980
  const { maxFixedSize } = columnOpts;
976
981
  const resizableOpts = computeResizableOpts.value;
@@ -988,6 +993,7 @@ export default defineVxeComponent({
988
993
  const trVNs = [];
989
994
  const isAllChecked = customStore.isAll;
990
995
  const isAllIndeterminate = customStore.isIndeterminate;
996
+ const isAggRtBmLayout = aggPlacement === 'right' || aggPlacement === 'bottom';
991
997
  const params = {
992
998
  $table: $xeTable,
993
999
  $grid: $xeGrid,
@@ -1064,8 +1070,8 @@ export default defineVxeComponent({
1064
1070
  h('div', {
1065
1071
  class: 'vxe-table-custom-popup--name'
1066
1072
  }, [
1067
- allowSort
1068
- ? showSortDragButton && (showSortBtn
1073
+ (allowSort && showSortDragButton) || (allowGroup || allowValues)
1074
+ ? (showSortBtn || ((allowGroup || allowValues) && !isColGroup)
1069
1075
  ? h('div', Object.assign({ class: ['vxe-table-custom-popup--column-sort-btn', {
1070
1076
  'is--disabled': isHidden
1071
1077
  }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isHidden
@@ -1204,11 +1210,11 @@ export default defineVxeComponent({
1204
1210
  default: () => {
1205
1211
  return h('div', {
1206
1212
  ref: refBodyWrapperElem,
1207
- class: 'vxe-table-custom-popup--body-wrapper'
1213
+ class: ['vxe-table-custom-popup--body-wrapper', `agg-layout--${aggPlacement}`]
1208
1214
  }, defaultSlot
1209
1215
  ? $xeTable.callSlot(defaultSlot, params)
1210
1216
  : [
1211
- !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1217
+ !isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1212
1218
  ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1213
1219
  customStore
1214
1220
  })
@@ -1291,7 +1297,12 @@ export default defineVxeComponent({
1291
1297
  }, $xeTable.callSlot(bottomSlot, params))
1292
1298
  : renderEmptyElement($xeTable),
1293
1299
  renderDragTip()
1294
- ])
1300
+ ]),
1301
+ isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1302
+ ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1303
+ customStore
1304
+ })
1305
+ : renderEmptyElement($xeTable)
1295
1306
  ]);
1296
1307
  },
1297
1308
  footer: () => {
@@ -440,7 +440,7 @@ hooks.add('tableValidatorModule', {
440
440
  const errorRules = [];
441
441
  const syncValidList = [];
442
442
  if (field && editRules) {
443
- const rules = XEUtils.get(editRules, field);
443
+ const rules = column.rules ? column.rules : XEUtils.get(editRules, field);
444
444
  if (rules) {
445
445
  const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, field) : val;
446
446
  rules.forEach((rule) => {
@@ -514,7 +514,7 @@ hooks.add('tableValidatorModule', {
514
514
  const { editRules } = props;
515
515
  const { field } = column;
516
516
  if (field && editRules) {
517
- const rules = XEUtils.get(editRules, field);
517
+ const rules = column.rules ? column.rules : XEUtils.get(editRules, field);
518
518
  return rules && !!XEUtils.find(rules, rule => type === 'all' || !rule.trigger || type === rule.trigger);
519
519
  }
520
520
  return false;
@@ -1089,7 +1089,7 @@ export const Cell = {
1089
1089
  const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1090
1090
  let isRequired = false;
1091
1091
  if (editRules) {
1092
- const columnRules = XEUtils.get(editRules, column.field);
1092
+ const columnRules = column.rules ? column.rules : XEUtils.get(editRules, column.field);
1093
1093
  if (columnRules) {
1094
1094
  isRequired = columnRules.some((rule) => rule.required);
1095
1095
  }
@@ -93,6 +93,8 @@ export const columnProps = {
93
93
  filterRender: Object,
94
94
  // 是否显示浮动筛选
95
95
  floatingFilters: Object,
96
+ // 列的校验规则
97
+ rules: Array,
96
98
  // 设置为分组节点
97
99
  rowGroupNode: Boolean,
98
100
  // 设置为树节点
@@ -101,6 +101,7 @@ export class ColumnInfo {
101
101
  filterRecoverMethod: _vm.filterRecoverMethod,
102
102
  filterRender: filterRender,
103
103
  floatingFilters: _vm.floatingFilters,
104
+ rules: _vm.rules,
104
105
  rowGroupNode: _vm.rowGroupNode,
105
106
  treeNode: _vm.treeNode,
106
107
  dragSort: _vm.dragSort,
@@ -13886,7 +13886,7 @@ export default defineVxeComponent({
13886
13886
  warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
13887
13887
  }
13888
13888
  if (mouseOpts.area && (props.treeConfig && !treeOpts.transform)) {
13889
- errLog('vxe.error.noTree', ['mouse-config.area']);
13889
+ errLog('vxe.error.notSupportProp', ['mouse-config.area', 'tree-config.transform=false', 'tree-config.transform=true']);
13890
13890
  }
13891
13891
  if (props.editConfig && editOpts.activeMethod) {
13892
13892
  warnLog('vxe.error.delProp', ['edit-config.activeMethod', '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;