vxe-gantt 4.9.0-beta.1 → 4.9.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +10 -171
- package/es/gantt/src/gantt-view.js +8 -169
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-view.js +22 -208
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/index.umd.js +24 -210
- package/lib/index.umd.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/gantt/src/gantt-view.ts +23 -185
package/dist/all.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VxeUI } from '@vxe-ui/core';
|
|
1
|
+
import { VxeUI, useFns as useFns$1 } from '@vxe-ui/core';
|
|
2
2
|
export { VxeUI } from '@vxe-ui/core';
|
|
3
3
|
import { defineComponent, inject, ref, onMounted, onUnmounted, h, reactive, computed, watch, nextTick, onBeforeUnmount, provide } from 'vue';
|
|
4
4
|
import XEUtils from 'xe-utils';
|
|
@@ -6,7 +6,7 @@ import DomZIndex from 'dom-zindex';
|
|
|
6
6
|
import { VxeTable } from 'vxe-table';
|
|
7
7
|
|
|
8
8
|
const { setConfig: setConfig$1, setIcon } = VxeUI;
|
|
9
|
-
VxeUI.ganttVersion = "4.9.0-beta.
|
|
9
|
+
VxeUI.ganttVersion = "4.9.0-beta.2";
|
|
10
10
|
const ymdFormat = 'yyyy-MM-dd';
|
|
11
11
|
const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
12
12
|
setConfig$1({
|
|
@@ -130,7 +130,7 @@ setIcon({
|
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
const { log } = VxeUI;
|
|
133
|
-
const ganttVersion = `gantt v${"4.9.0-beta.
|
|
133
|
+
const ganttVersion = `gantt v${"4.9.0-beta.2"}`;
|
|
134
134
|
function createComponentLog(name) {
|
|
135
135
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
136
136
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
@@ -1400,8 +1400,7 @@ var GanttViewFooterComponent = defineVxeComponent({
|
|
|
1400
1400
|
}
|
|
1401
1401
|
});
|
|
1402
1402
|
|
|
1403
|
-
const { getConfig: getConfig$1, domUtils,
|
|
1404
|
-
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils;
|
|
1403
|
+
const { getConfig: getConfig$1, domUtils, globalResize, globalEvents: globalEvents$1, renderEmptyElement: renderEmptyElement$1 } = VxeUI;
|
|
1405
1404
|
const { FinishToStart, StartToFinish, StartToStart, FinishToFinish } = VxeGanttDependencyType;
|
|
1406
1405
|
const sourceType = 'gantt';
|
|
1407
1406
|
const secondMs = 1000;
|
|
@@ -1488,10 +1487,6 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1488
1487
|
const ganttInternalData = $xeGantt.internalData;
|
|
1489
1488
|
const { computeDateFormat, computeTaskBarOpts, computeTaskViewOpts, computeStartField, computeEndField, computeTypeField, computeScrollbarOpts, computeScaleUnit, computeWeekScale, computeMinScale, computeTaskNowLineOpts, computeScaleStep, computeIsVScrollbar } = $xeGantt.getComputeMaps();
|
|
1490
1489
|
const refElem = ref();
|
|
1491
|
-
const refTrackXElem = ref();
|
|
1492
|
-
const refTrackYElem = ref();
|
|
1493
|
-
const refThumbXElem = ref();
|
|
1494
|
-
const refThumbYElem = ref();
|
|
1495
1490
|
const refScrollXVirtualElem = ref();
|
|
1496
1491
|
const refScrollYVirtualElem = ref();
|
|
1497
1492
|
const refScrollXHandleElem = ref();
|
|
@@ -1745,6 +1740,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1745
1740
|
getRefMaps: () => refMaps,
|
|
1746
1741
|
getComputeMaps: () => computeMaps
|
|
1747
1742
|
};
|
|
1743
|
+
const { refTrackXElem, refTrackYElem, refThumbXElem, refThumbYElem, updateThumbSize, updateThumbOffset, clickTrackXEvent, clickTrackYEvent, pointerdownThumbXEvent, pointermoveThumbXEvent, cleatPointerThumbEvent, pointerdownThumbYEvent, pointermoveThumbYEvent } = useFns$1.useInitVScrollbar($xeGanttView);
|
|
1748
1744
|
const parseStringDate = (dateValue) => {
|
|
1749
1745
|
const dateFormat = computeDateFormat.value;
|
|
1750
1746
|
return XEUtils.toStringDate(dateValue, dateFormat);
|
|
@@ -3336,6 +3332,11 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
3336
3332
|
$xeGantt.dispatchEvent('scroll', evntParams, evnt);
|
|
3337
3333
|
};
|
|
3338
3334
|
const ganttViewMethods = {
|
|
3335
|
+
getScrollViewElem() {
|
|
3336
|
+
const { elemStore } = internalData;
|
|
3337
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3338
|
+
return viewEl;
|
|
3339
|
+
},
|
|
3339
3340
|
refreshData() {
|
|
3340
3341
|
handleUpdateData();
|
|
3341
3342
|
handleRecalculateStyle();
|
|
@@ -3571,168 +3572,6 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
3571
3572
|
}
|
|
3572
3573
|
}
|
|
3573
3574
|
};
|
|
3574
|
-
const updateThumbSize = () => {
|
|
3575
|
-
const { elemStore } = internalData;
|
|
3576
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3577
|
-
if (!viewEl) {
|
|
3578
|
-
return;
|
|
3579
|
-
}
|
|
3580
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
3581
|
-
return;
|
|
3582
|
-
}
|
|
3583
|
-
const trackXEl = refTrackXElem.value;
|
|
3584
|
-
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
3585
|
-
const thumbXElem = refThumbXElem.value;
|
|
3586
|
-
if (thumbXElem) {
|
|
3587
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
3588
|
-
}
|
|
3589
|
-
reactData.xThumbWidth = xThumbWidth;
|
|
3590
|
-
const trackYEl = refTrackYElem.value;
|
|
3591
|
-
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
3592
|
-
const thumbYElem = refThumbYElem.value;
|
|
3593
|
-
if (thumbYElem) {
|
|
3594
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
3595
|
-
}
|
|
3596
|
-
reactData.yThumbHeight = yThumbHeight;
|
|
3597
|
-
};
|
|
3598
|
-
const updateThumbOffset = () => {
|
|
3599
|
-
const { elemStore } = internalData;
|
|
3600
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3601
|
-
if (!viewEl) {
|
|
3602
|
-
return;
|
|
3603
|
-
}
|
|
3604
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
3605
|
-
return;
|
|
3606
|
-
}
|
|
3607
|
-
const { xThumbWidth, yThumbHeight } = reactData;
|
|
3608
|
-
const trackXEl = refTrackXElem.value;
|
|
3609
|
-
const thumbXElem = refThumbXElem.value;
|
|
3610
|
-
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
3611
|
-
internalData.xThumbLeft = xThumbLeft;
|
|
3612
|
-
if (thumbXElem && xThumbWidth) {
|
|
3613
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
3614
|
-
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
3615
|
-
}
|
|
3616
|
-
const trackYEl = refTrackYElem.value;
|
|
3617
|
-
const thumbYElem = refThumbYElem.value;
|
|
3618
|
-
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
3619
|
-
internalData.yThumbTop = yThumbTop;
|
|
3620
|
-
if (thumbYElem && yThumbHeight) {
|
|
3621
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
3622
|
-
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
3623
|
-
}
|
|
3624
|
-
};
|
|
3625
|
-
const clickTrackXEvent = (evnt) => {
|
|
3626
|
-
const trackEl = evnt.currentTarget;
|
|
3627
|
-
if (trackEl !== evnt.target) {
|
|
3628
|
-
return;
|
|
3629
|
-
}
|
|
3630
|
-
const { elemStore } = internalData;
|
|
3631
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3632
|
-
if (!viewEl) {
|
|
3633
|
-
return;
|
|
3634
|
-
}
|
|
3635
|
-
const { xThumbWidth } = reactData;
|
|
3636
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
3637
|
-
viewEl.scrollTo({
|
|
3638
|
-
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
3639
|
-
behavior: 'auto'
|
|
3640
|
-
});
|
|
3641
|
-
};
|
|
3642
|
-
const clickTrackYEvent = (evnt) => {
|
|
3643
|
-
const trackEl = evnt.currentTarget;
|
|
3644
|
-
if (trackEl !== evnt.target) {
|
|
3645
|
-
return;
|
|
3646
|
-
}
|
|
3647
|
-
const { elemStore } = internalData;
|
|
3648
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3649
|
-
if (!viewEl) {
|
|
3650
|
-
return;
|
|
3651
|
-
}
|
|
3652
|
-
const { yThumbHeight } = reactData;
|
|
3653
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
3654
|
-
viewEl.scrollTo({
|
|
3655
|
-
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
3656
|
-
behavior: 'auto'
|
|
3657
|
-
});
|
|
3658
|
-
};
|
|
3659
|
-
const pointerdownThumbXEvent = (evnt) => {
|
|
3660
|
-
const thumbEl = evnt.currentTarget;
|
|
3661
|
-
internalData.isThumbDrag = true;
|
|
3662
|
-
thumbEl.setPointerCapture(evnt.pointerId);
|
|
3663
|
-
const { elemStore } = internalData;
|
|
3664
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3665
|
-
if (!viewEl) {
|
|
3666
|
-
return;
|
|
3667
|
-
}
|
|
3668
|
-
const { xThumbWidth } = reactData;
|
|
3669
|
-
const trackEl = thumbEl.parentElement;
|
|
3670
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
3671
|
-
const pointerPosition = evnt.clientX - trackRect.left;
|
|
3672
|
-
// 记录 thumb 的偏移
|
|
3673
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
3674
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
3675
|
-
};
|
|
3676
|
-
const pointermoveThumbXEvent = (evnt) => {
|
|
3677
|
-
const thumbEl = evnt.currentTarget;
|
|
3678
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
3679
|
-
return;
|
|
3680
|
-
}
|
|
3681
|
-
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
3682
|
-
if (isThumbDrag) {
|
|
3683
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3684
|
-
if (!viewEl) {
|
|
3685
|
-
return;
|
|
3686
|
-
}
|
|
3687
|
-
const { xThumbWidth } = reactData;
|
|
3688
|
-
const thumbEl = evnt.currentTarget;
|
|
3689
|
-
const trackEl = thumbEl.parentElement;
|
|
3690
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
3691
|
-
// 更新偏移
|
|
3692
|
-
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
3693
|
-
}
|
|
3694
|
-
};
|
|
3695
|
-
const cleatPointerThumbEvent = (evnt) => {
|
|
3696
|
-
const thumbEl = evnt.currentTarget;
|
|
3697
|
-
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
3698
|
-
internalData.isThumbDrag = false;
|
|
3699
|
-
};
|
|
3700
|
-
const pointerdownThumbYEvent = (evnt) => {
|
|
3701
|
-
const thumbEl = evnt.currentTarget;
|
|
3702
|
-
internalData.isThumbDrag = true;
|
|
3703
|
-
thumbEl.setPointerCapture(evnt.pointerId);
|
|
3704
|
-
const { elemStore } = internalData;
|
|
3705
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3706
|
-
if (!viewEl) {
|
|
3707
|
-
return;
|
|
3708
|
-
}
|
|
3709
|
-
const { yThumbHeight } = reactData;
|
|
3710
|
-
const trackEl = thumbEl.parentElement;
|
|
3711
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
3712
|
-
const pointerPosition = evnt.clientY - trackRect.top;
|
|
3713
|
-
// 记录 thumb 的偏移
|
|
3714
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
3715
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
3716
|
-
};
|
|
3717
|
-
const pointermoveThumbYEvent = (evnt) => {
|
|
3718
|
-
const thumbEl = evnt.currentTarget;
|
|
3719
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
3720
|
-
return;
|
|
3721
|
-
}
|
|
3722
|
-
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
3723
|
-
if (isThumbDrag) {
|
|
3724
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
3725
|
-
if (!viewEl) {
|
|
3726
|
-
return;
|
|
3727
|
-
}
|
|
3728
|
-
const { yThumbHeight } = reactData;
|
|
3729
|
-
const thumbEl = evnt.currentTarget;
|
|
3730
|
-
const trackEl = thumbEl.parentElement;
|
|
3731
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
3732
|
-
// 更新偏移
|
|
3733
|
-
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
3734
|
-
}
|
|
3735
|
-
};
|
|
3736
3575
|
Object.assign($xeGanttView, ganttViewMethods, ganttViewPrivateMethods);
|
|
3737
3576
|
const renderScrollX = () => {
|
|
3738
3577
|
return h('div', {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, ref, reactive, nextTick, inject, onBeforeUnmount, watch, provide, computed, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import { setScrollTop, setScrollLeft, removeClass, addClass, hasClass } from '../../ui/src/dom';
|
|
4
|
-
import { VxeUI } from '@vxe-ui/core';
|
|
4
|
+
import { VxeUI, useFns } from '@vxe-ui/core';
|
|
5
5
|
import { getDefaultConfig } from '../../ui/src/utils';
|
|
6
6
|
import { getRefElem, getTaskBarLeft, getTaskBarWidth, hasMilestoneTask, getTaskType, hasSubviewTask } from './util';
|
|
7
7
|
import { VxeGanttDependencyType } from './static';
|
|
@@ -9,8 +9,7 @@ import XEUtils from 'xe-utils';
|
|
|
9
9
|
import GanttViewHeaderComponent from './gantt-header';
|
|
10
10
|
import GanttViewBodyComponent from './gantt-body';
|
|
11
11
|
import GanttViewFooterComponent from './gantt-footer';
|
|
12
|
-
const { getConfig, domUtils,
|
|
13
|
-
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils;
|
|
12
|
+
const { getConfig, domUtils, globalResize, globalEvents, renderEmptyElement } = VxeUI;
|
|
14
13
|
const { FinishToStart, StartToFinish, StartToStart, FinishToFinish } = VxeGanttDependencyType;
|
|
15
14
|
const sourceType = 'gantt';
|
|
16
15
|
const secondMs = 1000;
|
|
@@ -97,10 +96,6 @@ export default defineVxeComponent({
|
|
|
97
96
|
const ganttInternalData = $xeGantt.internalData;
|
|
98
97
|
const { computeDateFormat, computeTaskBarOpts, computeTaskViewOpts, computeStartField, computeEndField, computeTypeField, computeScrollbarOpts, computeScaleUnit, computeWeekScale, computeMinScale, computeTaskNowLineOpts, computeScaleStep, computeIsVScrollbar } = $xeGantt.getComputeMaps();
|
|
99
98
|
const refElem = ref();
|
|
100
|
-
const refTrackXElem = ref();
|
|
101
|
-
const refTrackYElem = ref();
|
|
102
|
-
const refThumbXElem = ref();
|
|
103
|
-
const refThumbYElem = ref();
|
|
104
99
|
const refScrollXVirtualElem = ref();
|
|
105
100
|
const refScrollYVirtualElem = ref();
|
|
106
101
|
const refScrollXHandleElem = ref();
|
|
@@ -354,6 +349,7 @@ export default defineVxeComponent({
|
|
|
354
349
|
getRefMaps: () => refMaps,
|
|
355
350
|
getComputeMaps: () => computeMaps
|
|
356
351
|
};
|
|
352
|
+
const { refTrackXElem, refTrackYElem, refThumbXElem, refThumbYElem, updateThumbSize, updateThumbOffset, clickTrackXEvent, clickTrackYEvent, pointerdownThumbXEvent, pointermoveThumbXEvent, cleatPointerThumbEvent, pointerdownThumbYEvent, pointermoveThumbYEvent } = useFns.useInitVScrollbar($xeGanttView);
|
|
357
353
|
const parseStringDate = (dateValue) => {
|
|
358
354
|
const dateFormat = computeDateFormat.value;
|
|
359
355
|
return XEUtils.toStringDate(dateValue, dateFormat);
|
|
@@ -1945,6 +1941,11 @@ export default defineVxeComponent({
|
|
|
1945
1941
|
$xeGantt.dispatchEvent('scroll', evntParams, evnt);
|
|
1946
1942
|
};
|
|
1947
1943
|
const ganttViewMethods = {
|
|
1944
|
+
getScrollViewElem() {
|
|
1945
|
+
const { elemStore } = internalData;
|
|
1946
|
+
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
1947
|
+
return viewEl;
|
|
1948
|
+
},
|
|
1948
1949
|
refreshData() {
|
|
1949
1950
|
handleUpdateData();
|
|
1950
1951
|
handleRecalculateStyle();
|
|
@@ -2180,168 +2181,6 @@ export default defineVxeComponent({
|
|
|
2180
2181
|
}
|
|
2181
2182
|
}
|
|
2182
2183
|
};
|
|
2183
|
-
const updateThumbSize = () => {
|
|
2184
|
-
const { elemStore } = internalData;
|
|
2185
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2186
|
-
if (!viewEl) {
|
|
2187
|
-
return;
|
|
2188
|
-
}
|
|
2189
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
2190
|
-
return;
|
|
2191
|
-
}
|
|
2192
|
-
const trackXEl = refTrackXElem.value;
|
|
2193
|
-
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0;
|
|
2194
|
-
const thumbXElem = refThumbXElem.value;
|
|
2195
|
-
if (thumbXElem) {
|
|
2196
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
2197
|
-
}
|
|
2198
|
-
reactData.xThumbWidth = xThumbWidth;
|
|
2199
|
-
const trackYEl = refTrackYElem.value;
|
|
2200
|
-
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0;
|
|
2201
|
-
const thumbYElem = refThumbYElem.value;
|
|
2202
|
-
if (thumbYElem) {
|
|
2203
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
2204
|
-
}
|
|
2205
|
-
reactData.yThumbHeight = yThumbHeight;
|
|
2206
|
-
};
|
|
2207
|
-
const updateThumbOffset = () => {
|
|
2208
|
-
const { elemStore } = internalData;
|
|
2209
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2210
|
-
if (!viewEl) {
|
|
2211
|
-
return;
|
|
2212
|
-
}
|
|
2213
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
2214
|
-
return;
|
|
2215
|
-
}
|
|
2216
|
-
const { xThumbWidth, yThumbHeight } = reactData;
|
|
2217
|
-
const trackXEl = refTrackXElem.value;
|
|
2218
|
-
const thumbXElem = refThumbXElem.value;
|
|
2219
|
-
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0;
|
|
2220
|
-
internalData.xThumbLeft = xThumbLeft;
|
|
2221
|
-
if (thumbXElem && xThumbWidth) {
|
|
2222
|
-
thumbXElem.style.width = xThumbWidth + 'px';
|
|
2223
|
-
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`;
|
|
2224
|
-
}
|
|
2225
|
-
const trackYEl = refTrackYElem.value;
|
|
2226
|
-
const thumbYElem = refThumbYElem.value;
|
|
2227
|
-
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0;
|
|
2228
|
-
internalData.yThumbTop = yThumbTop;
|
|
2229
|
-
if (thumbYElem && yThumbHeight) {
|
|
2230
|
-
thumbYElem.style.height = yThumbHeight + 'px';
|
|
2231
|
-
thumbYElem.style.transform = `translateY(${yThumbTop}px)`;
|
|
2232
|
-
}
|
|
2233
|
-
};
|
|
2234
|
-
const clickTrackXEvent = (evnt) => {
|
|
2235
|
-
const trackEl = evnt.currentTarget;
|
|
2236
|
-
if (trackEl !== evnt.target) {
|
|
2237
|
-
return;
|
|
2238
|
-
}
|
|
2239
|
-
const { elemStore } = internalData;
|
|
2240
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2241
|
-
if (!viewEl) {
|
|
2242
|
-
return;
|
|
2243
|
-
}
|
|
2244
|
-
const { xThumbWidth } = reactData;
|
|
2245
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
2246
|
-
viewEl.scrollTo({
|
|
2247
|
-
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
2248
|
-
behavior: 'auto'
|
|
2249
|
-
});
|
|
2250
|
-
};
|
|
2251
|
-
const clickTrackYEvent = (evnt) => {
|
|
2252
|
-
const trackEl = evnt.currentTarget;
|
|
2253
|
-
if (trackEl !== evnt.target) {
|
|
2254
|
-
return;
|
|
2255
|
-
}
|
|
2256
|
-
const { elemStore } = internalData;
|
|
2257
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2258
|
-
if (!viewEl) {
|
|
2259
|
-
return;
|
|
2260
|
-
}
|
|
2261
|
-
const { yThumbHeight } = reactData;
|
|
2262
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
2263
|
-
viewEl.scrollTo({
|
|
2264
|
-
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
2265
|
-
behavior: 'auto'
|
|
2266
|
-
});
|
|
2267
|
-
};
|
|
2268
|
-
const pointerdownThumbXEvent = (evnt) => {
|
|
2269
|
-
const thumbEl = evnt.currentTarget;
|
|
2270
|
-
internalData.isThumbDrag = true;
|
|
2271
|
-
thumbEl.setPointerCapture(evnt.pointerId);
|
|
2272
|
-
const { elemStore } = internalData;
|
|
2273
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2274
|
-
if (!viewEl) {
|
|
2275
|
-
return;
|
|
2276
|
-
}
|
|
2277
|
-
const { xThumbWidth } = reactData;
|
|
2278
|
-
const trackEl = thumbEl.parentElement;
|
|
2279
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
2280
|
-
const pointerPosition = evnt.clientX - trackRect.left;
|
|
2281
|
-
// 记录 thumb 的偏移
|
|
2282
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
2283
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
2284
|
-
};
|
|
2285
|
-
const pointermoveThumbXEvent = (evnt) => {
|
|
2286
|
-
const thumbEl = evnt.currentTarget;
|
|
2287
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
2288
|
-
return;
|
|
2289
|
-
}
|
|
2290
|
-
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
2291
|
-
if (isThumbDrag) {
|
|
2292
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2293
|
-
if (!viewEl) {
|
|
2294
|
-
return;
|
|
2295
|
-
}
|
|
2296
|
-
const { xThumbWidth } = reactData;
|
|
2297
|
-
const thumbEl = evnt.currentTarget;
|
|
2298
|
-
const trackEl = thumbEl.parentElement;
|
|
2299
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
2300
|
-
// 更新偏移
|
|
2301
|
-
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth);
|
|
2302
|
-
}
|
|
2303
|
-
};
|
|
2304
|
-
const cleatPointerThumbEvent = (evnt) => {
|
|
2305
|
-
const thumbEl = evnt.currentTarget;
|
|
2306
|
-
thumbEl.releasePointerCapture(evnt.pointerId);
|
|
2307
|
-
internalData.isThumbDrag = false;
|
|
2308
|
-
};
|
|
2309
|
-
const pointerdownThumbYEvent = (evnt) => {
|
|
2310
|
-
const thumbEl = evnt.currentTarget;
|
|
2311
|
-
internalData.isThumbDrag = true;
|
|
2312
|
-
thumbEl.setPointerCapture(evnt.pointerId);
|
|
2313
|
-
const { elemStore } = internalData;
|
|
2314
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2315
|
-
if (!viewEl) {
|
|
2316
|
-
return;
|
|
2317
|
-
}
|
|
2318
|
-
const { yThumbHeight } = reactData;
|
|
2319
|
-
const trackEl = thumbEl.parentElement;
|
|
2320
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
2321
|
-
const pointerPosition = evnt.clientY - trackRect.top;
|
|
2322
|
-
// 记录 thumb 的偏移
|
|
2323
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
2324
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset;
|
|
2325
|
-
};
|
|
2326
|
-
const pointermoveThumbYEvent = (evnt) => {
|
|
2327
|
-
const thumbEl = evnt.currentTarget;
|
|
2328
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
2329
|
-
return;
|
|
2330
|
-
}
|
|
2331
|
-
const { elemStore, isThumbDrag, thumbDragOffset } = internalData;
|
|
2332
|
-
if (isThumbDrag) {
|
|
2333
|
-
const viewEl = getRefElem(elemStore['main-body-scroll']);
|
|
2334
|
-
if (!viewEl) {
|
|
2335
|
-
return;
|
|
2336
|
-
}
|
|
2337
|
-
const { yThumbHeight } = reactData;
|
|
2338
|
-
const thumbEl = evnt.currentTarget;
|
|
2339
|
-
const trackEl = thumbEl.parentElement;
|
|
2340
|
-
const trackRect = trackEl.getBoundingClientRect();
|
|
2341
|
-
// 更新偏移
|
|
2342
|
-
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight);
|
|
2343
|
-
}
|
|
2344
|
-
};
|
|
2345
2184
|
Object.assign($xeGanttView, ganttViewMethods, ganttViewPrivateMethods);
|
|
2346
2185
|
const renderScrollX = () => {
|
|
2347
2186
|
return h('div', {
|
package/es/ui/index.js
CHANGED
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 ganttVersion = `gantt v${"4.9.0-beta.
|
|
3
|
+
const ganttVersion = `gantt v${"4.9.0-beta.2"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|