vxe-table 4.19.19 → 4.19.20

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.
@@ -1,6 +1,6 @@
1
1
  import { h, reactive, ref, provide, inject, nextTick, Teleport, onActivated, onDeactivated, onBeforeUnmount, onUnmounted, watch, computed, onMounted } from 'vue';
2
2
  import { defineVxeComponent } from '../../ui/src/comp';
3
- import XEUtils, { isNaN } from 'xe-utils';
3
+ import XEUtils from 'xe-utils';
4
4
  import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasEventInputTarget } from '../../ui/src/dom';
5
5
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
6
6
  import { VxeUI } from '../../ui';
@@ -2067,7 +2067,7 @@ export default defineVxeComponent({
2067
2067
  cellValue = $xeTable.getCellLabel(row, column);
2068
2068
  }
2069
2069
  if (!sortType || sortType === 'auto') {
2070
- return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2070
+ return eqEmptyValue(cellValue) || isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2071
2071
  }
2072
2072
  else if (sortType === 'number') {
2073
2073
  return XEUtils.toNumber(cellValue);
@@ -2086,7 +2086,7 @@ export default defineVxeComponent({
2086
2086
  cellValue = $xeTable.getCellLabel(row, column);
2087
2087
  }
2088
2088
  if (!sortType || sortType === 'auto') {
2089
- return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2089
+ return eqEmptyValue(cellValue) || isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2090
2090
  }
2091
2091
  else if (sortType === 'number') {
2092
2092
  return XEUtils.toNumber(cellValue);
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.19.19";
3
+ export const version = "4.19.20";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"4.19.19"}`;
3
+ const tableVersion = `table v${"4.19.20"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
package/lib/index.umd.js CHANGED
@@ -3314,7 +3314,7 @@ function getDefaultConfig(val1, def1) {
3314
3314
  /* unused harmony import specifier */ var VxeUI;
3315
3315
 
3316
3316
 
3317
- const version = "4.19.19";
3317
+ const version = "4.19.20";
3318
3318
  core_.VxeUI.version = version;
3319
3319
  core_.VxeUI.tableVersion = version;
3320
3320
  core_.VxeUI.setConfig({
@@ -4101,7 +4101,7 @@ function wheelScrollTopTo(diffNum, cb) {
4101
4101
  const {
4102
4102
  log: log_log
4103
4103
  } = core_.VxeUI;
4104
- const tableVersion = `table v${"4.19.19"}`;
4104
+ const tableVersion = `table v${"4.19.20"}`;
4105
4105
  function createComponentLog(name) {
4106
4106
  const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
4107
4107
  const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
@@ -20796,7 +20796,7 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
20796
20796
  * 计算自适应行高
20797
20797
  */const calcCellAutoHeight=(rowid,rowRest,wrapperEl)=>{const{fullCellHeightMaps}=internalData;let chRest=fullCellHeightMaps[rowid];if(!chRest){chRest={};fullCellHeightMaps[rowid]=chRest;}const wrapperElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let firstCellStyle=null;let topBottomPadding=0;let changeCH=false;for(let i=0;i<wrapperElemList.length;i++){const wrapperElem=wrapperElemList[i];const cellElem=wrapperElem.parentElement;const cellStyle=cellElem.style;const orHeight=cellStyle.height;const colid=wrapperElem.getAttribute('colid')||'';cellStyle.height='';if(!firstCellStyle){firstCellStyle=getComputedStyle(cellElem);topBottomPadding=firstCellStyle?Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)):0;}const cellHeight=wrapperElem?wrapperElem.clientHeight:0;const colHeight=Math.ceil(cellHeight+topBottomPadding);if(chRest[colid]!==colHeight){changeCH=true;chRest[colid]=colHeight;}cellStyle.height=orHeight;}const cellMaxHeight=getRowMaxHeight(chRest,changeCH);return cellMaxHeight;};/**
20798
20798
  * 自适应行高
20799
- */const calcCellHeight=()=>{const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=refElem.value;if(!el||!el.clientWidth){return;}const treeOpts=computeTreeOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)){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(rowid,rowRest,el);rowRest.height=Math.max(defaultRowHeight,reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{isRowGroupStatus}=reactData;const{sortBy,sortType,aggFunc}=column;return isRowGroupStatus&&aggFunc?row=>{if(row.isAggregate){const aggData=row.aggData;const currAggData=aggData?aggData[column.field]:null;return currAggData?currAggData.value:null;}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=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return (0,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_.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;}: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=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return (0,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_.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 updateAfterTreeIndex=()=>{const{fullDataRowIdData,fullAllDataRowIdData,afterFullData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};let rowNum=0;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._seq=rowNum;rowRest.treeIndex=index;rowRest._tIndex=rowNum;}else{const rest={row,rowid,_seq:rowNum,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,_tIndex:rowNum,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}rowNum++;fullMaps[rowid]=row;},{children:transform?mapChildrenField:childrenField});if(transform){afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=index;}});}internalData.afterFullRowMaps=fullMaps;};const updateAfterListIndex=()=>{const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};let rowNum=0;afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){rowRest.seq=seq;rowRest._seq=rowNum;rowRest._index=index;}else{const rest={row,rowid,_seq:rowNum,seq,index:-1,$index:-1,_index:index,treeIndex:-1,_tIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}rowNum++;fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
20799
+ */const calcCellHeight=()=>{const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=refElem.value;if(!el||!el.clientWidth){return;}const treeOpts=computeTreeOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)){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(rowid,rowRest,el);rowRest.height=Math.max(defaultRowHeight,reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{isRowGroupStatus}=reactData;const{sortBy,sortType,aggFunc}=column;return isRowGroupStatus&&aggFunc?row=>{if(row.isAggregate){const aggData=row.aggData;const currAggData=aggData?aggData[column.field]:null;return currAggData?currAggData.value:null;}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=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return eqEmptyValue(cellValue)||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;}: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=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return eqEmptyValue(cellValue)||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 updateAfterTreeIndex=()=>{const{fullDataRowIdData,fullAllDataRowIdData,afterFullData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};let rowNum=0;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._seq=rowNum;rowRest.treeIndex=index;rowRest._tIndex=rowNum;}else{const rest={row,rowid,_seq:rowNum,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,_tIndex:rowNum,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}rowNum++;fullMaps[rowid]=row;},{children:transform?mapChildrenField:childrenField});if(transform){afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=index;}});}internalData.afterFullRowMaps=fullMaps;};const updateAfterListIndex=()=>{const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};let rowNum=0;afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){rowRest.seq=seq;rowRest._seq=rowNum;rowRest._index=index;}else{const rest={row,rowid,_seq:rowNum,seq,index:-1,$index:-1,_index:index,treeIndex:-1,_tIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}rowNum++;fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
20800
20800
  * 预编译
20801
20801
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
20802
20802
  */const updateAfterDataIndex=()=>{const{treeConfig}=props;if(treeConfig){updateAfterTreeIndex();}else{updateAfterListIndex();}};/**