vxe-table 4.20.7 → 4.20.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +57 -33
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +11 -0
- package/es/style.css +1 -1
- package/es/table/src/body.js +3 -3
- package/es/table/src/cell.js +2 -2
- package/es/table/src/footer.js +3 -3
- package/es/table/src/header.js +3 -3
- package/es/table/src/table.js +26 -19
- package/es/table/src/util.js +5 -1
- package/es/ui/index.js +3 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +15 -0
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +51 -27
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +3 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +2 -2
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +3 -3
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -3
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +16 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +5 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +3 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +11 -0
- package/packages/table/src/body.ts +3 -3
- package/packages/table/src/cell.ts +2 -2
- package/packages/table/src/footer.ts +3 -3
- package/packages/table/src/header.ts +3 -3
- package/packages/table/src/table.ts +26 -19
- package/packages/table/src/util.ts +5 -1
- package/packages/ui/index.ts +2 -0
- /package/es/{iconfont.1784868296497.ttf → iconfont.1785140083044.ttf} +0 -0
- /package/es/{iconfont.1784868296497.woff → iconfont.1785140083044.woff} +0 -0
- /package/es/{iconfont.1784868296497.woff2 → iconfont.1785140083044.woff2} +0 -0
- /package/lib/{iconfont.1784868296497.ttf → iconfont.1785140083044.ttf} +0 -0
- /package/lib/{iconfont.1784868296497.woff → iconfont.1785140083044.woff} +0 -0
- /package/lib/{iconfont.1784868296497.woff2 → iconfont.1785140083044.woff2} +0 -0
package/lib/table/src/util.js
CHANGED
|
@@ -191,6 +191,8 @@ function createInternalData() {
|
|
|
191
191
|
tooltipTimeout: null,
|
|
192
192
|
initStatus: false,
|
|
193
193
|
isActivated: false,
|
|
194
|
+
// rceTimeout: undefined,
|
|
195
|
+
// rceRunTime: undefined,
|
|
194
196
|
rceDelay: 0
|
|
195
197
|
// _sToTime: null
|
|
196
198
|
};
|
|
@@ -1172,6 +1174,7 @@ function handleCustomStoreConfig($xeTable) {
|
|
|
1172
1174
|
const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom);
|
|
1173
1175
|
const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
1174
1176
|
const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
1177
|
+
const isCustomPager = hangleBolleanDefaultValue(storageOpts.pager, isAllCustom);
|
|
1175
1178
|
return {
|
|
1176
1179
|
isCustomAlign,
|
|
1177
1180
|
isCustomHeaderAlign,
|
|
@@ -1181,6 +1184,7 @@ function handleCustomStoreConfig($xeTable) {
|
|
|
1181
1184
|
isCustomFixed,
|
|
1182
1185
|
isCustomSort,
|
|
1183
1186
|
isCustomAggGroup,
|
|
1184
|
-
isCustomAggFunc
|
|
1187
|
+
isCustomAggFunc,
|
|
1188
|
+
isCustomPager
|
|
1185
1189
|
};
|
|
1186
1190
|
}
|
|
@@ -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.getColReMaxWidth=getColReMaxWidth,exports.getColReMinWidth=getColReMinWidth,exports.getColumnList=getColumnList,exports.getFirstChildColumn=getFirstChildColumn,exports.getLastChildColumn=getLastChildColumn,exports.getRefElem=getRefElem,exports.getRootColumn=getRootColumn,exports.getRowMaxHeight=getRowMaxHeight,exports.getRowUniqueId=getRowUniqueId,exports.getRowid=getRowid,exports.getRowkey=getRowkey,exports.handleCustomStoreConfig=handleCustomStoreConfig,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,exports.watchColumn=watchColumn;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_columnInfo=require("./columnInfo"),_dom=require("../../ui/src/dom"),_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:{},fullCellHeightMaps:{},fullCellStoreMaps:{},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,rceDelay:0}}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,defPopupStyle:{},panePopupStyle:{},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:{xlarge:54,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 maxKey="__max";function getRowMaxHeight(t,e){if(!e&&t[maxKey])return t[maxKey];{let e=0;for(var l in t){var o=t[l];l!==maxKey&&_xeUtils.default.isNumber(o)&&o>e&&(e=o)}return t[maxKey]=e}}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,a=t[0].reduce((e,t)=>e+t.colSpan,0),i=[],n=[];for(let e=0;e<l;e++){var o=[],r=[];for(let e=0;e<a;e++)o.push(!1),r.push("");i.push(o),n.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<=a-s;l++){let t=!0;for(let e=0;e<s;e++)if(i[r][l+e]){t=!1;break}if(t){o=l;break}}if(-1===o){for(let l=0;l<=a-s;l++){let t=!0;for(let e=0;e<s;e++)if(i[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++)i[t][e]=!0,n[t][e]=u;e=o+s}}return n}function restoreScrollLocation(e,t,l){var o=e.internalData;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 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.internalData.currKeyField;return e}function getRowid(e,t){var{isCurrDeepKey:e,currKeyField:l}=e.internalData;return t?encodeRowid((e?getDeepRowIdByKey:getFastRowIdByKey)(t,l)):""}function createHandleUpdateRowId(e){let{isCurrDeepKey:t,currKeyField:l}=e.internalData;e=e.getComputeMaps().computeRowOpts;let o=e.value,r=t?updateDeepRowKey:updateFastRowKey;return{rowKey:l,handleUpdateRowId(e){return e?r(o,e,l):""}}}function createHandleGetRowId(e){let{isCurrDeepKey:t,currKeyField:l}=e.internalData,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 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 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 toFilters(e,a){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:a})):[])}function toTreePathSeq(e){return e.map((e,t)=>t%2==0?Number(e)+1:".").join("")}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){if(e){e=e.value;if(e)return e.$el||e}return null}function getCalcHeight(e){return"unset"!==e&&e||0}function getColReMaxWidth(e){var{$table:t,column:l,cell:o}=e,r=t.internalData.elemStore,{computeColumnOpts:t,computeResizableOpts:a}=t.getComputeMaps(),a=a.value,t=t.value,a=a.maxWidth,l=l.maxWidth||t.maxWidth;if(a){t=_xeUtils.default.isFunction(a)?a(e):a;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){a=getRefElem(r["main-body-scroll"]);if(a){if((0,_dom.isScale)(l))return t=(a.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.props,a=t.internalData,{computeColumnOpts:t,computeResizableOpts:i}=t.getComputeMaps(),i=i.value,t=t.value,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,u,s,i=a.elemStore,e=r.showHeaderOverflow,a=l.showHeaderOverflow,r=l.minWidth||t.minWidth,l=_xeUtils.default.isUndefined(a)||_xeUtils.default.isNull(a)?e:a,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")),a=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")),n=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+a+l+t+n+u+o+s),r){e=getRefElem(i["main-body-scroll"]);if(e){if((0,_dom.isScale)(r))return a=(e.clientWidth-1)/100,Math.max(d,Math.floor(_xeUtils.default.toInteger(r)*a));if((0,_dom.isPx)(r))return Math.max(d,_xeUtils.default.toInteger(r))}}return d}function isColumnInfo(e){return e&&(e.constructor===_columnInfo.ColumnInfo||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:(0,_vue.reactive)(new _columnInfo.ColumnInfo(e,t,l))}function watchColumn(l,e,o){Object.keys(e).forEach(t=>{(0,_vue.watch)(()=>e[t],e=>{o.update(t,e),l&&("filters"===t?(l.setFilter(o,e),l.handleUpdateDataQueue()):["visible","fixed","width","minWidth","maxWidth"].includes(t)&&l.handleRefreshColumnQueue())})})}function assembleColumn(e,t,l,o){var e=e.reactData,r=e.staticColumns,a=t.parentNode,o=o?o.columnConfig:null,i=o?o.children:r;a&&i&&(l.defaultParentId=o?o.id:null,i.splice(_xeUtils.default.arrayIndexOf(a.children,t),0,l),e.staticColumns=r.slice(0))}function destroyColumn(e,t){var e=e.reactData,l=e.staticColumns,o=_xeUtils.default.findTree(l,e=>e.id===t.id,{children:"children"});o&&o.items.splice(o.index,1),e.staticColumns=l.slice(0)}function getRootColumn(e,t){var e=e.internalData,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 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 clearTableDefaultStatus(e){var{props:t,internalData:l}=e,l=(l.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 rowToVisible(e,t){var l=e.reactData,o=e.internalData,{computeLeftFixedWidth:r,computeRightFixedWidth:a,computeRowOpts:i,computeCellOpts:n,computeDefaultRowHeight:u}=e.getComputeMaps(),{scrollYLoad:l,scrollYTop:s,isAllOverflow:d}=l,{elemStore:o,afterFullData:c,fullAllDataRowIdData:m,isResizeCellHeight:g}=o,i=i.value,n=n.value,u=u.value,r=r.value,a=a.value,o=getRefElem(o["main-body-scroll"]),p=getRowid(e,t);if(o){var f=o.clientHeight,h=o.scrollTop,o=o.querySelector(`[rowid="${p}"]`);if(o){var s=o.offsetTop+(l?s:0),o=o.clientHeight;if(s<h||h+f<s)return e.scrollTo(null,s);if(f+h<=s+o)return e.scrollTo(null,h+o)}else if(l)return g||n.height||i.height||!d?(o=(s=m[p]||{}).resizeHeight||n.height||i.height||s.height||u,(l=s.oTop)<h?e.scrollTo(null,l-r-1):e.scrollTo(null,l+o-(f-a-1))):e.scrollTo(null,(e.findRowIndexOf(c,t)-1)*u)}return Promise.resolve()}function colToVisible(l,o,r,t){var a=l.reactData,i=l.internalData,{computeLeftFixedWidth:n,computeRightFixedWidth:u}=l.getComputeMaps(),{scrollXLoad:a,scrollXLeft:s}=a,{elemStore:i,visibleColumn:d}=i,n=n.value,u=u.value,i=getRefElem(i["main-body-scroll"]);if(!r.fixed&&i){var c=i.clientWidth,m=i.scrollLeft;let e=null;if(t&&(t=getRowid(l,t),e=i.querySelector(`[rowid="${t}"] .`+r.id)),e=e||i.querySelector("."+r.id)){t=e.offsetLeft+(a?s:0),i=e.clientWidth;if(o||!(t<=m+n&&m+n<t+i)&&!(m+n<=t&&t<m+c-u)){if(t<m+n)return l.scrollTo(t-n-1);if(c-u<t+i-m)return l.scrollTo(t+i-(c-u-1))}}else if(a){let t=0;s=r.renderWidth;for(let e=0;e<d.length;e++){var g=d[e];if(g===r||g.id===r.id)break;t+=g.renderWidth}if(o||!(t<=m+n&&t+s>m+n)&&!(t>=m+n&&t<m+c-u))return t<m?l.scrollTo(t-n-1):l.scrollTo(t+s-(c-u-1))}}return Promise.resolve()}function hangleBolleanDefaultValue(e,t){return _xeUtils.default.isBoolean(e)?e:t}function handleCustomStoreConfig(e){var e=e.getComputeMaps().computeCustomOpts,{storage:e,storeOptions:t}=e.value,l=!0===e,e=Object.assign({},!l&&e||{},t);return{isCustomAlign:hangleBolleanDefaultValue(e.align,l),isCustomHeaderAlign:hangleBolleanDefaultValue(e.headerAlign,l),isCustomFooterAlign:hangleBolleanDefaultValue(e.footerAlign,l),isCustomResizable:hangleBolleanDefaultValue(e.resizable,l),isCustomVisible:hangleBolleanDefaultValue(e.visible,l),isCustomFixed:hangleBolleanDefaultValue(e.fixed,l),isCustomSort:hangleBolleanDefaultValue(e.sort,l),isCustomAggGroup:hangleBolleanDefaultValue(e.aggGroup,l),isCustomAggFunc:hangleBolleanDefaultValue(e.aggFunc,l)}}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.getRowMaxHeight=getRowMaxHeight,exports.getRowUniqueId=getRowUniqueId,exports.getRowid=getRowid,exports.getRowkey=getRowkey,exports.handleCustomStoreConfig=handleCustomStoreConfig,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,exports.watchColumn=watchColumn;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_columnInfo=require("./columnInfo"),_dom=require("../../ui/src/dom"),_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:{},fullCellHeightMaps:{},fullCellStoreMaps:{},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,rceDelay:0}}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,defPopupStyle:{},panePopupStyle:{},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:{xlarge:54,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 maxKey="__max";function getRowMaxHeight(t,e){if(!e&&t[maxKey])return t[maxKey];{let e=0;for(var l in t){var o=t[l];l!==maxKey&&_xeUtils.default.isNumber(o)&&o>e&&(e=o)}return t[maxKey]=e}}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,a=t[0].reduce((e,t)=>e+t.colSpan,0),i=[],n=[];for(let e=0;e<l;e++){var o=[],r=[];for(let e=0;e<a;e++)o.push(!1),r.push("");i.push(o),n.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<=a-s;l++){let t=!0;for(let e=0;e<s;e++)if(i[r][l+e]){t=!1;break}if(t){o=l;break}}if(-1===o){for(let l=0;l<=a-s;l++){let t=!0;for(let e=0;e<s;e++)if(i[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++)i[t][e]=!0,n[t][e]=u;e=o+s}}return n}function restoreScrollLocation(e,t,l){var o=e.internalData;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 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.internalData.currKeyField;return e}function getRowid(e,t){var{isCurrDeepKey:e,currKeyField:l}=e.internalData;return t?encodeRowid((e?getDeepRowIdByKey:getFastRowIdByKey)(t,l)):""}function createHandleUpdateRowId(e){let{isCurrDeepKey:t,currKeyField:l}=e.internalData;e=e.getComputeMaps().computeRowOpts;let o=e.value,r=t?updateDeepRowKey:updateFastRowKey;return{rowKey:l,handleUpdateRowId(e){return e?r(o,e,l):""}}}function createHandleGetRowId(e){let{isCurrDeepKey:t,currKeyField:l}=e.internalData,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 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 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 toFilters(e,a){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:a})):[])}function toTreePathSeq(e){return e.map((e,t)=>t%2==0?Number(e)+1:".").join("")}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){if(e){e=e.value;if(e)return e.$el||e}return null}function getCalcHeight(e){return"unset"!==e&&e||0}function getColReMaxWidth(e){var{$table:t,column:l,cell:o}=e,r=t.internalData.elemStore,{computeColumnOpts:t,computeResizableOpts:a}=t.getComputeMaps(),a=a.value,t=t.value,a=a.maxWidth,l=l.maxWidth||t.maxWidth;if(a){t=_xeUtils.default.isFunction(a)?a(e):a;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){a=getRefElem(r["main-body-scroll"]);if(a){if((0,_dom.isScale)(l))return t=(a.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.props,a=t.internalData,{computeColumnOpts:t,computeResizableOpts:i}=t.getComputeMaps(),i=i.value,t=t.value,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,u,s,i=a.elemStore,e=r.showHeaderOverflow,a=l.showHeaderOverflow,r=l.minWidth||t.minWidth,l=_xeUtils.default.isUndefined(a)||_xeUtils.default.isNull(a)?e:a,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")),a=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")),n=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+a+l+t+n+u+o+s),r){e=getRefElem(i["main-body-scroll"]);if(e){if((0,_dom.isScale)(r))return a=(e.clientWidth-1)/100,Math.max(d,Math.floor(_xeUtils.default.toInteger(r)*a));if((0,_dom.isPx)(r))return Math.max(d,_xeUtils.default.toInteger(r))}}return d}function isColumnInfo(e){return e&&(e.constructor===_columnInfo.ColumnInfo||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:(0,_vue.reactive)(new _columnInfo.ColumnInfo(e,t,l))}function watchColumn(l,e,o){Object.keys(e).forEach(t=>{(0,_vue.watch)(()=>e[t],e=>{o.update(t,e),l&&("filters"===t?(l.setFilter(o,e),l.handleUpdateDataQueue()):["visible","fixed","width","minWidth","maxWidth"].includes(t)&&l.handleRefreshColumnQueue())})})}function assembleColumn(e,t,l,o){var e=e.reactData,r=e.staticColumns,a=t.parentNode,o=o?o.columnConfig:null,i=o?o.children:r;a&&i&&(l.defaultParentId=o?o.id:null,i.splice(_xeUtils.default.arrayIndexOf(a.children,t),0,l),e.staticColumns=r.slice(0))}function destroyColumn(e,t){var e=e.reactData,l=e.staticColumns,o=_xeUtils.default.findTree(l,e=>e.id===t.id,{children:"children"});o&&o.items.splice(o.index,1),e.staticColumns=l.slice(0)}function getRootColumn(e,t){var e=e.internalData,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 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 clearTableDefaultStatus(e){var{props:t,internalData:l}=e,l=(l.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 rowToVisible(e,t){var l=e.reactData,o=e.internalData,{computeLeftFixedWidth:r,computeRightFixedWidth:a,computeRowOpts:i,computeCellOpts:n,computeDefaultRowHeight:u}=e.getComputeMaps(),{scrollYLoad:l,scrollYTop:s,isAllOverflow:d}=l,{elemStore:o,afterFullData:c,fullAllDataRowIdData:m,isResizeCellHeight:g}=o,i=i.value,n=n.value,u=u.value,r=r.value,a=a.value,o=getRefElem(o["main-body-scroll"]),p=getRowid(e,t);if(o){var f=o.clientHeight,h=o.scrollTop,o=o.querySelector(`[rowid="${p}"]`);if(o){var s=o.offsetTop+(l?s:0),o=o.clientHeight;if(s<h||h+f<s)return e.scrollTo(null,s);if(f+h<=s+o)return e.scrollTo(null,h+o)}else if(l)return g||n.height||i.height||!d?(o=(s=m[p]||{}).resizeHeight||n.height||i.height||s.height||u,(l=s.oTop)<h?e.scrollTo(null,l-r-1):e.scrollTo(null,l+o-(f-a-1))):e.scrollTo(null,(e.findRowIndexOf(c,t)-1)*u)}return Promise.resolve()}function colToVisible(l,o,r,t){var a=l.reactData,i=l.internalData,{computeLeftFixedWidth:n,computeRightFixedWidth:u}=l.getComputeMaps(),{scrollXLoad:a,scrollXLeft:s}=a,{elemStore:i,visibleColumn:d}=i,n=n.value,u=u.value,i=getRefElem(i["main-body-scroll"]);if(!r.fixed&&i){var c=i.clientWidth,m=i.scrollLeft;let e=null;if(t&&(t=getRowid(l,t),e=i.querySelector(`[rowid="${t}"] .`+r.id)),e=e||i.querySelector("."+r.id)){t=e.offsetLeft+(a?s:0),i=e.clientWidth;if(o||!(t<=m+n&&m+n<t+i)&&!(m+n<=t&&t<m+c-u)){if(t<m+n)return l.scrollTo(t-n-1);if(c-u<t+i-m)return l.scrollTo(t+i-(c-u-1))}}else if(a){let t=0;s=r.renderWidth;for(let e=0;e<d.length;e++){var g=d[e];if(g===r||g.id===r.id)break;t+=g.renderWidth}if(o||!(t<=m+n&&t+s>m+n)&&!(t>=m+n&&t<m+c-u))return t<m?l.scrollTo(t-n-1):l.scrollTo(t+s-(c-u-1))}}return Promise.resolve()}function hangleBolleanDefaultValue(e,t){return _xeUtils.default.isBoolean(e)?e:t}function handleCustomStoreConfig(e){var e=e.getComputeMaps().computeCustomOpts,{storage:e,storeOptions:t}=e.value,l=!0===e,e=Object.assign({},!l&&e||{},t);return{isCustomAlign:hangleBolleanDefaultValue(e.align,l),isCustomHeaderAlign:hangleBolleanDefaultValue(e.headerAlign,l),isCustomFooterAlign:hangleBolleanDefaultValue(e.footerAlign,l),isCustomResizable:hangleBolleanDefaultValue(e.resizable,l),isCustomVisible:hangleBolleanDefaultValue(e.visible,l),isCustomFixed:hangleBolleanDefaultValue(e.fixed,l),isCustomSort:hangleBolleanDefaultValue(e.sort,l),isCustomAggGroup:hangleBolleanDefaultValue(e.aggGroup,l),isCustomAggFunc:hangleBolleanDefaultValue(e.aggFunc,l),isCustomPager:hangleBolleanDefaultValue(e.pager,l)}}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.hooks = 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 = "4.20.
|
|
16
|
+
const version = exports.version = "4.20.8";
|
|
17
17
|
_core.VxeUI.version = version;
|
|
18
18
|
_core.VxeUI.tableVersion = version;
|
|
19
19
|
_core.VxeUI.setConfig({
|
|
@@ -84,9 +84,11 @@ _core.VxeUI.setConfig({
|
|
|
84
84
|
defaultPlacement: 'top'
|
|
85
85
|
},
|
|
86
86
|
headerTooltipConfig: {
|
|
87
|
+
mode: 'tooltip',
|
|
87
88
|
enterable: true
|
|
88
89
|
},
|
|
89
90
|
footerTooltipConfig: {
|
|
91
|
+
mode: 'tooltip',
|
|
90
92
|
enterable: true
|
|
91
93
|
},
|
|
92
94
|
validConfig: {
|
package/lib/ui/index.min.js
CHANGED
|
@@ -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.hooks=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="4.20.
|
|
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.hooks=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="4.20.8",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!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:{mode:"tooltip",enterable:!0,defaultPlacement:"top"},headerTooltipConfig:{mode:"tooltip",enterable:!0},footerTooltipConfig:{mode:"tooltip",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,allowAlign:!0,showSortDragButton:!0,showFooter:!0,placement:"top-right",storeOptions:{visible:!0,resizable:!0,sort:!0,fixed:!0,align:!0,headerAlign:!0,footerAlign:!0,aggFunc:!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:1,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_CUSTOM_FIXED_LEFT:iconPrefix+"fixed-left",TABLE_CUSTOM_FIXED_RIGHT:iconPrefix+"fixed-right",TABLE_CUSTOM_ALIGN_LEFT:iconPrefix+"align-left",TABLE_CUSTOM_ALIGN_CENTER:iconPrefix+"align-center",TABLE_CUSTOM_ALIGN_RIGHT:iconPrefix+"align-right",TABLE_CUSTOM_MOVE_UP:iconPrefix+"arrows-up",TABLE_CUSTOM_MOVE_DN:iconPrefix+"arrows-down",TABLE_CUSTOM_PUT_TOP:iconPrefix+"top",TABLE_CUSTOM_PUT_BOTTOM:iconPrefix+"bottom",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+"setting",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,hooks=exports.hooks=_core.VxeUI.hooks,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,i){return _core.VxeUI.modal.alert(e,o,i)},confirm(e,o,i){return _core.VxeUI.modal.confirm(e,o,i)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,i){return _core.VxeUI.modal.notification(e,o,i)}});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -9,7 +9,7 @@ var _core = require("@vxe-ui/core");
|
|
|
9
9
|
const {
|
|
10
10
|
log
|
|
11
11
|
} = _core.VxeUI;
|
|
12
|
-
const tableVersion = `table v${"4.20.
|
|
12
|
+
const tableVersion = `table v${"4.20.8"}`;
|
|
13
13
|
function createComponentLog(name) {
|
|
14
14
|
const uiVersion = _core.VxeUI.uiVersion ? `ui v${_core.VxeUI.uiVersion}` : '';
|
|
15
15
|
const ganttVersion = _core.VxeUI.ganttVersion ? `gantt v${_core.VxeUI.ganttVersion}` : '';
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.createComponentLog=createComponentLog,exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,tableVersion="table v4.20.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.createComponentLog=createComponentLog,exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,tableVersion="table v4.20.8";function createComponentLog(e){var r=_core.VxeUI.uiVersion?"ui v"+_core.VxeUI.uiVersion:"",o=_core.VxeUI.ganttVersion?"gantt v"+_core.VxeUI.ganttVersion:"",t=_core.VxeUI.designVersion?"design v"+_core.VxeUI.designVersion:"",r=[r,tableVersion,o,t].filter(e=>e).join(" ");return{warnLog:log.create("warn",r+"] ["+e),errLog:log.create("error",r+"] ["+e)}}let warnLog=exports.warnLog=log.create("warn",tableVersion),errLog=exports.errLog=log.create("error",tableVersion);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.8",
|
|
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",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript": "~5.9.3",
|
|
67
67
|
"vue": "3.4.27",
|
|
68
68
|
"vue-router": "~4.5.1",
|
|
69
|
-
"vxe-pc-ui": "4.16.
|
|
69
|
+
"vxe-pc-ui": "4.16.22"
|
|
70
70
|
},
|
|
71
71
|
"vetur": {
|
|
72
72
|
"tags": "helper/vetur/tags.json",
|
|
@@ -1536,6 +1536,17 @@ export default defineVxeComponent({
|
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
return null
|
|
1539
|
+
},
|
|
1540
|
+
getCustomPagerData () {
|
|
1541
|
+
const { pagerConfig } = props
|
|
1542
|
+
const { tablePage } = reactData
|
|
1543
|
+
const pagerOpts = computePagerOpts.value
|
|
1544
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
1545
|
+
return {
|
|
1546
|
+
pSize: tablePage.pageSize
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
return {}
|
|
1539
1550
|
}
|
|
1540
1551
|
// setProxyInfo (options) {
|
|
1541
1552
|
// if (props.proxyConfig && options) {
|
|
@@ -161,9 +161,9 @@ export default defineVxeComponent({
|
|
|
161
161
|
let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
|
|
162
162
|
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
|
|
163
163
|
const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
|
|
164
|
-
const showEllipsis = cellOverflow === 'ellipsis'
|
|
165
|
-
const showTitle = cellOverflow === 'title'
|
|
166
|
-
const showTooltip = cellOverflow === true ? tooltipOpts.mode
|
|
164
|
+
const showEllipsis = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'ellipsis'
|
|
165
|
+
const showTitle = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'title'
|
|
166
|
+
const showTooltip = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'tooltip'
|
|
167
167
|
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis
|
|
168
168
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
169
169
|
const isCsHeight = !!customCellHeight
|
|
@@ -191,8 +191,8 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
191
191
|
const headerTooltipOpts = computeHeaderTooltipOpts.value
|
|
192
192
|
const showAllTip = headerTooltipOpts.showAll
|
|
193
193
|
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
194
|
-
const showTitle = headOverflow === 'title'
|
|
195
|
-
const showTooltip = headOverflow === true
|
|
194
|
+
const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title'
|
|
195
|
+
const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'tooltip'
|
|
196
196
|
const ons: Record<string, any> = {}
|
|
197
197
|
if (showTitle || showTooltip || showAllTip) {
|
|
198
198
|
ons.onMouseenter = (evnt: MouseEvent) => {
|
|
@@ -74,9 +74,9 @@ export default defineVxeComponent({
|
|
|
74
74
|
const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding
|
|
75
75
|
const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
|
|
76
76
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
|
|
77
|
-
const showEllipsis = footOverflow === 'ellipsis'
|
|
78
|
-
const showTitle = footOverflow === 'title'
|
|
79
|
-
const showTooltip = footOverflow === true ? footerTooltipOpts.mode
|
|
77
|
+
const showEllipsis = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'ellipsis'
|
|
78
|
+
const showTitle = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'title'
|
|
79
|
+
const showTooltip = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'tooltip'
|
|
80
80
|
const hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
81
81
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
82
82
|
const attrs: any = { colid }
|
|
@@ -88,9 +88,9 @@ export default defineVxeComponent({
|
|
|
88
88
|
const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
|
|
89
89
|
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
90
90
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
|
|
91
|
-
const showEllipsis = headOverflow === 'ellipsis'
|
|
92
|
-
const showTitle = headOverflow === 'title'
|
|
93
|
-
const showTooltip = headOverflow === true ? headerTooltipOpts.mode
|
|
91
|
+
const showEllipsis = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'ellipsis'
|
|
92
|
+
const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title'
|
|
93
|
+
const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'tooltip'
|
|
94
94
|
const hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
95
95
|
let hasFilter = false
|
|
96
96
|
let firstFilterOption: VxeTableDefines.FilterOption | null = null
|
|
@@ -1610,9 +1610,9 @@ export default defineVxeComponent({
|
|
|
1610
1610
|
const handleCustomRestore = (storeData: VxeTableDefines.CustomStoreData) => {
|
|
1611
1611
|
const { aggregateConfig, rowGroupConfig } = props
|
|
1612
1612
|
const { collectColumn } = internalData
|
|
1613
|
-
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable)
|
|
1613
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc, isCustomPager } = handleCustomStoreConfig($xeTable)
|
|
1614
1614
|
|
|
1615
|
-
let { alignData, headerAlignData, footerAlignData, resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData } = storeData
|
|
1615
|
+
let { alignData, headerAlignData, footerAlignData, resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData, pagerData } = storeData
|
|
1616
1616
|
// 处理还原
|
|
1617
1617
|
if ((isCustomAlign && alignData) ||
|
|
1618
1618
|
(isCustomHeaderAlign && headerAlignData) ||
|
|
@@ -1622,7 +1622,8 @@ export default defineVxeComponent({
|
|
|
1622
1622
|
(isCustomVisible && visibleData) ||
|
|
1623
1623
|
(isCustomFixed && fixedData) ||
|
|
1624
1624
|
(isCustomAggGroup && aggGroupData) ||
|
|
1625
|
-
(isCustomAggFunc && aggFuncData)
|
|
1625
|
+
(isCustomAggFunc && aggFuncData) ||
|
|
1626
|
+
(isCustomPager && pagerData && $xeGGWrapper)) {
|
|
1626
1627
|
const sortColMaps: Record<string, {
|
|
1627
1628
|
key: string
|
|
1628
1629
|
sNum: number
|
|
@@ -1957,7 +1958,7 @@ export default defineVxeComponent({
|
|
|
1957
1958
|
const autoWidthColumnList = computeAutoWidthColumnList.value
|
|
1958
1959
|
const { fullColumnIdData } = internalData
|
|
1959
1960
|
const el = refElem.value
|
|
1960
|
-
if (el) {
|
|
1961
|
+
if (el && autoWidthColumnList.length) {
|
|
1961
1962
|
el.setAttribute('data-calc-col', 'Y')
|
|
1962
1963
|
autoWidthColumnList.forEach(column => {
|
|
1963
1964
|
const colid = column.id
|
|
@@ -2244,7 +2245,7 @@ export default defineVxeComponent({
|
|
|
2244
2245
|
const fullMaps: Record<string, any> = {}
|
|
2245
2246
|
let rowNum = 0
|
|
2246
2247
|
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
2247
|
-
XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
2248
|
+
XEUtils.eachTree(afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
2248
2249
|
const rowid = handleGetRowId(row)
|
|
2249
2250
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
2250
2251
|
const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
@@ -2252,9 +2253,10 @@ export default defineVxeComponent({
|
|
|
2252
2253
|
rowRest.seq = seq
|
|
2253
2254
|
rowRest._seq = rowNum
|
|
2254
2255
|
rowRest.treeIndex = index
|
|
2256
|
+
rowRest._index = rowNum
|
|
2255
2257
|
rowRest._tIndex = rowNum
|
|
2256
2258
|
} else {
|
|
2257
|
-
const rest = { row, rowid, _seq: rowNum, seq, index
|
|
2259
|
+
const rest = { row, rowid, _seq: rowNum, seq, index, $index: -1, _index: rowNum, treeIndex: index, _tIndex: rowNum, items, parent: parentRow, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
2258
2260
|
fullAllDataRowIdData[rowid] = rest
|
|
2259
2261
|
fullDataRowIdData[rowid] = rest
|
|
2260
2262
|
}
|
|
@@ -3493,7 +3495,7 @@ export default defineVxeComponent({
|
|
|
3493
3495
|
if (reWidth) {
|
|
3494
3496
|
calcCellWidth()
|
|
3495
3497
|
}
|
|
3496
|
-
if (reFull) {
|
|
3498
|
+
if (reWidth || reFull) {
|
|
3497
3499
|
autoCellWidth()
|
|
3498
3500
|
}
|
|
3499
3501
|
calcScrollbar()
|
|
@@ -3508,7 +3510,7 @@ export default defineVxeComponent({
|
|
|
3508
3510
|
if (reWidth) {
|
|
3509
3511
|
calcCellWidth()
|
|
3510
3512
|
}
|
|
3511
|
-
if (reFull) {
|
|
3513
|
+
if (reWidth || reFull) {
|
|
3512
3514
|
autoCellWidth()
|
|
3513
3515
|
}
|
|
3514
3516
|
if (reHeight) {
|
|
@@ -3606,7 +3608,7 @@ export default defineVxeComponent({
|
|
|
3606
3608
|
return
|
|
3607
3609
|
}
|
|
3608
3610
|
internalData.rsePending = true
|
|
3609
|
-
handleLazyRecalculate(
|
|
3611
|
+
handleLazyRecalculate(false, true, true, {
|
|
3610
3612
|
minRunDelay: 200
|
|
3611
3613
|
}).then(() => {
|
|
3612
3614
|
internalData.rsePending = false
|
|
@@ -4888,12 +4890,12 @@ export default defineVxeComponent({
|
|
|
4888
4890
|
return
|
|
4889
4891
|
}
|
|
4890
4892
|
const expandOpts = computeExpandOpts.value
|
|
4891
|
-
const rowOpts = computeRowOpts.value
|
|
4892
|
-
const cellOpts = computeCellOpts.value
|
|
4893
|
-
const defaultRowHeight = computeDefaultRowHeight.value
|
|
4894
4893
|
const { mode } = expandOpts
|
|
4895
4894
|
if (expandColumn && mode === 'fixed') {
|
|
4896
4895
|
const { elemStore, fullAllDataRowIdData } = internalData
|
|
4896
|
+
const rowOpts = computeRowOpts.value
|
|
4897
|
+
const cellOpts = computeCellOpts.value
|
|
4898
|
+
const defaultRowHeight = computeDefaultRowHeight.value
|
|
4897
4899
|
const rowExpandEl = refRowExpandElem.value
|
|
4898
4900
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
4899
4901
|
if (rowExpandEl && bodyScrollElem) {
|
|
@@ -8241,7 +8243,7 @@ export default defineVxeComponent({
|
|
|
8241
8243
|
const { isRowGroupStatus, rowGroupList } = reactData
|
|
8242
8244
|
const { fullColumnFieldData, collectColumn } = internalData
|
|
8243
8245
|
const { storage, checkMethod } = customOpts
|
|
8244
|
-
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable)
|
|
8246
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc, isCustomPager } = handleCustomStoreConfig($xeTable)
|
|
8245
8247
|
|
|
8246
8248
|
const alignData: Record<string, VxeColumnPropTypes.Align> = {}
|
|
8247
8249
|
const headerAlignData: Record<string, VxeColumnPropTypes.HeaderAlign> = {}
|
|
@@ -8254,6 +8256,7 @@ export default defineVxeComponent({
|
|
|
8254
8256
|
const aggFuncData: Record<string, VxeColumnPropTypes.AggFunc> = {}
|
|
8255
8257
|
|
|
8256
8258
|
const storeData: VxeTableDefines.CustomStoreData = {
|
|
8259
|
+
pagerData: isCustomPager && $xeGGWrapper && $xeGGWrapper.getCustomPagerData ? $xeGGWrapper.getCustomPagerData() : undefined,
|
|
8257
8260
|
alignData: undefined,
|
|
8258
8261
|
headerAlignData: undefined,
|
|
8259
8262
|
footerAlignData: undefined,
|
|
@@ -9090,8 +9093,10 @@ export default defineVxeComponent({
|
|
|
9090
9093
|
if (!el || !el.clientWidth) {
|
|
9091
9094
|
return
|
|
9092
9095
|
}
|
|
9096
|
+
if (internalData.rsePending) {
|
|
9097
|
+
return
|
|
9098
|
+
}
|
|
9093
9099
|
handleResizeEvent()
|
|
9094
|
-
$xeTable.updateCellAreas()
|
|
9095
9100
|
}
|
|
9096
9101
|
|
|
9097
9102
|
const handleTargetEnterEvent = (isClear: boolean) => {
|
|
@@ -10232,7 +10237,7 @@ export default defineVxeComponent({
|
|
|
10232
10237
|
const tableId = computeTableId.value
|
|
10233
10238
|
const customOpts = computeCustomOpts.value
|
|
10234
10239
|
const { updateStore, storage } = customOpts
|
|
10235
|
-
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable)
|
|
10240
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc, isCustomPager } = handleCustomStoreConfig($xeTable)
|
|
10236
10241
|
|
|
10237
10242
|
if (type !== 'reset') {
|
|
10238
10243
|
// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
@@ -10249,7 +10254,8 @@ export default defineVxeComponent({
|
|
|
10249
10254
|
isCustomFixed ||
|
|
10250
10255
|
isCustomSort ||
|
|
10251
10256
|
isCustomAggGroup ||
|
|
10252
|
-
isCustomAggFunc
|
|
10257
|
+
isCustomAggFunc ||
|
|
10258
|
+
isCustomPager
|
|
10253
10259
|
)
|
|
10254
10260
|
) {
|
|
10255
10261
|
if (!tableId) {
|
|
@@ -10258,6 +10264,7 @@ export default defineVxeComponent({
|
|
|
10258
10264
|
}
|
|
10259
10265
|
const storeData: VxeTableDefines.CustomStoreData = type === 'reset'
|
|
10260
10266
|
? {
|
|
10267
|
+
pagerData: {},
|
|
10261
10268
|
alignData: {},
|
|
10262
10269
|
headerAlignData: {},
|
|
10263
10270
|
footerAlignData: {},
|
|
@@ -14657,9 +14664,9 @@ export default defineVxeComponent({
|
|
|
14657
14664
|
// if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
|
|
14658
14665
|
// warnLog('vxe.error.reqProp', ['show-overflow'])
|
|
14659
14666
|
// }
|
|
14660
|
-
if (treeConfig && !treeOpts.transform && props.stripe) {
|
|
14661
|
-
|
|
14662
|
-
}
|
|
14667
|
+
// if (treeConfig && !treeOpts.transform && props.stripe) {
|
|
14668
|
+
// warnLog('vxe.error.noTree', ['stripe'])
|
|
14669
|
+
// }
|
|
14663
14670
|
if (treeConfig && !treeOpts.transform) {
|
|
14664
14671
|
if (sortOpts.isDeep) {
|
|
14665
14672
|
warnLog('vxe.error.reqSupportProp', ['transform=false', 'sort-config.isDeep=false'])
|
|
@@ -165,6 +165,8 @@ export function createInternalData (): TableInternalData {
|
|
|
165
165
|
initStatus: false,
|
|
166
166
|
isActivated: false,
|
|
167
167
|
|
|
168
|
+
// rceTimeout: undefined,
|
|
169
|
+
// rceRunTime: undefined,
|
|
168
170
|
rceDelay: 0
|
|
169
171
|
|
|
170
172
|
// _sToTime: null
|
|
@@ -1136,6 +1138,7 @@ export function handleCustomStoreConfig ($xeTable: VxeTableConstructor) {
|
|
|
1136
1138
|
const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom)
|
|
1137
1139
|
const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom)
|
|
1138
1140
|
const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
1141
|
+
const isCustomPager = hangleBolleanDefaultValue(storageOpts.pager, isAllCustom)
|
|
1139
1142
|
return {
|
|
1140
1143
|
isCustomAlign,
|
|
1141
1144
|
isCustomHeaderAlign,
|
|
@@ -1145,6 +1148,7 @@ export function handleCustomStoreConfig ($xeTable: VxeTableConstructor) {
|
|
|
1145
1148
|
isCustomFixed,
|
|
1146
1149
|
isCustomSort,
|
|
1147
1150
|
isCustomAggGroup,
|
|
1148
|
-
isCustomAggFunc
|
|
1151
|
+
isCustomAggFunc,
|
|
1152
|
+
isCustomPager
|
|
1149
1153
|
}
|
|
1150
1154
|
}
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|