vxe-table 4.23.0-beta.1 → 4.23.0-beta.3
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 +478 -101
- 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/module/custom/panel.js +2 -2
- package/es/table/module/filter/hook.js +1 -0
- package/es/table/src/props.js +6 -2
- package/es/table/src/table.js +435 -85
- 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/dom.js +11 -8
- 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 +70 -43
- 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/custom/panel.js +2 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/filter/hook.js +1 -0
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/src/props.js +6 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +35 -25
- 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/dom.js +11 -7
- package/lib/ui/src/dom.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/module/custom/panel.ts +2 -2
- package/packages/table/module/filter/hook.ts +1 -0
- package/packages/table/src/props.ts +6 -2
- package/packages/table/src/table.ts +468 -87
- package/packages/table/src/util.ts +15 -2
- package/packages/ui/src/dom.ts +12 -8
- package/styles/components/table.scss +65 -0
- /package/es/{iconfont.1791954193706.ttf → iconfont.1792117711657.ttf} +0 -0
- /package/es/{iconfont.1791954193706.woff → iconfont.1792117711657.woff} +0 -0
- /package/es/{iconfont.1791954193706.woff2 → iconfont.1792117711657.woff2} +0 -0
- /package/lib/{iconfont.1791954193706.ttf → iconfont.1792117711657.ttf} +0 -0
- /package/lib/{iconfont.1791954193706.woff → iconfont.1792117711657.woff} +0 -0
- /package/lib/{iconfont.1791954193706.woff2 → iconfont.1792117711657.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -56,7 +56,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
56
56
|
return XEUtils.eqNull(val1) ? def1 : val1;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const version = "4.23.0-beta.
|
|
59
|
+
const version = "4.23.0-beta.3";
|
|
60
60
|
VxeUI.version = version;
|
|
61
61
|
VxeUI.tableVersion = version;
|
|
62
62
|
VxeUI.setConfig({
|
|
@@ -790,7 +790,8 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
790
790
|
* 通用定位计算
|
|
791
791
|
*/
|
|
792
792
|
function updatePanelPlacement(targetElem, panelElem, options) {
|
|
793
|
-
const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
793
|
+
const { defaultTop, defaultLeft, placement, defaultPlacement, appendTo, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
794
|
+
appendTo: '',
|
|
794
795
|
teleportTo: false,
|
|
795
796
|
marginSize: 18,
|
|
796
797
|
isMinWidth: true
|
|
@@ -804,7 +805,7 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
804
805
|
const stys = {};
|
|
805
806
|
if (panelElem && targetElem) {
|
|
806
807
|
const bodyEl = document.body;
|
|
807
|
-
const parentWrapperEl = getPopupWrapperElement(panelElem);
|
|
808
|
+
const parentWrapperEl = getPopupWrapperElement(teleportTo ? getPopupAppendElement(appendTo) : panelElem);
|
|
808
809
|
if (parentWrapperEl) {
|
|
809
810
|
const targetWidth = targetElem.offsetWidth;
|
|
810
811
|
const targetHeight = targetElem.offsetHeight;
|
|
@@ -815,14 +816,16 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
815
816
|
const targetRect = targetElem.getBoundingClientRect();
|
|
816
817
|
const visibleHeight = bodyEl.clientHeight;
|
|
817
818
|
const visibleWidth = bodyEl.clientWidth;
|
|
818
|
-
const
|
|
819
|
-
const
|
|
819
|
+
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
820
|
+
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
821
|
+
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
822
|
+
const parentWrapperOffsetTop = parentWrapperRect.top;
|
|
820
823
|
const targetLeft = targetRect.left;
|
|
821
824
|
const targetTop = targetRect.top;
|
|
822
825
|
minWidth = targetElem.offsetWidth;
|
|
823
826
|
if (teleportTo) {
|
|
824
|
-
left = defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2);
|
|
825
|
-
top = defaultTop || (targetTop + targetHeight);
|
|
827
|
+
left = (defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2)) - parentWrapperScrollLeft;
|
|
828
|
+
top = (defaultTop || (targetTop + targetHeight)) - parentWrapperScrollTop;
|
|
826
829
|
if (placement === 'top') {
|
|
827
830
|
panelPlacement = 'top';
|
|
828
831
|
top = targetTop - panelHeight;
|
|
@@ -866,8 +869,8 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
866
869
|
left = marginSize;
|
|
867
870
|
}
|
|
868
871
|
// 偏移
|
|
869
|
-
top -=
|
|
870
|
-
left -=
|
|
872
|
+
top -= parentWrapperOffsetTop;
|
|
873
|
+
left -= parentWrapperOffsetLeft;
|
|
871
874
|
}
|
|
872
875
|
else {
|
|
873
876
|
if (placement === 'top') {
|
|
@@ -936,9 +939,20 @@ function getPopupWrapperElement(panelElem) {
|
|
|
936
939
|
const parentEl = panelElem.parentElement;
|
|
937
940
|
return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
|
|
938
941
|
}
|
|
942
|
+
function getPopupContainer(appendTo) {
|
|
943
|
+
const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
|
|
944
|
+
return selectElem || 'body';
|
|
945
|
+
}
|
|
946
|
+
function getPopupAppendElement(appendTo) {
|
|
947
|
+
const selectElem = getPopupContainer(appendTo);
|
|
948
|
+
if (XEUtils.isString(selectElem)) {
|
|
949
|
+
return document.querySelector(selectElem) || document.body;
|
|
950
|
+
}
|
|
951
|
+
return selectElem;
|
|
952
|
+
}
|
|
939
953
|
|
|
940
954
|
const { log } = VxeUI;
|
|
941
|
-
const tableVersion = `table v${"4.23.0-beta.
|
|
955
|
+
const tableVersion = `table v${"4.23.0-beta.3"}`;
|
|
942
956
|
function createComponentLog(name) {
|
|
943
957
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
944
958
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -1190,9 +1204,15 @@ function createInternalData$3() {
|
|
|
1190
1204
|
// 当前行
|
|
1191
1205
|
currentRow: null,
|
|
1192
1206
|
currentCol: null,
|
|
1193
|
-
//
|
|
1194
|
-
|
|
1207
|
+
// resizeObserver: undefined,
|
|
1208
|
+
// 滚动条
|
|
1209
|
+
// scrollObserver: undefined,
|
|
1210
|
+
// isThumbDrag: false,
|
|
1211
|
+
thumbDragOffset: 0,
|
|
1212
|
+
yThumbTop: 0,
|
|
1213
|
+
xThumbLeft: 0,
|
|
1195
1214
|
lastScrollTop: 0,
|
|
1215
|
+
lastScrollLeft: 0,
|
|
1196
1216
|
// 单选框属性,已选中保留的行
|
|
1197
1217
|
radioReserveRow: null,
|
|
1198
1218
|
// 复选框属性,已选中保留的行集合
|
|
@@ -1325,6 +1345,9 @@ function createReactData$2() {
|
|
|
1325
1345
|
scrollbarWidth: 0,
|
|
1326
1346
|
// 横向滚动条的高度
|
|
1327
1347
|
scrollbarHeight: 0,
|
|
1348
|
+
// 滚动条
|
|
1349
|
+
yThumbHeight: 0,
|
|
1350
|
+
xThumbWidth: 0,
|
|
1328
1351
|
// 行高
|
|
1329
1352
|
rowHeight: 0,
|
|
1330
1353
|
// 表格父容器的高度
|
|
@@ -3850,7 +3873,10 @@ const tableProps = {
|
|
|
3850
3873
|
type: Boolean,
|
|
3851
3874
|
default: () => getConfig$7().table.highlightCurrentRow
|
|
3852
3875
|
},
|
|
3853
|
-
|
|
3876
|
+
/**
|
|
3877
|
+
* (即将废弃)鼠标移到行是否要高亮显示
|
|
3878
|
+
* @deprecated
|
|
3879
|
+
*/
|
|
3854
3880
|
highlightHoverRow: {
|
|
3855
3881
|
type: Boolean,
|
|
3856
3882
|
default: () => getConfig$7().table.highlightHoverRow
|
|
@@ -4075,7 +4101,7 @@ const tableProps = {
|
|
|
4075
4101
|
virtualYConfig: Object,
|
|
4076
4102
|
useScrollbar: {
|
|
4077
4103
|
type: Boolean,
|
|
4078
|
-
default: () => getConfig$7().table.useScrollbar
|
|
4104
|
+
default: () => getDefaultConfig(getConfig$7().table.useScrollbar, getConfig$7().useScrollbar)
|
|
4079
4105
|
},
|
|
4080
4106
|
// 滚动条配置项
|
|
4081
4107
|
scrollbarConfig: Object,
|
|
@@ -6382,8 +6408,8 @@ var TableCustomPanelComponent = defineVxeComponent({
|
|
|
6382
6408
|
const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
|
|
6383
6409
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
6384
6410
|
if (prevDragGroupField || prevDragAggFnColid) {
|
|
6385
|
-
if ($xeTable.
|
|
6386
|
-
$xeTable.
|
|
6411
|
+
if ($xeTable.handlePivotTableAggPanelDragendEvent) {
|
|
6412
|
+
$xeTable.handlePivotTableAggPanelDragendEvent(evnt);
|
|
6387
6413
|
}
|
|
6388
6414
|
}
|
|
6389
6415
|
else if (prevDragCol && dragCol) {
|
|
@@ -8977,6 +9003,7 @@ hooks$7.add('tableFilterModule', {
|
|
|
8977
9003
|
if (transfer) {
|
|
8978
9004
|
const ppObj = updatePanelPlacement(currEl, filterWrapperElem, {
|
|
8979
9005
|
defaultPlacement: 'bottom',
|
|
9006
|
+
appendTo: '',
|
|
8980
9007
|
isMinWidth: false,
|
|
8981
9008
|
teleportTo: transfer
|
|
8982
9009
|
});
|
|
@@ -15976,7 +16003,8 @@ renderer$2.mixin({
|
|
|
15976
16003
|
});
|
|
15977
16004
|
|
|
15978
16005
|
const { warnLog: warnLog$2, errLog: errLog$2 } = createComponentLog('table');
|
|
15979
|
-
const { getConfig: getConfig$2, getIcon: getIcon$1, getI18n: getI18n$2, renderer: renderer$1, formats, createEvent: createEvent$2, globalResize, interceptor, hooks: hooks$1, globalEvents: globalEvents$1, GLOBAL_EVENT_KEYS: GLOBAL_EVENT_KEYS$1, useFns: useFns$2, renderEmptyElement: renderEmptyElement$1 } = VxeUI;
|
|
16006
|
+
const { getConfig: getConfig$2, getIcon: getIcon$1, getI18n: getI18n$2, renderer: renderer$1, formats, scrollbarUtils, createEvent: createEvent$2, globalResize, interceptor, hooks: hooks$1, domUtils, globalEvents: globalEvents$1, GLOBAL_EVENT_KEYS: GLOBAL_EVENT_KEYS$1, useFns: useFns$2, renderEmptyElement: renderEmptyElement$1 } = VxeUI;
|
|
16007
|
+
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils || {};
|
|
15980
16008
|
const supportMaxRow = 5e6;
|
|
15981
16009
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
15982
16010
|
const maxYHeight = 5e6;
|
|
@@ -16051,6 +16079,10 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16051
16079
|
const refScrollYBottomCornerElem = ref();
|
|
16052
16080
|
const refScrollXSpaceElem = ref();
|
|
16053
16081
|
const refScrollYSpaceElem = ref();
|
|
16082
|
+
const refTrackXElem = ref();
|
|
16083
|
+
const refTrackYElem = ref();
|
|
16084
|
+
const refThumbXElem = ref();
|
|
16085
|
+
const refThumbYElem = ref();
|
|
16054
16086
|
let $xeToolbar;
|
|
16055
16087
|
const computeTableId = computed(() => {
|
|
16056
16088
|
const { id } = props;
|
|
@@ -16141,6 +16173,36 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16141
16173
|
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16142
16174
|
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {});
|
|
16143
16175
|
});
|
|
16176
|
+
const computeScrollXHeight = computed(() => {
|
|
16177
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16178
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
16179
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
|
|
16180
|
+
});
|
|
16181
|
+
const computeScrollYWidth = computed(() => {
|
|
16182
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16183
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
16184
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width));
|
|
16185
|
+
});
|
|
16186
|
+
const computeScrollXVisible = computed(() => {
|
|
16187
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16188
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
16189
|
+
return getDefaultConfig(scrollbarXOpts.visible, scrollbarOpts.visible);
|
|
16190
|
+
});
|
|
16191
|
+
const computeScrollYVisible = computed(() => {
|
|
16192
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16193
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
16194
|
+
return getDefaultConfig(scrollbarYOpts.visible, scrollbarOpts.visible);
|
|
16195
|
+
});
|
|
16196
|
+
const computeScrollXAutoHide = computed(() => {
|
|
16197
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16198
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
16199
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
16200
|
+
});
|
|
16201
|
+
const computeScrollYAutoHide = computed(() => {
|
|
16202
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
16203
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
16204
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
16205
|
+
});
|
|
16144
16206
|
const computeScrollbarXToTop = computed(() => {
|
|
16145
16207
|
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
16146
16208
|
return scrollbarXOpts.position === 'top';
|
|
@@ -16149,6 +16211,23 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16149
16211
|
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
16150
16212
|
return scrollbarYOpts.position === 'left';
|
|
16151
16213
|
});
|
|
16214
|
+
const computeScrollbarWrapperClss = computed(() => {
|
|
16215
|
+
const { yThumbHeight, xThumbWidth } = reactData;
|
|
16216
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
16217
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
16218
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
16219
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
16220
|
+
return domUtils.buildClass([
|
|
16221
|
+
'vxe-scrollbar is--virtual',
|
|
16222
|
+
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
16223
|
+
`ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}`,
|
|
16224
|
+
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
16225
|
+
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
16226
|
+
], {
|
|
16227
|
+
'overflow-y': yThumbHeight,
|
|
16228
|
+
'overflow-x': xThumbWidth
|
|
16229
|
+
});
|
|
16230
|
+
});
|
|
16152
16231
|
const computeScrollYThreshold = computed(() => {
|
|
16153
16232
|
const virtualYOpts = computeVirtualYOpts.value;
|
|
16154
16233
|
const { threshold } = virtualYOpts;
|
|
@@ -16178,6 +16257,10 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16178
16257
|
}
|
|
16179
16258
|
return cellOpts;
|
|
16180
16259
|
});
|
|
16260
|
+
const computeCellHeitht = computed(() => {
|
|
16261
|
+
const cellOpts = computeCellOpts.value;
|
|
16262
|
+
return cellOpts.height;
|
|
16263
|
+
});
|
|
16181
16264
|
const computeHeaderCellOpts = computed(() => {
|
|
16182
16265
|
const headerCellOpts = Object.assign({}, getConfig$2().table.headerCellConfig, props.headerCellConfig);
|
|
16183
16266
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
@@ -16241,7 +16324,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16241
16324
|
return Object.assign({}, getConfig$2().table.checkboxConfig, props.checkboxConfig);
|
|
16242
16325
|
});
|
|
16243
16326
|
const computeTooltipOpts = computed(() => {
|
|
16244
|
-
|
|
16327
|
+
const { useScrollbar } = props;
|
|
16328
|
+
return Object.assign({ useScrollbar }, getConfig$2().tooltip, getConfig$2().table.tooltipConfig, props.tooltipConfig);
|
|
16245
16329
|
});
|
|
16246
16330
|
const computeHeaderTooltipOpts = computed(() => {
|
|
16247
16331
|
const tooltipOpts = computeTooltipOpts.value;
|
|
@@ -16477,11 +16561,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16477
16561
|
return '';
|
|
16478
16562
|
});
|
|
16479
16563
|
const computeTableStyle = computed(() => {
|
|
16480
|
-
const
|
|
16481
|
-
const
|
|
16482
|
-
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
16483
|
-
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width);
|
|
16484
|
-
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height);
|
|
16564
|
+
const barWidth = computeScrollYWidth.value;
|
|
16565
|
+
const barHeight = computeScrollXHeight.value;
|
|
16485
16566
|
const stys = {};
|
|
16486
16567
|
if (barWidth || barHeight) {
|
|
16487
16568
|
stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight);
|
|
@@ -16677,8 +16758,15 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16677
16758
|
computeScrollbarOpts,
|
|
16678
16759
|
computeScrollbarXOpts,
|
|
16679
16760
|
computeScrollbarYOpts,
|
|
16761
|
+
computeScrollXHeight,
|
|
16762
|
+
computeScrollYWidth,
|
|
16763
|
+
computeScrollXVisible,
|
|
16764
|
+
computeScrollYVisible,
|
|
16765
|
+
computeScrollXAutoHide,
|
|
16766
|
+
computeScrollYAutoHide,
|
|
16680
16767
|
computeScrollbarXToTop,
|
|
16681
16768
|
computeScrollbarYToLeft,
|
|
16769
|
+
computeScrollbarWrapperClss,
|
|
16682
16770
|
computeColumnOpts,
|
|
16683
16771
|
computeCurrentColumnOpts,
|
|
16684
16772
|
computeScrollXThreshold,
|
|
@@ -17795,14 +17883,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17795
17883
|
if (!bodyWrapperElem) {
|
|
17796
17884
|
return;
|
|
17797
17885
|
}
|
|
17798
|
-
const yHandleEl = refScrollYHandleElem.value;
|
|
17799
|
-
if (!yHandleEl) {
|
|
17800
|
-
return;
|
|
17801
|
-
}
|
|
17802
|
-
const xHandleEl = refScrollXHandleElem.value;
|
|
17803
|
-
if (!xHandleEl) {
|
|
17804
|
-
return;
|
|
17805
|
-
}
|
|
17806
17886
|
const columnOpts = computeColumnOpts.value;
|
|
17807
17887
|
let tWidth = 0;
|
|
17808
17888
|
const minCellWidth = 40; // 列宽最少限制 40px
|
|
@@ -18402,12 +18482,12 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18402
18482
|
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
|
|
18403
18483
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
18404
18484
|
}
|
|
18405
|
-
const
|
|
18406
|
-
const
|
|
18485
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
18486
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
18407
18487
|
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
18408
18488
|
let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
|
|
18409
|
-
const hideXScroll =
|
|
18410
|
-
if (
|
|
18489
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden';
|
|
18490
|
+
if (scrollXVisible === 'visible' || $xeGanttView) {
|
|
18411
18491
|
osbHeight = scrollbarHeight;
|
|
18412
18492
|
xScrollbarVisible = 'visible';
|
|
18413
18493
|
}
|
|
@@ -18416,12 +18496,12 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18416
18496
|
xScrollbarVisible = 'hidden';
|
|
18417
18497
|
}
|
|
18418
18498
|
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
18419
|
-
const
|
|
18420
|
-
if (
|
|
18499
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden';
|
|
18500
|
+
if (hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
|
|
18421
18501
|
osbWidth = 0;
|
|
18422
18502
|
yScrollbarVisible = 'hidden';
|
|
18423
18503
|
}
|
|
18424
|
-
else if (
|
|
18504
|
+
else if (scrollYVisible === 'visible') {
|
|
18425
18505
|
osbWidth = scrollbarWidth;
|
|
18426
18506
|
yScrollbarVisible = 'visible';
|
|
18427
18507
|
}
|
|
@@ -19229,7 +19309,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19229
19309
|
const calcScrollbar = () => {
|
|
19230
19310
|
const { scrollXWidth, scrollYHeight } = reactData;
|
|
19231
19311
|
const { elemStore } = internalData;
|
|
19232
|
-
const scrollbarOpts = computeScrollbarOpts.value;
|
|
19233
19312
|
const el = refElem.value;
|
|
19234
19313
|
if (!el || !el.clientWidth) {
|
|
19235
19314
|
return;
|
|
@@ -19239,20 +19318,29 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19239
19318
|
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
19240
19319
|
const xHandleEl = refScrollXHandleElem.value;
|
|
19241
19320
|
const yHandleEl = refScrollYHandleElem.value;
|
|
19321
|
+
const thumbXElem = refThumbXElem.value;
|
|
19322
|
+
const thumbYElem = refThumbYElem.value;
|
|
19242
19323
|
let overflowY = false;
|
|
19243
19324
|
let overflowX = false;
|
|
19244
19325
|
if (bodyWrapperElem) {
|
|
19245
|
-
const
|
|
19246
|
-
const
|
|
19247
|
-
const
|
|
19248
|
-
const barHeight = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
|
|
19326
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
19327
|
+
const barWidth = computeScrollYWidth.value;
|
|
19328
|
+
const barHeight = computeScrollXHeight.value;
|
|
19249
19329
|
overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
|
|
19250
|
-
|
|
19330
|
+
// 如果是虚拟滚动条
|
|
19331
|
+
if (thumbYElem) {
|
|
19332
|
+
reactData.scrollbarHeight = scrollbarOpts.padding ? thumbYElem.offsetWidth : 0;
|
|
19333
|
+
}
|
|
19334
|
+
else if (yHandleEl) {
|
|
19251
19335
|
reactData.scrollbarWidth = (barWidth || barHeight) || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14;
|
|
19252
19336
|
}
|
|
19253
19337
|
reactData.overflowY = overflowY;
|
|
19254
19338
|
overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
|
|
19255
|
-
|
|
19339
|
+
// 如果是虚拟滚动条
|
|
19340
|
+
if (thumbXElem) {
|
|
19341
|
+
reactData.scrollbarHeight = scrollbarOpts.padding ? thumbXElem.offsetHeight : 0;
|
|
19342
|
+
}
|
|
19343
|
+
else if (xHandleEl) {
|
|
19256
19344
|
reactData.scrollbarHeight = (barHeight || barWidth) || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
|
|
19257
19345
|
}
|
|
19258
19346
|
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
@@ -19319,6 +19407,10 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19319
19407
|
}
|
|
19320
19408
|
});
|
|
19321
19409
|
};
|
|
19410
|
+
const updateScrollbar = () => {
|
|
19411
|
+
updateThumbSize();
|
|
19412
|
+
updateThumbOffset();
|
|
19413
|
+
};
|
|
19322
19414
|
const defaultMinRunDelay = 50;
|
|
19323
19415
|
const handleLazyRecalculate = (reFull, reWidth, reHeight, options) => {
|
|
19324
19416
|
const minRunDelay = (options ? options.minRunDelay : defaultMinRunDelay) || defaultMinRunDelay;
|
|
@@ -19339,6 +19431,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19339
19431
|
const refreshDelay = resizeOpts.refreshDelay || 30;
|
|
19340
19432
|
const reDelay = rceDelay + refreshDelay;
|
|
19341
19433
|
const el = refElem.value;
|
|
19434
|
+
updateScrollbar();
|
|
19342
19435
|
if (el && el.clientWidth) {
|
|
19343
19436
|
autoCellWidth();
|
|
19344
19437
|
updateRowExpandStyle();
|
|
@@ -27340,6 +27433,18 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
27340
27433
|
}
|
|
27341
27434
|
return nextTick();
|
|
27342
27435
|
},
|
|
27436
|
+
/**
|
|
27437
|
+
* @private
|
|
27438
|
+
*/
|
|
27439
|
+
updateScrollbar() {
|
|
27440
|
+
return updateScrollbar();
|
|
27441
|
+
},
|
|
27442
|
+
/**
|
|
27443
|
+
* @private
|
|
27444
|
+
*/
|
|
27445
|
+
updateThumbOffset() {
|
|
27446
|
+
return updateThumbOffset();
|
|
27447
|
+
},
|
|
27343
27448
|
/**
|
|
27344
27449
|
* 表头单元格按下事件
|
|
27345
27450
|
*/
|
|
@@ -28487,19 +28592,18 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28487
28592
|
},
|
|
28488
28593
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
28489
28594
|
const { highlightHoverRow } = props;
|
|
28490
|
-
const { lastScrollLeft, lastScrollTop } = internalData;
|
|
28491
|
-
const
|
|
28492
|
-
|
|
28493
|
-
if (!xHandleEl || !yHandleEl) {
|
|
28595
|
+
const { elemStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
28596
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
28597
|
+
if (!bodyScrollElem) {
|
|
28494
28598
|
return;
|
|
28495
28599
|
}
|
|
28496
28600
|
const rowOpts = computeRowOpts.value;
|
|
28497
28601
|
const validTip = refValidTooltip.value;
|
|
28498
28602
|
const tooltip = refTooltip.value;
|
|
28499
|
-
const bodyHeight =
|
|
28500
|
-
const bodyWidth =
|
|
28501
|
-
const scrollHeight =
|
|
28502
|
-
const scrollWidth =
|
|
28603
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
28604
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
28605
|
+
const scrollHeight = bodyScrollElem.scrollHeight;
|
|
28606
|
+
const scrollWidth = bodyScrollElem.scrollWidth;
|
|
28503
28607
|
let isTop = false;
|
|
28504
28608
|
let isBottom = false;
|
|
28505
28609
|
let isLeft = false;
|
|
@@ -28561,6 +28665,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28561
28665
|
isLeft,
|
|
28562
28666
|
isRight,
|
|
28563
28667
|
direction }, params);
|
|
28668
|
+
updateThumbOffset();
|
|
28564
28669
|
updateRowExpandStyle();
|
|
28565
28670
|
checkLastSyncScroll(isRollX, isRollY);
|
|
28566
28671
|
if (isRollX) {
|
|
@@ -28605,6 +28710,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28605
28710
|
}
|
|
28606
28711
|
},
|
|
28607
28712
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
28713
|
+
const { useScrollbar } = props;
|
|
28608
28714
|
const { scrollYLoad, scrollXLoad } = reactData;
|
|
28609
28715
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData;
|
|
28610
28716
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
@@ -28624,19 +28730,21 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28624
28730
|
if (!bodyScrollElem) {
|
|
28625
28731
|
return;
|
|
28626
28732
|
}
|
|
28627
|
-
if (!
|
|
28628
|
-
|
|
28629
|
-
|
|
28630
|
-
|
|
28631
|
-
|
|
28733
|
+
if (!useScrollbar) {
|
|
28734
|
+
if (!xHandleEl) {
|
|
28735
|
+
return;
|
|
28736
|
+
}
|
|
28737
|
+
if (!yHandleEl) {
|
|
28738
|
+
return;
|
|
28739
|
+
}
|
|
28632
28740
|
}
|
|
28633
28741
|
if (inBodyScroll) {
|
|
28634
28742
|
if (scrollRenderType !== fixedType) {
|
|
28635
28743
|
return;
|
|
28636
28744
|
}
|
|
28637
28745
|
}
|
|
28638
|
-
let scrollTop =
|
|
28639
|
-
let scrollLeft =
|
|
28746
|
+
let scrollTop = 0;
|
|
28747
|
+
let scrollLeft = 0;
|
|
28640
28748
|
if (leftScrollElem && fixedType === 'left') {
|
|
28641
28749
|
scrollTop = leftScrollElem.scrollTop;
|
|
28642
28750
|
}
|
|
@@ -28777,8 +28885,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28777
28885
|
const rightFixedWidth = computeRightFixedWidth.value;
|
|
28778
28886
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
|
|
28779
28887
|
const rowOpts = computeRowOpts.value;
|
|
28780
|
-
const
|
|
28781
|
-
const
|
|
28888
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
28889
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
28782
28890
|
const xHandleEl = refScrollXHandleElem.value;
|
|
28783
28891
|
const yHandleEl = refScrollYHandleElem.value;
|
|
28784
28892
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -28801,14 +28909,14 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28801
28909
|
const isRollY = overflowY && scrollTop !== lastScrollTop;
|
|
28802
28910
|
if (isRollX) {
|
|
28803
28911
|
// 如果禁用滚动
|
|
28804
|
-
if (
|
|
28912
|
+
if (scrollXVisible === false || scrollXVisible === 'hidden') {
|
|
28805
28913
|
evnt.preventDefault();
|
|
28806
28914
|
return;
|
|
28807
28915
|
}
|
|
28808
28916
|
}
|
|
28809
28917
|
if (isRollY) {
|
|
28810
28918
|
// 如果禁用滚动
|
|
28811
|
-
if (
|
|
28919
|
+
if (scrollYVisible === false || scrollYVisible === 'hidden') {
|
|
28812
28920
|
evnt.preventDefault();
|
|
28813
28921
|
return;
|
|
28814
28922
|
}
|
|
@@ -29373,6 +29481,168 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29373
29481
|
return nextTick();
|
|
29374
29482
|
}
|
|
29375
29483
|
};
|
|
29484
|
+
const updateThumbSize = () => {
|
|
29485
|
+
const { elemStore } = internalData;
|
|
29486
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29487
|
+
if (!viewEl) {
|
|
29488
|
+
return;
|
|
29489
|
+
}
|
|
29490
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
29491
|
+
return;
|
|
29492
|
+
}
|
|
29493
|
+
const trackXEl = refTrackXElem.value;
|
|
29494
|
+
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
29495
|
+
const thumbXElem = refThumbXElem.value;
|
|
29496
|
+
if (thumbXElem) {
|
|
29497
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
29498
|
+
}
|
|
29499
|
+
reactData.xThumbWidth = xThumbWidth;
|
|
29500
|
+
const trackYEl = refTrackYElem.value;
|
|
29501
|
+
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
29502
|
+
const thumbYElem = refThumbYElem.value;
|
|
29503
|
+
if (thumbYElem) {
|
|
29504
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
29505
|
+
}
|
|
29506
|
+
reactData.yThumbHeight = yThumbHeight;
|
|
29507
|
+
};
|
|
29508
|
+
const updateThumbOffset = () => {
|
|
29509
|
+
const { elemStore } = internalData;
|
|
29510
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29511
|
+
if (!viewEl) {
|
|
29512
|
+
return;
|
|
29513
|
+
}
|
|
29514
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
29515
|
+
return;
|
|
29516
|
+
}
|
|
29517
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
29518
|
+
const trackXEl = refTrackXElem.value;
|
|
29519
|
+
const thumbXElem = refThumbXElem.value;
|
|
29520
|
+
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
29521
|
+
internalData.xThumbLeft = xThumbLeft;
|
|
29522
|
+
if (thumbXElem && xThumbWidth) {
|
|
29523
|
+
thumbXElem.style.width = xThumbWidth + 'px';
|
|
29524
|
+
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
29525
|
+
}
|
|
29526
|
+
const trackYEl = refTrackYElem.value;
|
|
29527
|
+
const thumbYElem = refThumbYElem.value;
|
|
29528
|
+
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
29529
|
+
internalData.yThumbTop = yThumbTop;
|
|
29530
|
+
if (thumbYElem && yThumbHeight) {
|
|
29531
|
+
thumbYElem.style.height = yThumbHeight + 'px';
|
|
29532
|
+
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
29533
|
+
}
|
|
29534
|
+
};
|
|
29535
|
+
const clickTrackXEvent = (evnt) => {
|
|
29536
|
+
const { elemStore } = internalData;
|
|
29537
|
+
const trackEl = evnt.currentTarget;
|
|
29538
|
+
if (trackEl !== evnt.target) {
|
|
29539
|
+
return;
|
|
29540
|
+
}
|
|
29541
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29542
|
+
if (!viewEl) {
|
|
29543
|
+
return;
|
|
29544
|
+
}
|
|
29545
|
+
const { xThumbWidth } = reactData;
|
|
29546
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
29547
|
+
viewEl.scrollTo({
|
|
29548
|
+
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
29549
|
+
behavior: 'auto'
|
|
29550
|
+
});
|
|
29551
|
+
};
|
|
29552
|
+
const clickTrackYEvent = (evnt) => {
|
|
29553
|
+
const { elemStore } = internalData;
|
|
29554
|
+
const trackEl = evnt.currentTarget;
|
|
29555
|
+
if (trackEl !== evnt.target) {
|
|
29556
|
+
return;
|
|
29557
|
+
}
|
|
29558
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29559
|
+
if (!viewEl) {
|
|
29560
|
+
return;
|
|
29561
|
+
}
|
|
29562
|
+
const { yThumbHeight } = reactData;
|
|
29563
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
29564
|
+
viewEl.scrollTo({
|
|
29565
|
+
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
29566
|
+
behavior: 'auto'
|
|
29567
|
+
});
|
|
29568
|
+
};
|
|
29569
|
+
const pointerdownThumbXEvent = (evnt) => {
|
|
29570
|
+
const { elemStore } = internalData;
|
|
29571
|
+
const thumbEl = evnt.currentTarget;
|
|
29572
|
+
internalData.isThumbDrag = true;
|
|
29573
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
29574
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29575
|
+
if (!viewEl) {
|
|
29576
|
+
return;
|
|
29577
|
+
}
|
|
29578
|
+
const { xThumbWidth } = reactData;
|
|
29579
|
+
const trackEl = thumbEl.parentElement;
|
|
29580
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
29581
|
+
const pointerPosition = evnt.clientX - trackRect.left;
|
|
29582
|
+
// 记录 thumb 的偏移
|
|
29583
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
29584
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
29585
|
+
};
|
|
29586
|
+
const pointermoveThumbXEvent = (evnt) => {
|
|
29587
|
+
const thumbEl = evnt.currentTarget;
|
|
29588
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
29589
|
+
return;
|
|
29590
|
+
}
|
|
29591
|
+
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
29592
|
+
if (isThumbDrag) {
|
|
29593
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29594
|
+
if (!viewEl) {
|
|
29595
|
+
return;
|
|
29596
|
+
}
|
|
29597
|
+
const { xThumbWidth } = reactData;
|
|
29598
|
+
const thumbEl = evnt.currentTarget;
|
|
29599
|
+
const trackEl = thumbEl.parentElement;
|
|
29600
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
29601
|
+
// 更新偏移
|
|
29602
|
+
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
29603
|
+
}
|
|
29604
|
+
};
|
|
29605
|
+
const cleatPointerThumbEvent = (evnt) => {
|
|
29606
|
+
const thumbEl = evnt.currentTarget;
|
|
29607
|
+
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
29608
|
+
internalData.isThumbDrag = false;
|
|
29609
|
+
};
|
|
29610
|
+
const pointerdownThumbYEvent = (evnt) => {
|
|
29611
|
+
const { elemStore } = internalData;
|
|
29612
|
+
const thumbEl = evnt.currentTarget;
|
|
29613
|
+
internalData.isThumbDrag = true;
|
|
29614
|
+
thumbEl.setPointerCapture(evnt.pointerId);
|
|
29615
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29616
|
+
if (!viewEl) {
|
|
29617
|
+
return;
|
|
29618
|
+
}
|
|
29619
|
+
const { yThumbHeight } = reactData;
|
|
29620
|
+
const trackEl = thumbEl.parentElement;
|
|
29621
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
29622
|
+
const pointerPosition = evnt.clientY - trackRect.top;
|
|
29623
|
+
// 记录 thumb 的偏移
|
|
29624
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
29625
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
29626
|
+
};
|
|
29627
|
+
const pointermoveThumbYEvent = (evnt) => {
|
|
29628
|
+
const thumbEl = evnt.currentTarget;
|
|
29629
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
29630
|
+
return;
|
|
29631
|
+
}
|
|
29632
|
+
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
29633
|
+
if (isThumbDrag) {
|
|
29634
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29635
|
+
if (!viewEl) {
|
|
29636
|
+
return;
|
|
29637
|
+
}
|
|
29638
|
+
const { yThumbHeight } = reactData;
|
|
29639
|
+
const thumbEl = evnt.currentTarget;
|
|
29640
|
+
const trackEl = thumbEl.parentElement;
|
|
29641
|
+
const trackRect = trackEl.getBoundingClientRect();
|
|
29642
|
+
// 更新偏移
|
|
29643
|
+
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
29644
|
+
}
|
|
29645
|
+
};
|
|
29376
29646
|
// 检测对应模块是否安装
|
|
29377
29647
|
// 'openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').forEach(name => {
|
|
29378
29648
|
// ($xeTable as any)[name] = function () {
|
|
@@ -29397,6 +29667,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29397
29667
|
const scrollbarOpts = computeScrollbarOpts.value;
|
|
29398
29668
|
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
29399
29669
|
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
29670
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
29671
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
29400
29672
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
29401
29673
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
29402
29674
|
const isFixedLeft = fixedType === 'left';
|
|
@@ -29407,8 +29679,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29407
29679
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
29408
29680
|
class: [
|
|
29409
29681
|
`vxe-table--fixed-${fixedType}-wrapper`,
|
|
29410
|
-
`sx--${(
|
|
29411
|
-
`sy--${(
|
|
29682
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
29683
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
29412
29684
|
{
|
|
29413
29685
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
29414
29686
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
@@ -29672,6 +29944,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29672
29944
|
};
|
|
29673
29945
|
const renderScrollY = () => {
|
|
29674
29946
|
return h('div', {
|
|
29947
|
+
key: 'vsy',
|
|
29675
29948
|
ref: refScrollYVirtualElem,
|
|
29676
29949
|
class: 'vxe-table--scroll-y-virtual'
|
|
29677
29950
|
}, [
|
|
@@ -29709,12 +29982,15 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29709
29982
|
const scrollbarOpts = computeScrollbarOpts.value;
|
|
29710
29983
|
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
29711
29984
|
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
29985
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
29986
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
29712
29987
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
29713
29988
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
29714
29989
|
const { leftList, rightList } = columnStore;
|
|
29715
29990
|
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior;
|
|
29716
29991
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
29717
29992
|
return h('div', {
|
|
29993
|
+
key: 'tvw',
|
|
29718
29994
|
ref: refTableViewportElem,
|
|
29719
29995
|
class: ['vxe-table--viewport-wrapper', {
|
|
29720
29996
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
@@ -29724,8 +30000,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29724
30000
|
h('div', {
|
|
29725
30001
|
class: [
|
|
29726
30002
|
'vxe-table--main-wrapper',
|
|
29727
|
-
`sx--${(
|
|
29728
|
-
`sy--${(
|
|
30003
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
30004
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`
|
|
29729
30005
|
]
|
|
29730
30006
|
}, [
|
|
29731
30007
|
/**
|
|
@@ -29767,9 +30043,10 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29767
30043
|
renderRowExpandedVNs()
|
|
29768
30044
|
]);
|
|
29769
30045
|
};
|
|
29770
|
-
const
|
|
30046
|
+
const renderNativeBody = () => {
|
|
29771
30047
|
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
29772
30048
|
return h('div', {
|
|
30049
|
+
key: 'lnb',
|
|
29773
30050
|
class: 'vxe-table--layout-wrapper'
|
|
29774
30051
|
}, scrollbarYToLeft
|
|
29775
30052
|
? [
|
|
@@ -29781,6 +30058,72 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29781
30058
|
renderScrollY()
|
|
29782
30059
|
]);
|
|
29783
30060
|
};
|
|
30061
|
+
const renderVirtualBody = () => {
|
|
30062
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
30063
|
+
const { useScrollbar } = props;
|
|
30064
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
30065
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
30066
|
+
const scrollXAutoHide = computeScrollXAutoHide.value;
|
|
30067
|
+
const scrollYAutoHide = computeScrollYAutoHide.value;
|
|
30068
|
+
const scrollXVisible = computeScrollXVisible.value;
|
|
30069
|
+
const scrollYVisible = computeScrollYVisible.value;
|
|
30070
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
30071
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
30072
|
+
const scrollbarWrapperClss = computeScrollbarWrapperClss.value;
|
|
30073
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden';
|
|
30074
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden';
|
|
30075
|
+
return h('div', {
|
|
30076
|
+
key: 'lvb',
|
|
30077
|
+
class: ['vxe-table--layout-wrapper', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
30078
|
+
'is--virtual-scrollbar': useScrollbar,
|
|
30079
|
+
'ov-padding': useScrollbar && scrollbarOpts.padding,
|
|
30080
|
+
'ov-x--auto-hide': useScrollbar && scrollXAutoHide,
|
|
30081
|
+
'ov-y--auto-hide': useScrollbar && scrollYAutoHide,
|
|
30082
|
+
'overflow-y': yThumbHeight,
|
|
30083
|
+
'overflow-x': xThumbWidth
|
|
30084
|
+
}]
|
|
30085
|
+
}, [
|
|
30086
|
+
renderViewport(),
|
|
30087
|
+
h('div', {
|
|
30088
|
+
class: scrollbarWrapperClss
|
|
30089
|
+
}, [
|
|
30090
|
+
hideXScroll
|
|
30091
|
+
? renderEmptyElement$1($xeTable)
|
|
30092
|
+
: h('div', {
|
|
30093
|
+
ref: refTrackXElem,
|
|
30094
|
+
class: 'vxe-scrollbar--track-x',
|
|
30095
|
+
onClick: clickTrackXEvent
|
|
30096
|
+
}, [
|
|
30097
|
+
h('div', {
|
|
30098
|
+
ref: refThumbXElem,
|
|
30099
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
30100
|
+
onPointerdown: pointerdownThumbXEvent,
|
|
30101
|
+
onPointermove: pointermoveThumbXEvent,
|
|
30102
|
+
onPointerup: cleatPointerThumbEvent,
|
|
30103
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
30104
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
30105
|
+
})
|
|
30106
|
+
]),
|
|
30107
|
+
hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)
|
|
30108
|
+
? renderEmptyElement$1($xeTable)
|
|
30109
|
+
: h('div', {
|
|
30110
|
+
ref: refTrackYElem,
|
|
30111
|
+
class: 'vxe-scrollbar--track-y',
|
|
30112
|
+
onClick: clickTrackYEvent
|
|
30113
|
+
}, [
|
|
30114
|
+
h('div', {
|
|
30115
|
+
ref: refThumbYElem,
|
|
30116
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
30117
|
+
onPointerdown: pointerdownThumbYEvent,
|
|
30118
|
+
onPointermove: pointermoveThumbYEvent,
|
|
30119
|
+
onPointerup: cleatPointerThumbEvent,
|
|
30120
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
30121
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
30122
|
+
})
|
|
30123
|
+
])
|
|
30124
|
+
])
|
|
30125
|
+
]);
|
|
30126
|
+
};
|
|
29784
30127
|
const renderVN = () => {
|
|
29785
30128
|
const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
|
|
29786
30129
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
|
|
@@ -29886,15 +30229,17 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29886
30229
|
h('div', {
|
|
29887
30230
|
key: 'tw',
|
|
29888
30231
|
class: 'vxe-table--render-wrapper'
|
|
29889
|
-
},
|
|
29890
|
-
? [
|
|
29891
|
-
|
|
29892
|
-
|
|
29893
|
-
|
|
29894
|
-
|
|
29895
|
-
|
|
29896
|
-
|
|
29897
|
-
|
|
30232
|
+
}, useScrollbar
|
|
30233
|
+
? [renderVirtualBody()]
|
|
30234
|
+
: (scrollbarXToTop
|
|
30235
|
+
? [
|
|
30236
|
+
renderScrollX(),
|
|
30237
|
+
renderNativeBody()
|
|
30238
|
+
]
|
|
30239
|
+
: [
|
|
30240
|
+
renderNativeBody(),
|
|
30241
|
+
renderScrollX()
|
|
30242
|
+
])),
|
|
29898
30243
|
/**
|
|
29899
30244
|
* 空数据
|
|
29900
30245
|
*/
|
|
@@ -30070,7 +30415,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30070
30415
|
key: 'ctp',
|
|
30071
30416
|
ref: refCommTooltip,
|
|
30072
30417
|
isArrow: false,
|
|
30073
|
-
enterable: false
|
|
30418
|
+
enterable: false,
|
|
30419
|
+
useScrollbar
|
|
30074
30420
|
}),
|
|
30075
30421
|
/**
|
|
30076
30422
|
* 工具提示
|
|
@@ -30093,7 +30439,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30093
30439
|
maxHeight: tableTipConfig.maxHeight,
|
|
30094
30440
|
placement: tableTipConfig.placement,
|
|
30095
30441
|
defaultPlacement: tableTipConfig.defaultPlacement,
|
|
30096
|
-
popupClassName: tableTipConfig.popupClassName
|
|
30442
|
+
popupClassName: tableTipConfig.popupClassName,
|
|
30443
|
+
useScrollbar: tableTipConfig.useScrollbar
|
|
30097
30444
|
}, currTooltipSlot
|
|
30098
30445
|
? {
|
|
30099
30446
|
content: () => {
|
|
@@ -30132,7 +30479,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30132
30479
|
theme: validTipConfig.theme,
|
|
30133
30480
|
enterable: validTipConfig.enterable,
|
|
30134
30481
|
enterDelay: validTipConfig.enterDelay,
|
|
30135
|
-
leaveDelay: validTipConfig.leaveDelay
|
|
30482
|
+
leaveDelay: validTipConfig.leaveDelay,
|
|
30483
|
+
useScrollbar
|
|
30136
30484
|
})
|
|
30137
30485
|
: renderEmptyElement$1($xeTable)
|
|
30138
30486
|
])
|
|
@@ -30201,6 +30549,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30201
30549
|
$xeTable.refreshColumn();
|
|
30202
30550
|
});
|
|
30203
30551
|
});
|
|
30552
|
+
const reScrollFlag = ref(0);
|
|
30204
30553
|
const reLayoutFlag = ref(0);
|
|
30205
30554
|
watch(computeSize, () => {
|
|
30206
30555
|
reLayoutFlag.value++;
|
|
@@ -30233,36 +30582,47 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30233
30582
|
watch(() => props.maxHeight, () => {
|
|
30234
30583
|
reLayoutFlag.value++;
|
|
30235
30584
|
});
|
|
30585
|
+
watch(() => VxeUI.getLanguage(), () => {
|
|
30586
|
+
reLayoutFlag.value++;
|
|
30587
|
+
});
|
|
30236
30588
|
watch(computeScrollbarXToTop, () => {
|
|
30589
|
+
reScrollFlag.value++;
|
|
30237
30590
|
reLayoutFlag.value++;
|
|
30238
30591
|
});
|
|
30239
30592
|
watch(computeScrollbarYToLeft, () => {
|
|
30593
|
+
reScrollFlag.value++;
|
|
30240
30594
|
reLayoutFlag.value++;
|
|
30241
30595
|
});
|
|
30242
|
-
watch(
|
|
30596
|
+
watch(computeScrollXVisible, () => {
|
|
30597
|
+
reScrollFlag.value++;
|
|
30243
30598
|
reLayoutFlag.value++;
|
|
30244
30599
|
});
|
|
30245
|
-
watch(() => {
|
|
30246
|
-
|
|
30247
|
-
return scrollbarXOpts.visible;
|
|
30248
|
-
}, () => {
|
|
30600
|
+
watch(computeScrollYVisible, () => {
|
|
30601
|
+
reScrollFlag.value++;
|
|
30249
30602
|
reLayoutFlag.value++;
|
|
30250
30603
|
});
|
|
30251
|
-
watch(() => {
|
|
30252
|
-
|
|
30253
|
-
return scrollbarYOpts.visible;
|
|
30254
|
-
}, () => {
|
|
30604
|
+
watch(computeScrollXHeight, () => {
|
|
30605
|
+
reScrollFlag.value++;
|
|
30255
30606
|
reLayoutFlag.value++;
|
|
30256
30607
|
});
|
|
30257
|
-
watch(() => {
|
|
30258
|
-
|
|
30259
|
-
|
|
30260
|
-
}
|
|
30608
|
+
watch(computeScrollYWidth, () => {
|
|
30609
|
+
reScrollFlag.value++;
|
|
30610
|
+
reLayoutFlag.value++;
|
|
30611
|
+
});
|
|
30612
|
+
watch(computeCellHeitht, () => {
|
|
30261
30613
|
reLayoutFlag.value++;
|
|
30262
30614
|
});
|
|
30263
30615
|
watch(reLayoutFlag, () => {
|
|
30264
30616
|
$xeTable.recalculate(true);
|
|
30265
30617
|
});
|
|
30618
|
+
watch(reScrollFlag, () => {
|
|
30619
|
+
nextTick(() => {
|
|
30620
|
+
$xeTable.updateScrollbar();
|
|
30621
|
+
nextTick(() => {
|
|
30622
|
+
$xeTable.updateScrollbar();
|
|
30623
|
+
});
|
|
30624
|
+
});
|
|
30625
|
+
});
|
|
30266
30626
|
const footFlag = ref(0);
|
|
30267
30627
|
watch(() => props.footerData ? props.footerData.length : -1, () => {
|
|
30268
30628
|
footFlag.value++;
|
|
@@ -30378,7 +30738,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30378
30738
|
}
|
|
30379
30739
|
});
|
|
30380
30740
|
$xeTable.preventEvent(null, 'created', { $table: $xeTable });
|
|
30381
|
-
let resizeObserver;
|
|
30382
30741
|
onActivated(() => {
|
|
30383
30742
|
$xeTable.recalculate().then(() => $xeTable.refreshScroll());
|
|
30384
30743
|
$xeTable.preventEvent(null, 'activated', { $table: $xeTable });
|
|
@@ -30394,7 +30753,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30394
30753
|
});
|
|
30395
30754
|
onMounted(() => {
|
|
30396
30755
|
const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource, areaConfig } = props;
|
|
30397
|
-
const { scrollXStore, scrollYStore } = internalData;
|
|
30756
|
+
const { elemStore, scrollXStore, scrollYStore } = internalData;
|
|
30398
30757
|
const columnOpts = computeColumnOpts.value;
|
|
30399
30758
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
30400
30759
|
const aggregateOpts = computeAggregateOpts.value;
|
|
@@ -30667,12 +31026,26 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30667
31026
|
handleUpdateRowGroup(groupFields);
|
|
30668
31027
|
initData();
|
|
30669
31028
|
nextTick(() => {
|
|
30670
|
-
|
|
30671
|
-
|
|
31029
|
+
const { useScrollbar, autoResize } = props;
|
|
31030
|
+
const el = refElem.value;
|
|
31031
|
+
if (useScrollbar) {
|
|
31032
|
+
const viewInnerEl = getRefElem(elemStore['main-body-table']);
|
|
31033
|
+
const scrollObserver = globalResize.create(() => {
|
|
31034
|
+
reScrollFlag.value++;
|
|
31035
|
+
});
|
|
31036
|
+
if (el) {
|
|
31037
|
+
scrollObserver.observe(el);
|
|
31038
|
+
}
|
|
31039
|
+
if (viewInnerEl) {
|
|
31040
|
+
scrollObserver.observe(viewInnerEl);
|
|
31041
|
+
}
|
|
31042
|
+
internalData.scrollObserver = scrollObserver;
|
|
31043
|
+
}
|
|
31044
|
+
if (autoResize) {
|
|
30672
31045
|
const parentEl = $xeTable.getParentElem();
|
|
30673
|
-
resizeObserver = globalResize.create(() => {
|
|
31046
|
+
const resizeObserver = globalResize.create(() => {
|
|
30674
31047
|
if (props.autoResize) {
|
|
30675
|
-
|
|
31048
|
+
handleResizeEvent();
|
|
30676
31049
|
}
|
|
30677
31050
|
});
|
|
30678
31051
|
if (el) {
|
|
@@ -30681,6 +31054,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30681
31054
|
if (parentEl) {
|
|
30682
31055
|
resizeObserver.observe(parentEl);
|
|
30683
31056
|
}
|
|
31057
|
+
internalData.resizeObserver = resizeObserver;
|
|
30684
31058
|
}
|
|
30685
31059
|
});
|
|
30686
31060
|
if (virtualYOpts.mode !== 'scroll') {
|
|
@@ -30702,7 +31076,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30702
31076
|
$xeTable.preventEvent(null, 'mounted', { $table: $xeTable });
|
|
30703
31077
|
});
|
|
30704
31078
|
onBeforeUnmount(() => {
|
|
30705
|
-
const { _sToTime } = internalData;
|
|
31079
|
+
const { resizeObserver, scrollObserver, _sToTime } = internalData;
|
|
30706
31080
|
if (_sToTime) {
|
|
30707
31081
|
clearTimeout(_sToTime);
|
|
30708
31082
|
}
|
|
@@ -30713,6 +31087,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30713
31087
|
internalData.cvCacheMaps = {};
|
|
30714
31088
|
internalData.prevDragRow = null;
|
|
30715
31089
|
internalData.prevDragCol = null;
|
|
31090
|
+
if (scrollObserver) {
|
|
31091
|
+
scrollObserver.disconnect();
|
|
31092
|
+
}
|
|
30716
31093
|
if (resizeObserver) {
|
|
30717
31094
|
resizeObserver.disconnect();
|
|
30718
31095
|
}
|