vxe-table 4.13.17 → 4.13.18
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/locale/lang/fr-FR.d.ts +2 -0
- package/es/locale/lang/hy-AM.d.ts +2 -0
- package/es/locale/lang/id-ID.d.ts +2 -0
- package/es/locale/lang/it-IT.d.ts +2 -0
- package/es/locale/lang/ms-MY.d.ts +2 -0
- package/es/locale/lang/ms-MY.js +708 -0
- package/es/locale/lang/nb-NO.d.ts +2 -0
- package/es/locale/lang/th-TH.d.ts +2 -0
- package/es/locale/lang/ug-CN.d.ts +2 -0
- package/es/locale/lang/uz-UZ.d.ts +2 -0
- package/es/locale/lang/uz-UZ.js +708 -0
- package/es/locale/lang/vi-VN.d.ts +2 -0
- package/es/locale/lang/zh-CHT.d.ts +2 -0
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +1 -1
- package/es/table/module/filter/hook.js +8 -0
- package/es/table/src/table.js +35 -35
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +14 -10
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.d.ts +2 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +728 -0
- package/lib/locale/lang/de-DE.d.ts +2 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +728 -0
- package/lib/locale/lang/fr-FR.d.ts +2 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +728 -0
- package/lib/locale/lang/hy-AM.d.ts +2 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +728 -0
- package/lib/locale/lang/id-ID.d.ts +2 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +728 -0
- package/lib/locale/lang/it-IT.d.ts +2 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +728 -0
- package/lib/locale/lang/ms-MY.d.ts +2 -0
- package/lib/locale/lang/ms-MY.js +714 -0
- package/lib/locale/lang/ms-MY.min.js +1 -0
- package/lib/locale/lang/ms-MY.umd.js +728 -0
- package/lib/locale/lang/nb-NO.d.ts +2 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +728 -0
- package/lib/locale/lang/th-TH.d.ts +2 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +728 -0
- package/lib/locale/lang/ug-CN.d.ts +2 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +728 -0
- package/lib/locale/lang/uz-UZ.d.ts +2 -0
- package/lib/locale/lang/uz-UZ.js +714 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -0
- package/lib/locale/lang/uz-UZ.umd.js +728 -0
- package/lib/locale/lang/vi-VN.d.ts +2 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +728 -0
- package/lib/locale/lang/zh-CHT.d.ts +2 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +728 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +1 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/filter/hook.js +8 -0
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/src/table.js +3 -7
- 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/locale/lang/ms-MY.ts +708 -0
- package/packages/locale/lang/uz-UZ.ts +708 -0
- package/packages/table/module/custom/panel.ts +1 -1
- package/packages/table/module/filter/hook.ts +8 -0
- package/packages/table/src/table.ts +40 -34
- package/lib/locale/lang/zh-TC.umd.js +0 -23
- /package/es/{iconfont.1746324623861.ttf → iconfont.1746578870894.ttf} +0 -0
- /package/es/{iconfont.1746324623861.woff → iconfont.1746578870894.woff} +0 -0
- /package/es/{iconfont.1746324623861.woff2 → iconfont.1746578870894.woff2} +0 -0
- /package/es/locale/lang/{zh-TC.d.ts → ar-EG.d.ts} +0 -0
- /package/{lib/locale/lang/zh-TC.d.ts → es/locale/lang/de-DE.d.ts} +0 -0
- /package/lib/{iconfont.1746324623861.ttf → iconfont.1746578870894.ttf} +0 -0
- /package/lib/{iconfont.1746324623861.woff → iconfont.1746578870894.woff} +0 -0
- /package/lib/{iconfont.1746324623861.woff2 → iconfont.1746578870894.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, reactive, ref, provide, inject, nextTick, onActivated, onDeactivated, onBeforeUnmount, onUnmounted, watch, computed, onMounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
|
-
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize,
|
|
3
|
+
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey } from '../../ui/src/dom';
|
|
4
4
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
5
5
|
import { VxeUI } from '../../ui';
|
|
6
6
|
import Cell from './cell';
|
|
@@ -7485,8 +7485,9 @@ export default defineComponent({
|
|
|
7485
7485
|
evnt.stopPropagation();
|
|
7486
7486
|
evnt.preventDefault();
|
|
7487
7487
|
const { column } = params;
|
|
7488
|
-
const { overflowX, scrollbarHeight } = reactData;
|
|
7488
|
+
const { columnStore, overflowX, scrollbarHeight } = reactData;
|
|
7489
7489
|
const { elemStore, visibleColumn } = internalData;
|
|
7490
|
+
const { leftList, rightList } = columnStore;
|
|
7490
7491
|
const resizableOpts = computeResizableOpts.value;
|
|
7491
7492
|
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
7492
7493
|
const tableEl = refElem.value;
|
|
@@ -7496,10 +7497,11 @@ export default defineComponent({
|
|
|
7496
7497
|
if (!resizeBarElem) {
|
|
7497
7498
|
return;
|
|
7498
7499
|
}
|
|
7500
|
+
const isLeftFixed = fixedType === 'left';
|
|
7501
|
+
const isRightFixed = fixedType === 'right';
|
|
7499
7502
|
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
7500
7503
|
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
7501
7504
|
const { clientX: dragClientX } = evnt;
|
|
7502
|
-
const wrapperElem = refElem.value;
|
|
7503
7505
|
const dragBtnElem = evnt.target;
|
|
7504
7506
|
let resizeColumn = column;
|
|
7505
7507
|
if (column.children && column.children.length) {
|
|
@@ -7514,30 +7516,32 @@ export default defineComponent({
|
|
|
7514
7516
|
if (!bodyScrollElem) {
|
|
7515
7517
|
return;
|
|
7516
7518
|
}
|
|
7517
|
-
const
|
|
7519
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
7520
|
+
const rightContainerRect = rightContainerElem ? rightContainerElem.getBoundingClientRect() : null;
|
|
7521
|
+
const cellRect = cell.getBoundingClientRect();
|
|
7522
|
+
const dragBtnRect = dragBtnElem.getBoundingClientRect();
|
|
7518
7523
|
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
7519
7524
|
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
7525
|
+
const dragPosLeft = dragBtnRect.x - tableRect.x + dragBtnOffsetWidth;
|
|
7520
7526
|
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
// 计算左右侧固定列偏移量
|
|
7526
|
-
let fixedOffsetWidth = 0;
|
|
7527
|
+
const dragMinLeft = isRightFixed ? 0 : (cellRect.x - tableRect.x + dragBtnWidth + minInterval);
|
|
7528
|
+
const dragMaxLeft = cellRect.x - tableRect.x + cell.clientWidth - minInterval;
|
|
7529
|
+
let fixedLeftRemainWidth = 0;
|
|
7530
|
+
let fixedRightRemainWidth = 0;
|
|
7527
7531
|
if (isLeftFixed || isRightFixed) {
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7532
|
+
let isMach = false;
|
|
7533
|
+
const fixedColumn = isLeftFixed ? leftList : rightList;
|
|
7534
|
+
for (let i = 0; i < fixedColumn.length; i++) {
|
|
7535
|
+
const item = fixedColumn[i];
|
|
7536
|
+
if (isMach) {
|
|
7537
|
+
fixedLeftRemainWidth += item.renderWidth;
|
|
7533
7538
|
}
|
|
7534
|
-
else
|
|
7535
|
-
|
|
7539
|
+
else {
|
|
7540
|
+
isMach = item.id === resizeColumn.id;
|
|
7541
|
+
if (!isMach) {
|
|
7542
|
+
fixedRightRemainWidth += item.renderWidth;
|
|
7543
|
+
}
|
|
7536
7544
|
}
|
|
7537
|
-
tempCellElem = tempCellElem[siblingProp];
|
|
7538
|
-
}
|
|
7539
|
-
if (isRightFixed && rightContainerElem) {
|
|
7540
|
-
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
7541
7545
|
}
|
|
7542
7546
|
}
|
|
7543
7547
|
// 处理拖动事件
|
|
@@ -7547,29 +7551,25 @@ export default defineComponent({
|
|
|
7547
7551
|
const tableHeight = tableEl.clientHeight;
|
|
7548
7552
|
const offsetX = evnt.clientX - dragClientX;
|
|
7549
7553
|
let left = dragPosLeft + offsetX;
|
|
7550
|
-
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
7551
7554
|
if (isLeftFixed) {
|
|
7552
|
-
|
|
7553
|
-
|
|
7555
|
+
if (rightContainerRect) {
|
|
7556
|
+
left = Math.min(left, rightContainerRect.x - tableRect.x - fixedLeftRemainWidth - minInterval);
|
|
7557
|
+
}
|
|
7554
7558
|
}
|
|
7555
7559
|
else if (isRightFixed) {
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
else {
|
|
7561
|
-
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
7562
|
-
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
7560
|
+
if (leftContainerElem) {
|
|
7561
|
+
left = Math.max(left, leftContainerElem.clientWidth + fixedRightRemainWidth + minInterval);
|
|
7562
|
+
}
|
|
7563
|
+
left = Math.min(left, dragMaxLeft);
|
|
7563
7564
|
}
|
|
7564
7565
|
dragLeft = Math.max(left, dragMinLeft);
|
|
7565
|
-
const resizeBarLeft = Math.max(1, dragLeft
|
|
7566
|
+
const resizeBarLeft = Math.max(1, dragLeft);
|
|
7566
7567
|
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
7567
7568
|
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
|
|
7568
7569
|
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
|
|
7569
7570
|
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
7570
|
-
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
7571
|
+
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [Math.floor(resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft))]);
|
|
7571
7572
|
const tableWrapperWidth = tableEl.clientWidth;
|
|
7572
|
-
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
7573
7573
|
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
7574
7574
|
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
7575
7575
|
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
@@ -7581,7 +7581,7 @@ export default defineComponent({
|
|
|
7581
7581
|
resizeTipLeft += tableWrapperWidth - resizeBarLeft;
|
|
7582
7582
|
}
|
|
7583
7583
|
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
7584
|
-
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY -
|
|
7584
|
+
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - tableRect.y - resizeTipHeight / 2))}px`;
|
|
7585
7585
|
}
|
|
7586
7586
|
reactData.isDragResize = true;
|
|
7587
7587
|
};
|
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.13.
|
|
3141
|
+
const version = "4.13.18";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3599,7 +3599,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3599
3599
|
const {
|
|
3600
3600
|
log: log_log
|
|
3601
3601
|
} = core_.VxeUI;
|
|
3602
|
-
const log_version = `table v${"4.13.
|
|
3602
|
+
const log_version = `table v${"4.13.18"}`;
|
|
3603
3603
|
const warnLog = log_log.create('warn', log_version);
|
|
3604
3604
|
const errLog = log_log.create('error', log_version);
|
|
3605
3605
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -9508,7 +9508,7 @@ const {
|
|
|
9508
9508
|
const {
|
|
9509
9509
|
mode
|
|
9510
9510
|
} = customOpts;
|
|
9511
|
-
if (!VxeUIModalComponent) {
|
|
9511
|
+
if (!VxeUIModalComponent && mode === 'modal') {
|
|
9512
9512
|
errLog('vxe.error.reqComp', ['vxe-modal']);
|
|
9513
9513
|
}
|
|
9514
9514
|
if (!VxeUIDrawerComponent && mode === 'drawer') {
|
|
@@ -11307,13 +11307,9 @@ fullList=handleVirtualTreeToList();}const tableData=scrollYLoad?fullList.slice(s
|
|
|
11307
11307
|
const fullDataRowIdMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const rowGroupOpts=computeRowGroupOpts.value;const{mapChildrenField}=rowGroupOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
11308
11308
|
if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sourceData,handleSourceRow,{children:treeOpts.transform?treeOpts.mapChildrenField:childrenField});}else{sourceData.forEach(handleSourceRow);}internalData.sourceDataRowIdData=sourceRowIdData;internalData.tableSourceData=sourceData;},/**
|
|
11309
11309
|
* 指定列宽的列进行拆分
|
|
11310
|
-
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{overflowX,scrollbarHeight}=reactData;const{elemStore,visibleColumn}=internalData;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const
|
|
11311
|
-
|
|
11312
|
-
let
|
|
11313
|
-
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tableHeight=tableEl.clientHeight;const offsetX=evnt.clientX-dragClientX;let left=dragPosLeft+offsetX;const scrollLeft=fixedType?0:bodyScrollElem.scrollLeft;if(isLeftFixed){// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
11314
|
-
left=Math.min(left,(rightContainerElem?rightContainerElem.offsetLeft:bodyScrollElem.clientWidth)-fixedOffsetWidth-minInterval);}else if(isRightFixed){// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
11315
|
-
dragMinLeft=(leftContainerElem?leftContainerElem.clientWidth:0)+fixedOffsetWidth+minInterval;left=Math.min(left,dragPosLeft+cell.clientWidth-minInterval);}else{dragMinLeft=Math.max(bodyScrollElem.scrollLeft,dragMinLeft);// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
11316
|
-
}dragLeft=Math.max(left,dragMinLeft);const resizeBarLeft=Math.max(1,dragLeft-scrollLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft)]);const tableWrapperWidth=tableEl.clientWidth;const wrapperRect=wrapperElem.getBoundingClientRect();const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-wrapperRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});const colMinWidth=getColReMinWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}},handleRowResizeMousedownEvent(evnt,params){evnt.stopPropagation();evnt.preventDefault();const{row}=params;const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{elemStore,fullAllDataRowIdData}=internalData;const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const scrollbarYToLeft=computeScrollbarYToLeft.value;const resizableOpts=computeResizableOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const tableEl=refElem.value;const resizeBarElem=refRowResizeBar.value;if(!resizeBarElem){return;}const{clientY:dragClientY}=evnt;const resizeTipElem=resizeBarElem.firstElementChild;const dragBtnElem=evnt.currentTarget;const tdEl=dragBtnElem.parentNode;const trEl=tdEl.parentNode;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const defaultRowHeight=computeDefaultRowHeight.value;const currCellHeight=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;const tableRect=tableEl.getBoundingClientRect();const trRect=trEl.getBoundingClientRect();const targetOffsetY=dragClientY-trRect.y-trEl.clientHeight;let resizeHeight=currCellHeight;const cellEl=tdEl.querySelector('.vxe-cell');let cellMinHeight=0;if(cellEl){const cellStyle=getComputedStyle(cellEl);cellMinHeight=Math.max(1,Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));}const minTop=trRect.y-tableRect.y+cellMinHeight;// 处理拖动事件
|
|
11310
|
+
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{columnStore,overflowX,scrollbarHeight}=reactData;const{elemStore,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const isLeftFixed=fixedType==='left';const isRightFixed=fixedType==='right';const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const dragBtnElem=evnt.target;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});let dragLeft=0;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const tableRect=tableEl.getBoundingClientRect();const rightContainerRect=rightContainerElem?rightContainerElem.getBoundingClientRect():null;const cellRect=cell.getBoundingClientRect();const dragBtnRect=dragBtnElem.getBoundingClientRect();const dragBtnWidth=dragBtnElem.clientWidth;const dragBtnOffsetWidth=Math.floor(dragBtnWidth/2);const dragPosLeft=dragBtnRect.x-tableRect.x+dragBtnOffsetWidth;const minInterval=getColReMinWidth(cellParams)-dragBtnOffsetWidth;// 列之间的最小间距
|
|
11311
|
+
const dragMinLeft=isRightFixed?0:cellRect.x-tableRect.x+dragBtnWidth+minInterval;const dragMaxLeft=cellRect.x-tableRect.x+cell.clientWidth-minInterval;let fixedLeftRemainWidth=0;let fixedRightRemainWidth=0;if(isLeftFixed||isRightFixed){let isMach=false;const fixedColumn=isLeftFixed?leftList:rightList;for(let i=0;i<fixedColumn.length;i++){const item=fixedColumn[i];if(isMach){fixedLeftRemainWidth+=item.renderWidth;}else{isMach=item.id===resizeColumn.id;if(!isMach){fixedRightRemainWidth+=item.renderWidth;}}}}// 处理拖动事件
|
|
11312
|
+
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tableHeight=tableEl.clientHeight;const offsetX=evnt.clientX-dragClientX;let left=dragPosLeft+offsetX;if(isLeftFixed){if(rightContainerRect){left=Math.min(left,rightContainerRect.x-tableRect.x-fixedLeftRemainWidth-minInterval);}}else if(isRightFixed){if(leftContainerElem){left=Math.max(left,leftContainerElem.clientWidth+fixedRightRemainWidth+minInterval);}left=Math.min(left,dragMaxLeft);}dragLeft=Math.max(left,dragMinLeft);const resizeBarLeft=Math.max(1,dragLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[Math.floor(resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft))]);const tableWrapperWidth=tableEl.clientWidth;const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-tableRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});const colMinWidth=getColReMinWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}},handleRowResizeMousedownEvent(evnt,params){evnt.stopPropagation();evnt.preventDefault();const{row}=params;const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{elemStore,fullAllDataRowIdData}=internalData;const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const scrollbarYToLeft=computeScrollbarYToLeft.value;const resizableOpts=computeResizableOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const tableEl=refElem.value;const resizeBarElem=refRowResizeBar.value;if(!resizeBarElem){return;}const{clientY:dragClientY}=evnt;const resizeTipElem=resizeBarElem.firstElementChild;const dragBtnElem=evnt.currentTarget;const tdEl=dragBtnElem.parentNode;const trEl=tdEl.parentNode;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const defaultRowHeight=computeDefaultRowHeight.value;const currCellHeight=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;const tableRect=tableEl.getBoundingClientRect();const trRect=trEl.getBoundingClientRect();const targetOffsetY=dragClientY-trRect.y-trEl.clientHeight;let resizeHeight=currCellHeight;const cellEl=tdEl.querySelector('.vxe-cell');let cellMinHeight=0;if(cellEl){const cellStyle=getComputedStyle(cellEl);cellMinHeight=Math.max(1,Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));}const minTop=trRect.y-tableRect.y+cellMinHeight;// 处理拖动事件
|
|
11317
11313
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage}=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(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
11318
11314
|
reactData.isCustomStatus=true;}if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11319
11315
|
if(!evntList.length&&type==='event.clearEdit'){evntList=table_interceptor.get('event.clearActived');if(true){if(evntList.length){warnLog('vxe.error.delEvent',['event.clearActived','event.clearEdit']);}}}// 兼容老版本
|
|
@@ -14219,10 +14215,18 @@ hook_hooks.add('tableFilterModule', {
|
|
|
14219
14215
|
handleFilterConfirmFilter(null);
|
|
14220
14216
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14221
14217
|
},
|
|
14218
|
+
saveFilterPanelByEvent(evnt) {
|
|
14219
|
+
handleFilterConfirmFilter(evnt);
|
|
14220
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14221
|
+
},
|
|
14222
14222
|
resetFilterPanel() {
|
|
14223
14223
|
handleFilterResetFilter(null);
|
|
14224
14224
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14225
14225
|
},
|
|
14226
|
+
resetFilterPanelByEvent(evnt) {
|
|
14227
|
+
handleFilterResetFilter(evnt);
|
|
14228
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14229
|
+
},
|
|
14226
14230
|
getCheckedFilters() {
|
|
14227
14231
|
const {
|
|
14228
14232
|
tableFullColumn
|