vxe-table 4.17.25 → 4.17.27

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 (40) 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 +16 -8
  6. package/es/toolbar/src/toolbar.js +73 -91
  7. package/es/toolbar/style.css +10 -1
  8. package/es/toolbar/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-toolbar/style.css +10 -1
  12. package/es/vxe-toolbar/style.min.css +1 -1
  13. package/lib/index.css +1 -1
  14. package/lib/index.min.css +1 -1
  15. package/lib/index.umd.js +120 -146
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/table.js +3 -3
  20. package/lib/table/src/table.min.js +1 -1
  21. package/lib/toolbar/src/toolbar.js +117 -143
  22. package/lib/toolbar/src/toolbar.min.js +1 -1
  23. package/lib/toolbar/style/style.css +10 -1
  24. package/lib/toolbar/style/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/lib/vxe-toolbar/style/style.css +10 -1
  30. package/lib/vxe-toolbar/style/style.min.css +1 -1
  31. package/package.json +1 -1
  32. package/packages/table/src/table.ts +16 -8
  33. package/packages/toolbar/src/toolbar.ts +87 -117
  34. package/styles/components/toolbar.scss +10 -1
  35. /package/es/{iconfont.1764811572357.ttf → iconfont.1765156968806.ttf} +0 -0
  36. /package/es/{iconfont.1764811572357.woff → iconfont.1765156968806.woff} +0 -0
  37. /package/es/{iconfont.1764811572357.woff2 → iconfont.1765156968806.woff2} +0 -0
  38. /package/lib/{iconfont.1764811572357.ttf → iconfont.1765156968806.ttf} +0 -0
  39. /package/lib/{iconfont.1764811572357.woff → iconfont.1765156968806.woff} +0 -0
  40. /package/lib/{iconfont.1764811572357.woff2 → iconfont.1765156968806.woff2} +0 -0
@@ -46,7 +46,7 @@ exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:fal
46
46
  return Object.assign({},globalScrollX,scrollX);}if(globalVirtualXConfig){return Object.assign({},globalVirtualXConfig,virtualXConfig);}// 已废弃,保留兼容
