vxe-table 4.17.7 → 4.17.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.
@@ -2017,19 +2017,28 @@ export default defineVxeComponent({
2017
2017
  * 计算自适应行高
2018
2018
  */
2019
2019
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
2020
- const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2020
+ const { scrollXLoad } = reactData;
2021
+ const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2021
2022
  let colHeight = rowRest.height;
2022
2023
  let firstCellStyle = null;
2023
2024
  let topBottomPadding = 0;
2024
- for (let i = 0; i < cellElemList.length; i++) {
2025
- const wrapperElem = cellElemList[i];
2025
+ for (let i = 0; i < wrapperElemList.length; i++) {
2026
+ const wrapperElem = wrapperElemList[i];
2026
2027
  const cellElem = wrapperElem.parentElement;
2027
2028
  if (!firstCellStyle) {
2029
+ const cellStyle = cellElem.style;
2030
+ const orHeight = cellStyle.height;
2031
+ if (!scrollXLoad) {
2032
+ cellStyle.height = '';
2033
+ }
2028
2034
  firstCellStyle = getComputedStyle(cellElem);
2029
2035
  topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
2036
+ if (!scrollXLoad) {
2037
+ cellStyle.height = orHeight;
2038
+ }
2030
2039
  }
2031
2040
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2032
- colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
2041
+ colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
2033
2042
  }
2034
2043
  return colHeight;
2035
2044
  };
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.17.7";
3
+ export const version = "4.17.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.17.7"}`;
3
+ const version = `table v${"4.17.8"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3141,7 +3141,7 @@ function eqEmptyValue(cellValue) {
3141
3141
  ;// ./packages/ui/index.ts
3142
3142
 
3143
3143
 
3144
- const version = "4.17.7";
3144
+ const version = "4.17.8";
3145
3145
  core_.VxeUI.version = version;
3146
3146
  core_.VxeUI.tableVersion = version;
3147
3147
  core_.VxeUI.setConfig({
@@ -3654,7 +3654,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3654
3654
  const {
3655
3655
  log: log_log
3656
3656
  } = core_.VxeUI;
3657
- const log_version = `table v${"4.17.7"}`;
3657
+ const log_version = `table v${"4.17.8"}`;
3658
3658
  const warnLog = log_log.create('warn', log_version);
3659
3659
  const errLog = log_log.create('error', log_version);
3660
3660
  ;// ./packages/table/src/columnInfo.ts
@@ -18985,7 +18985,7 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
18985
18985
  * 如果所有列足够放的情况下,从最后动态列开始分配
18986
18986
  */const dynamicList=scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);let dynamicSize=dynamicList.length-1;if(dynamicSize>0){let i=bodyWidth-tWidth;if(i>0){while(i>0&&dynamicSize>=0){i--;dynamicList[dynamicSize--].renderWidth++;}tWidth=bodyWidth;}}}reactData.scrollXWidth=tWidth;reactData.resizeWidthFlag++;updateColumnOffsetLeft();updateHeight();};/**
18987
18987
  * 计算自适应行高
18988
- */const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;let firstCellStyle=null;let topBottomPadding=0;for(let i=0;i<cellElemList.length;i++){const wrapperElem=cellElemList[i];const cellElem=wrapperElem.parentElement;if(!firstCellStyle){firstCellStyle=getComputedStyle(cellElem);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;}const cellHeight=wrapperElem?wrapperElem.clientHeight:0;colHeight=Math.max(colHeight,Math.ceil(cellHeight+topBottomPadding));}return colHeight;};/**
18988
+ */const calcCellAutoHeight=(rowRest,wrapperEl)=>{const{scrollXLoad}=reactData;const wrapperElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;let firstCellStyle=null;let topBottomPadding=0;for(let i=0;i<wrapperElemList.length;i++){const wrapperElem=wrapperElemList[i];const cellElem=wrapperElem.parentElement;if(!firstCellStyle){const cellStyle=cellElem.style;const orHeight=cellStyle.height;if(!scrollXLoad){cellStyle.height='';}firstCellStyle=getComputedStyle(cellElem);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;if(!scrollXLoad){cellStyle.height=orHeight;}}const cellHeight=wrapperElem?wrapperElem.clientHeight:0;colHeight=scrollXLoad?Math.max(colHeight,Math.ceil(cellHeight+topBottomPadding)):Math.ceil(cellHeight+topBottomPadding);}return colHeight;};/**
18989
18989
  * 自适应行高
18990
18990
  */const calcCellHeight=()=>{const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const treeOpts=computeTreeOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)&&el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const reHeight=calcCellAutoHeight(rowRest,el);rowRest.height=Math.max(defaultRowHeight,scrollXLoad?Math.max(rowRest.height,reHeight):reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{sortBy,sortType}=column;return row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=tableMethods.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};};const updateAfterListIndex=()=>{const{treeConfig}=props;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:index,treeIndex:-1,_tIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
18991
18991
  * 预编译