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
@@ -503,6 +503,7 @@ const updateColDropTipContent = ($xeTable, tdEl) => {
503
503
  };
504
504
  function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
505
505
  const reactData = $xeTable;
506
+ const internalData = $xeTable;
506
507
  const el = $xeTable.$refs.refElem;
507
508
  if (!el) {
508
509
  return;
@@ -511,6 +512,9 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
511
512
  scrollbarWidth,
512
513
  scrollbarHeight
513
514
  } = reactData;
515
+ const {
516
+ prevDragToChild
517
+ } = internalData;
514
518
  const wrapperRect = el.getBoundingClientRect();
515
519
  if (trEl) {
516
520
  const rdLineEl = $xeTable.$refs.refDragRowLineElem;
@@ -522,6 +526,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
522
526
  rdLineEl.style.height = `${trRect.height}px`;
523
527
  rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
524
528
  rdLineEl.setAttribute('drag-pos', dragPos);
529
+ rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
525
530
  } else {
526
531
  rdLineEl.style.display = '';
527
532
  }
@@ -546,7 +551,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
546
551
  rdTipEl.style.display = 'block';
547
552
  rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
548
553
  rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
549
- rdTipEl.setAttribute('drag-status', showLine ? 'normal' : 'disabled');
554
+ rdTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
550
555
  }
551
556
  }
552
557
  const hideDropTip = $xeTable => {
@@ -5954,13 +5959,40 @@ const Methods = {
5954
5959
  }
5955
5960
  }
5956
5961
  },
5962
+ handleColumnSortEvent(evnt, column) {
5963
+ const $xeTable = this;
5964
+ const props = $xeTable;
5965
+ const {
5966
+ mouseConfig
5967
+ } = props;
5968
+ const mouseOpts = $xeTable.computeMouseOpts;
5969
+ const {
5970
+ field,
5971
+ sortable
5972
+ } = column;
5973
+ if (sortable) {
5974
+ const params = {
5975
+ $table: $xeTable,
5976
+ $event: evnt,
5977
+ column,
5978
+ field,
5979
+ property: field,
5980
+ order: column.order,
5981
+ sortList: $xeTable.getSortColumns(),
5982
+ sortTime: column.sortTime
5983
+ };
5984
+ if (mouseConfig && mouseOpts.area && $xeTable.handleSortEvent) {
5985
+ $xeTable.handleSortEvent(evnt, params);
5986
+ }
5987
+ $xeTable.dispatchEvent('sort-change', params, evnt);
5988
+ }
5989
+ },
5957
5990
  /**
5958
5991
  * 点击排序事件
5959
5992
  */
