vxe-table 3.21.5 → 3.21.7

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.
@@ -20,6 +20,7 @@ exports.encodeRowid = encodeRowid;
20
20
  exports.getCalcHeight = getCalcHeight;
21
21
  exports.getCellRestHeight = getCellRestHeight;
22
22
  exports.getCellValue = getCellValue;
23
+ exports.getColReMaxWidth = getColReMaxWidth;
23
24
  exports.getColReMinWidth = getColReMinWidth;
24
25
  exports.getColumnList = getColumnList;
25
26
  exports.getFirstChildColumn = getFirstChildColumn;
@@ -793,7 +794,10 @@ function toFilters(filters, colid) {
793
794
  }
794
795
  return filters;
795
796
  }
796
- function getColReMinWidth(params) {
797
+ /**
798
+ * 列宽拖动最大宽度
799
+ */
800
+ function getColReMaxWidth(params) {
797
801
  const {
798
802
  $table,
799
803
  column,
@@ -801,9 +805,52 @@ function getColReMinWidth(params) {
801
805
  } = params;
802
806
  const internalData = $table;
803
807
  const {
804
- showHeaderOverflow: allColumnHeaderOverflow,
805
- resizableOpts
806
- } = $table;
808
+ elemStore
809
+ } = internalData;
810
+ const resizableOpts = $table.computeResizableOpts;
811
+ const columnOpts = $table.computeColumnOpts;
812
+ const {
813
+ maxWidth: reMaxWidth
814
+ } = resizableOpts;
815
+ const colMaxWidth = column.maxWidth || columnOpts.maxWidth;
816
+ // 如果自定义调整宽度逻辑
817
+ if (reMaxWidth) {
818
+ const customMaxWidth = _xeUtils.default.isFunction(reMaxWidth) ? reMaxWidth(params) : reMaxWidth;
819
+ if (customMaxWidth !== 'auto') {
820
+ return Math.max(1, _xeUtils.default.toNumber(customMaxWidth));
821
+ }
822
+ }
823
+ const minTitleWidth = _xeUtils.default.floor((_xeUtils.default.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
824
+ const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize((0, _dom.queryElement)(cell, '.vxe-cell'));
825
+ const mWidth = minTitleWidth + paddingLeftRight;
826
+ // 如果设置最小宽
827
+ if (colMaxWidth) {
828
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
829
+ if (bodyScrollElem) {
830
+ if ((0, _dom.isScale)(colMaxWidth)) {
831
+ const bodyWidth = bodyScrollElem.clientWidth - 1;
832
+ const meanWidth = bodyWidth / 100;
833
+ return Math.max(mWidth, Math.floor(_xeUtils.default.toInteger(colMaxWidth) * meanWidth));
834
+ } else if ((0, _dom.isPx)(colMaxWidth)) {
835
+ return Math.max(mWidth, _xeUtils.default.toInteger(colMaxWidth));
836
+ }
837
+ }
838
+ }
839
+ return -1;
840
+ }
841
+ /**
842
+ * 列宽拖动最小宽度
843
+ */
844
+ function getColReMinWidth(params) {
845
+ const {
846
+ $table,
847
+ column,
848
+ cell
849
+ } = params;
850
+ const tableProps = $table;
851
+ const internalData = $table;
852
+ const resizableOpts = $table.computeResizableOpts;
853
+ const columnOpts = $table.computeColumnOpts;
807
854
  const {
808
855
  minWidth
809
856
  } = resizableOpts;
@@ -818,9 +865,12 @@ function getColReMinWidth(params) {
818
865
  elemStore
819
866
  } = internalData;
820
867
  const {
821
- showHeaderOverflow,
822
- minWidth: colMinWidth
868
+ showHeaderOverflow: allColumnHeaderOverflow
869
+ } = tableProps;
870
+ const {
871
+ showHeaderOverflow
823
872
  } = column;
873
+ const colMinWidth = column.minWidth || columnOpts.minWidth;
824
874
  const headOverflow = _xeUtils.default.isUndefined(showHeaderOverflow) || _xeUtils.default.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
825
875
  const showEllipsis = headOverflow === 'ellipsis';
826
876
  const showTitle = headOverflow === 'title';
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.assembleColumn=assembleColumn,exports.clearTableAllStatus=clearTableAllStatus,exports.clearTableDefaultStatus=clearTableDefaultStatus,exports.colToVisible=colToVisible,exports.convertHeaderColumnToRows=void 0,exports.convertHeaderToGridRows=convertHeaderToGridRows,exports.createColumn=createColumn,exports.createHandleGetRowId=createHandleGetRowId,exports.createHandleUpdateRowId=createHandleUpdateRowId,exports.createInternalData=createInternalData,exports.createReactData=createReactData,exports.createRowId=createRowId,exports.destroyColumn=destroyColumn,exports.encodeRowid=encodeRowid,exports.getCalcHeight=getCalcHeight,exports.getCellRestHeight=getCellRestHeight,exports.getCellValue=getCellValue,exports.getColReMinWidth=getColReMinWidth,exports.getColumnList=getColumnList,exports.getFirstChildColumn=getFirstChildColumn,exports.getLastChildColumn=getLastChildColumn,exports.getRefElem=getRefElem,exports.getRootColumn=getRootColumn,exports.getRowUniqueId=getRowUniqueId,exports.getRowid=getRowid,exports.getRowkey=getRowkey,exports.handleFieldOrColumn=handleFieldOrColumn,exports.handleRowidOrRow=handleRowidOrRow,exports.hasDeepKey=hasDeepKey,exports.isColumnInfo=isColumnInfo,exports.restoreScrollLocation=restoreScrollLocation,exports.rowToVisible=rowToVisible,exports.setCellValue=setCellValue,exports.toFilters=toFilters,exports.toTreePathSeq=toTreePathSeq;var _xeUtils=_interopRequireDefault(require("xe-utils")),_columnInfo=require("./columnInfo"),_dom=require("../../ui/src/dom"),_log=require("../../ui/src/log"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function createInternalData(){return{tZindex:0,currKeyField:"",isCurrDeepKey:!1,elemStore:{},scrollXStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},scrollYStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},tableWidth:0,tableHeight:0,customHeight:0,customMinHeight:0,customMaxHeight:0,hoverRow:null,lastScrollLeft:0,lastScrollTop:0,radioReserveRow:null,checkboxReserveRowMap:{},rowExpandedReserveRowMap:{},treeExpandedReserveRowMap:{},treeIndeterminateRowMaps:{},tableFullData:[],afterFullData:[],afterTreeFullData:[],afterGroupFullData:[],afterFullRowMaps:{},tableFullTreeData:[],tableFullGroupData:[],tableSynchData:[],tableSourceData:[],collectColumn:[],tableFullColumn:[],visibleColumn:[],fullAllDataRowIdData:{},fullDataRowIdData:{},visibleDataRowIdData:{},keepUpdateFieldMaps:{},headerFullDataColData:{},footerFullDataRowData:{},sourceDataRowIdData:{},fullColumnIdData:{},fullColumnFieldData:{},currentRow:null,mergeHeaderList:[],mergeHeaderMaps:{},mergeHeaderCellMaps:{},mergeHeaderRowMaps:{},mergeHeaderColMaps:{},mergeBodyList:[],mergeBodyMaps:{},mergeBodyCellMaps:{},mergeBodyRowMaps:{},mergeBodyColMaps:{},mergeFooterList:[],mergeFooterMaps:{},mergeFooterCellMaps:{},mergeFooterRowMaps:{},mergeFooterColMaps:{},rowExpandedMaps:{},rowExpandLazyLoadedMaps:{},rowGroupExpandedMaps:{},treeExpandedMaps:{},treeExpandLazyLoadedMaps:{},selectCheckboxMaps:{},pendingRowMaps:{},insertRowMaps:{},removeRowMaps:{},cvCacheMaps:{},tHeaderHeight:0,tBodyHeight:0,tFooterHeight:0,stackHistoryStore:{undoStacks:[],redoStacks:[]},teleportToWrapperElem:null,popupToWrapperElem:null,customPopupToElem:null,lastSTime:0,inited:!1,tooltipTimeout:null,initStatus:!1,isActivated:!1}}function createReactData(){return{updateColFlag:0,staticColumns:[],tableGroupColumn:[],tableColumn:[],tableData:[],scrollXLoad:!1,scrollYLoad:!1,overflowY:!0,overflowX:!1,scrollbarWidth:0,scrollbarHeight:0,rowHeight:0,parentHeight:0,isGroup:!1,isAllOverflow:!1,isAllSelected:!1,isIndeterminate:!1,currentColumn:null,selectRadioRow:null,footerTableData:[],rowGroupColumn:null,expandColumn:null,checkboxColumn:null,radioColumn:null,treeNodeColumn:null,hasFixedColumn:!1,upDataFlag:0,reColumnFlag:0,initStore:{filter:!1,import:!1,export:!1,custom:!1},customStore:{btnEl:null,isAll:!1,isIndeterminate:!1,activeBtn:!1,activeWrapper:!1,visible:!1,maxHeight:null,popupStyle:{},oldSortMaps:{},oldFixedMaps:{},oldVisibleMaps:{}},customColumnList:[],filterStore:{isAllSelected:!1,isIndeterminate:!1,style:null,column:null,visible:!1,maxHeight:null},columnStore:{leftList:[],centerList:[],rightList:[],resizeList:[],pxList:[],pxMinList:[],autoMinList:[],scaleList:[],scaleMinList:[],autoList:[],remainList:[]},ctxMenuStore:{selected:null,visible:!1,showChild:!1,selectChild:null,list:[],style:null},editStore:{indexs:{columns:[]},titles:{columns:[]},selected:{row:null,column:null},copyed:{cut:!1,rows:[],columns:[]},actived:{row:null,column:null},focused:{row:null,column:null}},tooltipStore:{row:null,column:null,content:"",visible:!1,type:null,currOpts:{}},validStore:{visible:!1},validErrorMaps:{},importStore:{inited:!1,file:null,type:"",modeList:[],typeList:[],filename:"",visible:!1},importParams:{mode:"",types:null,message:!0},exportStore:{inited:!1,name:"",modeList:[],typeList:[],columns:[],isPrint:!1,hasFooter:!1,hasMerge:!1,hasTree:!1,hasRowGroup:!1,hasColgroup:!1,visible:!1},exportParams:{filename:"",sheetName:"",mode:"",type:"",isColgroup:!1,isMerge:!1,isTreeAllExpanded:!1,isRowGroupAllExpanded:!1,useStyle:!1,original:!1,message:!0,isHeader:!1,isTitle:!1,isFooter:!1},visiblwRowsFlag:1,isRowGroupStatus:!1,rowGroupList:[],aggHandleFields:[],aggHandleAggColumns:[],rowGroupExpandedFlag:1,rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,insertRowFlag:1,removeRowFlag:1,mergeHeadFlag:1,mergeBodyFlag:1,mergeFootFlag:1,rowHeightStore:{large:52,default:48,medium:44,small:40,mini:36},scrollVMLoading:!1,scrollYHeight:0,scrollYTop:0,isScrollYBig:!1,scrollXLeft:0,scrollXWidth:0,isScrollXBig:!1,lazScrollLoading:!1,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:!1,isCustomDragStatus:!0,ctPopupFlag:1,isCrossDragRow:!1,dragRow:null,isCrossDragCol:!1,dragCol:null,dragTipText:"",isDragResize:!1,isRowLoading:!1,isColLoading:!1}}let getAllConvertColumns=(e,l)=>{let t=[];return e.forEach(e=>{e.parentId=l?l.id:null,e.visible&&(e.children&&e.children.length&&e.children.some(e=>e.visible)?(t.push(e),t.push(...getAllConvertColumns(e.children,e))):t.push(e))}),t},convertHeaderColumnToRows=e=>{let l=1,o=(t,e)=>{if(e&&(t.level=e.level+1,l<t.level)&&(l=t.level),t.children&&t.children.length&&t.children.some(e=>e.visible)){let l=0;t.children.forEach(e=>{e.visible&&(o(e,t),l+=e.colSpan)}),t.colSpan=l}else t.colSpan=1},t=(e.forEach(e=>{e.level=1,o(e)}),[]);for(let e=0;e<l;e++)t.push([]);return getAllConvertColumns(e).forEach(e=>{e.children&&e.children.length&&e.children.some(e=>e.visible)?e.rowSpan=1:e.rowSpan=l-e.level+1,t[e.level-1].push(e)}),t};function convertHeaderToGridRows(l){var t=l.length,i=l[0].reduce((e,l)=>e+l.colSpan,0),n=[],a=[];for(let e=0;e<t;e++){var o=[],r=[];for(let e=0;e<i;e++)o.push(!1),r.push("");n.push(o),a.push(r)}for(let r=0;r<t;r++){let e=0;for(var u of l[r]){var{colSpan:s,rowSpan:d}=u;let o=-1;for(let t=e;t<=i-s;t++){let l=!0;for(let e=0;e<s;e++)if(n[r][t+e]){l=!1;break}if(l){o=t;break}}if(-1===o){for(let t=0;t<=i-s;t++){let l=!0;for(let e=0;e<s;e++)if(n[r][t+e]){l=!1;break}if(l){o=t;break}}if(-1===o)break}for(let l=r;l<r+d;l++)for(let e=o;e<o+s;e++)n[l][e]=!0,a[l][e]=u;e=o+s}}return a}function restoreScrollLocation(e,l,t){var o=e;return l||t?(o.intoRunScroll=!1,o.inVirtualScroll=!1,o.inWheelScroll=!1,o.inHeaderScroll=!1,o.inBodyScroll=!1,o.inFooterScroll=!1,o.scrollRenderType="",e.scrollTo(l,t)):e.clearScroll()}function toTreePathSeq(e){return e.map((e,l)=>l%2==0?Number(e)+1:".").join("")}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}function createRowId(e,l,t){e=e.createKeyMethod;return e?""+e({row:l,keyField:t}):getRowUniqueId()}function hasDeepKey(e){return-1<e.indexOf(".")}function getRowkey(e){e=e.currKeyField;return e}function getRowid(e,l){var{isCurrDeepKey:e,currKeyField:t}=e;return l?encodeRowid((e?getDeepRowIdByKey:getFastRowIdByKey)(l,t)):""}function createHandleUpdateRowId(e){let{isCurrDeepKey:l,currKeyField:t}=e,o=e.computeRowOpts,r=l?updateDeepRowKey:updateFastRowKey;return{rowKey:t,handleUpdateRowId(e){return e?r(o,e,t):""}}}function createHandleGetRowId(e){let{isCurrDeepKey:l,currKeyField:t}=e,o=l?getDeepRowIdByKey:getFastRowIdByKey;return{rowKey:t,handleGetRowId(e){return e?encodeRowid(o(e,t)):""}}}function encodeRowid(e){return _xeUtils.default.eqNull(e)?"":encodeURIComponent(e)}function getDeepRowIdByKey(e,l){return _xeUtils.default.get(e,l)}function updateDeepRowKey(e,l,t){let o=encodeRowid(getDeepRowIdByKey(l,t));return(0,_utils.eqEmptyValue)(o)&&(e=createRowId(e,l,t),o=""+e,_xeUtils.default.set(l,t,o)),o}function getFastRowIdByKey(e,l){return e[l]}function updateFastRowKey(e,l,t){let o=encodeRowid(getFastRowIdByKey(l,t));return(0,_utils.eqEmptyValue)(o)&&(e=createRowId(e,l,t),o=""+e,l[t]=e),o}function getPaddingLeftRightSize(e){return e?(e=getComputedStyle(e),_xeUtils.default.toNumber(e.paddingLeft)+_xeUtils.default.toNumber(e.paddingRight)):0}function getElementMarginAndWidth(e){var l,t;return e?(t=getComputedStyle(e),l=_xeUtils.default.toNumber(t.marginLeft),t=_xeUtils.default.toNumber(t.marginRight),e.offsetWidth+l+t):0}function getCalcHeight(e){return"unset"!==e&&e||0}function handleFieldOrColumn(e,l){return l?_xeUtils.default.isString(l)||_xeUtils.default.isNumber(l)?e.getColumnByField(""+l):l:null}function handleRowidOrRow(e,l){return l?(l=_xeUtils.default.isString(l)||_xeUtils.default.isNumber(l)?l:getRowid(e,l),e.getRowById(l)):null}function getCellRestHeight(e,l,t,o){return e.resizeHeight||l.height||t.height||e.height||o}function assembleColumn(e){var l=e.$xeTable,t=l.staticColumns,{$el:e,$xeColumn:o,columnConfig:r}=e,i=o?o.columnConfig:null;i?("vxe-table-column"===o.$options._componentTag?(0,_log.errLog)("vxe.error.groupTag",[`<vxe-table-colgroup title=${o.title} ...>`,`<vxe-table-column title=${o.title} ...>`]):"vxe-column"===o.$options._componentTag&&(0,_log.warnLog)("vxe.error.groupTag",[`<vxe-colgroup title=${o.title} ...>`,`<vxe-column title=${o.title} ...>`]),i.children||(i.children=[]),r.defaultParentId=i.id,i.children.splice(_xeUtils.default.arrayIndexOf(o.$el.children,e),0,r)):t.splice(_xeUtils.default.arrayIndexOf(l.$refs.hideColumn.children,e),0,r)}function destroyColumn(e){var l=e.$xeTable.staticColumns;let t=e.columnConfig;e=_xeUtils.default.findTree(l,e=>e===t);e&&e.items.splice(e.index,1)}function getRootColumn(e,l){var t=e.fullColumnIdData;if(!l)return null;let o=l.parentId;for(;t[o];){let e=t[o].column;if(!(o=e.parentId))return e}return l}function toFilters(e,i){return e&&(_xeUtils.default.isArray(e)?e.map(({label:e,value:l,data:t,resetValue:o,checked:r})=>({label:e,value:l,data:t,resetValue:o,checked:!!r,_checked:!!r,_colId:i})):[])}function getColReMinWidth(e){var{$table:l,column:t,cell:o}=e,r=l,{showHeaderOverflow:l,resizableOpts:i}=l,i=i.minWidth;if(i){e=_xeUtils.default.isFunction(i)?i(e):i;if("auto"!==e)return Math.max(1,_xeUtils.default.toNumber(e))}var n,a,u,s,i=r.elemStore,{showHeaderOverflow:e,minWidth:r}=t,t=_xeUtils.default.isUndefined(e)||_xeUtils.default.isNull(e)?l:e,l="title"===t||(!0===t||"tooltip"===t)||"ellipsis"===t;let d=_xeUtils.default.floor(1.8*(_xeUtils.default.toNumber(getComputedStyle(o).fontSize)||14))+(getPaddingLeftRightSize(o)+getPaddingLeftRightSize((0,_dom.queryElement)(o,".vxe-cell")));if(l&&(e=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--drag-handle")),t=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--checkbox")),l=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--required-icon")),n=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--edit-icon")),a=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell-title-prefix-icon")),u=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell-title-suffix-icon")),s=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--sort")),o=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--filter")),d+=e+t+l+n+a+u+o+s),r){e=getRefElem(i["main-body-scroll"]);if(e){if((0,_dom.isScale)(r))return t=(e.clientWidth-1)/100,Math.max(d,Math.floor(_xeUtils.default.toInteger(r)*t));if((0,_dom.isPx)(r))return Math.max(d,_xeUtils.default.toInteger(r))}}return d}function getFirstChildColumn(e){var l=e.children;return l&&l.length?getFirstChildColumn(_xeUtils.default.first(l)):e}function getLastChildColumn(e){var l=e.children;return l&&l.length?getFirstChildColumn(_xeUtils.default.last(l)):e}function getCellValue(e,l){return l?_xeUtils.default.get(e,l.field):null}function setCellValue(e,l,t){l&&_xeUtils.default.set(e,l.field,t)}function getRefElem(e){return e?e.$el||e:null}function clearTableDefaultStatus(e){var l=e,t=(e.initStatus=!1,[e.clearSort(),e.clearCurrentRow(),e.clearCurrentColumn(),e.clearRadioRow(),e.clearRadioReserve(),e.clearCheckboxRow(),e.clearCheckboxReserve(),e.clearRowExpand(),e.clearTreeExpand(),e.clearTreeExpandReserve(),e.clearPendingRow()]);return e.clearFilter&&t.push(e.clearFilter()),e.clearSelected&&(l.keyboardConfig||l.mouseConfig)&&t.push(e.clearSelected()),e.clearCellAreas&&l.mouseConfig&&t.push(e.clearCellAreas(),e.clearCopyCellArea()),Promise.all(t).then(()=>e.clearScroll())}function clearTableAllStatus(e){return e.clearFilter&&e.clearFilter(),clearTableDefaultStatus(e)}function isColumnInfo(e){return e instanceof _columnInfo.ColumnInfo}function getColumnList(e){let l=[];return e.forEach(e=>{l.push(...e.children&&e.children.length?getColumnList(e.children):[e])}),l}function createColumn(e,l,t){return isColumnInfo(l)?l:new _columnInfo.ColumnInfo(e,l,t)}function rowToVisible(e,l){var{scrollYLoad:t,scrollYTop:o,isAllOverflow:r}=e,{elemStore:i,afterFullData:n,fullAllDataRowIdData:a,isResizeCellHeight:u}=e,s=e.computeRowOpts,d=e.computeCellOpts,c=e.computeDefaultRowHeight,m=e.computeLeftFixedWidth,g=e.computeRightFixedWidth,i=getRefElem(i["main-body-scroll"]),p=getRowid(e,l);if(i){var f=i.clientHeight,h=i.scrollTop,i=i.querySelector(`[rowid="${p}"]`);if(i){var o=i.offsetTop+(t?o:0),i=i.clientHeight;if(o<h||h+f<o)return e.scrollTo(null,o);if(f+h<=o+i)return e.scrollTo(null,h+i)}else if(t)return u||d.height||s.height||!r?(i=(o=a[p]||{}).resizeHeight||d.height||s.height||o.height||c,(t=o.oTop)<h?e.scrollTo(null,t-m-1):e.scrollTo(null,t+i-(f-g-1))):e.scrollTo(null,(e.findRowIndexOf(n,l)-1)*c)}return Promise.resolve()}function colToVisible(t,o,r,l){var{scrollXLoad:i,scrollXLeft:n}=t,{elemStore:a,visibleColumn:u}=t,s=t.computeLeftFixedWidth,d=t.computeRightFixedWidth,a=getRefElem(a["main-body-scroll"]);if(!r.fixed&&a){var c=a.clientWidth,m=a.scrollLeft;let e=null;if(l&&(l=getRowid(t,l),e=a.querySelector(`[rowid="${l}"] .`+r.id)),e=e||a.querySelector("."+r.id)){l=e.offsetLeft+(i?n:0),a=e.clientWidth;if(o||!(l<=m+s&&m+s<l+a)&&!(m+s<=l&&l<m+c-d)){if(l<m+s)return t.scrollTo(l-s-1);if(c-d<l+a-m)return t.scrollTo(l+a-(c-d-1))}}else if(i){let l=0;n=r.renderWidth;for(let e=0;e<u.length;e++){var g=u[e];if(g===r||g.id===r.id)break;l+=g.renderWidth}if(o||!(l<=m+s&&l+n>m+s)&&!(l>=m+s&&l<m+c-d))return l<m?t.scrollTo(l-s-1):t.scrollTo(l+n-(c-d-1))}}return Promise.resolve()}exports.convertHeaderColumnToRows=convertHeaderColumnToRows;
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.assembleColumn=assembleColumn,exports.clearTableAllStatus=clearTableAllStatus,exports.clearTableDefaultStatus=clearTableDefaultStatus,exports.colToVisible=colToVisible,exports.convertHeaderColumnToRows=void 0,exports.convertHeaderToGridRows=convertHeaderToGridRows,exports.createColumn=createColumn,exports.createHandleGetRowId=createHandleGetRowId,exports.createHandleUpdateRowId=createHandleUpdateRowId,exports.createInternalData=createInternalData,exports.createReactData=createReactData,exports.createRowId=createRowId,exports.destroyColumn=destroyColumn,exports.encodeRowid=encodeRowid,exports.getCalcHeight=getCalcHeight,exports.getCellRestHeight=getCellRestHeight,exports.getCellValue=getCellValue,exports.getColReMaxWidth=getColReMaxWidth,exports.getColReMinWidth=getColReMinWidth,exports.getColumnList=getColumnList,exports.getFirstChildColumn=getFirstChildColumn,exports.getLastChildColumn=getLastChildColumn,exports.getRefElem=getRefElem,exports.getRootColumn=getRootColumn,exports.getRowUniqueId=getRowUniqueId,exports.getRowid=getRowid,exports.getRowkey=getRowkey,exports.handleFieldOrColumn=handleFieldOrColumn,exports.handleRowidOrRow=handleRowidOrRow,exports.hasDeepKey=hasDeepKey,exports.isColumnInfo=isColumnInfo,exports.restoreScrollLocation=restoreScrollLocation,exports.rowToVisible=rowToVisible,exports.setCellValue=setCellValue,exports.toFilters=toFilters,exports.toTreePathSeq=toTreePathSeq;var _xeUtils=_interopRequireDefault(require("xe-utils")),_columnInfo=require("./columnInfo"),_dom=require("../../ui/src/dom"),_log=require("../../ui/src/log"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function createInternalData(){return{tZindex:0,currKeyField:"",isCurrDeepKey:!1,elemStore:{},scrollXStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},scrollYStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},tableWidth:0,tableHeight:0,customHeight:0,customMinHeight:0,customMaxHeight:0,hoverRow:null,lastScrollLeft:0,lastScrollTop:0,radioReserveRow:null,checkboxReserveRowMap:{},rowExpandedReserveRowMap:{},treeExpandedReserveRowMap:{},treeIndeterminateRowMaps:{},tableFullData:[],afterFullData:[],afterTreeFullData:[],afterGroupFullData:[],afterFullRowMaps:{},tableFullTreeData:[],tableFullGroupData:[],tableSynchData:[],tableSourceData:[],collectColumn:[],tableFullColumn:[],visibleColumn:[],fullAllDataRowIdData:{},fullDataRowIdData:{},visibleDataRowIdData:{},keepUpdateFieldMaps:{},headerFullDataColData:{},footerFullDataRowData:{},sourceDataRowIdData:{},fullColumnIdData:{},fullColumnFieldData:{},currentRow:null,mergeHeaderList:[],mergeHeaderMaps:{},mergeHeaderCellMaps:{},mergeHeaderRowMaps:{},mergeHeaderColMaps:{},mergeBodyList:[],mergeBodyMaps:{},mergeBodyCellMaps:{},mergeBodyRowMaps:{},mergeBodyColMaps:{},mergeFooterList:[],mergeFooterMaps:{},mergeFooterCellMaps:{},mergeFooterRowMaps:{},mergeFooterColMaps:{},rowExpandedMaps:{},rowExpandLazyLoadedMaps:{},rowGroupExpandedMaps:{},treeExpandedMaps:{},treeExpandLazyLoadedMaps:{},selectCheckboxMaps:{},pendingRowMaps:{},insertRowMaps:{},removeRowMaps:{},cvCacheMaps:{},tHeaderHeight:0,tBodyHeight:0,tFooterHeight:0,stackHistoryStore:{undoStacks:[],redoStacks:[]},teleportToWrapperElem:null,popupToWrapperElem:null,customPopupToElem:null,lastSTime:0,inited:!1,tooltipTimeout:null,initStatus:!1,isActivated:!1}}function createReactData(){return{updateColFlag:0,staticColumns:[],tableGroupColumn:[],tableColumn:[],tableData:[],scrollXLoad:!1,scrollYLoad:!1,overflowY:!0,overflowX:!1,scrollbarWidth:0,scrollbarHeight:0,rowHeight:0,parentHeight:0,isGroup:!1,isAllOverflow:!1,isAllSelected:!1,isIndeterminate:!1,currentColumn:null,selectRadioRow:null,footerTableData:[],rowGroupColumn:null,expandColumn:null,checkboxColumn:null,radioColumn:null,treeNodeColumn:null,hasFixedColumn:!1,upDataFlag:0,reColumnFlag:0,initStore:{filter:!1,import:!1,export:!1,custom:!1},customStore:{btnEl:null,isAll:!1,isIndeterminate:!1,activeBtn:!1,activeWrapper:!1,visible:!1,maxHeight:null,popupStyle:{},oldSortMaps:{},oldFixedMaps:{},oldVisibleMaps:{}},customColumnList:[],filterStore:{isAllSelected:!1,isIndeterminate:!1,style:null,column:null,visible:!1,maxHeight:null},columnStore:{leftList:[],centerList:[],rightList:[],resizeList:[],pxList:[],pxMinList:[],autoMinList:[],scaleList:[],scaleMinList:[],autoList:[],remainList:[]},ctxMenuStore:{selected:null,visible:!1,showChild:!1,selectChild:null,list:[],style:null},editStore:{indexs:{columns:[]},titles:{columns:[]},selected:{row:null,column:null},copyed:{cut:!1,rows:[],columns:[]},actived:{row:null,column:null},focused:{row:null,column:null}},tooltipStore:{row:null,column:null,content:"",visible:!1,type:null,currOpts:{}},validStore:{visible:!1},validErrorMaps:{},importStore:{inited:!1,file:null,type:"",modeList:[],typeList:[],filename:"",visible:!1},importParams:{mode:"",types:null,message:!0},exportStore:{inited:!1,name:"",modeList:[],typeList:[],columns:[],isPrint:!1,hasFooter:!1,hasMerge:!1,hasTree:!1,hasRowGroup:!1,hasColgroup:!1,visible:!1},exportParams:{filename:"",sheetName:"",mode:"",type:"",isColgroup:!1,isMerge:!1,isTreeAllExpanded:!1,isRowGroupAllExpanded:!1,useStyle:!1,original:!1,message:!0,isHeader:!1,isTitle:!1,isFooter:!1},visiblwRowsFlag:1,isRowGroupStatus:!1,rowGroupList:[],aggHandleFields:[],aggHandleAggColumns:[],rowGroupExpandedFlag:1,rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,insertRowFlag:1,removeRowFlag:1,mergeHeadFlag:1,mergeBodyFlag:1,mergeFootFlag:1,rowHeightStore:{large:52,default:48,medium:44,small:40,mini:36},scrollVMLoading:!1,scrollYHeight:0,scrollYTop:0,isScrollYBig:!1,scrollXLeft:0,scrollXWidth:0,isScrollXBig:!1,lazScrollLoading:!1,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:!1,isCustomDragStatus:!0,ctPopupFlag:1,isCrossDragRow:!1,dragRow:null,isCrossDragCol:!1,dragCol:null,dragTipText:"",isDragResize:!1,isRowLoading:!1,isColLoading:!1}}let getAllConvertColumns=(e,t)=>{let l=[];return e.forEach(e=>{e.parentId=t?t.id:null,e.visible&&(e.children&&e.children.length&&e.children.some(e=>e.visible)?(l.push(e),l.push(...getAllConvertColumns(e.children,e))):l.push(e))}),l},convertHeaderColumnToRows=e=>{let t=1,o=(l,e)=>{if(e&&(l.level=e.level+1,t<l.level)&&(t=l.level),l.children&&l.children.length&&l.children.some(e=>e.visible)){let t=0;l.children.forEach(e=>{e.visible&&(o(e,l),t+=e.colSpan)}),l.colSpan=t}else l.colSpan=1},l=(e.forEach(e=>{e.level=1,o(e)}),[]);for(let e=0;e<t;e++)l.push([]);return getAllConvertColumns(e).forEach(e=>{e.children&&e.children.length&&e.children.some(e=>e.visible)?e.rowSpan=1:e.rowSpan=t-e.level+1,l[e.level-1].push(e)}),l};function convertHeaderToGridRows(t){var l=t.length,i=t[0].reduce((e,t)=>e+t.colSpan,0),n=[],a=[];for(let e=0;e<l;e++){var o=[],r=[];for(let e=0;e<i;e++)o.push(!1),r.push("");n.push(o),a.push(r)}for(let r=0;r<l;r++){let e=0;for(var u of t[r]){var{colSpan:s,rowSpan:d}=u;let o=-1;for(let l=e;l<=i-s;l++){let t=!0;for(let e=0;e<s;e++)if(n[r][l+e]){t=!1;break}if(t){o=l;break}}if(-1===o){for(let l=0;l<=i-s;l++){let t=!0;for(let e=0;e<s;e++)if(n[r][l+e]){t=!1;break}if(t){o=l;break}}if(-1===o)break}for(let t=r;t<r+d;t++)for(let e=o;e<o+s;e++)n[t][e]=!0,a[t][e]=u;e=o+s}}return a}function restoreScrollLocation(e,t,l){var o=e;return t||l?(o.intoRunScroll=!1,o.inVirtualScroll=!1,o.inWheelScroll=!1,o.inHeaderScroll=!1,o.inBodyScroll=!1,o.inFooterScroll=!1,o.scrollRenderType="",e.scrollTo(t,l)):e.clearScroll()}function toTreePathSeq(e){return e.map((e,t)=>t%2==0?Number(e)+1:".").join("")}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}function createRowId(e,t,l){e=e.createKeyMethod;return e?""+e({row:t,keyField:l}):getRowUniqueId()}function hasDeepKey(e){return-1<e.indexOf(".")}function getRowkey(e){e=e.currKeyField;return e}function getRowid(e,t){var{isCurrDeepKey:e,currKeyField:l}=e;return t?encodeRowid((e?getDeepRowIdByKey:getFastRowIdByKey)(t,l)):""}function createHandleUpdateRowId(e){let{isCurrDeepKey:t,currKeyField:l}=e,o=e.computeRowOpts,r=t?updateDeepRowKey:updateFastRowKey;return{rowKey:l,handleUpdateRowId(e){return e?r(o,e,l):""}}}function createHandleGetRowId(e){let{isCurrDeepKey:t,currKeyField:l}=e,o=t?getDeepRowIdByKey:getFastRowIdByKey;return{rowKey:l,handleGetRowId(e){return e?encodeRowid(o(e,l)):""}}}function encodeRowid(e){return _xeUtils.default.eqNull(e)?"":encodeURIComponent(e)}function getDeepRowIdByKey(e,t){return _xeUtils.default.get(e,t)}function updateDeepRowKey(e,t,l){let o=encodeRowid(getDeepRowIdByKey(t,l));return(0,_utils.eqEmptyValue)(o)&&(e=createRowId(e,t,l),o=""+e,_xeUtils.default.set(t,l,o)),o}function getFastRowIdByKey(e,t){return e[t]}function updateFastRowKey(e,t,l){let o=encodeRowid(getFastRowIdByKey(t,l));return(0,_utils.eqEmptyValue)(o)&&(e=createRowId(e,t,l),o=""+e,t[l]=e),o}function getPaddingLeftRightSize(e){return e?(e=getComputedStyle(e),_xeUtils.default.toNumber(e.paddingLeft)+_xeUtils.default.toNumber(e.paddingRight)):0}function getElementMarginAndWidth(e){var t,l;return e?(l=getComputedStyle(e),t=_xeUtils.default.toNumber(l.marginLeft),l=_xeUtils.default.toNumber(l.marginRight),e.offsetWidth+t+l):0}function getCalcHeight(e){return"unset"!==e&&e||0}function handleFieldOrColumn(e,t){return t?_xeUtils.default.isString(t)||_xeUtils.default.isNumber(t)?e.getColumnByField(""+t):t:null}function handleRowidOrRow(e,t){return t?(t=_xeUtils.default.isString(t)||_xeUtils.default.isNumber(t)?t:getRowid(e,t),e.getRowById(t)):null}function getCellRestHeight(e,t,l,o){return e.resizeHeight||t.height||l.height||e.height||o}function assembleColumn(e){var t=e.$xeTable,l=t.staticColumns,{$el:e,$xeColumn:o,columnConfig:r}=e,i=o?o.columnConfig:null;i?("vxe-table-column"===o.$options._componentTag?(0,_log.errLog)("vxe.error.groupTag",[`<vxe-table-colgroup title=${o.title} ...>`,`<vxe-table-column title=${o.title} ...>`]):"vxe-column"===o.$options._componentTag&&(0,_log.warnLog)("vxe.error.groupTag",[`<vxe-colgroup title=${o.title} ...>`,`<vxe-column title=${o.title} ...>`]),i.children||(i.children=[]),r.defaultParentId=i.id,i.children.splice(_xeUtils.default.arrayIndexOf(o.$el.children,e),0,r)):l.splice(_xeUtils.default.arrayIndexOf(t.$refs.hideColumn.children,e),0,r)}function destroyColumn(e){var t=e.$xeTable.staticColumns;let l=e.columnConfig;e=_xeUtils.default.findTree(t,e=>e===l);e&&e.items.splice(e.index,1)}function getRootColumn(e,t){var l=e.fullColumnIdData;if(!t)return null;let o=t.parentId;for(;l[o];){let e=l[o].column;if(!(o=e.parentId))return e}return t}function toFilters(e,i){return e&&(_xeUtils.default.isArray(e)?e.map(({label:e,value:t,data:l,resetValue:o,checked:r})=>({label:e,value:t,data:l,resetValue:o,checked:!!r,_checked:!!r,_colId:i})):[])}function getColReMaxWidth(e){var{$table:t,column:l,cell:o}=e,r=t.elemStore,i=t.computeResizableOpts.maxWidth,l=l.maxWidth||t.computeColumnOpts.maxWidth;if(i){t=_xeUtils.default.isFunction(i)?i(e):i;if("auto"!==t)return Math.max(1,_xeUtils.default.toNumber(t))}e=_xeUtils.default.floor(1.8*(_xeUtils.default.toNumber(getComputedStyle(o).fontSize)||14))+(getPaddingLeftRightSize(o)+getPaddingLeftRightSize((0,_dom.queryElement)(o,".vxe-cell")));if(l){i=getRefElem(r["main-body-scroll"]);if(i){if((0,_dom.isScale)(l))return t=(i.clientWidth-1)/100,Math.max(e,Math.floor(_xeUtils.default.toInteger(l)*t));if((0,_dom.isPx)(l))return Math.max(e,_xeUtils.default.toInteger(l))}}return-1}function getColReMinWidth(e){var{$table:t,column:l,cell:o}=e,r=t,i=t,n=t.computeResizableOpts,t=t.computeColumnOpts,n=n.minWidth;if(n){e=_xeUtils.default.isFunction(n)?n(e):n;if("auto"!==e)return Math.max(1,_xeUtils.default.toNumber(e))}var a,u,s,n=i.elemStore,e=r.showHeaderOverflow,i=l.showHeaderOverflow,r=l.minWidth||t.minWidth,l=_xeUtils.default.isUndefined(i)||_xeUtils.default.isNull(i)?e:i,t="title"===l||(!0===l||"tooltip"===l)||"ellipsis"===l;let d=_xeUtils.default.floor(1.8*(_xeUtils.default.toNumber(getComputedStyle(o).fontSize)||14))+(getPaddingLeftRightSize(o)+getPaddingLeftRightSize((0,_dom.queryElement)(o,".vxe-cell")));if(t&&(e=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--drag-handle")),i=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--checkbox")),l=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--required-icon")),t=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--edit-icon")),a=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell-title-prefix-icon")),u=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell-title-suffix-icon")),s=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--sort")),o=getElementMarginAndWidth((0,_dom.queryElement)(o,".vxe-cell--filter")),d+=e+i+l+t+a+u+o+s),r){e=getRefElem(n["main-body-scroll"]);if(e){if((0,_dom.isScale)(r))return i=(e.clientWidth-1)/100,Math.max(d,Math.floor(_xeUtils.default.toInteger(r)*i));if((0,_dom.isPx)(r))return Math.max(d,_xeUtils.default.toInteger(r))}}return d}function getFirstChildColumn(e){var t=e.children;return t&&t.length?getFirstChildColumn(_xeUtils.default.first(t)):e}function getLastChildColumn(e){var t=e.children;return t&&t.length?getFirstChildColumn(_xeUtils.default.last(t)):e}function getCellValue(e,t){return t?_xeUtils.default.get(e,t.field):null}function setCellValue(e,t,l){t&&_xeUtils.default.set(e,t.field,l)}function getRefElem(e){return e?e.$el||e:null}function clearTableDefaultStatus(e){var t=e,l=(e.initStatus=!1,[e.clearSort(),e.clearCurrentRow(),e.clearCurrentColumn(),e.clearRadioRow(),e.clearRadioReserve(),e.clearCheckboxRow(),e.clearCheckboxReserve(),e.clearRowExpand(),e.clearTreeExpand(),e.clearTreeExpandReserve(),e.clearPendingRow()]);return e.clearFilter&&l.push(e.clearFilter()),e.clearSelected&&(t.keyboardConfig||t.mouseConfig)&&l.push(e.clearSelected()),e.clearCellAreas&&t.mouseConfig&&l.push(e.clearCellAreas(),e.clearCopyCellArea()),Promise.all(l).then(()=>e.clearScroll())}function clearTableAllStatus(e){return e.clearFilter&&e.clearFilter(),clearTableDefaultStatus(e)}function isColumnInfo(e){return e instanceof _columnInfo.ColumnInfo}function getColumnList(e){let t=[];return e.forEach(e=>{t.push(...e.children&&e.children.length?getColumnList(e.children):[e])}),t}function createColumn(e,t,l){return isColumnInfo(t)?t:new _columnInfo.ColumnInfo(e,t,l)}function rowToVisible(e,t){var{scrollYLoad:l,scrollYTop:o,isAllOverflow:r}=e,{elemStore:i,afterFullData:n,fullAllDataRowIdData:a,isResizeCellHeight:u}=e,s=e.computeRowOpts,d=e.computeCellOpts,c=e.computeDefaultRowHeight,m=e.computeLeftFixedWidth,g=e.computeRightFixedWidth,i=getRefElem(i["main-body-scroll"]),p=getRowid(e,t);if(i){var f=i.clientHeight,h=i.scrollTop,i=i.querySelector(`[rowid="${p}"]`);if(i){var o=i.offsetTop+(l?o:0),i=i.clientHeight;if(o<h||h+f<o)return e.scrollTo(null,o);if(f+h<=o+i)return e.scrollTo(null,h+i)}else if(l)return u||d.height||s.height||!r?(i=(o=a[p]||{}).resizeHeight||d.height||s.height||o.height||c,(l=o.oTop)<h?e.scrollTo(null,l-m-1):e.scrollTo(null,l+i-(f-g-1))):e.scrollTo(null,(e.findRowIndexOf(n,t)-1)*c)}return Promise.resolve()}function colToVisible(l,o,r,t){var{scrollXLoad:i,scrollXLeft:n}=l,{elemStore:a,visibleColumn:u}=l,s=l.computeLeftFixedWidth,d=l.computeRightFixedWidth,a=getRefElem(a["main-body-scroll"]);if(!r.fixed&&a){var c=a.clientWidth,m=a.scrollLeft;let e=null;if(t&&(t=getRowid(l,t),e=a.querySelector(`[rowid="${t}"] .`+r.id)),e=e||a.querySelector("."+r.id)){t=e.offsetLeft+(i?n:0),a=e.clientWidth;if(o||!(t<=m+s&&m+s<t+a)&&!(m+s<=t&&t<m+c-d)){if(t<m+s)return l.scrollTo(t-s-1);if(c-d<t+a-m)return l.scrollTo(t+a-(c-d-1))}}else if(i){let t=0;n=r.renderWidth;for(let e=0;e<u.length;e++){var g=u[e];if(g===r||g.id===r.id)break;t+=g.renderWidth}if(o||!(t<=m+s&&t+n>m+s)&&!(t>=m+s&&t<m+c-d))return t<m?l.scrollTo(t-s-1):l.scrollTo(t+n-(c-d-1))}}return Promise.resolve()}exports.convertHeaderColumnToRows=convertHeaderColumnToRows;
package/lib/ui/index.js CHANGED
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "VxeUI", {
13
13
  exports.version = exports.validators = exports.use = exports.t = exports.setup = exports.setTheme = exports.setLanguage = exports.setIcon = exports.setI18n = exports.setConfig = exports.saveFile = exports.renderer = exports.readFile = exports.print = exports.modal = exports.menus = exports.log = exports.interceptor = exports.globalResize = exports.globalEvents = exports.getTheme = exports.getIcon = exports.getI18n = exports.getConfig = exports.formats = exports.default = exports.config = exports.commands = exports.clipboard = exports._t = void 0;
14
14
  var _core = require("@vxe-ui/core");
15
15
  var _utils = require("./src/utils");
16
- const version = exports.version = "3.21.5";
16
+ const version = exports.version = "3.21.7";
17
17
  _core.VxeUI.version = version;
18
18
  _core.VxeUI.tableVersion = version;
19
19
  _core.VxeUI.setConfig({
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="3.21.5",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!0,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},currentRowConfig:{strict:!0},currentColumnConfig:{strict:!0},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0,defaultPlacement:"top"},headerTooltipConfig:{enterable:!0},footerTooltipConfig:{enterable:!0},validConfig:{showErrorMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{autoOptions:{isCalcHeader:!0,isCalcBody:!0,isCalcFooter:!0},maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},menuConfig:{destroyOnClose:!0},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showSortDragButton:!0,showFooter:!0,placement:"top-right",storeOptions:{visible:!0,resizable:!0,sort:!0,fixed:!0},modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,allowClear:!0,allowBtn:!0,iconLayout:"vertical"},filterConfig:{destroyOnClose:!0,multiple:!0,showIcon:!0,maxHeight:280},floatingFilterConfig:{},aggregateConfig:{padding:!0,placement:"left",rowField:"id",parentField:"_X_ROW_PARENT_KEY",childrenField:"_X_ROW_CHILDREN",mapChildrenField:"_X_ROW_CHILD_LIST",indent:20,showIcon:!0,maxGroupSize:4,showAggFuncTitle:!0},treeConfig:{padding:!0,rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0,showRootLine:!0},expandConfig:{showIcon:!0,mode:"fixed"},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isAll:!0,isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{gt:24,preSize:0,oSize:0},virtualYConfig:{gt:100,preSize:1,oSize:0},scrollbarConfig:{x:{visible:!0},y:{visible:!0}},undoRedoHistoryConfig:{stackSize:50}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:"list",result:"result",total:"page.total",footerData:"footerData",message:"message"}}},toolbar:{},gantt:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_MENU_OPTION_LOADING:iconPrefix+"repeat roll",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_AGG_GROUP:iconPrefix+"grouping",TABLE_DRAG_STATUS_AGG_VALUES:iconPrefix+"values",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TABLE_ROW_GROUP_OPEN:iconPrefix+"arrow-right rotate90",TABLE_ROW_GROUP_CLOSE:iconPrefix+"arrow-right",TABLE_AGGREGATE_GROUPING:iconPrefix+"grouping",TABLE_AGGREGATE_VALUES:iconPrefix+"values",TABLE_AGGREGATE_SORT:iconPrefix+"drag-handle",TABLE_AGGREGATE_DELETE:iconPrefix+"close",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="3.21.7",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!0,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},currentRowConfig:{strict:!0},currentColumnConfig:{strict:!0},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0,defaultPlacement:"top"},headerTooltipConfig:{enterable:!0},footerTooltipConfig:{enterable:!0},validConfig:{showErrorMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{autoOptions:{isCalcHeader:!0,isCalcBody:!0,isCalcFooter:!0},maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},menuConfig:{destroyOnClose:!0},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showSortDragButton:!0,showFooter:!0,placement:"top-right",storeOptions:{visible:!0,resizable:!0,sort:!0,fixed:!0},modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,allowClear:!0,allowBtn:!0,iconLayout:"vertical"},filterConfig:{destroyOnClose:!0,multiple:!0,showIcon:!0,maxHeight:280},floatingFilterConfig:{},aggregateConfig:{padding:!0,placement:"left",rowField:"id",parentField:"_X_ROW_PARENT_KEY",childrenField:"_X_ROW_CHILDREN",mapChildrenField:"_X_ROW_CHILD_LIST",indent:20,showIcon:!0,maxGroupSize:4,showAggFuncTitle:!0},treeConfig:{padding:!0,rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0,showRootLine:!0},expandConfig:{showIcon:!0,mode:"fixed"},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isAll:!0,isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{gt:24,preSize:0,oSize:0},virtualYConfig:{gt:100,preSize:1,oSize:0},scrollbarConfig:{x:{visible:!0},y:{visible:!0}},undoRedoHistoryConfig:{stackSize:50}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:"list",result:"result",total:"page.total",footerData:"footerData",message:"message"}}},toolbar:{},gantt:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_MENU_OPTION_LOADING:iconPrefix+"repeat roll",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_AGG_GROUP:iconPrefix+"grouping",TABLE_DRAG_STATUS_AGG_VALUES:iconPrefix+"values",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TABLE_ROW_GROUP_OPEN:iconPrefix+"arrow-right rotate90",TABLE_ROW_GROUP_CLOSE:iconPrefix+"arrow-right",TABLE_AGGREGATE_GROUPING:iconPrefix+"grouping",TABLE_AGGREGATE_VALUES:iconPrefix+"values",TABLE_AGGREGATE_SORT:iconPrefix+"drag-handle",TABLE_AGGREGATE_DELETE:iconPrefix+"close",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
package/lib/ui/src/log.js CHANGED
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
8
8
  const {
9
9
  log
10
10
  } = _core.VxeUI;
