vxe-table 4.19.6 → 4.19.8

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 (39) hide show
  1. package/dist/all.esm.js +203 -75
  2. package/dist/style.css +1 -1
  3. package/es/grid/src/grid.js +1 -1
  4. package/es/style.css +1 -1
  5. package/es/table/src/body.js +11 -11
  6. package/es/table/src/group.js +3 -0
  7. package/es/table/src/table.js +169 -61
  8. package/es/table/src/util.js +18 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/grid/src/grid.js +1 -1
  12. package/lib/grid/src/grid.min.js +1 -1
  13. package/lib/index.umd.js +70 -31
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/table/src/body.js +11 -11
  17. package/lib/table/src/body.min.js +1 -1
  18. package/lib/table/src/group.js +3 -0
  19. package/lib/table/src/group.min.js +1 -1
  20. package/lib/table/src/table.js +35 -16
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/table/src/util.js +19 -1
  23. package/lib/table/src/util.min.js +1 -1
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/log.js +1 -1
  27. package/lib/ui/src/log.min.js +1 -1
  28. package/package.json +2 -2
  29. package/packages/grid/src/grid.ts +1 -1
  30. package/packages/table/src/body.ts +13 -13
  31. package/packages/table/src/group.ts +4 -0
  32. package/packages/table/src/table.ts +175 -63
  33. package/packages/table/src/util.ts +21 -1
  34. /package/es/{iconfont.1780293024194.ttf → iconfont.1780726776354.ttf} +0 -0
  35. /package/es/{iconfont.1780293024194.woff → iconfont.1780726776354.woff} +0 -0
  36. /package/es/{iconfont.1780293024194.woff2 → iconfont.1780726776354.woff2} +0 -0
  37. /package/lib/{iconfont.1780293024194.ttf → iconfont.1780726776354.ttf} +0 -0
  38. /package/lib/{iconfont.1780293024194.woff → iconfont.1780726776354.woff} +0 -0
  39. /package/lib/{iconfont.1780293024194.woff2 → iconfont.1780726776354.woff2} +0 -0
@@ -345,21 +345,11 @@ export default defineVxeComponent({
345
345
  class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
346
346
  }, column.renderCell(cellParams)));
347
347
  }
