vxe-table 4.23.0-beta.1 → 4.23.0-beta.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/README.md +2 -2
- package/dist/all.esm.js +499 -87
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- 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/src/props.js +6 -2
- package/es/table/src/scrollbar.js +54 -0
- package/es/table/src/table.js +427 -81
- package/es/table/src/util.js +11 -2
- package/es/table/style.css +30 -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 +30 -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 +106 -28
- 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/props.js +6 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/scrollbar.js +63 -0
- package/lib/table/src/scrollbar.min.js +1 -0
- package/lib/table/src/table.js +32 -22
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +11 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +30 -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 +30 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/src/props.ts +6 -2
- package/packages/table/src/scrollbar.ts +57 -0
- package/packages/table/src/table.ts +459 -83
- package/packages/table/src/util.ts +15 -2
- package/styles/components/table.scss +65 -0
- /package/es/{iconfont.1791954193706.ttf → iconfont.1792035024476.ttf} +0 -0
- /package/es/{iconfont.1791954193706.woff → iconfont.1792035024476.woff} +0 -0
- /package/es/{iconfont.1791954193706.woff2 → iconfont.1792035024476.woff2} +0 -0
- /package/lib/{iconfont.1791954193706.ttf → iconfont.1792035024476.ttf} +0 -0
- /package/lib/{iconfont.1791954193706.woff → iconfont.1792035024476.woff} +0 -0
- /package/lib/{iconfont.1791954193706.woff2 → iconfont.1792035024476.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -7,6 +7,7 @@ import { VxeUI } from '../../ui';
|
|
|
7
7
|
import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util';
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
10
|
+
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from './scrollbar';
|
|
10
11
|
import { createComponentLog } from '../../ui/src/log';
|
|
11
12
|
import { getCrossTableDragRowInfo } from './store';
|
|
12
13
|
import Cell from './cell';
|
|
@@ -29,7 +30,7 @@ import '../module/validator/hook';
|
|
|
29
30
|
import '../module/custom/hook';
|
|
30
31
|
import '../render';
|
|
31
32
|
const { warnLog, errLog } = createComponentLog('table');
|
|
32
|
-
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI;
|
|
33
|
+
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, domUtils, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI;
|
|
33
34
|
const supportMaxRow = 5e6;
|
|
34
35
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
35
36
|
const maxYHeight = 5e6;
|
|
@@ -104,6 +105,10 @@ export default defineVxeComponent({
|
|
|
104
105
|
const refScrollYBottomCornerElem = ref();
|
|
105
106
|
const refScrollXSpaceElem = ref();
|
|
106
107
|
const refScrollYSpaceElem = ref();
|
|
108
|
+
const refTrackXElem = ref();
|
|
109
|
+
const refTrackYElem = ref();
|
|
110
|
+
const refThumbXElem = ref();
|
|
111
|
+
const refThumbYElem = ref();
|
|
107
112
|
let $xeToolbar;
|
|
108
113
|
const computeTableId = computed(() => {
|
|
109
114
|
const { id } = props;
|
|
@@ -194,6 +199,36 @@ export default defineVxeComponent({
|
|
|
194
199
|
const scrollbarOpts = computeScrollbarOpts.value;
|
|
195
200
|
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {});
|
|
196
201
|
});
|
|
202
|
+
const computeScrollXHeight = computed(() => {
|
|
203
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
204
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
205
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
|
|
206
|
+
});
|
|
207
|
+
const computeScrollYWidth = computed(() => {
|
|
208
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
209
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
210
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width));
|
|
211
|
+
});
|
|
212
|
+
const computeScrollXVisible = computed(() => {
|
|
213
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
214
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
215
|
+
return getDefaultConfig(scrollbarXOpts.visible, scrollbarOpts.visible);
|
|
216
|
+
});
|
|
217
|
+
const computeScrollYVisible = computed(() => {
|
|
218
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
219
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
220
|
+
return getDefaultConfig(scrollbarYOpts.visible, scrollbarOpts.visible);
|
|
221
|
+
});
|
|
222
|
+
const computeScrollXAutoHide = computed(() => {
|
|
223
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
224
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
225
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
226
|
+
});
|
|
227
|
+
const computeScrollYAutoHide = computed(() => {
|
|
228
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
229
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
230
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
231
|
+
});
|
|
197
232
|
const computeScrollbarXToTop = computed(() => {
|
|
198
233
|
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
199
234
|
return scrollbarXOpts.position === 'top';
|
|
@@ -202,6 +237,23 @@ export default defineVxeComponent({
|
|
|
202
237
|
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
203
238
|
return scrollbarYOpts.position === 'left';
|
|
204
239
|
});
|
|
240
|
+
const computeScrollbarWrapperClss = computed(() => {
|
|
241
|
+
const { yThumbHeight, xThumbWidth } = reactData;
|
|
242
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
243
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
244
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
245
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
246
|
+
return domUtils.buildClass([
|
|
247
|
+
'vxe-scrollbar is--virtual',
|
|
248
|
+
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
249
|
+
`ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}`,
|
|
250
|
+
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
251
|
+
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
252
|
+
], {
|
|
253
|
+
'overflow-y': yThumbHeight,
|
|
254
|
+
'overflow-x': xThumbWidth
|
|
255
|
+
});
|
|
256
|
+
});
|
|
205
257
|
const computeScrollYThreshold = computed(() => {
|
|
206
258
|
const virtualYOpts = computeVirtualYOpts.value;
|
|
207
259
|
const { threshold } = virtualYOpts;
|
|
@@ -231,6 +283,10 @@ export default defineVxeComponent({
|
|
|
231
283
|
}
|
|
232
284
|
return cellOpts;
|
|
233
285
|
});
|
|
286
|
+
const computeCellHeitht = computed(() => {
|
|
287
|
+
const cellOpts = computeCellOpts.value;
|
|
288
|
+
return cellOpts.height;
|
|
289
|
+
});
|
|
234
290
|
const computeHeaderCellOpts = computed(() => {
|
|
235
291
|
const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
236
292
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
@@ -538,11 +594,8 @@ export default defineVxeComponent({
|
|
|
538
594
|
return '';
|
|
539
595
|
});
|
|
540
596
|
const computeTableStyle = computed(() => {
|
|
541
|
-
const
|
|
542
|
-
const
|
|
543
|
-
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
544
|
-
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width);
|
|
545
|
-
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height);
|
|
597
|
+
const barWidth = computeScrollYWidth.value;
|
|
598
|
+
const barHeight = computeScrollXHeight.value;
|
|
546
599
|
const stys = {};
|
|
547
600
|
if (barWidth || barHeight) {
|
|
548
601
|
stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight);
|
|
@@ -741,8 +794,15 @@ export default defineVxeComponent({
|
|
|
741
794
|
computeScrollbarOpts,
|
|
742
795
|
computeScrollbarXOpts,
|
|
743
796
|
computeScrollbarYOpts,
|
|
797
|
+
computeScrollXHeight,
|
|
798
|
+
computeScrollYWidth,
|
|
799
|
+
computeScrollXVisible,
|
|
800
|
+
computeScrollYVisible,
|
|
801
|
+
computeScrollXAutoHide,
|
|
802
|
+
computeScrollYAutoHide,
|
|
744
803
|
computeScrollbarXToTop,
|
|
745
804
|
computeScrollbarYToLeft,
|
|
805
|
+
computeScrollbarWrapperClss,
|
|
746
806
|
computeColumnOpts,
|
|
747
807
|
computeCurrentColumnOpts,
|
|
748
808
|
computeScrollXThreshold,
|
|
@@ -1863,14 +1923,6 @@ export default defineVxeComponent({
|
|
|
1863
1923
|
if (!bodyWrapperElem) {
|
|
1864
1924
|
return;
|
|
1865
1925
|
}
|
|
1866
|
-
const yHandleEl = refScrollYHandleElem.value;
|
|
1867
|
-
if (!yHandleEl) {
|
|
1868
|
-
return;
|
|
1869
|
-
}
|
|
1870
|
-
const xHandleEl = refScrollXHandleElem.value;
|
|
1871
|
-
if (!xHandleEl) {
|
|
1872
|
-
return;
|
|
1873
|
-
}
|
|
1874
1926
|
const columnOpts = computeColumnOpts.value;
|
|
1875
1927
|
let tWidth = 0;
|
|
1876
1928
|
const minCellWidth = 40; // 列宽最少限制 40px
|
|
@@ -2470,12 +2522,12 @@ export default defineVxeComponent({
|
|
|
2470
2522
|
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
|
|
2471
2523
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
2472
2524
|
}
|
|
2473
|
-
const
|
|
2474
|
-
const
|
|
2525
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
2526
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
2475
2527
|
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
2476
2528
|
let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
|
|
2477
|
-
const hideXScroll =
|
|
2478
|
-
if (
|
|
2529
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden';
|
|
2530
|
+
if (scrollXVisible === 'visible' || $xeGanttView) {
|
|
2479
2531
|
osbHeight = scrollbarHeight;
|
|
2480
2532
|
xScrollbarVisible = 'visible';
|
|
2481
2533
|
}
|
|
@@ -2484,12 +2536,12 @@ export default defineVxeComponent({
|
|
|
2484
2536
|
xScrollbarVisible = 'hidden';
|
|
2485
2537
|
}
|
|
2486
2538
|
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
2487
|
-
const
|
|
2488
|
-
if (
|
|
2539
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden';
|
|
2540
|
+
if (hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
|
|
2489
2541
|
osbWidth = 0;
|
|
2490
2542
|
yScrollbarVisible = 'hidden';
|
|
2491
2543
|
}
|
|
2492
|
-
else if (
|
|
2544
|
+
else if (scrollYVisible === 'visible') {
|
|
2493
2545
|
osbWidth = scrollbarWidth;
|
|
2494
2546
|
yScrollbarVisible = 'visible';
|
|
2495
2547
|
}
|
|
@@ -3297,7 +3349,6 @@ export default defineVxeComponent({
|
|
|
3297
3349
|
const calcScrollbar = () => {
|
|
3298
3350
|
const { scrollXWidth, scrollYHeight } = reactData;
|
|
3299
3351
|
const { elemStore } = internalData;
|
|
3300
|
-
const scrollbarOpts = computeScrollbarOpts.value;
|
|
3301
3352
|
const el = refElem.value;
|
|
3302
3353
|
if (!el || !el.clientWidth) {
|
|
3303
3354
|
return;
|
|
@@ -3307,20 +3358,29 @@ export default defineVxeComponent({
|
|
|
3307
3358
|
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
3308
3359
|
const xHandleEl = refScrollXHandleElem.value;
|
|
3309
3360
|
const yHandleEl = refScrollYHandleElem.value;
|
|
3361
|
+
const thumbXElem = refThumbXElem.value;
|
|
3362
|
+
const thumbYElem = refThumbYElem.value;
|
|
3310
3363
|
let overflowY = false;
|
|
3311
3364
|
let overflowX = false;
|
|
3312
3365
|
if (bodyWrapperElem) {
|
|
3313
|
-
const
|
|
3314
|
-
const
|
|
3315
|
-
const
|
|
3316
|
-
const barHeight = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
|
|
3366
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
3367
|
+
const barWidth = computeScrollYWidth.value;
|
|
3368
|
+
const barHeight = computeScrollXHeight.value;
|
|
3317
3369
|
overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
|
|
3318
|
-
|
|
3370
|
+
// 如果是虚拟滚动条
|
|
3371
|
+
if (thumbYElem) {
|
|
3372
|
+
reactData.scrollbarHeight = scrollbarOpts.padding ? thumbYElem.offsetWidth : 0;
|
|
3373
|
+
}
|
|
3374
|
+
else if (yHandleEl) {
|
|
3319
3375
|
reactData.scrollbarWidth = (barWidth || barHeight) || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14;
|
|
3320
3376
|
}
|
|
3321
3377
|
reactData.overflowY = overflowY;
|
|
3322
3378
|
overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
|
|
3323
|
-
|
|
3379
|
+
// 如果是虚拟滚动条
|
|
3380
|
+
if (thumbXElem) {
|
|
3381
|
+
reactData.scrollbarHeight = scrollbarOpts.padding ? thumbXElem.offsetHeight : 0;
|
|
3382
|
+
}
|
|
3383
|
+
else if (xHandleEl) {
|
|
3324
3384
|
reactData.scrollbarHeight = (barHeight || barWidth) || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
|
|
3325
3385
|
}
|
|
3326
3386
|
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
@@ -3387,6 +3447,10 @@ export default defineVxeComponent({
|
|
|
3387
3447
|
}
|
|
3388
3448
|
});
|
|
3389
3449
|
};
|
|
3450
|
+
const updateScrollbar = () => {
|
|
3451
|
+
updateThumbSize();
|
|
3452
|
+
updateThumbOffset();
|
|
3453
|
+
};
|
|
3390
3454
|
const defaultMinRunDelay = 50;
|
|
3391
3455
|
const handleLazyRecalculate = (reFull, reWidth, reHeight, options) => {
|
|
3392
3456
|
const minRunDelay = (options ? options.minRunDelay : defaultMinRunDelay) || defaultMinRunDelay;
|
|
@@ -3407,6 +3471,7 @@ export default defineVxeComponent({
|
|
|
3407
3471
|
const refreshDelay = resizeOpts.refreshDelay || 30;
|
|
3408
3472
|
const reDelay = rceDelay + refreshDelay;
|
|
3409
3473
|
const el = refElem.value;
|
|
3474
|
+
updateScrollbar();
|
|
3410
3475
|
if (el && el.clientWidth) {
|
|
3411
3476
|
autoCellWidth();
|
|
3412
3477
|
updateRowExpandStyle();
|
|
@@ -11422,6 +11487,18 @@ export default defineVxeComponent({
|
|
|
11422
11487
|
}
|
|
11423
11488
|
return nextTick();
|
|
11424
11489
|
},
|
|
11490
|
+
/**
|
|
11491
|
+
* @private
|
|
11492
|
+
*/
|
|
11493
|
+
updateScrollbar() {
|
|
11494
|
+
return updateScrollbar();
|
|
11495
|
+
},
|
|
11496
|
+
/**
|
|
11497
|
+
* @private
|
|
11498
|
+
*/
|
|
11499
|
+
updateThumbOffset() {
|
|
11500
|
+
return updateThumbOffset();
|
|
11501
|
+
},
|
|
11425
11502
|
/**
|
|
11426
11503
|
* 表头单元格按下事件
|
|
11427
11504
|
*/
|
|
@@ -12573,19 +12650,18 @@ export default defineVxeComponent({
|
|
|
12573
12650
|
},
|
|
12574
12651
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
12575
12652
|
const { highlightHoverRow } = props;
|
|
12576
|
-
const { lastScrollLeft, lastScrollTop } = internalData;
|
|
12577
|
-
const
|
|
12578
|
-
|
|
12579
|
-
if (!xHandleEl || !yHandleEl) {
|
|
12653
|
+
const { elemStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
12654
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
12655
|
+
if (!bodyScrollElem) {
|
|
12580
12656
|
return;
|
|
12581
12657
|
}
|
|
12582
12658
|
const rowOpts = computeRowOpts.value;
|
|
12583
12659
|
const validTip = refValidTooltip.value;
|
|
12584
12660
|
const tooltip = refTooltip.value;
|
|
12585
|
-
const bodyHeight =
|
|
12586
|
-
const bodyWidth =
|
|
12587
|
-
const scrollHeight =
|
|
12588
|
-
const scrollWidth =
|
|
12661
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
12662
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
12663
|
+
const scrollHeight = bodyScrollElem.scrollHeight;
|
|
12664
|
+
const scrollWidth = bodyScrollElem.scrollWidth;
|
|
12589
12665
|
let isTop = false;
|
|
12590
12666
|
let isBottom = false;
|
|
12591
12667
|
let isLeft = false;
|
|
@@ -12647,6 +12723,7 @@ export default defineVxeComponent({
|
|
|
12647
12723
|
isLeft,
|
|
12648
12724
|
isRight,
|
|
12649
12725
|
direction }, params);
|
|
12726
|
+
updateThumbOffset();
|
|
12650
12727
|
updateRowExpandStyle();
|
|
12651
12728
|
checkLastSyncScroll(isRollX, isRollY);
|
|
12652
12729
|
if (isRollX) {
|
|
@@ -12691,6 +12768,7 @@ export default defineVxeComponent({
|
|
|
12691
12768
|
}
|
|
12692
12769
|
},
|
|
12693
12770
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
12771
|
+
const { useScrollbar } = props;
|
|
12694
12772
|
const { scrollYLoad, scrollXLoad } = reactData;
|
|
12695
12773
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData;
|
|
12696
12774
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
@@ -12710,19 +12788,21 @@ export default defineVxeComponent({
|
|
|
12710
12788
|
if (!bodyScrollElem) {
|
|
12711
12789
|
return;
|
|
12712
12790
|
}
|
|
12713
|
-
if (!
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12791
|
+
if (!useScrollbar) {
|
|
12792
|
+
if (!xHandleEl) {
|
|
12793
|
+
return;
|
|
12794
|
+
}
|
|
12795
|
+
if (!yHandleEl) {
|
|
12796
|
+
return;
|
|
12797
|
+
}
|
|
12718
12798
|
}
|
|
12719
12799
|
if (inBodyScroll) {
|
|
12720
12800
|
if (scrollRenderType !== fixedType) {
|
|
12721
12801
|
return;
|
|
12722
12802
|
}
|
|
12723
12803
|
}
|
|
12724
|
-
let scrollTop =
|
|
12725
|
-
let scrollLeft =
|
|
12804
|
+
let scrollTop = 0;
|
|
12805
|
+
let scrollLeft = 0;
|
|
12726
12806
|
if (leftScrollElem && fixedType === 'left') {
|
|
12727
12807
|
scrollTop = leftScrollElem.scrollTop;
|
|
12728
12808
|
}
|
|
@@ -12863,8 +12943,8 @@ export default defineVxeComponent({
|
|
|
12863
12943
|
const rightFixedWidth = computeRightFixedWidth.value;
|
|
12864
12944
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
|
|
12865
12945
|
const rowOpts = computeRowOpts.value;
|
|
12866
|
-
const
|
|
12867
|
-
const
|
|
12946
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
12947
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
12868
12948
|
const xHandleEl = refScrollXHandleElem.value;
|
|
12869
12949
|
const yHandleEl = refScrollYHandleElem.value;
|
|
12870
12950
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -12887,14 +12967,14 @@ export default defineVxeComponent({
|
|
|
12887
12967
|
const isRollY = overflowY && scrollTop !== lastScrollTop;
|
|
12888
12968
|
if (isRollX) {
|
|
12889
12969
|
// 如果禁用滚动
|
|
12890
|
-
if (
|
|
12970
|
+
if (scrollXVisible === false || scrollXVisible === 'hidden') {
|
|
12891
12971
|
evnt.preventDefault();
|
|
12892
12972
|
return;
|
|
12893
12973
|
}
|
|
12894
12974
|
}
|
|
12895
12975
|
if (isRollY) {
|
|
12896
12976
|
// 如果禁用滚动
|
|
12897
|
-
if (
|
|
12977
|
+
if (scrollYVisible === false || scrollYVisible === 'hidden') {
|
|
12898
12978
|
evnt.preventDefault();
|
|
12899
12979
|
return;
|
|
12900
12980
|
}
|
|
@@ -13459,6 +13539,168 @@ export default defineVxeComponent({
|
|
|
13459
13539
|
return nextTick();
|
|
13460
13540
|
}
|
|
13461
13541
|
};
|
|
13542
|
+
const updateThumbSize = () => {
|
|
13543
|
+
const { elemStore } = internalData;
|
|
13544
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13545
|
+
if (!viewEl) {
|
|
13546
|
+
return;
|
|
13547
|
+
}
|
|
13548
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
13549
|
+
return;
|
|
13550
|
+
}
|
|
13551
|
+
const trackXEl = refTrackXElem.value;
|
|
13552
|
+
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
13553
|
+
const thumbXElem = refThumbXElem.value;
|
|
13554
|
+
if (thumbXElem) {
|
|
13555
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
13556
|
+
}
|
|
13557
|
+
reactData.xThumbWidth = xThumbWidth;
|
|
13558
|
+
const trackYEl = refTrackYElem.value;
|
|
13559
|
+
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
13560
|
+
const thumbYElem = refThumbYElem.value;
|
|
13561
|
+
if (thumbYElem) {
|
|
13562
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
13563
|
+
}
|
|
13564
|
+
reactData.yThumbHeight = yThumbHeight;
|
|
13565
|
+
};
|
|
13566
|
+
const updateThumbOffset = () => {
|
|
13567
|
+
const { elemStore } = internalData;
|
|
13568
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13569
|
+
if (!viewEl) {
|
|
13570
|
+
return;
|
|
13571
|
+
}
|
|
13572
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
13573
|
+
return;
|
|
13574
|
+
}
|
|
13575
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
13576
|
+
const trackXEl = refTrackXElem.value;
|
|
13577
|
+
const thumbXElem = refThumbXElem.value;
|
|
13578
|
+
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
13579
|
+
internalData.xThumbLeft = xThumbLeft;
|
|
13580
|
+
if (thumbXElem && xThumbWidth) {
|
|
13581
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
13582
|
+
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
13583
|
+
}
|
|
13584
|
+
const trackYEl = refTrackYElem.value;
|
|
13585
|
+
const thumbYElem = refThumbYElem.value;
|
|
13586
|
+
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
13587
|
+
internalData.yThumbTop = yThumbTop;
|
|
13588
|
+
if (thumbYElem && yThumbHeight) {
|
|
13589
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
13590
|
+
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
13591
|
+
}
|
|
13592
|
+
};
|
|
13593
|
+
const clickTrackXEvent = (evnt) => {
|
|
13594
|
+
const { elemStore } = internalData;
|
|
13595
|
+
const trackEl = evnt.currentTarget;
|
|
13596
|
+
if (trackEl !== evnt.target) {
|
|
13597
|
+
return;
|
|
13598
|
+
}
|
|
13599
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13600
|
+
if (!viewEl) {
|
|
13601
|
+
return;
|
|
13602
|
+
}
|
|
13603
|
+
const { xThumbWidth } = reactData;
|
|
13604
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
13605
|
+
viewEl.scrollTo({
|
|
13606
|
+
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
13607
|
+
behavior: 'auto'
|
|
13608
|
+
});
|
|
13609
|
+
};
|
|
13610
|
+
const clickTrackYEvent = (evnt) => {
|
|
13611
|
+
const { elemStore } = internalData;
|
|
13612
|
+
const trackEl = evnt.currentTarget;
|
|
13613
|
+
if (trackEl !== evnt.target) {
|
|
13614
|
+
return;
|
|
13615
|
+
}
|
|
13616
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13617
|
+
if (!viewEl) {
|
|
13618
|
+
return;
|
|
13619
|
+
}
|
|
13620
|
+
const { yThumbHeight } = reactData;
|
|
13621
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
13622
|
+
viewEl.scrollTo({
|
|
13623
|
+
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
13624
|
+
behavior: 'auto'
|
|
13625
|
+
});
|
|
13626
|
+
};
|
|
13627
|
+
const pointerdownThumbXEvent = (evnt) => {
|
|
13628
|
+
const { elemStore } = internalData;
|
|
13629
|
+
const thumbEl = evnt.currentTarget;
|
|
13630
|
+
internalData.isThumbDrag = true;
|
|
13631
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
13632
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13633
|
+
if (!viewEl) {
|
|
13634
|
+
return;
|
|
13635
|
+
}
|
|
13636
|
+
const { xThumbWidth } = reactData;
|
|
13637
|
+
const trackEl = thumbEl.parentElement;
|
|
13638
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
13639
|
+
const pointerPosition = evnt.clientX - trackRect.left;
|
|
13640
|
+
// 记录 thumb 的偏移
|
|
13641
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
13642
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
13643
|
+
};
|
|
13644
|
+
const pointermoveThumbXEvent = (evnt) => {
|
|
13645
|
+
const thumbEl = evnt.currentTarget;
|
|
13646
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
13647
|
+
return;
|
|
13648
|
+
}
|
|
13649
|
+
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
13650
|
+
if (isThumbDrag) {
|
|
13651
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13652
|
+
if (!viewEl) {
|
|
13653
|
+
return;
|
|
13654
|
+
}
|
|
13655
|
+
const { xThumbWidth } = reactData;
|
|
13656
|
+
const thumbEl = evnt.currentTarget;
|
|
13657
|
+
const trackEl = thumbEl.parentElement;
|
|
13658
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
13659
|
+
// 更新偏移
|
|
13660
|
+
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
13661
|
+
}
|
|
13662
|
+
};
|
|
13663
|
+
const cleatPointerThumbEvent = (evnt) => {
|
|
13664
|
+
const thumbEl = evnt.currentTarget;
|
|
13665
|
+
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
13666
|
+
internalData.isThumbDrag = false;
|
|
13667
|
+
};
|
|
13668
|
+
const pointerdownThumbYEvent = (evnt) => {
|
|
13669
|
+
const { elemStore } = internalData;
|
|
13670
|
+
const thumbEl = evnt.currentTarget;
|
|
13671
|
+
internalData.isThumbDrag = true;
|
|
13672
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
13673
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13674
|
+
if (!viewEl) {
|
|
13675
|
+
return;
|
|
13676
|
+
}
|
|
13677
|
+
const { yThumbHeight } = reactData;
|
|
13678
|
+
const trackEl = thumbEl.parentElement;
|
|
13679
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
13680
|
+
const pointerPosition = evnt.clientY - trackRect.top;
|
|
13681
|
+
// 记录 thumb 的偏移
|
|
13682
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
13683
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
13684
|
+
};
|
|
13685
|
+
const pointermoveThumbYEvent = (evnt) => {
|
|
13686
|
+
const thumbEl = evnt.currentTarget;
|
|
13687
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
13688
|
+
return;
|
|
13689
|
+
}
|
|
13690
|
+
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
13691
|
+
if (isThumbDrag) {
|
|
13692
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
13693
|
+
if (!viewEl) {
|
|
13694
|
+
return;
|
|
13695
|
+
}
|
|
13696
|
+
const { yThumbHeight } = reactData;
|
|
13697
|
+
const thumbEl = evnt.currentTarget;
|
|
13698
|
+
const trackEl = thumbEl.parentElement;
|
|
13699
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
13700
|
+
// 更新偏移
|
|
13701
|
+
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
13702
|
+
}
|
|
13703
|
+
};
|
|
13462
13704
|
// 检测对应模块是否安装
|
|
13463
13705
|
// 'openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').forEach(name => {
|
|
13464
13706
|
// ($xeTable as any)[name] = function () {
|
|
@@ -13483,6 +13725,8 @@ export default defineVxeComponent({
|
|
|
13483
13725
|
const scrollbarOpts = computeScrollbarOpts.value;
|
|
13484
13726
|
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
13485
13727
|
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
13728
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
13729
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
13486
13730
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
13487
13731
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
13488
13732
|
const isFixedLeft = fixedType === 'left';
|
|
@@ -13493,8 +13737,8 @@ export default defineVxeComponent({
|
|
|
13493
13737
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
13494
13738
|
class: [
|
|
13495
13739
|
`vxe-table--fixed-${fixedType}-wrapper`,
|
|
13496
|
-
`sx--${(
|
|
13497
|
-
`sy--${(
|
|
13740
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
13741
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
13498
13742
|
{
|
|
13499
13743
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
13500
13744
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
@@ -13758,6 +14002,7 @@ export default defineVxeComponent({
|
|
|
13758
14002
|
};
|
|
13759
14003
|
const renderScrollY = () => {
|
|
13760
14004
|
return h('div', {
|
|
14005
|
+
key: 'vsy',
|
|
13761
14006
|
ref: refScrollYVirtualElem,
|
|
13762
14007
|
class: 'vxe-table--scroll-y-virtual'
|
|
13763
14008
|
}, [
|
|
@@ -13795,12 +14040,15 @@ export default defineVxeComponent({
|
|
|
13795
14040
|
const scrollbarOpts = computeScrollbarOpts.value;
|
|
13796
14041
|
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
13797
14042
|
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
14043
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
14044
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
13798
14045
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
13799
14046
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
13800
14047
|
const { leftList, rightList } = columnStore;
|
|
13801
14048
|
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior;
|
|
13802
14049
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
13803
14050
|
return h('div', {
|
|
14051
|
+
key: 'tvw',
|
|
13804
14052
|
ref: refTableViewportElem,
|
|
13805
14053
|
class: ['vxe-table--viewport-wrapper', {
|
|
13806
14054
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
@@ -13810,8 +14058,8 @@ export default defineVxeComponent({
|
|
|
13810
14058
|
h('div', {
|
|
13811
14059
|
class: [
|
|
13812
14060
|
'vxe-table--main-wrapper',
|
|
13813
|
-
`sx--${(
|
|
13814
|
-
`sy--${(
|
|
14061
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
14062
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`
|
|
13815
14063
|
]
|
|
13816
14064
|
}, [
|
|
13817
14065
|
/**
|
|
@@ -13853,9 +14101,10 @@ export default defineVxeComponent({
|
|
|
13853
14101
|
renderRowExpandedVNs()
|
|
13854
14102
|
]);
|
|
13855
14103
|
};
|
|
13856
|
-
const
|
|
14104
|
+
const renderNativeBody = () => {
|
|
13857
14105
|
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
13858
14106
|
return h('div', {
|
|
14107
|
+
key: 'lnb',
|
|
13859
14108
|
class: 'vxe-table--layout-wrapper'
|
|
13860
14109
|
}, scrollbarYToLeft
|
|
13861
14110
|
? [
|
|
@@ -13867,6 +14116,72 @@ export default defineVxeComponent({
|
|
|
13867
14116
|
renderScrollY()
|
|
13868
14117
|
]);
|
|
13869
14118
|
};
|
|
14119
|
+
const renderVirtualBody = () => {
|
|
14120
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
14121
|
+
const { useScrollbar } = props;
|
|
14122
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
14123
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
14124
|
+
const scrollXAutoHide = computeScrollXAutoHide.value;
|
|
14125
|
+
const scrollYAutoHide = computeScrollYAutoHide.value;
|
|
14126
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
14127
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
14128
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
14129
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
14130
|
+
const scrollbarWrapperClss = computeScrollbarWrapperClss.value;
|
|
14131
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden';
|
|
14132
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden';
|
|
14133
|
+
return h('div', {
|
|
14134
|
+
key: 'lvb',
|
|
14135
|
+
class: ['vxe-table--layout-wrapper', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
14136
|
+
'is--virtual-scrollbar': useScrollbar,
|
|
14137
|
+
'ov-padding': useScrollbar && scrollbarOpts.padding,
|
|
14138
|
+
'ov-x--auto-hide': useScrollbar && scrollXAutoHide,
|
|
14139
|
+
'ov-y--auto-hide': useScrollbar && scrollYAutoHide,
|
|
14140
|
+
'overflow-y': yThumbHeight,
|
|
14141
|
+
'overflow-x': xThumbWidth
|
|
14142
|
+
}]
|
|
14143
|
+
}, [
|
|
14144
|
+
renderViewport(),
|
|
14145
|
+
h('div', {
|
|
14146
|
+
class: scrollbarWrapperClss
|
|
14147
|
+
}, [
|
|
14148
|
+
hideXScroll
|
|
14149
|
+
? renderEmptyElement($xeTable)
|
|
14150
|
+
: h('div', {
|
|
14151
|
+
ref: refTrackXElem,
|
|
14152
|
+
class: 'vxe-scrollbar--track-x',
|
|
14153
|
+
onClick: clickTrackXEvent
|
|
14154
|
+
}, [
|
|
14155
|
+
h('div', {
|
|
14156
|
+
ref: refThumbXElem,
|
|
14157
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
14158
|
+
onPointerdown: pointerdownThumbXEvent,
|
|
14159
|
+
onPointermove: pointermoveThumbXEvent,
|
|
14160
|
+
onPointerup: cleatPointerThumbEvent,
|
|
14161
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
14162
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
14163
|
+
})
|
|
14164
|
+
]),
|
|
14165
|
+
hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)
|
|
14166
|
+
? renderEmptyElement($xeTable)
|
|
14167
|
+
: h('div', {
|
|
14168
|
+
ref: refTrackYElem,
|
|
14169
|
+
class: 'vxe-scrollbar--track-y',
|
|
14170
|
+
onClick: clickTrackYEvent
|
|
14171
|
+
}, [
|
|
14172
|
+
h('div', {
|
|
14173
|
+
ref: refThumbYElem,
|
|
14174
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
14175
|
+
onPointerdown: pointerdownThumbYEvent,
|
|
14176
|
+
onPointermove: pointermoveThumbYEvent,
|
|
14177
|
+
onPointerup: cleatPointerThumbEvent,
|
|
14178
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
14179
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
14180
|
+
})
|
|
14181
|
+
])
|
|
14182
|
+
])
|
|
14183
|
+
]);
|
|
14184
|
+
};
|
|
13870
14185
|
const renderVN = () => {
|
|
13871
14186
|
const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
|
|
13872
14187
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
|
|
@@ -13972,15 +14287,17 @@ export default defineVxeComponent({
|
|
|
13972
14287
|
h('div', {
|
|
13973
14288
|
key: 'tw',
|
|
13974
14289
|
class: 'vxe-table--render-wrapper'
|
|
13975
|
-
},
|
|
13976
|
-
? [
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
14290
|
+
}, useScrollbar
|
|
14291
|
+
? [renderVirtualBody()]
|
|
14292
|
+
: (scrollbarXToTop
|
|
14293
|
+
? [
|
|
14294
|
+
renderScrollX(),
|
|
14295
|
+
renderNativeBody()
|
|
14296
|
+
]
|
|
14297
|
+
: [
|
|
14298
|
+
renderNativeBody(),
|
|
14299
|
+
renderScrollX()
|
|
14300
|
+
])),
|
|
13984
14301
|
/**
|
|
13985
14302
|
* 空数据
|
|
13986
14303
|
*/
|
|
@@ -14287,6 +14604,7 @@ export default defineVxeComponent({
|
|
|
14287
14604
|
$xeTable.refreshColumn();
|
|
14288
14605
|
});
|
|
14289
14606
|
});
|
|
14607
|
+
const reScrollFlag = ref(0);
|
|
14290
14608
|
const reLayoutFlag = ref(0);
|
|
14291
14609
|
watch(computeSize, () => {
|
|
14292
14610
|
reLayoutFlag.value++;
|
|
@@ -14319,36 +14637,47 @@ export default defineVxeComponent({
|
|
|
14319
14637
|
watch(() => props.maxHeight, () => {
|
|
14320
14638
|
reLayoutFlag.value++;
|
|
14321
14639
|
});
|
|
14640
|
+
watch(() => VxeUI.getLanguage(), () => {
|
|
14641
|
+
reLayoutFlag.value++;
|
|
14642
|
+
});
|
|
14322
14643
|
watch(computeScrollbarXToTop, () => {
|
|
14644
|
+
reScrollFlag.value++;
|
|
14323
14645
|
reLayoutFlag.value++;
|
|
14324
14646
|
});
|
|
14325
14647
|
watch(computeScrollbarYToLeft, () => {
|
|
14648
|
+
reScrollFlag.value++;
|
|
14326
14649
|
reLayoutFlag.value++;
|
|
14327
14650
|
});
|
|
14328
|
-
watch(
|
|
14651
|
+
watch(computeScrollXVisible, () => {
|
|
14652
|
+
reScrollFlag.value++;
|
|
14329
14653
|
reLayoutFlag.value++;
|
|
14330
14654
|
});
|
|
14331
|
-
watch(() => {
|
|
14332
|
-
|
|
14333
|
-
return scrollbarXOpts.visible;
|
|
14334
|
-
}, () => {
|
|
14655
|
+
watch(computeScrollYVisible, () => {
|
|
14656
|
+
reScrollFlag.value++;
|
|
14335
14657
|
reLayoutFlag.value++;
|
|
14336
14658
|
});
|
|
14337
|
-
watch(() => {
|
|
14338
|
-
|
|
14339
|
-
return scrollbarYOpts.visible;
|
|
14340
|
-
}, () => {
|
|
14659
|
+
watch(computeScrollXHeight, () => {
|
|
14660
|
+
reScrollFlag.value++;
|
|
14341
14661
|
reLayoutFlag.value++;
|
|
14342
14662
|
});
|
|
14343
|
-
watch(() => {
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
}
|
|
14663
|
+
watch(computeScrollYWidth, () => {
|
|
14664
|
+
reScrollFlag.value++;
|
|
14665
|
+
reLayoutFlag.value++;
|
|
14666
|
+
});
|
|
14667
|
+
watch(computeCellHeitht, () => {
|
|
14347
14668
|
reLayoutFlag.value++;
|
|
14348
14669
|
});
|
|
14349
14670
|
watch(reLayoutFlag, () => {
|
|
14350
14671
|
$xeTable.recalculate(true);
|
|
14351
14672
|
});
|
|
14673
|
+
watch(reScrollFlag, () => {
|
|
14674
|
+
nextTick(() => {
|
|
14675
|
+
$xeTable.updateScrollbar();
|
|
14676
|
+
nextTick(() => {
|
|
14677
|
+
$xeTable.updateScrollbar();
|
|
14678
|
+
});
|
|
14679
|
+
});
|
|
14680
|
+
});
|
|
14352
14681
|
const footFlag = ref(0);
|
|
14353
14682
|
watch(() => props.footerData ? props.footerData.length : -1, () => {
|
|
14354
14683
|
footFlag.value++;
|
|
@@ -14464,7 +14793,6 @@ export default defineVxeComponent({
|
|
|
14464
14793
|
}
|
|
14465
14794
|
});
|
|
14466
14795
|
$xeTable.preventEvent(null, 'created', { $table: $xeTable });
|
|
14467
|
-
let resizeObserver;
|
|
14468
14796
|
onActivated(() => {
|
|
14469
14797
|
$xeTable.recalculate().then(() => $xeTable.refreshScroll());
|
|
14470
14798
|
$xeTable.preventEvent(null, 'activated', { $table: $xeTable });
|
|
@@ -14480,7 +14808,7 @@ export default defineVxeComponent({
|
|
|
14480
14808
|
});
|
|
14481
14809
|
onMounted(() => {
|
|
14482
14810
|
const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource, areaConfig } = props;
|
|
14483
|
-
const { scrollXStore, scrollYStore } = internalData;
|
|
14811
|
+
const { elemStore, scrollXStore, scrollYStore } = internalData;
|
|
14484
14812
|
const columnOpts = computeColumnOpts.value;
|
|
14485
14813
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
14486
14814
|
const aggregateOpts = computeAggregateOpts.value;
|
|
@@ -14753,12 +15081,26 @@ export default defineVxeComponent({
|
|
|
14753
15081
|
handleUpdateRowGroup(groupFields);
|
|
14754
15082
|
initData();
|
|
14755
15083
|
nextTick(() => {
|
|
14756
|
-
|
|
14757
|
-
|
|
15084
|
+
const { useScrollbar, autoResize } = props;
|
|
15085
|
+
const el = refElem.value;
|
|
15086
|
+
if (useScrollbar) {
|
|
15087
|
+
const viewInnerEl = getRefElem(elemStore['main-body-table']);
|
|
15088
|
+
const scrollObserver = globalResize.create(() => {
|
|
15089
|
+
reScrollFlag.value++;
|
|
15090
|
+
});
|
|
15091
|
+
if (el) {
|
|
15092
|
+
scrollObserver.observe(el);
|
|
15093
|
+
}
|
|
15094
|
+
if (viewInnerEl) {
|
|
15095
|
+
scrollObserver.observe(viewInnerEl);
|
|
15096
|
+
}
|
|
15097
|
+
internalData.scrollObserver = scrollObserver;
|
|
15098
|
+
}
|
|
15099
|
+
if (autoResize) {
|
|
14758
15100
|
const parentEl = $xeTable.getParentElem();
|
|
14759
|
-
resizeObserver = globalResize.create(() => {
|
|
15101
|
+
const resizeObserver = globalResize.create(() => {
|
|
14760
15102
|
if (props.autoResize) {
|
|
14761
|
-
|
|
15103
|
+
handleResizeEvent();
|
|
14762
15104
|
}
|
|
14763
15105
|
});
|
|
14764
15106
|
if (el) {
|
|
@@ -14767,6 +15109,7 @@ export default defineVxeComponent({
|
|
|
14767
15109
|
if (parentEl) {
|
|
14768
15110
|
resizeObserver.observe(parentEl);
|
|
14769
15111
|
}
|
|
15112
|
+
internalData.resizeObserver = resizeObserver;
|
|
14770
15113
|
}
|
|
14771
15114
|
});
|
|
14772
15115
|
if (virtualYOpts.mode !== 'scroll') {
|
|
@@ -14788,7 +15131,7 @@ export default defineVxeComponent({
|
|
|
14788
15131
|
$xeTable.preventEvent(null, 'mounted', { $table: $xeTable });
|
|
14789
15132
|
});
|
|
14790
15133
|
onBeforeUnmount(() => {
|
|
14791
|
-
const { _sToTime } = internalData;
|
|
15134
|
+
const { resizeObserver, scrollObserver, _sToTime } = internalData;
|
|
14792
15135
|
if (_sToTime) {
|
|
14793
15136
|
clearTimeout(_sToTime);
|
|
14794
15137
|
}
|
|
@@ -14799,6 +15142,9 @@ export default defineVxeComponent({
|
|
|
14799
15142
|
internalData.cvCacheMaps = {};
|
|
14800
15143
|
internalData.prevDragRow = null;
|
|
14801
15144
|
internalData.prevDragCol = null;
|
|
15145
|
+
if (scrollObserver) {
|
|
15146
|
+
scrollObserver.disconnect();
|
|
15147
|
+
}
|
|
14802
15148
|
if (resizeObserver) {
|
|
14803
15149
|
resizeObserver.disconnect();
|
|
14804
15150
|
}
|