11
- const version = `table v${"3.21.5"}`;
11
+ const version = `table v${"3.21.7"}`;
12
12
  const warnLog = exports.warnLog = log.create('warn', version);
13
13
  const errLog = exports.errLog = log.create('error', version);
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.21.5",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.21.7",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.21.5",
3
+ "version": "3.21.7",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -68,7 +68,7 @@
68
68
  "vue-i18n": "^8.15.1",
69
69
  "vue-router": "^3.5.1",
70
70
  "vue-template-compiler": "2.6.14",
71
- "vxe-pc-ui": "3.14.25"
71
+ "vxe-pc-ui": "3.14.29"
72
72
  },
73
73
  "vetur": {
74
74
  "tags": "helper/vetur/tags.json",
@@ -363,25 +363,11 @@ function renderTdColumn (
363
363
  }, column.renderCell(h, cellParams))
364
364
  )
365
365
  }
366
- tdVNs.push(
367
- h('div', {
368
- key: 'tc',
369
- class: ['vxe-cell', {
370
- 'c--title': showTitle,
371
- 'c--tooltip': showTooltip,
372
- 'c--ellipsis': showEllipsis
373
- }],
374
- style: tcStyle,
375
- attrs: {
376
- title: showTitle ? $xeTable.getCellLabel(row, column) : null
377
- }
378
- }, clVNs)
379
- )
380
366
  if (showValidTip && errorValidItem) {
381
367
  const errRule = errorValidItem.rule
382
368
  const validSlot = slots ? slots.valid : null
383
369
  const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem }
