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

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.
@@ -252,6 +252,7 @@ export default defineComponent({
252
252
  rowExpandHeightFlag: 1,
253
253
  calcCellHeightFlag: 1,
254
254
  resizeHeightFlag: 1,
255
+ resizeWidthFlag: 1,
255
256
  isCustomStatus: false,
256
257
  isDragRowMove: false,
257
258
  dragRow: null,
@@ -1470,6 +1471,7 @@ export default defineComponent({
1470
1471
  internalData.headerHeight = headerHeight;
1471
1472
  internalData.footerHeight = footerHeight;
1472
1473
  reactData.overflowX = overflowX;
1474
+ reactData.resizeWidthFlag++;
1473
1475
  updateColumnOffsetLeft();
1474
1476
  updateHeight();
1475
1477
  reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
@@ -1776,7 +1778,7 @@ export default defineComponent({
1776
1778
  const updateStyle = () => {
1777
1779
  const { border, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props;
1778
1780
  const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn } = reactData;
1779
- const { visibleColumn, fullColumnIdData, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
1781
+ const { visibleColumn, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
1780
1782
  const el = refElem.value;
1781
1783
  if (!el) {
1782
1784
  return;
@@ -1785,7 +1787,6 @@ export default defineComponent({
1785
1787
  const osbWidth = overflowY ? scrollbarWidth : 0;
1786
1788
  const osbHeight = overflowX ? scrollbarHeight : 0;
1787
1789
  const emptyPlaceholderElem = refEmptyPlaceholder.value;
1788
- const cellOffsetWidth = computeCellOffsetWidth.value;
1789
1790
  const mouseOpts = computeMouseOpts.value;
1790
1791
  const expandOpts = computeExpandOpts.value;
1791
1792
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
@@ -2053,56 +2054,6 @@ export default defineComponent({
2053
2054
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
2054
2055
  }
2055
2056
  }
2056
- const colgroupElem = getRefElem(elemStore[`${name}-${layout}-colgroup`]);
2057
- if (colgroupElem) {
2058
- XEUtils.arrayEach(colgroupElem.children, (colElem) => {
2059
- const colid = colElem.getAttribute('name');
2060
- if (fullColumnIdData[colid]) {
2061
- const colRest = fullColumnIdData[colid];
2062
- const column = colRest.column;
2063
- const { showHeaderOverflow, showFooterOverflow, showOverflow } = column;
2064
- let cellOverflow;
2065
- colElem.style.width = `${column.renderWidth}px`;
2066
- if (layout === 'header') {
2067
- cellOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
2068
- }
2069
- else if (layout === 'footer') {
2070
- cellOverflow = XEUtils.isUndefined(showFooterOverflow) || XEUtils.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
2071
- }
2072
- else {
2073
- cellOverflow = XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow) ? isAllOverflow : showOverflow;
2074
- }
2075
- const showEllipsis = cellOverflow === 'ellipsis';
2076
- const showTitle = cellOverflow === 'title';
2077
- const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
2078
- let hasEllipsis = showTitle || showTooltip || showEllipsis;
2079
- const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
2080
- // 纵向虚拟滚动不支持动态行高
2081
- if (scrollYLoad && !hasEllipsis) {
2082
- hasEllipsis = true;
2083
- }
2084
- if (listElem) {
2085
- XEUtils.arrayEach(listElem.querySelectorAll(`.${column.id}`), (elem) => {
2086
- const colspan = parseInt(elem.getAttribute('colspan') || 1);
2087
- const cellElem = elem.querySelector('.vxe-cell');
2088
- let colWidth = column.renderWidth;
2089
- if (cellElem) {
2090
- if (colspan > 1) {
2091
- const columnIndex = $xeTable.getColumnIndex(column);
2092
- for (let index = 1; index < colspan; index++) {
2093
- const nextColumn = $xeTable.getColumns(columnIndex + index);
2094
- if (nextColumn) {
2095
- colWidth += nextColumn.renderWidth;
2096
- }
2097
- }
2098
- }
2099
- cellElem.style.width = hasEllipsis ? `${colWidth - (cellOffsetWidth * colspan)}px` : '';
2100
- }
2101
- });
2102
- }
2103
- }
2104
- });
2105
- }
2106
2057
  });
2107
2058
  });
2108
2059
  if (currentRow) {
@@ -2895,8 +2846,8 @@ export default defineComponent({
2895
2846
  return result;
2896
2847
  };
2897
2848
  const parseColumns = (isReset) => {
2898
- const { showOverflow } = props;
2899
- const rowOpts = computeRowOpts.value;
2849
+ // const { showOverflow } = props
2850
+ // const rowOpts = computeRowOpts.value
2900
2851
  const leftList = [];
2901
2852
  const centerList = [];
2902
2853
  const rightList = [];
@@ -2969,28 +2920,28 @@ export default defineComponent({
2969
2920
  reactData.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
2970
2921
  Object.assign(columnStore, { leftList, centerList, rightList });
2971
2922
  if (scrollXLoad) {
2972
- if (showOverflow) {
2973
- if (!rowOpts.height) {
2974
- const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
2975
- if (errColumn) {
2976
- errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
2977
- }
2978
- }
2923
+ // if (showOverflow) {
2924
+ // if (!rowOpts.height) {
2925
+ // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
2926
+ // if (errColumn) {
2927
+ // errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
2928
+ // }
2929
+ // }
2930
+ // }
2931
+ // if (process.env.NODE_ENV === 'development') {
2932
+ // if (props.showHeader && !props.showHeaderOverflow) {
2933
+ // warnLog('vxe.error.reqProp', ['show-header-overflow'])
2934
+ // }
2935
+ // if (props.showFooter && !props.showFooterOverflow) {
2936
+ // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
2937
+ // }
2938
+ if (props.spanMethod) {
2939
+ warnLog('vxe.error.scrollErrProp', ['span-method']);
2979
2940
  }
2980
- if (process.env.NODE_ENV === 'development') {
2981
- // if (props.showHeader && !props.showHeaderOverflow) {
2982
- // warnLog('vxe.error.reqProp', ['show-header-overflow'])
2983
- // }
2984
- // if (props.showFooter && !props.showFooterOverflow) {
2985
- // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
2986
- // }
2987
- if (props.spanMethod) {
2988
- warnLog('vxe.error.scrollErrProp', ['span-method']);
2989
- }
2990
- if (props.footerSpanMethod) {
2991
- warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
2992
- }
2941
+ if (props.footerSpanMethod) {
2942
+ warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
2993
2943
  }
2944
+ // }
2994
2945
  if (isReset) {
2995
2946
  const { visibleSize } = handleVirtualXVisible();
2996
2947
  scrollXStore.startIndex = 0;
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.12.0-beta.23";
3
+ export const version = "4.12.0-beta.25";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -123,7 +123,7 @@ VxeUI.setConfig({
123
123
  // remote: false,
124
124
  // filterMethod: null,
125
125
  // destroyOnClose: false,
126
- isEvery: true,
126
+ // isEvery: false,
127
127
  showIcon: true
128
128
  },
129
129
  treeConfig: {
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.12.0-beta.23"}`;
3
+ const version = `table v${"4.12.0-beta.25"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
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.23";
3141
+ const version = "4.12.0-beta.25";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3261,7 +3261,7 @@ core_.VxeUI.setConfig({
3261
3261
  // remote: false,
3262
3262
  // filterMethod: null,
3263
3263
  // destroyOnClose: false,
3264
- isEvery: true,
3264
+ // isEvery: false,
3265
3265
  showIcon: true
3266
3266
  },
3267
3267
  treeConfig: {
@@ -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.23"}`;
3590
+ const log_version = `table v${"4.12.0-beta.25"}`;
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
@@ -6209,8 +6209,6 @@ const Colgroup = VxeColgroup;
6209
6209
  var esnext_iterator_filter = __webpack_require__(4520);
6210
6210
  // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.every.js
6211
6211
  var esnext_iterator_every = __webpack_require__(3215);
6212
- // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.find.js
6213
- var esnext_iterator_find = __webpack_require__(2577);
6214
6212
  // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.reduce.js
6215
6213
  var esnext_iterator_reduce = __webpack_require__(8872);
6216
6214
  // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.to-array.js
@@ -6256,6 +6254,7 @@ const renderType = 'body';
6256
6254
  const {
6257
6255
  computeEditOpts,
6258
6256
  computeMouseOpts,
6257
+ computeCellOffsetWidth,
6259
6258
  computeAreaOpts,
6260
6259
  computeDefaultRowHeight,
6261
6260
  computeEmptyOpts,
@@ -6341,7 +6340,8 @@ const renderType = 'body';
6341
6340
  */
6342
6341
  const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
6343
6342
  const {
6344
- fullAllDataRowIdData
6343
+ fullAllDataRowIdData,
6344
+ visibleColumn
6345
6345
  } = tableInternalData;
6346
6346
  const {
6347
6347
  columnKey,
@@ -6368,6 +6368,7 @@ const renderType = 'body';
6368
6368
  scrollYLoad,
6369
6369
  calcCellHeightFlag,
6370
6370
  resizeHeightFlag,
6371
+ resizeWidthFlag,
6371
6372
  mergeList,
6372
6373
  editStore,
6373
6374
  isAllOverflow,
@@ -6400,6 +6401,7 @@ const renderType = 'body';
6400
6401
  const columnOpts = computeColumnOpts.value;
6401
6402
  const mouseOpts = computeMouseOpts.value;
6402
6403
  const areaOpts = computeAreaOpts.value;
6404
+ const cellOffsetWidth = computeCellOffsetWidth.value;
6403
6405
  const {
6404
6406
  selectCellToRow
6405
6407
  } = areaOpts;
@@ -6593,6 +6595,18 @@ const renderType = 'body';
6593
6595
  }
6594
6596
  }
6595
6597
  const tcStyle = {};
6598
+ if (hasEllipsis && resizeWidthFlag) {
6599
+ let tsColspan = tdAttrs.colspan || 0;
6600
+ if (tsColspan > 1) {
6601
+ for (let index = 1; index < tsColspan; index++) {
6602
+ const nextColumn = visibleColumn[columnIndex + index];
6603
+ if (nextColumn) {
6604
+ tsColspan += nextColumn.renderWidth;
6605
+ }
6606
+ }
6607
+ }
6608
+ tcStyle.width = `${column.renderWidth - cellOffsetWidth * tsColspan}px`;
6609
+ }
6596
6610
  if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
6597
6611
  tcStyle.height = `${cellHeight}px`;
6598
6612
  } else {
@@ -9593,6 +9607,8 @@ const {
9593
9607
  return renderVN;
9594
9608
  }
9595
9609
  }));
9610
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.find.js
9611
+ var esnext_iterator_find = __webpack_require__(2577);
9596
9612
  ;// ./packages/table/module/export/import-panel.ts
9597
9613
 
9598
9614
 
@@ -10435,7 +10451,7 @@ focused:{row:null,column:null},insertMaps:{},removeMaps:{}},// 存放 tooltip
10435
10451
  tooltipStore:{row:null,column:null,content:null,visible:false,currOpts:{}},// 存放数据校验相关信息
10436
10452
  validStore:{visible:false},validErrorMaps:{},// 导入相关信息
10437
10453
  importStore:{inited:false,file:null,type:'',modeList:[],typeList:[],filename:'',visible:false},importParams:{mode:'',types:null,message:true},// 导出相关信息
10438
- exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:false,hasFooter:false,hasMerge:false,hasTree:false,hasColgroup:false,visible:false},exportParams:{filename:'',sheetName:'',mode:'',type:'',isColgroup:false,isMerge:false,isAllExpand:false,useStyle:false,original:false,message:true,isHeader:false,isFooter:false},rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,rowHeightStore:{default:48,medium:44,small:40,mini:36},scrollVMLoading:false,scrollYHeight:0,scrollYTop:0,isScrollYBig:false,scrollXLeft:0,scrollXWidth:0,isScrollXBig:false,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,isCustomStatus:false,isDragRowMove:false,dragRow:null,isDragColMove:false,dragCol:null,dragTipText:'',isDragResize:false,isRowLoading:false,isColLoading:false});const internalData={tZindex:0,elemStore:{},// 存放横向 X 虚拟滚动相关的信息
10454
+ exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:false,hasFooter:false,hasMerge:false,hasTree:false,hasColgroup:false,visible:false},exportParams:{filename:'',sheetName:'',mode:'',type:'',isColgroup:false,isMerge:false,isAllExpand:false,useStyle:false,original:false,message:true,isHeader:false,isFooter:false},rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,rowHeightStore:{default:48,medium:44,small:40,mini:36},scrollVMLoading:false,scrollYHeight:0,scrollYTop:0,isScrollYBig:false,scrollXLeft:0,scrollXWidth:0,isScrollXBig:false,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:false,isDragRowMove:false,dragRow:null,isDragColMove:false,dragCol:null,dragTipText:'',isDragResize:false,isRowLoading:false,isColLoading:false});const internalData={tZindex:0,elemStore:{},// 存放横向 X 虚拟滚动相关的信息
10439
10455
  scrollXStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},// 存放纵向 Y 虚拟滚动相关信息
10440
10456
  scrollYStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},// 表格宽度
10441
10457
  tableWidth:0,// 表格高度
@@ -10497,7 +10513,7 @@ resizeList.forEach(column=>{const reWidth=external_root_XEUtils_commonjs_xe_util
10497
10513
  remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.renderWidth=width;tWidth+=width;});if(fit){/**
10498
10514
  * 偏移量算法
10499
10515
  * 如果所有列足够放的情况下,从最后动态列开始分配
10500
- */const dynamicList=scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);let dynamicSize=dynamicList.length-1;if(dynamicSize>0){let i=bodyWidth-tWidth;if(i>0){while(i>0&&dynamicSize>=0){i--;dynamicList[dynamicSize--].renderWidth++;}tWidth=bodyWidth;}}}const tableHeight=bodyElem.offsetHeight;const overflowY=yHandleEl.scrollHeight>yHandleEl.clientHeight;reactData.scrollbarWidth=Math.max(scrollbarOpts.width||0,yHandleEl.offsetWidth-yHandleEl.clientWidth);reactData.overflowY=overflowY;reactData.scrollXWidth=tWidth;internalData.tableHeight=tableHeight;const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const overflowX=tWidth>bodyWidth;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;reactData.scrollbarHeight=Math.max(scrollbarOpts.height||0,xHandleEl.offsetHeight-xHandleEl.clientHeight);internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;updateColumnOffsetLeft();updateHeight();reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());if(overflowX){$xeTable.checkScrolling();}};const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;for(let i=0;i<cellElemList.length;i++){const cellElem=cellElemList[i];const tdEl=cellElem.parentElement;const topBottomPadding=Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));const cellHeight=cellElem?cellElem.clientHeight:0;colHeight=Math.max(colHeight-topBottomPadding,Math.ceil(cellHeight));}return colHeight;};const calcCellHeight=()=>{const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&scrollYLoad&&el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const reHeight=calcCellAutoHeight(rowRest,el);rowRest.height=Math.max(defaultRowHeight,scrollXLoad?Math.max(rowRest.height,reHeight):reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{sortBy,sortType}=column;return row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=tableMethods.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};};const updateAfterListIndex=()=>{const{treeConfig}=props;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:index,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
10516
+ */const dynamicList=scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);let dynamicSize=dynamicList.length-1;if(dynamicSize>0){let i=bodyWidth-tWidth;if(i>0){while(i>0&&dynamicSize>=0){i--;dynamicList[dynamicSize--].renderWidth++;}tWidth=bodyWidth;}}}const tableHeight=bodyElem.offsetHeight;const overflowY=yHandleEl.scrollHeight>yHandleEl.clientHeight;reactData.scrollbarWidth=Math.max(scrollbarOpts.width||0,yHandleEl.offsetWidth-yHandleEl.clientWidth);reactData.overflowY=overflowY;reactData.scrollXWidth=tWidth;internalData.tableHeight=tableHeight;const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const overflowX=tWidth>bodyWidth;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;reactData.scrollbarHeight=Math.max(scrollbarOpts.height||0,xHandleEl.offsetHeight-xHandleEl.clientHeight);internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;reactData.resizeWidthFlag++;updateColumnOffsetLeft();updateHeight();reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());if(overflowX){$xeTable.checkScrolling();}};const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;for(let i=0;i<cellElemList.length;i++){const cellElem=cellElemList[i];const tdEl=cellElem.parentElement;const topBottomPadding=Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));const cellHeight=cellElem?cellElem.clientHeight:0;colHeight=Math.max(colHeight-topBottomPadding,Math.ceil(cellHeight));}return colHeight;};const calcCellHeight=()=>{const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&scrollYLoad&&el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const reHeight=calcCellAutoHeight(rowRest,el);rowRest.height=Math.max(defaultRowHeight,scrollXLoad?Math.max(rowRest.height,reHeight):reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{sortBy,sortType}=column;return row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=tableMethods.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};};const updateAfterListIndex=()=>{const{treeConfig}=props;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:index,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
10501
10517
  * 预编译
10502
10518
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
10503
10519
  */const updateAfterDataIndex=()=>{const{treeConfig}=props;const{fullDataRowIdData,fullAllDataRowIdData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};if(treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,(row,index,items,path)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=path.map((num,i)=>i%2===0?Number(num)+1:'.').join('');if(rowRest){rowRest.seq=seq;rowRest.treeIndex=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;},{children:transform?treeOpts.mapChildrenField:childrenField});internalData.afterFullRowMaps=fullMaps;updateAfterListIndex();}else{updateAfterListIndex();}};/**
@@ -10515,7 +10531,7 @@ tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_util
10515
10531
  // 支持单列、多列、组合排序
10516
10532
  if(!allRemoteSort&&orderColumns.length){if(treeConfig&&transform){// 虚拟树和列表一样,只能排序根级节点
10517
10533
  if(allSortMethod){const sortRests=allSortMethod({data:tableTree,sortList:orderColumns,$table:$xeTable});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableTree;}else{const treeList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree,{children:mapChildrenField});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList,orderColumns.map(({column,order})=>[getOrderField(column),order])),{key:rowField,parentKey:parentField,children:childrenField,mapChildren:mapChildrenField});}tableData=tableTree;}else{if(allSortMethod){const sortRests=allSortMethod({data:tableData,sortList:orderColumns,$table:$xeTable});tableData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableData;}else{tableData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData,orderColumns.map(({column,order})=>[getOrderField(column),order]));}tableTree=tableData;}}}else{if(treeConfig&&transform){// 还原虚拟树
10518
- tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,()=>true,{original:true,isEvery,children:treeOpts.mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.slice(0):tableFullData.slice(0);tableTree=tableData;}}internalData.afterFullData=tableData;internalData.afterTreeFullData=tableTree;updateAfterDataIndex();};const updateStyle=()=>{const{border,showHeaderOverflow:allColumnHeaderOverflow,showFooterOverflow:allColumnFooterOverflow,mouseConfig,spanMethod,footerSpanMethod}=props;const{isGroup,currentRow,tableColumn,scrollXLoad,scrollYLoad,overflowX,scrollbarWidth,overflowY,scrollbarHeight,scrollXWidth,columnStore,editStore,isAllOverflow,expandColumn}=reactData;const{visibleColumn,fullColumnIdData,tableHeight,headerHeight,footerHeight,elemStore,customHeight,customMinHeight,customMaxHeight}=internalData;const el=refElem.value;if(!el){return;}const containerList=['main','left','right'];const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const emptyPlaceholderElem=refEmptyPlaceholder.value;const cellOffsetWidth=computeCellOffsetWidth.value;const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const bodyTableElem=getRefElem(elemStore['main-body-table']);if(emptyPlaceholderElem){emptyPlaceholderElem.style.top=`${headerHeight}px`;emptyPlaceholderElem.style.height=bodyWrapperElem?`${bodyWrapperElem.offsetHeight-osbHeight}px`:'';}let bodyHeight=0;let bodyMaxHeight=0;const bodyMinHeight=customMinHeight-headerHeight-footerHeight-osbHeight;if(customMaxHeight){bodyMaxHeight=Math.max(bodyMinHeight,customMaxHeight-headerHeight-footerHeight-osbHeight);}if(customHeight){bodyHeight=customHeight-headerHeight-footerHeight-osbHeight;}if(!bodyHeight){if(bodyTableElem){bodyHeight=bodyTableElem.clientHeight;}}if(bodyHeight){if(bodyMaxHeight){bodyHeight=Math.min(bodyMaxHeight,bodyHeight);}bodyHeight=Math.max(bodyMinHeight,bodyHeight);}const scrollbarXToTop=computeScrollbarXToTop.value;const xLeftCornerEl=refScrollXLeftCornerElem.value;const xRightCornerEl=refScrollXRightCornerElem.value;const scrollXVirtualEl=refScrollXVirtualElem.value;if(scrollXVirtualEl){scrollXVirtualEl.style.height=`${osbHeight}px`;scrollXVirtualEl.style.visibility=overflowX?'visible':'hidden';}const xWrapperEl=refScrollXWrapperElem.value;if(xWrapperEl){xWrapperEl.style.left=scrollbarXToTop?`${osbWidth}px`:'';xWrapperEl.style.width=`${el.clientWidth-osbWidth}px`;}if(xLeftCornerEl){xLeftCornerEl.style.width=scrollbarXToTop?`${osbWidth}px`:'';xLeftCornerEl.style.display=scrollbarXToTop?osbWidth&&osbHeight?'block':'':'';}if(xRightCornerEl){xRightCornerEl.style.width=scrollbarXToTop?'':`${osbWidth}px`;xRightCornerEl.style.display=scrollbarXToTop?'':osbWidth&&osbHeight?'block':'';}const scrollYVirtualEl=refScrollYVirtualElem.value;if(scrollYVirtualEl){scrollYVirtualEl.style.width=`${osbWidth}px`;scrollYVirtualEl.style.height=`${bodyHeight+headerHeight+footerHeight}px`;scrollYVirtualEl.style.visibility=overflowY?'visible':'hidden';}const yTopCornerEl=refScrollYTopCornerElem.value;if(yTopCornerEl){yTopCornerEl.style.height=`${headerHeight}px`;yTopCornerEl.style.display=headerHeight?'block':'';}const yWrapperEl=refScrollYWrapperElem.value;if(yWrapperEl){yWrapperEl.style.height=`${bodyHeight}px`;yWrapperEl.style.top=`${headerHeight}px`;}const yBottomCornerEl=refScrollYBottomCornerElem.value;if(yBottomCornerEl){yBottomCornerEl.style.height=`${footerHeight}px`;yBottomCornerEl.style.top=`${headerHeight+bodyHeight}px`;yBottomCornerEl.style.display=footerHeight?'block':'';}const rowExpandEl=refRowExpandElem.value;if(rowExpandEl){rowExpandEl.style.height=`${bodyHeight}px`;rowExpandEl.style.top=`${headerHeight}px`;}containerList.forEach((name,index)=>{const fixedType=index>0?name:'';const layoutList=['header','body','footer'];const isFixedLeft=fixedType==='left';let fixedColumn=[];let fixedWrapperElem;if(fixedType){fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;fixedWrapperElem=isFixedLeft?refLeftContainer.value:refRightContainer.value;}layoutList.forEach(layout=>{const wrapperElem=getRefElem(elemStore[`${name}-${layout}-wrapper`]);const currScrollElem=getRefElem(elemStore[`${name}-${layout}-scroll`]);const tableElem=getRefElem(elemStore[`${name}-${layout}-table`]);if(layout==='header'){// 表头体样式处理
10534
+ tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,()=>true,{original:true,isEvery,children:treeOpts.mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.slice(0):tableFullData.slice(0);tableTree=tableData;}}internalData.afterFullData=tableData;internalData.afterTreeFullData=tableTree;updateAfterDataIndex();};const updateStyle=()=>{const{border,showHeaderOverflow:allColumnHeaderOverflow,showFooterOverflow:allColumnFooterOverflow,mouseConfig,spanMethod,footerSpanMethod}=props;const{isGroup,currentRow,tableColumn,scrollXLoad,scrollYLoad,overflowX,scrollbarWidth,overflowY,scrollbarHeight,scrollXWidth,columnStore,editStore,isAllOverflow,expandColumn}=reactData;const{visibleColumn,tableHeight,headerHeight,footerHeight,elemStore,customHeight,customMinHeight,customMaxHeight}=internalData;const el=refElem.value;if(!el){return;}const containerList=['main','left','right'];const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const emptyPlaceholderElem=refEmptyPlaceholder.value;const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const bodyTableElem=getRefElem(elemStore['main-body-table']);if(emptyPlaceholderElem){emptyPlaceholderElem.style.top=`${headerHeight}px`;emptyPlaceholderElem.style.height=bodyWrapperElem?`${bodyWrapperElem.offsetHeight-osbHeight}px`:'';}let bodyHeight=0;let bodyMaxHeight=0;const bodyMinHeight=customMinHeight-headerHeight-footerHeight-osbHeight;if(customMaxHeight){bodyMaxHeight=Math.max(bodyMinHeight,customMaxHeight-headerHeight-footerHeight-osbHeight);}if(customHeight){bodyHeight=customHeight-headerHeight-footerHeight-osbHeight;}if(!bodyHeight){if(bodyTableElem){bodyHeight=bodyTableElem.clientHeight;}}if(bodyHeight){if(bodyMaxHeight){bodyHeight=Math.min(bodyMaxHeight,bodyHeight);}bodyHeight=Math.max(bodyMinHeight,bodyHeight);}const scrollbarXToTop=computeScrollbarXToTop.value;const xLeftCornerEl=refScrollXLeftCornerElem.value;const xRightCornerEl=refScrollXRightCornerElem.value;const scrollXVirtualEl=refScrollXVirtualElem.value;if(scrollXVirtualEl){scrollXVirtualEl.style.height=`${osbHeight}px`;scrollXVirtualEl.style.visibility=overflowX?'visible':'hidden';}const xWrapperEl=refScrollXWrapperElem.value;if(xWrapperEl){xWrapperEl.style.left=scrollbarXToTop?`${osbWidth}px`:'';xWrapperEl.style.width=`${el.clientWidth-osbWidth}px`;}if(xLeftCornerEl){xLeftCornerEl.style.width=scrollbarXToTop?`${osbWidth}px`:'';xLeftCornerEl.style.display=scrollbarXToTop?osbWidth&&osbHeight?'block':'':'';}if(xRightCornerEl){xRightCornerEl.style.width=scrollbarXToTop?'':`${osbWidth}px`;xRightCornerEl.style.display=scrollbarXToTop?'':osbWidth&&osbHeight?'block':'';}const scrollYVirtualEl=refScrollYVirtualElem.value;if(scrollYVirtualEl){scrollYVirtualEl.style.width=`${osbWidth}px`;scrollYVirtualEl.style.height=`${bodyHeight+headerHeight+footerHeight}px`;scrollYVirtualEl.style.visibility=overflowY?'visible':'hidden';}const yTopCornerEl=refScrollYTopCornerElem.value;if(yTopCornerEl){yTopCornerEl.style.height=`${headerHeight}px`;yTopCornerEl.style.display=headerHeight?'block':'';}const yWrapperEl=refScrollYWrapperElem.value;if(yWrapperEl){yWrapperEl.style.height=`${bodyHeight}px`;yWrapperEl.style.top=`${headerHeight}px`;}const yBottomCornerEl=refScrollYBottomCornerElem.value;if(yBottomCornerEl){yBottomCornerEl.style.height=`${footerHeight}px`;yBottomCornerEl.style.top=`${headerHeight+bodyHeight}px`;yBottomCornerEl.style.display=footerHeight?'block':'';}const rowExpandEl=refRowExpandElem.value;if(rowExpandEl){rowExpandEl.style.height=`${bodyHeight}px`;rowExpandEl.style.top=`${headerHeight}px`;}containerList.forEach((name,index)=>{const fixedType=index>0?name:'';const layoutList=['header','body','footer'];const isFixedLeft=fixedType==='left';let fixedColumn=[];let fixedWrapperElem;if(fixedType){fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;fixedWrapperElem=isFixedLeft?refLeftContainer.value:refRightContainer.value;}layoutList.forEach(layout=>{const wrapperElem=getRefElem(elemStore[`${name}-${layout}-wrapper`]);const currScrollElem=getRefElem(elemStore[`${name}-${layout}-scroll`]);const tableElem=getRefElem(elemStore[`${name}-${layout}-table`]);if(layout==='header'){// 表头体样式处理
10519
10535
  // 横向滚动渲染
10520
10536
  let renderColumnList=tableColumn;let isOptimizeMode=false;if(isGroup){renderColumnList=visibleColumn;}else{// 如果是使用优化模式
10521
10537
  if(scrollXLoad||scrollYLoad||allColumnHeaderOverflow){if(spanMethod||footerSpanMethod){// 如果不支持优化模式
@@ -10527,8 +10543,7 @@ if(scrollXLoad||scrollYLoad||isAllOverflow){if(expandColumn&&expandOpts.mode!=='
10527
10543
  tableElem.style.paddingRight=osbWidth&&fixedType&&(browse['-moz']||browse.safari)?`${osbWidth}px`:'';}const emptyBlockElem=getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);if(emptyBlockElem){emptyBlockElem.style.width=tWidth?`${tWidth}px`:'';}}else if(layout==='footer'){let renderColumnList=tableColumn;let isOptimizeMode=false;// 如果是使用优化模式
10528
10544
  if(scrollXLoad||scrollYLoad||allColumnFooterOverflow){if(spanMethod||footerSpanMethod){// 如果不支持优化模式
10529
10545
  }else{isOptimizeMode=true;}}if(fixedType){renderColumnList=visibleColumn;if(isOptimizeMode){renderColumnList=fixedColumn||[];}}const tWidth=renderColumnList.reduce((previous,column)=>previous+column.renderWidth,0);if(fixedType){if(isOptimizeMode){if(wrapperElem){wrapperElem.style.width=tWidth?`${tWidth}px`:'';}}else{if(wrapperElem){wrapperElem.style.width=scrollXWidth?`${scrollXWidth}px`:'';}}}if(currScrollElem){currScrollElem.style.height=`${footerHeight}px`;// 如果是固定列
10530
- if(fixedWrapperElem){if(wrapperElem){wrapperElem.style.top=`${customHeight>0?customHeight-footerHeight-osbHeight:tableHeight+headerHeight}px`;}}}if(tableElem){tableElem.style.width=tWidth?`${tWidth}px`:'';}}const colgroupElem=getRefElem(elemStore[`${name}-${layout}-colgroup`]);if(colgroupElem){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(colgroupElem.children,colElem=>{const colid=colElem.getAttribute('name');if(fullColumnIdData[colid]){const colRest=fullColumnIdData[colid];const column=colRest.column;const{showHeaderOverflow,showFooterOverflow,showOverflow}=column;let cellOverflow;colElem.style.width=`${column.renderWidth}px`;if(layout==='header'){cellOverflow=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow)?allColumnHeaderOverflow:showHeaderOverflow;}else if(layout==='footer'){cellOverflow=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showFooterOverflow)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showFooterOverflow)?allColumnFooterOverflow:showFooterOverflow;}else{cellOverflow=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow)?isAllOverflow:showOverflow;}const showEllipsis=cellOverflow==='ellipsis';const showTitle=cellOverflow==='title';const showTooltip=cellOverflow===true||cellOverflow==='tooltip';let hasEllipsis=showTitle||showTooltip||showEllipsis;const listElem=getRefElem(elemStore[`${name}-${layout}-list`]);// 纵向虚拟滚动不支持动态行高
10531
- if(scrollYLoad&&!hasEllipsis){hasEllipsis=true;}if(listElem){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(listElem.querySelectorAll(`.${column.id}`),elem=>{const colspan=parseInt(elem.getAttribute('colspan')||1);const cellElem=elem.querySelector('.vxe-cell');let colWidth=column.renderWidth;if(cellElem){if(colspan>1){const columnIndex=$xeTable.getColumnIndex(column);for(let index=1;index<colspan;index++){const nextColumn=$xeTable.getColumns(columnIndex+index);if(nextColumn){colWidth+=nextColumn.renderWidth;}}}cellElem.style.width=hasEllipsis?`${colWidth-cellOffsetWidth*colspan}px`:'';}});}}});}});});if(currentRow){$xeTable.setCurrentRow(currentRow);}if(mouseConfig&&mouseOpts.selected&&editStore.selected.row&&editStore.selected.column){$xeTable.addCellSelectedClass();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const checkValidate=type=>{if($xeTable.triggerValidate){return $xeTable.triggerValidate(type);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};/**
10546
+ if(fixedWrapperElem){if(wrapperElem){wrapperElem.style.top=`${customHeight>0?customHeight-footerHeight-osbHeight:tableHeight+headerHeight}px`;}}}if(tableElem){tableElem.style.width=tWidth?`${tWidth}px`:'';}}});});if(currentRow){$xeTable.setCurrentRow(currentRow);}if(mouseConfig&&mouseOpts.selected&&editStore.selected.row&&editStore.selected.column){$xeTable.addCellSelectedClass();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const checkValidate=type=>{if($xeTable.triggerValidate){return $xeTable.triggerValidate(type);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};/**
10532
10547
  * 当单元格发生改变时
10533
10548
  * 如果存在规则,则校验
10534
10549
  */const handleChangeCell=(evnt,params)=>{checkValidate('blur').catch(e=>e).then(()=>{$xeTable.handleEdit(params,evnt).then(()=>checkValidate('change')).catch(e=>e);});};const handleDefaultSort=()=>{const{sortConfig}=props;if(sortConfig){const sortOpts=computeSortOpts.value;let{defaultSort}=sortOpts;if(defaultSort){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(defaultSort)){defaultSort=[defaultSort];}if(defaultSort.length){(sortConfig.multiple?defaultSort:defaultSort.slice(0,1)).forEach((item,index)=>{const{field,order}=item;if(field&&order){const column=tableMethods.getColumnByField(field);if(column&&column.sortable){column.order=order;column.sortTime=Date.now()+index;}}});if(!sortOpts.remote){tablePrivateMethods.handleTableData(true).then(updateStyle);}}}}};/**
@@ -10615,17 +10630,29 @@ if(oldScrollYLoad===sYLoad){restoreScrollLocation($xeTable,targetScrollLeft,targ
10615
10630
  * 处理初始化的默认行为
10616
10631
  * 只会执行一次
10617
10632
  */const handleInitDefaults=()=>{handleDefaultSort();};const handleTableColumn=()=>{const{scrollXLoad}=reactData;const{visibleColumn,scrollXStore,fullColumnIdData}=internalData;const tableColumn=scrollXLoad?visibleColumn.slice(scrollXStore.startIndex,scrollXStore.endIndex):visibleColumn.slice(0);tableColumn.forEach((column,$index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest.$index=$index;}});reactData.tableColumn=tableColumn;};const handleUpdateColumn=()=>{const columnList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(internalData.collectColumn,'renderSortNumber');internalData.collectColumn=columnList;const tableFullColumn=getColumnList(columnList);internalData.tableFullColumn=tableFullColumn;cacheColumnMap();};const loadScrollXData=()=>{const{mergeList,mergeFooterList,isScrollXBig}=reactData;const{scrollXStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollXStore;const{toVisibleIndex,visibleSize}=handleVirtualXVisible();const offsetItem={startIndex:Math.max(0,isScrollXBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollXBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+offsetSize+preloadSize};scrollXStore.visibleStartIndex=toVisibleIndex-1;scrollXStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeList.concat(mergeFooterList),offsetItem,'col');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollXStore.startIndex=offsetStartIndex;scrollXStore.endIndex=offsetEndIndex;$xeTable.updateScrollXData();}}$xeTable.closeTooltip();};// 获取所有的列,排除分组
