vxe-table 3.25.0-beta.2 → 3.25.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/es/style.css +1 -1
- package/es/table/module/custom/panel.js +2 -2
- package/es/table/module/filter/mixin.js +1 -0
- package/es/table/src/methods.js +2 -2
- package/es/table/src/table.js +8 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +11 -8
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +31 -74
- package/lib/index.umd.min.js +1 -1
- package/lib/style.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/mixin.js +1 -0
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/src/methods.js +6 -6
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -4
- package/lib/table/src/table.min.js +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/package.json +2 -2
- package/packages/table/module/custom/panel.ts +2 -2
- package/packages/table/module/filter/mixin.ts +1 -0
- package/packages/table/src/methods.ts +3 -2
- package/packages/table/src/table.ts +8 -4
- package/packages/ui/src/dom.ts +12 -8
- package/es/table/src/scrollbar.js +0 -54
- package/lib/table/src/scrollbar.js +0 -63
- package/lib/table/src/scrollbar.min.js +0 -1
- package/packages/table/src/scrollbar.ts +0 -57
- /package/es/{iconfont.1792035018941.ttf → iconfont.1792117667851.ttf} +0 -0
- /package/es/{iconfont.1792035018941.woff → iconfont.1792117667851.woff} +0 -0
- /package/es/{iconfont.1792035018941.woff2 → iconfont.1792117667851.woff2} +0 -0
- /package/lib/{iconfont.1792035018941.ttf → iconfont.1792117667851.ttf} +0 -0
- /package/lib/{iconfont.1792035018941.woff → iconfont.1792117667851.woff} +0 -0
- /package/lib/{iconfont.1792035018941.woff2 → iconfont.1792117667851.woff2} +0 -0
|
@@ -424,8 +424,8 @@ export default {
|
|
|
424
424
|
const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
|
|
425
425
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
426
426
|
if (prevDragGroupField || prevDragAggFnColid) {
|
|
427
|
-
if ($xeTable.
|
|
428
|
-
$xeTable.
|
|
427
|
+
if ($xeTable.handlePivotTableAggPanelDragendEvent) {
|
|
428
|
+
$xeTable.handlePivotTableAggPanelDragendEvent(evnt);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
else if (prevDragCol && dragCol) {
|
package/es/table/src/methods.js
CHANGED
|
@@ -6,11 +6,11 @@ import Cell from './cell';
|
|
|
6
6
|
import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
9
|
-
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from './scrollbar';
|
|
10
9
|
import { createComponentLog } from '../../ui/src/log';
|
|
11
10
|
import { getCrossTableDragRowInfo } from './store';
|
|
12
11
|
const { warnLog, errLog } = createComponentLog('table');
|
|
13
|
-
const { getConfig, getI18n, renderer, formats, interceptor, createEvent, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
|
|
12
|
+
const { getConfig, getI18n, renderer, scrollbarUtils, formats, interceptor, createEvent, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
|
|
13
|
+
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils || {};
|
|
14
14
|
const supportMaxRow = 5e6;
|
|
15
15
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
16
16
|
const maxYHeight = 5e6;
|
package/es/table/src/table.js
CHANGED
|
@@ -992,7 +992,8 @@ export default {
|
|
|
992
992
|
computeTooltipOpts() {
|
|
993
993
|
const $xeTable = this;
|
|
994
994
|
const props = $xeTable;
|
|
995
|
-
|
|
995
|
+
const { useScrollbar } = props;
|
|
996
|
+
return Object.assign({ useScrollbar }, getConfig().tooltip, getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
996
997
|
},
|
|
997
998
|
tipConfig() {
|
|
998
999
|
return Object.assign({}, this.tooltipOpts);
|
|
@@ -2589,7 +2590,8 @@ export default {
|
|
|
2589
2590
|
ref: 'refCommTooltip',
|
|
2590
2591
|
props: {
|
|
2591
2592
|
isArrow: false,
|
|
2592
|
-
enterable: false
|
|
2593
|
+
enterable: false,
|
|
2594
|
+
useScrollbar
|
|
2593
2595
|
}
|
|
2594
2596
|
})
|
|
2595
2597
|
: renderEmptyElement($xeTable),
|
|
@@ -2616,7 +2618,8 @@ export default {
|
|
|
2616
2618
|
maxHeight: tableTipConfig.maxHeight,
|
|
2617
2619
|
placement: tableTipConfig.placement,
|
|
2618
2620
|
defaultPlacement: tableTipConfig.defaultPlacement,
|
|
2619
|
-
popupClassName: tableTipConfig.popupClassName
|
|
2621
|
+
popupClassName: tableTipConfig.popupClassName,
|
|
2622
|
+
useScrollbar: tableTipConfig.useScrollbar
|
|
2620
2623
|
},
|
|
2621
2624
|
scopedSlots: currTooltipSlot
|
|
2622
2625
|
? {
|
|
@@ -2659,7 +2662,8 @@ export default {
|
|
|
2659
2662
|
theme: validTipConfig.theme,
|
|
2660
2663
|
enterable: validTipConfig.enterable,
|
|
2661
2664
|
enterDelay: validTipConfig.enterDelay,
|
|
2662
|
-
leaveDelay: validTipConfig.leaveDelay
|
|
2665
|
+
leaveDelay: validTipConfig.leaveDelay,
|
|
2666
|
+
useScrollbar
|
|
2663
2667
|
}
|
|
2664
2668
|
})
|
|
2665
2669
|
: renderEmptyElement($xeTable)
|
package/es/ui/index.js
CHANGED
package/es/ui/src/dom.js
CHANGED
|
@@ -231,7 +231,8 @@ export function wheelScrollTopTo(diffNum, cb) {
|
|
|
231
231
|
* 通用定位计算
|
|
232
232
|
*/
|
|
233
233
|
export function updatePanelPlacement(targetElem, panelElem, options) {
|
|
234
|
-
const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
234
|
+
const { defaultTop, defaultLeft, placement, defaultPlacement, appendTo, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
235
|
+
appendTo: '',
|
|
235
236
|
teleportTo: false,
|
|
236
237
|
marginSize: 18,
|
|
237
238
|
isMinWidth: true
|
|
@@ -245,7 +246,7 @@ export function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
245
246
|
const stys = {};
|
|
246
247
|
if (panelElem && targetElem) {
|
|
247
248
|
const bodyEl = document.body;
|
|
248
|
-
const parentWrapperEl = getPopupWrapperElement(panelElem);
|
|
249
|
+
const parentWrapperEl = getPopupWrapperElement(teleportTo ? getPopupAppendElement(appendTo) : panelElem);
|
|
249
250
|
if (parentWrapperEl) {
|
|
250
251
|
const targetWidth = targetElem.offsetWidth;
|
|
251
252
|
const targetHeight = targetElem.offsetHeight;
|
|
@@ -256,14 +257,16 @@ export function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
256
257
|
const targetRect = targetElem.getBoundingClientRect();
|
|
257
258
|
const visibleHeight = bodyEl.clientHeight;
|
|
258
259
|
const visibleWidth = bodyEl.clientWidth;
|
|
259
|
-
const
|
|
260
|
-
const
|
|
260
|
+
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
261
|
+
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
262
|
+
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
263
|
+
const parentWrapperOffsetTop = parentWrapperRect.top;
|
|
261
264
|
const targetLeft = targetRect.left;
|
|
262
265
|
const targetTop = targetRect.top;
|
|
263
266
|
minWidth = targetElem.offsetWidth;
|
|
264
267
|
if (teleportTo) {
|
|
265
|
-
left = defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2);
|
|
266
|
-
top = defaultTop || (targetTop + targetHeight);
|
|
268
|
+
left = (defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2)) - parentWrapperScrollLeft;
|
|
269
|
+
top = (defaultTop || (targetTop + targetHeight)) - parentWrapperScrollTop;
|
|
267
270
|
if (placement === 'top') {
|
|
268
271
|
panelPlacement = 'top';
|
|
269
272
|
top = targetTop - panelHeight;
|
|
@@ -307,8 +310,8 @@ export function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
307
310
|
left = marginSize;
|
|
308
311
|
}
|
|
309
312
|
// 偏移
|
|
310
|
-
top -=
|
|
311
|
-
left -=
|
|
313
|
+
top -= parentWrapperOffsetTop;
|
|
314
|
+
left -= parentWrapperOffsetLeft;
|
|
312
315
|
}
|
|
313
316
|
else {
|
|
314
317
|
if (placement === 'top') {
|
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"3.25.0-beta.
|
|
3
|
+
const tableVersion = `table v${"3.25.0-beta.3"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
package/lib/index.umd.js
CHANGED
|
@@ -3323,7 +3323,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
3323
3323
|
/* unused harmony import specifier */ var VxeUI;
|
|
3324
3324
|
|
|
3325
3325
|
|
|
3326
|
-
const version = "3.25.0-beta.
|
|
3326
|
+
const version = "3.25.0-beta.3";
|
|
3327
3327
|
core_.VxeUI.version = version;
|
|
3328
3328
|
core_.VxeUI.tableVersion = version;
|
|
3329
3329
|
core_.VxeUI.setConfig({
|
|
@@ -3865,7 +3865,6 @@ var es_iterator_reduce = __webpack_require__(8237);
|
|
|
3865
3865
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
3866
3866
|
var es_iterator_some = __webpack_require__(3579);
|
|
3867
3867
|
;// ./packages/ui/src/dom.ts
|
|
3868
|
-
/* unused harmony import specifier */ var XEUtils;
|
|
3869
3868
|
|
|
3870
3869
|
|
|
3871
3870
|
const reClsMap = {};
|
|
@@ -4124,10 +4123,12 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
4124
4123
|
defaultLeft,
|
|
4125
4124
|
placement,
|
|
4126
4125
|
defaultPlacement,
|
|
4126
|
+
appendTo,
|
|
4127
4127
|
teleportTo,
|
|
4128
4128
|
marginSize,
|
|
4129
4129
|
isMinWidth
|
|
4130
4130
|
} = Object.assign({
|
|
4131
|
+
appendTo: '',
|
|
4131
4132
|
teleportTo: false,
|
|
4132
4133
|
marginSize: 18,
|
|
4133
4134
|
isMinWidth: true
|
|
@@ -4141,7 +4142,7 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
4141
4142
|
const stys = {};
|
|
4142
4143
|
if (panelElem && targetElem) {
|
|
4143
4144
|
const bodyEl = document.body;
|
|
4144
|
-
const parentWrapperEl = getPopupWrapperElement(panelElem);
|
|
4145
|
+
const parentWrapperEl = getPopupWrapperElement(teleportTo ? getPopupAppendElement(appendTo) : panelElem);
|
|
4145
4146
|
if (parentWrapperEl) {
|
|
4146
4147
|
const targetWidth = targetElem.offsetWidth;
|
|
4147
4148
|
const targetHeight = targetElem.offsetHeight;
|
|
@@ -4152,14 +4153,16 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
4152
4153
|
const targetRect = targetElem.getBoundingClientRect();
|
|
4153
4154
|
const visibleHeight = bodyEl.clientHeight;
|
|
4154
4155
|
const visibleWidth = bodyEl.clientWidth;
|
|
4155
|
-
const
|
|
4156
|
-
const
|
|
4156
|
+
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
4157
|
+
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
4158
|
+
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
4159
|
+
const parentWrapperOffsetTop = parentWrapperRect.top;
|
|
4157
4160
|
const targetLeft = targetRect.left;
|
|
4158
4161
|
const targetTop = targetRect.top;
|
|
4159
4162
|
minWidth = targetElem.offsetWidth;
|
|
4160
4163
|
if (teleportTo) {
|
|
4161
|
-
left = defaultLeft || targetLeft - (panelWidth - targetWidth) / 2;
|
|
4162
|
-
top = defaultTop || targetTop + targetHeight;
|
|
4164
|
+
left = (defaultLeft || targetLeft - (panelWidth - targetWidth) / 2) - parentWrapperScrollLeft;
|
|
4165
|
+
top = (defaultTop || targetTop + targetHeight) - parentWrapperScrollTop;
|
|
4163
4166
|
if (placement === 'top') {
|
|
4164
4167
|
panelPlacement = 'top';
|
|
4165
4168
|
top = targetTop - panelHeight;
|
|
@@ -4201,8 +4204,8 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
4201
4204
|
left = marginSize;
|
|
4202
4205
|
}
|
|
4203
4206
|
// 偏移
|
|
4204
|
-
top -=
|
|
4205
|
-
left -=
|
|
4207
|
+
top -= parentWrapperOffsetTop;
|
|
4208
|
+
left -= parentWrapperOffsetLeft;
|
|
4206
4209
|
} else {
|
|
4207
4210
|
if (placement === 'top') {
|
|
4208
4211
|
panelPlacement = 'top';
|
|
@@ -4268,12 +4271,12 @@ function getPopupWrapperElement(panelElem) {
|
|
|
4268
4271
|
return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
|
|
4269
4272
|
}
|
|
4270
4273
|
function getPopupContainer(appendTo) {
|
|
4271
|
-
const selectElem = appendTo &&
|
|
4274
|
+
const selectElem = appendTo && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(appendTo) ? appendTo({}) : appendTo;
|
|
4272
4275
|
return selectElem || 'body';
|
|
4273
4276
|
}
|
|
4274
4277
|
function getPopupAppendElement(appendTo) {
|
|
4275
4278
|
const selectElem = getPopupContainer(appendTo);
|
|
4276
|
-
if (
|
|
4279
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(selectElem)) {
|
|
4277
4280
|
return document.querySelector(selectElem) || document.body;
|
|
4278
4281
|
}
|
|
4279
4282
|
return selectElem;
|
|
@@ -4283,7 +4286,7 @@ function getPopupAppendElement(appendTo) {
|
|
|
4283
4286
|
const {
|
|
4284
4287
|
log: log_log
|
|
4285
4288
|
} = core_.VxeUI;
|
|
4286
|
-
const tableVersion = `table v${"3.25.0-beta.
|
|
4289
|
+
const tableVersion = `table v${"3.25.0-beta.3"}`;
|
|
4287
4290
|
function createComponentLog(name) {
|
|
4288
4291
|
const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
|
|
4289
4292
|
const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
|
|
@@ -8054,61 +8057,6 @@ function clearColAnimate(elem, clss) {
|
|
|
8054
8057
|
}
|
|
8055
8058
|
}, 500);
|
|
8056
8059
|
}
|
|
8057
|
-
;// ./packages/table/src/scrollbar.ts
|
|
8058
|
-
/**
|
|
8059
|
-
* 计算滚动条滑块的长度
|
|
8060
|
-
*/
|
|
8061
|
-
function getThumbSize(viewportSize, contentSize, trackSize) {
|
|
8062
|
-
if (contentSize <= viewportSize) {
|
|
8063
|
-
return 0;
|
|
8064
|
-
}
|
|
8065
|
-
const ratio = viewportSize / contentSize;
|
|
8066
|
-
const ideal = trackSize * ratio;
|
|
8067
|
-
return Math.max(20, Math.min(ideal, trackSize));
|
|
8068
|
-
}
|
|
8069
|
-
/**
|
|
8070
|
-
* 计算滚动条滑块的偏移位置
|
|
8071
|
-
*/
|
|
8072
|
-
function getThumbOffsetSize(offsetSize, viewportSize, contentSize, trackSize, thumbSize) {
|
|
8073
|
-
const maxScroll = contentSize - viewportSize;
|
|
8074
|
-
if (maxScroll <= 0) {
|
|
8075
|
-
return 0;
|
|
8076
|
-
}
|
|
8077
|
-
const maxThumbOffset = trackSize - thumbSize;
|
|
8078
|
-
if (maxThumbOffset <= 0) {
|
|
8079
|
-
return 0;
|
|
8080
|
-
}
|
|
8081
|
-
const clamped = Math.min(Math.max(offsetSize, 0), maxScroll);
|
|
8082
|
-
const ratio = clamped / maxScroll;
|
|
8083
|
-
return ratio * maxThumbOffset;
|
|
8084
|
-
}
|
|
8085
|
-
/**
|
|
8086
|
-
* 根据点击轨道的位置,计算滑块的偏移位置
|
|
8087
|
-
*/
|
|
8088
|
-
function getScrollFromClick(clickPosition, viewportSize, contentSize, trackSize, thumbSize) {
|
|
8089
|
-
const maxThumbOffset = trackSize - thumbSize;
|
|
8090
|
-
const maxScroll = contentSize - viewportSize;
|
|
8091
|
-
if (maxScroll <= 0 || maxThumbOffset <= 0) {
|
|
8092
|
-
return 0;
|
|
8093
|
-
}
|
|
8094
|
-
let thumbOffset = clickPosition - thumbSize / 2;
|
|
8095
|
-
thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
|
|
8096
|
-
const scrollOffset = thumbOffset / maxThumbOffset * maxScroll;
|
|
8097
|
-
return scrollOffset;
|
|
8098
|
-
}
|
|
8099
|
-
/**
|
|
8100
|
-
* 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
|
|
8101
|
-
*/
|
|
8102
|
-
function getScrollFromDrag(pointerPosition, dragOffset, viewportSize, contentSize, trackSize, thumbSize) {
|
|
8103
|
-
const maxScroll = contentSize - viewportSize;
|
|
8104
|
-
const maxThumbOffset = trackSize - thumbSize;
|
|
8105
|
-
if (maxScroll <= 0 || maxThumbOffset <= 0) {
|
|
8106
|
-
return 0;
|
|
8107
|
-
}
|
|
8108
|
-
let thumbOffset = pointerPosition - dragOffset;
|
|
8109
|
-
thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
|
|
8110
|
-
return thumbOffset / maxThumbOffset * maxScroll;
|
|
8111
|
-
}
|
|
8112
8060
|
;// ./packages/table/src/store.ts
|
|
8113
8061
|
// 跨表拖拽
|
|
8114
8062
|
const crossTableDragRowGlobal = {
|
|
@@ -8119,7 +8067,7 @@ function getCrossTableDragRowInfo($xeTable) {
|
|
|
8119
8067
|
return crossTableDragRowInfo;
|
|
8120
8068
|
}
|
|
8121
8069
|
;// ./packages/table/src/methods.ts
|
|
8122
|
-
const{warnLog: methods_warnLog,errLog: methods_errLog}=createComponentLog('table');const{getConfig: methods_getConfig,getI18n: methods_getI18n,renderer: methods_renderer,formats: methods_formats,interceptor: methods_interceptor,createEvent,globalEvents: methods_globalEvents,GLOBAL_EVENT_KEYS}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const sourceType='table';let crossTableDragRowObj=null;function eqCellValue(newRow,oldRow,field){const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(newRow,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oldRow,field);let result=false;if(eqEmptyValue(val1)&&eqEmptyValue(val2)){result=true;}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){result=''+val1===''+val2;}else{result=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);}return{newValue:val1,oldValue:val2,result};}function getNextSortOrder($xeTable,column){const sortOpts=$xeTable.computeSortOpts;const{orders=[]}=sortOpts;const currOrder=column.order||null;const oIndex=orders.indexOf(currOrder)+1;return orders[oIndex<orders.length?oIndex:0];}const getCustomStorageMap=id=>{const version=methods_getConfig().version;const rest=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringJSON(localStorage.getItem(customStorageKey)||'');const maps=rest&&rest._v===version?rest:{_v:version};return(id?maps[id]:maps)||{};};const setCustomStorageMap=(id,data)=>{const version=methods_getConfig().version;const maps=getCustomStorageMap();maps[id]=data||undefined;maps._v=version;localStorage.setItem(customStorageKey,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(maps));};const getRecoverRowMaps=($xeTable,keyMaps)=>{const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;const restKeys={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(keyMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){restKeys[rowid]=row;}});return restKeys;};function handleReserveRow($xeTable,reserveRowMap){const internalData=$xeTable;const{fullDataRowIdData}=internalData;const reserveList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reserveRowMap,(item,rowid)=>{if(fullDataRowIdData[rowid]&&reserveList.indexOf(fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;}function handleVirtualXVisible($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=$xeTable.computeLeftFixedWidth;const rightFixedWidth=$xeTable.computeRightFixedWidth;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientWidth=bodyScrollElem.clientWidth;let scrollLeft=bodyScrollElem.scrollLeft;if(isScrollXBig){scrollLeft=Math.ceil((scrollXWidth-clientWidth)*Math.min(1,scrollLeft/(maxXWidth-clientWidth)));}const startLeft=scrollLeft+leftFixedWidth;const endLeft=scrollLeft+clientWidth-rightFixedWidth;let leftIndex=0;let rightIndex=visibleColumn.length;while(leftIndex<rightIndex){const cIndex=Math.floor((leftIndex+rightIndex)/2);const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};if(colRest.oLeft<=startLeft){leftIndex=cIndex+1;}else{rightIndex=cIndex;}}let visibleSize=0;const toVisibleIndex=leftIndex===visibleColumn.length?leftIndex:Math.max(0,leftIndex<visibleColumn.length?leftIndex-2:0);for(let cIndex=toVisibleIndex,cLen=visibleColumn.length;cIndex<cLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};visibleSize++;if(colRest.oLeft>endLeft||visibleSize>=60){break;}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};}function handleCustomRestore($xeTable,storeData){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const $xeGrid=$xeTable.$xeGrid;const $xeGantt=$xeTable.$xeGantt;const $xeGGWrapper=$xeGrid||$xeGantt;const{aggregateConfig,rowGroupConfig}=props;const{collectColumn}=internalData;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc,isCustomPager}=handleCustomStoreConfig($xeTable);let{alignData,headerAlignData,footerAlignData,resizableData,sortData,visibleData,fixedData,aggGroupData,aggFuncData,pagerData}=storeData;// 处理还原
|
|
8070
|
+
const{warnLog: methods_warnLog,errLog: methods_errLog}=createComponentLog('table');const{getConfig: methods_getConfig,getI18n: methods_getI18n,renderer: methods_renderer,scrollbarUtils,formats: methods_formats,interceptor: methods_interceptor,createEvent,globalEvents: methods_globalEvents,GLOBAL_EVENT_KEYS}=core_.VxeUI;const{getThumbOffsetSize,getThumbSize,getScrollFromClick,getScrollFromDrag}=scrollbarUtils||{};const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const sourceType='table';let crossTableDragRowObj=null;function eqCellValue(newRow,oldRow,field){const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(newRow,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oldRow,field);let result=false;if(eqEmptyValue(val1)&&eqEmptyValue(val2)){result=true;}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){result=''+val1===''+val2;}else{result=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);}return{newValue:val1,oldValue:val2,result};}function getNextSortOrder($xeTable,column){const sortOpts=$xeTable.computeSortOpts;const{orders=[]}=sortOpts;const currOrder=column.order||null;const oIndex=orders.indexOf(currOrder)+1;return orders[oIndex<orders.length?oIndex:0];}const getCustomStorageMap=id=>{const version=methods_getConfig().version;const rest=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringJSON(localStorage.getItem(customStorageKey)||'');const maps=rest&&rest._v===version?rest:{_v:version};return(id?maps[id]:maps)||{};};const setCustomStorageMap=(id,data)=>{const version=methods_getConfig().version;const maps=getCustomStorageMap();maps[id]=data||undefined;maps._v=version;localStorage.setItem(customStorageKey,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(maps));};const getRecoverRowMaps=($xeTable,keyMaps)=>{const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;const restKeys={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(keyMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){restKeys[rowid]=row;}});return restKeys;};function handleReserveRow($xeTable,reserveRowMap){const internalData=$xeTable;const{fullDataRowIdData}=internalData;const reserveList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reserveRowMap,(item,rowid)=>{if(fullDataRowIdData[rowid]&&reserveList.indexOf(fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;}function handleVirtualXVisible($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=$xeTable.computeLeftFixedWidth;const rightFixedWidth=$xeTable.computeRightFixedWidth;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientWidth=bodyScrollElem.clientWidth;let scrollLeft=bodyScrollElem.scrollLeft;if(isScrollXBig){scrollLeft=Math.ceil((scrollXWidth-clientWidth)*Math.min(1,scrollLeft/(maxXWidth-clientWidth)));}const startLeft=scrollLeft+leftFixedWidth;const endLeft=scrollLeft+clientWidth-rightFixedWidth;let leftIndex=0;let rightIndex=visibleColumn.length;while(leftIndex<rightIndex){const cIndex=Math.floor((leftIndex+rightIndex)/2);const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};if(colRest.oLeft<=startLeft){leftIndex=cIndex+1;}else{rightIndex=cIndex;}}let visibleSize=0;const toVisibleIndex=leftIndex===visibleColumn.length?leftIndex:Math.max(0,leftIndex<visibleColumn.length?leftIndex-2:0);for(let cIndex=toVisibleIndex,cLen=visibleColumn.length;cIndex<cLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};visibleSize++;if(colRest.oLeft>endLeft||visibleSize>=60){break;}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};}function handleCustomRestore($xeTable,storeData){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const $xeGrid=$xeTable.$xeGrid;const $xeGantt=$xeTable.$xeGantt;const $xeGGWrapper=$xeGrid||$xeGantt;const{aggregateConfig,rowGroupConfig}=props;const{collectColumn}=internalData;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc,isCustomPager}=handleCustomStoreConfig($xeTable);let{alignData,headerAlignData,footerAlignData,resizableData,sortData,visibleData,fixedData,aggGroupData,aggFuncData,pagerData}=storeData;// 处理还原
|
|
8123
8071
|
if(isCustomAlign&&alignData||isCustomHeaderAlign&&headerAlignData||isCustomFooterAlign&&footerAlignData||isCustomResizable&&resizableData||isCustomSort&&sortData||isCustomVisible&&visibleData||isCustomFixed&&fixedData||isCustomAggGroup&&aggGroupData||isCustomAggFunc&&aggFuncData||isCustomPager&&pagerData&&$xeGGWrapper){const sortColMaps={};if(isCustomSort&&sortData){// 转换兼容老版本数据,即将废弃兼容
|
|
8124
8072
|
if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortData)){const sortRests=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(sortData,(index,colKey)=>{sortRests.push({key:colKey,index});});sortData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(sortRests,{field:'index',order:'asc'}).map(item=>({k:item.key}));}let colNum=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sortData,(sObj,index,sOjs,path,pSObj)=>{sortColMaps[sObj.k]={key:sObj.k,sNum:colNum++,pKey:pSObj?pSObj.k:null};},{children:'c'});}const colKeyMaps={};const allCols=[];const aggGroupConfs=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();// 支持一级
|
|
8125
8073
|
if(!parentColumn){if(isCustomFixed&&fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}}if(isCustomResizable&&resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(isCustomVisible&&visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}if(isCustomAggFunc&&aggFuncData&&(aggregateConfig||rowGroupConfig)&&aggFuncData[colKey]){column.aggFunc=aggFuncData[colKey];}if(isCustomAggGroup&&aggGroupData&&aggGroupData[colKey]){aggGroupConfs.push({field:column.field});}colKeyMaps[colKey]=column;allCols.push(column);});if((aggregateConfig||rowGroupConfig)&&aggGroupConfs.length){const groupRest=handleGroupData($xeTable,internalData.tableFullData,aggGroupConfs);internalData.tableFullTreeData=[];internalData.tableFullGroupData=groupRest.treeData;reactData.isRowGroupStatus=true;reactData.rowGroupList=aggGroupConfs;$xeTable.cacheRowMap(false);}// 如果自定义了顺序
|
|
@@ -11676,8 +11624,8 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11676
11624
|
} = customPanelInternalData;
|
|
11677
11625
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
11678
11626
|
if (prevDragGroupField || prevDragAggFnColid) {
|
|
11679
|
-
if ($xeTable.
|
|
11680
|
-
$xeTable.
|
|
11627
|
+
if ($xeTable.handlePivotTableAggPanelDragendEvent) {
|
|
11628
|
+
$xeTable.handlePivotTableAggPanelDragendEvent(evnt);
|
|
11681
11629
|
}
|
|
11682
11630
|
} else if (prevDragCol && dragCol) {
|
|
11683
11631
|
// 判断是否有拖动
|
|
@@ -14535,6 +14483,7 @@ function updatePopupStyle($xeTable) {
|
|
|
14535
14483
|
if (transfer) {
|
|
14536
14484
|
const ppObj = updatePanelPlacement(currEl, filterWrapperElem, {
|
|
14537
14485
|
defaultPlacement: 'bottom',
|
|
14486
|
+
appendTo: '',
|
|
14538
14487
|
isMinWidth: false,
|
|
14539
14488
|
teleportTo: transfer
|
|
14540
14489
|
});
|
|
@@ -22294,7 +22243,12 @@ function renderVirtualBody(h, $xeTable) {
|
|
|
22294
22243
|
computeTooltipOpts() {
|
|
22295
22244
|
const $xeTable = this;
|
|
22296
22245
|
const props = $xeTable;
|
|
22297
|
-
|
|
22246
|
+
const {
|
|
22247
|
+
useScrollbar
|
|
22248
|
+
} = props;
|
|
22249
|
+
return Object.assign({
|
|
22250
|
+
useScrollbar
|
|
22251
|
+
}, table_getConfig().tooltip, table_getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
22298
22252
|
},
|
|
22299
22253
|
tipConfig() {
|
|
22300
22254
|
return {
|
|
@@ -24033,7 +23987,8 @@ function renderVirtualBody(h, $xeTable) {
|
|
|
24033
23987
|
ref: 'refCommTooltip',
|
|
24034
23988
|
props: {
|
|
24035
23989
|
isArrow: false,
|
|
24036
|
-
enterable: false
|
|
23990
|
+
enterable: false,
|
|
23991
|
+
useScrollbar
|
|
24037
23992
|
}
|
|
24038
23993
|
}) : table_renderEmptyElement($xeTable),
|
|
24039
23994
|
/**
|
|
@@ -24058,7 +24013,8 @@ function renderVirtualBody(h, $xeTable) {
|
|
|
24058
24013
|
maxHeight: tableTipConfig.maxHeight,
|
|
24059
24014
|
placement: tableTipConfig.placement,
|
|
24060
24015
|
defaultPlacement: tableTipConfig.defaultPlacement,
|
|
24061
|
-
popupClassName: tableTipConfig.popupClassName
|
|
24016
|
+
popupClassName: tableTipConfig.popupClassName,
|
|
24017
|
+
useScrollbar: tableTipConfig.useScrollbar
|
|
24062
24018
|
},
|
|
24063
24019
|
scopedSlots: currTooltipSlot ? {
|
|
24064
24020
|
content: () => {
|
|
@@ -24122,7 +24078,8 @@ function renderVirtualBody(h, $xeTable) {
|
|
|
24122
24078
|
theme: validTipConfig.theme,
|
|
24123
24079
|
enterable: validTipConfig.enterable,
|
|
24124
24080
|
enterDelay: validTipConfig.enterDelay,
|
|
24125
|
-
leaveDelay: validTipConfig.leaveDelay
|
|
24081
|
+
leaveDelay: validTipConfig.leaveDelay,
|
|
24082
|
+
useScrollbar
|
|
24126
24083
|
}
|
|
24127
24084
|
}) : table_renderEmptyElement($xeTable)])]);
|
|
24128
24085
|
},
|