vxe-table 3.13.0 → 3.13.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/mixin.js +9 -6
- package/es/table/src/methods.js +51 -21
- package/es/table/src/table.js +13 -10
- package/es/table/style.css +2 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- 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 -39
- 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/mixin.js +10 -7
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/methods.js +51 -20
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +14 -10
- 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 +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/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/mixin.ts +9 -6
- package/packages/table/src/methods.ts +54 -23
- package/packages/table/src/table.ts +17 -11
- package/styles/components/table.scss +2 -0
- /package/es/{iconfont.1739842422207.ttf → iconfont.1739871566624.ttf} +0 -0
- /package/es/{iconfont.1739842422207.woff → iconfont.1739871566624.woff} +0 -0
- /package/es/{iconfont.1739842422207.woff2 → iconfont.1739871566624.woff2} +0 -0
- /package/lib/{iconfont.1739842422207.ttf → iconfont.1739871566624.ttf} +0 -0
- /package/lib/{iconfont.1739842422207.woff → iconfont.1739871566624.woff} +0 -0
- /package/lib/{iconfont.1739842422207.woff2 → iconfont.1739871566624.woff2} +0 -0
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.13.
|
|
2223
|
+
const version = "3.13.2";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
|
|
|
2843
2843
|
const {
|
|
2844
2844
|
log: log_log
|
|
2845
2845
|
} = core_.VxeUI;
|
|
2846
|
-
const log_version = `table v${"3.13.
|
|
2846
|
+
const log_version = `table v${"3.13.2"}`;
|
|
2847
2847
|
const warnLog = log_log.create('warn', log_version);
|
|
2848
2848
|
const errLog = log_log.create('error', log_version);
|
|
2849
2849
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -7161,7 +7161,12 @@ const getWheelSpeed = lastScrollTime => {
|
|
|
7161
7161
|
}
|
|
7162
7162
|
return multiple;
|
|
7163
7163
|
};
|
|
7164
|
-
const
|
|
7164
|
+
const wheelScrollLeftTo = (scrollLeft, cb) => {
|
|
7165
|
+
requestAnimationFrame(() => {
|
|
7166
|
+
cb(scrollLeft);
|
|
7167
|
+
});
|
|
7168
|
+
};
|
|
7169
|
+
const wheelScrollTopTo = (diffNum, cb) => {
|
|
7165
7170
|
const duration = Math.abs(diffNum);
|
|
7166
7171
|
const startTime = performance.now();
|
|
7167
7172
|
let countTop = 0;
|
|
@@ -14432,6 +14437,9 @@ const Methods = {
|
|
|
14432
14437
|
scrollRenderType,
|
|
14433
14438
|
inFooterScroll
|
|
14434
14439
|
} = internalData;
|
|
14440
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
14441
|
+
return;
|
|
14442
|
+
}
|
|
14435
14443
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
14436
14444
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
14437
14445
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -14440,9 +14448,6 @@ const Methods = {
|
|
|
14440
14448
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
14441
14449
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
14442
14450
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
14443
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
14444
|
-
return;
|
|
14445
|
-
}
|
|
14446
14451
|
if (intoRunScroll) {
|
|
14447
14452
|
return;
|
|
14448
14453
|
}
|
|
@@ -14519,17 +14524,17 @@ const Methods = {
|
|
|
14519
14524
|
inBodyScroll,
|
|
14520
14525
|
inFooterScroll
|
|
14521
14526
|
} = internalData;
|
|
14522
|
-
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
14523
|
-
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
14524
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14525
|
-
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
14526
|
-
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
14527
14527
|
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
14528
14528
|
return;
|
|
14529
14529
|
}
|
|
14530
14530
|
if (intoRunScroll) {
|
|
14531
14531
|
return;
|
|
14532
14532
|
}
|
|
14533
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
14534
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
14535
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14536
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
14537
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
14533
14538
|
if (!headerScrollElem) {
|
|
14534
14539
|
return;
|
|
14535
14540
|
}
|
|
@@ -14570,14 +14575,14 @@ const Methods = {
|
|
|
14570
14575
|
inHeaderScroll,
|
|
14571
14576
|
inBodyScroll
|
|
14572
14577
|
} = internalData;
|
|
14578
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
14579
|
+
return;
|
|
14580
|
+
}
|
|
14573
14581
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
14574
14582
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
14575
14583
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14576
14584
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
14577
14585
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
14578
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
14579
|
-
return;
|
|
14580
|
-
}
|
|
14581
14586
|
if (intoRunScroll) {
|
|
14582
14587
|
return;
|
|
14583
14588
|
}
|
|
@@ -14623,8 +14628,14 @@ const Methods = {
|
|
|
14623
14628
|
highlightHoverRow
|
|
14624
14629
|
} = tableProps;
|
|
14625
14630
|
const {
|
|
14631
|
+
scrollXLoad,
|
|
14626
14632
|
scrollYLoad
|
|
14627
14633
|
} = reactData;
|
|
14634
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
14635
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
14636
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
14637
|
+
return;
|
|
14638
|
+
}
|
|
14628
14639
|
const {
|
|
14629
14640
|
elemStore,
|
|
14630
14641
|
lastScrollTop,
|
|
@@ -14634,7 +14645,9 @@ const Methods = {
|
|
|
14634
14645
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
14635
14646
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
14636
14647
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
14648
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
14637
14649
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14650
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
14638
14651
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
14639
14652
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
14640
14653
|
if (!xHandleEl) {
|
|
@@ -14647,25 +14660,43 @@ const Methods = {
|
|
|
14647
14660
|
return;
|
|
14648
14661
|
}
|
|
14649
14662
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
14650
|
-
const deltaTop = deltaY * wheelSpeed;
|
|
14651
|
-
const deltaLeft = deltaX * wheelSpeed;
|
|
14663
|
+
const deltaTop = Math.ceil(deltaY * wheelSpeed);
|
|
14664
|
+
const deltaLeft = Math.ceil(deltaX * wheelSpeed);
|
|
14652
14665
|
const isTopWheel = deltaTop < 0;
|
|
14653
14666
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
14654
14667
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
14655
14668
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
14656
14669
|
return;
|
|
14657
14670
|
}
|
|
14658
|
-
const scrollTop =
|
|
14671
|
+
const scrollTop = currScrollTop + deltaTop;
|
|
14659
14672
|
const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
|
|
14660
14673
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
14661
14674
|
const isRollY = scrollTop !== lastScrollTop;
|
|
14675
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
14676
|
+
$xeTable.clearHoverRow();
|
|
14677
|
+
}
|
|
14662
14678
|
// 用于鼠标纵向滚轮处理
|
|
14679
|
+
if (isRollX) {
|
|
14680
|
+
evnt.preventDefault();
|
|
14681
|
+
internalData.inWheelScroll = true;
|
|
14682
|
+
wheelScrollLeftTo(scrollLeft, offsetLeft => {
|
|
14683
|
+
const currLeftNum = offsetLeft;
|
|
14684
|
+
setScrollLeft(xHandleEl, currLeftNum);
|
|
14685
|
+
setScrollLeft(bodyScrollElem, currLeftNum);
|
|
14686
|
+
setScrollLeft(headerScrollElem, currLeftNum);
|
|
14687
|
+
setScrollLeft(footerScrollElem, currLeftNum);
|
|
14688
|
+
if (scrollXLoad) {
|
|
14689
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
14690
|
+
}
|
|
14691
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
14692
|
+
type: 'table',
|
|
14693
|
+
fixed: ''
|
|
14694
|
+
});
|
|
14695
|
+
});
|
|
14696
|
+
}
|
|
14663
14697
|
if (isRollY) {
|
|
14664
14698
|
evnt.preventDefault();
|
|
14665
|
-
|
|
14666
|
-
$xeTable.clearHoverRow();
|
|
14667
|
-
}
|
|
14668
|
-
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
14699
|
+
wheelScrollTopTo(scrollTop - currScrollTop, offsetTop => {
|
|
14669
14700
|
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
14670
14701
|
internalData.inWheelScroll = true;
|
|
14671
14702
|
setScrollTop(yHandleEl, currTopNum);
|
|
@@ -14676,7 +14707,7 @@ const Methods = {
|
|
|
14676
14707
|
if (scrollYLoad) {
|
|
14677
14708
|
$xeTable.triggerScrollYEvent(evnt);
|
|
14678
14709
|
}
|
|
14679
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
14710
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
14680
14711
|
type: 'table',
|
|
14681
14712
|
fixed: ''
|
|
14682
14713
|
});
|
|
@@ -23140,12 +23171,12 @@ const convertToRows = originColumns => {
|
|
|
23140
23171
|
const {
|
|
23141
23172
|
mergeList,
|
|
23142
23173
|
mergeFooterList,
|
|
23143
|
-
isGroup
|
|
23144
|
-
tableGroupColumn
|
|
23174
|
+
isGroup
|
|
23145
23175
|
} = reactData;
|
|
23146
23176
|
const {
|
|
23147
23177
|
tableFullColumn,
|
|
23148
|
-
afterFullData
|
|
23178
|
+
afterFullData,
|
|
23179
|
+
collectColumn
|
|
23149
23180
|
} = internalData;
|
|
23150
23181
|
const exportOpts = $xeTable.computeExportOpts;
|
|
23151
23182
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -23175,7 +23206,7 @@ const convertToRows = originColumns => {
|
|
|
23175
23206
|
// beforeExportMethod: null,
|
|
23176
23207
|
// afterExportMethod: null
|
|
23177
23208
|
}, exportOpts, options);
|
|
23178
|
-
|
|
23209
|
+
let {
|
|
23179
23210
|
filename,
|
|
23180
23211
|
sheetName,
|
|
23181
23212
|
type,
|
|
@@ -23188,7 +23219,11 @@ const convertToRows = originColumns => {
|
|
|
23188
23219
|
excludeFields
|
|
23189
23220
|
} = opts;
|
|
23190
23221
|
let groups = [];
|
|
23191
|
-
const
|
|
23222
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
23223
|
+
if (!mode) {
|
|
23224
|
+
mode = selectRecords.length ? 'selected' : 'current';
|
|
23225
|
+
}
|
|
23226
|
+
const customCols = columns && columns.length ? columns : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(collectColumn, column => {
|
|
23192
23227
|
const isColGroup = column.children && column.children.length;
|
|
23193
23228
|
let isChecked = false;
|
|
23194
23229
|
if (columns && columns.length) {
|
|
@@ -23264,7 +23299,7 @@ const convertToRows = originColumns => {
|
|
|
23264
23299
|
original: true
|
|
23265
23300
|
});
|
|
23266
23301
|
} else {
|
|
23267
|
-
groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(isGroup ?
|
|
23302
|
+
groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({
|
|
23268
23303
|
column,
|
|
23269
23304
|
$columnIndex: index
|
|
23270
23305
|
})), {
|
|
@@ -23339,7 +23374,6 @@ const convertToRows = originColumns => {
|
|
|
23339
23374
|
if (!handleOptions.data) {
|
|
23340
23375
|
handleOptions.data = [];
|
|
23341
23376
|
if (mode === 'selected') {
|
|
23342
|
-
const selectRecords = $xeTable.getCheckboxRecords();
|
|
23343
23377
|
if (['html', 'pdf'].indexOf(type) > -1 && treeConfig) {
|
|
23344
23378
|
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, {
|
|
23345
23379
|
data: '_row'
|
|
@@ -25399,7 +25433,6 @@ function renderViewport(h, $xeTable) {
|
|
|
25399
25433
|
} = props;
|
|
25400
25434
|
const {
|
|
25401
25435
|
overflowX,
|
|
25402
|
-
scrollYLoad,
|
|
25403
25436
|
tableData,
|
|
25404
25437
|
tableColumn,
|
|
25405
25438
|
tableGroupColumn,
|
|
@@ -25410,16 +25443,9 @@ function renderViewport(h, $xeTable) {
|
|
|
25410
25443
|
leftList,
|
|
25411
25444
|
rightList
|
|
25412
25445
|
} = columnStore;
|
|
25413
|
-
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
25414
|
-
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
25415
|
-
const ons = {};
|
|
25416
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
25417
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
25418
|
-
}
|
|
25419
25446
|
return h('div', {
|
|
25420
25447
|
ref: 'refTableViewportElem',
|
|
25421
|
-
class: 'vxe-table--viewport-wrapper'
|
|
25422
|
-
on: ons
|
|
25448
|
+
class: 'vxe-table--viewport-wrapper'
|
|
25423
25449
|
}, [h('div', {
|
|
25424
25450
|
class: 'vxe-table--main-wrapper'
|
|
25425
25451
|
}, [
|
|
@@ -26353,6 +26379,7 @@ function renderBody(h, $xeTable) {
|
|
|
26353
26379
|
}
|
|
26354
26380
|
},
|
|
26355
26381
|
created() {
|
|
26382
|
+
const $xeTable = this;
|
|
26356
26383
|
const {
|
|
26357
26384
|
scrollXStore,
|
|
26358
26385
|
sYOpts,
|
|
@@ -26620,7 +26647,7 @@ function renderBody(h, $xeTable) {
|
|
|
26620
26647
|
table_globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent);
|
|
26621
26648
|
table_globalEvents.on(this, 'resize', this.handleGlobalResizeEvent);
|
|
26622
26649
|
table_globalEvents.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
|
|
26623
|
-
|
|
26650
|
+
$xeTable.preventEvent(null, 'created');
|
|
26624
26651
|
},
|
|
26625
26652
|
mounted() {
|
|
26626
26653
|
const $xeTable = this;
|
|
@@ -26669,6 +26696,12 @@ function renderBody(h, $xeTable) {
|
|
|
26669
26696
|
resizeObserver.observe(this.getParentElem());
|
|
26670
26697
|
this.$resize = resizeObserver;
|
|
26671
26698
|
}
|
|
26699
|
+
const tableViewportEl = $xeTable.$refs.refTableViewportElem;
|
|
26700
|
+
if (tableViewportEl) {
|
|
26701
|
+
tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, {
|
|
26702
|
+
passive: false
|
|
26703
|
+
});
|
|
26704
|
+
}
|
|
26672
26705
|
this.preventEvent(null, 'mounted');
|
|
26673
26706
|
},
|
|
26674
26707
|
activated() {
|
|
@@ -26679,6 +26712,11 @@ function renderBody(h, $xeTable) {
|
|
|
26679
26712
|
this.preventEvent(null, 'deactivated');
|
|
26680
26713
|
},
|
|
26681
26714
|
beforeDestroy() {
|
|
26715
|
+
const $xeTable = this;
|
|
26716
|
+
const tableViewportEl = $xeTable.$refs.refTableViewportElem;
|
|
26717
|
+
if (tableViewportEl) {
|
|
26718
|
+
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
26719
|
+
}
|
|
26682
26720
|
if (this.$resize) {
|
|
26683
26721
|
this.$resize.disconnect();
|
|
26684
26722
|
}
|