vxe-table 3.25.0-beta.5 → 3.25.0-beta.6

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.
@@ -236,7 +236,7 @@ if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(prop
236
236
  // 如果列被设置为固定,则清除合并状态
237
237
  if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn($xeTable);handleUpdateAggValues($xeTable);if(isReset){return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();}function initColumnHierarchy($xeTable){const internalData=$xeTable;const{collectColumn}=internalData;const fullColIdData={};const fullColFieldData={};let sortIndex=1;_xeUtils.default.eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const{id:colid,field}=column;const parentId=parentColumn?parentColumn.id:null;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};column.parentId=parentId;column.defaultParentId=parentId;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;sortIndex++;if(field){if(fullColFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}fullColIdData[colid]=rest;});internalData.fullColumnIdData=fullColIdData;internalData.fullColumnFieldData=fullColFieldData;}function buildColumnInfo($xeTable){const props=$xeTable;const $xeToolbar=$xeTable.$refs.$xeToolbar;const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const expandOpts=$xeTable.computeExpandOpts;cacheColumnMap($xeTable);parseColumns($xeTable,true).then(()=>{if(reactData.scrollXLoad){loadScrollXData($xeTable);}});$xeTable.clearHeaderFormatterCache();$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return $xeTable.$nextTick().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}const columnOpts=$xeTable.computeColumnOpts;if(props.showCustomHeader&&reactData.isGroup&&(columnOpts.resizable||props.resizable)){warnLog('vxe.error.notConflictProp',['show-custom-header & colgroup','column-config.resizable=false']);}reactData.isColLoading=false;return handleLazyRecalculate($xeTable,false,true,true);});}function handleInitColumn($xeTable,collectColumn){const reactData=$xeTable;const internalData=$xeTable;internalData.collectColumn=collectColumn;const tFullColumn=(0,_util.getColumnList)(collectColumn);internalData.tableFullColumn=tFullColumn;reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy($xeTable);return Promise.resolve(restoreCustomStorage($xeTable)).then(()=>{return buildColumnInfo($xeTable);});}/**
238
238
  * 纵向 Y 可视渲染处理
239
- */function loadScrollYData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,mergeBodyRowMaps,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible($xeTable);const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,mergeBodyRowMaps,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}}const createGetRowCacheProp=prop=>{return function(row){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;if(row){const rowid=(0,_util.getRowid)($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const $xeTable=this;const internalData=$xeTable;const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};function lazyScrollXData($xeTable){const internalData=$xeTable;const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData($xeTable);}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData($xeTable);},fpsTime);}function lazyScrollYData($xeTable){const internalData=$xeTable;const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData($xeTable);}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData($xeTable);},fpsTime);}function handleSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const autoWidthColumnList=$xeTable.computeAutoWidthColumnList;internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;reactData.lazScrollLoading=false;internalData.scrollRenderType='';let xRest=null;let yRest=null;if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){if(autoWidthColumnList.length){calcCellWidth($xeTable);}yRest=$xeTable.updateScrollYData().then(()=>{if(autoWidthColumnList.length){calcCellWidth($xeTable);autoCellWidth($xeTable);}if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle($xeTable);return Promise.all([xRest,yRest,scrollXLoad||scrollYLoad?$xeTable.updateCellAreas():null]);}function checkLastSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll($xeTable,isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){$xeTable.$nextTick(()=>{updateRowExpandStyle($xeTable);if(!internalData.lcsTimeout){handleSyncScroll($xeTable,isRollX,isRollY);}});}});},240);}const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const syncGanttScrollTop=($xeTable,scrollTop)=>{const internalData=$xeTable;const $xeGanttView=internalData.xeGanttView;if($xeGanttView){const ganttInternalData=$xeGanttView.internalData;const{elemStore:ganttElemStore}=ganttInternalData;const ganttBodyScrollElem=(0,_util.getRefElem)(ganttElemStore['main-body-scroll']);if(ganttBodyScrollElem){ganttBodyScrollElem.scrollTop=scrollTop;}}};function updateHeight($xeTable){const reactData=$xeTable;const internalData=$xeTable;internalData.customHeight=calcTableHeight($xeTable,'height');internalData.customMinHeight=calcTableHeight($xeTable,'minHeight');internalData.customMaxHeight=calcTableHeight($xeTable,'maxHeight');// 如果启用虚拟滚动,纠正高度
239
+ */function loadScrollYData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,mergeBodyRowMaps,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible($xeTable);const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,mergeBodyRowMaps,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}}const createGetRowCacheProp=prop=>{return function(row){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;if(row){const rowid=(0,_util.getRowid)($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const $xeTable=this;const internalData=$xeTable;const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};function lazyScrollXData($xeTable){const internalData=$xeTable;const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData($xeTable);}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData($xeTable);},fpsTime);}function lazyScrollYData($xeTable){const internalData=$xeTable;const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData($xeTable);}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData($xeTable);},fpsTime);}function handleSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const autoWidthColumnList=$xeTable.computeAutoWidthColumnList;internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;internalData.isSyncGanttScrollTop=false;reactData.lazScrollLoading=false;internalData.scrollRenderType='';const $xeGanttView=internalData.xeGanttView;if($xeGanttView){const ganttInternalData=$xeGanttView.internalData;ganttInternalData.isSyncTableScrollTop=false;}let xRest=null;let yRest=null;if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){if(autoWidthColumnList.length){calcCellWidth($xeTable);}yRest=$xeTable.updateScrollYData().then(()=>{if(autoWidthColumnList.length){calcCellWidth($xeTable);autoCellWidth($xeTable);}if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle($xeTable);return Promise.all([xRest,yRest,scrollXLoad||scrollYLoad?$xeTable.updateCellAreas():null]);}function checkLastSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll($xeTable,isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){$xeTable.$nextTick(()=>{updateRowExpandStyle($xeTable);if(!internalData.lcsTimeout){handleSyncScroll($xeTable,isRollX,isRollY);}});}});},240);}const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const syncGanttScrollTop=($xeTable,scrollTop)=>{const internalData=$xeTable;const{isSyncGanttScrollTop}=internalData;if(isSyncGanttScrollTop){return;}const $xeGanttView=internalData.xeGanttView;if($xeGanttView){const ganttInternalData=$xeGanttView.internalData;ganttInternalData.isSyncTableScrollTop=true;$xeGanttView.handleSyncScrollTop({scrollTop});}};function updateHeight($xeTable){const reactData=$xeTable;const internalData=$xeTable;internalData.customHeight=calcTableHeight($xeTable,'height');internalData.customMinHeight=calcTableHeight($xeTable,'minHeight');internalData.customMaxHeight=calcTableHeight($xeTable,'maxHeight');// 如果启用虚拟滚动,纠正高度
240
240
  if(reactData.scrollYLoad&&!(internalData.customHeight||internalData.customMinHeight||internalData.customMaxHeight)){internalData.customHeight=300;}}/**
241
241
  * 计算自适应列宽
242
242
  */function calcColumnAutoWidth($xeTable,column,wrapperEl){const reactData=$xeTable;const{scrollYLoad}=reactData;const columnOpts=$xeTable.computeColumnOpts;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=(scrollYLoad?column.renderAutoWidth:0)-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;}/**
@@ -815,7 +815,7 @@ if(transform){return handleVirtualTreeExpand($xeTable,rows,expanded);}else{retur
815
815
  * 获取表格的滚动状态
816
816
  */getScroll(){const $xeTable=this;return $xeTable.getScrollData();},/**
817
817
  * 获取表格的滚动数据
818
- */getScrollData(){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,scrollbarHeight,scrollbarWidth}=reactData;const{elemStore}=internalData;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);const scrollTop=bodyScrollElem?bodyScrollElem.scrollTop:0;const scrollLeft=bodyScrollElem?bodyScrollElem.scrollLeft:0;const clientHeight=bodyScrollElem?bodyScrollElem.clientHeight:0;const clientWidth=bodyScrollElem?bodyScrollElem.clientWidth:0;const scrollHeight=bodyScrollElem?bodyScrollElem.scrollHeight:0;const scrollWidth=bodyScrollElem?bodyScrollElem.scrollWidth:0;const isTop=scrollTop<=0;const isBottom=scrollTop+clientHeight>=scrollHeight;const isLeft=scrollLeft<=0;const isRight=scrollLeft+clientWidth>=scrollWidth;return{virtualX:scrollXLoad,virtualY:scrollYLoad,isTop,isBottom,isLeft,isRight,scrollbarHeight,scrollbarWidth,scrollTop,scrollLeft,scrollHeight,scrollWidth,clientHeight,clientWidth};},handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,params){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{highlightHoverRow}=props;const{elemStore,lastScrollLeft,lastScrollTop}=internalData;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowOpts=$xeTable.computeRowOpts;const validTip=$xeTable.$refs.refValidTooltip;const tooltip=$xeTable.$refs.refTooltip;const bodyHeight=bodyScrollElem.clientHeight;const bodyWidth=bodyScrollElem.clientWidth;const scrollHeight=bodyScrollElem.scrollHeight;const scrollWidth=bodyScrollElem.scrollWidth;let isTop=false;let isBottom=false;let isLeft=false;let isRight=false;let direction='';let isTopBoundary=false;let isBottomBoundary=false;let isLeftBoundary=false;let isRightBoundary=false;if(isRollX){const xThreshold=$xeTable.computeScrollXThreshold;isLeft=scrollLeft<=0;if(!isLeft){isRight=scrollLeft+bodyWidth>=scrollWidth-1;}if(scrollLeft>lastScrollLeft){direction='right';if(scrollLeft+bodyWidth>=scrollWidth-xThreshold){isRightBoundary=true;}}else{direction='left';if(scrollLeft<=xThreshold){isLeftBoundary=true;}}$xeTable.checkScrolling();internalData.lastScrollLeft=scrollLeft;}if(isRollY){const yThreshold=$xeTable.computeScrollYThreshold;isTop=scrollTop<=0;if(!isTop){isBottom=scrollTop+bodyHeight>=scrollHeight-1;}if(scrollTop>lastScrollTop){direction='bottom';if(scrollTop+bodyHeight>=scrollHeight-yThreshold){isBottomBoundary=true;}}else{direction='top';if(scrollTop<=yThreshold){isTopBoundary=true;}}internalData.lastScrollTop=scrollTop;}internalData.lastSTime=Date.now();const evntParams=Object.assign({source:sourceType,scrollTop,scrollLeft,bodyHeight,bodyWidth,scrollHeight,scrollWidth,isX:isRollX,isY:isRollY,isTop,isBottom,isLeft,isRight,direction},params);$xeTable.updateThumbOffset();updateRowExpandStyle($xeTable);checkLastSyncScroll($xeTable,isRollX,isRollY);if(isRollX){$xeTable.closeFilter();}if(rowOpts.isHover||highlightHoverRow){$xeTable.clearHoverRow();}if(validTip&&validTip.reactData.visible){validTip.close();}if(tooltip&&tooltip.reactData.visible){tooltip.close();}if(isBottomBoundary||isTopBoundary||isRightBoundary||isLeftBoundary){$xeTable.dispatchEvent('scroll-boundary',evntParams,evnt);}$xeTable.dispatchEvent('scroll',evntParams,evnt);},/**
818
+ */getScrollData(){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,scrollbarHeight,scrollbarWidth}=reactData;const{elemStore}=internalData;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);const scrollTop=bodyScrollElem?bodyScrollElem.scrollTop:0;const scrollLeft=bodyScrollElem?bodyScrollElem.scrollLeft:0;const clientHeight=bodyScrollElem?bodyScrollElem.clientHeight:0;const clientWidth=bodyScrollElem?bodyScrollElem.clientWidth:0;const scrollHeight=bodyScrollElem?bodyScrollElem.scrollHeight:0;const scrollWidth=bodyScrollElem?bodyScrollElem.scrollWidth:0;const isTop=scrollTop<=0;const isBottom=scrollTop+clientHeight>=scrollHeight;const isLeft=scrollLeft<=0;const isRight=scrollLeft+clientWidth>=scrollWidth;return{virtualX:scrollXLoad,virtualY:scrollYLoad,isTop,isBottom,isLeft,isRight,scrollbarHeight,scrollbarWidth,scrollTop,scrollLeft,scrollHeight,scrollWidth,clientHeight,clientWidth};},handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,params){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{highlightHoverRow}=props;const{elemStore,lastScrollLeft,lastScrollTop}=internalData;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowOpts=$xeTable.computeRowOpts;const validTip=$xeTable.$refs.refValidTooltip;const tooltip=$xeTable.$refs.refTooltip;const bodyHeight=bodyScrollElem.clientHeight;const bodyWidth=bodyScrollElem.clientWidth;const scrollHeight=bodyScrollElem.scrollHeight;const scrollWidth=bodyScrollElem.scrollWidth;let isTop=false;let isBottom=false;let isLeft=false;let isRight=false;let direction='';let isTopBoundary=false;let isBottomBoundary=false;let isLeftBoundary=false;let isRightBoundary=false;if(isRollX){const xThreshold=$xeTable.computeScrollXThreshold;isLeft=scrollLeft<=0;if(!isLeft){isRight=scrollLeft+bodyWidth>=scrollWidth-1;}if(scrollLeft>lastScrollLeft){direction='right';if(scrollLeft+bodyWidth>=scrollWidth-xThreshold){isRightBoundary=true;}}else{direction='left';if(scrollLeft<=xThreshold){isLeftBoundary=true;}}$xeTable.checkScrolling();internalData.lastScrollLeft=scrollLeft;}if(isRollY){const yThreshold=$xeTable.computeScrollYThreshold;isTop=scrollTop<=0;if(!isTop){isBottom=scrollTop+bodyHeight>=scrollHeight-1;}if(scrollTop>lastScrollTop){direction='bottom';if(scrollTop+bodyHeight>=scrollHeight-yThreshold){isBottomBoundary=true;}}else{direction='top';if(scrollTop<=yThreshold){isTopBoundary=true;}}internalData.lastScrollTop=scrollTop;}internalData.lastSTime=Date.now();const evntParams=Object.assign({source:sourceType,scrollTop,scrollLeft,bodyHeight,bodyWidth,scrollHeight,scrollWidth,isX:isRollX,isY:isRollY,isTop,isBottom,isLeft,isRight,direction},params);const isVScrollbar=$xeTable.computeIsVScrollbar;if(isVScrollbar){$xeTable.updateThumbOffset();}updateRowExpandStyle($xeTable);checkLastSyncScroll($xeTable,isRollX,isRollY);if(isRollX){$xeTable.closeFilter();}if(rowOpts.isHover||highlightHoverRow){$xeTable.clearHoverRow();}if(validTip&&validTip.reactData.visible){validTip.close();}if(tooltip&&tooltip.reactData.visible){tooltip.close();}if(isBottomBoundary||isTopBoundary||isRightBoundary||isLeftBoundary){$xeTable.dispatchEvent('scroll-boundary',evntParams,evnt);}$xeTable.dispatchEvent('scroll',evntParams,evnt);},/**
819
819
  * 横向 X 可视渲染事件处理
820
820
  */triggerScrollXEvent(){const $xeTable=this;const virtualXOpts=$xeTable.computeVirtualXOpts;if(virtualXOpts.immediate){loadScrollXData($xeTable);}else{lazyScrollXData($xeTable);}},/**
821
821
  * 纵向 Y 可视渲染事件处理
@@ -829,7 +829,7 @@ if(isRollX){evnt.preventDefault();internalData.inWheelScroll=true;(0,_dom.wheelS
829
829
  updateScrollXSpace(){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,overflowX,scrollXWidth}=reactData;const{visibleColumn,scrollXStore,elemStore,fullColumnIdData}=internalData;const $xeGanttView=internalData.xeGanttView;const mouseOpts=$xeTable.computeMouseOpts;const tableBody=$xeTable.$refs.refTableBody;const tableBodyElem=tableBody?tableBody.$el:null;if(tableBodyElem){const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);const bodyTableElem=(0,_util.getRefElem)(elemStore['main-body-table']);const headerTableElem=(0,_util.getRefElem)(elemStore['main-header-table']);const footerTableElem=(0,_util.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;}// 虚拟渲染
830
830
  let isScrollXBig=false;let ySpaceWidth=scrollXWidth;if(scrollXWidth>maxXWidth){// 触右
831
831
  if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollLeft+clientWidth>=maxXWidth){xSpaceLeft=maxXWidth-bodyTableElem.clientWidth;}else{xSpaceLeft=(maxXWidth-clientWidth)*(xSpaceLeft/(scrollXWidth-clientWidth));}ySpaceWidth=maxXWidth;isScrollXBig=true;}if(!(scrollXLoad&&overflowX)){xSpaceLeft=0;}if(getConfig().scrollMarginStyle){// 已废弃方式
832
- if(headerTableElem){headerTableElem.style.marginLeft=headerTableElem.getAttribute('xvm')?`${xSpaceLeft}px`:'';}if(bodyTableElem){bodyTableElem.style.marginLeft=`${xSpaceLeft}px`;}if(footerTableElem){footerTableElem.style.marginLeft=footerTableElem.getAttribute('xvm')?`${xSpaceLeft}px`:'';}}else{if(headerTableElem){headerTableElem.style.transform=headerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}if(bodyTableElem){bodyTableElem.style.transform=`translate(${xSpaceLeft}px, ${reactData.scrollYTop||0}px)`;}if(footerTableElem){footerTableElem.style.transform=footerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}}const containerList=['main'];containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const xSpaceElem=(0,_util.getRefElem)(elemStore[`${name}-${layout}-xSpace`]);if(xSpaceElem){xSpaceElem.style.width=scrollXLoad?`${ySpaceWidth}px`:'';}});});reactData.scrollXLeft=xSpaceLeft;reactData.scrollXWidth=ySpaceWidth;reactData.isScrollXBig=isScrollXBig;const scrollXSpaceEl=$xeTable.$refs.refScrollXSpaceElem;if(scrollXSpaceEl){scrollXSpaceEl.style.width=`${ySpaceWidth}px`;}calcScrollbar($xeTable);if(isScrollXBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}if($xeGanttView&&$xeGanttView.handleUpdateSXSpace){$xeGanttView.handleUpdateSXSpace();}return $xeTable.$nextTick(()=>{updateStyle($xeTable);});}},updateScrollYData(){const $xeTable=this;$xeTable.handleTableData();$xeTable.updateScrollYSpace();return $xeTable.$nextTick().then(()=>{$xeTable.handleTableData();$xeTable.updateScrollYSpace();});},// 更新纵向 Y 可视渲染上下剩余空间大小
832
+ if(headerTableElem){headerTableElem.style.marginLeft=headerTableElem.getAttribute('xvm')?`${xSpaceLeft}px`:'';}if(bodyTableElem){bodyTableElem.style.marginLeft=`${xSpaceLeft}px`;}if(footerTableElem){footerTableElem.style.marginLeft=footerTableElem.getAttribute('xvm')?`${xSpaceLeft}px`:'';}}else{if(headerTableElem){headerTableElem.style.transform=headerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}if(bodyTableElem){bodyTableElem.style.transform=`translate(${xSpaceLeft}px, ${reactData.scrollYTop||0}px)`;}if(footerTableElem){footerTableElem.style.transform=footerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}}const containerList=['main'];containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const xSpaceElem=(0,_util.getRefElem)(elemStore[`${name}-${layout}-xSpace`]);if(xSpaceElem){xSpaceElem.style.width=scrollXLoad?`${ySpaceWidth}px`:'';}});});reactData.scrollXLeft=xSpaceLeft;reactData.scrollXWidth=ySpaceWidth;reactData.isScrollXBig=isScrollXBig;const scrollXSpaceEl=$xeTable.$refs.refScrollXSpaceElem;if(scrollXSpaceEl){scrollXSpaceEl.style.width=`${ySpaceWidth}px`;}calcScrollbar($xeTable);if(isScrollXBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}if($xeGanttView&&$xeGanttView.handleUpdateSXSpace){$xeGanttView.handleUpdateSXSpace();}return $xeTable.$nextTick(()=>{updateStyle($xeTable);});}},updateScrollYData(){const $xeTable=this;$xeTable.handleTableData();$xeTable.updateScrollYSpace();return $xeTable.$nextTick().then(()=>{$xeTable.handleTableData();$xeTable.updateScrollYSpace();});},handleSyncScrollTop(params){const $xeTable=this;const internalData=$xeTable;const{scrollTop}=params;const{elemStore}=internalData;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);if(bodyScrollElem){bodyScrollElem.scrollTop=scrollTop;}},// 更新纵向 Y 可视渲染上下剩余空间大小
833
833
  updateScrollYSpace(){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{isAllOverflow,overflowY,scrollYLoad,scrollYHeight,expandColumn}=reactData;const{scrollYStore,elemStore,isResizeCellHeight,afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const $xeGanttView=internalData.xeGanttView;const{startIndex}=scrollYStore;const mouseOpts=$xeTable.computeMouseOpts;const expandOpts=$xeTable.computeExpandOpts;const rowOpts=$xeTable.computeRowOpts;const cellOpts=$xeTable.computeCellOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);const bodyTableElem=(0,_util.getRefElem)(elemStore['main-body-table']);const leftBodyTableElem=(0,_util.getRefElem)(elemStore['left-body-table']);const rightbodyTableElem=(0,_util.getRefElem)(elemStore['right-body-table']);const containerList=['main','left','right'];let ySpaceTop=0;let sYHeight=scrollYHeight;let isScrollYBig=false;if(scrollYLoad){const isCustomCellHeight=isResizeCellHeight||cellOpts.height||rowOpts.height;if(!isCustomCellHeight&&!expandColumn&&isAllOverflow){sYHeight=afterFullData.length*defaultRowHeight;if(sYHeight>maxYHeight){isScrollYBig=true;}ySpaceTop=Math.max(0,startIndex*defaultRowHeight);}else{const firstRow=afterFullData[startIndex];if(firstRow){let rowid=(0,_util.getRowid)($xeTable,firstRow);let rowRest=fullAllDataRowIdData[rowid]||{};ySpaceTop=rowRest.oTop||0;const lastRow=afterFullData[afterFullData.length-1];rowid=(0,_util.getRowid)($xeTable,lastRow);rowRest=fullAllDataRowIdData[rowid]||{};if(rowRest){const rHeight=(0,_util.getCellRestHeight)(rowRest,cellOpts,rowOpts,defaultRowHeight);// 如果为空时还没计算完数据,保持原高度不变
834
834
  if(rHeight){sYHeight=(rowRest.oTop||0)+rHeight;// 是否展开行
835
835
  if(expandColumn&&rowExpandedMaps[rowid]){sYHeight+=rowRest.expandHeight||expandOpts.height||0;}}}if(sYHeight>maxYHeight){isScrollYBig=true;}}else{sYHeight=bodyTableElem?bodyTableElem.clientHeight:0;}}}else{if(bodyTableElem){sYHeight=bodyTableElem.clientHeight;}}let clientHeight=0;if(bodyScrollElem){clientHeight=bodyScrollElem.clientHeight;}// 虚拟渲染