10618
- const getColumnList=columns=>{const result=[];columns.forEach(column=>{result.push(...(column.children&&column.children.length?getColumnList(column.children):[column]));});return result;};const parseColumns=isReset=>{const{showOverflow}=props;const rowOpts=computeRowOpts.value;const leftList=[];const centerList=[];const rightList=[];const{isGroup,columnStore}=reactData;const sXOpts=computeSXOpts.value;const{collectColumn,tableFullColumn,scrollXStore,fullColumnIdData}=internalData;// 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
10633
+ const getColumnList=columns=>{const result=[];columns.forEach(column=>{result.push(...(column.children&&column.children.length?getColumnList(column.children):[column]));});return result;};const parseColumns=isReset=>{// const { showOverflow } = props
10634
+ // const rowOpts = computeRowOpts.value
10635
+ const leftList=[];const centerList=[];const rightList=[];const{isGroup,columnStore}=reactData;const sXOpts=computeSXOpts.value;const{collectColumn,tableFullColumn,scrollXStore,fullColumnIdData}=internalData;// 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
10619
10636
  if(isGroup){const leftGroupList=[];const centerGroupList=[];const rightGroupList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const isColGroup=hasChildrenList(column);// 如果是分组,必须按组设置固定列,不允许给子列设置固定
10620
10637
  if(parentColumn&&parentColumn.fixed){column.fixed=parentColumn.fixed;}if(parentColumn&&column.fixed!==parentColumn.fixed){errLog('vxe.error.groupFixed');}if(isColGroup){column.visible=!!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(column.children,subColumn=>hasChildrenList(subColumn)?false:subColumn.visible);}else if(column.visible){if(column.fixed==='left'){leftList.push(column);}else if(column.fixed==='right'){rightList.push(column);}else{centerList.push(column);}}});collectColumn.forEach(column=>{if(column.visible){if(column.fixed==='left'){leftGroupList.push(column);}else if(column.fixed==='right'){rightGroupList.push(column);}else{centerGroupList.push(column);}}});reactData.tableGroupColumn=leftGroupList.concat(centerGroupList).concat(rightGroupList);}else{// 重新分配列
10621
10638
  tableFullColumn.forEach(column=>{if(column.visible){if(column.fixed==='left'){leftList.push(column);}else if(column.fixed==='right'){rightList.push(column);}else{centerList.push(column);}}});}const visibleColumn=leftList.concat(centerList).concat(rightList);// 如果gt为0,则总是启用
