vxe-table 3.10.15 → 3.11.0

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 (72) hide show
  1. package/README.md +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/table/module/custom/mixin.js +5 -1
  5. package/es/table/module/edit/mixin.js +24 -15
  6. package/es/table/module/validator/mixin.js +31 -10
  7. package/es/table/src/body.js +40 -24
  8. package/es/table/src/cell.js +75 -32
  9. package/es/table/src/footer.js +159 -131
  10. package/es/table/src/header.js +128 -90
  11. package/es/table/src/methods.js +292 -66
  12. package/es/table/src/props.js +5 -1
  13. package/es/table/src/table.js +64 -20
  14. package/es/table/style.css +33 -20
  15. package/es/table/style.min.css +1 -1
  16. package/es/ui/index.js +9 -4
  17. package/es/ui/src/log.js +1 -1
  18. package/es/vxe-table/style.css +33 -20
  19. package/es/vxe-table/style.min.css +1 -1
  20. package/helper/vetur/attributes.json +1 -1
  21. package/helper/vetur/tags.json +1 -1
  22. package/lib/index.umd.js +945 -460
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/style.css +1 -1
  25. package/lib/style.min.css +1 -1
  26. package/lib/table/module/custom/mixin.js +5 -1
  27. package/lib/table/module/custom/mixin.min.js +1 -1
  28. package/lib/table/module/edit/mixin.js +24 -15
  29. package/lib/table/module/edit/mixin.min.js +1 -1
  30. package/lib/table/module/validator/mixin.js +31 -10
  31. package/lib/table/module/validator/mixin.min.js +1 -1
  32. package/lib/table/src/body.js +31 -15
  33. package/lib/table/src/body.min.js +1 -1
  34. package/lib/table/src/cell.js +82 -35
  35. package/lib/table/src/cell.min.js +1 -1
  36. package/lib/table/src/footer.js +198 -161
  37. package/lib/table/src/footer.min.js +1 -1
  38. package/lib/table/src/header.js +169 -128
  39. package/lib/table/src/header.min.js +1 -1
  40. package/lib/table/src/methods.js +321 -69
  41. package/lib/table/src/methods.min.js +1 -1
  42. package/lib/table/src/props.js +5 -1
  43. package/lib/table/src/props.min.js +1 -1
  44. package/lib/table/src/table.js +70 -20
  45. package/lib/table/src/table.min.js +1 -1
  46. package/lib/table/style/style.css +33 -20
  47. package/lib/table/style/style.min.css +1 -1
  48. package/lib/ui/index.js +9 -4
  49. package/lib/ui/index.min.js +1 -1
  50. package/lib/ui/src/log.js +1 -1
  51. package/lib/ui/src/log.min.js +1 -1
  52. package/lib/vxe-table/style/style.css +33 -20
  53. package/lib/vxe-table/style/style.min.css +1 -1
  54. package/package.json +3 -3
  55. package/packages/table/module/custom/mixin.ts +5 -1
  56. package/packages/table/module/edit/mixin.ts +24 -15
  57. package/packages/table/module/validator/mixin.ts +33 -10
  58. package/packages/table/src/body.ts +43 -25
  59. package/packages/table/src/cell.ts +120 -67
  60. package/packages/table/src/footer.ts +164 -150
  61. package/packages/table/src/header.ts +136 -90
  62. package/packages/table/src/methods.ts +304 -68
  63. package/packages/table/src/props.ts +5 -1
  64. package/packages/table/src/table.ts +71 -19
  65. package/packages/ui/index.ts +8 -3
  66. package/styles/components/table.scss +42 -35
  67. /package/es/{iconfont.1731574584971.ttf → iconfont.1731890707082.ttf} +0 -0
  68. /package/es/{iconfont.1731574584971.woff → iconfont.1731890707082.woff} +0 -0
  69. /package/es/{iconfont.1731574584971.woff2 → iconfont.1731890707082.woff2} +0 -0
  70. /package/lib/{iconfont.1731574584971.ttf → iconfont.1731890707082.ttf} +0 -0
  71. /package/lib/{iconfont.1731574584971.woff → iconfont.1731890707082.woff} +0 -0
  72. /package/lib/{iconfont.1731574584971.woff2 → iconfont.1731890707082.woff2} +0 -0