384
- tdVNs.push(
370
+ clVNs.push(
385
371
  h('div', {
386
372
  key: 'tcv',
387
373
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
@@ -405,6 +391,20 @@ function renderTdColumn (
405
391
  ])
406
392
  )
407
393
  }
394
+ tdVNs.push(
395
+ h('div', {
396
+ key: 'tc',
397
+ class: ['vxe-cell', {
398
+ 'c--title': showTitle,
399
+ 'c--tooltip': showTooltip,
400
+ 'c--ellipsis': showEllipsis
401
+ }],
402
+ style: tcStyle,
403
+ attrs: {
404
+ title: showTitle ? $xeTable.getCellLabel(row, column) : null
405
+ }
406
+ }, clVNs)
407
+ )
408
408
  }
409
409
 
410
410
  let showAreaRowStatus = false
@@ -39,11 +39,15 @@ export default /* define-vxe-component start */ defineVxeComponent({
39
39
  const { $scopedSlots } = this
40
40
  const columnSlots: {
41
41
  header?: any
42
+ title?: any
42
43
  } = {}
43
44
 
44
45
  if ($scopedSlots.header) {
45
46
  columnSlots.header = $scopedSlots.header
46
47
  }
48
+ if ($scopedSlots.title) {
49
+ columnSlots.title = $scopedSlots.title
50
+ }
47
51
  this.columnConfig.slots = columnSlots
48
52
  assembleColumn($xeColgroup)
49
53
  },
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLe
3
3
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
4
4
  import { VxeUI } from '../../ui'
5
5
  import Cell from './cell'
6
- import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn } from './util'
6
+ import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
9
9
  import { warnLog, errLog } from '../../ui/src/log'
