vxe-table 4.12.0-beta.25 → 4.12.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.12.0-beta.25";
3141
+ const version = "4.12.0-beta.26";
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.12.0-beta.25"}`;
3590
+ const log_version = `table v${"4.12.0-beta.26"}`;
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
@@ -11176,7 +11176,7 @@ const el=refElem.value;if(!el){return;}const xHandleEl=refScrollXHandleElem.valu
11176
11176
  * 横向 X 可视渲染事件处理
11177
11177
  */triggerScrollXEvent(){const sXOpts=computeSXOpts.value;if(sXOpts.immediate){loadScrollXData();}else{lazyScrollXData();}},/**
11178
11178
  * 纵向 Y 可视渲染事件处理
11179
- */triggerScrollYEvent(){const sYOpts=computeSYOpts.value;if(sYOpts.immediate){loadScrollYData();}else{lazyScrollYData();}},triggerBodyScrollEvent(evnt,fixedType){const{scrollYLoad,scrollXLoad}=reactData;const{elemStore,intoRunScroll,lastScrollTop,lastScrollLeft,inWheelScroll,inVirtualScroll,inHeaderScroll,inBodyScroll,scrollRenderType,inFooterScroll}=internalData;if(inWheelScroll||inVirtualScroll||inHeaderScroll||inFooterScroll){return;}const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);const rowExpandEl=refRowExpandElem.value;if(intoRunScroll){return;}if(!bodyScrollElem){return;}if(!xHandleEl){return;}if(!yHandleEl){return;}if(inBodyScroll){if(scrollRenderType!==fixedType){return;}}let scrollTop=yHandleEl.scrollTop;let scrollLeft=xHandleEl.scrollLeft;if(leftScrollElem&&fixedType==='left'){scrollTop=leftScrollElem.scrollTop;}else if(rightScrollElem&&fixedType==='right'){scrollTop=rightScrollElem.scrollTop;}else{scrollTop=bodyScrollElem.scrollTop;scrollLeft=bodyScrollElem.scrollLeft;}const isRollX=scrollLeft!==lastScrollLeft;const isRollY=scrollTop!==lastScrollTop;internalData.inBodyScroll=true;internalData.scrollRenderType=fixedType;if(isRollY){if(fixedType==='left'){setScrollTop(bodyScrollElem,scrollTop);setScrollTop(rightScrollElem,scrollTop);}else if(fixedType==='right'){setScrollTop(bodyScrollElem,scrollTop);setScrollTop(leftScrollElem,scrollTop);}else{setScrollTop(leftScrollElem,scrollTop);setScrollTop(rightScrollElem,scrollTop);}setScrollTop(yHandleEl,scrollTop);setScrollTop(rowExpandEl,scrollTop);if(scrollYLoad){$xeTable.triggerScrollYEvent(evnt);}}if(isRollX){setScrollLeft(xHandleEl,scrollLeft);setScrollLeft(headerScrollElem,scrollLeft);setScrollLeft(footerScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'body',fixed:fixedType});},triggerHeaderScrollEvent(evnt,fixedType){const{scrollXLoad}=reactData;const{elemStore,intoRunScroll,inWheelScroll,inVirtualScroll,inBodyScroll,inFooterScroll}=internalData;if(inWheelScroll||inVirtualScroll||inBodyScroll||inFooterScroll){return;}const yHandleEl=refScrollYHandleElem.value;const xHandleEl=refScrollXHandleElem.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);if(intoRunScroll){return;}if(!headerScrollElem){return;}if(!xHandleEl){return;}if(!yHandleEl){return;}const scrollTop=yHandleEl.scrollTop;const scrollLeft=headerScrollElem.scrollLeft;const isRollX=true;const isRollY=false;internalData.inHeaderScroll=true;setScrollLeft(xHandleEl,scrollLeft);setScrollLeft(footerScrollElem,scrollLeft);setScrollLeft(bodyScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'header',fixed:fixedType});},triggerFooterScrollEvent(evnt,fixedType){const{scrollXLoad}=reactData;const{elemStore,intoRunScroll,inWheelScroll,inVirtualScroll,inHeaderScroll,inBodyScroll}=internalData;if(inWheelScroll||inVirtualScroll||inHeaderScroll||inBodyScroll){return;}const yHandleEl=refScrollYHandleElem.value;const xHandleEl=refScrollXHandleElem.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);if(intoRunScroll){return;}if(!footerScrollElem){return;}if(!xHandleEl){return;}if(!yHandleEl){return;}const scrollTop=yHandleEl.scrollTop;const scrollLeft=footerScrollElem.scrollLeft;const isRollX=true;const isRollY=false;internalData.inFooterScroll=true;setScrollLeft(xHandleEl,scrollLeft);setScrollLeft(headerScrollElem,scrollLeft);setScrollLeft(bodyScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'footer',fixed:fixedType});},triggerBodyWheelEvent(evnt){const{target,deltaY,deltaX,shiftKey}=evnt;if(target&&/^textarea$/i.test(target.tagName)){return;}const{highlightHoverRow}=src_props;const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;if(!(scrollYLoad||leftFixedWidth||rightFixedWidth||expandColumn)){return;}const{elemStore,lastScrollTop,lastScrollLeft}=internalData;const rowOpts=computeRowOpts.value;const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);const rowExpandEl=refRowExpandElem.value;if(!xHandleEl){return;}if(!yHandleEl){return;}if(!bodyScrollElem){return;}const wheelSpeed=getWheelSpeed(reactData.lastScrollTime);const deltaTop=Math.ceil((shiftKey?deltaX:deltaY)*wheelSpeed);const deltaLeft=Math.ceil((shiftKey?deltaY:deltaX)*wheelSpeed);const isTopWheel=deltaTop<0;const currScrollTop=bodyScrollElem.scrollTop;// 如果滚动位置已经是顶部或底部,则不需要触发
11179
+ */triggerScrollYEvent(){const sYOpts=computeSYOpts.value;if(sYOpts.immediate){loadScrollYData();}else{lazyScrollYData();}},triggerBodyScrollEvent(evnt,fixedType){const{scrollYLoad,scrollXLoad}=reactData;const{elemStore,intoRunScroll,lastScrollTop,lastScrollLeft,inWheelScroll,inVirtualScroll,inHeaderScroll,inBodyScroll,scrollRenderType,inFooterScroll}=internalData;if(inWheelScroll||inVirtualScroll||inHeaderScroll||inFooterScroll){return;}const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);const rowExpandEl=refRowExpandElem.value;if(intoRunScroll){return;}if(!bodyScrollElem){return;}if(!xHandleEl){return;}if(!yHandleEl){return;}if(inBodyScroll){if(scrollRenderType!==fixedType){return;}}let scrollTop=yHandleEl.scrollTop;let scrollLeft=xHandleEl.scrollLeft;if(leftScrollElem&&fixedType==='left'){scrollTop=leftScrollElem.scrollTop;}else if(rightScrollElem&&fixedType==='right'){scrollTop=rightScrollElem.scrollTop;}else{scrollTop=bodyScrollElem.scrollTop;scrollLeft=bodyScrollElem.scrollLeft;}const isRollX=scrollLeft!==lastScrollLeft;const isRollY=scrollTop!==lastScrollTop;internalData.inBodyScroll=true;internalData.scrollRenderType=fixedType;if(isRollY){if(fixedType==='left'){setScrollTop(bodyScrollElem,scrollTop);setScrollTop(rightScrollElem,scrollTop);}else if(fixedType==='right'){setScrollTop(bodyScrollElem,scrollTop);setScrollTop(leftScrollElem,scrollTop);}else{setScrollTop(leftScrollElem,scrollTop);setScrollTop(rightScrollElem,scrollTop);}setScrollTop(yHandleEl,scrollTop);setScrollTop(rowExpandEl,scrollTop);if(scrollYLoad){$xeTable.triggerScrollYEvent(evnt);}}if(isRollX){setScrollLeft(xHandleEl,scrollLeft);setScrollLeft(headerScrollElem,scrollLeft);setScrollLeft(footerScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'body',fixed:fixedType});},triggerHeaderScrollEvent(evnt,fixedType){const{scrollXLoad}=reactData;const{elemStore,intoRunScroll,inWheelScroll,inVirtualScroll,inBodyScroll,inFooterScroll}=internalData;if(inWheelScroll||inVirtualScroll||inBodyScroll||inFooterScroll){return;}const yHandleEl=refScrollYHandleElem.value;const xHandleEl=refScrollXHandleElem.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);if(intoRunScroll){return;}if(!headerScrollElem){return;}if(!xHandleEl){return;}if(!yHandleEl){return;}const scrollTop=yHandleEl.scrollTop;const scrollLeft=headerScrollElem.scrollLeft;const isRollX=true;const isRollY=false;internalData.inHeaderScroll=true;setScrollLeft(xHandleEl,scrollLeft);setScrollLeft(footerScrollElem,scrollLeft);setScrollLeft(bodyScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'header',fixed:fixedType});},triggerFooterScrollEvent(evnt,fixedType){const{scrollXLoad}=reactData;const{elemStore,intoRunScroll,inWheelScroll,inVirtualScroll,inHeaderScroll,inBodyScroll}=internalData;if(inWheelScroll||inVirtualScroll||inHeaderScroll||inBodyScroll){return;}const yHandleEl=refScrollYHandleElem.value;const xHandleEl=refScrollXHandleElem.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);if(intoRunScroll){return;}if(!footerScrollElem){return;}if(!xHandleEl){return;}if(!yHandleEl){return;}const scrollTop=yHandleEl.scrollTop;const scrollLeft=footerScrollElem.scrollLeft;const isRollX=true;const isRollY=false;internalData.inFooterScroll=true;setScrollLeft(xHandleEl,scrollLeft);setScrollLeft(headerScrollElem,scrollLeft);setScrollLeft(bodyScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'footer',fixed:fixedType});},triggerBodyWheelEvent(evnt){const{target,deltaY,deltaX,shiftKey}=evnt;if(target&&/^textarea$/i.test(target.tagName)){return;}const{highlightHoverRow}=src_props;const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;if(!(leftFixedWidth||rightFixedWidth||expandColumn)){return;}const{elemStore,lastScrollTop,lastScrollLeft}=internalData;const rowOpts=computeRowOpts.value;const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);const rowExpandEl=refRowExpandElem.value;if(!xHandleEl){return;}if(!yHandleEl){return;}if(!bodyScrollElem){return;}const wheelSpeed=getWheelSpeed(reactData.lastScrollTime);const deltaTop=Math.ceil((shiftKey?deltaX:deltaY)*wheelSpeed);const deltaLeft=Math.ceil((shiftKey?deltaY:deltaX)*wheelSpeed);const isTopWheel=deltaTop<0;const currScrollTop=bodyScrollElem.scrollTop;// 如果滚动位置已经是顶部或底部,则不需要触发
11180
11180
  if(isTopWheel?currScrollTop<=0:currScrollTop>=bodyScrollElem.scrollHeight-bodyScrollElem.clientHeight){return;}const scrollTop=currScrollTop+deltaTop;const scrollLeft=bodyScrollElem.scrollLeft+deltaLeft;const isRollX=scrollLeft!==lastScrollLeft;const isRollY=scrollTop!==lastScrollTop;if(rowOpts.isHover||highlightHoverRow){$xeTable.clearHoverRow();}// 用于鼠标纵向滚轮处理
