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.
- package/es/style.css +1 -1
- package/es/table/src/table.js +13 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +3 -3
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/table.ts +13 -4
- /package/es/{iconfont.1762136085329.ttf → iconfont.1762324094489.ttf} +0 -0
- /package/es/{iconfont.1762136085329.woff → iconfont.1762324094489.woff} +0 -0
- /package/es/{iconfont.1762136085329.woff2 → iconfont.1762324094489.woff2} +0 -0
- /package/lib/{iconfont.1762136085329.ttf → iconfont.1762324094489.ttf} +0 -0
- /package/lib/{iconfont.1762136085329.woff → iconfont.1762324094489.woff} +0 -0
- /package/lib/{iconfont.1762136085329.woff2 → iconfont.1762324094489.woff2} +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -96,7 +96,7 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
|
|
|
96
96
|
* 如果所有列足够放的情况下,从最后动态列开始分配
|
|
97
97
|
*/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();};/**
|
|
98
98
|
* 计算自适应行高
|
|
99
|
-
*/const calcCellAutoHeight=(rowRest,wrapperEl)=>{const
|
|
99
|
+
*/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(_xeUtils.default.toNumber(firstCellStyle.paddingTop)+_xeUtils.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;};/**
|
|
100
100
|
* 自适应行高
|
|
101
101
|
*/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}=(0,_util.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=_xeUtils.default.isFunction(sortBy)?sortBy({row,column}):_xeUtils.default.get(row,sortBy);}else{cellValue=tableMethods.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:_xeUtils.default.toNumber(cellValue);}else if(sortType==='number'){return _xeUtils.default.toNumber(cellValue);}else if(sortType==='string'){return _xeUtils.default.toValueString(cellValue);}return cellValue;};};const updateAfterListIndex=()=>{const{treeConfig}=props;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=(0,_util.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;};/**
|
|
102
102
|
* 预编译
|