vxe-table 4.23.16 → 4.23.17

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.
@@ -1270,7 +1270,7 @@ var table_default = (
1270
1270
  internalData.mergeHeaderMaps = {};
1271
1271
  internalData.mergeHeaderCellMaps = {};
1272
1272
  internalData.mergeHeaderRowMaps = {};
1273
- internalData.mergeBodyColMaps = {};
1273
+ internalData.mergeHeaderColMaps = {};
1274
1274
  $xeTable.setMergeHeaderCells(merges);
1275
1275
  };
1276
1276
  const handleHeaderMerge = (merges) => {
@@ -1993,35 +1993,51 @@ var table_default = (
1993
1993
  updateColumnOffsetLeft();
1994
1994
  updateHeight();
1995
1995
  };
1996
- const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
1996
+ const calcCellAutoHeight = (rowid, rowRest, wrapperEl, cacheElemList) => {
1997
1997
  const { fullCellHeightMaps } = internalData;
1998
1998
  let chRest = fullCellHeightMaps[rowid];
1999
1999
  if (!chRest) {
2000
2000
  chRest = {};
2001
2001
  fullCellHeightMaps[rowid] = chRest;
2002
2002
  }
2003
- const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2004
- let firstCellStyle = null;
2005
- let topBottomPadding = 0;
2003
+ const wrapperElemList = cacheElemList || Array.from(wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`));
2004
+ const cellItemList = [];
2006
2005
  let changeCH = false;
2007
2006
  for (let i = 0; i < wrapperElemList.length; i++) {
2008
2007
  const wrapperElem = wrapperElemList[i];
2009
2008
  const cellElem = wrapperElem.parentElement;
2010
- const cellStyle = cellElem.style;
2011
- const orHeight = cellStyle.height;
2012
- const colid = wrapperElem.getAttribute("colid") || "";
2013
- cellStyle.height = "";
2014
- if (!firstCellStyle) {
2015
- firstCellStyle = getComputedStyle(cellElem);
2016
- topBottomPadding = firstCellStyle ? Math.ceil(import_xe_utils.default.toNumber(firstCellStyle.paddingTop) + import_xe_utils.default.toNumber(firstCellStyle.paddingBottom)) : 0;
2017
- }
2018
- const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2019
- const colHeight = Math.ceil(cellHeight + topBottomPadding);
2009
+ if (!cellElem) {
2010
+ continue;
2011
+ }
2012
+ const orHeight = cellElem.style.height;
2013
+ if (orHeight) {
2014
+ cellElem.style.height = "";
2015
+ }
2016
+ cellItemList.push({
2017
+ wrapperElem,
2018
+ cellElem,
2019
+ colid: wrapperElem.getAttribute("colid") || "",
2020
+ orHeight
2021
+ });
2022
+ }
2023
+ let topBottomPadding = 0;
2024
+ if (cellItemList.length) {
2025
+ const firstCellStyle = getComputedStyle(cellItemList[0].cellElem);
2026
+ topBottomPadding = Math.ceil(import_xe_utils.default.toNumber(firstCellStyle.paddingTop) + import_xe_utils.default.toNumber(firstCellStyle.paddingBottom));
2027
+ }
2028
+ for (let i = 0; i < cellItemList.length; i++) {
2029
+ const { wrapperElem, colid } = cellItemList[i];
2030
+ const colHeight = Math.ceil(wrapperElem.clientHeight + topBottomPadding);
2020
2031
  if (chRest[colid] !== colHeight) {
2021
2032
  changeCH = true;
2022
2033
  chRest[colid] = colHeight;
2023
2034
  }
2024
- cellStyle.height = orHeight;
2035
+ }
2036
+ for (let i = 0; i < cellItemList.length; i++) {
2037
+ const { cellElem, orHeight } = cellItemList[i];
2038
+ if (orHeight) {
2039
+ cellElem.style.height = orHeight;
2040
+ }
2025
2041
  }
2026
2042
  const cellMaxHeight = (0, import_util.getRowMaxHeight)(chRest, changeCH);
2027
2043
  return cellMaxHeight;
@@ -2038,12 +2054,18 @@ var table_default = (
2038
2054
  const defaultRowHeight = computeDefaultRowHeight.value;
2039
2055
  if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
2040
2056
  const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
2057
+ const rowWrapperMaps = {};
2058
+ el.querySelectorAll(".vxe-cell--wrapper[rowid]").forEach((wrapperElem) => {
2059
+ const rid = wrapperElem.getAttribute("rowid") || "";
2060
+ const elemList = rowWrapperMaps[rid] || (rowWrapperMaps[rid] = []);
2061
+ elemList.push(wrapperElem);
2062
+ });
2041
2063
  el.setAttribute("data-calc-row", "Y");
2042
2064
  tableData.forEach((row) => {
2043
2065
  const rowid = handleGetRowId(row);
2044
2066
  const rowRest = fullAllDataRowIdData[rowid];
2045
2067
  if (rowRest) {
2046
- const reHeight = calcCellAutoHeight(rowid, rowRest, el);
2068
+ const reHeight = calcCellAutoHeight(rowid, rowRest, el, rowWrapperMaps[rowid] || []);
2047
2069
  rowRest.height = Math.max(defaultRowHeight, reHeight);
2048
2070
  }
2049
2071
  });
@@ -3836,7 +3858,7 @@ var table_default = (
3836
3858
  };
3837
3859
  const loadScrollXData = () => {
3838
3860
  const { isScrollXBig } = reactData;
3839
- const { mergeBodyList, mergeFooterList, mergeBodyRowMaps, scrollXStore } = internalData;
3861
+ const { mergeBodyList, mergeFooterList, mergeBodyColMaps, scrollXStore } = internalData;
3840
3862
  const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
3841
3863
  const { toVisibleIndex, visibleSize } = handleVirtualXVisible();
3842
3864
  const offsetItem = {
@@ -3845,7 +3867,7 @@ var table_default = (
3845
3867
  };
3846
3868
  scrollXStore.visibleStartIndex = toVisibleIndex - 1;
3847
3869
  scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
3848
- calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), mergeBodyRowMaps, offsetItem, "col");
3870
+ calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), mergeBodyColMaps, offsetItem, "col");
3849
3871
  const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
3850
3872
  if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
3851
3873
  if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
@@ -4221,7 +4243,7 @@ var table_default = (
4221
4243
  };
4222
4244
  const loadScrollYData = () => {
4223
4245
  const { isAllOverflow, isScrollYBig } = reactData;
4224
- const { mergeBodyList, mergeBodyColMaps, scrollYStore } = internalData;
4246
+ const { mergeBodyList, mergeBodyRowMaps, scrollYStore } = internalData;
4225
4247
  const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore;
4226
4248
  const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
4227
4249
  const { toVisibleIndex, visibleSize } = handleVirtualYVisible();
@@ -4231,7 +4253,7 @@ var table_default = (
4231
4253
  };
4232
4254
  scrollYStore.visibleStartIndex = toVisibleIndex - 1;
4233
4255
  scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
4234
- calculateMergerOffsetIndex(mergeBodyList, mergeBodyColMaps, offsetItem, "row");
4256
+ calculateMergerOffsetIndex(mergeBodyList, mergeBodyRowMaps, offsetItem, "row");
4235
4257
  const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
4236
4258
  if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
4237
4259
  if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
@@ -4300,7 +4322,7 @@ var table_default = (
4300
4322
  loadScrollYData();
4301
4323
  }, fpsTime);
4302
4324
  };
4303
- const handleSyncScroll = (isRollX, isRollY) => {
4325
+ const handleSyncScroll = (isRollX, isRollY, isCompensate) => {
4304
4326
  const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
4305
4327
  const autoWidthColumnList = computeAutoWidthColumnList.value;
4306
4328
  internalData.lcsRunTime = Date.now();
@@ -4321,7 +4343,9 @@ var table_default = (
4321
4343
  let xRest = null;
4322
4344
  let yRest = null;
4323
4345
  if (!isAllOverflow) {
4324
- calcCellHeight();
4346
+ if (!isCompensate) {
4347
+ calcCellHeight();
4348
+ }
4325
4349
  updateRowOffsetTop();
4326
4350
  }
4327
4351
  if (isRollX && scrollXLoad) {
@@ -4337,7 +4361,9 @@ var table_default = (
4337
4361
  autoCellWidth();
4338
4362
  }
4339
4363
  if (!isAllOverflow) {
4340
- calcCellHeight();
4364
+ if (!isCompensate) {
4365
+ calcCellHeight();
4366
+ }
4341
4367
  updateRowOffsetTop();
4342
4368
  }
4343
4369
  return $xeTable.updateScrollYSpace();
@@ -4358,7 +4384,7 @@ var table_default = (
4358
4384
  (0, import_vue.nextTick)(() => {
4359
4385
  updateRowExpandStyle();
4360
4386
  if (!internalData.lcsTimeout) {
4361
- handleSyncScroll(isRollX, isRollY);
4387
+ handleSyncScroll(isRollX, isRollY, true);
4362
4388
  }
4363
4389
  });
4364
4390
  }
@@ -6008,6 +6034,7 @@ var table_default = (
6008
6034
  const { fullAllDataRowIdData } = internalData;
6009
6035
  const rows = import_xe_utils.default.isArray(rowOrId) ? rowOrId : [rowOrId];
6010
6036
  const el = refElem.value;
6037
+ let status = false;
6011
6038
  if (el) {
6012
6039
  const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
6013
6040
  el.setAttribute("data-calc-row", "Y");
@@ -6016,12 +6043,15 @@ var table_default = (
6016
6043
  const rowRest = fullAllDataRowIdData[rowid];
6017
6044
  if (rowRest) {
6018
6045
  rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
6046
+ status = true;
6019
6047
  }
6020
6048
  });
6021
6049
  el.removeAttribute("data-calc-row");
6022
6050
  reactData.calcCellHeightFlag++;
6023
6051
  }
6024
- return (0, import_vue.nextTick)();
6052
+ return (0, import_vue.nextTick)().then(() => {
6053
+ return { status };
6054
+ });
6025
6055
  },
6026
6056
  setRowHeight(rowOrId, height) {
6027
6057
  const { fullAllDataRowIdData } = internalData;
package/lib/ui/index.js CHANGED
@@ -33,7 +33,7 @@ __export(ui_exports, {
33
33
  module.exports = __toCommonJS(ui_exports);
34
34
  var import_core = require("@vxe-ui/core");
35
35
  var import_utils = require("./src/utils");
36
- const version = "4.23.16";
36
+ const version = "4.23.17";
37
37
  import_core.VxeUI.version = version;
38
38
  import_core.VxeUI.tableVersion = version;
39
39
  import_core.VxeUI.setConfig({
package/lib/ui/src/log.js CHANGED
@@ -25,7 +25,7 @@ __export(log_exports, {
25
25
  module.exports = __toCommonJS(log_exports);
26
26
  var import_core = require("@vxe-ui/core");
27
27
  const { log } = import_core.VxeUI;
28
- const tableVersion = `table v${"4.23.16"}`;
28
+ const tableVersion = `table v${"4.23.17"}`;
29
29
  function createComponentLog(name) {
30
30
  const uiVersion = import_core.VxeUI.uiVersion ? `ui v${import_core.VxeUI.uiVersion}` : "";
31
31
  const ganttVersion = import_core.VxeUI.ganttVersion ? `gantt v${import_core.VxeUI.ganttVersion}` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.23.16",
3
+ "version": "4.23.17",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",