vxe-table 3.11.24 → 3.11.26

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 (53) hide show
  1. package/es/{iconfont.1733816028970.ttf → iconfont.1733885890565.ttf} +0 -0
  2. package/es/iconfont.1733885890565.woff +0 -0
  3. package/es/iconfont.1733885890565.woff2 +0 -0
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/module/filter/mixin.js +37 -21
  9. package/es/table/src/methods.js +77 -13
  10. package/es/table/src/table.js +3 -0
  11. package/es/table/style.css +15 -2
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +2 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +15 -2
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/{iconfont.1733816028970.ttf → iconfont.1733885890565.ttf} +0 -0
  18. package/lib/iconfont.1733885890565.woff +0 -0
  19. package/lib/iconfont.1733885890565.woff2 +0 -0
  20. package/lib/index.css +1 -1
  21. package/lib/index.min.css +1 -1
  22. package/lib/index.umd.js +152 -50
  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/filter/mixin.js +43 -25
  27. package/lib/table/module/filter/mixin.min.js +1 -1
  28. package/lib/table/src/methods.js +104 -23
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/src/table.js +2 -0
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/style/style.css +15 -2
  33. package/lib/table/style/style.min.css +1 -1
  34. package/lib/ui/index.js +2 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/lib/vxe-table/style/style.css +15 -2
  39. package/lib/vxe-table/style/style.min.css +1 -1
  40. package/package.json +2 -2
  41. package/packages/table/module/filter/mixin.ts +42 -21
  42. package/packages/table/src/methods.ts +80 -13
  43. package/packages/table/src/table.ts +3 -0
  44. package/packages/ui/index.ts +1 -0
  45. package/styles/components/icon.scss +5 -1
  46. package/styles/components/table.scss +12 -1
  47. package/styles/icon/iconfont.ttf +0 -0
  48. package/styles/icon/iconfont.woff +0 -0
  49. package/styles/icon/iconfont.woff2 +0 -0
  50. package/es/iconfont.1733816028970.woff +0 -0
  51. package/es/iconfont.1733816028970.woff2 +0 -0
  52. package/lib/iconfont.1733816028970.woff +0 -0
  53. package/lib/iconfont.1733816028970.woff2 +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.11.24";
2223
+ const version = "3.11.26";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2469,6 +2469,7 @@ core_.VxeUI.setIcon({
2469
2469
  TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
2470
2470
  TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
2471
2471
  TABLE_DRAG_STATUS_ROW: iconPrefix + 'sort',
2472
+ TABLE_DRAG_STATUS_SUB_ROW: iconPrefix + 'add-sub',
2472
2473
  TABLE_DRAG_STATUS_COLUMN: iconPrefix + 'swap',
2473
2474
  TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
2474
2475
  // toolbar
@@ -2788,7 +2789,7 @@ function isNodeElement(elem) {
2788
2789
  const {
2789
2790
  log: log_log
2790
2791
  } = core_.VxeUI;
2791
- const log_version = `table v${"3.11.24"}`;
2792
+ const log_version = `table v${"3.11.26"}`;
2792
2793
  const warnLog = log_log.create('warn', log_version);
2793
2794
  const errLog = log_log.create('error', log_version);
2794
2795
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5350,6 +5351,7 @@ const updateColDropTipContent = ($xeTable, tdEl) => {
5350
5351
  };
5351
5352
  function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5352
5353
  const reactData = $xeTable;
5354
+ const internalData = $xeTable;
5353
5355
  const el = $xeTable.$refs.refElem;
5354
5356
  if (!el) {
5355
5357
  return;
@@ -5358,6 +5360,9 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5358
5360
  scrollbarWidth,
5359
5361
  scrollbarHeight
5360
5362
  } = reactData;
5363
+ const {
5364
+ prevDragToChild
5365
+ } = internalData;
5361
5366
  const wrapperRect = el.getBoundingClientRect();
5362
5367
  if (trEl) {
5363
5368
  const rdLineEl = $xeTable.$refs.refDragRowLineElem;
@@ -5369,6 +5374,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5369
5374
  rdLineEl.style.height = `${trRect.height}px`;
5370
5375
  rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
5371
5376
  rdLineEl.setAttribute('drag-pos', dragPos);
5377
+ rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
5372
5378
  } else {
5373
5379
  rdLineEl.style.display = '';
5374
5380
  }
@@ -5393,7 +5399,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5393
5399
  rdTipEl.style.display = 'block';
5394
5400
  rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
5395
5401
  rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
5396
- rdTipEl.setAttribute('drag-status', showLine ? 'normal' : 'disabled');
5402
+ rdTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
5397
5403
  }
5398
5404
  }
5399
5405
  const hideDropTip = $xeTable => {
@@ -10808,13 +10814,40 @@ const Methods = {
10808
10814
  }
10809
10815
  }
10810
10816
  },
