vxe-table 4.13.0-beta.4 → 4.13.0

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.
Files changed (38) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/table.js +54 -39
  6. package/es/table/style.css +12 -0
  7. package/es/table/style.min.css +1 -1
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/es/vxe-table/style.css +12 -0
  11. package/es/vxe-table/style.min.css +1 -1
  12. package/helper/vetur/attributes.json +1 -1
  13. package/helper/vetur/tags.json +1 -1
  14. package/lib/index.css +1 -1
  15. package/lib/index.min.css +1 -1
  16. package/lib/index.umd.js +11 -10
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/src/table.js +59 -39
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/table/style/style.css +12 -0
  23. package/lib/table/style/style.min.css +1 -1
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/log.js +1 -1
  27. package/lib/ui/src/log.min.js +1 -1
  28. package/lib/vxe-table/style/style.css +12 -0
  29. package/lib/vxe-table/style/style.min.css +1 -1
  30. package/package.json +2 -2
  31. package/packages/table/src/table.ts +60 -40
  32. package/styles/components/table.scss +19 -0
  33. /package/es/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
  34. /package/es/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
  35. /package/es/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
  36. /package/lib/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
  37. /package/lib/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
  38. /package/lib/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.13.0-beta.4";
3141
+ const version = "4.13.0";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3587,7 +3587,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3587
3587
  const {
3588
3588
  log: log_log
3589
3589
  } = core_.VxeUI;
3590
- const log_version = `table v${"4.13.0-beta.4"}`;
3590
+ const log_version = `table v${"4.13.0"}`;
3591
3591
  const warnLog = log_log.create('warn', log_version);
3592
3592
  const errLog = log_log.create('error', log_version);
3593
3593
  ;// ./packages/table/src/columnInfo.ts
@@ -10496,8 +10496,8 @@ if(hasCustomSort){collectColumn=external_root_XEUtils_commonjs_xe_utils_commonjs
10496
10496
  * 支持动态列表调整分配
10497
10497
  * 支持自动分配偏移量
10498
10498
  * 支持 width=60 width=60px width=10% min-width=60 min-width=60px min-width=10%
10499
- */const autoCellWidth=()=>{const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const tableBody=refTableBody.value;const bodyElem=tableBody?tableBody.$el:null;if(!bodyElem){return;}const yHandleEl=refScrollYHandleElem.value;if(!yHandleEl){return;}const xHandleEl=refScrollXHandleElem.value;if(!xHandleEl){return;}let tWidth=0;const minCellWidth=40;// 列宽最少限制 40px
10500
- const bodyWidth=bodyElem.clientWidth;let remainWidth=bodyWidth;let meanWidth=remainWidth/100;const{fit}=props;const{columnStore}=reactData;const{resizeList,pxMinList,autoMinList,pxList,scaleList,scaleMinList,autoList,remainList}=columnStore;// 最小宽
10499
+ */const autoCellWidth=()=>{const{elemStore}=internalData;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);if(!bodyWrapperElem){return;}const yHandleEl=refScrollYHandleElem.value;if(!yHandleEl){return;}const xHandleEl=refScrollXHandleElem.value;if(!xHandleEl){return;}let tWidth=0;const minCellWidth=40;// 列宽最少限制 40px
10500
+ const bodyWidth=bodyWrapperElem.clientWidth;let remainWidth=bodyWidth;let meanWidth=remainWidth/100;const{fit}=props;const{columnStore}=reactData;const{resizeList,pxMinList,autoMinList,pxList,scaleList,scaleMinList,autoList,remainList}=columnStore;// 最小宽
10501
10501
  pxMinList.forEach(column=>{const minWidth=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.minWidth);tWidth+=minWidth;column.renderWidth=minWidth;});// 最小自适应
10502
10502
  autoMinList.forEach(column=>{const caWidth=Math.max(60,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.renderAutoWidth));tWidth+=caWidth;column.renderWidth=caWidth;});// 最小百分比
10503
10503
  scaleMinList.forEach(column=>{const smWidth=Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.minWidth)*meanWidth);tWidth+=smWidth;column.renderWidth=smWidth;});// 固定百分比
