vxe-table 4.23.3 → 4.23.5

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 (45) hide show
  1. package/dist/all.esm.js +76 -33
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  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/edit/hook.js +2 -2
  9. package/es/table/src/table.js +72 -29
  10. package/es/table/style.css +30 -11
  11. package/es/table/style.min.css +1 -1
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-table/style.css +30 -11
  15. package/es/vxe-table/style.min.css +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.min.css +1 -1
  18. package/lib/index.umd.js +25 -21
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/module/edit/hook.js +2 -2
  23. package/lib/table/module/edit/hook.min.js +1 -1
  24. package/lib/table/src/table.js +21 -17
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/table/style/style.css +30 -11
  27. package/lib/table/style/style.min.css +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/lib/vxe-table/style/style.css +30 -11
  33. package/lib/vxe-table/style/style.min.css +1 -1
  34. package/package.json +2 -2
  35. package/packages/table/module/edit/hook.ts +2 -2
  36. package/packages/table/src/table.ts +78 -32
  37. package/styles/components/table-module/filter.scss +26 -13
  38. package/styles/components/table.scss +6 -0
  39. package/styles/theme/base.scss +1 -0
  40. /package/es/{iconfont.1792723098707.ttf → iconfont.1792838769925.ttf} +0 -0
  41. /package/es/{iconfont.1792723098707.woff → iconfont.1792838769925.woff} +0 -0
  42. /package/es/{iconfont.1792723098707.woff2 → iconfont.1792838769925.woff2} +0 -0
  43. /package/lib/{iconfont.1792723098707.ttf → iconfont.1792838769925.ttf} +0 -0
  44. /package/lib/{iconfont.1792723098707.woff → iconfont.1792838769925.woff} +0 -0
  45. /package/lib/{iconfont.1792723098707.woff2 → iconfont.1792838769925.woff2} +0 -0
