vxe-table 4.12.0-beta.12 → 4.12.0-beta.13
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/es/style.css +1 -1
- package/es/table/src/table.js +28 -32
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +5 -5
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +29 -32
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -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/table/src/table.ts +28 -32
- /package/es/{iconfont.1741688837286.ttf → iconfont.1741830530906.ttf} +0 -0
- /package/es/{iconfont.1741688837286.woff → iconfont.1741830530906.woff} +0 -0
- /package/es/{iconfont.1741688837286.woff2 → iconfont.1741830530906.woff2} +0 -0
- /package/lib/{iconfont.1741688837286.ttf → iconfont.1741830530906.ttf} +0 -0
- /package/lib/{iconfont.1741688837286.woff → iconfont.1741830530906.woff} +0 -0
- /package/lib/{iconfont.1741688837286.woff2 → iconfont.1741830530906.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1206,7 +1206,7 @@ export default defineComponent({
|
|
|
1206
1206
|
}
|
|
1207
1207
|
else {
|
|
1208
1208
|
if ((storage && !type) || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
|
|
1209
|
-
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field
|
|
1209
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
1212
|
if (!hasFixed && fixed) {
|
|
@@ -5829,7 +5829,13 @@ export default defineComponent({
|
|
|
5829
5829
|
const { id } = props;
|
|
5830
5830
|
const customOpts = computeCustomOpts.value;
|
|
5831
5831
|
const { collectColumn } = internalData;
|
|
5832
|
-
const { checkMethod } = customOpts;
|
|
5832
|
+
const { storage, checkMethod } = customOpts;
|
|
5833
|
+
const isAllCustom = storage === true;
|
|
5834
|
+
const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
|
|
5835
|
+
const isCustomResizable = isAllCustom || storageOpts.resizable;
|
|
5836
|
+
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
5837
|
+
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
5838
|
+
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
5833
5839
|
const resizableData = {};
|
|
5834
5840
|
const sortData = {};
|
|
5835
5841
|
const visibleData = {};
|
|
@@ -5849,44 +5855,34 @@ export default defineComponent({
|
|
|
5849
5855
|
let hasFixed = 0;
|
|
5850
5856
|
let hasVisible = 0;
|
|
5851
5857
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
5858
|
+
const colKey = column.getKey();
|
|
5859
|
+
if (!colKey) {
|
|
5860
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
|
|
5861
|
+
return;
|
|
5862
|
+
}
|
|
5852
5863
|
// 只支持一级
|
|
5853
5864
|
if (!parentColumn) {
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
hasSort = 1;
|
|
5858
|
-
sortData[colKey] = column.renderSortNumber;
|
|
5859
|
-
}
|
|
5860
|
-
});
|
|
5861
|
-
if (column.fixed !== column.defaultFixed) {
|
|
5862
|
-
const colKey = column.getKey();
|
|
5863
|
-
if (colKey) {
|
|
5864
|
-
hasFixed = 1;
|
|
5865
|
-
fixedData[colKey] = column.fixed;
|
|
5866
|
-
}
|
|
5865
|
+
if (isCustomSort) {
|
|
5866
|
+
hasSort = 1;
|
|
5867
|
+
sortData[colKey] = column.renderSortNumber;
|
|
5867
5868
|
}
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
if (colKey) {
|
|
5872
|
-
hasResizable = 1;
|
|
5873
|
-
resizableData[colKey] = column.renderWidth;
|
|
5869
|
+
if (isCustomFixed && column.fixed !== column.defaultFixed) {
|
|
5870
|
+
hasFixed = 1;
|
|
5871
|
+
fixedData[colKey] = column.fixed;
|
|
5874
5872
|
}
|
|
5875
5873
|
}
|
|
5876
|
-
if (
|
|
5874
|
+
if (isCustomResizable && column.resizeWidth) {
|
|
5875
|
+
hasResizable = 1;
|
|
5876
|
+
resizableData[colKey] = column.renderWidth;
|
|
5877
|
+
}
|
|
5878
|
+
if (isCustomVisible && (!checkMethod || checkMethod({ column }))) {
|
|
5877
5879
|
if (!column.visible && column.defaultVisible) {
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
hasVisible = 1;
|
|
5881
|
-
visibleData[colKey] = false;
|
|
5882
|
-
}
|
|
5880
|
+
hasVisible = 1;
|
|
5881
|
+
visibleData[colKey] = false;
|
|
5883
5882
|
}
|
|
5884
5883
|
else if (column.visible && !column.defaultVisible) {
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
hasVisible = 1;
|
|
5888
|
-
visibleData[colKey] = true;
|
|
5889
|
-
}
|
|
5884
|
+
hasVisible = 1;
|
|
5885
|
+
visibleData[colKey] = true;
|
|
5890
5886
|
}
|
|
5891
5887
|
}
|
|
5892
5888
|
});
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.12.0-beta.
|
|
3141
|
+
const version = "4.12.0-beta.13";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3586,7 +3586,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3586
3586
|
const {
|
|
3587
3587
|
log: log_log
|
|
3588
3588
|
} = core_.VxeUI;
|
|
3589
|
-
const log_version = `table v${"4.12.0-beta.
|
|
3589
|
+
const log_version = `table v${"4.12.0-beta.13"}`;
|
|
3590
3590
|
const warnLog = log_log.create('warn', log_version);
|
|
3591
3591
|
const errLog = log_log.create('error', log_version);
|
|
3592
3592
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -10428,7 +10428,7 @@ if(hasCustomSort){collectColumn=external_root_XEUtils_commonjs_xe_utils_commonjs
|
|
|
10428
10428
|
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{});const isCustomResizable=isAllCustom||storageOpts.resizable;const isCustomVisible=isAllCustom||storageOpts.visible;const isCustomFixed=isAllCustom||storageOpts.fixed;const isCustomSort=isAllCustom||storageOpts.sort;if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
10429
10429
|
* 更新数据列的 Map
|
|
10430
10430
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
10431
|
-
*/const cacheColumnMap=()=>{const{tableFullColumn,collectColumn}=internalData;const fullColumnIdData=internalData.fullColumnIdData={};const fullColumnFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(hasChildrenList);let isAllOverflow=!!props.showOverflow;let expandColumn;let treeNodeColumn;let checkboxColumn;let radioColumn;let htmlColumn;let hasFixed;const handleFunc=(column,index,items,path,parentColumn)=>{const{id:colid,field,fixed,type,treeNode}=column;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};if(field){if(fullColumnFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColumnFieldData[field]=rest;}else{if(storage&&!type||columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){errLog('vxe.error.reqProp',[`${column.getTitle()||type||''} -> column.field
|
|
10431
|
+
*/const cacheColumnMap=()=>{const{tableFullColumn,collectColumn}=internalData;const fullColumnIdData=internalData.fullColumnIdData={};const fullColumnFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(hasChildrenList);let isAllOverflow=!!props.showOverflow;let expandColumn;let treeNodeColumn;let checkboxColumn;let radioColumn;let htmlColumn;let hasFixed;const handleFunc=(column,index,items,path,parentColumn)=>{const{id:colid,field,fixed,type,treeNode}=column;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};if(field){if(fullColumnFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColumnFieldData[field]=rest;}else{if(storage&&!type||columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){errLog('vxe.error.reqProp',[`${column.getTitle()||type||''} -> column.field=?`]);}}if(!hasFixed&&fixed){hasFixed=fixed;}if(!htmlColumn&&type==='html'){htmlColumn=column;}if(treeNode){if(true){if(treeNodeColumn){warnLog('vxe.error.colRepet',['tree-node',treeNode]);}}if(!treeNodeColumn){treeNodeColumn=column;}}else if(type==='expand'){if(true){if(expandColumn){warnLog('vxe.error.colRepet',['type',type]);}}if(!expandColumn){expandColumn=column;}}if(true){if(type==='checkbox'){if(checkboxColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!checkboxColumn){checkboxColumn=column;}}else if(type==='radio'){if(radioColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!radioColumn){radioColumn=column;}}}if(isAllOverflow&&column.showOverflow===false){isAllOverflow=false;}if(fullColumnIdData[colid]){errLog('vxe.error.colRepet',['colId',colid]);}fullColumnIdData[colid]=rest;};if(isGroup){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn,nodes)=>{column.level=nodes.length;handleFunc(column,index,items,path,parentColumn);});}else{tableFullColumn.forEach(handleFunc);}if(expandColumn&&expandOpts.mode!=='fixed'&&mouseOpts.area){errLog('vxe.error.errConflicts',['mouse-config.area','column.type=expand']);}if(htmlColumn){if(!columnOpts.useKey){errLog('vxe.error.reqProp',['column-config.useKey & column.type=html']);}if(!rowOpts.useKey){errLog('vxe.error.reqProp',['row-config.useKey & column.type=html']);}}reactData.isGroup=isGroup;reactData.treeNodeColumn=treeNodeColumn;reactData.expandColumn=expandColumn;reactData.isAllOverflow=isAllOverflow;};const updateHeight=()=>{internalData.customHeight=calcTableHeight('height');internalData.customMinHeight=calcTableHeight('minHeight');internalData.customMaxHeight=calcTableHeight('maxHeight');};const calcColumnAutoWidth=(column,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);let leftRightPadding=0;const firstCellEl=cellElemList[0];if(firstCellEl&&firstCellEl.parentElement){const cellStyle=getComputedStyle(firstCellEl.parentElement);leftRightPadding=Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingLeft)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingRight));}let colWidth=column.renderAutoWidth-leftRightPadding;for(let i=0;i<cellElemList.length;i++){const celEl=cellElemList[i];colWidth=Math.max(colWidth,celEl?Math.ceil(celEl.scrollWidth)+4:0);}return colWidth+leftRightPadding;};const calcCellWidth=()=>{const autoWidthColumnList=computeAutoWidthColumnList.value;const{fullColumnIdData}=internalData;const el=refElem.value;if(el){el.setAttribute('data-calc-col','Y');autoWidthColumnList.forEach(column=>{const colid=column.id;const colRest=fullColumnIdData[colid];const colWidth=calcColumnAutoWidth(column,el);if(colRest){colRest.width=Math.max(colWidth,colRest.width);}column.renderAutoWidth=colWidth;});$xeTable.analyColumnWidth();el.removeAttribute('data-calc-col');}};/**
|
|
10432
10432
|
* 列宽算法,计算单元格列宽,动态分配可用剩余空间
|
|
10433
10433
|
* 支持 px、%、固定 混合分配
|
|
10434
10434
|
* 支持动态列表调整分配
|
|
@@ -10903,8 +10903,8 @@ if(transform){return handleVirtualTreeExpand(rows,expanded);}else{return handleB
|
|
|
10903
10903
|
* 获取所有被合并的表尾
|
|
10904
10904
|
*/getMergeFooterItems(){return reactData.mergeFooterList.slice(0);},/**
|
|
10905
10905
|
* 清除所有表尾合并
|
|
10906
|
-
*/clearMergeFooterItems(){reactData.mergeFooterList=[];return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{checkMethod}=customOpts;const resizableData={};const sortData={};const visibleData={};const fixedData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined};if(!id){errLog('vxe.error.reqProp',['id']);return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{// 只支持一级
|
|
10907
|
-
if(!parentColumn){
|
|
10906
|
+
*/clearMergeFooterItems(){reactData.mergeFooterList=[];return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{});const isCustomResizable=isAllCustom||storageOpts.resizable;const isCustomVisible=isAllCustom||storageOpts.visible;const isCustomFixed=isAllCustom||storageOpts.fixed;const isCustomSort=isAllCustom||storageOpts.sort;const resizableData={};const sortData={};const visibleData={};const fixedData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined};if(!id){errLog('vxe.error.reqProp',['id']);return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}// 只支持一级
|
|
10907
|
+
if(!parentColumn){if(isCustomSort){hasSort=1;sortData[colKey]=column.renderSortNumber;}if(isCustomFixed&&column.fixed!==column.defaultFixed){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}});if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}return storeData;},focus(){internalData.isActivated=true;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},blur(){internalData.isActivated=false;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
10908
10908
|
* 连接工具栏
|
|
10909
10909
|
* @param $toolbar
|
|
10910
10910
|
*/connect($toolbar){if($toolbar){$xeToolbar=$toolbar;$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}else{errLog('vxe.error.barUnableLink');}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}};/**
|