vxe-table 3.25.0-beta.0 → 3.25.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/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/fr-FR.js +29 -29
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/methods.js +248 -40
- package/es/table/src/props.js +5 -0
- package/es/table/src/scrollbar.js +54 -0
- package/es/table/src/table.js +292 -73
- 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 +9 -11
- 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 +366 -84
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/fr-FR.js +29 -29
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +29 -29
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +21 -11
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +5 -0
- 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 +265 -62
- 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 +9 -11
- 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/locale/lang/fr-FR.ts +903 -903
- package/packages/table/src/methods.ts +260 -40
- package/packages/table/src/props.ts +5 -0
- package/packages/table/src/scrollbar.ts +57 -0
- package/packages/table/src/table.ts +329 -75
- package/packages/table/src/util.ts +15 -2
- package/packages/ui/index.ts +8 -10
- package/styles/components/table.scss +65 -0
- /package/es/{iconfont.1791880417274.ttf → iconfont.1792035018941.ttf} +0 -0
- /package/es/{iconfont.1791880417274.woff → iconfont.1792035018941.woff} +0 -0
- /package/es/{iconfont.1791880417274.woff2 → iconfont.1792035018941.woff2} +0 -0
- /package/lib/{iconfont.1791880417274.ttf → iconfont.1792035018941.ttf} +0 -0
- /package/lib/{iconfont.1791880417274.woff → iconfont.1792035018941.woff} +0 -0
- /package/lib/{iconfont.1791880417274.woff2 → iconfont.1792035018941.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
|
-
import { getFuncText, hasEnableConf, isEnableConf } from '../../ui/src/utils';
|
|
2
|
+
import { getDefaultConfig, getFuncText, hasEnableConf, isEnableConf } from '../../ui/src/utils';
|
|
3
3
|
import { initTpImg, toCssUnit } from '../../ui/src/dom';
|
|
4
|
-
import { createReactData, createInternalData, createHandleGetRowId, getCalcHeight, hasDeepKey } from './util';
|
|
4
|
+
import { createReactData, createInternalData, createHandleGetRowId, getCalcHeight, hasDeepKey, getRefElem } from './util';
|
|
5
5
|
import { VxeUI } from '../../ui';
|
|
6
6
|
import methods from './methods';
|
|
7
7
|
import TableBodyComponent from './body';
|
|
@@ -24,7 +24,7 @@ import keyboardMixin from '../module/keyboard/mixin';
|
|
|
24
24
|
import validatorMixin from '../module/validator/mixin';
|
|
25
25
|
import customMixin from '../module/custom/mixin';
|
|
26
26
|
const { warnLog, errLog } = createComponentLog('table');
|
|
27
|
-
const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI;
|
|
27
|
+
const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, domUtils, globalMixins, renderEmptyElement } = VxeUI;
|
|
28
28
|
function handleUpdateMergeBodyCells($xeTable, merges) {
|
|
29
29
|
const internalData = $xeTable;
|
|
30
30
|
internalData.mergeBodyList = [];
|
|
@@ -95,6 +95,8 @@ function renderViewFixed(h, $xeTable, fixedType) {
|
|
|
95
95
|
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
96
96
|
const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
|
|
97
97
|
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
98
|
+
const scrollXVisible = $xeTable.computeScrollXVisible;
|
|
99
|
+
const scrollYVisible = $xeTable.computeScrollYVisible;
|
|
98
100
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
99
101
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
100
102
|
const isFixedLeft = fixedType === 'left';
|
|
@@ -103,10 +105,15 @@ function renderViewFixed(h, $xeTable, fixedType) {
|
|
|
103
105
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
104
106
|
return h('div', {
|
|
105
107
|
ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
|
|
106
|
-
class: [
|
|
108
|
+
class: [
|
|
109
|
+
`vxe-table--fixed-${fixedType}-wrapper`,
|
|
110
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
111
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
112
|
+
{
|
|
107
113
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
108
114
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
109
|
-
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
110
117
|
}, [
|
|
111
118
|
showHeader
|
|
112
119
|
? h(TableHeaderComponent, {
|
|
@@ -398,6 +405,7 @@ function renderScrollX(h, $xeTable) {
|
|
|
398
405
|
}
|
|
399
406
|
function renderScrollY(h, $xeTable) {
|
|
400
407
|
return h('div', {
|
|
408
|
+
key: 'vsy',
|
|
401
409
|
ref: 'refScrollYVirtualElem',
|
|
402
410
|
class: 'vxe-table--scroll-y-virtual'
|
|
403
411
|
}, [
|
|
@@ -436,12 +444,15 @@ function renderViewport(h, $xeTable) {
|
|
|
436
444
|
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
437
445
|
const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
|
|
438
446
|
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
447
|
+
const scrollXVisible = $xeTable.computeScrollXVisible;
|
|
448
|
+
const scrollYVisible = $xeTable.computeScrollYVisible;
|
|
439
449
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
440
450
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
441
451
|
const { leftList, rightList } = columnStore;
|
|
442
452
|
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior;
|
|
443
453
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
444
454
|
return h('div', {
|
|
455
|
+
key: 'tvw',
|
|
445
456
|
ref: 'refTableViewportElem',
|
|
446
457
|
class: ['vxe-table--viewport-wrapper', {
|
|
447
458
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
@@ -449,7 +460,11 @@ function renderViewport(h, $xeTable) {
|
|
|
449
460
|
}]
|
|
450
461
|
}, [
|
|
451
462
|
h('div', {
|
|
452
|
-
class: [
|
|
463
|
+
class: [
|
|
464
|
+
'vxe-table--main-wrapper',
|
|
465
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
466
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`
|
|
467
|
+
]
|
|
453
468
|
}, [
|
|
454
469
|
/**
|
|
455
470
|
* 表头
|
|
@@ -496,9 +511,10 @@ function renderViewport(h, $xeTable) {
|
|
|
496
511
|
renderRowExpandedVNs(h, $xeTable)
|
|
497
512
|
]);
|
|
498
513
|
}
|
|
499
|
-
function
|
|
514
|
+
function renderNativeBody(h, $xeTable) {
|
|
500
515
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
501
516
|
return h('div', {
|
|
517
|
+
key: 'lnb',
|
|
502
518
|
class: 'vxe-table--layout-wrapper'
|
|
503
519
|
}, scrollbarYToLeft
|
|
504
520
|
? [
|
|
@@ -510,6 +526,84 @@ function renderBody(h, $xeTable) {
|
|
|
510
526
|
renderScrollY(h, $xeTable)
|
|
511
527
|
]);
|
|
512
528
|
}
|
|
529
|
+
function renderVirtualBody(h, $xeTable) {
|
|
530
|
+
const props = $xeTable;
|
|
531
|
+
const reactData = $xeTable;
|
|
532
|
+
const internalData = $xeTable;
|
|
533
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
534
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
535
|
+
const { useScrollbar } = props;
|
|
536
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
537
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
538
|
+
const scrollXAutoHide = $xeTable.computeScrollXAutoHide;
|
|
539
|
+
const scrollYAutoHide = $xeTable.computeScrollYAutoHide;
|
|
540
|
+
const scrollXVisible = $xeTable.computeScrollXVisible;
|
|
541
|
+
const scrollYVisible = $xeTable.computeScrollYVisible;
|
|
542
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
543
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
544
|
+
const scrollbarWrapperClss = $xeTable.computeScrollbarWrapperClss;
|
|
545
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden';
|
|
546
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden';
|
|
547
|
+
return h('div', {
|
|
548
|
+
key: 'lvb',
|
|
549
|
+
class: ['vxe-table--layout-wrapper', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
550
|
+
'is--virtual-scrollbar': useScrollbar,
|
|
551
|
+
'ov-padding': useScrollbar && scrollbarOpts.padding,
|
|
552
|
+
'ov-x--auto-hide': useScrollbar && scrollXAutoHide,
|
|
553
|
+
'ov-y--auto-hide': useScrollbar && scrollYAutoHide,
|
|
554
|
+
'overflow-y': yThumbHeight,
|
|
555
|
+
'overflow-x': xThumbWidth
|
|
556
|
+
}]
|
|
557
|
+
}, [
|
|
558
|
+
renderViewport(h, $xeTable),
|
|
559
|
+
h('div', {
|
|
560
|
+
class: scrollbarWrapperClss
|
|
561
|
+
}, [
|
|
562
|
+
hideXScroll
|
|
563
|
+
? renderEmptyElement($xeTable)
|
|
564
|
+
: h('div', {
|
|
565
|
+
ref: 'refTrackXElem',
|
|
566
|
+
class: 'vxe-scrollbar--track-x',
|
|
567
|
+
on: {
|
|
568
|
+
click: $xeTable.clickTrackXEvent
|
|
569
|
+
}
|
|
570
|
+
}, [
|
|
571
|
+
h('div', {
|
|
572
|
+
ref: 'refThumbXElem',
|
|
573
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
574
|
+
on: {
|
|
575
|
+
pointerdown: $xeTable.pointerdownThumbXEvent,
|
|
576
|
+
pointermove: $xeTable.pointermoveThumbXEvent,
|
|
577
|
+
pointerup: $xeTable.cleatPointerThumbEvent,
|
|
578
|
+
pointercancel: $xeTable.cleatPointerThumbEvent,
|
|
579
|
+
lostpointercapture: $xeTable.cleatPointerThumbEvent
|
|
580
|
+
}
|
|
581
|
+
})
|
|
582
|
+
]),
|
|
583
|
+
hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)
|
|
584
|
+
? renderEmptyElement($xeTable)
|
|
585
|
+
: h('div', {
|
|
586
|
+
ref: 'refTrackYElem',
|
|
587
|
+
class: 'vxe-scrollbar--track-y',
|
|
588
|
+
on: {
|
|
589
|
+
click: $xeTable.clickTrackYEvent
|
|
590
|
+
}
|
|
591
|
+
}, [
|
|
592
|
+
h('div', {
|
|
593
|
+
ref: 'refThumbYElem',
|
|
594
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
595
|
+
on: {
|
|
596
|
+
pointerdown: $xeTable.pointerdownThumbYEvent,
|
|
597
|
+
pointermove: $xeTable.pointermoveThumbYEvent,
|
|
598
|
+
pointerup: $xeTable.cleatPointerThumbEvent,
|
|
599
|
+
pointercancel: $xeTable.cleatPointerThumbEvent,
|
|
600
|
+
lostpointercapture: $xeTable.cleatPointerThumbEvent
|
|
601
|
+
}
|
|
602
|
+
})
|
|
603
|
+
])
|
|
604
|
+
])
|
|
605
|
+
]);
|
|
606
|
+
}
|
|
513
607
|
export default {
|
|
514
608
|
name: 'VxeTable',
|
|
515
609
|
mixins: [
|
|
@@ -553,7 +647,7 @@ export default {
|
|
|
553
647
|
const reactData = createReactData();
|
|
554
648
|
return Object.assign(Object.assign({ xID }, reactData), {
|
|
555
649
|
// 私有属性
|
|
556
|
-
reScrollFlag: 0, reLayoutFlag: 0, footFlag: 0, kfFlag: 0, layoutReFlag: 0, mergeFooteCellFlag: 0, crossTableDragRowInfo: crossTableDragRowGlobal });
|
|
650
|
+
reScrollFlag: 0, reLayoutFlag: 0, footFlag: 0, kfFlag: 0, layoutReFlag: 0, mergeFooteCellFlag: 0, crossTableDragRowInfo: crossTableDragRowGlobal, scrollDefaultConf: Object.assign({}, getConfig().scrollbar) });
|
|
557
651
|
},
|
|
558
652
|
computed: Object.assign(Object.assign({}, {}), { tableId() {
|
|
559
653
|
return this.computeTableId;
|
|
@@ -656,18 +750,54 @@ export default {
|
|
|
656
750
|
return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig);
|
|
657
751
|
},
|
|
658
752
|
computeScrollbarXOpts() {
|
|
659
|
-
var _a;
|
|
660
753
|
const $xeTable = this;
|
|
661
|
-
const props = $xeTable;
|
|
662
754
|
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
663
|
-
return Object.assign({}, scrollbarOpts.x,
|
|
755
|
+
return scrollbarOpts.x ? Object.assign({}, scrollbarOpts.x, scrollbarOpts.xConfig) : (scrollbarOpts.xConfig || {});
|
|
664
756
|
},
|
|
665
757
|
computeScrollbarYOpts() {
|
|
666
|
-
var _a;
|
|
667
758
|
const $xeTable = this;
|
|
668
|
-
const props = $xeTable;
|
|
669
759
|
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
670
|
-
return Object.assign({}, scrollbarOpts.y,
|
|
760
|
+
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {});
|
|
761
|
+
},
|
|
762
|
+
computeScrollXHeight() {
|
|
763
|
+
const $xeTable = this;
|
|
764
|
+
const scrollDefaultConf = $xeTable.scrollDefaultConf;
|
|
765
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
766
|
+
const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
|
|
767
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
|
|
768
|
+
},
|
|
769
|
+
computeScrollYWidth() {
|
|
770
|
+
const $xeTable = this;
|
|
771
|
+
const scrollDefaultConf = $xeTable.scrollDefaultConf;
|
|
772
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
773
|
+
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
774
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width));
|
|
775
|
+
},
|
|
776
|
+
computeScrollXVisible() {
|
|
777
|
+
const $xeTable = this;
|
|
778
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
779
|
+
const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
|
|
780
|
+
return getDefaultConfig(scrollbarXOpts.visible, scrollbarOpts.visible);
|
|
781
|
+
},
|
|
782
|
+
computeScrollYVisible() {
|
|
783
|
+
const $xeTable = this;
|
|
784
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
785
|
+
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
786
|
+
return getDefaultConfig(scrollbarYOpts.visible, scrollbarOpts.visible);
|
|
787
|
+
},
|
|
788
|
+
computeScrollXAutoHide() {
|
|
789
|
+
const $xeTable = this;
|
|
790
|
+
const scrollDefaultConf = $xeTable.scrollDefaultConf;
|
|
791
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
792
|
+
const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
|
|
793
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
794
|
+
},
|
|
795
|
+
computeScrollYAutoHide() {
|
|
796
|
+
const $xeTable = this;
|
|
797
|
+
const scrollDefaultConf = $xeTable.scrollDefaultConf;
|
|
798
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
799
|
+
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
800
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
671
801
|
},
|
|
672
802
|
computeScrollbarXToTop() {
|
|
673
803
|
const $xeTable = this;
|
|
@@ -679,6 +809,25 @@ export default {
|
|
|
679
809
|
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
680
810
|
return scrollbarYOpts.position === 'left';
|
|
681
811
|
},
|
|
812
|
+
computeScrollbarWrapperClss() {
|
|
813
|
+
const $xeTable = this;
|
|
814
|
+
const reactData = $xeTable;
|
|
815
|
+
const { yThumbHeight, xThumbWidth } = reactData;
|
|
816
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
817
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
818
|
+
const scrollXVisible = $xeTable.computeScrollXVisible;
|
|
819
|
+
const scrollYVisible = $xeTable.computeScrollYVisible;
|
|
820
|
+
return domUtils.buildClass([
|
|
821
|
+
'vxe-scrollbar is--virtual',
|
|
822
|
+
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
823
|
+
`ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}`,
|
|
824
|
+
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
825
|
+
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
826
|
+
], {
|
|
827
|
+
'overflow-y': yThumbHeight,
|
|
828
|
+
'overflow-x': xThumbWidth
|
|
829
|
+
});
|
|
830
|
+
},
|
|
682
831
|
computeScrollYThreshold() {
|
|
683
832
|
const $xeTable = this;
|
|
684
833
|
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
@@ -724,6 +873,11 @@ export default {
|
|
|
724
873
|
}
|
|
725
874
|
return cellOpts;
|
|
726
875
|
},
|
|
876
|
+
computeCellHeitht() {
|
|
877
|
+
const $xeTable = this;
|
|
878
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
879
|
+
return cellOpts.height;
|
|
880
|
+
},
|
|
727
881
|
computeHeaderCellOpts() {
|
|
728
882
|
const $xeTable = this;
|
|
729
883
|
const $xeGantt = $xeTable.$xeGantt;
|
|
@@ -1189,16 +1343,16 @@ export default {
|
|
|
1189
1343
|
},
|
|
1190
1344
|
computeTableStyle() {
|
|
1191
1345
|
const $xeTable = this;
|
|
1192
|
-
const
|
|
1193
|
-
const
|
|
1194
|
-
const
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
1346
|
+
const barWidth = $xeTable.computeScrollYWidth;
|
|
1347
|
+
const barHeight = $xeTable.computeScrollXHeight;
|
|
1348
|
+
const stys = {};
|
|
1349
|
+
if (barWidth || barHeight) {
|
|
1350
|
+
stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight);
|
|
1351
|
+
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight);
|
|
1352
|
+
stys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(barHeight || barWidth);
|
|
1353
|
+
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(barHeight || barWidth);
|
|
1197
1354
|
}
|
|
1198
|
-
|
|
1199
|
-
tStys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(height);
|
|
1200
|
-
}
|
|
1201
|
-
return tStys;
|
|
1355
|
+
return stys;
|
|
1202
1356
|
},
|
|
1203
1357
|
computeTableRowExpandedList() {
|
|
1204
1358
|
const $xeTable = this;
|
|
@@ -1399,17 +1553,6 @@ export default {
|
|
|
1399
1553
|
},
|
|
1400
1554
|
computeVxeLanguage() {
|
|
1401
1555
|
return VxeUI.getLanguage();
|
|
1402
|
-
},
|
|
1403
|
-
computeScrollbarVisible() {
|
|
1404
|
-
const $xeTable = this;
|
|
1405
|
-
const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
|
|
1406
|
-
const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
|
|
1407
|
-
return `${scrollbarXOpts.visible}${scrollbarYOpts.visible}`;
|
|
1408
|
-
},
|
|
1409
|
-
computeCellConfHeitht() {
|
|
1410
|
-
const $xeTable = this;
|
|
1411
|
-
const cellOpts = $xeTable.computeCellOpts;
|
|
1412
|
-
return cellOpts.height;
|
|
1413
1556
|
} }),
|
|
1414
1557
|
watch: {
|
|
1415
1558
|
data(value) {
|
|
@@ -1450,55 +1593,98 @@ export default {
|
|
|
1450
1593
|
this.$nextTick().then(() => this.refreshColumn());
|
|
1451
1594
|
},
|
|
1452
1595
|
computeSize() {
|
|
1453
|
-
this
|
|
1596
|
+
const $xeTable = this;
|
|
1597
|
+
$xeTable.reLayoutFlag++;
|
|
1454
1598
|
},
|
|
1455
1599
|
showHeader() {
|
|
1456
|
-
this
|
|
1600
|
+
const $xeTable = this;
|
|
1601
|
+
$xeTable.reLayoutFlag++;
|
|
1457
1602
|
},
|
|
1458
1603
|
showFooter() {
|
|
1459
|
-
this
|
|
1604
|
+
const $xeTable = this;
|
|
1605
|
+
$xeTable.reLayoutFlag++;
|
|
1460
1606
|
},
|
|
1461
1607
|
showHeaderOverflow() {
|
|
1462
|
-
this
|
|
1608
|
+
const $xeTable = this;
|
|
1609
|
+
$xeTable.reLayoutFlag++;
|
|
1463
1610
|
},
|
|
1464
1611
|
showOverflow() {
|
|
1465
1612
|
const $xeTable = this;
|
|
1466
1613
|
updateColumnAllOverflow($xeTable);
|
|
1467
|
-
|
|
1614
|
+
$xeTable.reLayoutFlag++;
|
|
1468
1615
|
},
|
|
1469
1616
|
showFooterOverflow() {
|
|
1470
|
-
this
|
|
1617
|
+
const $xeTable = this;
|
|
1618
|
+
$xeTable.reLayoutFlag++;
|
|
1471
1619
|
},
|
|
1472
1620
|
overflowX() {
|
|
1473
|
-
this
|
|
1621
|
+
const $xeTable = this;
|
|
1622
|
+
$xeTable.reLayoutFlag++;
|
|
1474
1623
|
},
|
|
1475
1624
|
overflowY() {
|
|
1476
|
-
this
|
|
1625
|
+
const $xeTable = this;
|
|
1626
|
+
$xeTable.reLayoutFlag++;
|
|
1477
1627
|
},
|
|
1478
1628
|
height() {
|
|
1479
|
-
this
|
|
1629
|
+
const $xeTable = this;
|
|
1630
|
+
$xeTable.reLayoutFlag++;
|
|
1480
1631
|
},
|
|
1481
1632
|
maxHeight() {
|
|
1482
|
-
this
|
|
1633
|
+
const $xeTable = this;
|
|
1634
|
+
$xeTable.reLayoutFlag++;
|
|
1635
|
+
},
|
|
1636
|
+
computeVxeLanguage() {
|
|
1637
|
+
const $xeTable = this;
|
|
1638
|
+
$xeTable.reLayoutFlag++;
|
|
1483
1639
|
},
|
|
1484
1640
|
computeScrollbarXToTop() {
|
|
1485
|
-
this
|
|
1641
|
+
const $xeTable = this;
|
|
1642
|
+
$xeTable.reScrollFlag++;
|
|
1643
|
+
$xeTable.reLayoutFlag++;
|
|
1486
1644
|
},
|
|
1487
1645
|
computeScrollbarYToLeft() {
|
|
1488
|
-
this
|
|
1646
|
+
const $xeTable = this;
|
|
1647
|
+
$xeTable.reScrollFlag++;
|
|
1648
|
+
$xeTable.reLayoutFlag++;
|
|
1489
1649
|
},
|
|
1490
|
-
|
|
1491
|
-
this
|
|
1650
|
+
computeScrollXVisible() {
|
|
1651
|
+
const $xeTable = this;
|
|
1652
|
+
$xeTable.reScrollFlag++;
|
|
1653
|
+
$xeTable.reLayoutFlag++;
|
|
1654
|
+
},
|
|
1655
|
+
computeScrollYVisible() {
|
|
1656
|
+
const $xeTable = this;
|
|
1657
|
+
$xeTable.reScrollFlag++;
|
|
1658
|
+
$xeTable.reLayoutFlag++;
|
|
1659
|
+
},
|
|
1660
|
+
computeScrollXHeight() {
|
|
1661
|
+
const $xeTable = this;
|
|
1662
|
+
$xeTable.reScrollFlag++;
|
|
1663
|
+
$xeTable.reLayoutFlag++;
|
|
1492
1664
|
},
|
|
1493
|
-
|
|
1494
|
-
this
|
|
1665
|
+
computeScrollYWidth() {
|
|
1666
|
+
const $xeTable = this;
|
|
1667
|
+
$xeTable.reScrollFlag++;
|
|
1668
|
+
$xeTable.reLayoutFlag++;
|
|
1495
1669
|
},
|
|
1496
|
-
|
|
1497
|
-
this
|
|
1670
|
+
computeCellHeitht() {
|
|
1671
|
+
const $xeTable = this;
|
|
1672
|
+
$xeTable.reLayoutFlag++;
|
|
1498
1673
|
},
|
|
1499
1674
|
reLayoutFlag() {
|
|
1500
1675
|
const $xeTable = this;
|
|
1501
|
-
$xeTable.$nextTick(() =>
|
|
1676
|
+
$xeTable.$nextTick(() => {
|
|
1677
|
+
$xeTable.recalculate(true);
|
|
1678
|
+
});
|
|
1679
|
+
},
|
|
1680
|
+
reScrollFlag() {
|
|
1681
|
+
const $xeTable = this;
|
|
1682
|
+
$xeTable.$nextTick(() => {
|
|
1683
|
+
$xeTable.updateScrollbar();
|
|
1684
|
+
$xeTable.$nextTick(() => {
|
|
1685
|
+
$xeTable.updateScrollbar();
|
|
1686
|
+
});
|
|
1687
|
+
});
|
|
1502
1688
|
},
|
|
1503
1689
|
footerData() {
|
|
1504
1690
|
this.footFlag++;
|
|
@@ -1622,6 +1808,7 @@ export default {
|
|
|
1622
1808
|
const areaOpts = $xeTable.computeAreaOpts;
|
|
1623
1809
|
const sortOpts = $xeTable.computeSortOpts;
|
|
1624
1810
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
1811
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
1625
1812
|
const { groupFields } = aggregateOpts;
|
|
1626
1813
|
if (props.rowId) {
|
|
1627
1814
|
warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
|
|
@@ -1870,6 +2057,12 @@ export default {
|
|
|
1870
2057
|
// if ((hasEnableConf(printConfig, printOpts) || hasEnableConf(importConfig, importOpts) || hasEnableConf(exportConfig, exportOpts)) && !$xeTable.exportData) {
|
|
1871
2058
|
// errLog('vxe.error.reqModule', ['Export'])
|
|
1872
2059
|
// }
|
|
2060
|
+
if (scrollbarOpts.x) {
|
|
2061
|
+
warnLog('vxe.error.delProp', ['scrollbar-config.x', 'scrollbar-config.xConfig']);
|
|
2062
|
+
}
|
|
2063
|
+
if (scrollbarOpts.y) {
|
|
2064
|
+
warnLog('vxe.error.delProp', ['scrollbar-config.y', 'scrollbar-config.yConfig']);
|
|
2065
|
+
}
|
|
1873
2066
|
Object.assign(scrollYStore, {
|
|
1874
2067
|
startIndex: 0,
|
|
1875
2068
|
endIndex: 1,
|
|
@@ -1936,6 +2129,8 @@ export default {
|
|
|
1936
2129
|
warnLog('vxe.error.reqProp', ['tooltip-config']);
|
|
1937
2130
|
}
|
|
1938
2131
|
$xeTable.$nextTick(() => {
|
|
2132
|
+
const { useScrollbar, autoResize } = props;
|
|
2133
|
+
const { elemStore } = internalData;
|
|
1939
2134
|
// 使用已安装的组件,如果未安装则不渲染
|
|
1940
2135
|
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
|
1941
2136
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
@@ -1979,15 +2174,34 @@ export default {
|
|
|
1979
2174
|
errLog('vxe.error.reqComp', ['vxe-tooltip']);
|
|
1980
2175
|
}
|
|
1981
2176
|
}
|
|
1982
|
-
|
|
2177
|
+
const el = $xeTable.$refs.refElem;
|
|
2178
|
+
if (useScrollbar) {
|
|
2179
|
+
const viewInnerEl = getRefElem(elemStore['main-body-table']);
|
|
2180
|
+
const scrollObserver = globalResize.create(() => {
|
|
2181
|
+
$xeTable.reScrollFlag++;
|
|
2182
|
+
});
|
|
2183
|
+
if (el) {
|
|
2184
|
+
scrollObserver.observe(el);
|
|
2185
|
+
}
|
|
2186
|
+
if (viewInnerEl) {
|
|
2187
|
+
scrollObserver.observe(viewInnerEl);
|
|
2188
|
+
}
|
|
2189
|
+
internalData.scrollObserver = scrollObserver;
|
|
2190
|
+
}
|
|
2191
|
+
if (autoResize) {
|
|
2192
|
+
const parentEl = $xeTable.getParentElem();
|
|
1983
2193
|
const resizeObserver = globalResize.create(() => {
|
|
1984
|
-
if (
|
|
1985
|
-
|
|
2194
|
+
if (props.autoResize) {
|
|
2195
|
+
$xeTable.handleResizeEvent();
|
|
1986
2196
|
}
|
|
1987
2197
|
});
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2198
|
+
if (el) {
|
|
2199
|
+
resizeObserver.observe(el);
|
|
2200
|
+
}
|
|
2201
|
+
if (parentEl) {
|
|
2202
|
+
resizeObserver.observe(parentEl);
|
|
2203
|
+
}
|
|
2204
|
+
internalData.resizeObserver = resizeObserver;
|
|
1991
2205
|
}
|
|
1992
2206
|
});
|
|
1993
2207
|
if (virtualYOpts.mode !== 'scroll') {
|
|
@@ -2018,7 +2232,7 @@ export default {
|
|
|
2018
2232
|
const $xeTable = this;
|
|
2019
2233
|
const reactData = $xeTable;
|
|
2020
2234
|
const internalData = $xeTable;
|
|
2021
|
-
const { _sToTime } = internalData;
|
|
2235
|
+
const { scrollObserver, resizeObserver, _sToTime } = internalData;
|
|
2022
2236
|
if (_sToTime) {
|
|
2023
2237
|
clearTimeout(_sToTime);
|
|
2024
2238
|
}
|
|
@@ -2038,8 +2252,11 @@ export default {
|
|
|
2038
2252
|
if (tableViewportEl) {
|
|
2039
2253
|
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
2040
2254
|
}
|
|
2041
|
-
if (
|
|
2042
|
-
|
|
2255
|
+
if (scrollObserver) {
|
|
2256
|
+
scrollObserver.disconnect();
|
|
2257
|
+
}
|
|
2258
|
+
if (resizeObserver) {
|
|
2259
|
+
resizeObserver.disconnect();
|
|
2043
2260
|
}
|
|
2044
2261
|
$xeTable.closeTooltip();
|
|
2045
2262
|
$xeTable.closeFilter();
|
|
@@ -2073,7 +2290,7 @@ export default {
|
|
|
2073
2290
|
const slots = $xeTable.$scopedSlots;
|
|
2074
2291
|
const reactData = $xeTable;
|
|
2075
2292
|
const { xID } = $xeTable;
|
|
2076
|
-
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
|
|
2293
|
+
const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
|
|
2077
2294
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
|
|
2078
2295
|
const { leftList, rightList } = columnStore;
|
|
2079
2296
|
const loadingSlot = slots.loading;
|
|
@@ -2117,7 +2334,7 @@ export default {
|
|
|
2117
2334
|
}
|
|
2118
2335
|
return h('div', {
|
|
2119
2336
|
ref: 'refElem',
|
|
2120
|
-
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
2337
|
+
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, useScrollbar ? 'is--virtual-scrollbar' : 'is--native-scrollbar', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
2121
2338
|
[`size--${vSize}`]: vSize,
|
|
2122
2339
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
2123
2340
|
'vxe-editable': !!editConfig,
|
|
@@ -2185,15 +2402,17 @@ export default {
|
|
|
2185
2402
|
h('div', {
|
|
2186
2403
|
key: 'tw',
|
|
2187
2404
|
class: 'vxe-table--render-wrapper'
|
|
2188
|
-
},
|
|
2189
|
-
? [
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2405
|
+
}, useScrollbar
|
|
2406
|
+
? [renderVirtualBody(h, $xeTable)]
|
|
2407
|
+
: (scrollbarXToTop
|
|
2408
|
+
? [
|
|
2409
|
+
renderScrollX(h, $xeTable),
|
|
2410
|
+
renderNativeBody(h, $xeTable)
|
|
2411
|
+
]
|
|
2412
|
+
: [
|
|
2413
|
+
renderNativeBody(h, $xeTable),
|
|
2414
|
+
renderScrollX(h, $xeTable)
|
|
2415
|
+
])),
|
|
2197
2416
|
/**
|
|
2198
2417
|
* 空数据
|
|
2199
2418
|
*/
|
package/es/table/src/util.js
CHANGED
|
@@ -43,9 +43,15 @@ export function createInternalData() {
|
|
|
43
43
|
// 当前行
|
|
44
44
|
currentRow: null,
|
|
45
45
|
currentCol: null,
|
|
46
|
-
//
|
|
47
|
-
|
|
46
|
+
// resizeObserver: undefined,
|
|
47
|
+
// 滚动条
|
|
48
|
+
// scrollObserver: undefined,
|
|
49
|
+
// isThumbDrag: false,
|
|
50
|
+
thumbDragOffset: 0,
|
|
51
|
+
yThumbTop: 0,
|
|
52
|
+
xThumbLeft: 0,
|
|
48
53
|
lastScrollTop: 0,
|
|
54
|
+
lastScrollLeft: 0,
|
|
49
55
|
// 单选框属性,已选中保留的行
|
|
50
56
|
radioReserveRow: null,
|
|
51
57
|
// 复选框属性,已选中保留的行集合
|
|
@@ -177,6 +183,9 @@ export function createReactData() {
|
|
|
177
183
|
scrollbarWidth: 0,
|
|
178
184
|
// 横向滚动条的高度
|
|
179
185
|
scrollbarHeight: 0,
|
|
186
|
+
// 滚动条
|
|
187
|
+
yThumbHeight: 0,
|
|
188
|
+
xThumbWidth: 0,
|
|
180
189
|
// 行高
|
|
181
190
|
rowHeight: 0,
|
|
182
191
|
// 表格父容器的高度
|
package/es/table/style.css
CHANGED
|
@@ -4024,4 +4024,34 @@ div.vxe-table--tooltip-wrapper.vxe-table--valid-error.old-cell-valid {
|
|
|
4024
4024
|
}
|
|
4025
4025
|
.vxe-table--footer-wrapper.body--wrapper {
|
|
4026
4026
|
outline: 0;
|
|
4027
|
+
}
|
|
4028
|
+
|
|
4029
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-padding.overflow-x.sx-pos--top > .vxe-table--viewport-wrapper {
|
|
4030
|
+
padding-top: var(--vxe-ui-scrollbar-x-height);
|
|
4031
|
+
}
|
|
4032
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-padding.overflow-x.sx-pos--bottom > .vxe-table--viewport-wrapper {
|
|
4033
|
+
padding-bottom: var(--vxe-ui-scrollbar-x-height);
|
|
4034
|
+
}
|
|
4035
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-padding.overflow-y.sy-pos--left > .vxe-table--viewport-wrapper {
|
|
4036
|
+
padding-left: var(--vxe-ui-scrollbar-y-width);
|
|
4037
|
+
}
|
|
4038
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-padding.overflow-y.sy-pos--right > .vxe-table--viewport-wrapper {
|
|
4039
|
+
padding-right: var(--vxe-ui-scrollbar-y-width);
|
|
4040
|
+
}
|
|
4041
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-x--auto-hide:hover > .vxe-scrollbar > .vxe-scrollbar--track-x {
|
|
4042
|
+
opacity: 1;
|
|
4043
|
+
}
|
|
4044
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-x--auto-hide > .vxe-scrollbar > .vxe-scrollbar--track-x {
|
|
4045
|
+
opacity: 0;
|
|
4046
|
+
transition: opacity 0.8s ease-in-out;
|
|
4047
|
+
}
|
|
4048
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-y--auto-hide:hover > .vxe-scrollbar > .vxe-scrollbar--track-y {
|
|
4049
|
+
opacity: 1;
|
|
4050
|
+
}
|
|
4051
|
+
.vxe-table--layout-wrapper.is--virtual-scrollbar.ov-y--auto-hide > .vxe-scrollbar > .vxe-scrollbar--track-y {
|
|
4052
|
+
opacity: 0;
|
|
4053
|
+
transition: opacity 0.8s ease-in-out;
|
|
4054
|
+
}
|
|
4055
|
+
.vxe-table--layout-wrapper > .vxe-scrollbar {
|
|
4056
|
+
position: unset;
|
|
4027
4057
|
}
|