vxe-table 3.17.5 → 3.17.7

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.
@@ -994,8 +994,8 @@ export default {
994
994
  if (matchObj && matchObj.parent) {
995
995
  const { parent } = matchObj;
996
996
  if (parent.children && parent.children.length) {
997
- parent.visible = parent.children.every((column) => column.visible);
998
- parent.halfVisible = !parent.visible && parent.children.some((column) => column.visible || column.halfVisible);
997
+ parent.renderVisible = parent.children.every((column) => column.renderVisible);
998
+ parent.halfVisible = !parent.renderVisible && parent.children.some((column) => column.renderVisible || column.halfVisible);
999
999
  this.handleOptionCheck(parent);
1000
1000
  }
1001
1001
  }
@@ -1004,8 +1004,8 @@ export default {
1004
1004
  const $xeTableCustomPanel = this;
1005
1005
  const $xeTable = $xeTableCustomPanel.$xeTable;
1006
1006
  const tableReactData = $xeTable;
1007
- const customOpts = $xeTable.computeCustomOpts;
1008
1007
  const isChecked = !column.renderVisible;
1008
+ const customOpts = $xeTable.computeCustomOpts;
1009
1009
  if (customOpts.immediate) {
1010
1010
  XEUtils.eachTree([column], (item) => {
1011
1011
  item.visible = isChecked;
@@ -2249,12 +2249,17 @@ function autoCellWidth($xeTable) {
2249
2249
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
2250
2250
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2251
2251
  let colHeight = rowRest.height;
2252
+ let firstCellStyle = null;
2253
+ let topBottomPadding = 0;
2252
2254
  for (let i = 0; i < cellElemList.length; i++) {
2253
- const cellElem = cellElemList[i];
2254
- const tdEl = cellElem.parentElement;
2255
- const topBottomPadding = Math.ceil(XEUtils.toNumber(tdEl.style.paddingTop) + XEUtils.toNumber(tdEl.style.paddingBottom));
2256
- const cellHeight = cellElem ? cellElem.clientHeight : 0;
2257
- colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
2255
+ const wrapperElem = cellElemList[i];
2256
+ const cellElem = wrapperElem.parentElement;
2257
+ if (!firstCellStyle) {
2258
+ firstCellStyle = getComputedStyle(cellElem);
2259
+ topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
2260
+ }
2261
+ const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2262
+ colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
2258
2263
  }
2259
2264
  return colHeight;
2260
2265
  };
@@ -5569,11 +5574,13 @@ const Methods = {
5569
5574
  },
5570
5575
  handleRowResizeMousedownEvent(evnt, params) {
5571
5576
  const $xeTable = this;
5577
+ const props = $xeTable;
5572
5578
  const reactData = $xeTable;
5573
5579
  const internalData = $xeTable;
5574
5580
  evnt.stopPropagation();
5575
5581
  evnt.preventDefault();
5576
5582
  const { row } = params;
5583
+ const { showOverflow } = props;
5577
5584
  const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData;
5578
5585
  const { elemStore, fullAllDataRowIdData } = internalData;
5579
5586
  const osbWidth = overflowY ? scrollbarWidth : 0;
@@ -5602,7 +5609,10 @@ const Methods = {
5602
5609
  return;
5603
5610
  }
5604
5611
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
5605
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
5612
+ let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
5613
+ if (!showOverflow) {
5614
+ currCellHeight = tdEl.clientHeight;
5615
+ }
5606
5616
  const tableRect = tableEl.getBoundingClientRect();
5607
5617
  const trRect = trEl.getBoundingClientRect();
5608
5618
  const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
@@ -5766,6 +5776,28 @@ const Methods = {
5766
5776
  });
5767
5777
  return rest;
5768
5778
  },
5779
+ recalcRowHeight(rowOrId) {
5780
+ const $xeTable = this;
5781
+ const reactData = $xeTable;
5782
+ const internalData = $xeTable;
5783
+ const { fullAllDataRowIdData } = internalData;
5784
+ const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
5785
+ const el = $xeTable.$refs.refElem;
5786
+ if (el) {
5787
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
5788
+ el.setAttribute('data-calc-row', 'Y');
5789
+ rows.forEach(row => {
5790
+ const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
5791
+ const rowRest = fullAllDataRowIdData[rowid];
5792
+ if (rowRest) {
5793
+ rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
5794
+ }
5795
+ el.removeAttribute('data-calc-row');
5796
+ });
5797
+ reactData.calcCellHeightFlag++;
5798
+ }
5799
+ return $xeTable.$nextTick();
5800
+ },
5769
5801
  setRowHeight(rowOrId, height) {
5770
5802
  const $xeTable = this;
5771
5803
  const reactData = $xeTable;
@@ -1313,25 +1313,19 @@ export default {
1313
1313
  this.$nextTick().then(() => this.refreshColumn());
1314
1314
  },
1315
1315
  computeSize() {
1316
- this.reScrollFlag++;
1316
+ this.reLayoutFlag++;
1317
1317
  },
1318
1318
  showHeader() {
1319
- this.reScrollFlag++;
1319
+ this.reLayoutFlag++;
1320
1320
  },
1321
1321
  showFooter() {
1322
- this.reScrollFlag++;
1322
+ this.reLayoutFlag++;
1323
1323
  },
1324
1324
  overflowX() {
1325
- this.reScrollFlag++;
1325
+ this.reLayoutFlag++;
1326
1326
  },
1327
1327
  overflowY() {
1328
- this.reScrollFlag++;
1329
- },
1330
- reScrollFlag() {
1331
- const $xeTable = this;
1332
- $xeTable.$nextTick(() => {
1333
- $xeTable.recalculate(true).then(() => $xeTable.refreshScroll());
1334
- });
1328
+ this.reLayoutFlag++;
1335
1329
  },
1336
1330
  height() {
1337
1331
  this.reLayoutFlag++;
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 = "3.17.5";
3
+ export const version = "3.17.7";
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${"3.17.5"}`;
3
+ const version = `table v${"3.17.7"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.17.5";
2005
+ const version = "3.17.7";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2669,7 +2669,7 @@ function isNodeElement(elem) {
2669
2669
  const {
2670
2670
  log: log_log
2671
2671
  } = core_.VxeUI;
2672
- const log_version = `table v${"3.17.5"}`;
2672
+ const log_version = `table v${"3.17.7"}`;
2673
2673
  const warnLog = log_log.create('warn', log_version);
2674
2674
  const errLog = log_log.create('error', log_version);
2675
2675
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -8109,12 +8109,17 @@ function autoCellWidth($xeTable) {
8109
8109
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
8110
8110
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
8111
8111
  let colHeight = rowRest.height;
8112
+ let firstCellStyle = null;
8113
+ let topBottomPadding = 0;
8112
8114
  for (let i = 0; i < cellElemList.length; i++) {
8113
- const cellElem = cellElemList[i];
8114
- const tdEl = cellElem.parentElement;
8115
- const topBottomPadding = Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));
8116
- const cellHeight = cellElem ? cellElem.clientHeight : 0;
8117
- colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
8115
+ const wrapperElem = cellElemList[i];
8116
+ const cellElem = wrapperElem.parentElement;
8117
+ if (!firstCellStyle) {
8118
+ firstCellStyle = getComputedStyle(cellElem);
8119
+ topBottomPadding = firstCellStyle ? Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)) : 0;
8120
+ }
8121
+ const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
8122
+ colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
8118
8123
  }
8119
8124
  return colHeight;
8120
8125
  };
@@ -11913,6 +11918,7 @@ const Methods = {
11913
11918
  },
11914
11919
  handleRowResizeMousedownEvent(evnt, params) {
11915
11920
  const $xeTable = this;
11921
+ const props = $xeTable;
11916
11922
  const reactData = $xeTable;
11917
11923
  const internalData = $xeTable;
11918
11924
  evnt.stopPropagation();
@@ -11920,6 +11926,9 @@ const Methods = {
11920
11926
  const {
11921
11927
  row
11922
11928
  } = params;
11929
+ const {
11930
+ showOverflow
11931
+ } = props;
11923
11932
  const {
11924
11933
  overflowX,
11925
11934
  scrollbarWidth,
@@ -11958,7 +11967,10 @@ const Methods = {
11958
11967
  return;
11959
11968
  }
11960
11969
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
11961
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
11970
+ let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
11971
+ if (!showOverflow) {
11972
+ currCellHeight = tdEl.clientHeight;
11973
+ }
11962
11974
  const tableRect = tableEl.getBoundingClientRect();
11963
11975
  const trRect = trEl.getBoundingClientRect();
11964
11976
  const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
@@ -12145,6 +12157,32 @@ const Methods = {
12145
12157
  });
12146
12158
  return rest;
12147
12159
  },
12160
+ recalcRowHeight(rowOrId) {
12161
+ const $xeTable = this;
12162
+ const reactData = $xeTable;
12163
+ const internalData = $xeTable;
12164
+ const {
12165
+ fullAllDataRowIdData
12166
+ } = internalData;
12167
+ const rows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId) ? rowOrId : [rowOrId];
12168
+ const el = $xeTable.$refs.refElem;
12169
+ if (el) {
12170
+ const {
12171
+ handleGetRowId
12172
+ } = createHandleGetRowId($xeTable);
12173
+ el.setAttribute('data-calc-row', 'Y');
12174
+ rows.forEach(row => {
12175
+ const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row : handleGetRowId(row);
12176
+ const rowRest = fullAllDataRowIdData[rowid];
12177
+ if (rowRest) {
12178
+ rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
12179
+ }
12180
+ el.removeAttribute('data-calc-row');
12181
+ });
12182
+ reactData.calcCellHeightFlag++;
12183
+ }
12184
+ return $xeTable.$nextTick();
12185
+ },
12148
12186
  setRowHeight(rowOrId, height) {
12149
12187
  const $xeTable = this;
12150
12188
  const reactData = $xeTable;
@@ -21124,8 +21162,8 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
21124
21162
  parent
21125
21163
  } = matchObj;
21126
21164
  if (parent.children && parent.children.length) {
21127
- parent.visible = parent.children.every(column => column.visible);
21128
- parent.halfVisible = !parent.visible && parent.children.some(column => column.visible || column.halfVisible);
21165
+ parent.renderVisible = parent.children.every(column => column.renderVisible);
21166
+ parent.halfVisible = !parent.renderVisible && parent.children.some(column => column.renderVisible || column.halfVisible);
21129
21167
  this.handleOptionCheck(parent);
21130
21168
  }
21131
21169
  }
@@ -21134,8 +21172,8 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
21134
21172
  const $xeTableCustomPanel = this;
21135
21173
  const $xeTable = $xeTableCustomPanel.$xeTable;
21136
21174
  const tableReactData = $xeTable;
21137
- const customOpts = $xeTable.computeCustomOpts;
21138
21175
  const isChecked = !column.renderVisible;
21176
+ const customOpts = $xeTable.computeCustomOpts;
21139
21177
  if (customOpts.immediate) {
21140
21178
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], item => {
21141
21179
  item.visible = isChecked;
@@ -29679,25 +29717,19 @@ function renderBody(h, $xeTable) {
29679
29717
  this.$nextTick().then(() => this.refreshColumn());
29680
29718
  },
29681
29719
  computeSize() {
29682
- this.reScrollFlag++;
29720
+ this.reLayoutFlag++;
29683
29721
  },
29684
29722
  showHeader() {
29685
- this.reScrollFlag++;
29723
+ this.reLayoutFlag++;
29686
29724
  },
29687
29725
  showFooter() {
29688
- this.reScrollFlag++;
29726
+ this.reLayoutFlag++;
29689
29727
  },
29690
29728
  overflowX() {
29691
- this.reScrollFlag++;
29729
+ this.reLayoutFlag++;
29692
29730
  },
29693
29731
  overflowY() {
29694
- this.reScrollFlag++;
29695
- },
29696
- reScrollFlag() {
29697
- const $xeTable = this;
29698
- $xeTable.$nextTick(() => {
29699
- $xeTable.recalculate(true).then(() => $xeTable.refreshScroll());
29700
- });
29732
+ this.reLayoutFlag++;
29701
29733
  },
29702
29734
  height() {
29703
29735
  this.reLayoutFlag++;