vxe-table 4.16.8 → 4.16.9
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/README.en.md +3 -1
- package/README.ja-JP.md +3 -2
- package/README.md +3 -2
- package/README.zh-TW.md +3 -2
- package/es/style.css +1 -1
- package/es/table/src/table.js +6 -1
- package/es/ui/index.js +1 -4
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +3 -6
- 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 -4
- 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 +6 -1
- package/packages/ui/index.ts +0 -3
- /package/es/{iconfont.1757293933468.ttf → iconfont.1757392740800.ttf} +0 -0
- /package/es/{iconfont.1757293933468.woff → iconfont.1757392740800.woff} +0 -0
- /package/es/{iconfont.1757293933468.woff2 → iconfont.1757392740800.woff2} +0 -0
- /package/lib/{iconfont.1757293933468.ttf → iconfont.1757392740800.ttf} +0 -0
- /package/lib/{iconfont.1757293933468.woff → iconfont.1757392740800.woff} +0 -0
- /package/lib/{iconfont.1757293933468.woff2 → iconfont.1757392740800.woff2} +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -61,7 +61,7 @@ if(isCustomSort&&sortData){allCols.forEach(column=>{const colKey=column.getKey()
|
|
|
61
61
|
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);if(storage&&(customConfig?(0,_utils.isEnableConf)(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggGroup||isCustomAggFunc)){if(!tableId){(0,_log.errLog)('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
62
62
|
* 更新数据列的 Map
|
|
63
63
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
64
|
-
*/const cacheColumnMap=()=>{const{tableFullColumn,collectColumn}=internalData;const fullColIdData=internalData.fullColumnIdData={};const fullColFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(_utils.hasChildrenList);let isAllOverflow=!!
|
|
64
|
+
*/const cacheColumnMap=()=>{const{treeConfig,showOverflow}=props;const{tableFullColumn,collectColumn}=internalData;const fullColIdData=internalData.fullColumnIdData={};const fullColFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const treeOpts=computeTreeOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(_utils.hasChildrenList);let isAllOverflow=!!showOverflow;let rowGroupColumn;let expandColumn;let treeNodeColumn;let checkboxColumn;let radioColumn;let htmlColumn;let hasFixed;const handleFunc=(column,index,items,path,parentColumn)=>{const{id:colid,field,fixed,type,treeNode,rowGroupNode}=column;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};if(field){if(fullColFieldData[field]){(0,_log.errLog)('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}else{if(storage&&!type){(0,_log.errLog)('vxe.error.reqSupportProp',['storage',`${column.getTitle()||type||''} -> field=?`]);}if(columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){(0,_log.errLog)('vxe.error.reqSupportProp',['column-drag-config.isCrossDrag | column-drag-config.isSelfToChildDrag',`${column.getTitle()||type||''} -> field=?`]);}}if(!hasFixed&&fixed){hasFixed=fixed;}if(!htmlColumn&&type==='html'){htmlColumn=column;}if(treeNode){if(treeNodeColumn){(0,_log.warnLog)('vxe.error.colRepet',['tree-node',treeNode]);}if(!treeNodeColumn){treeNodeColumn=column;}}if(rowGroupNode){if(treeNodeColumn){(0,_log.warnLog)('vxe.error.colRepet',['row-group-node',rowGroupNode]);}if(!rowGroupColumn){rowGroupColumn=column;}}if(type==='expand'){if(expandColumn){(0,_log.warnLog)('vxe.error.colRepet',['type',type]);}if(!expandColumn){expandColumn=column;}}if(type==='checkbox'){if(checkboxColumn){(0,_log.warnLog)('vxe.error.colRepet',['type',type]);}if(!checkboxColumn){checkboxColumn=column;}}else if(type==='radio'){if(radioColumn){(0,_log.warnLog)('vxe.error.colRepet',['type',type]);}if(!radioColumn){radioColumn=column;}}if(isAllOverflow&&column.showOverflow===false){isAllOverflow=false;}if(fullColIdData[colid]){(0,_log.errLog)('vxe.error.colRepet',['colId',colid]);}fullColIdData[colid]=rest;};if(isGroup){_xeUtils.default.eachTree(collectColumn,(column,index,items,path,parentColumn,nodes)=>{column.level=nodes.length;handleFunc(column,index,items,path,parentColumn);});}else{tableFullColumn.forEach(handleFunc);}if(expandColumn&&expandOpts.mode!=='fixed'&&virtualYOpts.enabled){(0,_log.warnLog)('vxe.error.notConflictProp',['column.type="expand','virtual-y-config.enabled=false']);}if(expandColumn&&expandOpts.mode!=='fixed'&&mouseOpts.area){(0,_log.errLog)('vxe.error.errConflicts',['mouse-config.area','column.type=expand']);}if(expandColumn&&expandOpts.mode!=='inside'&&treeConfig&&!treeOpts.transform){(0,_log.errLog)('vxe.error.notConflictProp',['tree-config.transform=false','expand-config.mode=fixed']);}if(htmlColumn){if(!columnOpts.useKey){(0,_log.errLog)('vxe.error.notSupportProp',['column.type=html','column-config.useKey=false','column-config.useKey=true']);}if(!rowOpts.useKey){(0,_log.errLog)('vxe.error.notSupportProp',['column.type=html','row-config.useKey=false','row-config.useKey=true']);}}reactData.isGroup=isGroup;reactData.rowGroupColumn=rowGroupColumn;reactData.treeNodeColumn=treeNodeColumn;reactData.expandColumn=expandColumn;reactData.checkboxColumn=checkboxColumn;reactData.radioColumn=radioColumn;reactData.isAllOverflow=isAllOverflow;};const updateHeight=()=>{internalData.customHeight=calcTableHeight('height');internalData.customMinHeight=calcTableHeight('minHeight');internalData.customMaxHeight=calcTableHeight('maxHeight');// 如果启用虚拟滚动,默认高度
|
|
65
65
|
if(reactData.scrollYLoad&&!(internalData.customHeight||internalData.customMinHeight)){internalData.customHeight=300;}};const calcColumnAutoWidth=(column,wrapperEl)=>{const columnOpts=computeColumnOpts.value;const{autoOptions}=columnOpts;const{isCalcHeader,isCalcBody,isCalcFooter}=autoOptions||{};const querySelections=[];if(isCalcHeader){querySelections.push(`.vxe-header-cell--wrapper[colid="${column.id}"]`);}if(isCalcBody){querySelections.push(`.vxe-body-cell--wrapper[colid="${column.id}"]`);}if(isCalcFooter){querySelections.push(`.vxe-footer-cell--wrapper[colid="${column.id}"]`);}const cellElemList=querySelections.length?wrapperEl.querySelectorAll(querySelections.join(',')):[];let leftRightPadding=0;const firstCellEl=cellElemList[0];if(firstCellEl&&firstCellEl.parentElement){const cellStyle=getComputedStyle(firstCellEl.parentElement);leftRightPadding=Math.ceil(_xeUtils.default.toNumber(cellStyle.paddingLeft)+_xeUtils.default.toNumber(cellStyle.paddingRight));}let colWidth=column.renderAutoWidth-leftRightPadding;for(let i=0;i<cellElemList.length;i++){const celEl=cellElemList[i];colWidth=Math.max(colWidth,celEl?Math.ceil(celEl.scrollWidth)+4:0);}return colWidth+leftRightPadding;};const calcCellWidth=()=>{const autoWidthColumnList=computeAutoWidthColumnList.value;const{fullColumnIdData}=internalData;const el=refElem.value;if(el){el.setAttribute('data-calc-col','Y');autoWidthColumnList.forEach(column=>{const colid=column.id;const colRest=fullColumnIdData[colid];const colWidth=calcColumnAutoWidth(column,el);if(colRest){colRest.width=Math.max(colWidth,colRest.width);}column.renderAutoWidth=colWidth;});$xeTable.analyColumnWidth();el.removeAttribute('data-calc-col');}};/**
|
|
66
66
|
* 列宽算法,计算单元格列宽,动态分配可用剩余空间
|
|
67
67
|
* 支持 px、%、固定 混合分配
|