10622
- const scrollXLoad=!!sXOpts.enabled&&sXOpts.gt>-1&&(sXOpts.gt===0||sXOpts.gt<tableFullColumn.length);reactData.hasFixedColumn=leftList.length>0||rightList.length>0;Object.assign(columnStore,{leftList,centerList,rightList});if(scrollXLoad){if(showOverflow){if(!rowOpts.height){const errColumn=internalData.tableFullColumn.find(column=>column.showOverflow===false);if(errColumn){errLog('vxe.error.errProp',[`column[field="${errColumn.field}"].show-overflow=false`,'show-overflow=true']);}}}if(true){// if (props.showHeader && !props.showHeaderOverflow) {
10639
+ const scrollXLoad=!!sXOpts.enabled&&sXOpts.gt>-1&&(sXOpts.gt===0||sXOpts.gt<tableFullColumn.length);reactData.hasFixedColumn=leftList.length>0||rightList.length>0;Object.assign(columnStore,{leftList,centerList,rightList});if(scrollXLoad){// if (showOverflow) {
10640
+ // if (!rowOpts.height) {
10641
+ // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
10642
+ // if (errColumn) {
10643
+ // errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
10644
+ // }
10645
+ // }
10646
+ // }
10647
+ // if (process.env.VUE_APP_VXE_ENV === 'development') {
10648
+ // if (props.showHeader && !props.showHeaderOverflow) {
10623
10649
  // warnLog('vxe.error.reqProp', ['show-header-overflow'])
10624
10650
  // }
10625
10651
  // if (props.showFooter && !props.showFooterOverflow) {
10626
10652
  // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
10627
10653
  // }
10628
- if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(props.footerSpanMethod){warnLog('vxe.error.scrollErrProp',['footer-span-method']);}}if(isReset){const{visibleSize}=handleVirtualXVisible();scrollXStore.startIndex=0;scrollXStore.endIndex=visibleSize;scrollXStore.visibleSize=visibleSize;scrollXStore.visibleStartIndex=0;scrollXStore.visibleEndIndex=visibleSize;}}// 如果列被显示/隐藏,则清除合并状态
10654
+ if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(props.footerSpanMethod){warnLog('vxe.error.scrollErrProp',['footer-span-method']);}// }
10655
+ if(isReset){const{visibleSize}=handleVirtualXVisible();scrollXStore.startIndex=0;scrollXStore.endIndex=visibleSize;scrollXStore.visibleSize=visibleSize;scrollXStore.visibleStartIndex=0;scrollXStore.visibleEndIndex=visibleSize;}}// 如果列被显示/隐藏,则清除合并状态
10629
10656
  // 如果列被设置为固定,则清除合并状态
10630
10657
  if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}reactData.scrollXLoad=scrollXLoad;visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});internalData.visibleColumn=visibleColumn;handleTableColumn();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnSort=()=>{const{collectColumn}=internalData;collectColumn.forEach((column,index)=>{const sortIndex=index+1;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;});};const handleColumn=collectColumn=>{const expandOpts=computeExpandOpts.value;internalData.collectColumn=collectColumn;const tableFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tableFullColumn;reactData.isColLoading=true;reactData.isDragColMove=false;initColumnSort();return Promise.resolve(restoreCustomStorage()).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}reactData.isColLoading=false;return $xeTable.recalculate();});});};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const sYOpts=computeSYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
10631
10658
  const scrollYLoad=(transform||!treeConfig)&&!!sYOpts.enabled&&sYOpts.gt>-1&&(sYOpts.gt===0||sYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;return scrollYLoad;};/**