@@ -10508,7 +10508,7 @@ resizeList.forEach(column=>{const reWidth=external_root_XEUtils_commonjs_xe_util
10508
10508
  remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.renderWidth=width;tWidth+=width;});if(fit){/**
10509
10509
  * 偏移量算法
10510
10510
  * 如果所有列足够放的情况下,从最后动态列开始分配
10511
- */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;}}}const tableHeight=bodyElem.offsetHeight;const overflowY=yHandleEl.scrollHeight>yHandleEl.clientHeight;reactData.scrollbarWidth=Math.max(scrollbarOpts.width||0,yHandleEl.offsetWidth-yHandleEl.clientWidth);reactData.overflowY=overflowY;reactData.scrollXWidth=tWidth;internalData.tableHeight=tableHeight;const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const overflowX=tWidth>bodyWidth;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;reactData.scrollbarHeight=Math.max(scrollbarOpts.height||0,xHandleEl.offsetHeight-xHandleEl.clientHeight);internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;reactData.resizeWidthFlag++;updateColumnOffsetLeft();updateHeight();reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());if(overflowX){$xeTable.checkScrolling();}};const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;for(let i=0;i<cellElemList.length;i++){const cellElem=cellElemList[i];const tdEl=cellElem.parentElement;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));const cellHeight=cellElem?cellElem.clientHeight:0;colHeight=Math.max(colHeight-topBottomPadding,Math.ceil(cellHeight));}return colHeight;};const calcCellHeight=()=>{const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&scrollYLoad&&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,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;};/**
10511
+ */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();};const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;for(let i=0;i<cellElemList.length;i++){const cellElem=cellElemList[i];const tdEl=cellElem.parentElement;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));const cellHeight=cellElem?cellElem.clientHeight:0;colHeight=Math.max(colHeight-topBottomPadding,Math.ceil(cellHeight));}return colHeight;};const calcCellHeight=()=>{const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&scrollYLoad&&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,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;};/**
10512
10512
  * 预编译
10513
10513
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
10514
10514
  */const updateAfterDataIndex=()=>{const{treeConfig}=props;const{fullDataRowIdData,fullAllDataRowIdData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};if(treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,(row,index,items,path)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=path.map((num,i)=>i%2===0?Number(num)+1:'.').join('');if(rowRest){rowRest.seq=seq;rowRest.treeIndex=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;},{children:transform?treeOpts.mapChildrenField:childrenField});internalData.afterFullRowMaps=fullMaps;updateAfterListIndex();}else{updateAfterListIndex();}};/**
@@ -10589,8 +10589,9 @@ reactData.treeExpandedFlag++;if(treeConfig&&treeOpts.reserve){$xeTable.setTreeEx
10589
10589
  if(!checkStrictly&&$xeTable.isCheckedByCheckboxRow(row)){handleCheckedCheckboxRow(childRows,true);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(transform){$xeTable.handleTableData();updateAfterDataIndex();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}});});}}).catch(()=>{const{treeExpandLazyLoadedMaps}=internalData;if(rowRest){rowRest.treeLoaded=false;}if(treeExpandLazyLoadedMaps[rowid]){delete treeExpandLazyLoadedMaps[rowid];}}).finally(()=>{reactData.treeExpandedFlag++;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>$xeTable.recalculate()).then(()=>resolve());});}else{resolve();}});};const handleTreeExpandReserve=(row,expanded)=>{const{treeExpandedReserveRowMap}=internalData;const treeOpts=computeTreeOpts.value;if(treeOpts.reserve){const rowid=getRowid($xeTable,row);if(expanded){treeExpandedReserveRowMap[rowid]=row;}else if(treeExpandedReserveRowMap[rowid]){delete treeExpandedReserveRowMap[rowid];}}};const handleAsyncRowExpand=row=>{return new Promise(resolve=>{const expandOpts=computeExpandOpts.value;const{loadMethod}=expandOpts;if(loadMethod){const{fullAllDataRowIdData,rowExpandLazyLoadedMaps}=internalData;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];rowExpandLazyLoadedMaps[rowid]=row;loadMethod({$table:$xeTable,row,rowIndex:$xeTable.getRowIndex(row),$rowIndex:$xeTable.getVMRowIndex(row)}).then(()=>{const{rowExpandedMaps}=internalData;if(rowRest){rowRest.expandLoaded=true;}rowExpandedMaps[rowid]=row;reactData.rowExpandedFlag++;}).catch(()=>{if(rowRest){rowRest.expandLoaded=false;}}).finally(()=>{const{rowExpandLazyLoadedMaps}=internalData;if(rowExpandLazyLoadedMaps[rowid]){delete rowExpandLazyLoadedMaps[rowid];}reactData.rowExpandedFlag++;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>$xeTable.recalculate()).then(()=>$xeTable.updateCellAreas()).then(()=>resolve());});}else{resolve();}});};const handleRowExpandReserve=(row,expanded)=>{const{rowExpandedReserveRowMap}=internalData;const expandOpts=computeExpandOpts.value;if(expandOpts.reserve){const rowid=getRowid($xeTable,row);if(expanded){rowExpandedReserveRowMap[rowid]=row;}else if(rowExpandedReserveRowMap[rowid]){delete rowExpandedReserveRowMap[rowid];}}};const handleDefaultMergeCells=()=>{const{mergeCells}=props;if(mergeCells){$xeTable.setMergeCells(mergeCells);}};const handleDefaultMergeFooterItems=()=>{const{mergeFooterItems}=props;if(mergeFooterItems){$xeTable.setMergeFooterItems(mergeFooterItems);}};// 计算可视渲染相关数据
10590
10590
  const computeScrollLoad=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{const{scrollXLoad,scrollYLoad}=reactData;const{scrollXStore,scrollYStore}=internalData;const virtualYOpts=computeVirtualYOpts.value;const virtualXOpts=computeVirtualXOpts.value;// 计算 X 逻辑
10591
10591
  if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible();const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData();});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
10592
- const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{updateStyle();});});};const handleRecalculateLayout=reFull=>{const el=refElem.value;internalData.rceRunTime=Date.now();if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}calcCellWidth();autoCellWidth();updateStyle();updateRowExpandStyle();return computeScrollLoad().then(()=>{if(reFull===true){// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
10593
- calcCellWidth();autoCellWidth();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();return computeScrollLoad();}});};/**
10592
+ const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;// 已废弃
10593
+ reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=Math.max(scrollbarOpts.width||0,yHandleEl.offsetWidth-yHandleEl.clientWidth);}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=Math.max(scrollbarOpts.height||0,xHandleEl.offsetHeight-xHandleEl.clientHeight);}const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}};const handleRecalculateLayout=reFull=>{const el=refElem.value;internalData.rceRunTime=Date.now();if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}calcCellWidth();autoCellWidth();calcScrollbar();updateStyle();updateRowExpandStyle();return computeScrollLoad().then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
10594
+ calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};/**
10594
10595
  * 加载表格数据
10595
10596
  * @param {Array} datas 数据
10596
10597
  */const loadTableData=(datas,isReset)=>{const{keepSource,treeConfig}=props;const{scrollYLoad:oldScrollYLoad}=reactData;const{scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据
@@ -11189,10 +11190,10 @@ if(isRollX){evnt.preventDefault();internalData.inWheelScroll=true;wheelScrollLef
11189
11190
  updateScrollXSpace(){const{isGroup,scrollXLoad,overflowX,scrollXWidth}=reactData;const{visibleColumn,scrollXStore,elemStore,fullColumnIdData}=internalData;const mouseOpts=computeMouseOpts.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;if(tableBodyElem){const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);let xSpaceLeft=0;const firstColumn=visibleColumn[scrollXStore.startIndex];if(firstColumn){const colRest=fullColumnIdData[firstColumn.id]||{};xSpaceLeft=colRest.oLeft;}let clientWidth=0;if(bodyScrollElem){clientWidth=bodyScrollElem.clientWidth;}// 虚拟渲染
11190
11191
  let isScrollXBig=false;let ySpaceWidth=scrollXWidth;if(scrollXWidth>maxXWidth){// 触右
11191
11192
  if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollLeft+clientWidth>=maxXWidth){xSpaceLeft=maxXWidth-bodyTableElem.clientWidth;}else{xSpaceLeft=(maxXWidth-clientWidth)*(xSpaceLeft/(scrollXWidth-clientWidth));}ySpaceWidth=maxXWidth;isScrollXBig=true;}let marginLeft='';if(scrollXLoad&&overflowX){marginLeft=`${xSpaceLeft}px`;}if(headerTableElem){headerTableElem.style.marginLeft=isGroup?'':marginLeft;}if(bodyTableElem){bodyTableElem.style.marginLeft=marginLeft;}if(footerTableElem){footerTableElem.style.marginLeft=marginLeft;}reactData.isScrollXBig=isScrollXBig;const containerList=['main'];containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const xSpaceElem=getRefElem(elemStore[`${name}-${layout}-xSpace`]);if(xSpaceElem){xSpaceElem.style.width=scrollXLoad?`${ySpaceWidth}px`:'';}});});const scrollXSpaceEl=refScrollXSpaceElem.value;if(scrollXSpaceEl){scrollXSpaceEl.style.width=`${ySpaceWidth}px`;}if(isScrollXBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{updateStyle();});}},// 更新纵向 Y 可视渲染上下剩余空间大小