@@ -92,6 +92,48 @@ function renderEmptyBody(h, _vm) {
92
92
  }
93
93
  return emptyContent;
94
94
  }
95
+ const renderDragTipContents = (h, $xeTable) => {
96
+ const props = $xeTable;
97
+ const reactData = $xeTable;
98
+ const { dragConfig } = props;
99
+ const { dragRow, dragCol, dragTipText } = reactData;
100
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
101
+ const rowDragOpts = $xeTable.computeRowDragOpts;
102
+ const rowDragSlots = rowDragOpts.slots || {};
103
+ const rTipSlot = rowDragSlots.tip || (dragConfig && dragConfig.slots ? dragConfig.slots.rowTip : null);
104
+ const columnDragSlots = columnDragOpts.slots || {};
105
+ const cTipSlot = columnDragSlots.tip;
106
+ if (dragRow && rTipSlot) {
107
+ return $xeTable.callSlot(rTipSlot, { row: dragRow }, h);
108
+ }
109
+ if (dragCol && cTipSlot) {
110
+ return $xeTable.callSlot(cTipSlot, { column: dragCol }, h);
111
+ }
112
+ return [h('span', dragTipText)];
113
+ };
114
+ const renderDragTip = (h, $xeTable) => {
115
+ const rowOpts = $xeTable.computeRowOpts;
116
+ const columnOpts = $xeTable.computeColumnOpts;
117
+ if (rowOpts.drag || columnOpts.drag) {
118
+ return h('div', {
119
+ class: 'vxe-table--drag-wrapper'
120
+ }, [
121
+ h('div', {
122
+ ref: 'refDragRowLineElem',
123
+ class: 'vxe-table--drag-row-line'
124
+ }),
125
+ h('div', {
126
+ ref: 'refDragColLineElem',
127
+ class: 'vxe-table--drag-col-line'
128
+ }),
129
+ h('div', {
130
+ ref: 'refDragTipElem',
131
+ class: 'vxe-table--drag-sort-tip'
132
+ }, renderDragTipContents(h, $xeTable))
133
+ ]);
134
+ }
135
+ return renderEmptyElement($xeTable);
136
+ };
95
137
  function handleUupdateResize(_vm) {
96
138
  const { $el } = _vm;
97
139
  if ($el && $el.clientWidth && $el.clientHeight) {
@@ -345,9 +387,13 @@ export default {
345
387
  isHeader: false,
346
388
  isFooter: false
347
389
  },
390
+ scrollVMLoading: false,
348
391
  isDragRowMove: false,
349
392
  dragRow: null,
393
+ isDragColMove: false,
394
+ dragCol: null,
350
395
  dragTipText: '',
396
+ _isResize: false,
351
397
  _isLoading: false
352
398
  };
353
399
  },