348
- tdVNs.push(h('div', {
349
- key: 'tc',
350
- class: ['vxe-cell', {
351
- 'c--title': showTitle,
352
- 'c--tooltip': showTooltip,
353
- 'c--ellipsis': showEllipsis
354
- }],
355
- style: tcStyle,
356
- title: showTitle ? $xeTable.getCellLabel(row, column) : null
357
- }, clVNs));
358
348
  if (showValidTip && errorValidItem) {
359
349
  const errRule = errorValidItem.rule;
360
350
  const validSlot = slots ? slots.valid : null;
361
351
  const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
362
- tdVNs.push(h('div', {
352
+ clVNs.push(h('div', {
363
353
  key: 'tcv',
364
354
  class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
365
355
  style: errRule && errRule.maxWidth
@@ -381,6 +371,16 @@ export default defineVxeComponent({
381
371
  ])
382
372
  ]));
383
373
  }
374
+ tdVNs.push(h('div', {
375
+ key: 'tc',
376
+ class: ['vxe-cell', {
377
+ 'c--title': showTitle,
378
+ 'c--tooltip': showTooltip,
379
+ 'c--ellipsis': showEllipsis
380
+ }],
381
+ style: tcStyle,
382
+ title: showTitle ? $xeTable.getCellLabel(row, column) : null
383
+ }, clVNs));
384
384
  }
385
385
  let showAreaRowStatus = false;
386
386
  if (mouseConfig && mouseOpts.area && !_columnIndex && selectCellToRow) {
@@ -18,6 +18,9 @@ export default defineVxeComponent({
18
18
  if (slots.header) {
19
19
  columnSlots.header = slots.header;
20
20
  }
21
+ if (slots.title) {
22
+ columnSlots.title = slots.title;
23
+ }
21
24
  columnConfig.slots = columnSlots;
22
25
  columnConfig.children = [];
23
26
  watchColumn($xeTable, props, columnConfig);
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils';
4
4
  import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasEventInputTarget } from '../../ui/src/dom';
5
5
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
6
6
  import { VxeUI } from '../../ui';
7
- import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn } from './util';
7
+ import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight } from './util';
8
8
  import { getSlotVNs } from '../../ui/src/vn';
9
9
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
10
10
  import { warnLog, errLog } from '../../ui/src/log';
@@ -1962,34 +1962,38 @@ export default defineVxeComponent({
1962
1962
  /**
1963
1963
  * 计算自适应行高
1964
1964
  */
1965
- const calcCellAutoHeight = (rowRest, wrapperEl) => {
1966
- const { scrollXLoad } = reactData;
1965
+ const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
1966
+ const { fullCellHeightMaps } = internalData;
1967
+ let chRest = fullCellHeightMaps[rowid];
1968
+ if (!chRest) {
1969
+ chRest = {};
1970
+ fullCellHeightMaps[rowid] = chRest;
1971
+ }
1967
1972
  const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
1968
- let colHeight = 0;
1969
1973
  let firstCellStyle = null;
1970
1974
  let topBottomPadding = 0;
1975
+ let changeCH = false;
1971
1976
  for (let i = 0; i < wrapperElemList.length; i++) {
1972
1977
  const wrapperElem = wrapperElemList[i];
1973
1978
  const cellElem = wrapperElem.parentElement;
1974
1979
  const cellStyle = cellElem.style;
1975
1980
  const orHeight = cellStyle.height;
1976
- if (!scrollXLoad) {
1977
- cellStyle.height = '';
1978
- }
1981
+ const colid = wrapperElem.getAttribute('colid') || '';
1982
+ cellStyle.height = '';
1979
1983
  if (!firstCellStyle) {
1980
1984
  firstCellStyle = getComputedStyle(cellElem);
1981
1985
  topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
1982
1986
  }
1983
- if (!scrollXLoad) {
1984
- cellStyle.height = orHeight;
1985
- }
1986
1987
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
1987
- colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
1988
- }
1989
- if (scrollXLoad) {
1990
- colHeight = Math.max(colHeight, rowRest.height);
1988
+ const colHeight = Math.ceil(cellHeight + topBottomPadding);
1989
+ if (chRest[colid] !== colHeight) {
1990
+ changeCH = true;
1991
+ chRest[colid] = colHeight;
1992
+ }
1993
+ cellStyle.height = orHeight;
1991
1994
  }
1992
- return colHeight;
1995
+ const cellMaxHeight = getRowMaxHeight(chRest, changeCH);
1996
+ return cellMaxHeight;
1993
1997
  };
1994
1998
  /**
1995
1999
  * 自适应行高
@@ -2011,7 +2015,7 @@ export default defineVxeComponent({
2011
2015
  const rowid = handleGetRowId(row);
2012
2016
  const rowRest = fullAllDataRowIdData[rowid];
2013
2017
  if (rowRest) {
2014
- const reHeight = calcCellAutoHeight(rowRest, el);
2018
+ const reHeight = calcCellAutoHeight(rowid, rowRest, el);
2015
2019
  rowRest.height = Math.max(defaultRowHeight, reHeight);
2016
2020
  }
2017
2021
  el.removeAttribute('data-calc-row');
@@ -2437,7 +2441,7 @@ export default defineVxeComponent({
2437
2441
  xScrollbarVisible = 'hidden';
2438
2442
  }
2439
2443
  let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
2440
- if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
2444
+ if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
2441
2445
  osbWidth = 0;
2442
2446
  yScrollbarVisible = 'hidden';
2443
2447
  }
@@ -3281,7 +3285,6 @@ export default defineVxeComponent({
3281
3285
  };
3282
3286
  const handleRecalculateStyle = (reFull, reWidth, reHeight) => {
3283
3287
  const el = refElem.value;
3284
- internalData.rceRunTime = Date.now();
3285
3288
  if (!el || !el.clientWidth) {
3286
3289
  return nextTick();
3287
3290
  }
@@ -3305,6 +3308,7 @@ export default defineVxeComponent({
3305
3308
  if (reFull) {
3306
3309
  updateTreeLineStyle();
3307
3310
  }
3311
+ internalData.rceRunTime = Date.now();
3308
3312
  return computeScrollLoad().then(() => {
3309
3313
  // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
3310
3314
  if (reWidth) {
@@ -3325,18 +3329,30 @@ export default defineVxeComponent({
3325
3329
  if (reFull) {
3326
3330
  updateTreeLineStyle();
3327
3331
  }
3332
+ internalData.rceRunTime = Date.now();
3328
3333
  if (reFull) {
3329
3334
  return computeScrollLoad();
3330
3335
  }
3331
3336
  });
3332
3337
  };
3338
+ const minRunDelay = 50;
3333
3339
  const handleLazyRecalculate = (reFull, reWidth, reHeight) => {
3334
3340
  return new Promise(resolve => {
3335
3341
  const $xeGanttView = internalData.xeGanttView;
3336
3342
  const { customStore } = reactData;
3337
3343
  const { rceTimeout, rceRunTime } = internalData;
3338
3344
  const resizeOpts = computeResizeOpts.value;
3339
- const refreshDelay = resizeOpts.refreshDelay || 20;
3345
+ let rceDelay = internalData.rceDelay;
3346
+ // 如果在500毫秒内频繁执行,则执行次数减缓
3347
+ if (rceRunTime && rceRunTime > Date.now() - 500) {
3348
+ rceDelay += 50;
3349
+ }
3350
+ else {
3351
+ rceDelay = 0;
3352
+ }
3353
+ internalData.rceDelay = rceDelay;
3354
+ const refreshDelay = resizeOpts.refreshDelay || 30;
3355
+ const reDelay = rceDelay + refreshDelay;
3340
3356
  const el = refElem.value;
3341
3357
  if (el && el.clientWidth) {
3342
3358
  autoCellWidth();
@@ -3347,7 +3363,7 @@ export default defineVxeComponent({
3347
3363
  }
3348
3364
  if (rceTimeout) {
3349
3365
  clearTimeout(rceTimeout);
3350
- if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
3366
+ if (rceRunTime && rceRunTime + minRunDelay < Date.now()) {
3351
3367
  resolve(handleRecalculateStyle(reFull, reWidth, reHeight));
3352
3368
  }
3353
3369
  else {
@@ -3365,11 +3381,23 @@ export default defineVxeComponent({
3365
3381
  internalData.rceTimeout = setTimeout(() => {
3366
3382
  internalData.rceTimeout = undefined;
3367
3383
  handleRecalculateStyle(reFull, reWidth, reHeight);
3368
- }, refreshDelay);
3384
+ if ($xeGanttView && $xeGanttView.handleLazyRecalculate) {
3385
+ $xeGanttView.handleLazyRecalculate();
3386
+ }
3387
+ }, reDelay);
3369
3388
  });
3370
3389
  };
3390
+ let resizePending = false;
3371
3391
  const handleResizeEvent = () => {
3372
- handleLazyRecalculate(true, true, true);
3392
+ if (resizePending) {
3393
+ return;
3394
+ }
3395
+ resizePending = true;
3396
+ handleLazyRecalculate(true, true, true).then(() => {
3397
+ resizePending = false;
3398
+ }).catch(() => {
3399
+ resizePending = false;
3400
+ });
3373
3401
  };
3374
3402
  const handleUpdateAggValues = () => {
3375
3403
  const { visibleColumn } = internalData;
@@ -3713,6 +3741,7 @@ export default defineVxeComponent({
3713
3741
  reactData.insertRowFlag++;
3714
3742
  internalData.removeRowMaps = {};
3715
3743
  reactData.removeRowFlag++;
3744
+ internalData.fullCellHeightMaps = {};
3716
3745
  const sYLoad = updateScrollYStatus(fullData);
3717
3746
  // 全量数据
3718
3747
  internalData.tableFullData = fullData;
@@ -3744,6 +3773,7 @@ export default defineVxeComponent({
3744
3773
  updateStyle();
3745
3774
  }).then(() => {
3746
3775
  computeScrollLoad();
3776
+ syncGanttScrollYStatus();
3747
3777
  }).then(() => {
3748
3778
  const virtualYOpts = computeVirtualYOpts.value;
3749
3779
  // 是否启用了虚拟滚动
@@ -3803,6 +3833,7 @@ export default defineVxeComponent({
3803
3833
  reactData.isRowLoading = false;
3804
3834
  handleRecalculateStyle(false, false, false);
3805
3835
  updateTreeLineStyle();
3836
+ syncGanttScrollYStatus();
3806
3837
  // 如果是自动行高,特殊情况需调用 recalculate 手动刷新
3807
3838
  if (!props.showOverflow) {
3808
3839
  setTimeout(() => {
@@ -4071,8 +4102,42 @@ export default defineVxeComponent({
4071
4102
  internalData.fullColumnIdData = fullColIdData;
4072
4103
  internalData.fullColumnFieldData = fullColFieldData;
4073
4104
  };
4074
- const handleInitColumn = (collectColumn) => {
4105
+ const buildColumnInfo = () => {
4106
+ const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
4075
4107
  const expandOpts = computeExpandOpts.value;
4108
+ cacheColumnMap();
4109
+ parseColumns(true).then(() => {
4110
+ if (reactData.scrollXLoad) {
4111
+ loadScrollXData();
4112
+ }
4113
+ });
4114
+ $xeTable.clearHeaderFormatterCache();
4115
+ $xeTable.clearMergeCells();
4116
+ $xeTable.clearMergeFooterItems();
4117
+ $xeTable.handleTableData(true);
4118
+ $xeTable.handleAggregateSummaryData();
4119
+ if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
4120
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
4121
+ }
4122
+ return nextTick().then(() => {
4123
+ if ($xeToolbar) {
4124
+ $xeToolbar.syncUpdate({
4125
+ collectColumn: internalData.collectColumn,
4126
+ $table: $xeTable
4127
+ });
4128
+ }
4129
+ if ($xeTable.handleUpdateCustomColumn) {
4130
+ $xeTable.handleUpdateCustomColumn();
4131
+ }
4132
+ const columnOpts = computeColumnOpts.value;
4133
+ if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
4134
+ warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
4135
+ }
4136
+ reactData.isColLoading = false;
4137
+ return handleLazyRecalculate(false, true, true);
4138
+ });
4139
+ };
4140
+ const handleInitColumn = (collectColumn) => {
4076
4141
  internalData.collectColumn = collectColumn;
4077
4142
  const tFullColumn = getColumnList(collectColumn);
4078
4143
  internalData.tableFullColumn = tFullColumn;
@@ -4080,38 +4145,7 @@ export default defineVxeComponent({
4080
4145
  reactData.isColLoading = true;
4081
4146
  initColumnHierarchy();
4082
4147
  return Promise.resolve(restoreCustomStorage()).then(() => {
4083
- const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
4084
- cacheColumnMap();
4085
- parseColumns(true).then(() => {
4086
- if (reactData.scrollXLoad) {
4087
- loadScrollXData();
4088
- }
4089
- });
4090
- $xeTable.clearHeaderFormatterCache();
4091
- $xeTable.clearMergeCells();
4092
- $xeTable.clearMergeFooterItems();
4093
- $xeTable.handleTableData(true);
4094
- $xeTable.handleAggregateSummaryData();
4095
- if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
4096
- warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
4097
- }
4098
- return nextTick().then(() => {
4099
- if ($xeToolbar) {
4100
- $xeToolbar.syncUpdate({
4101
- collectColumn: internalData.collectColumn,
4102
- $table: $xeTable
4103
- });
4104
- }
4105
- if ($xeTable.handleUpdateCustomColumn) {
4106
- $xeTable.handleUpdateCustomColumn();
4107
- }
4108
- const columnOpts = computeColumnOpts.value;
4109
- if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
4110
- warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
4111
- }
4112
- reactData.isColLoading = false;
4113
- return handleLazyRecalculate(false, true, true);
4114
- });
4148
+ return buildColumnInfo();
4115
4149
  });
4116
4150
  };
4117
4151
  const updateScrollXStatus = (fullColumn) => {
@@ -4122,9 +4156,14 @@ export default defineVxeComponent({
4122
4156
  reactData.scrollXLoad = scrollXLoad;
4123
4157
  return scrollXLoad;
4124
4158
  };
4159
+ const syncGanttScrollYStatus = () => {
4160
+ const $xeGanttView = internalData.xeGanttView;
4161
+ if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
4162
+ $xeGanttView.handleUpdateSYStatus(reactData.scrollYLoad);
4163
+ }
4164
+ };
4125
4165
  const updateScrollYStatus = (fullData) => {
4126
4166
  const { treeConfig } = props;
4127
- const $xeGanttView = internalData.xeGanttView;
4128
4167
  const virtualYOpts = computeVirtualYOpts.value;
4129
4168
  const treeOpts = computeTreeOpts.value;
4130
4169
  const { transform } = treeOpts;
@@ -4132,9 +4171,7 @@ export default defineVxeComponent({
4132
4171
  // 如果gt为0,则总是启用
4133
4172
  const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
4134
4173
  reactData.scrollYLoad = scrollYLoad;
4135
- if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
4136
- $xeGanttView.handleUpdateSYStatus(scrollYLoad);
4137
- }
4174
+ syncGanttScrollYStatus();
4138
4175
  return scrollYLoad;
4139
4176
  };
4140
4177
  /**
@@ -6049,7 +6086,7 @@ export default defineVxeComponent({
6049
6086
  const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
6050
6087
  const rowRest = fullAllDataRowIdData[rowid];
6051
6088
  if (rowRest) {
6052
- rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
6089
+ rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
6053
6090
  }
6054
6091
  el.removeAttribute('data-calc-row');
6055
6092
  });
@@ -7803,6 +7840,65 @@ export default defineVxeComponent({
7803
7840
  clearHistory() {
7804
7841
  return $xeTable.handleClearStack();
7805
7842
  },
7843
+ /**
7844
+ * 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
7845
+ * @param storeData
7846
+ * @returns
7847
+ */
7848
+ setCustomStoreData(storeData) {
7849
+ if (!storeData) {
7850
+ return nextTick();
7851
+ }
7852
+ const customOpts = computeCustomOpts.value;
7853
+ const { checkMethod } = customOpts;
7854
+ // 重置状态
7855
+ clearTableAllStatus($xeTable);
7856
+ // 恢复列
7857
+ const allCols = [];
7858
+ XEUtils.eachTree(internalData.collectColumn, (column) => {
7859
+ column.resizeWidth = 0;
7860
+ column.fixed = column.defaultFixed;
7861
+ column.renderSortNumber = column.sortNumber;
7862
+ column.parentId = column.defaultParentId;
7863
+ if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
7864
+ column.visible = column.defaultVisible;
7865
+ }
7866
+ column.aggFunc = column.defaultAggFunc;
7867
+ column.renderAggFn = column.defaultAggFunc;
7868
+ column.renderResizeWidth = column.renderWidth;
7869
+ allCols.push(column);
7870
+ });
7871
+ const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' });
7872
+ internalData.collectColumn = newCollectCols;
7873
+ internalData.tableFullColumn = getColumnList(newCollectCols);
7874
+ reactData.updateColFlag++;
7875
+ reactData.isColLoading = true;
7876
+ initColumnHierarchy();
7877
+ return Promise.resolve(handleCustomRestore(storeData)).then(() => {
7878
+ return buildColumnInfo();
7879
+ }).then(() => {
7880
+ // 恢复数据聚合分组
7881
+ const { isRowGroupStatus, rowGroupList } = reactData;
7882
+ if (isRowGroupStatus && !!$xeTable.handlePivotTableAggData) {
7883
+ const rowGroupFields = computeRowGroupFields.value;
7884
+ if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
7885
+ if (rowGroupFields && rowGroupFields.length) {
7886
+ $xeTable.setRowGroups(rowGroupFields);
7887
+ }
7888
+ else {
7889
+ $xeTable.clearRowGroups();
7890
+ }
7891
+ }
7892
+ else {
7893
+ $xeTable.handleUpdateAggData();
7894
+ }
7895
+ }
7896
+ });
7897
+ },
7898
+ /**
7899
+ * 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
7900
+ * @returns
7901
+ */
7806
7902
  getCustomStoreData() {
7807
7903
  const { id } = props;
7808
7904
  const customOpts = computeCustomOpts.value;
@@ -9582,6 +9678,9 @@ export default defineVxeComponent({
9582
9678
  }
9583
9679
  }
9584
9680
  },
9681
+ /**
9682
+ * @private
9683
+ */
9585
9684
  handleRowResizeMousedownEvent(evnt, params) {
9586
9685
  evnt.stopPropagation();
9587
9686
  evnt.preventDefault();
@@ -9698,6 +9797,9 @@ export default defineVxeComponent({
9698
9797
  };
9699
9798
  updateEvent(evnt);
9700
9799
  },
9800
+ /**
9801
+ * @private
9802
+ */
9701
9803
  handleRowResizeDblclickEvent(evnt, params) {
9702
9804
  const resizableOpts = computeResizableOpts.value;
9703
9805
  const { isDblclickAutoHeight } = resizableOpts;
@@ -9716,7 +9818,7 @@ export default defineVxeComponent({
9716
9818
  }
9717
9819
  const handleRsHeight = () => {
9718
9820
  el.setAttribute('data-calc-row', 'Y');
9719
- const resizeHeight = calcCellAutoHeight(rowRest, el);
9821
+ const resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
9720
9822
  el.removeAttribute('data-calc-row');
9721
9823
  const resizeParams = Object.assign(Object.assign({}, params), { resizeHeight, resizeRow: row });
9722
9824
  reactData.isDragResize = false;
@@ -9737,6 +9839,9 @@ export default defineVxeComponent({
9737
9839
  }
9738
9840
  }
9739
9841
  },
9842
+ /**
9843
+ * @private
9844
+ */
9740
9845
  saveCustomStore(type) {
9741
9846
  const { customConfig } = props;
9742
9847
  const tableId = computeTableId.value;
@@ -9783,6 +9888,9 @@ export default defineVxeComponent({
9783
9888
  }
9784
9889
  return nextTick();
9785
9890
  },
9891
+ /**
9892
+ * @private
9893
+ */
9786
9894
  handleCustom() {
9787
9895
  const { mouseConfig } = props;
9788
9896
  if (mouseConfig) {
@@ -83,6 +83,7 @@ export function createInternalData() {
83
83
  sourceDataRowIdData: {},
84
84
  fullColumnIdData: {},
85
85
  fullColumnFieldData: {},
86
+ fullCellHeightMaps: {},
86
87
  // 当前行
87
88
  currentRow: null,
88
89
  // 合并表头单元格的数据
@@ -143,7 +144,8 @@ export function createInternalData() {
143
144
  inited: false,
144
145
  tooltipTimeout: null,
145
146
  initStatus: false,
146
- isActivated: false
147
+ isActivated: false,
148
+ rceDelay: 0
147
149
  // _sToTime: null
148
150
  };
149
151
  }
@@ -391,6 +393,21 @@ export function createReactData() {
391
393
  isColLoading: false
392
394
  };
393
395
  }
396
+ const maxKey = '__max';
397
+ export function getRowMaxHeight(chRest, isForce) {
398
+ if (isForce || !chRest[maxKey]) {
399
+ let max = 0;
400
+ for (const key in chRest) {
401
+ const val = chRest[key];
402
+ if (key !== maxKey && XEUtils.isNumber(val) && val > max) {
403
+ max = val;
404
+ }
405
+ }
406
+ chRest[maxKey] = max;
407
+ return max;
408
+ }
409
+ return chRest[maxKey];
410
+ }
394
411
  const getAllConvertColumns = (columns, parentColumn) => {
395
412
  const result = [];
396
413
  columns.forEach((column) => {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.19.6";
3
+ export const version = "4.19.8";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.19.6"}`;
3
+ const version = `table v${"4.19.8"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
@@ -31,7 +31,7 @@ const {
31
31
  renderEmptyElement
32
32
  } = _ui.VxeUI;
33
33
  const tableComponentPropKeys = Object.keys(_props2.tableProps);
34
- const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
34
+ const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'setCustomStoreData', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
35
35
  function createReactData() {
36
36
  var _a;
37
37
  return {