vxe-table 4.8.7 → 4.8.9
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/style.min.css +1 -1
- package/es/table/src/body.js +4 -8
- package/es/table/src/cell.js +7 -3
- package/es/table/src/footer.js +2 -4
- package/es/table/src/table.js +191 -72
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +204 -85
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +4 -8
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +10 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +2 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/table.js +188 -70
- 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/body.ts +4 -8
- package/packages/table/src/cell.ts +9 -5
- package/packages/table/src/footer.ts +2 -4
- package/packages/table/src/table.ts +189 -70
- /package/es/{iconfont.1731032736115.ttf → iconfont.1731144197614.ttf} +0 -0
- /package/es/{iconfont.1731032736115.woff → iconfont.1731144197614.woff} +0 -0
- /package/es/{iconfont.1731032736115.woff2 → iconfont.1731144197614.woff2} +0 -0
- /package/lib/{iconfont.1731032736115.ttf → iconfont.1731144197614.ttf} +0 -0
- /package/lib/{iconfont.1731032736115.woff → iconfont.1731144197614.woff} +0 -0
- /package/lib/{iconfont.1731032736115.woff2 → iconfont.1731144197614.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -1998,7 +1998,7 @@ function eqEmptyValue(cellValue) {
|
|
|
1998
1998
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
1999
1999
|
|
|
2000
2000
|
|
|
2001
|
-
const version = "4.8.
|
|
2001
|
+
const version = "4.8.9";
|
|
2002
2002
|
core_.VxeUI.version = version;
|
|
2003
2003
|
core_.VxeUI.tableVersion = version;
|
|
2004
2004
|
core_.VxeUI.setConfig({
|
|
@@ -2389,7 +2389,7 @@ var es_array_push = __webpack_require__(4114);
|
|
|
2389
2389
|
const {
|
|
2390
2390
|
log: log_log
|
|
2391
2391
|
} = core_.VxeUI;
|
|
2392
|
-
const log_version = `table v${"4.8.
|
|
2392
|
+
const log_version = `table v${"4.8.9"}`;
|
|
2393
2393
|
const warnLog = log_log.create('warn', log_version);
|
|
2394
2394
|
const errLog = log_log.create('error', log_version);
|
|
2395
2395
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3388,12 +3388,16 @@ function renderCellDragIcon(params) {
|
|
|
3388
3388
|
function renderCellBaseVNs(params, content) {
|
|
3389
3389
|
const {
|
|
3390
3390
|
$table,
|
|
3391
|
-
column
|
|
3391
|
+
column,
|
|
3392
|
+
level
|
|
3392
3393
|
} = params;
|
|
3393
3394
|
const {
|
|
3394
3395
|
dragSort
|
|
3395
3396
|
} = column;
|
|
3396
|
-
const
|
|
3397
|
+
const tableProps = $table.props;
|
|
3398
|
+
const {
|
|
3399
|
+
treeConfig
|
|
3400
|
+
} = tableProps;
|
|
3397
3401
|
const {
|
|
3398
3402
|
computeRowOpts,
|
|
3399
3403
|
computeDragOpts
|
|
@@ -3404,8 +3408,11 @@ function renderCellBaseVNs(params, content) {
|
|
|
3404
3408
|
showRowIcon,
|
|
3405
3409
|
rowVisibleMethod
|
|
3406
3410
|
} = dragOpts;
|
|
3411
|
+
const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
|
|
3407
3412
|
if (dragSort && rowOpts.drag && showRowIcon && (!rowVisibleMethod || rowVisibleMethod(params))) {
|
|
3408
|
-
|
|
3413
|
+
if (!treeConfig || !level) {
|
|
3414
|
+
vns.unshift(renderCellDragIcon(params));
|
|
3415
|
+
}
|
|
3409
3416
|
}
|
|
3410
3417
|
return vns;
|
|
3411
3418
|
}
|
|
@@ -5371,11 +5378,9 @@ const lineOffsetSizes = {
|
|
|
5371
5378
|
setScrollTop(leftElem, scrollTop);
|
|
5372
5379
|
setScrollTop(rightElem, scrollTop);
|
|
5373
5380
|
}
|
|
5374
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
5381
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
5375
5382
|
type: renderType,
|
|
5376
|
-
fixed: fixedType
|
|
5377
|
-
scrollTop,
|
|
5378
|
-
scrollLeft
|
|
5383
|
+
fixed: fixedType
|
|
5379
5384
|
});
|
|
5380
5385
|
}
|
|
5381
5386
|
if (xHandleEl) {
|
|
@@ -5385,11 +5390,9 @@ const lineOffsetSizes = {
|
|
|
5385
5390
|
tableInternalData.lastScrollLeft = scrollLeft;
|
|
5386
5391
|
setScrollLeft(headerElem, scrollLeft);
|
|
5387
5392
|
setScrollLeft(footerElem, scrollLeft);
|
|
5388
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
5393
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
5389
5394
|
type: renderType,
|
|
5390
|
-
fixed: fixedType
|
|
5391
|
-
scrollTop,
|
|
5392
|
-
scrollLeft
|
|
5395
|
+
fixed: fixedType
|
|
5393
5396
|
});
|
|
5394
5397
|
}
|
|
5395
5398
|
};
|
|
@@ -6179,11 +6182,9 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
6179
6182
|
tableReactData.lastScrollTime = Date.now();
|
|
6180
6183
|
setScrollLeft(headerElem, scrollLeft);
|
|
6181
6184
|
setScrollLeft(bodyElem, scrollLeft);
|
|
6182
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
6185
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
6183
6186
|
type: footer_renderType,
|
|
6184
|
-
fixed: fixedType
|
|
6185
|
-
scrollTop,
|
|
6186
|
-
scrollLeft
|
|
6187
|
+
fixed: fixedType
|
|
6187
6188
|
});
|
|
6188
6189
|
}
|
|
6189
6190
|
};
|
|
@@ -11860,11 +11861,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11860
11861
|
reactData.lastScrollTime = Date.now();
|
|
11861
11862
|
handleSyncScrollX(scrollLeft);
|
|
11862
11863
|
$xeTable.triggerScrollXEvent(evnt);
|
|
11863
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
11864
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
11864
11865
|
type: 'table',
|
|
11865
|
-
fixed: ''
|
|
11866
|
-
scrollTop,
|
|
11867
|
-
scrollLeft
|
|
11866
|
+
fixed: ''
|
|
11868
11867
|
});
|
|
11869
11868
|
};
|
|
11870
11869
|
const debounceScrollYCalculate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(function () {
|
|
@@ -11896,11 +11895,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11896
11895
|
reactData.lastScrollTime = Date.now();
|
|
11897
11896
|
handleSyncScrollY(scrollTop);
|
|
11898
11897
|
$xeTable.triggerScrollYEvent(evnt);
|
|
11899
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
11898
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
11900
11899
|
type: 'table',
|
|
11901
|
-
fixed: ''
|
|
11902
|
-
scrollTop,
|
|
11903
|
-
scrollLeft
|
|
11900
|
+
fixed: ''
|
|
11904
11901
|
});
|
|
11905
11902
|
};
|
|
11906
11903
|
let keyCtxTimeout;
|
|
@@ -12651,25 +12648,35 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12651
12648
|
* 设置为固定列
|
|
12652
12649
|
*/
|
|
12653
12650
|
setColumnFixed(fieldOrColumn, fixed) {
|
|
12654
|
-
|
|
12655
|
-
const
|
|
12656
|
-
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
12651
|
+
let status = false;
|
|
12652
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12657
12653
|
const columnOpts = computeColumnOpts.value;
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12654
|
+
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
12655
|
+
for (let i = 0; i < cols.length; i++) {
|
|
12656
|
+
const item = cols[i];
|
|
12657
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12658
|
+
const targetColumn = getRootColumn($xeTable, column);
|
|
12659
|
+
if (targetColumn && targetColumn.fixed !== fixed) {
|
|
12660
|
+
// 是否超过最大固定列数量
|
|
12661
|
+
if (!targetColumn.fixed && isMaxFixedColumn) {
|
|
12662
|
+
if (core_.VxeUI.modal) {
|
|
12663
|
+
core_.VxeUI.modal.message({
|
|
12664
|
+
status: 'error',
|
|
12665
|
+
content: table_getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
|
|
12666
|
+
});
|
|
12667
|
+
}
|
|
12668
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12669
|
+
}
|
|
12670
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
|
|
12671
|
+
column.fixed = fixed;
|
|
12672
|
+
});
|
|
12673
|
+
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
12674
|
+
if (!status) {
|
|
12675
|
+
status = true;
|
|
12666
12676
|
}
|
|
12667
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12668
12677
|
}
|
|
12669
|
-
|
|
12670
|
-
|
|
12671
|
-
});
|
|
12672
|
-
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
12678
|
+
}
|
|
12679
|
+
if (status) {
|
|
12673
12680
|
return tableMethods.refreshColumn();
|
|
12674
12681
|
}
|
|
12675
12682
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -12678,13 +12685,22 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12678
12685
|
* 取消指定固定列
|
|
12679
12686
|
*/
|
|
12680
12687
|
clearColumnFixed(fieldOrColumn) {
|
|
12681
|
-
|
|
12682
|
-
const
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
+
let status = false;
|
|
12689
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12690
|
+
cols.forEach(item => {
|
|
12691
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12692
|
+
const targetColumn = getRootColumn($xeTable, column);
|
|
12693
|
+
if (targetColumn && targetColumn.fixed) {
|
|
12694
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
|
|
12695
|
+
column.fixed = null;
|
|
12696
|
+
});
|
|
12697
|
+
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
12698
|
+
if (!status) {
|
|
12699
|
+
status = true;
|
|
12700
|
+
}
|
|
12701
|
+
}
|
|
12702
|
+
});
|
|
12703
|
+
if (status) {
|
|
12688
12704
|
return tableMethods.refreshColumn();
|
|
12689
12705
|
}
|
|
12690
12706
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -12693,9 +12709,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12693
12709
|
* 隐藏指定列
|
|
12694
12710
|
*/
|
|
12695
12711
|
hideColumn(fieldOrColumn) {
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12712
|
+
let status = false;
|
|
12713
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12714
|
+
cols.forEach(item => {
|
|
12715
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12716
|
+
if (column && column.visible) {
|
|
12717
|
+
column.visible = false;
|
|
12718
|
+
if (!status) {
|
|
12719
|
+
status = true;
|
|
12720
|
+
}
|
|
12721
|
+
}
|
|
12722
|
+
});
|
|
12723
|
+
if (status) {
|
|
12699
12724
|
return tablePrivateMethods.handleCustom();
|
|
12700
12725
|
}
|
|
12701
12726
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -12704,25 +12729,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12704
12729
|
* 显示指定列
|
|
12705
12730
|
*/
|
|
12706
12731
|
showColumn(fieldOrColumn) {
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12732
|
+
let status = false;
|
|
12733
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12734
|
+
cols.forEach(item => {
|
|
12735
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12736
|
+
if (column && !column.visible) {
|
|
12737
|
+
column.visible = true;
|
|
12738
|
+
if (!status) {
|
|
12739
|
+
status = true;
|
|
12740
|
+
}
|
|
12741
|
+
}
|
|
12742
|
+
});
|
|
12743
|
+
if (status) {
|
|
12710
12744
|
return tablePrivateMethods.handleCustom();
|
|
12711
12745
|
}
|
|
12712
12746
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12713
12747
|
},
|
|
12714
12748
|
setColumnWidth(fieldOrColumn, width) {
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
if (
|
|
12720
|
-
const
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12749
|
+
let status = false;
|
|
12750
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12751
|
+
cols.forEach(item => {
|
|
12752
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12753
|
+
if (column) {
|
|
12754
|
+
const colWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
|
|
12755
|
+
let rdWidth = colWidth;
|
|
12756
|
+
if (isScale(width)) {
|
|
12757
|
+
const tableBody = refTableBody.value;
|
|
12758
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
12759
|
+
const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0;
|
|
12760
|
+
rdWidth = Math.floor(colWidth * bodyWidth);
|
|
12761
|
+
}
|
|
12762
|
+
column.resizeWidth = rdWidth;
|
|
12763
|
+
if (!status) {
|
|
12764
|
+
status = true;
|
|
12765
|
+
}
|
|
12724
12766
|
}
|
|
12725
|
-
|
|
12767
|
+
});
|
|
12768
|
+
if (status) {
|
|
12726
12769
|
return tableMethods.refreshColumn();
|
|
12727
12770
|
}
|
|
12728
12771
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -13850,16 +13893,34 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13850
13893
|
*/
|
|
13851
13894
|
scrollTo(scrollLeft, scrollTop) {
|
|
13852
13895
|
const tableBody = refTableBody.value;
|
|
13896
|
+
const tableHeader = refTableHeader.value;
|
|
13853
13897
|
const tableFooter = refTableFooter.value;
|
|
13898
|
+
const leftBody = refTableLeftBody.value;
|
|
13854
13899
|
const rightBody = refTableRightBody.value;
|
|
13855
13900
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
13901
|
+
const leftBodyElem = leftBody ? leftBody.$el : null;
|
|
13856
13902
|
const rightBodyElem = rightBody ? rightBody.$el : null;
|
|
13903
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
13857
13904
|
const tableFooterElem = tableFooter ? tableFooter.$el : null;
|
|
13858
13905
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
13859
|
-
|
|
13906
|
+
const xHandleEl = refScrollXHandleElem.value;
|
|
13907
|
+
if (xHandleEl) {
|
|
13908
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
13909
|
+
} else {
|
|
13910
|
+
setScrollLeft(tableBodyElem, scrollLeft);
|
|
13911
|
+
setScrollLeft(tableHeaderElem, scrollLeft);
|
|
13912
|
+
setScrollLeft(tableFooterElem, scrollLeft);
|
|
13913
|
+
}
|
|
13860
13914
|
}
|
|
13861
13915
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollTop)) {
|
|
13862
|
-
|
|
13916
|
+
const yHandleEl = refScrollYHandleElem.value;
|
|
13917
|
+
if (yHandleEl) {
|
|
13918
|
+
setScrollTop(yHandleEl, scrollTop);
|
|
13919
|
+
} else {
|
|
13920
|
+
setScrollTop(tableBodyElem, scrollTop);
|
|
13921
|
+
setScrollTop(leftBodyElem, scrollTop);
|
|
13922
|
+
setScrollTop(rightBodyElem, scrollTop);
|
|
13923
|
+
}
|
|
13863
13924
|
}
|
|
13864
13925
|
if (reactData.scrollXLoad || reactData.scrollYLoad) {
|
|
13865
13926
|
return new Promise(resolve => {
|
|
@@ -14813,6 +14874,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14813
14874
|
});
|
|
14814
14875
|
}
|
|
14815
14876
|
};
|
|
14877
|
+
const updateRowDropOrigin = row => {
|
|
14878
|
+
const el = refElem.value;
|
|
14879
|
+
if (el) {
|
|
14880
|
+
const clss = 'row--drag-origin';
|
|
14881
|
+
const rowid = getRowid($xeTable, row);
|
|
14882
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), elem => {
|
|
14883
|
+
addClass(elem, clss);
|
|
14884
|
+
});
|
|
14885
|
+
}
|
|
14886
|
+
};
|
|
14816
14887
|
const clearRowDropTarget = () => {
|
|
14817
14888
|
const el = refElem.value;
|
|
14818
14889
|
if (el) {
|
|
@@ -14822,6 +14893,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14822
14893
|
});
|
|
14823
14894
|
}
|
|
14824
14895
|
};
|
|
14896
|
+
const updateRowDropTarget = (row, dragPos) => {
|
|
14897
|
+
const el = refElem.value;
|
|
14898
|
+
if (el) {
|
|
14899
|
+
const clss = 'row--drag-active-target';
|
|
14900
|
+
const rowid = getRowid($xeTable, row);
|
|
14901
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), elem => {
|
|
14902
|
+
addClass(elem, clss);
|
|
14903
|
+
elem.setAttribute('drag-pos', dragPos);
|
|
14904
|
+
});
|
|
14905
|
+
}
|
|
14906
|
+
};
|
|
14825
14907
|
const showRowDropTip = evnt => {
|
|
14826
14908
|
const rdTipEl = refRowDragTipElem.value;
|
|
14827
14909
|
if (!rdTipEl) {
|
|
@@ -16207,7 +16289,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16207
16289
|
} = reactData;
|
|
16208
16290
|
const {
|
|
16209
16291
|
afterFullData,
|
|
16292
|
+
afterTreeFullData,
|
|
16210
16293
|
tableFullData,
|
|
16294
|
+
tableFullTreeData,
|
|
16211
16295
|
prevDragRow,
|
|
16212
16296
|
prevDragPos
|
|
16213
16297
|
} = internalData;
|
|
@@ -16222,18 +16306,35 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16222
16306
|
return;
|
|
16223
16307
|
}
|
|
16224
16308
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
16225
|
-
|
|
16226
|
-
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
-
|
|
16230
|
-
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16309
|
+
let oafIndex = -1;
|
|
16310
|
+
let nafIndex = -1;
|
|
16311
|
+
if (treeConfig) {
|
|
16312
|
+
// 移出源位置
|
|
16313
|
+
oafIndex = $xeTable.findRowIndexOf(afterTreeFullData, dragRow);
|
|
16314
|
+
const otfIndex = $xeTable.findRowIndexOf(tableFullTreeData, dragRow);
|
|
16315
|
+
afterTreeFullData.splice(oafIndex, 1);
|
|
16316
|
+
tableFullTreeData.splice(otfIndex, 1);
|
|
16317
|
+
// 插新位置
|
|
16318
|
+
const pafIndex = $xeTable.findRowIndexOf(afterTreeFullData, prevDragRow);
|
|
16319
|
+
const ptfIndex = $xeTable.findRowIndexOf(tableFullTreeData, prevDragRow);
|
|
16320
|
+
nafIndex = pafIndex + dragOffsetIndex;
|
|
16321
|
+
const ntfIndex = ptfIndex + dragOffsetIndex;
|
|
16322
|
+
afterTreeFullData.splice(nafIndex, 0, dragRow);
|
|
16323
|
+
tableFullTreeData.splice(ntfIndex, 0, dragRow);
|
|
16324
|
+
} else {
|
|
16325
|
+
// 移出源位置
|
|
16326
|
+
oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
|
|
16327
|
+
const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
|
|
16328
|
+
afterFullData.splice(oafIndex, 1);
|
|
16329
|
+
tableFullData.splice(otfIndex, 1);
|
|
16330
|
+
// 插新位置
|
|
16331
|
+
const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
|
|
16332
|
+
const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
|
|
16333
|
+
nafIndex = pafIndex + dragOffsetIndex;
|
|
16334
|
+
const ntfIndex = ptfIndex + dragOffsetIndex;
|
|
16335
|
+
afterFullData.splice(nafIndex, 0, dragRow);
|
|
16336
|
+
tableFullData.splice(ntfIndex, 0, dragRow);
|
|
16337
|
+
}
|
|
16237
16338
|
reactData.isDragRowMove = true;
|
|
16238
16339
|
$xeTable.cacheRowMap();
|
|
16239
16340
|
$xeTable.updateScrollYStatus();
|
|
@@ -16282,8 +16383,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16282
16383
|
} = reactData;
|
|
16283
16384
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
16284
16385
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
16285
|
-
|
|
16286
|
-
trEl.setAttribute('drag-pos', dragPos);
|
|
16386
|
+
updateRowDropTarget(row, dragPos);
|
|
16287
16387
|
internalData.prevDragRow = row;
|
|
16288
16388
|
internalData.prevDragPos = dragPos;
|
|
16289
16389
|
dispatchEvent('row-dragover', {
|
|
@@ -16316,7 +16416,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16316
16416
|
}
|
|
16317
16417
|
reactData.dragRow = row;
|
|
16318
16418
|
trEl.draggable = true;
|
|
16319
|
-
|
|
16419
|
+
updateRowDropOrigin(row);
|
|
16320
16420
|
showRowDropTip(evnt);
|
|
16321
16421
|
updateRowDropTipContent(tdEl);
|
|
16322
16422
|
dispatchEvent('row-dragstart', params, evnt);
|
|
@@ -16333,7 +16433,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16333
16433
|
triggerScrollXEvent() {
|
|
16334
16434
|
loadScrollXData();
|
|
16335
16435
|
},
|
|
16336
|
-
handleScrollEvent(evnt, isRollY, isRollX, params) {
|
|
16436
|
+
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
16337
16437
|
const {
|
|
16338
16438
|
highlightHoverRow
|
|
16339
16439
|
} = props;
|
|
@@ -16351,20 +16451,39 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16351
16451
|
if (tooltip && tooltip.reactData.visible) {
|
|
16352
16452
|
tooltip.close();
|
|
16353
16453
|
}
|
|
16354
|
-
if (isRollX) {
|
|
16355
|
-
tablePrivateMethods.checkScrolling();
|
|
16356
|
-
}
|
|
16357
16454
|
const bodyHeight = bodyElem ? bodyElem.clientHeight : 0;
|
|
16358
16455
|
const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
|
|
16359
16456
|
const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
|
|
16360
16457
|
const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
|
|
16458
|
+
let isTop = false;
|
|
16459
|
+
let isBottom = false;
|
|
16460
|
+
let isLeft = false;
|
|
16461
|
+
let isRight = false;
|
|
16462
|
+
if (isRollX) {
|
|
16463
|
+
isLeft = scrollLeft <= 0;
|
|
16464
|
+
if (!isTop) {
|
|
16465
|
+
isRight = scrollLeft + bodyWidth >= scrollWidth;
|
|
16466
|
+
}
|
|
16467
|
+
tablePrivateMethods.checkScrolling();
|
|
16468
|
+
} else {
|
|
16469
|
+
isTop = scrollTop <= 0;
|
|
16470
|
+
if (!isTop) {
|
|
16471
|
+
isBottom = scrollTop + bodyHeight >= scrollHeight;
|
|
16472
|
+
}
|
|
16473
|
+
}
|
|
16361
16474
|
const evntParams = {
|
|
16475
|
+
scrollTop,
|
|
16476
|
+
scrollLeft,
|
|
16362
16477
|
bodyHeight,
|
|
16363
16478
|
bodyWidth,
|
|
16364
16479
|
scrollHeight,
|
|
16365
16480
|
scrollWidth,
|
|
16366
16481
|
isX: isRollX,
|
|
16367
16482
|
isY: isRollY,
|
|
16483
|
+
isTop,
|
|
16484
|
+
isBottom,
|
|
16485
|
+
isLeft,
|
|
16486
|
+
isRight,
|
|
16368
16487
|
...params
|
|
16369
16488
|
};
|
|
16370
16489
|
dispatchEvent('scroll', evntParams, evnt);
|