5960
5993
  triggerSortEvent(evnt, column, order) {
5961
- const {
5962
- sortOpts
5963
- } = this;
5994
+ const $xeTable = this;
5995
+ const sortOpts = $xeTable.computeSortOpts;
5964
5996
  const {
5965
5997
  field,
5966
5998
  sortable,
@@ -5968,27 +6000,14 @@ const Methods = {
5968
6000
  } = column;
5969
6001
  if (sortable || remoteSort) {
5970
6002
  if (!order || column.order === order) {
5971
- this.clearSort(sortOpts.multiple ? column : null);
6003
+ $xeTable.clearSort(sortOpts.multiple ? column : null);
5972
6004
  } else {
5973
- this.sort({
6005
+ $xeTable.sort({
5974
6006
  field,
5975
6007
  order
5976
6008
  });
5977
6009
  }
5978
- const params = {
5979
- $table: this,
5980
- $event: evnt,
5981
- column,
5982
- field,
5983
- property: field,
5984
- order: column.order,
5985
- sortList: this.getSortColumns(),
5986
- sortTime: column.sortTime
5987
- };
5988
- if (this.mouseConfig && this.mouseOpts.area && this.handleSortEvent) {
5989
- this.handleSortEvent(evnt, params);
5990
- }
5991
- this.emitEvent('sort-change', params, evnt);
6010
+ $xeTable.handleColumnSortEvent(evnt, column);
5992
6011
  }
5993
6012
  },
5994
6013
  /**
@@ -6011,7 +6030,8 @@ const Methods = {
6011
6030
  } = props;
6012
6031
  const rowDragOpts = $xeTable.computeRowDragOpts;
6013
6032
  const {
6014
- fullAllDataRowIdData
6033
+ fullAllDataRowIdData,
6034
+ prevDragToChild
6015
6035
  } = internalData;
6016
6036
  const {
6017
6037
  isCrossDrag,
@@ -6021,6 +6041,7 @@ const Methods = {
6021
6041
  const treeOpts = $xeTable.computeTreeOpts;
6022
6042
  const {
6023
6043
  transform,
6044
+ rowField,
6024
6045
  mapChildrenField,
6025
6046
  parentField
6026
6047
  } = treeOpts;
@@ -6130,7 +6151,7 @@ const Methods = {
6130
6151
  childRow[parentField] = dragRow[parentField];
6131
6152
  });
6132
6153
  }
6133
- dragRow[parentField] = prevDragRow[parentField];
6154
+ dragRow[parentField] = prevDragToChild ? prevDragRow[rowField] : prevDragRow[parentField];
6134
6155
  internalData.tableFullTreeData = _xeUtils.default.toArrayTree(fullList, {
6135
6156
  key: treeOpts.rowField,
6136
6157
  parentKey: treeOpts.parentField,
@@ -6203,14 +6224,20 @@ const Methods = {
6203
6224
  const {
6204
6225
  dragRow
6205
6226
  } = reactData;
6227
+ const treeOpts = $xeTable.computeTreeOpts;
6228
+ const {
6229
+ transform
6230
+ } = treeOpts;
6206
6231
  const rowDragOpts = $xeTable.computeRowDragOpts;
6207
6232
  const {
6208
- isCrossDrag
6233
+ isCrossDrag,
6234
+ isToChildDrag
6209
6235
  } = rowDragOpts;
6210
6236
  if (!dragRow) {
6211
6237
  evnt.preventDefault();
6212
6238
  return;
6213
6239
  }
6240
+ const hasCtrlKey = evnt.ctrlKey;
6214
6241
  const trEl = evnt.currentTarget;
6215
6242
  const rowid = trEl.getAttribute('rowid') || '';
6216
6243
  const rest = fullAllDataRowIdData[rowid];
@@ -6226,6 +6253,7 @@ const Methods = {
6226
6253
  showDropTip($xeTable, evnt, trEl, null, false, dragPos);
6227
6254
  return;
6228
6255
  }
6256
+ internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && hasCtrlKey);
6229
6257
  internalData.prevDragRow = row;
6230
6258
  internalData.prevDragPos = dragPos;
6231
6259
  showDropTip($xeTable, evnt, trEl, null, true, dragPos);
@@ -6402,6 +6430,7 @@ const Methods = {
6402
6430
  showDropTip($xeTable, evnt, null, thEl, false, dragPos);
6403
6431
  return;
6404
6432
  }
6433
+ internalData.prevDragToChild = false;
6405
6434
  internalData.prevDragCol = column;
6406
6435
  internalData.prevDragPos = dragPos;
6407
6436
  showDropTip($xeTable, evnt, null, thEl, true, dragPos);
@@ -6579,6 +6608,58 @@ const Methods = {
6579
6608
  }
6580
6609
  return this.$nextTick();
6581
6610
  },
6611
+ setSort(sortConfs, isUpdate) {
6612
+ const $xeTable = this;
6613
+ const sortOpts = $xeTable.computeSortOpts;
6614
+ const {
6615
+ multiple,
6616
+ remote,
6617
+ orders
6618
+ } = sortOpts;
6619
+ if (!_xeUtils.default.isArray(sortConfs)) {
6620
+ sortConfs = [sortConfs];
6621
+ }
6622
+ if (sortConfs && sortConfs.length) {
6623
+ if (!multiple) {
6624
+ sortConfs = [sortConfs[0]];
6625
+ clearAllSort($xeTable);
6626
+ }
6627
+ let firstColumn = null;
6628
+ sortConfs.forEach((confs, index) => {
6629
+ let {
6630
+ field,
6631
+ order
6632
+ } = confs;
6633
+ let column = field;
6634
+ if (_xeUtils.default.isString(field)) {
6635
+ column = $xeTable.getColumnByField(field);
6636
+ }
6637
+ if (!firstColumn) {
6638
+ firstColumn = column;
6639
+ }
6640
+ if (column && column.sortable) {
6641
+ if (orders.indexOf(order) === -1) {
6642
+ order = getNextSortOrder($xeTable, column);
6643
+ }
6644
+ if (column.order !== order) {
6645
+ column.order = order;
6646
+ }
6647
+ column.sortTime = Date.now() + index;
6648
+ }
6649
+ });
6650
+ if (isUpdate) {
6651
+ if (!remote) {
6652
+ $xeTable.handleTableData(true);
6653
+ }
6654
+ $xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
6655
+ }
6656
+ return $xeTable.$nextTick().then(() => {
6657
+ $xeTable.updateCellAreas();
6658
+ return $xeTable.updateStyle();
6659
+ });
6660
+ }
6661
+ return $xeTable.$nextTick();
6662
+ },
6582
6663
  /**
6583
6664
  * 清空指定列的排序条件
6584
6665
  * 如果为空则清空所有列的排序条件