@@ -432,13 +432,22 @@ function updateScrollXStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMet
432
432
  return scrollXLoad
433
433
  }
434
434
 
435
+ function syncGanttScrollYStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
436
+ const reactData = $xeTable as unknown as TableReactData
437
+ const internalData = $xeTable as unknown as TableInternalData
438
+
439
+ const $xeGanttView = internalData.xeGanttView
440
+ if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
441
+ $xeGanttView.handleUpdateSYStatus(reactData.scrollYLoad)
442
+ }
443
+ }
444
+
435
445
  function updateScrollYStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, fullData?: any[]) {
436
446
  const props = $xeTable
437
447
  const reactData = $xeTable as unknown as TableReactData
438
448
  const internalData = $xeTable as unknown as TableInternalData
439
449
 
440
450
  const { treeConfig } = props
441
- const $xeGanttView = internalData.xeGanttView
442
451
  const virtualYOpts = $xeTable.computeVirtualYOpts
443
452
  const treeOpts = $xeTable.computeTreeOpts
444
453
  const { transform } = treeOpts
@@ -446,9 +455,7 @@ function updateScrollYStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMet
446
455
  // 如果gt为0,则总是启用
447
456
  const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length)
448
457
  reactData.scrollYLoad = scrollYLoad
449
- if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
450
- $xeGanttView.handleUpdateSYStatus(scrollYLoad)
451
- }
458
+ syncGanttScrollYStatus($xeTable)
452
459
  return scrollYLoad