11192
- updateScrollYSpace(){const{isAllOverflow,scrollYLoad,expandColumn}=reactData;const{scrollYStore,elemStore,isResizeCellHeight,afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const{startIndex}=scrollYStore;const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const containerList=['main','left','right'];let ySpaceTop=0;let scrollYHeight=0;let isScrollYBig=false;if(scrollYLoad){const isCustomCellHeight=isResizeCellHeight||cellOpts.height||rowOpts.height;if(!isCustomCellHeight&&!expandColumn&&isAllOverflow){scrollYHeight=afterFullData.length*defaultRowHeight;if(scrollYHeight>maxYHeight){isScrollYBig=true;}ySpaceTop=Math.max(0,startIndex*defaultRowHeight);}else{const firstRow=afterFullData[startIndex];let rowid=getRowid($xeTable,firstRow);let rowRest=fullAllDataRowIdData[rowid]||{};ySpaceTop=rowRest.oTop;const lastRow=afterFullData[afterFullData.length-1];rowid=getRowid($xeTable,lastRow);rowRest=fullAllDataRowIdData[rowid]||{};scrollYHeight=rowRest.oTop+(rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight);// 是否展开行
11193
+ updateScrollYSpace(){const{isAllOverflow,scrollYLoad,expandColumn}=reactData;const{scrollYStore,elemStore,isResizeCellHeight,afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const{startIndex}=scrollYStore;const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const containerList=['main','left','right'];let ySpaceTop=0;let scrollYHeight=0;let isScrollYBig=false;if(scrollYLoad){const isCustomCellHeight=isResizeCellHeight||cellOpts.height||rowOpts.height;if(!isCustomCellHeight&&!expandColumn&&isAllOverflow){scrollYHeight=afterFullData.length*defaultRowHeight;if(scrollYHeight>maxYHeight){isScrollYBig=true;}ySpaceTop=Math.max(0,startIndex*defaultRowHeight);}else{const firstRow=afterFullData[startIndex];let rowid=getRowid($xeTable,firstRow);let rowRest=fullAllDataRowIdData[rowid]||{};ySpaceTop=rowRest.oTop||0;const lastRow=afterFullData[afterFullData.length-1];rowid=getRowid($xeTable,lastRow);rowRest=fullAllDataRowIdData[rowid]||{};scrollYHeight=(rowRest.oTop||0)+(rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight);// 是否展开行
11193
11194
  if(expandColumn&&rowExpandedMaps[rowid]){scrollYHeight+=rowRest.expandHeight||expandOpts.height||0;}if(scrollYHeight>maxYHeight){isScrollYBig=true;}}}else{if(bodyTableElem){scrollYHeight=bodyTableElem.clientHeight;}}let clientHeight=0;if(bodyScrollElem){clientHeight=bodyScrollElem.clientHeight;}// 虚拟渲染
11194
11195
  let ySpaceHeight=scrollYHeight;let scrollYTop=ySpaceTop;if(isScrollYBig){// 触底
11195
- if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHeight){scrollYTop=maxYHeight-bodyTableElem.clientHeight;}else{scrollYTop=(maxYHeight-clientHeight)*(ySpaceTop/(scrollYHeight-clientHeight));}ySpaceHeight=maxYHeight;}containerList.forEach(name=>{const layoutList=['header','body','footer'];const tableElem=getRefElem(elemStore[`${name}-body-table`]);if(tableElem){tableElem.style.marginTop=scrollYTop?`${scrollYTop}px`:'';}layoutList.forEach(layout=>{const ySpaceElem=getRefElem(elemStore[`${name}-${layout}-ySpace`]);if(ySpaceElem){ySpaceElem.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}});});const scrollYSpaceEl=refScrollYSpaceElem.value;if(scrollYSpaceEl){scrollYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}const rowExpandYSpaceEl=refRowExpandYSpaceElem.value;if(rowExpandYSpaceEl){rowExpandYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}reactData.scrollYTop=scrollYTop;reactData.scrollYHeight=scrollYHeight;reactData.isScrollYBig=isScrollYBig;if(isScrollYBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});},updateScrollXData(){const{isAllOverflow}=reactData;handleTableColumn();$xeTable.updateScrollYSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{handleTableColumn();$xeTable.updateScrollXSpace();if(!isAllOverflow){$xeTable.updateScrollYSpace();}});},updateScrollYData(){$xeTable.handleTableData();$xeTable.updateScrollYSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{$xeTable.handleTableData();$xeTable.updateScrollYSpace();});},/**
11196
+ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHeight){scrollYTop=maxYHeight-bodyTableElem.clientHeight;}else{scrollYTop=(maxYHeight-clientHeight)*(ySpaceTop/(scrollYHeight-clientHeight));}ySpaceHeight=maxYHeight;}containerList.forEach(name=>{const layoutList=['header','body','footer'];const tableElem=getRefElem(elemStore[`${name}-body-table`]);if(tableElem){tableElem.style.marginTop=scrollYTop?`${scrollYTop}px`:'';}layoutList.forEach(layout=>{const ySpaceElem=getRefElem(elemStore[`${name}-${layout}-ySpace`]);if(ySpaceElem){ySpaceElem.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}});});const scrollYSpaceEl=refScrollYSpaceElem.value;if(scrollYSpaceEl){scrollYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}const rowExpandYSpaceEl=refRowExpandYSpaceElem.value;if(rowExpandYSpaceEl){rowExpandYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}reactData.scrollYTop=scrollYTop;reactData.scrollYHeight=scrollYHeight;reactData.isScrollYBig=isScrollYBig;if(isScrollYBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});},updateScrollXData(){const{isAllOverflow}=reactData;handleTableColumn();$xeTable.updateScrollXSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{handleTableColumn();$xeTable.updateScrollXSpace();if(!isAllOverflow){$xeTable.updateScrollYSpace();}});},updateScrollYData(){$xeTable.handleTableData();$xeTable.updateScrollYSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{$xeTable.handleTableData();$xeTable.updateScrollYSpace();});},/**
11196
11197
  * 处理固定列的显示状态
11197
11198
  */checkScrolling(){const{elemStore}=internalData;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const xHandleEl=refScrollXHandleElem.value;const bodtTargetEl=xHandleEl||bodyScrollElem;if(bodtTargetEl){if(leftContainerElem){if(bodtTargetEl.scrollLeft>0){addClass(leftContainerElem,'scrolling--middle');}else{removeClass(leftContainerElem,'scrolling--middle');}}if(rightContainerElem){if(bodtTargetEl.clientWidth<bodtTargetEl.scrollWidth-Math.ceil(bodtTargetEl.scrollLeft)){addClass(rightContainerElem,'scrolling--middle');}else{removeClass(rightContainerElem,'scrolling--middle');}}}},updateZindex(){if(props.zIndex){internalData.tZindex=props.zIndex;}else if(internalData.tZindex<getLastZIndex()){internalData.tZindex=nextZIndex();}},handleCheckedCheckboxRow,/**
11198
11199
  * 行 hover 事件
@@ -11241,7 +11242,7 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
11241
11242
  * 通用提示
11242
11243
  */(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,{key:'ctp',ref:refCommTooltip,isArrow:false,enterable:false}),/**
11243
11244
  * 工具提示
11244
- */(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,{key:'btp',ref:refTooltip,theme:tableTipConfig.theme,enterable:tableTipConfig.enterable,enterDelay:tableTipConfig.enterDelay,leaveDelay:tableTipConfig.leaveDelay}),/**
11245
+ */(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,{key:'btp',ref:refTooltip,theme:tableTipConfig.theme,enterable:tableTipConfig.enterable,enterDelay:tableTipConfig.enterDelay,leaveDelay:tableTipConfig.leaveDelay,useHTML:tableTipConfig.useHTML}),/**
11245
11246
  * 校验提示
11246
11247
  */props.editRules&&validOpts.showMessage&&(validOpts.message==='default'?!height:validOpts.message==='tooltip')?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,{key:'vtp',ref:refValidTooltip,class:[{'old-cell-valid':editRules&&table_getConfig().cellVaildMode==='obsolete'},'vxe-table--valid-error'],theme:validTipConfig.theme,enterable:validTipConfig.enterable,enterDelay:validTipConfig.enterDelay,leaveDelay:validTipConfig.leaveDelay}):table_renderEmptyElement($xeTable)]):table_renderEmptyElement($xeTable)]);};const dataFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.data?props.data.length:-1,()=>{dataFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.data,()=>{dataFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(dataFlag,()=>{const{initStatus}=internalData;const value=props.data||[];if(value&&value.length>=50000){warnLog('vxe.error.errLargeData',['loadData(data), reloadData(data)']);}loadTableData(value,false).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const expandOpts=computeExpandOpts.value;internalData.inited=true;internalData.initStatus=true;if(!initStatus){handleLoadDefaults();}// const checkboxOpts = computeCheckboxOpts.value
11247
11248
  // const checkboxColumn = internalData.tableFullColumn.find(column => column.type === 'checkbox')