10817
+ handleColumnSortEvent(evnt, column) {
10818
+ const $xeTable = this;
10819
+ const props = $xeTable;
10820
+ const {
10821
+ mouseConfig
10822
+ } = props;
10823
+ const mouseOpts = $xeTable.computeMouseOpts;
10824
+ const {
10825
+ field,
10826
+ sortable
10827
+ } = column;
10828
+ if (sortable) {
10829
+ const params = {
10830
+ $table: $xeTable,
10831
+ $event: evnt,
10832
+ column,
10833
+ field,
10834
+ property: field,
10835
+ order: column.order,
10836
+ sortList: $xeTable.getSortColumns(),
10837
+ sortTime: column.sortTime
10838
+ };
10839
+ if (mouseConfig && mouseOpts.area && $xeTable.handleSortEvent) {
10840
+ $xeTable.handleSortEvent(evnt, params);
10841
+ }
10842
+ $xeTable.dispatchEvent('sort-change', params, evnt);
10843
+ }
10844
+ },
10811
10845
  /**
10812
10846
  * 点击排序事件
10813
10847
  */
10814
10848
  triggerSortEvent(evnt, column, order) {
10815
- const {
10816
- sortOpts
10817
- } = this;
10849
+ const $xeTable = this;
10850
+ const sortOpts = $xeTable.computeSortOpts;
10818
10851
  const {
10819
10852
  field,
10820
10853
  sortable,
@@ -10822,27 +10855,14 @@ const Methods = {
10822
10855
  } = column;
10823
10856
  if (sortable || remoteSort) {
10824
10857
  if (!order || column.order === order) {
10825
- this.clearSort(sortOpts.multiple ? column : null);
10858
+ $xeTable.clearSort(sortOpts.multiple ? column : null);
10826
10859
  } else {
10827
- this.sort({
10860
+ $xeTable.sort({
10828
10861
  field,
10829
10862
  order
10830
10863
  });
10831
10864
  }
10832
- const params = {
10833
- $table: this,
10834
- $event: evnt,
10835
- column,
10836
- field,
10837
- property: field,
10838
- order: column.order,
10839
- sortList: this.getSortColumns(),
10840
- sortTime: column.sortTime
10841
- };
10842
- if (this.mouseConfig && this.mouseOpts.area && this.handleSortEvent) {
10843
- this.handleSortEvent(evnt, params);
10844
- }
10845
- this.emitEvent('sort-change', params, evnt);
10865
+ $xeTable.handleColumnSortEvent(evnt, column);
10846
10866
  }
10847
10867
  },
10848
10868
  /**
@@ -10865,7 +10885,8 @@ const Methods = {
10865
10885
  } = props;
10866
10886
  const rowDragOpts = $xeTable.computeRowDragOpts;
10867
10887
  const {
10868
- fullAllDataRowIdData
10888
+ fullAllDataRowIdData,
10889
+ prevDragToChild
10869
10890
  } = internalData;
10870
10891
  const {
10871
10892
  isCrossDrag,
@@ -10875,6 +10896,7 @@ const Methods = {
10875
10896
  const treeOpts = $xeTable.computeTreeOpts;
10876
10897
  const {
10877
10898
  transform,
10899
+ rowField,
10878
10900
  mapChildrenField,
10879
10901
  parentField
10880
10902
  } = treeOpts;
@@ -10984,7 +11006,7 @@ const Methods = {
10984
11006
  childRow[parentField] = dragRow[parentField];
10985
11007
  });
10986
11008
  }
10987
- dragRow[parentField] = prevDragRow[parentField];
11009
+ dragRow[parentField] = prevDragToChild ? prevDragRow[rowField] : prevDragRow[parentField];
10988
11010
  internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
10989
11011
  key: treeOpts.rowField,
10990
11012
  parentKey: treeOpts.parentField,
@@ -11057,14 +11079,20 @@ const Methods = {
11057
11079
  const {
11058
11080
  dragRow
11059
11081
  } = reactData;
11082
+ const treeOpts = $xeTable.computeTreeOpts;
11083
+ const {
11084
+ transform
11085
+ } = treeOpts;
11060
11086
  const rowDragOpts = $xeTable.computeRowDragOpts;
11061
11087
  const {
11062
- isCrossDrag
11088
+ isCrossDrag,
11089
+ isToChildDrag
11063
11090
  } = rowDragOpts;
11064
11091
  if (!dragRow) {
11065
11092
  evnt.preventDefault();
11066
11093
  return;
11067
11094
  }
11095
+ const hasCtrlKey = evnt.ctrlKey;
11068
11096
  const trEl = evnt.currentTarget;
11069
11097
  const rowid = trEl.getAttribute('rowid') || '';
11070
11098
  const rest = fullAllDataRowIdData[rowid];
@@ -11080,6 +11108,7 @@ const Methods = {
11080
11108
  showDropTip($xeTable, evnt, trEl, null, false, dragPos);
11081
11109
  return;
11082
11110
  }
11111
+ internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && hasCtrlKey);
11083
11112
  internalData.prevDragRow = row;
11084
11113
  internalData.prevDragPos = dragPos;
11085
11114
  showDropTip($xeTable, evnt, trEl, null, true, dragPos);
@@ -11255,6 +11284,7 @@ const Methods = {
11255
11284
  showDropTip($xeTable, evnt, null, thEl, false, dragPos);
11256
11285
  return;
11257
11286
  }
11287
+ internalData.prevDragToChild = false;
11258
11288
  internalData.prevDragCol = column;
11259
11289
  internalData.prevDragPos = dragPos;
11260
11290
  showDropTip($xeTable, evnt, null, thEl, true, dragPos);
@@ -11435,6 +11465,58 @@ const Methods = {
11435
11465
  }
11436
11466
  return this.$nextTick();
11437
11467
  },
11468
+ setSort(sortConfs, isUpdate) {
11469
+ const $xeTable = this;
11470
+ const sortOpts = $xeTable.computeSortOpts;
11471
+ const {
11472
+ multiple,
11473
+ remote,
11474
+ orders
11475
+ } = sortOpts;
11476
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortConfs)) {
11477
+ sortConfs = [sortConfs];
11478
+ }
11479
+ if (sortConfs && sortConfs.length) {
11480
+ if (!multiple) {
11481
+ sortConfs = [sortConfs[0]];
11482
+ clearAllSort($xeTable);
11483
+ }
11484
+ let firstColumn = null;
11485
+ sortConfs.forEach((confs, index) => {
11486
+ let {
11487
+ field,
11488
+ order
11489
+ } = confs;
11490
+ let column = field;
11491
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(field)) {
11492
+ column = $xeTable.getColumnByField(field);
11493
+ }
11494
+ if (!firstColumn) {
11495
+ firstColumn = column;
11496
+ }
11497
+ if (column && column.sortable) {
11498
+ if (orders.indexOf(order) === -1) {
11499
+ order = getNextSortOrder($xeTable, column);
11500
+ }
11501
+ if (column.order !== order) {
11502
+ column.order = order;
11503
+ }
11504
+ column.sortTime = Date.now() + index;
11505
+ }
11506
+ });
11507
+ if (isUpdate) {
11508
+ if (!remote) {
11509
+ $xeTable.handleTableData(true);
11510
+ }
11511
+ $xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
11512
+ }
11513
+ return $xeTable.$nextTick().then(() => {
11514
+ $xeTable.updateCellAreas();
11515
+ return $xeTable.updateStyle();
11516
+ });
11517
+ }
11518
+ return $xeTable.$nextTick();
11519
+ },
11438
11520
  /**
11439
11521
  * 清空指定列的排序条件
11440
11522
  * 如果为空则清空所有列的排序条件
@@ -17494,12 +17576,16 @@ const {
17494
17576
  * @param {ColumnInfo} fieldOrColumn 列
17495
17577
  * @param {Array} options 选项
17496
17578
  */
17497
- _setFilter(fieldOrColumn, options, update) {
17579
+ _setFilter(fieldOrColumn, options, isUpdate) {
17580
+ const $xeTable = this;
17498
17581
  const column = handleFieldOrColumn(this, fieldOrColumn);
17499
17582
  if (column && column.filters) {
17500
17583
  column.filters = toFilters(options || []);
17584
+ if (isUpdate) {
17585
+ return $xeTable.handleColumnConfirmFilter(column, new Event('click'));
17586
+ }
17501
17587
  }
17502
- return update ? this.updateData() : this.$nextTick();
17588
+ return $xeTable.$nextTick();
17503
17589
  },
17504
17590
  checkFilterOptions() {
17505
17591
  const {
@@ -17685,21 +17771,19 @@ const {
17685
17771
  });
17686
17772
  return filterList;
17687
17773
  },
17688
- /**
17689
- * 确认筛选
17690
- * 当筛选面板中的确定按钮被按下时触发
17691
- * @param {Event} evnt 事件
17692
- */
17693
- confirmFilterEvent(evnt) {
17774
+ handleColumnConfirmFilter(column, evnt) {
17775
+ const $xeTable = this;
17776
+ const props = $xeTable;
17777
+ const reactData = $xeTable;
17778
+ const {
17779
+ mouseConfig
17780
+ } = props;
17694
17781
  const {
17695
- filterStore,
17696
- filterOpts,
17697
17782
  scrollXLoad: oldScrollXLoad,
17698
17783
  scrollYLoad: oldScrollYLoad
17699
- } = this;
17700
- const {
17701
- column
17702
- } = filterStore;
17784
+ } = reactData;
17785
+ const filterOpts = $xeTable.computeFilterOpts;
17786
+ const mouseOpts = $xeTable.computeMouseOpts;
17703
17787
  const {
17704
17788
  field
17705
17789
  } = column;
@@ -17728,35 +17812,51 @@ const {
17728
17812
  this.handleTableData(true);
17729
17813
  this.checkSelectionStatus();
17730
17814
  }
17731
- if (this.mouseConfig && this.mouseOpts.area && this.handleFilterEvent) {
17732
- this.handleFilterEvent(evnt, params);
17815
+ if (mouseConfig && mouseOpts.area && this.handleFilterEvent) {
17816
+ $xeTable.handleFilterEvent(evnt, params);
17733
17817
  }
17734
17818
  if (evnt) {
17735
- this.emitEvent('filter-change', params, evnt);
17819
+ $xeTable.emitEvent('filter-change', params, evnt);
17736
17820
  }
17737
- this.closeFilter();
17738
- this.updateFooter().then(() => {
17821
+ $xeTable.closeFilter();
17822
+ return $xeTable.updateFooter().then(() => {
17739
17823
  const {
17740
17824
  scrollXLoad,
17741
17825
  scrollYLoad
17742
17826
  } = this;
17743
17827
  if (oldScrollXLoad || scrollXLoad || oldScrollYLoad || scrollYLoad) {
17744
17828
  if (oldScrollXLoad || scrollXLoad) {
17745
- this.updateScrollXSpace();
17829
+ $xeTable.updateScrollXSpace();
17746
17830
  }
17747
17831
  if (oldScrollYLoad || scrollYLoad) {
17748
- this.updateScrollYSpace();
17832
+ $xeTable.updateScrollYSpace();
17749
17833
  }
17750
- return this.refreshScroll();
17834
+ return $xeTable.refreshScroll();
17751
17835
  }
17752
17836
  }).then(() => {
17753
- this.updateCellAreas();
17754
- return this.recalculate(true);
17837
+ $xeTable.updateCellAreas();
17838
+ return $xeTable.recalculate(true);
17755
17839
  }).then(() => {
17756
17840
  // 存在滚动行为未结束情况
17757
- setTimeout(() => this.recalculate(), 50);
17841
+ setTimeout(() => $xeTable.recalculate(), 50);
17758
17842
  });
17759
17843
  },
17844
+ /**
17845
+ * 确认筛选
17846
+ * 当筛选面板中的确定按钮被按下时触发
17847
+ * @param {Event} evnt 事件
17848
+ */
17849
+ confirmFilterEvent(evnt) {
17850
+ const $xeTable = this;
17851
+ const reactData = $xeTable;
17852
+ const {
17853
+ filterStore
17854
+ } = reactData;
17855
+ const {
17856
+ column
17857
+ } = filterStore;
17858
+ $xeTable.handleColumnConfirmFilter(column, evnt);
17859
+ },
17760
17860
  handleClearFilter(column) {
17761
17861
  if (column) {
17762
17862
  const {
@@ -22565,6 +22665,8 @@ const renderDragTip = (h, $xeTable) => {
22565
22665
  class: 'vxe-table--drag-sort-tip-status'
22566
22666
  }, [h('span', {
22567
22667
  class: ['vxe-table--drag-sort-tip-normal-status', dragRow ? table_getIcon().TABLE_DRAG_STATUS_ROW : table_getIcon().TABLE_DRAG_STATUS_COLUMN]
22668
+ }), h('span', {
22669
+ class: ['vxe-table--drag-sort-tip-sub-status', table_getIcon().TABLE_DRAG_STATUS_SUB_ROW]
22568
22670
  }), h('span', {
22569
22671
  class: ['vxe-table--drag-sort-tip-disabled-status', table_getIcon().TABLE_DRAG_DISABLED]
22570
22672
  })]), h('div', {