47
47
  return Object.assign({},globalScrollX,scrollX);});const computeVirtualYOpts=(0,_vue.computed)(()=>{const{virtualYConfig,scrollY}=props;const globalVirtualYConfig=getConfig().table.virtualYConfig;const globalScrollY=getConfig().table.scrollY;if(virtualYConfig){return Object.assign({},globalVirtualYConfig,virtualYConfig);}if(scrollY){// 已废弃,保留兼容
48
48
  return Object.assign({},globalScrollY,scrollY);}if(globalVirtualYConfig){return Object.assign({},globalVirtualYConfig,virtualYConfig);}// 已废弃,保留兼容
49
- return Object.assign({},globalScrollY,scrollY);});const computeScrollbarOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXOpts=(0,_vue.computed)(()=>{var _a;const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.x,((_a=props.scrollbarConfig)===null||_a===void 0?void 0:_a.x)||{});});const computeScrollbarYOpts=(0,_vue.computed)(()=>{var _a;const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.y,((_a=props.scrollbarConfig)===null||_a===void 0?void 0:_a.y)||{});});const computeScrollbarXToTop=(0,_vue.computed)(()=>{const scrollbarXOpts=computeScrollbarXOpts.value;return scrollbarXOpts.position==='top';});const computeScrollbarYToLeft=(0,_vue.computed)(()=>{const scrollbarYOpts=computeScrollbarYOpts.value;return scrollbarYOpts.position==='left';});const computeScrollYThreshold=(0,_vue.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return _xeUtils.default.toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,_vue.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,_vue.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,_vue.computed)(()=>{const cellOpts=Object.assign({},getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=_xeUtils.default.toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,_vue.computed)(()=>{const headerCellOpts=Object.assign({},getConfig().table.headerCellConfig,props.headerCellConfig);const defaultRowHeight=computeDefaultRowHeight.value;const cellOpts=computeCellOpts.value;let headCellHeight=_xeUtils.default.toNumber((0,_util.getCalcHeight)(headerCellOpts.height||cellOpts.height));if($xeGantt){const{computeTaskScaleConfs}=$xeGantt.getComputeMaps();const taskScaleConfs=computeTaskScaleConfs.value;if(taskScaleConfs&&taskScaleConfs.length>2){const ganttMinHeadCellHeight=defaultRowHeight/2*taskScaleConfs.length;headCellHeight=Math.max(ganttMinHeadCellHeight,headCellHeight);}}headerCellOpts.height=headCellHeight;return headerCellOpts;});const computeFooterCellOpts=(0,_vue.computed)(()=>{const footerCellOpts=Object.assign({},getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=_xeUtils.default.toNumber((0,_util.getCalcHeight)(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.aggregateConfig||getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,_vue.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,_vue.computed)(()=>{return Object.assign({startIndex:0},getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().tooltip,getConfig().table.tooltipConfig,props.tooltipConfig);});const computeHeaderTooltipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().tooltip,getConfig().table.headerTooltipConfig,props.headerTooltipConfig);});const computeFooterTooltipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().tooltip,getConfig().table.footerTooltipConfig,props.footerTooltipConfig);});const computeTableTipConfig=(0,_vue.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,_vue.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,_vue.computed)(()=>{return Object.assign({orders:['asc','desc',null]},getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.filterConfig,props.filterConfig);});const computeFloatingFilterOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.floatingFilterConfig,props.floatingFilterConfig);});const computeMouseOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,_vue.computed)(()=>{const fnrOpts=computeFnrOpts.value;return fnrOpts;});const computeFnrOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,_vue.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,_vue.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeBodyMergeCoverFixed=(0,_vue.computed)(()=>{const{columnStore,mergeBodyFlag}=reactData;const{mergeBodyList,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const rscIndex=visibleColumn.length-rightList.length;if(mergeBodyFlag&&(leftList.length||rightList.length)){const lecIndex=leftList.length;for(let i=0;i<mergeBodyList.length;i++){const{col,colspan}=mergeBodyList[i];if(col<lecIndex||col+colspan>rscIndex){return true;}}}return false;});const computeIsHeaderRenderOptimize=(0,_vue.computed)(()=>{const{spanMethod,footerSpanMethod,showHeaderOverflow:allColumnHeaderOverflow}=props;const{isGroup,scrollXLoad}=reactData;let isOptimizeMode=false;if(isGroup){// 分组表头
49
+ return Object.assign({},globalScrollY,scrollY);});const computeScrollbarOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXOpts=(0,_vue.computed)(()=>{var _a;const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.x,((_a=props.scrollbarConfig)===null||_a===void 0?void 0:_a.x)||{});});const computeScrollbarYOpts=(0,_vue.computed)(()=>{var _a;const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.y,((_a=props.scrollbarConfig)===null||_a===void 0?void 0:_a.y)||{});});const computeScrollbarXToTop=(0,_vue.computed)(()=>{const scrollbarXOpts=computeScrollbarXOpts.value;return scrollbarXOpts.position==='top';});const computeScrollbarYToLeft=(0,_vue.computed)(()=>{const scrollbarYOpts=computeScrollbarYOpts.value;return scrollbarYOpts.position==='left';});const computeScrollYThreshold=(0,_vue.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return _xeUtils.default.toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,_vue.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,_vue.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,_vue.computed)(()=>{const cellOpts=Object.assign({},getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=_xeUtils.default.toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,_vue.computed)(()=>{const headerCellOpts=Object.assign({},getConfig().table.headerCellConfig,props.headerCellConfig);const defaultRowHeight=computeDefaultRowHeight.value;const cellOpts=computeCellOpts.value;let headCellHeight=_xeUtils.default.toNumber((0,_util.getCalcHeight)(headerCellOpts.height||cellOpts.height));if($xeGantt){const{computeTaskViewScales}=$xeGantt.getComputeMaps();const taskViewScales=computeTaskViewScales.value;if(taskViewScales&&taskViewScales.length>2){const ganttMinHeadCellHeight=defaultRowHeight/2*taskViewScales.length;headCellHeight=Math.max(ganttMinHeadCellHeight,headCellHeight);}}headerCellOpts.height=headCellHeight;return headerCellOpts;});const computeFooterCellOpts=(0,_vue.computed)(()=>{const footerCellOpts=Object.assign({},getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=_xeUtils.default.toNumber((0,_util.getCalcHeight)(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.aggregateConfig||getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,_vue.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,_vue.computed)(()=>{return Object.assign({startIndex:0},getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().tooltip,getConfig().table.tooltipConfig,props.tooltipConfig);});const computeHeaderTooltipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().tooltip,getConfig().table.headerTooltipConfig,props.headerTooltipConfig);});const computeFooterTooltipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().tooltip,getConfig().table.footerTooltipConfig,props.footerTooltipConfig);});const computeTableTipConfig=(0,_vue.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,_vue.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,_vue.computed)(()=>{return Object.assign({orders:['asc','desc',null]},getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.filterConfig,props.filterConfig);});const computeFloatingFilterOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.floatingFilterConfig,props.floatingFilterConfig);});const computeMouseOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,_vue.computed)(()=>{const fnrOpts=computeFnrOpts.value;return fnrOpts;});const computeFnrOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,_vue.computed)(()=>{return Object.assign({},getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,_vue.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,_vue.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeBodyMergeCoverFixed=(0,_vue.computed)(()=>{const{columnStore,mergeBodyFlag}=reactData;const{mergeBodyList,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const rscIndex=visibleColumn.length-rightList.length;if(mergeBodyFlag&&(leftList.length||rightList.length)){const lecIndex=leftList.length;for(let i=0;i<mergeBodyList.length;i++){const{col,colspan}=mergeBodyList[i];if(col<lecIndex||col+colspan>rscIndex){return true;}}}return false;});const computeIsHeaderRenderOptimize=(0,_vue.computed)(()=>{const{spanMethod,footerSpanMethod,showHeaderOverflow:allColumnHeaderOverflow}=props;const{isGroup,scrollXLoad}=reactData;let isOptimizeMode=false;if(isGroup){// 分组表头
50
50
  }else{// 如果是使用优化模式
51
51
  if(scrollXLoad&&allColumnHeaderOverflow){if(spanMethod||footerSpanMethod){// 如果不支持优化模式
52
52
  }else{isOptimizeMode=true;}}}return isOptimizeMode;});const computeIsBodyRenderOptimize=(0,_vue.computed)(()=>{const{spanMethod,footerSpanMethod}=props;const{scrollXLoad,scrollYLoad,isAllOverflow,expandColumn}=reactData;const bodyMergeCoverFixed=computeBodyMergeCoverFixed.value;const expandOpts=computeExpandOpts.value;let isOptimizeMode=false;// 如果是使用优化模式
@@ -281,8 +281,8 @@ const matchObj=_xeUtils.default.findTree(tableFullGroupData,item=>(0,_util.getRo
281
281
  * 处理默认展开分组行
282
282
  */const handleDefaultRowGroupExpand=()=>{const{isRowGroupStatus}=reactData;if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{expandAll,expandGroupFields}=aggregateOpts;if(expandAll){$xeTable.setAllRowGroupExpand(true);}else if(expandGroupFields&&expandGroupFields.length){$xeTable.setRowGroupExpandByField(expandGroupFields,true);}}};const handleCheckAllEvent=(evnt,value)=>{handleCheckedAllCheckboxRow(value);if(evnt){dispatchEvent('checkbox-all',{records:()=>$xeTable.getCheckboxRecords(),reserves:()=>$xeTable.getCheckboxReserveRecords(),indeterminates:()=>$xeTable.getCheckboxIndeterminateRecords(),checked:value},evnt);}};/**
283
283
  * 纵向 Y 可视渲染处理
284
- */const loadScrollYData=()=>{const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible();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,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{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{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};const lazyScrollXData=()=>{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();}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData();},fpsTime);};const lazyScrollYData=()=>{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();}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData();},fpsTime);};const handleSyncScroll=(isRollX,isRollY)=>{const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;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();updateRowOffsetTop();}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){yRest=$xeTable.updateScrollYData().then(()=>{if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle();return Promise.all([xRest,yRest,$xeTable.updateCellAreas()]);};const checkLastSyncScroll=(isRollX,isRollY)=>{const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll(isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){(0,_vue.nextTick)(()=>{updateRowExpandStyle();if(!internalData.lcsTimeout){handleSyncScroll(isRollX,isRollY);}});}});},200);};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 wheelScrollLeftTo=(scrollLeft,cb)=>{requestAnimationFrame(()=>{cb(scrollLeft);});};const wheelScrollTopTo=(diffNum,cb)=>{const duration=Math.abs(diffNum);const startTime=performance.now();let countTop=0;const step=timestamp=>{let progress=(timestamp-startTime)/duration;if(progress<0){progress=0;}else if(progress>1){progress=1;}const easedProgress=Math.pow(progress,2);const offsetTop=Math.floor(diffNum*easedProgress)-countTop;countTop+=offsetTop;cb(offsetTop);if(progress<1){requestAnimationFrame(step);}};requestAnimationFrame(step);};const syncGanttScrollTop=scrollTop=>{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;}}};const dispatchEvent=(type,params,evnt)=>{emit(type,createEvent(evnt,{$table:$xeTable,$grid:$xeGrid,$gantt:$xeGantt},params));};const handleScrollToRowColumn=(fieldOrColumn,row)=>{const{fullColumnIdData}=internalData;const column=(0,_util.handleFieldOrColumn)($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return(0,_util.colToVisible)($xeTable,column,row);}return(0,_vue.nextTick)();};const handleUpdateResize=()=>{const el=refElem.value;if(el&&el.clientWidth&&el.clientHeight){$xeTable.recalculate();}};const handleUpdateColResize=(evnt,params)=>{$xeTable.analyColumnWidth();$xeTable.recalculate().then(()=>{$xeTable.saveCustomStore('update:width');$xeTable.updateCellAreas();$xeTable.dispatchEvent('column-resizable-change',params,evnt);// 已废弃 resizable-change
285
- $xeTable.dispatchEvent('resizable-change',params,evnt);setTimeout(()=>$xeTable.recalculate(true),300);});};const handleUpdateRowResize=(evnt,params)=>{reactData.resizeHeightFlag++;$xeTable.recalculate().then(()=>{$xeTable.updateCellAreas();$xeTable.dispatchEvent('row-resizable-change',params,evnt);setTimeout(()=>$xeTable.recalculate(true),300);});};const updateColumnOffsetLeft=()=>{const{visibleColumn,fullColumnIdData}=internalData;let offsetLeft=0;for(let cIndex=0,rLen=visibleColumn.length;cIndex<rLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest.oLeft=offsetLeft;}offsetLeft+=column.renderWidth;}};const updateRowOffsetTop=()=>{const{expandColumn}=reactData;const{afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const{handleGetRowId}=(0,_util.createHandleGetRowId)($xeTable);let offsetTop=0;for(let rIndex=0,rLen=afterFullData.length;rIndex<rLen;rIndex++){const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};rowRest.oTop=offsetTop;offsetTop+=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;// 是否展开行
284
+ */const loadScrollYData=()=>{const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible();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,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{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{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};const lazyScrollXData=()=>{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();}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData();},fpsTime);};const lazyScrollYData=()=>{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();}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData();},fpsTime);};const handleSyncScroll=(isRollX,isRollY)=>{const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;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();updateRowOffsetTop();}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){yRest=$xeTable.updateScrollYData().then(()=>{if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle();return Promise.all([xRest,yRest,$xeTable.updateCellAreas()]);};const checkLastSyncScroll=(isRollX,isRollY)=>{const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll(isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){(0,_vue.nextTick)(()=>{updateRowExpandStyle();if(!internalData.lcsTimeout){handleSyncScroll(isRollX,isRollY);}});}});},200);};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 wheelScrollLeftTo=(scrollLeft,cb)=>{requestAnimationFrame(()=>{cb(scrollLeft);});};const wheelScrollTopTo=(diffNum,cb)=>{const duration=Math.abs(diffNum);const startTime=performance.now();let countTop=0;const step=timestamp=>{let progress=(timestamp-startTime)/duration;if(progress<0){progress=0;}else if(progress>1){progress=1;}const easedProgress=Math.pow(progress,2);const offsetTop=Math.floor(diffNum*easedProgress)-countTop;countTop+=offsetTop;cb(offsetTop);if(progress<1){requestAnimationFrame(step);}};requestAnimationFrame(step);};const syncGanttScrollTop=scrollTop=>{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;}}};const dispatchEvent=(type,params,evnt)=>{emit(type,createEvent(evnt,{$table:$xeTable,$grid:$xeGrid,$gantt:$xeGantt},params));};const handleScrollToRowColumn=(fieldOrColumn,row)=>{const{fullColumnIdData}=internalData;const column=(0,_util.handleFieldOrColumn)($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return(0,_util.colToVisible)($xeTable,column,row);}return(0,_vue.nextTick)();};const handleUpdateResize=()=>{const el=refElem.value;if(el&&el.clientWidth&&el.clientHeight){$xeTable.recalculate();}};const handleUpdateColResize=(evnt,params)=>{$xeTable.analyColumnWidth();$xeTable.recalculate().then(()=>{$xeTable.saveCustomStore('update:width');$xeTable.refreshScroll().then(()=>{$xeTable.updateCellAreas();});$xeTable.dispatchEvent('column-resizable-change',params,evnt);// 已废弃 resizable-change
285
+ $xeTable.dispatchEvent('resizable-change',params,evnt);setTimeout(()=>{$xeTable.recalculate(true);},300);});};const handleUpdateRowResize=(evnt,params)=>{reactData.resizeHeightFlag++;$xeTable.recalculate().then(()=>{$xeTable.refreshScroll().then(()=>{$xeTable.updateCellAreas();});$xeTable.dispatchEvent('row-resizable-change',params,evnt);setTimeout(()=>{$xeTable.recalculate(true);},300);});};const updateColumnOffsetLeft=()=>{const{visibleColumn,fullColumnIdData}=internalData;let offsetLeft=0;for(let cIndex=0,rLen=visibleColumn.length;cIndex<rLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest.oLeft=offsetLeft;}offsetLeft+=column.renderWidth;}};const updateRowOffsetTop=()=>{const{expandColumn}=reactData;const{afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const{handleGetRowId}=(0,_util.createHandleGetRowId)($xeTable);let offsetTop=0;for(let rIndex=0,rLen=afterFullData.length;rIndex<rLen;rIndex++){const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};rowRest.oTop=offsetTop;offsetTop+=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;// 是否展开行
286
286
  if(expandColumn&&rowExpandedMaps[rowid]){offsetTop+=rowRest.expandHeight||expandOpts.height||0;}}};/**
287
287
  * 更新展开行样式
288
288
  */const updateRowExpandStyle=()=>{const{expandColumn,scrollYLoad,scrollYTop,isScrollYBig}=reactData;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const{mode}=expandOpts;if(expandColumn&&mode==='fixed'){const{elemStore,fullAllDataRowIdData}=internalData;const rowExpandEl=refRowExpandElem.value;const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);if(rowExpandEl&&bodyScrollElem){let isUpdateHeight=false;_xeUtils.default.arrayEach(rowExpandEl.children,reEl=>{const expandEl=reEl;const rowid=expandEl.getAttribute('rowid')||'';const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const expandHeight=expandEl.offsetHeight+1;const trEl=bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);let offsetTop=0;if(scrollYLoad){if(isScrollYBig&&trEl){offsetTop=trEl.offsetTop+trEl.offsetHeight;}else{offsetTop=rowRest.oTop+(rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight);}}else{if(trEl){offsetTop=trEl.offsetTop+trEl.offsetHeight;}}if(isScrollYBig){offsetTop+=scrollYTop;}expandEl.style.top=(0,_dom.toCssUnit)(offsetTop);if(!isUpdateHeight){if(rowRest.expandHeight!==expandHeight){isUpdateHeight=true;}}rowRest.expandHeight=expandHeight;}});if(isUpdateHeight){reactData.rowExpandHeightFlag++;(0,_vue.nextTick)(()=>{updateRowOffsetTop();});}}}};/**