vxe-table 4.23.0-beta.4 → 4.23.0-beta.5
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/dist/all.esm.js +18 -174
- package/dist/style.css +1 -1
- package/es/style.css +1 -1
- package/es/table/src/table.js +16 -172
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +9 -13
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +7 -11
- 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/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/src/table.ts +31 -195
- /package/es/{iconfont.1792139865095.ttf → iconfont.1792220287498.ttf} +0 -0
- /package/es/{iconfont.1792139865095.woff → iconfont.1792220287498.woff} +0 -0
- /package/es/{iconfont.1792139865095.woff2 → iconfont.1792220287498.woff2} +0 -0
- /package/lib/{iconfont.1792139865095.ttf → iconfont.1792220287498.ttf} +0 -0
- /package/lib/{iconfont.1792139865095.woff → iconfont.1792220287498.woff} +0 -0
- /package/lib/{iconfont.1792139865095.woff2 → iconfont.1792220287498.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.5";
|
|
60
60
|
VxeUI.version = version;
|
|
61
61
|
VxeUI.tableVersion = version;
|
|
62
62
|
VxeUI.setConfig({
|
|
@@ -952,7 +952,7 @@ function getPopupAppendElement(appendTo) {
|
|
|
952
952
|
}
|
|
953
953
|
|
|
954
954
|
const { log } = VxeUI;
|
|
955
|
-
const tableVersion = `table v${"4.23.0-beta.
|
|
955
|
+
const tableVersion = `table v${"4.23.0-beta.5"}`;
|
|
956
956
|
function createComponentLog(name) {
|
|
957
957
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
958
958
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -15995,8 +15995,7 @@ renderer$2.mixin({
|
|
|
15995
15995
|
});
|
|
15996
15996
|
|
|
15997
15997
|
const { warnLog: warnLog$2, errLog: errLog$2 } = createComponentLog('table');
|
|
15998
|
-
const { getConfig: getConfig$2, getIcon: getIcon$1, getI18n: getI18n$2, renderer: renderer$1, formats,
|
|
15999
|
-
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils || {};
|
|
15998
|
+
const { getConfig: getConfig$2, getIcon: getIcon$1, getI18n: getI18n$2, renderer: renderer$1, formats, 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;
|
|
16000
15999
|
const supportMaxRow = 5e6;
|
|
16001
16000
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
16002
16001
|
const maxYHeight = 5e6;
|
|
@@ -16027,8 +16026,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16027
16026
|
const crossTableDragRowInfo = getCrossTableDragRowInfo();
|
|
16028
16027
|
const reactData = reactive(createReactData$2());
|
|
16029
16028
|
const internalData = createInternalData$3();
|
|
16030
|
-
let tableMethods = {};
|
|
16031
|
-
let tablePrivateMethods = {};
|
|
16032
16029
|
const refElem = ref();
|
|
16033
16030
|
const refVarElem = ref();
|
|
16034
16031
|
const refTooltip = ref();
|
|
@@ -16072,10 +16069,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16072
16069
|
const refScrollYBottomCornerElem = ref();
|
|
16073
16070
|
const refScrollXSpaceElem = ref();
|
|
16074
16071
|
const refScrollYSpaceElem = ref();
|
|
16075
|
-
const refTrackXElem = ref();
|
|
16076
|
-
const refTrackYElem = ref();
|
|
16077
|
-
const refThumbXElem = ref();
|
|
16078
|
-
const refThumbYElem = ref();
|
|
16079
16072
|
let $xeToolbar;
|
|
16080
16073
|
const computeTableId = computed(() => {
|
|
16081
16074
|
const { id } = props;
|
|
@@ -16746,6 +16739,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16746
16739
|
computeSize,
|
|
16747
16740
|
computeIsVScrollbar,
|
|
16748
16741
|
computeTableId,
|
|
16742
|
+
computeTableStyle,
|
|
16749
16743
|
computeValidOpts,
|
|
16750
16744
|
computeRowField,
|
|
16751
16745
|
computeVirtualXOpts,
|
|
@@ -16846,6 +16840,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16846
16840
|
// 已废弃
|
|
16847
16841
|
xegrid: $xeGrid
|
|
16848
16842
|
};
|
|
16843
|
+
const { refTrackXElem, refTrackYElem, refThumbXElem, refThumbYElem, updateThumbSize, updateThumbOffset, clickTrackXEvent, clickTrackYEvent, pointerdownThumbXEvent, pointermoveThumbXEvent, cleatPointerThumbEvent, pointerdownThumbYEvent, pointermoveThumbYEvent } = useFns$2.useInitVScrollbar($xeTable);
|
|
16849
16844
|
const eqCellValue = (newRow, oldRow, field) => {
|
|
16850
16845
|
const val1 = XEUtils.get(newRow, field);
|
|
16851
16846
|
const val2 = XEUtils.get(oldRow, field);
|
|
@@ -20924,11 +20919,16 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20924
20919
|
return nextTick();
|
|
20925
20920
|
};
|
|
20926
20921
|
};
|
|
20927
|
-
tableMethods = {
|
|
20922
|
+
const tableMethods = {
|
|
20928
20923
|
dispatchEvent,
|
|
20929
20924
|
getEl() {
|
|
20930
20925
|
return refElem.value;
|
|
20931
20926
|
},
|
|
20927
|
+
getScrollViewElem() {
|
|
20928
|
+
const { elemStore } = internalData;
|
|
20929
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
20930
|
+
return viewEl;
|
|
20931
|
+
},
|
|
20932
20932
|
/**
|
|
20933
20933
|
* 重置表格的一切数据状态
|
|
20934
20934
|
*/
|
|
@@ -25494,7 +25494,13 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
25494
25494
|
/**
|
|
25495
25495
|
* 内部方法
|
|
25496
25496
|
*/
|
|
25497
|
-
tablePrivateMethods = {
|
|
25497
|
+
const tablePrivateMethods = {
|
|
25498
|
+
getReactData() {
|
|
25499
|
+
return reactData;
|
|
25500
|
+
},
|
|
25501
|
+
getInternalData() {
|
|
25502
|
+
return internalData;
|
|
25503
|
+
},
|
|
25498
25504
|
getSetupOptions() {
|
|
25499
25505
|
return getConfig$2();
|
|
25500
25506
|
},
|
|
@@ -29501,168 +29507,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
29501
29507
|
internalData.scrollObserver = scrollObserver;
|
|
29502
29508
|
}
|
|
29503
29509
|
};
|
|
29504
|
-
const updateThumbSize = () => {
|
|
29505
|
-
const { elemStore } = internalData;
|
|
29506
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29507
|
-
if (!viewEl) {
|
|
29508
|
-
return;
|
|
29509
|
-
}
|
|
29510
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
29511
|
-
return;
|
|
29512
|
-
}
|
|
29513
|
-
const trackXEl = refTrackXElem.value;
|
|
29514
|
-
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
29515
|
-
const thumbXElem = refThumbXElem.value;
|
|
29516
|
-
if (thumbXElem) {
|
|
29517
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
29518
|
-
}
|
|
29519
|
-
reactData.xThumbWidth = xThumbWidth;
|
|
29520
|
-
const trackYEl = refTrackYElem.value;
|
|
29521
|
-
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
29522
|
-
const thumbYElem = refThumbYElem.value;
|
|
29523
|
-
if (thumbYElem) {
|
|
29524
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
29525
|
-
}
|
|
29526
|
-
reactData.yThumbHeight = yThumbHeight;
|
|
29527
|
-
};
|
|
29528
|
-
const updateThumbOffset = () => {
|
|
29529
|
-
const { elemStore } = internalData;
|
|
29530
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29531
|
-
if (!viewEl) {
|
|
29532
|
-
return;
|
|
29533
|
-
}
|
|
29534
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
29535
|
-
return;
|
|
29536
|
-
}
|
|
29537
|
-
const { xThumbWidth, yThumbHeight } = reactData;
|
|
29538
|
-
const trackXEl = refTrackXElem.value;
|
|
29539
|
-
const thumbXElem = refThumbXElem.value;
|
|
29540
|
-
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
29541
|
-
internalData.xThumbLeft = xThumbLeft;
|
|
29542
|
-
if (thumbXElem && xThumbWidth) {
|
|
29543
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
29544
|
-
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
29545
|
-
}
|
|
29546
|
-
const trackYEl = refTrackYElem.value;
|
|
29547
|
-
const thumbYElem = refThumbYElem.value;
|
|
29548
|
-
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
29549
|
-
internalData.yThumbTop = yThumbTop;
|
|
29550
|
-
if (thumbYElem && yThumbHeight) {
|
|
29551
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
29552
|
-
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
29553
|
-
}
|
|
29554
|
-
};
|
|
29555
|
-
const clickTrackXEvent = (evnt) => {
|
|
29556
|
-
const { elemStore } = internalData;
|
|
29557
|
-
const trackEl = evnt.currentTarget;
|
|
29558
|
-
if (trackEl !== evnt.target) {
|
|
29559
|
-
return;
|
|
29560
|
-
}
|
|
29561
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29562
|
-
if (!viewEl) {
|
|
29563
|
-
return;
|
|
29564
|
-
}
|
|
29565
|
-
const { xThumbWidth } = reactData;
|
|
29566
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29567
|
-
viewEl.scrollTo({
|
|
29568
|
-
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
29569
|
-
behavior: 'auto'
|
|
29570
|
-
});
|
|
29571
|
-
};
|
|
29572
|
-
const clickTrackYEvent = (evnt) => {
|
|
29573
|
-
const { elemStore } = internalData;
|
|
29574
|
-
const trackEl = evnt.currentTarget;
|
|
29575
|
-
if (trackEl !== evnt.target) {
|
|
29576
|
-
return;
|
|
29577
|
-
}
|
|
29578
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29579
|
-
if (!viewEl) {
|
|
29580
|
-
return;
|
|
29581
|
-
}
|
|
29582
|
-
const { yThumbHeight } = reactData;
|
|
29583
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29584
|
-
viewEl.scrollTo({
|
|
29585
|
-
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
29586
|
-
behavior: 'auto'
|
|
29587
|
-
});
|
|
29588
|
-
};
|
|
29589
|
-
const pointerdownThumbXEvent = (evnt) => {
|
|
29590
|
-
const { elemStore } = internalData;
|
|
29591
|
-
const thumbEl = evnt.currentTarget;
|
|
29592
|
-
internalData.isThumbDrag = true;
|
|
29593
|
-
thumbEl.setPointerCapture(evnt.pointerId);
|
|
29594
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29595
|
-
if (!viewEl) {
|
|
29596
|
-
return;
|
|
29597
|
-
}
|
|
29598
|
-
const { xThumbWidth } = reactData;
|
|
29599
|
-
const trackEl = thumbEl.parentElement;
|
|
29600
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29601
|
-
const pointerPosition = evnt.clientX - trackRect.left;
|
|
29602
|
-
// 记录 thumb 的偏移
|
|
29603
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
29604
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
29605
|
-
};
|
|
29606
|
-
const pointermoveThumbXEvent = (evnt) => {
|
|
29607
|
-
const thumbEl = evnt.currentTarget;
|
|
29608
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
29609
|
-
return;
|
|
29610
|
-
}
|
|
29611
|
-
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
29612
|
-
if (isThumbDrag) {
|
|
29613
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29614
|
-
if (!viewEl) {
|
|
29615
|
-
return;
|
|
29616
|
-
}
|
|
29617
|
-
const { xThumbWidth } = reactData;
|
|
29618
|
-
const thumbEl = evnt.currentTarget;
|
|
29619
|
-
const trackEl = thumbEl.parentElement;
|
|
29620
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29621
|
-
// 更新偏移
|
|
29622
|
-
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
29623
|
-
}
|
|
29624
|
-
};
|
|
29625
|
-
const cleatPointerThumbEvent = (evnt) => {
|
|
29626
|
-
const thumbEl = evnt.currentTarget;
|
|
29627
|
-
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
29628
|
-
internalData.isThumbDrag = false;
|
|
29629
|
-
};
|
|
29630
|
-
const pointerdownThumbYEvent = (evnt) => {
|
|
29631
|
-
const { elemStore } = internalData;
|
|
29632
|
-
const thumbEl = evnt.currentTarget;
|
|
29633
|
-
internalData.isThumbDrag = true;
|
|
29634
|
-
thumbEl.setPointerCapture(evnt.pointerId);
|
|
29635
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29636
|
-
if (!viewEl) {
|
|
29637
|
-
return;
|
|
29638
|
-
}
|
|
29639
|
-
const { yThumbHeight } = reactData;
|
|
29640
|
-
const trackEl = thumbEl.parentElement;
|
|
29641
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29642
|
-
const pointerPosition = evnt.clientY - trackRect.top;
|
|
29643
|
-
// 记录 thumb 的偏移
|
|
29644
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
29645
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
29646
|
-
};
|
|
29647
|
-
const pointermoveThumbYEvent = (evnt) => {
|
|
29648
|
-
const thumbEl = evnt.currentTarget;
|
|
29649
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
29650
|
-
return;
|
|
29651
|
-
}
|
|
29652
|
-
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
29653
|
-
if (isThumbDrag) {
|
|
29654
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
29655
|
-
if (!viewEl) {
|
|
29656
|
-
return;
|
|
29657
|
-
}
|
|
29658
|
-
const { yThumbHeight } = reactData;
|
|
29659
|
-
const thumbEl = evnt.currentTarget;
|
|
29660
|
-
const trackEl = thumbEl.parentElement;
|
|
29661
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
29662
|
-
// 更新偏移
|
|
29663
|
-
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
29664
|
-
}
|
|
29665
|
-
};
|
|
29666
29510
|
// 检测对应模块是否安装
|
|
29667
29511
|
// 'openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').forEach(name => {
|
|
29668
29512
|
// ($xeTable as any)[name] = function () {
|