11181
11181
  if(isRollX){evnt.preventDefault();internalData.inWheelScroll=true;wheelScrollLeftTo(scrollLeft,offsetLeft=>{const currLeftNum=offsetLeft;setScrollLeft(xHandleEl,currLeftNum);setScrollLeft(bodyScrollElem,currLeftNum);setScrollLeft(headerScrollElem,currLeftNum);setScrollLeft(footerScrollElem,currLeftNum);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,bodyScrollElem.scrollTop,currLeftNum,{type:'table',fixed:''});});}if(isRollY){evnt.preventDefault();wheelScrollTopTo(scrollTop-currScrollTop,offsetTop=>{const currTopNum=bodyScrollElem.scrollTop+offsetTop;internalData.inWheelScroll=true;setScrollTop(yHandleEl,currTopNum);setScrollTop(bodyScrollElem,currTopNum);setScrollTop(leftScrollElem,currTopNum);setScrollTop(rightScrollElem,currTopNum);setScrollTop(rowExpandEl,currTopNum);if(scrollYLoad){$xeTable.triggerScrollYEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,currTopNum,bodyScrollElem.scrollLeft,{type:'table',fixed:''});});}},triggerVirtualScrollXEvent(evnt){const{scrollXLoad}=reactData;const{elemStore,inWheelScroll,lastScrollTop,inHeaderScroll,inBodyScroll,inFooterScroll}=internalData;if(inHeaderScroll||inBodyScroll||inFooterScroll){return;}if(inWheelScroll){return;}const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);const yHandleEl=refScrollYHandleElem.value;const wrapperEl=evnt.currentTarget;const{scrollLeft}=wrapperEl;const yBodyEl=yHandleEl||bodyScrollElem;let scrollTop=0;if(yBodyEl){scrollTop=yBodyEl.scrollTop;}const isRollX=true;const isRollY=scrollTop!==lastScrollTop;internalData.inVirtualScroll=true;setScrollLeft(bodyScrollElem,scrollLeft);setScrollLeft(headerScrollElem,scrollLeft);setScrollLeft(footerScrollElem,scrollLeft);if(scrollXLoad){$xeTable.triggerScrollXEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'table',fixed:''});},triggerVirtualScrollYEvent(evnt){const{scrollYLoad}=reactData;const{elemStore,inWheelScroll,lastScrollLeft,inHeaderScroll,inBodyScroll,inFooterScroll}=internalData;if(inHeaderScroll||inBodyScroll||inFooterScroll){return;}if(inWheelScroll){return;}const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);const rowExpandEl=refRowExpandElem.value;const xHandleEl=refScrollXHandleElem.value;const wrapperEl=evnt.currentTarget;const{scrollTop}=wrapperEl;const xBodyEl=xHandleEl||bodyScrollElem;let scrollLeft=0;if(xBodyEl){scrollLeft=xBodyEl.scrollLeft;}const isRollX=scrollLeft!==lastScrollLeft;const isRollY=true;internalData.inVirtualScroll=true;setScrollTop(bodyScrollElem,scrollTop);setScrollTop(leftScrollElem,scrollTop);setScrollTop(rightScrollElem,scrollTop);setScrollTop(rowExpandEl,scrollTop);if(scrollYLoad){$xeTable.triggerScrollYEvent(evnt);}$xeTable.handleScrollEvent(evnt,isRollY,isRollX,scrollTop,scrollLeft,{type:'table',fixed:''});},/**
11182
11182
  * 对于树形结构中,可以直接滚动到指定深层节点中