453
460
  }
454
461
 
@@ -1004,6 +1011,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1004
1011
  const props = $xeTable
1005
1012
  const reactData = $xeTable as unknown as TableReactData
1006
1013
  const internalData = $xeTable as unknown as TableInternalData
1014
+ const $xeGantt = $xeTable.$xeGantt
1007
1015
 
1008
1016
  const { mouseConfig } = props
1009
1017
  const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
@@ -1044,7 +1052,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1044
1052
  }
1045
1053
 
1046
1054
  let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
1047
- if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
1055
+ if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
1048
1056
  osbWidth = 0
1049
1057
  yScrollbarVisible = 'hidden'
1050
1058
  } else if (scrollbarYConf.visible === 'visible') {
@@ -2418,6 +2426,7 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
2418
2426
  if (!xHandleEl) {
2419
2427
  return
2420
2428
  }
2429
+ const columnOpts = $xeTable.computeColumnOpts
2421
2430
  let tWidth = 0
2422
2431
  const minCellWidth = 40 // 列宽最少限制 40px
2423
2432
  const bodyWidth = bodyWrapperElem.clientWidth
@@ -2426,53 +2435,92 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
2426
2435
  const { fit } = props
2427
2436
  const { columnStore } = reactData
2428
2437
  const { resizeList, pxMinList, autoMinList, pxList, scaleList, scaleMinList, autoList, remainList } = columnStore
2438
+
2439
+ const parseColumnMaxWidth = (column: VxeTableDefines.ColumnInfo) => {
2440
+ const maxWidth = column.maxWidth || columnOpts.maxWidth
2441
+ if (maxWidth && maxWidth !== 'auto') {
2442
+ if (isScale(maxWidth)) {
2443
+ return Math.floor(XEUtils.toInteger(maxWidth) * meanWidth)
2444
+ }
2445
+ return XEUtils.toInteger(maxWidth)
2446
+ }
2447
+ return 0
2448
+ }
2449
+
2429
2450
  // 最小宽
2430
2451
  pxMinList.forEach((column) => {
2431
- const minWidth = XEUtils.toInteger(column.minWidth)
2432
- tWidth += minWidth
2433
- column.renderWidth = minWidth
2452
+ let miWidth = XEUtils.toInteger(column.minWidth)
2453
+ const mxWidth = parseColumnMaxWidth(column)
2454
+ if (mxWidth) {
2455
+ miWidth = Math.min(miWidth, mxWidth)
2456
+ }
2457
+ tWidth += miWidth
2458
+ column.renderWidth = miWidth
2434
2459
  })
2435
2460
  // 最小自适应
2436
2461
  autoMinList.forEach((column) => {
2437
- const scaleWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
2438
- tWidth += scaleWidth
2439
- column.renderWidth = scaleWidth
2462
+ let caWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
2463
+ const mxWidth = parseColumnMaxWidth(column)
2464
+ if (mxWidth) {
2465
+ caWidth = Math.min(caWidth, mxWidth)
2466
+ }
2467
+ tWidth += caWidth
2468
+ column.renderWidth = caWidth
2440
2469
  })
2441
2470
  // 最小百分比
2442
2471
  scaleMinList.forEach((column) => {
2443
- const scaleWidth = Math.floor(XEUtils.toInteger(column.minWidth) * meanWidth)
2444
- tWidth += scaleWidth
2445
- column.renderWidth = scaleWidth
2472
+ let smWidth = Math.floor(XEUtils.toInteger(column.minWidth) * meanWidth)
2473
+ const mxWidth = parseColumnMaxWidth(column)
2474
+ if (mxWidth) {
2475
+ smWidth = Math.min(smWidth, mxWidth)
2476
+ }
2477
+ tWidth += smWidth
2478
+ column.renderWidth = smWidth
2446
2479
  })
2447
2480
  // 固定百分比
2448
2481
  scaleList.forEach((column) => {
2449
- const scaleWidth = Math.floor(XEUtils.toInteger(column.width) * meanWidth)
2450
- tWidth += scaleWidth
2451
- column.renderWidth = scaleWidth
2482
+ let sfWidth = Math.floor(XEUtils.toInteger(column.width) * meanWidth)
2483
+ const mxWidth = parseColumnMaxWidth(column)
2484
+ if (mxWidth) {
2485
+ sfWidth = Math.min(sfWidth, mxWidth)
2486
+ }
2487
+ tWidth += sfWidth
2488
+ column.renderWidth = sfWidth
2452
2489
  })
2453
2490
  // 固定宽
2454
2491
  pxList.forEach((column) => {
2455
- const width = XEUtils.toInteger(column.width)
2456
- tWidth += width
2457
- column.renderWidth = width
2492
+ let pWidth = XEUtils.toInteger(column.width)
2493
+ const mxWidth = parseColumnMaxWidth(column)
2494
+ if (mxWidth) {
2495
+ pWidth = Math.min(pWidth, mxWidth)
2496
+ }
2497
+ tWidth += pWidth
2498
+ column.renderWidth = pWidth
2458
2499
  })
2459
2500
  // 自适应宽
2460
2501
  autoList.forEach((column) => {
2461
- const width = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
2462
- tWidth += width
2463
- column.renderWidth = width
2502
+ let aWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
2503
+ const mxWidth = parseColumnMaxWidth(column)
2504
+ if (mxWidth) {
2505
+ aWidth = Math.min(aWidth, mxWidth)
2506
+ }
2507
+ tWidth += aWidth
2508
+ column.renderWidth = aWidth
2464
2509
  })
2510
+
2465
2511
  // 调整了列宽
2466
2512
  resizeList.forEach((column) => {
2467
2513
  const width = XEUtils.toInteger(column.resizeWidth)
2468
2514
  tWidth += width
2469
2515
  column.renderWidth = width
2470
2516
  })
2517
+
2518
+ const zoomColumnList = scaleMinList.concat(pxMinList).concat(autoMinList).filter(column => !parseColumnMaxWidth(column))
2471
2519
  remainWidth -= tWidth
2472
- meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0
2520
+ meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (zoomColumnList.length + remainList.length)) : 0
2473
2521
  if (fit) {
2474
2522
  if (remainWidth > 0) {
2475
- scaleMinList.concat(pxMinList).concat(autoMinList).forEach((column) => {
2523
+ zoomColumnList.forEach((column) => {
2476
2524
  tWidth += meanWidth
2477
2525
  column.renderWidth += meanWidth
2478
2526
  })
@@ -2490,8 +2538,9 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
2490
2538
  /**
2491
2539
  * 偏移量算法
2492
2540
  * 如果所有列足够放的情况下,从最后动态列开始分配
2541
+ * 排除已设置 max-width
2493
2542
  */
2494
- const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList)
2543
+ const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList).filter(column => !parseColumnMaxWidth(column))
2495
2544
  let dynamicSize = dynamicList.length - 1
2496
2545
  if (dynamicSize > 0) {
2497
2546
  let i = bodyWidth - tWidth
@@ -3561,6 +3610,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3561
3610
  updateStyle($xeTable)
3562
3611
  }).then(() => {
3563
3612
  computeScrollLoad($xeTable)
3613
+ syncGanttScrollYStatus($xeTable)
3564
3614
  }).then(() => {
3565
3615
  const virtualYOpts = $xeTable.computeVirtualYOpts
3566
3616
  // 是否启用了虚拟滚动
@@ -3623,6 +3673,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3623
3673
  reactData.isRowLoading = false
3624
3674
  handleRecalculateStyle($xeTable, false, false, false)
3625
3675
  updateTreeLineStyle($xeTable)
3676
+ syncGanttScrollYStatus($xeTable)
3626
3677
  // 如果是自动行高,特殊情况需调用 recalculate 手动刷新
3627
3678
  if (!props.showOverflow) {
3628
3679
  setTimeout(() => {
@@ -6773,6 +6824,7 @@ const tableMethods: any = {
6773
6824
  const dragPosLeft = dragBtnRect.x - tableRect.x + dragBtnOffsetWidth
6774
6825
 
6775
6826
  const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth // 列之间的最小间距
6827
+ const maxInterval = getColReMaxWidth(cellParams) // 列之间的最大间距
6776
6828
  const dragMinLeft = isRightFixed ? 0 : (cellRect.x - tableRect.x + dragBtnWidth + minInterval)
6777
6829
  const dragMaxLeft = cellRect.x - tableRect.x + cell.clientWidth - minInterval
6778
6830
 
@@ -6814,6 +6866,10 @@ const tableMethods: any = {
6814
6866
  }
6815
6867
 
6816
6868
  dragLeft = Math.max(left, dragMinLeft)
6869
+ // 最大宽
6870
+ if (maxInterval > 1) {
6871
+ dragLeft = Math.min(dragLeft, maxInterval + dragMinLeft - minInterval)
6872
+ }
6817
6873
 
6818
6874
  const resizeBarLeft = Math.max(1, dragLeft)
6819
6875
  resizeBarElem.style.left = `${resizeBarLeft}px`
@@ -6901,6 +6957,7 @@ const tableMethods: any = {
6901
6957
  const cell = dragBtnElem.parentNode as HTMLTableCellElement
6902
6958
  const cellParams = Object.assign(params, { cell, $table: $xeTable })
6903
6959
  const colMinWidth = getColReMinWidth(cellParams)
6960
+ const colMaxWidth = getColReMaxWidth(cellParams)
6904
6961
 
6905
6962
  el.setAttribute('data-calc-col', 'Y')
6906
6963
  let resizeWidth = calcColumnAutoWidth($xeTable, resizeColumn, el)
@@ -6909,6 +6966,9 @@ const tableMethods: any = {
6909
6966
  resizeWidth = Math.max(resizeWidth, colRest.width)
6910
6967
  }
6911
6968
  resizeWidth = Math.max(colMinWidth, resizeWidth)
6969
+ if (colMaxWidth > 1) {
6970
+ resizeWidth = Math.min(colMaxWidth, resizeWidth)
6971
+ }
6912
6972
  const resizeParams = { ...params, resizeWidth, resizeColumn }
6913
6973
  reactData.isDragResize = false
6914
6974
  internalData._lastResizeTime = Date.now()
@@ -7956,8 +8016,15 @@ const tableMethods: any = {
7956
8016
  },
7957
8017
  handleGlobalPasteEvent (evnt: any) {
7958
8018
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8019
+ const props = $xeTable
8020
+ const internalData = $xeTable as unknown as TableInternalData
8021
+ const reactData = $xeTable as unknown as TableReactData
7959
8022
 
7960
- const { isActivated, keyboardConfig, keyboardOpts, mouseConfig, mouseOpts, editStore, filterStore } = this
8023
+ const { keyboardConfig, mouseConfig } = props
8024
+ const { editStore, filterStore } = reactData
8025
+ const { isActivated } = internalData
8026
+ const mouseOpts = $xeTable.computeMouseOpts
8027
+ const keyboardOpts = $xeTable.computeKeyboardOpts
7961
8028
  const { actived } = editStore
7962
8029
  if (isActivated && !filterStore.visible) {
7963
8030
  if (!(actived.row || actived.column)) {
@@ -7970,8 +8037,15 @@ const tableMethods: any = {
7970
8037
  },
7971
8038
  handleGlobalCopyEvent (evnt: any) {
7972
8039
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8040
+ const props = $xeTable
8041
+ const internalData = $xeTable as unknown as TableInternalData
8042
+ const reactData = $xeTable as unknown as TableReactData
7973
8043
 
7974
- const { isActivated, keyboardConfig, keyboardOpts, mouseConfig, mouseOpts, editStore, filterStore } = this
8044
+ const { keyboardConfig, mouseConfig } = props
8045
+ const { editStore, filterStore } = reactData
8046
+ const { isActivated } = internalData
8047
+ const mouseOpts = $xeTable.computeMouseOpts
8048
+ const keyboardOpts = $xeTable.computeKeyboardOpts
7975
8049
  const { actived } = editStore
7976
8050
  if (isActivated && !filterStore.visible) {
7977
8051
  if (!(actived.row || actived.column)) {
@@ -7984,8 +8058,15 @@ const tableMethods: any = {
7984
8058
  },
7985
8059
  handleGlobalCutEvent (evnt: any) {
7986
8060
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8061
+ const props = $xeTable
8062
+ const internalData = $xeTable as unknown as TableInternalData
8063
+ const reactData = $xeTable as unknown as TableReactData
7987
8064
 
7988
- const { isActivated, keyboardConfig, keyboardOpts, mouseConfig, mouseOpts, editStore, filterStore } = this
8065
+ const { keyboardConfig, mouseConfig } = props
8066
+ const { editStore, filterStore } = reactData
8067
+ const { isActivated } = internalData
8068
+ const mouseOpts = $xeTable.computeMouseOpts
8069
+ const keyboardOpts = $xeTable.computeKeyboardOpts
7989
8070
  const { actived } = editStore
7990
8071
  if (isActivated && !filterStore.visible) {
7991
8072
  if (!(actived.row || actived.column)) {
@@ -12701,10 +12782,10 @@ const tableMethods: any = {
12701
12782
  return updateStyle($xeTable)
12702
12783
  })
12703
12784
  },
12704
- updateScrollYStatus () {
12785
+ updateScrollYStatus (fullData: any[]) {
12705
12786
  const $xeTable = this
12706
12787
 
12707
- return updateScrollYStatus($xeTable)
12788
+ return updateScrollYStatus($xeTable, fullData)
12708
12789
  },
12709
12790
  /**
12710
12791
  * 如果有滚动条,则滚动到对应的位置