vxe-table 3.12.4 → 3.12.6
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/module/custom/mixin.js +3 -3
- package/es/table/src/cell.js +1 -1
- package/es/table/src/methods.js +59 -20
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +76 -30
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +3 -3
- package/lib/table/src/cell.js +1 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +70 -24
- package/lib/table/src/methods.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/module/custom/mixin.ts +3 -3
- package/packages/table/src/cell.ts +1 -1
- package/packages/table/src/methods.ts +64 -24
- /package/es/{iconfont.1736149136555.ttf → iconfont.1736230307358.ttf} +0 -0
- /package/es/{iconfont.1736149136555.woff → iconfont.1736230307358.woff} +0 -0
- /package/es/{iconfont.1736149136555.woff2 → iconfont.1736230307358.woff2} +0 -0
- /package/lib/{iconfont.1736149136555.ttf → iconfont.1736230307358.ttf} +0 -0
- /package/lib/{iconfont.1736149136555.woff → iconfont.1736230307358.woff} +0 -0
- /package/lib/{iconfont.1736149136555.woff2 → iconfont.1736230307358.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -108,6 +108,8 @@ function cacheColumnMap($xeTable) {
|
|
|
108
108
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
109
109
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
110
110
|
const { isCrossDrag, isSelfToChildDrag } = columnDragOpts;
|
|
111
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
112
|
+
const { storage } = customOpts;
|
|
111
113
|
const rowOpts = $xeTable.computeRowOpts;
|
|
112
114
|
const isGroup = collectColumn.some(hasChildrenList);
|
|
113
115
|
let isAllOverflow = !!props.showOverflow;
|
|
@@ -127,8 +129,8 @@ function cacheColumnMap($xeTable) {
|
|
|
127
129
|
fullColumnFieldData[field] = rest;
|
|
128
130
|
}
|
|
129
131
|
else {
|
|
130
|
-
if (isCrossDrag || isSelfToChildDrag) {
|
|
131
|
-
errLog('vxe.error.
|
|
132
|
+
if (storage || isCrossDrag || isSelfToChildDrag) {
|
|
133
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
if (!hasFixed && fixed) {
|
|
@@ -622,7 +624,7 @@ const calcCellHeight = ($xeTable) => {
|
|
|
622
624
|
let paddingTop = 0;
|
|
623
625
|
let paddingBottom = 0;
|
|
624
626
|
let calcPadding = false;
|
|
625
|
-
tableData.forEach(
|
|
627
|
+
tableData.forEach(row => {
|
|
626
628
|
const rowid = getRowid($xeTable, row);
|
|
627
629
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
628
630
|
const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell`);
|
|
@@ -648,8 +650,9 @@ const calcCellHeight = ($xeTable) => {
|
|
|
648
650
|
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
649
651
|
}
|
|
650
652
|
});
|
|
653
|
+
reactData.isCalcCellHeight++;
|
|
651
654
|
}
|
|
652
|
-
// updateCellOffset(
|
|
655
|
+
// updateCellOffset()
|
|
653
656
|
};
|
|
654
657
|
function getOrderField(_vm, column) {
|
|
655
658
|
const { sortBy, sortType } = column;
|
|
@@ -966,11 +969,11 @@ function loadScrollYData($xeTable) {
|
|
|
966
969
|
const { mergeList } = reactData;
|
|
967
970
|
const { tableHeight, scrollYStore } = internalData;
|
|
968
971
|
const { startIndex, endIndex, offsetSize } = scrollYStore;
|
|
969
|
-
const
|
|
972
|
+
const autoOffsetYSize = showOverflow ? offsetSize : offsetSize + Math.min(8, Math.ceil(tableHeight / 200));
|
|
970
973
|
const { toVisibleIndex, visibleSize } = handleVirtualYVisible($xeTable);
|
|
971
974
|
const offsetItem = {
|
|
972
|
-
startIndex: Math.max(0, toVisibleIndex - 1 -
|
|
973
|
-
endIndex: toVisibleIndex + visibleSize +
|
|
975
|
+
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
976
|
+
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize
|
|
974
977
|
};
|
|
975
978
|
calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
|
|
976
979
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
@@ -991,11 +994,12 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
|
991
994
|
clearTimeout(lcsTimeout);
|
|
992
995
|
}
|
|
993
996
|
internalData.lcsTimeout = setTimeout(() => {
|
|
997
|
+
internalData.lcsRunTime = Date.now();
|
|
994
998
|
internalData.lcsTimeout = undefined;
|
|
995
999
|
internalData.inVirtualScroll = false;
|
|
996
1000
|
internalData.inBodyScroll = false;
|
|
997
|
-
internalData.bodyScrollType = '';
|
|
998
1001
|
internalData.inFooterScroll = false;
|
|
1002
|
+
internalData.bodyScrollType = '';
|
|
999
1003
|
if (isRollX && scrollXLoad) {
|
|
1000
1004
|
$xeTable.updateScrollXData().then(() => {
|
|
1001
1005
|
loadScrollXData($xeTable);
|
|
@@ -5413,26 +5417,25 @@ const Methods = {
|
|
|
5413
5417
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
|
|
5414
5418
|
}
|
|
5415
5419
|
},
|
|
5416
|
-
|
|
5420
|
+
handleRowDragSwapEvent(evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
|
|
5417
5421
|
const $xeTable = this;
|
|
5418
5422
|
const props = $xeTable;
|
|
5419
5423
|
const reactData = $xeTable;
|
|
5420
5424
|
const internalData = $xeTable;
|
|
5421
5425
|
const { treeConfig, dragConfig } = props;
|
|
5422
5426
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
5423
|
-
const { fullAllDataRowIdData
|
|
5427
|
+
const { fullAllDataRowIdData } = internalData;
|
|
5424
5428
|
const { isPeerDrag, isCrossDrag, isSelfToChildDrag, dragEndMethod } = rowDragOpts;
|
|
5425
5429
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
5426
5430
|
const { transform, rowField, mapChildrenField, parentField } = treeOpts;
|
|
5427
5431
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5428
|
-
const {
|
|
5429
|
-
const { afterFullData, tableFullData, prevDragRow, prevDragPos } = internalData;
|
|
5432
|
+
const { afterFullData, tableFullData } = internalData;
|
|
5430
5433
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
5431
5434
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
5432
5435
|
if (prevDragRow && dragRow) {
|
|
5433
5436
|
// 判断是否有拖动
|
|
5434
5437
|
if (prevDragRow !== dragRow) {
|
|
5435
|
-
Promise.resolve(dEndMethod
|
|
5438
|
+
return Promise.resolve(dEndMethod
|
|
5436
5439
|
? dEndMethod({
|
|
5437
5440
|
oldRow: dragRow,
|
|
5438
5441
|
newRow: prevDragRow,
|
|
@@ -5583,6 +5586,38 @@ const Methods = {
|
|
|
5583
5586
|
});
|
|
5584
5587
|
}
|
|
5585
5588
|
}
|
|
5589
|
+
return Promise.resolve();
|
|
5590
|
+
},
|
|
5591
|
+
handleRowDragDragendEvent(evnt) {
|
|
5592
|
+
const $xeTable = this;
|
|
5593
|
+
const props = $xeTable;
|
|
5594
|
+
const reactData = $xeTable;
|
|
5595
|
+
const internalData = $xeTable;
|
|
5596
|
+
const { treeConfig } = props;
|
|
5597
|
+
const { fullAllDataRowIdData, prevDragToChild } = internalData;
|
|
5598
|
+
const { dragRow } = reactData;
|
|
5599
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
5600
|
+
const { lazy } = treeOpts;
|
|
5601
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
5602
|
+
const { prevDragRow, prevDragPos } = internalData;
|
|
5603
|
+
if (treeConfig && prevDragToChild) {
|
|
5604
|
+
// 懒加载
|
|
5605
|
+
if (lazy) {
|
|
5606
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
5607
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
5608
|
+
if (prevDragRow[hasChildField]) {
|
|
5609
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
5610
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
5611
|
+
}
|
|
5612
|
+
}
|
|
5613
|
+
else {
|
|
5614
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
5615
|
+
}
|
|
5616
|
+
}
|
|
5617
|
+
}
|
|
5618
|
+
else {
|
|
5619
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
5620
|
+
}
|
|
5586
5621
|
hideDropTip($xeTable);
|
|
5587
5622
|
clearRowDropOrigin($xeTable);
|
|
5588
5623
|
internalData.prevDragToChild = false;
|
|
@@ -5601,7 +5636,8 @@ const Methods = {
|
|
|
5601
5636
|
const { fullAllDataRowIdData } = internalData;
|
|
5602
5637
|
const { dragRow } = reactData;
|
|
5603
5638
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
5604
|
-
const { transform, parentField } = treeOpts;
|
|
5639
|
+
const { lazy, transform, parentField } = treeOpts;
|
|
5640
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
5605
5641
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
5606
5642
|
const { isPeerDrag, isCrossDrag, isToChildDrag } = rowDragOpts;
|
|
5607
5643
|
if (!dragRow) {
|
|
@@ -5614,18 +5650,21 @@ const Methods = {
|
|
|
5614
5650
|
const rest = fullAllDataRowIdData[rowid];
|
|
5615
5651
|
if (rest) {
|
|
5616
5652
|
const row = rest.row;
|
|
5653
|
+
const rowid = getRowid($xeTable, row);
|
|
5654
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5617
5655
|
evnt.preventDefault();
|
|
5618
5656
|
const { dragRow } = reactData;
|
|
5619
5657
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
5620
5658
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
5659
|
+
internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && hasCtrlKey);
|
|
5660
|
+
internalData.prevDragRow = row;
|
|
5661
|
+
internalData.prevDragPos = dragPos;
|
|
5621
5662
|
if ($xeTable.eqRow(dragRow, row) ||
|
|
5663
|
+
(hasCtrlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
|
|
5622
5664
|
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level))) {
|
|
5623
5665
|
showDropTip($xeTable, evnt, trEl, null, false, dragPos);
|
|
5624
5666
|
return;
|
|
5625
5667
|
}
|
|
5626
|
-
internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && hasCtrlKey);
|
|
5627
|
-
internalData.prevDragRow = row;
|
|
5628
|
-
internalData.prevDragPos = dragPos;
|
|
5629
5668
|
showDropTip($xeTable, evnt, trEl, null, true, dragPos);
|
|
5630
5669
|
$xeTable.dispatchEvent('row-dragover', {
|
|
5631
5670
|
oldRow: dragRow,
|
|
@@ -5884,15 +5923,15 @@ const Methods = {
|
|
|
5884
5923
|
const { clientX } = evnt;
|
|
5885
5924
|
const offsetX = clientX - thEl.getBoundingClientRect().x;
|
|
5886
5925
|
const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
|
|
5926
|
+
internalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && hasCtrlKey);
|
|
5927
|
+
internalData.prevDragCol = column;
|
|
5928
|
+
internalData.prevDragPos = dragPos;
|
|
5887
5929
|
if (column.fixed ||
|
|
5888
5930
|
(dragCol && dragCol.id === column.id) ||
|
|
5889
5931
|
(!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.parentId))) {
|
|
5890
5932
|
showDropTip($xeTable, evnt, null, thEl, false, dragPos);
|
|
5891
5933
|
return;
|
|
5892
5934
|
}
|
|
5893
|
-
internalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && hasCtrlKey);
|
|
5894
|
-
internalData.prevDragCol = column;
|
|
5895
|
-
internalData.prevDragPos = dragPos;
|
|
5896
5935
|
showDropTip($xeTable, evnt, null, thEl, true, dragPos);
|
|
5897
5936
|
$xeTable.dispatchEvent('column-dragover', {
|
|
5898
5937
|
oldColumn: dragCol,
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.12.
|
|
2223
|
+
const version = "3.12.6";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2814,7 +2814,7 @@ function isNodeElement(elem) {
|
|
|
2814
2814
|
const {
|
|
2815
2815
|
log: log_log
|
|
2816
2816
|
} = core_.VxeUI;
|
|
2817
|
-
const log_version = `table v${"3.12.
|
|
2817
|
+
const log_version = `table v${"3.12.6"}`;
|
|
2818
2818
|
const warnLog = log_log.create('warn', log_version);
|
|
2819
2819
|
const errLog = log_log.create('error', log_version);
|
|
2820
2820
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -4056,7 +4056,7 @@ const Cell = {
|
|
|
4056
4056
|
style: {
|
|
4057
4057
|
paddingLeft: `${level * indent}px`
|
|
4058
4058
|
}
|
|
4059
|
-
}, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasLazyChilds : hasChild) ? [h('div', {
|
|
4059
|
+
}, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) ? [h('div', {
|
|
4060
4060
|
class: 'vxe-tree--btn-wrapper',
|
|
4061
4061
|
on: ons
|
|
4062
4062
|
}, [h('i', {
|
|
@@ -5137,6 +5137,10 @@ function cacheColumnMap($xeTable) {
|
|
|
5137
5137
|
isCrossDrag,
|
|
5138
5138
|
isSelfToChildDrag
|
|
5139
5139
|
} = columnDragOpts;
|
|
5140
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
5141
|
+
const {
|
|
5142
|
+
storage
|
|
5143
|
+
} = customOpts;
|
|
5140
5144
|
const rowOpts = $xeTable.computeRowOpts;
|
|
5141
5145
|
const isGroup = collectColumn.some(hasChildrenList);
|
|
5142
5146
|
let isAllOverflow = !!props.showOverflow;
|
|
@@ -5170,8 +5174,8 @@ function cacheColumnMap($xeTable) {
|
|
|
5170
5174
|
}
|
|
5171
5175
|
fullColumnFieldData[field] = rest;
|
|
5172
5176
|
} else {
|
|
5173
|
-
if (isCrossDrag || isSelfToChildDrag) {
|
|
5174
|
-
errLog('vxe.error.
|
|
5177
|
+
if (storage || isCrossDrag || isSelfToChildDrag) {
|
|
5178
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
|
|
5175
5179
|
}
|
|
5176
5180
|
}
|
|
5177
5181
|
if (!hasFixed && fixed) {
|
|
@@ -5741,8 +5745,9 @@ const calcCellHeight = $xeTable => {
|
|
|
5741
5745
|
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
5742
5746
|
}
|
|
5743
5747
|
});
|
|
5748
|
+
reactData.isCalcCellHeight++;
|
|
5744
5749
|
}
|
|
5745
|
-
// updateCellOffset(
|
|
5750
|
+
// updateCellOffset()
|
|
5746
5751
|
};
|
|
5747
5752
|
function getOrderField(_vm, column) {
|
|
5748
5753
|
const {
|
|
@@ -6110,14 +6115,14 @@ function loadScrollYData($xeTable) {
|
|
|
6110
6115
|
endIndex,
|
|
6111
6116
|
offsetSize
|
|
6112
6117
|
} = scrollYStore;
|
|
6113
|
-
const
|
|
6118
|
+
const autoOffsetYSize = showOverflow ? offsetSize : offsetSize + Math.min(8, Math.ceil(tableHeight / 200));
|
|
6114
6119
|
const {
|
|
6115
6120
|
toVisibleIndex,
|
|
6116
6121
|
visibleSize
|
|
6117
6122
|
} = handleVirtualYVisible($xeTable);
|
|
6118
6123
|
const offsetItem = {
|
|
6119
|
-
startIndex: Math.max(0, toVisibleIndex - 1 -
|
|
6120
|
-
endIndex: toVisibleIndex + visibleSize +
|
|
6124
|
+
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
6125
|
+
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize
|
|
6121
6126
|
};
|
|
6122
6127
|
calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
|
|
6123
6128
|
const {
|
|
@@ -6146,11 +6151,12 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
|
6146
6151
|
clearTimeout(lcsTimeout);
|
|
6147
6152
|
}
|
|
6148
6153
|
internalData.lcsTimeout = setTimeout(() => {
|
|
6154
|
+
internalData.lcsRunTime = Date.now();
|
|
6149
6155
|
internalData.lcsTimeout = undefined;
|
|
6150
6156
|
internalData.inVirtualScroll = false;
|
|
6151
6157
|
internalData.inBodyScroll = false;
|
|
6152
|
-
internalData.bodyScrollType = '';
|
|
6153
6158
|
internalData.inFooterScroll = false;
|
|
6159
|
+
internalData.bodyScrollType = '';
|
|
6154
6160
|
if (isRollX && scrollXLoad) {
|
|
6155
6161
|
$xeTable.updateScrollXData().then(() => {
|
|
6156
6162
|
loadScrollXData($xeTable);
|
|
@@ -11393,7 +11399,7 @@ const Methods = {
|
|
|
11393
11399
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
|
|
11394
11400
|
}
|
|
11395
11401
|
},
|
|
11396
|
-
|
|
11402
|
+
handleRowDragSwapEvent(evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
|
|
11397
11403
|
const $xeTable = this;
|
|
11398
11404
|
const props = $xeTable;
|
|
11399
11405
|
const reactData = $xeTable;
|
|
@@ -11404,8 +11410,7 @@ const Methods = {
|
|
|
11404
11410
|
} = props;
|
|
11405
11411
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
11406
11412
|
const {
|
|
11407
|
-
fullAllDataRowIdData
|
|
11408
|
-
prevDragToChild
|
|
11413
|
+
fullAllDataRowIdData
|
|
11409
11414
|
} = internalData;
|
|
11410
11415
|
const {
|
|
11411
11416
|
isPeerDrag,
|
|
@@ -11421,21 +11426,16 @@ const Methods = {
|
|
|
11421
11426
|
parentField
|
|
11422
11427
|
} = treeOpts;
|
|
11423
11428
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
11424
|
-
const {
|
|
11425
|
-
dragRow
|
|
11426
|
-
} = reactData;
|
|
11427
11429
|
const {
|
|
11428
11430
|
afterFullData,
|
|
11429
|
-
tableFullData
|
|
11430
|
-
prevDragRow,
|
|
11431
|
-
prevDragPos
|
|
11431
|
+
tableFullData
|
|
11432
11432
|
} = internalData;
|
|
11433
11433
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
11434
11434
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
11435
11435
|
if (prevDragRow && dragRow) {
|
|
11436
11436
|
// 判断是否有拖动
|
|
11437
11437
|
if (prevDragRow !== dragRow) {
|
|
11438
|
-
Promise.resolve(dEndMethod ? dEndMethod({
|
|
11438
|
+
return Promise.resolve(dEndMethod ? dEndMethod({
|
|
11439
11439
|
oldRow: dragRow,
|
|
11440
11440
|
newRow: prevDragRow,
|
|
11441
11441
|
dragPos: prevDragPos,
|
|
@@ -11586,6 +11586,48 @@ const Methods = {
|
|
|
11586
11586
|
}).catch(() => {});
|
|
11587
11587
|
}
|
|
11588
11588
|
}
|
|
11589
|
+
return Promise.resolve();
|
|
11590
|
+
},
|
|
11591
|
+
handleRowDragDragendEvent(evnt) {
|
|
11592
|
+
const $xeTable = this;
|
|
11593
|
+
const props = $xeTable;
|
|
11594
|
+
const reactData = $xeTable;
|
|
11595
|
+
const internalData = $xeTable;
|
|
11596
|
+
const {
|
|
11597
|
+
treeConfig
|
|
11598
|
+
} = props;
|
|
11599
|
+
const {
|
|
11600
|
+
fullAllDataRowIdData,
|
|
11601
|
+
prevDragToChild
|
|
11602
|
+
} = internalData;
|
|
11603
|
+
const {
|
|
11604
|
+
dragRow
|
|
11605
|
+
} = reactData;
|
|
11606
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
11607
|
+
const {
|
|
11608
|
+
lazy
|
|
11609
|
+
} = treeOpts;
|
|
11610
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
11611
|
+
const {
|
|
11612
|
+
prevDragRow,
|
|
11613
|
+
prevDragPos
|
|
11614
|
+
} = internalData;
|
|
11615
|
+
if (treeConfig && prevDragToChild) {
|
|
11616
|
+
// 懒加载
|
|
11617
|
+
if (lazy) {
|
|
11618
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
11619
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
11620
|
+
if (prevDragRow[hasChildField]) {
|
|
11621
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
11622
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11623
|
+
}
|
|
11624
|
+
} else {
|
|
11625
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11626
|
+
}
|
|
11627
|
+
}
|
|
11628
|
+
} else {
|
|
11629
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11630
|
+
}
|
|
11589
11631
|
hideDropTip($xeTable);
|
|
11590
11632
|
clearRowDropOrigin($xeTable);
|
|
11591
11633
|
internalData.prevDragToChild = false;
|
|
@@ -11611,9 +11653,11 @@ const Methods = {
|
|
|
11611
11653
|
} = reactData;
|
|
11612
11654
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
11613
11655
|
const {
|
|
11656
|
+
lazy,
|
|
11614
11657
|
transform,
|
|
11615
11658
|
parentField
|
|
11616
11659
|
} = treeOpts;
|
|
11660
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
11617
11661
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
11618
11662
|
const {
|
|
11619
11663
|
isPeerDrag,
|
|
@@ -11630,19 +11674,21 @@ const Methods = {
|
|
|
11630
11674
|
const rest = fullAllDataRowIdData[rowid];
|
|
11631
11675
|
if (rest) {
|
|
11632
11676
|
const row = rest.row;
|
|
11677
|
+
const rowid = getRowid($xeTable, row);
|
|
11678
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
11633
11679
|
evnt.preventDefault();
|
|
11634
11680
|
const {
|
|
11635
11681
|
dragRow
|
|
11636
11682
|
} = reactData;
|
|
11637
11683
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
11638
11684
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
11639
|
-
if ($xeTable.eqRow(dragRow, row) || !isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level)) {
|
|
11640
|
-
showDropTip($xeTable, evnt, trEl, null, false, dragPos);
|
|
11641
|
-
return;
|
|
11642
|
-
}
|
|
11643
11685
|
internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && hasCtrlKey);
|
|
11644
11686
|
internalData.prevDragRow = row;
|
|
11645
11687
|
internalData.prevDragPos = dragPos;
|
|
11688
|
+
if ($xeTable.eqRow(dragRow, row) || hasCtrlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded || !isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level)) {
|
|
11689
|
+
showDropTip($xeTable, evnt, trEl, null, false, dragPos);
|
|
11690
|
+
return;
|
|
11691
|
+
}
|
|
11646
11692
|
showDropTip($xeTable, evnt, trEl, null, true, dragPos);
|
|
11647
11693
|
$xeTable.dispatchEvent('row-dragover', {
|
|
11648
11694
|
oldRow: dragRow,
|
|
@@ -11933,13 +11979,13 @@ const Methods = {
|
|
|
11933
11979
|
} = evnt;
|
|
11934
11980
|
const offsetX = clientX - thEl.getBoundingClientRect().x;
|
|
11935
11981
|
const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
|
|
11982
|
+
internalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && hasCtrlKey);
|
|
11983
|
+
internalData.prevDragCol = column;
|
|
11984
|
+
internalData.prevDragPos = dragPos;
|
|
11936
11985
|
if (column.fixed || dragCol && dragCol.id === column.id || !isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.parentId)) {
|
|
11937
11986
|
showDropTip($xeTable, evnt, null, thEl, false, dragPos);
|
|
11938
11987
|
return;
|
|
11939
11988
|
}
|
|
11940
|
-
internalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && hasCtrlKey);
|
|
11941
|
-
internalData.prevDragCol = column;
|
|
11942
|
-
internalData.prevDragPos = dragPos;
|
|
11943
11989
|
showDropTip($xeTable, evnt, null, thEl, true, dragPos);
|
|
11944
11990
|
$xeTable.dispatchEvent('column-dragover', {
|
|
11945
11991
|
oldColumn: dragCol,
|
|
@@ -23344,10 +23390,10 @@ function validErrorRuleValue(rule, val) {
|
|
|
23344
23390
|
allowFixed,
|
|
23345
23391
|
allowResizable
|
|
23346
23392
|
} = customOpts;
|
|
23347
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path,
|
|
23348
|
-
if (
|
|
23393
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parentColumn) => {
|
|
23394
|
+
if (parentColumn) {
|
|
23349
23395
|
// 更新子列信息
|
|
23350
|
-
column.fixed =
|
|
23396
|
+
column.fixed = parentColumn.fixed;
|
|
23351
23397
|
} else {
|
|
23352
23398
|
if (allowSort) {
|
|
23353
23399
|
const sortIndex = index + 1;
|