@@ -420,8 +466,11 @@ export default {
420
466
  computeRowOpts() {
421
467
  return Object.assign({}, getConfig().table.rowConfig, this.rowConfig);
422
468
  },
423
- computeDragOpts() {
424
- return Object.assign({}, getConfig().table.dragConfig, this.dragConfig);
469
+ computeRowDragOpts() {
470
+ return Object.assign({}, getConfig().table.rowDragConfig, this.rowDragConfig);
471
+ },
472
+ computeColumnDragOpts() {
473
+ return Object.assign({}, getConfig().table.columnDragConfig, this.columnDragConfig);
425
474
  },
426
475
  resizeOpts() {
427
476
  return this.computeResizeOpts;
@@ -839,7 +888,7 @@ export default {
839
888
  if (this.rowOpts.height && !this.showOverflow) {
840
889
  warnLog('vxe.error.notProp', ['table.show-overflow']);
841
890
  }
842
- if (!this.handleUpdateCellAreas) {
891
+ if (!this.handleRecalculateCellAreas) {
843
892
  if (this.clipConfig) {
844
893
  warnLog('vxe.error.notProp', ['clip-config']);
845
894
  }
@@ -851,6 +900,9 @@ export default {
851
900
  return;
852
901
  }
853
902
  }
903
+ if (this.dragConfig) {
904
+ warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
905
+ }
854
906
  if (this.treeConfig && treeOpts.children) {
855
907
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
856
908
  }
@@ -1039,24 +1091,23 @@ export default {
1039
1091
  const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
1040
1092
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
1041
1093
  const $xeTable = this;
1042
- const reactData = $xeTable;
1043
- const { _e, $scopedSlots, tId, isCalcColumn, tableData, tableColumn, tableGroupColumn, isGroup, loading, stripe, showHeader, height, tableBorder, treeOpts, treeConfig, mouseConfig, mouseOpts, computeSize, validOpts, showFooter, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, validTipOpts, initStore, columnStore, filterStore, customStore, ctxMenuStore, ctxMenuOpts, footerTableData, columnOpts, rowOpts, checkboxOpts, loadingOpts, editRules } = $xeTable;
1044
- const { dragRow, dragTipText } = reactData;
1094
+ const { _e, $scopedSlots, tId, isCalcColumn, tableData, tableColumn, tableGroupColumn, isGroup, loading, stripe, showHeader, height, tableBorder, treeOpts, treeConfig, mouseConfig, mouseOpts, areaOpts, computeSize, validOpts, showFooter, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, validTipOpts, initStore, columnStore, filterStore, customStore, ctxMenuStore, ctxMenuOpts, footerTableData, columnOpts, rowOpts, checkboxOpts, loadingOpts, editRules } = $xeTable;
1045
1095
  const { leftList, rightList } = columnStore;
1046
1096
  const currLoading = this._isLoading || loading;
1047
1097
  const vSize = computeSize;
1048
- const dragOpts = $xeTable.computeDragOpts;
1049
1098
  const virtualScrollBars = $xeTable.computeVirtualScrollBars;
1050
- const dragSlots = dragOpts.slots || {};
1051
- const rowTipSlot = dragSlots.rowTip;
1099
+ const isArea = mouseConfig && mouseOpts.area;
1052
1100
  return h('div', {
1101
+ ref: 'refElem',
1053
1102
  class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
1054
1103
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
1055
1104
  'vxe-editable': !!editConfig,
1056
1105
  'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete',
1057
1106
  'cell--highlight': highlightCell,
1058
1107
  'cell--selected': mouseConfig && mouseOpts.selected,
1059
- 'cell--area': mouseConfig && mouseOpts.area,
1108
+ 'cell--area': isArea,
1109
+ 'header-cell--area': isArea && areaOpts.selectCellByHeader,
1110
+ 'body-cell--area': isArea && areaOpts.selectCellByBody,
1060
1111
  'row--highlight': rowOpts.isHover || highlightHoverRow,
1061
1112
  'column--highlight': columnOpts.isHover || highlightHoverColumn,
1062
1113
  'checkbox--range': checkboxOpts.range,
@@ -1293,16 +1344,9 @@ export default {
1293
1344
  })
1294
1345
  : _e(),
1295
1346
  /**
1296
- * 拖拽提示
1297
- */
1298
- rowOpts.drag && (dragRow || dragTipText)
1299
- ? h('div', {
1300
- ref: 'refRowDragTipElem',
1301
- class: 'vxe-table--row-drag-tip'
1302
- }, rowTipSlot
1303
- ? (dragRow ? this.callSlot(rowTipSlot, { row: dragRow }, h) : [renderEmptyElement($xeTable)])
1304
- : (dragTipText ? [h('span', dragTipText)] : [renderEmptyElement($xeTable)]))
1305
- : _e(),
1347
+ * 拖拽提示
1348
+ */
1349
+ renderDragTip(h, this),
1306
1350
  h('div', {}, [
1307
1351
  /**
1308
1352
  * 提示相关
@@ -2046,6 +2046,7 @@
2046
2046
  /*树形节点*/
2047
2047
  /*展开行*/
2048
2048
  /*设置列高度*/
2049
+ /*拖拽列*/
2049
2050
  /*拖拽行*/
2050
2051
  /*溢出列*/
2051
2052
  /*暂无数据*/
@@ -2126,8 +2127,12 @@
2126
2127
  .vxe-table--render-default.column--highlight .vxe-header--column:not(.col--seq):hover {
2127
2128
  background-color: var(--vxe-ui-table-column-hover-background-color);
2128
2129
  }
2129
- .vxe-table--render-default.cell--area .vxe-table--body-wrapper,
2130
- .vxe-table--render-default.cell--area .vxe-body--column {
2130
+ .vxe-table--render-default.header-cell--area .vxe-table--header-wrapper {
2131
+ -webkit-user-select: none;
2132
+ -moz-user-select: none;
2133
+ user-select: none;
2134
+ }
2135
+ .vxe-table--render-default.body-cell--area .vxe-table--body-wrapper {
2131
2136
  -webkit-user-select: none;
2132
2137
  -moz-user-select: none;
2133
2138
  user-select: none;
@@ -2501,6 +2506,7 @@
2501
2506
  width: 1px;
2502
2507
  height: 100%;
2503
2508
  z-index: 9;
2509
+ pointer-events: none;
2504
2510
  cursor: col-resize;
2505
2511
  }
2506
2512
  .vxe-table--render-default .vxe-table--resizable-bar:before {
@@ -2607,6 +2613,26 @@
2607
2613
  overflow: auto;
2608
2614
  outline: 0;
2609
2615
  }
2616
+ .vxe-table--render-default .vxe-table--drag-col-line {
2617
+ height: 100%;
2618
+ width: 1px;
2619
+ background-color: var(--vxe-ui-font-primary-color);
2620
+ }
2621
+ .vxe-table--render-default .vxe-header--column.col--drag-origin > .vxe-cell {
2622
+ opacity: 0.5;
2623
+ }
2624
+ .vxe-table--render-default .vxe-header--col-list-move {
2625
+ transition: transform 0.35s;
2626
+ }
2627
+ .vxe-table--render-default .vxe-table--drag-col-line,
2628
+ .vxe-table--render-default .vxe-table--drag-row-line {
2629
+ display: none;
2630
+ position: absolute;
2631
+ top: 0;
2632
+ left: 0;
2633
+ z-index: 9;
2634
+ pointer-events: none;
2635
+ }
2610
2636
  .vxe-table--render-default .vxe-cell--drag-handle {
2611
2637
  -webkit-user-select: none;
2612
2638
  -moz-user-select: none;
@@ -2628,31 +2654,18 @@
2628
2654
  color: var(--vxe-ui-input-disabled-color);
2629
2655
  cursor: not-allowed;
2630
2656
  }
2631
- .vxe-table--render-default .vxe-body--row.row--drag-origin > .vxe-body--column > .vxe-cell {
2632
- opacity: 0.5;
2633
- }
2634
- .vxe-table--render-default .vxe-body--row.row--drag-active-target > .vxe-body--column::after {
2635
- display: none;
2636
- content: "";
2637
- position: absolute;
2638
- left: 0;
2657
+ .vxe-table--render-default .vxe-table--drag-row-line {
2639
2658
  width: 100%;
2640
- height: 2px;
2659
+ height: 1px;
2641
2660
  background-color: var(--vxe-ui-font-primary-color);
2642
- z-index: 12;
2643
- }
2644
- .vxe-table--render-default .vxe-body--row.row--drag-active-target[drag-pos=top] > .vxe-body--column::after {
2645
- display: block;
2646
- top: 0;
2647
2661
  }
2648
- .vxe-table--render-default .vxe-body--row.row--drag-active-target[drag-pos=bottom] > .vxe-body--column::after {
2649
- display: block;
2650
- bottom: 0;
2662
+ .vxe-table--render-default .vxe-body--row.row--drag-origin > .vxe-body--column > .vxe-cell {
2663
+ opacity: 0.5;
2651
2664
  }
2652
2665
  .vxe-table--render-default .vxe-body--row-list-move {
2653
2666
  transition: transform 0.35s;
2654
2667
  }
2655
- .vxe-table--render-default .vxe-table--row-drag-tip {
2668
+ .vxe-table--render-default .vxe-table--drag-sort-tip {
2656
2669
  display: none;
2657
2670
  position: absolute;
2658
2671
  top: 0;