vxe-table 4.11.0 → 4.11.2
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/hook.js +9 -6
- package/es/table/src/table.js +65 -27
- package/es/table/style.css +2 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +3 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +2 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +77 -38
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/hook.js +10 -7
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/table.js +64 -27
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +2 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -3
- 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/lib/vxe-table/style/style.css +2 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/export/hook.ts +9 -6
- package/packages/table/src/table.ts +68 -31
- package/packages/ui/index.ts +2 -2
- package/styles/components/table.scss +2 -0
- /package/es/{iconfont.1739842441645.ttf → iconfont.1739871583820.ttf} +0 -0
- /package/es/{iconfont.1739842441645.woff → iconfont.1739871583820.woff} +0 -0
- /package/es/{iconfont.1739842441645.woff2 → iconfont.1739871583820.woff2} +0 -0
- /package/lib/{iconfont.1739842441645.ttf → iconfont.1739871583820.ttf} +0 -0
- /package/lib/{iconfont.1739842441645.woff → iconfont.1739871583820.woff} +0 -0
- /package/lib/{iconfont.1739842441645.woff2 → iconfont.1739871583820.woff2} +0 -0
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.11.
|
|
3141
|
+
const version = "4.11.2";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3335,8 +3335,8 @@ core_.VxeUI.setConfig({
|
|
|
3335
3335
|
virtualYConfig: {
|
|
3336
3336
|
enabled: true,
|
|
3337
3337
|
gt: 100,
|
|
3338
|
-
preSize:
|
|
3339
|
-
oSize:
|
|
3338
|
+
preSize: 0,
|
|
3339
|
+
oSize: 1
|
|
3340
3340
|
},
|
|
3341
3341
|
scrollbarConfig: {
|
|
3342
3342
|
// width: 0,
|
|
@@ -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.11.
|
|
3589
|
+
const log_version = `table v${"4.11.2"}`;
|
|
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
|
|
@@ -14103,7 +14103,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14103
14103
|
}
|
|
14104
14104
|
return multiple;
|
|
14105
14105
|
};
|
|
14106
|
-
const
|
|
14106
|
+
const wheelScrollLeftTo = (scrollLeft, cb) => {
|
|
14107
|
+
requestAnimationFrame(() => {
|
|
14108
|
+
cb(scrollLeft);
|
|
14109
|
+
});
|
|
14110
|
+
};
|
|
14111
|
+
const wheelScrollTopTo = (diffNum, cb) => {
|
|
14107
14112
|
const duration = Math.abs(diffNum);
|
|
14108
14113
|
const startTime = performance.now();
|
|
14109
14114
|
let countTop = 0;
|
|
@@ -20356,6 +20361,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20356
20361
|
scrollRenderType,
|
|
20357
20362
|
inFooterScroll
|
|
20358
20363
|
} = internalData;
|
|
20364
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
20365
|
+
return;
|
|
20366
|
+
}
|
|
20359
20367
|
const xHandleEl = refScrollXHandleElem.value;
|
|
20360
20368
|
const yHandleEl = refScrollYHandleElem.value;
|
|
20361
20369
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -20364,9 +20372,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20364
20372
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
20365
20373
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
20366
20374
|
const rowExpandEl = refRowExpandElem.value;
|
|
20367
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
20368
|
-
return;
|
|
20369
|
-
}
|
|
20370
20375
|
if (intoRunScroll) {
|
|
20371
20376
|
return;
|
|
20372
20377
|
}
|
|
@@ -20384,6 +20389,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20384
20389
|
return;
|
|
20385
20390
|
}
|
|
20386
20391
|
}
|
|
20392
|
+
console.log('triggerBodyScrollEvent', 11);
|
|
20387
20393
|
let scrollTop = yHandleEl.scrollTop;
|
|
20388
20394
|
let scrollLeft = xHandleEl.scrollLeft;
|
|
20389
20395
|
if (leftScrollElem && fixedType === 'left') {
|
|
@@ -20440,14 +20446,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20440
20446
|
inBodyScroll,
|
|
20441
20447
|
inFooterScroll
|
|
20442
20448
|
} = internalData;
|
|
20449
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
20450
|
+
return;
|
|
20451
|
+
}
|
|
20443
20452
|
const yHandleEl = refScrollYHandleElem.value;
|
|
20444
20453
|
const xHandleEl = refScrollXHandleElem.value;
|
|
20445
20454
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
20446
20455
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
20447
20456
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
20448
|
-
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
20449
|
-
return;
|
|
20450
|
-
}
|
|
20451
20457
|
if (intoRunScroll) {
|
|
20452
20458
|
return;
|
|
20453
20459
|
}
|
|
@@ -20460,6 +20466,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20460
20466
|
if (!yHandleEl) {
|
|
20461
20467
|
return;
|
|
20462
20468
|
}
|
|
20469
|
+
console.log('triggerHeaderScrollEvent', 11);
|
|
20463
20470
|
const scrollTop = yHandleEl.scrollTop;
|
|
20464
20471
|
const scrollLeft = headerScrollElem.scrollLeft;
|
|
20465
20472
|
const isRollX = true;
|
|
@@ -20488,14 +20495,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20488
20495
|
inHeaderScroll,
|
|
20489
20496
|
inBodyScroll
|
|
20490
20497
|
} = internalData;
|
|
20498
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
20499
|
+
return;
|
|
20500
|
+
}
|
|
20491
20501
|
const yHandleEl = refScrollYHandleElem.value;
|
|
20492
20502
|
const xHandleEl = refScrollXHandleElem.value;
|
|
20493
20503
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
20494
20504
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
20495
20505
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
20496
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
20497
|
-
return;
|
|
20498
|
-
}
|
|
20499
20506
|
if (intoRunScroll) {
|
|
20500
20507
|
return;
|
|
20501
20508
|
}
|
|
@@ -20508,6 +20515,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20508
20515
|
if (!yHandleEl) {
|
|
20509
20516
|
return;
|
|
20510
20517
|
}
|
|
20518
|
+
console.log('triggerFooterScrollEvent');
|
|
20511
20519
|
const scrollTop = yHandleEl.scrollTop;
|
|
20512
20520
|
const scrollLeft = footerScrollElem.scrollLeft;
|
|
20513
20521
|
const isRollX = true;
|
|
@@ -20537,8 +20545,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20537
20545
|
highlightHoverRow
|
|
20538
20546
|
} = src_props;
|
|
20539
20547
|
const {
|
|
20548
|
+
scrollXLoad,
|
|
20540
20549
|
scrollYLoad
|
|
20541
20550
|
} = reactData;
|
|
20551
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
20552
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
20553
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
20554
|
+
return;
|
|
20555
|
+
}
|
|
20542
20556
|
const {
|
|
20543
20557
|
elemStore,
|
|
20544
20558
|
lastScrollTop,
|
|
@@ -20548,7 +20562,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20548
20562
|
const xHandleEl = refScrollXHandleElem.value;
|
|
20549
20563
|
const yHandleEl = refScrollYHandleElem.value;
|
|
20550
20564
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
20565
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
20551
20566
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
20567
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
20552
20568
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
20553
20569
|
const rowExpandEl = refRowExpandElem.value;
|
|
20554
20570
|
if (!xHandleEl) {
|
|
@@ -20561,25 +20577,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20561
20577
|
return;
|
|
20562
20578
|
}
|
|
20563
20579
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
20564
|
-
const deltaTop = deltaY * wheelSpeed;
|
|
20565
|
-
const deltaLeft = deltaX * wheelSpeed;
|
|
20580
|
+
const deltaTop = Math.ceil(deltaY * wheelSpeed);
|
|
20581
|
+
const deltaLeft = Math.ceil(deltaX * wheelSpeed);
|
|
20566
20582
|
const isTopWheel = deltaTop < 0;
|
|
20567
20583
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
20568
20584
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
20569
20585
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
20570
20586
|
return;
|
|
20571
20587
|
}
|
|
20572
|
-
const scrollTop =
|
|
20588
|
+
const scrollTop = currScrollTop + deltaTop;
|
|
20573
20589
|
const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
|
|
20574
20590
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
20575
20591
|
const isRollY = scrollTop !== lastScrollTop;
|
|
20592
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
20593
|
+
$xeTable.clearHoverRow();
|
|
20594
|
+
}
|
|
20576
20595
|
// 用于鼠标纵向滚轮处理
|
|
20596
|
+
if (isRollX) {
|
|
20597
|
+
evnt.preventDefault();
|
|
20598
|
+
internalData.inWheelScroll = true;
|
|
20599
|
+
wheelScrollLeftTo(scrollLeft, offsetLeft => {
|
|
20600
|
+
const currLeftNum = offsetLeft;
|
|
20601
|
+
setScrollLeft(xHandleEl, currLeftNum);
|
|
20602
|
+
setScrollLeft(bodyScrollElem, currLeftNum);
|
|
20603
|
+
setScrollLeft(headerScrollElem, currLeftNum);
|
|
20604
|
+
setScrollLeft(footerScrollElem, currLeftNum);
|
|
20605
|
+
if (scrollXLoad) {
|
|
20606
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20607
|
+
}
|
|
20608
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
20609
|
+
type: 'table',
|
|
20610
|
+
fixed: ''
|
|
20611
|
+
});
|
|
20612
|
+
});
|
|
20613
|
+
}
|
|
20577
20614
|
if (isRollY) {
|
|
20578
20615
|
evnt.preventDefault();
|
|
20579
|
-
|
|
20580
|
-
$xeTable.clearHoverRow();
|
|
20581
|
-
}
|
|
20582
|
-
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
20616
|
+
wheelScrollTopTo(scrollTop - currScrollTop, offsetTop => {
|
|
20583
20617
|
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
20584
20618
|
internalData.inWheelScroll = true;
|
|
20585
20619
|
setScrollTop(yHandleEl, currTopNum);
|
|
@@ -20590,7 +20624,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20590
20624
|
if (scrollYLoad) {
|
|
20591
20625
|
$xeTable.triggerScrollYEvent(evnt);
|
|
20592
20626
|
}
|
|
20593
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
20627
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
20594
20628
|
type: 'table',
|
|
20595
20629
|
fixed: ''
|
|
20596
20630
|
});
|
|
@@ -21239,7 +21273,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21239
21273
|
} = props;
|
|
21240
21274
|
const {
|
|
21241
21275
|
overflowX,
|
|
21242
|
-
scrollYLoad,
|
|
21243
21276
|
tableData,
|
|
21244
21277
|
tableColumn,
|
|
21245
21278
|
tableGroupColumn,
|
|
@@ -21250,16 +21283,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21250
21283
|
leftList,
|
|
21251
21284
|
rightList
|
|
21252
21285
|
} = columnStore;
|
|
21253
|
-
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
21254
|
-
const rightFixedWidth = computeRightFixedWidth.value;
|
|
21255
|
-
const ons = {};
|
|
21256
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
21257
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
21258
|
-
}
|
|
21259
21286
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21260
21287
|
ref: refTableViewportElem,
|
|
21261
|
-
class: 'vxe-table--viewport-wrapper'
|
|
21262
|
-
...ons
|
|
21288
|
+
class: 'vxe-table--viewport-wrapper'
|
|
21263
21289
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21264
21290
|
class: 'vxe-table--main-wrapper'
|
|
21265
21291
|
}, [
|
|
@@ -21919,6 +21945,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21919
21945
|
}
|
|
21920
21946
|
}
|
|
21921
21947
|
});
|
|
21948
|
+
const tableViewportEl = refTableViewportElem.value;
|
|
21949
|
+
if (tableViewportEl) {
|
|
21950
|
+
tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, {
|
|
21951
|
+
passive: false
|
|
21952
|
+
});
|
|
21953
|
+
}
|
|
21922
21954
|
table_globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent);
|
|
21923
21955
|
table_globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent);
|
|
21924
21956
|
table_globalEvents.on($xeTable, 'cut', handleGlobalCutEvent);
|
|
@@ -21933,6 +21965,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21933
21965
|
});
|
|
21934
21966
|
});
|
|
21935
21967
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
21968
|
+
const tableViewportEl = refTableViewportElem.value;
|
|
21969
|
+
if (tableViewportEl) {
|
|
21970
|
+
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
21971
|
+
}
|
|
21936
21972
|
if (resizeObserver) {
|
|
21937
21973
|
resizeObserver.disconnect();
|
|
21938
21974
|
}
|
|
@@ -25402,12 +25438,12 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
25402
25438
|
const {
|
|
25403
25439
|
mergeList,
|
|
25404
25440
|
mergeFooterList,
|
|
25405
|
-
isGroup
|
|
25406
|
-
tableGroupColumn
|
|
25441
|
+
isGroup
|
|
25407
25442
|
} = reactData;
|
|
25408
25443
|
const {
|
|
25409
25444
|
tableFullColumn,
|
|
25410
|
-
afterFullData
|
|
25445
|
+
afterFullData,
|
|
25446
|
+
collectColumn
|
|
25411
25447
|
} = internalData;
|
|
25412
25448
|
const exportOpts = computeExportOpts.value;
|
|
25413
25449
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -25437,7 +25473,7 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
25437
25473
|
// beforeExportMethod: null,
|
|
25438
25474
|
// afterExportMethod: null
|
|
25439
25475
|
}, exportOpts, options);
|
|
25440
|
-
|
|
25476
|
+
let {
|
|
25441
25477
|
filename,
|
|
25442
25478
|
sheetName,
|
|
25443
25479
|
type,
|
|
@@ -25450,7 +25486,11 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
25450
25486
|
excludeFields
|
|
25451
25487
|
} = opts;
|
|
25452
25488
|
let groups = [];
|
|
25453
|
-
const
|
|
25489
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
25490
|
+
if (!mode) {
|
|
25491
|
+
mode = selectRecords.length ? 'selected' : 'current';
|
|
25492
|
+
}
|
|
25493
|
+
const customCols = columns && columns.length ? columns : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(collectColumn, column => {
|
|
25454
25494
|
const isColGroup = column.children && column.children.length;
|
|
25455
25495
|
let isChecked = false;
|
|
25456
25496
|
if (columns && columns.length) {
|
|
@@ -25526,7 +25566,7 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
25526
25566
|
original: true
|
|
25527
25567
|
});
|
|
25528
25568
|
} else {
|
|
25529
|
-
groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(isGroup ?
|
|
25569
|
+
groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({
|
|
25530
25570
|
column,
|
|
25531
25571
|
$columnIndex: index
|
|
25532
25572
|
})), {
|
|
@@ -25601,7 +25641,6 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
25601
25641
|
if (!handleOptions.data) {
|
|
25602
25642
|
handleOptions.data = [];
|
|
25603
25643
|
if (mode === 'selected') {
|
|
25604
|
-
const selectRecords = $xeTable.getCheckboxRecords();
|
|
25605
25644
|
if (['html', 'pdf'].indexOf(type) > -1 && treeConfig) {
|
|
25606
25645
|
handleOptions.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree($xeTable.getTableData().fullData, item => $xeTable.findRowIndexOf(selectRecords, item) > -1, Object.assign({}, treeOpts, {
|
|
25607
25646
|
data: '_row'
|