@@ -306,7 +306,7 @@ hooks.add('tableEditModule', {
306
306
  }
307
307
  reactData.removeRowFlag++;
308
308
  reactData.insertRowFlag++;
309
- $xeTable.cacheRowMap(false);
309
+ $xeTable.cacheRowMap(false, false);
310
310
  $xeTable.updateScrollYStatus();
311
311
  $xeTable.handleTableData(treeConfig && transform);
312
312
  if (!(treeConfig && transform)) {
@@ -673,7 +673,7 @@ hooks.add('tableEditModule', {
673
673
  reactData.removeRowFlag++;
674
674
  reactData.insertRowFlag++;
675
675
  reactData.pendingRowFlag++;
676
- $xeTable.cacheRowMap(false);
676
+ $xeTable.cacheRowMap(false, false);
677
677
  $xeTable.handleTableData(treeConfig && transform);
678
678
  $xeTable.updateFooter();
679
679
  $xeTable.handleUpdateBodyMerge();
@@ -993,7 +993,7 @@ export default defineVxeComponent({
993
993
  };
994
994
  const calcVarRowHeightConfig = (sizeKey, sizeEl) => {
995
995
  const { rowHeightStore } = reactData;
996
- if (sizeEl && sizeEl.clientHeight) {
996
+ if (sizeKey && sizeEl && sizeEl.clientHeight) {
997
997
  rowHeightStore[sizeKey] = sizeEl.clientHeight;
998
998
  }
999
999
  };
@@ -1627,7 +1627,7 @@ export default defineVxeComponent({
1627
1627
  internalData.tableFullGroupData = groupRest.treeData;
1628
1628
  reactData.isRowGroupStatus = true;
1629
1629
  reactData.rowGroupList = aggGroupConfs;
1630
- $xeTable.cacheRowMap(false);
1630
+ $xeTable.cacheRowMap(false, false);
1631
1631
  }
1632
1632
  // 如果自定义了顺序
1633
1633
  if (isCustomSort && sortData) {
@@ -3160,7 +3160,7 @@ export default defineVxeComponent({
3160
3160
  }
3161
3161
  }
3162
3162
  };
3163
- const handleAsyncTreeExpandChilds = (row) => {
3163
+ const handleAsyncTreeExpandChilds = (row, autoExpand) => {
3164
3164
  const treeOpts = computeTreeOpts.value;
3165
3165
  const checkboxOpts = computeCheckboxOpts.value;
3166
3166
  const { transform, loadMethod } = treeOpts;
@@ -3184,7 +3184,7 @@ export default defineVxeComponent({
3184
3184
  if (childRecords) {
3185
3185
  return $xeTable.loadTreeChildren(row, childRecords).then(childRows => {
3186
3186
  const { treeExpandedMaps } = internalData;
3187
- if (childRows.length && !treeExpandedMaps[rowid]) {
3187
+ if (autoExpand && childRows.length && !treeExpandedMaps[rowid]) {
3188
3188
  treeExpandedMaps[rowid] = row;
3189
3189
  }
3190
3190
  reactData.treeExpandedFlag++;
@@ -3403,7 +3403,9 @@ export default defineVxeComponent({
3403
3403
  }
3404
3404
  const varEl = refVarElem.value;
3405
3405
  if (varEl) {
3406
- const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
3406
+ const [dxlargeEl, largeEl, defEl, mediumEl, smallEl, miniEl] = varEl.children;
3407
+ calcVarRowHeightConfig('xlarge', dxlargeEl);
3408
+ calcVarRowHeightConfig('large', largeEl);
3407
3409
  calcVarRowHeightConfig('default', defEl);
3408
3410
  calcVarRowHeightConfig('medium', mediumEl);
3409
3411
  calcVarRowHeightConfig('small', smallEl);
@@ -3890,7 +3892,7 @@ export default defineVxeComponent({
3890
3892
  internalData.tableFullTreeData = isRGroup ? [] : treeData;
3891
3893
  internalData.tableFullGroupData = isRGroup ? treeData : [];
3892
3894
  // 缓存数据
3893
- $xeTable.cacheRowMap(isReset);
3895
+ $xeTable.cacheRowMap(isReset, true);
3894
3896
  // 原始数据
3895
3897
  internalData.tableSynchData = datas;
3896
3898
  if (isReset) {
@@ -4361,7 +4363,7 @@ export default defineVxeComponent({
4361
4363
  const isLoad = lazy && row[hasChildField] && !rowRest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
4362
4364
  // 是否使用懒加载
4363
4365
  if (isLoad) {
4364
- result.push(handleAsyncTreeExpandChilds(row));
4366
+ result.push(handleAsyncTreeExpandChilds(row, true));
4365
4367
  }
4366
4368
  else {
4367
4369
  if (row[childrenField] && row[childrenField].length) {
@@ -5352,7 +5354,7 @@ export default defineVxeComponent({
5352
5354
  if (reDelFlag) {
5353
5355
  reactData.removeRowFlag++;
5354
5356
  $xeTable.updateFooter();
5355
- $xeTable.cacheRowMap(false);
5357
+ $xeTable.cacheRowMap(false, true);
5356
5358
  $xeTable.handleTableData(treeConfig && transform);
5357
5359
  if (!(treeConfig && transform)) {
5358
5360
  $xeTable.updateAfterDataIndex();
@@ -7594,7 +7596,7 @@ export default defineVxeComponent({
7594
7596
  * 重新懒加载树节点,并展开该节点
7595
7597
  * @param {Row} row 行对象
7596
7598
  */
7597
- reloadTreeExpand(row) {
7599
+ reloadTreeExpand(row, autoExpand = true) {
7598
7600
  const { treeExpandLazyLoadedMaps } = internalData;
7599
7601
  const treeOpts = computeTreeOpts.value;
7600
7602
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
@@ -7602,7 +7604,7 @@ export default defineVxeComponent({
7602
7604
  const rowid = getRowid($xeTable, row);
7603
7605
  if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
7604
7606
  return $xeTable.clearTreeExpandLoaded(row).then(() => {
7605
- return handleAsyncTreeExpandChilds(row);
7607
+ return handleAsyncTreeExpandChilds(row, autoExpand);
7606
7608
  }).then(() => {
7607
7609
  if (transform) {
7608
7610
  handleVirtualTreeToList();
@@ -9502,7 +9504,7 @@ export default defineVxeComponent({
9502
9504
  internalData.insertRowMaps = iRowMaps;
9503
9505
  internalData.removeRowMaps = rRowMaps;
9504
9506
  internalData.afterFullData = afterFullList;
9505
- $xeTable.cacheRowMap(false);
9507
+ $xeTable.cacheRowMap(false, false);
9506
9508
  $xeTable.handleTableData(treeConfig && transform);
9507
9509
  $xeTable.updateFooter();
9508
9510
  $xeTable.handleUpdateBodyMerge();
@@ -9730,7 +9732,7 @@ export default defineVxeComponent({
9730
9732
  /**
9731
9733
  * 更新数据行的 Map
9732
9734
  */
9733
- cacheRowMap(isReset) {
9735
+ cacheRowMap(isReset, isReLoaded) {
9734
9736
  const { treeConfig } = props;
9735
9737
  const { isRowGroupStatus } = reactData;
9736
9738
  const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps, rowExpandedMaps, selectCheckboxMaps } = internalData;
@@ -9749,8 +9751,10 @@ export default defineVxeComponent({
9749
9751
  fullDataRowIdMaps[rowid] = rowRest;
9750
9752
  fullAllDataRowIdMaps[rowid] = rowRest;
9751
9753
  }
9752
- rowRest.treeLoaded = false;
9753
- rowRest.expandLoaded = false;
9754
+ if (isReset || isReLoaded) {
9755
+ rowRest.treeLoaded = false;
9756
+ rowRest.expandLoaded = false;
9757
+ }
9754
9758
  rowRest._seq = rowNum++;
9755
9759
  rowRest.row = row;
9756
9760
  rowRest.items = items;
@@ -11786,7 +11790,7 @@ export default defineVxeComponent({
11786
11790
  }
11787
11791
  $xeTable.handleClearStack();
11788
11792
  $xeTable.handleTableData(treeConfig && transform);
11789
- $xeTable.cacheRowMap(false);
11793
+ $xeTable.cacheRowMap(false, false);
11790
11794
  updateScrollYStatus();
11791
11795
  if (!(treeConfig && transform)) {
11792
11796
  $xeTable.updateAfterDataIndex();
@@ -12143,31 +12147,62 @@ export default defineVxeComponent({
12143
12147
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
12144
12148
  const { prevDragRow, prevDragPos } = internalData;
12145
12149
  const rowDragOpts = computeRowDragOpts.value;
12146
- const { isCrossTableDrag } = rowDragOpts;
12150
+ const { isCrossDrag, isCrossTableDrag, isAutoExpandToChild, isAutoLazyLoadToChild } = rowDragOpts;
12151
+ const childrenField = treeOpts.children || treeOpts.childrenField;
12147
12152
  // 跨表拖拽
12148
- if (isCrossTableDrag && crossTableDragRowObj) {
12153
+ if (isCrossTableDrag && (!treeConfig || isCrossDrag) && crossTableDragRowObj) {
12149
12154
  const { $newTable } = crossTableDragRowObj;
12150
12155
  if ($newTable && $newTable.xID !== $xeTable.xID) {
12151
12156
  $newTable.handleCrossTableRowDragInsertEvent(evnt);
12152
12157
  return;
12153
12158
  }
12154
12159
  }
12155
- if (treeConfig && lazy && prevDragToChild) {
12160
+ if (treeConfig && prevDragToChild) {
12156
12161
  // 懒加载
12157
- const newRowid = getRowid($xeTable, prevDragRow);
12158
- const rowRest = fullAllDataRowIdData[newRowid];
12159
- if (prevDragRow[hasChildField]) {
12160
- if (rowRest && rowRest.treeLoaded) {
12162
+ const prevRowid = getRowid($xeTable, prevDragRow);
12163
+ const rowRest = fullAllDataRowIdData[prevRowid];
12164
+ if (!rowRest) {
12165
+ handleRowDragEndClearStatus();
12166
+ return;
12167
+ }
12168
+ const hasLazyChilds = prevDragRow[hasChildField];
12169
+ const rowChilds = prevDragRow[childrenField];
12170
+ // 如果懒加载节点未被加载
12171
+ if (isAutoExpandToChild) {
12172
+ // 判断目标节点是否有树子级
12173
+ if ((lazy && hasLazyChilds) || (rowChilds && rowChilds.length)) {
12174
+ hideDropTip();
12175
+ $xeTable.setTreeExpand(prevDragRow, true).then(() => {
12176
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
12177
+ });
12178
+ return;
12179
+ }
12180
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild).then(() => {
12181
+ if (!$xeTable.isTreeExpandByRow(prevDragRow)) {
12182
+ $xeTable.setTreeExpand(prevDragRow, true);
12183
+ }
12184
+ });
12185
+ return;
12186
+ }
12187
+ // 如果是懒加载节点。只加载不自动展开
12188
+ if ((lazy && hasLazyChilds) && isAutoLazyLoadToChild) {
12189
+ if (rowChilds && rowChilds.length) {
12161
12190
  $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
12191
+ return;
12162
12192
  }
12193
+ hideDropTip();
12194
+ $xeTable.reloadTreeExpand(prevDragRow, false).then(() => {
12195
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
12196
+ });
12197
+ return;
12163
12198
  }
12164
- else {
12165
- $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
12199
+ // 懒加载的行默认需要先展开过后才允许拖拽,除非启用 isAutoExpandToChild | isAutoLazyLoadToChild
12200
+ if (lazy && hasLazyChilds && !rowRest.treeLoaded) {
12201
+ handleRowDragEndClearStatus();
12202
+ return;
12166
12203
  }
12167
12204
  }
12168
- else {
12169
- $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
12170
- }
12205
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
12171
12206
  },
12172
12207
  handleRowDragDragoverEvent(evnt) {
12173
12208
  const { treeConfig } = props;
@@ -12177,7 +12212,7 @@ export default defineVxeComponent({
12177
12212
  const { lazy, transform, parentField } = treeOpts;
12178
12213
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
12179
12214
  const rowDragOpts = computeRowDragOpts.value;
12180
- const { isPeerDrag, isCrossDrag, isToChildDrag, isCrossTableDrag } = rowDragOpts;
12215
+ const { isPeerDrag, isCrossDrag, isToChildDrag, isCrossTableDrag, isAutoLazyLoadToChild, isAutoExpandToChild } = rowDragOpts;
12181
12216
  if (!dragRow && !(isCrossTableDrag && (!treeConfig || isCrossDrag) && crossTableDragRowObj)) {
12182
12217
  evnt.preventDefault();
12183
12218
  return;
@@ -12221,7 +12256,7 @@ export default defineVxeComponent({
12221
12256
  }
12222
12257
  }
12223
12258
  if ($xeTable.eqRow(dragRow, row) ||
12224
- (isControlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
12259
+ (isControlKey && treeConfig && lazy && row[hasChildField] && (rowRest && !rowRest.treeLoaded) && !isAutoLazyLoadToChild && !isAutoExpandToChild) ||
12225
12260
  (!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rowRest.level))) {
12226
12261
  showDropTip(evnt, trEl, null, false, dragPos);
12227
12262
  return;
@@ -14166,12 +14201,20 @@ export default defineVxeComponent({
14166
14201
  * 隐藏列
14167
14202
  */
14168
14203
  h('div', {
14204
+ key: 'tss',
14169
14205
  class: 'vxe-table-slots'
14170
14206
  }, slots.default ? slots.default({}) : []),
14171
14207
  h('div', {
14208
+ key: 'tvr',
14172
14209
  ref: refVarElem,
14173
14210
  class: 'vxe-table-vars'
14174
14211
  }, [
14212
+ h('div', {
14213
+ class: 'vxe-table-var-xlarge'
14214
+ }),
14215
+ h('div', {
14216
+ class: 'vxe-table-var-large'
14217
+ }),
14175
14218
  h('div', {
14176
14219
  class: 'vxe-table-var-default'
14177
14220
  }),
@@ -1580,6 +1580,25 @@
1580
1580
  vertical-align: middle;
1581
1581
  }
1582
1582
 
1583
+ .vxe-table--filter-wrapper {
1584
+ --vxe-ui-table-filter-current-font-size: var(--vxe-ui-font-size-default);
1585
+ }
1586
+ .vxe-table--filter-wrapper.size--xlarge {
1587
+ --vxe-ui-table-filter-current-font-size: var(--vxe-ui-font-size-xlarge);
1588
+ }
1589
+ .vxe-table--filter-wrapper.size--large {
1590
+ --vxe-ui-table-filter-current-font-size: var(--vxe-ui-font-size-large);
1591
+ }
1592
+ .vxe-table--filter-wrapper.size--medium {
1593
+ --vxe-ui-table-filter-current-font-size: var(--vxe-ui-font-size-medium);
1594
+ }
1595
+ .vxe-table--filter-wrapper.size--small {
1596
+ --vxe-ui-table-filter-current-font-size: var(--vxe-ui-font-size-small);
1597
+ }
1598
+ .vxe-table--filter-wrapper.size--mini {
1599
+ --vxe-ui-table-filter-current-font-size: var(--vxe-ui-font-size-mini);
1600
+ }
1601
+
1583
1602
  .vxe-cell--filter {
1584
1603
  padding: 0 0.1em 0 0.2em;
1585
1604
  text-align: center;
@@ -1618,8 +1637,12 @@
1618
1637
  z-index: 15;
1619
1638
  max-height: var(--vxe-ui-vxe-table-filter-default-max-height);
1620
1639
  }
1640
+ .vxe-table--filter-wrapper[class^=size--], .vxe-table--filter-wrapper[class*=" size--"] {
1641
+ font-size: var(--vxe-ui-table-filter-current-font-size);
1642
+ }
1621
1643
  .vxe-table--filter-wrapper:not(.is--multiple) .vxe-table--filter-header,
1622
- .vxe-table--filter-wrapper:not(.is--multiple) .vxe-table--filter-body {
1644
+ .vxe-table--filter-wrapper:not(.is--multiple) .vxe-table--filter-body,
1645
+ .vxe-table--filter-wrapper:not(.is--multiple) .vxe-table--scrollbar-filter-body {
1623
1646
  text-align: center;
1624
1647
  }
1625
1648
  .vxe-table--filter-wrapper.is--active {
@@ -1746,16 +1769,6 @@
1746
1769
  vertical-align: middle;
1747
1770
  }
1748
1771
 
1749
- .vxe-table--filter-wrapper.size--medium {
1750
- font-size: var(--vxe-ui-font-size-medium);
1751
- }
1752
- .vxe-table--filter-wrapper.size--small {
1753
- font-size: var(--vxe-ui-font-size-small);
1754
- }
1755
- .vxe-table--filter-wrapper.size--mini {
1756
- font-size: var(--vxe-ui-font-size-mini);
1757
- }
1758
-
1759
1772
  .vxe-table--context-menu-wrapper {
1760
1773
  display: none;
1761
1774
  }
@@ -1892,6 +1905,12 @@
1892
1905
  user-select: none;
1893
1906
  pointer-events: none;
1894
1907
  }
1908
+ .vxe-table-vars .vxe-table-var-xlarge {
1909
+ height: var(--vxe-ui-table-row-height-xlarge);
1910
+ }
1911
+ .vxe-table-vars .vxe-table-var-large {
1912
+ height: var(--vxe-ui-table-row-height-large);
1913
+ }
1895
1914
  .vxe-table-vars .vxe-table-var-default {
1896
1915
  height: var(--vxe-ui-table-row-height-default);
1897
1916
  }