@visactor/vtable-gantt 1.22.0 → 1.22.1
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/cjs/Gantt.d.ts +1 -0
- package/cjs/Gantt.js.map +1 -1
- package/cjs/gantt-helper.js +62 -61
- package/cjs/gantt-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/task-bar.js +1 -1
- package/cjs/scenegraph/task-bar.js.map +1 -1
- package/cjs/state/state-manager.d.ts +1 -0
- package/cjs/state/state-manager.js +43 -8
- package/cjs/state/state-manager.js.map +1 -1
- package/cjs/tools/debounce.js +3 -3
- package/cjs/tools/debounce.js.map +1 -1
- package/cjs/tools/inertia.js +6 -3
- package/cjs/tools/inertia.js.map +1 -1
- package/cjs/ts-types/gantt-engine.d.ts +1 -0
- package/cjs/ts-types/gantt-engine.js.map +1 -1
- package/cjs/zoom-scale/DataZoomIntegration.js +1 -1
- package/cjs/zoom-scale/DataZoomIntegration.js.map +1 -1
- package/dist/vtable-gantt.js +957 -562
- package/dist/vtable-gantt.min.js +2 -2
- package/es/Gantt.d.ts +1 -0
- package/es/Gantt.js.map +1 -1
- package/es/gantt-helper.js +60 -59
- package/es/gantt-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/task-bar.js +1 -1
- package/es/scenegraph/task-bar.js.map +1 -1
- package/es/state/state-manager.d.ts +1 -0
- package/es/state/state-manager.js +43 -8
- package/es/state/state-manager.js.map +1 -1
- package/es/tools/debounce.js +4 -2
- package/es/tools/debounce.js.map +1 -1
- package/es/tools/inertia.js +5 -3
- package/es/tools/inertia.js.map +1 -1
- package/es/ts-types/gantt-engine.d.ts +1 -0
- package/es/ts-types/gantt-engine.js.map +1 -1
- package/es/zoom-scale/DataZoomIntegration.js +2 -2
- package/es/zoom-scale/DataZoomIntegration.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable-gantt.js
CHANGED
|
@@ -24643,12 +24643,12 @@
|
|
|
24643
24643
|
const parsedParams = this.parseParams(params, isTimeline);
|
|
24644
24644
|
return animate = isTimeline ? this.executeTimelineItem(parsedParams, graphic, index, count) : this.executeTypeConfigItem(parsedParams, graphic, index, count), animate && this._trackAnimation(animate), animate;
|
|
24645
24645
|
}
|
|
24646
|
-
stop(type) {
|
|
24646
|
+
stop(type, callEnd = !0) {
|
|
24647
24647
|
for (; this._animates.length > 0;) {
|
|
24648
24648
|
const animate = this._animates.pop();
|
|
24649
|
-
null == animate || animate.stop(type);
|
|
24649
|
+
!1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
|
|
24650
24650
|
}
|
|
24651
|
-
this._animates = [], this._activeCount = 0, this._started && (this._started = !1, this.onEnd());
|
|
24651
|
+
this._animates = [], this._activeCount = 0, this._started && (this._started = !1, callEnd && this.onEnd());
|
|
24652
24652
|
}
|
|
24653
24653
|
}
|
|
24654
24654
|
AnimateExecutor.builtInAnimateMap = {};
|
|
@@ -24708,7 +24708,7 @@
|
|
|
24708
24708
|
executor: new AnimateExecutor(this.graphic)
|
|
24709
24709
|
});
|
|
24710
24710
|
}), shouldStopState.forEach(state => {
|
|
24711
|
-
state.executor.stop();
|
|
24711
|
+
state.executor.stop(null, !1);
|
|
24712
24712
|
}), shouldApplyState.length) {
|
|
24713
24713
|
shouldApplyState[0].executor.execute(shouldApplyState[0].animationConfig);
|
|
24714
24714
|
for (let i = 0; i < shouldApplyState.length; i++) {
|
|
@@ -24759,7 +24759,7 @@
|
|
|
24759
24759
|
clearState() {
|
|
24760
24760
|
var _a;
|
|
24761
24761
|
null === (_a = this.stateList) || void 0 === _a || _a.forEach(state => {
|
|
24762
|
-
state.executor.stop();
|
|
24762
|
+
state.executor.stop(null, !1);
|
|
24763
24763
|
}), this.stateList = null;
|
|
24764
24764
|
}
|
|
24765
24765
|
reApplyState(state) {
|
|
@@ -30467,6 +30467,19 @@
|
|
|
30467
30467
|
return convertDomainToTickData(scale.domain());
|
|
30468
30468
|
};
|
|
30469
30469
|
|
|
30470
|
+
var DataZoomActiveTag;
|
|
30471
|
+
!function (DataZoomActiveTag) {
|
|
30472
|
+
DataZoomActiveTag.startHandler = "startHandler", DataZoomActiveTag.endHandler = "endHandler", DataZoomActiveTag.middleHandler = "middleHandler", DataZoomActiveTag.background = "background";
|
|
30473
|
+
}(DataZoomActiveTag || (DataZoomActiveTag = {}));
|
|
30474
|
+
var IDataZoomInteractiveEvent;
|
|
30475
|
+
!function (IDataZoomInteractiveEvent) {
|
|
30476
|
+
IDataZoomInteractiveEvent.stateUpdate = "stateUpdate", IDataZoomInteractiveEvent.maskUpdate = "maskUpdate", IDataZoomInteractiveEvent.dataZoomUpdate = "dataZoomUpdate";
|
|
30477
|
+
}(IDataZoomInteractiveEvent || (IDataZoomInteractiveEvent = {}));
|
|
30478
|
+
var IDataZoomEvent;
|
|
30479
|
+
!function (IDataZoomEvent) {
|
|
30480
|
+
IDataZoomEvent.dataZoomChange = "dataZoomChange";
|
|
30481
|
+
}(IDataZoomEvent || (IDataZoomEvent = {}));
|
|
30482
|
+
|
|
30470
30483
|
const DEFAULT_HANDLER_PATH = "M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z";
|
|
30471
30484
|
const DEFAULT_DATA_ZOOM_ATTRIBUTES = {
|
|
30472
30485
|
orient: "bottom",
|
|
@@ -30584,14 +30597,17 @@
|
|
|
30584
30597
|
}
|
|
30585
30598
|
};
|
|
30586
30599
|
|
|
30587
|
-
|
|
30588
|
-
|
|
30589
|
-
|
|
30590
|
-
|
|
30591
|
-
|
|
30592
|
-
|
|
30593
|
-
|
|
30594
|
-
|
|
30600
|
+
const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
|
|
30601
|
+
if (!textBounds) return !1;
|
|
30602
|
+
if (isHorizontal) {
|
|
30603
|
+
if ("start" === layout) {
|
|
30604
|
+
if (textBounds.x1 < componentBoundsLike.x1) return !0;
|
|
30605
|
+
} else if (textBounds.x2 > componentBoundsLike.x2) return !0;
|
|
30606
|
+
} else if ("start" === layout) {
|
|
30607
|
+
if (textBounds.y1 < componentBoundsLike.y1) return !0;
|
|
30608
|
+
} else if (textBounds.y2 > componentBoundsLike.y2) return !0;
|
|
30609
|
+
return !1;
|
|
30610
|
+
};
|
|
30595
30611
|
|
|
30596
30612
|
var __rest$3 = undefined && undefined.__rest || function (s, e) {
|
|
30597
30613
|
var t = {};
|
|
@@ -30602,176 +30618,96 @@
|
|
|
30602
30618
|
}
|
|
30603
30619
|
return t;
|
|
30604
30620
|
};
|
|
30605
|
-
|
|
30606
|
-
|
|
30607
|
-
|
|
30608
|
-
|
|
30609
|
-
|
|
30610
|
-
|
|
30611
|
-
|
|
30621
|
+
class DataZoomRenderer {
|
|
30622
|
+
get startHandlerMask() {
|
|
30623
|
+
return this._startHandlerMask;
|
|
30624
|
+
}
|
|
30625
|
+
get middleHandlerSymbol() {
|
|
30626
|
+
return this._middleHandlerSymbol;
|
|
30627
|
+
}
|
|
30628
|
+
get middleHandlerRect() {
|
|
30629
|
+
return this._middleHandlerRect;
|
|
30630
|
+
}
|
|
30631
|
+
get endHandlerMask() {
|
|
30632
|
+
return this._endHandlerMask;
|
|
30633
|
+
}
|
|
30634
|
+
get selectedBackground() {
|
|
30635
|
+
return this._selectedBackground;
|
|
30636
|
+
}
|
|
30637
|
+
get dragMask() {
|
|
30638
|
+
return this._dragMask;
|
|
30639
|
+
}
|
|
30640
|
+
get startText() {
|
|
30641
|
+
return this._startText;
|
|
30642
|
+
}
|
|
30643
|
+
get endText() {
|
|
30644
|
+
return this._endText;
|
|
30645
|
+
}
|
|
30646
|
+
get startValue() {
|
|
30647
|
+
return this._startValue;
|
|
30648
|
+
}
|
|
30649
|
+
get endValue() {
|
|
30650
|
+
return this._endValue;
|
|
30651
|
+
}
|
|
30652
|
+
set showText(showText) {
|
|
30653
|
+
this._showText = showText;
|
|
30654
|
+
}
|
|
30655
|
+
get background() {
|
|
30656
|
+
return this._background;
|
|
30657
|
+
}
|
|
30658
|
+
set previewData(previewData) {
|
|
30659
|
+
this._previewData = previewData;
|
|
30660
|
+
}
|
|
30661
|
+
get previewGroup() {
|
|
30662
|
+
return this._previewGroup;
|
|
30663
|
+
}
|
|
30664
|
+
get selectedPreviewGroup() {
|
|
30665
|
+
return this._selectedPreviewGroup;
|
|
30666
|
+
}
|
|
30667
|
+
set previewPointsX(previewPointsX) {
|
|
30668
|
+
this._previewPointsX = previewPointsX;
|
|
30669
|
+
}
|
|
30670
|
+
set previewPointsY(previewPointsY) {
|
|
30671
|
+
this._previewPointsY = previewPointsY;
|
|
30672
|
+
}
|
|
30673
|
+
set previewPointsX1(previewPointsX1) {
|
|
30674
|
+
this._previewPointsX1 = previewPointsX1;
|
|
30675
|
+
}
|
|
30676
|
+
set previewPointsY1(previewPointsY1) {
|
|
30677
|
+
this._previewPointsY1 = previewPointsY1;
|
|
30678
|
+
}
|
|
30679
|
+
set statePointToData(statePointToData) {
|
|
30680
|
+
this._statePointToData = statePointToData;
|
|
30681
|
+
}
|
|
30682
|
+
_initAttrs(props) {
|
|
30683
|
+
this.attribute = props.attribute, this._isHorizontal = "top" === this.attribute.orient || "bottom" === this.attribute.orient;
|
|
30612
30684
|
const {
|
|
30613
|
-
start: start,
|
|
30614
|
-
end: end,
|
|
30615
|
-
orient: orient,
|
|
30616
30685
|
previewData: previewData,
|
|
30617
30686
|
previewPointsX: previewPointsX,
|
|
30618
30687
|
previewPointsY: previewPointsY,
|
|
30619
30688
|
previewPointsX1: previewPointsX1,
|
|
30620
30689
|
previewPointsY1: previewPointsY1
|
|
30621
30690
|
} = this.attribute;
|
|
30622
|
-
|
|
30623
|
-
const {
|
|
30624
|
-
width: width,
|
|
30625
|
-
height: height
|
|
30626
|
-
} = this.getLayoutAttrFromConfig();
|
|
30627
|
-
this._spanCache = this.state.end - this.state.start, this._isHorizontal = "top" === orient || "bottom" === orient, this._layoutCache.max = this._isHorizontal ? width : height, this._layoutCache.attPos = this._isHorizontal ? "x" : "y", this._layoutCache.attSize = this._isHorizontal ? "width" : "height", previewData && (this._previewData = previewData), isFunction$7(previewPointsX) && (this._previewPointsX = previewPointsX), isFunction$7(previewPointsY) && (this._previewPointsY = previewPointsY), isFunction$7(previewPointsX1) && (this._previewPointsX1 = previewPointsX1), isFunction$7(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
|
|
30691
|
+
previewData && (this._previewData = previewData), isFunction$7(previewPointsX) && (this._previewPointsX = previewPointsX), isFunction$7(previewPointsY) && (this._previewPointsY = previewPointsY), isFunction$7(previewPointsX1) && (this._previewPointsX1 = previewPointsX1), isFunction$7(previewPointsY1) && (this._previewPointsY1 = previewPointsY1), this._getState = props.getState, this._getLayoutAttrFromConfig = props.getLayoutAttrFromConfig, this._getContainer = props.getContainer;
|
|
30628
30692
|
}
|
|
30629
|
-
constructor(
|
|
30630
|
-
|
|
30631
|
-
startPos: {
|
|
30632
|
-
x: 0,
|
|
30633
|
-
y: 0
|
|
30634
|
-
},
|
|
30635
|
-
lastPos: {
|
|
30636
|
-
x: 0,
|
|
30637
|
-
y: 0
|
|
30638
|
-
}
|
|
30639
|
-
}, this._layoutCache = {
|
|
30640
|
-
attPos: "x",
|
|
30641
|
-
attSize: "width",
|
|
30642
|
-
max: 0
|
|
30643
|
-
}, this.state = {
|
|
30644
|
-
start: 0,
|
|
30645
|
-
end: 1
|
|
30646
|
-
}, this._statePointToData = state => state, this._handleTouchMove = e => {
|
|
30647
|
-
this._activeState && e.preventDefault();
|
|
30648
|
-
}, this._onHandlerPointerDown = (e, tag) => {
|
|
30649
|
-
this._clearDragEvents(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e);
|
|
30650
|
-
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
30651
|
-
triggers = getEndTriggersOfDrag();
|
|
30652
|
-
evtTarget.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
30653
|
-
capture: !0
|
|
30654
|
-
}), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
30655
|
-
capture: !0
|
|
30656
|
-
}), triggers.forEach(trigger => {
|
|
30657
|
-
evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
|
|
30658
|
-
});
|
|
30659
|
-
}, this._pointerMove = e => {
|
|
30660
|
-
const {
|
|
30661
|
-
start: startAttr,
|
|
30662
|
-
end: endAttr,
|
|
30663
|
-
brushSelect: brushSelect,
|
|
30664
|
-
realTime = !0
|
|
30665
|
-
} = this.attribute,
|
|
30666
|
-
pos = this.eventPosToStagePos(e),
|
|
30667
|
-
{
|
|
30668
|
-
attPos: attPos,
|
|
30669
|
-
max: max
|
|
30670
|
-
} = this._layoutCache,
|
|
30671
|
-
dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / max;
|
|
30672
|
-
let {
|
|
30673
|
-
start: start,
|
|
30674
|
-
end: end
|
|
30675
|
-
} = this.state;
|
|
30676
|
-
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
|
|
30677
|
-
start: start,
|
|
30678
|
-
end: end,
|
|
30679
|
-
tag: this._activeTag
|
|
30680
|
-
}));
|
|
30681
|
-
}, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
|
|
30682
|
-
const {
|
|
30683
|
-
start: start,
|
|
30684
|
-
end: end,
|
|
30685
|
-
brushSelect: brushSelect,
|
|
30686
|
-
realTime = !0
|
|
30687
|
-
} = this.attribute;
|
|
30688
|
-
if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
|
|
30689
|
-
const pos = this.eventPosToStagePos(e);
|
|
30690
|
-
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
30691
|
-
}
|
|
30692
|
-
this._activeState = !1, brushSelect && this.renderDragMask(), this._dispatchEvent("change", {
|
|
30693
|
-
start: this.state.start,
|
|
30694
|
-
end: this.state.end,
|
|
30695
|
-
tag: this._activeTag
|
|
30696
|
-
}), this._clearDragEvents();
|
|
30697
|
-
};
|
|
30693
|
+
constructor(props) {
|
|
30694
|
+
this._previewData = [], this._statePointToData = state => state;
|
|
30698
30695
|
const {
|
|
30699
|
-
position: position,
|
|
30700
30696
|
showDetail: showDetail
|
|
30701
|
-
} =
|
|
30702
|
-
this.
|
|
30697
|
+
} = props.attribute;
|
|
30698
|
+
this._showText = "auto" !== showDetail && showDetail, this._initAttrs(props);
|
|
30703
30699
|
}
|
|
30704
|
-
setAttributes(
|
|
30705
|
-
|
|
30700
|
+
setAttributes(props) {
|
|
30701
|
+
this._initAttrs(props);
|
|
30706
30702
|
}
|
|
30707
|
-
|
|
30708
|
-
|
|
30703
|
+
renderDataZoom(onlyStateChange = !1) {
|
|
30704
|
+
var _a, _b, _c, _d, _e, _f;
|
|
30709
30705
|
const {
|
|
30710
|
-
|
|
30706
|
+
backgroundChartStyle = {},
|
|
30707
|
+
selectedBackgroundChartStyle = {},
|
|
30711
30708
|
brushSelect: brushSelect
|
|
30712
30709
|
} = this.attribute;
|
|
30713
|
-
this.
|
|
30714
|
-
const selectedTag = brushSelect ? "background" : "middleRect";
|
|
30715
|
-
this._selectedBackground && this._selectedBackground.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), brushSelect && this._background && this._background.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), brushSelect && this._previewGroup && this._previewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), this._selectedPreviewGroup && this._selectedPreviewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), "auto" === showDetail && (this.addEventListener("pointerenter", this._onHandlerPointerEnter), this.addEventListener("pointerleave", this._onHandlerPointerLeave)), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
30716
|
-
passive: !1
|
|
30717
|
-
});
|
|
30718
|
-
}
|
|
30719
|
-
dragMaskSize() {
|
|
30720
|
-
const {
|
|
30721
|
-
position: position
|
|
30722
|
-
} = this.attribute,
|
|
30723
|
-
{
|
|
30724
|
-
attPos: attPos,
|
|
30725
|
-
max: max
|
|
30726
|
-
} = this._layoutCache;
|
|
30727
|
-
return this._activeCache.lastPos[attPos] - position[attPos] > max ? max + position[attPos] - this._activeCache.startPos[attPos] : this._activeCache.lastPos[attPos] - position[attPos] < 0 ? position[attPos] - this._activeCache.startPos[attPos] : this._activeCache.lastPos[attPos] - this._activeCache.startPos[attPos];
|
|
30728
|
-
}
|
|
30729
|
-
setStateAttr(start, end, shouldRender) {
|
|
30730
|
-
const {
|
|
30731
|
-
zoomLock = !1,
|
|
30732
|
-
minSpan = 0,
|
|
30733
|
-
maxSpan = 1
|
|
30734
|
-
} = this.attribute,
|
|
30735
|
-
span = end - start;
|
|
30736
|
-
span !== this._spanCache && (zoomLock || span < minSpan || span > maxSpan) || (this._spanCache = span, this.state.start = start, this.state.end = end, shouldRender && this.setAttributes({
|
|
30737
|
-
start: start,
|
|
30738
|
-
end: end
|
|
30739
|
-
}));
|
|
30740
|
-
}
|
|
30741
|
-
_clearDragEvents() {
|
|
30742
|
-
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
30743
|
-
triggers = getEndTriggersOfDrag();
|
|
30744
|
-
evtTarget.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
30745
|
-
capture: !0
|
|
30746
|
-
}), triggers.forEach(trigger => {
|
|
30747
|
-
evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
30748
|
-
}), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
30749
|
-
capture: !0
|
|
30750
|
-
});
|
|
30751
|
-
}
|
|
30752
|
-
_onHandlerPointerEnter(e) {
|
|
30753
|
-
this._showText = !0, this.renderText();
|
|
30754
|
-
}
|
|
30755
|
-
_onHandlerPointerLeave(e) {
|
|
30756
|
-
this._showText = !1, this.renderText();
|
|
30757
|
-
}
|
|
30758
|
-
backgroundDragZoom(startPos, endPos) {
|
|
30759
|
-
const {
|
|
30760
|
-
attPos: attPos,
|
|
30761
|
-
max: max
|
|
30762
|
-
} = this._layoutCache,
|
|
30763
|
-
{
|
|
30764
|
-
position: position
|
|
30765
|
-
} = this.attribute,
|
|
30766
|
-
startPosInComponent = startPos[attPos] - position[attPos],
|
|
30767
|
-
endPosInComponent = endPos[attPos] - position[attPos],
|
|
30768
|
-
start = Math.min(Math.max(Math.min(startPosInComponent, endPosInComponent) / max, 0), 1),
|
|
30769
|
-
end = Math.min(Math.max(Math.max(startPosInComponent, endPosInComponent) / max, 0), 1);
|
|
30770
|
-
Math.abs(start - end) < .01 ? this.moveZoomWithMiddle(start) : this.setStateAttr(start, end, !1);
|
|
30771
|
-
}
|
|
30772
|
-
moveZoomWithMiddle(middle) {
|
|
30773
|
-
let offset = middle - (this.state.start + this.state.end) / 2;
|
|
30774
|
-
0 !== offset && (offset > 0 ? this.state.end + offset > 1 && (offset = 1 - this.state.end) : offset < 0 && this.state.start + offset < 0 && (offset = -this.state.start), this.setStateAttr(this.state.start + offset, this.state.end + offset, !1));
|
|
30710
|
+
this._renderBackground(), (null === (_a = backgroundChartStyle.line) || void 0 === _a ? void 0 : _a.visible) && !onlyStateChange && this._setPreviewAttributes("line", this._getContainer()), (null === (_b = backgroundChartStyle.area) || void 0 === _b ? void 0 : _b.visible) && !onlyStateChange && this._setPreviewAttributes("area", this._getContainer()), brushSelect && this.renderDragMask(), this._renderSelectedBackground(), (null === (_c = selectedBackgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this._setSelectedPreviewClipAttributes("line", this._getContainer()), (null === (_d = selectedBackgroundChartStyle.line) || void 0 === _d ? void 0 : _d.visible) && !onlyStateChange && this._setSelectedPreviewAttributes("line"), (null === (_e = selectedBackgroundChartStyle.line) || void 0 === _e ? void 0 : _e.visible) && this._setSelectedPreviewClipAttributes("area", this._getContainer()), (null === (_f = selectedBackgroundChartStyle.area) || void 0 === _f ? void 0 : _f.visible) && !onlyStateChange && this._setSelectedPreviewAttributes("area"), this._renderHandler(), this._showText && this.renderText();
|
|
30775
30711
|
}
|
|
30776
30712
|
renderDragMask() {
|
|
30777
30713
|
const {
|
|
@@ -30781,254 +30717,104 @@
|
|
|
30781
30717
|
position: position,
|
|
30782
30718
|
width: width,
|
|
30783
30719
|
height: height
|
|
30784
|
-
} = this.
|
|
30785
|
-
|
|
30786
|
-
|
|
30720
|
+
} = this._getLayoutAttrFromConfig(),
|
|
30721
|
+
{
|
|
30722
|
+
start: start,
|
|
30723
|
+
end: end
|
|
30724
|
+
} = this._getState();
|
|
30725
|
+
return this._isHorizontal ? this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
|
|
30726
|
+
x: position.x + start * width,
|
|
30787
30727
|
y: position.y,
|
|
30788
|
-
width:
|
|
30728
|
+
width: (end - start) * width,
|
|
30789
30729
|
height: height
|
|
30790
|
-
}, dragMaskStyle), "rect") : this._dragMask = this.
|
|
30730
|
+
}, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
|
|
30791
30731
|
x: position.x,
|
|
30792
|
-
y:
|
|
30732
|
+
y: position.y + start * height,
|
|
30793
30733
|
width: width,
|
|
30794
|
-
height:
|
|
30795
|
-
}, dragMaskStyle), "rect")
|
|
30796
|
-
|
|
30797
|
-
|
|
30798
|
-
|
|
30799
|
-
if (this._isHorizontal) {
|
|
30800
|
-
if ("start" === layout) {
|
|
30801
|
-
if (textBounds.x1 < componentBoundsLike.x1) return !0;
|
|
30802
|
-
} else if (textBounds.x2 > componentBoundsLike.x2) return !0;
|
|
30803
|
-
} else if ("start" === layout) {
|
|
30804
|
-
if (textBounds.y1 < componentBoundsLike.y1) return !0;
|
|
30805
|
-
} else if (textBounds.y2 > componentBoundsLike.y2) return !0;
|
|
30806
|
-
return !1;
|
|
30734
|
+
height: (end - start) * height
|
|
30735
|
+
}, dragMaskStyle), "rect"), {
|
|
30736
|
+
start: start,
|
|
30737
|
+
end: end
|
|
30738
|
+
};
|
|
30807
30739
|
}
|
|
30808
|
-
|
|
30809
|
-
var _a
|
|
30740
|
+
_renderBackground() {
|
|
30741
|
+
var _a;
|
|
30810
30742
|
const {
|
|
30811
|
-
|
|
30812
|
-
|
|
30743
|
+
backgroundStyle: backgroundStyle,
|
|
30744
|
+
brushSelect: brushSelect,
|
|
30745
|
+
zoomLock: zoomLock
|
|
30813
30746
|
} = this.attribute,
|
|
30814
30747
|
{
|
|
30815
|
-
formatMethod: startTextFormat
|
|
30816
|
-
} = startTextStyle,
|
|
30817
|
-
restStartTextStyle = __rest$3(startTextStyle, ["formatMethod"]),
|
|
30818
|
-
{
|
|
30819
|
-
formatMethod: endTextFormat
|
|
30820
|
-
} = endTextStyle,
|
|
30821
|
-
restEndTextStyle = __rest$3(endTextStyle, ["formatMethod"]),
|
|
30822
|
-
{
|
|
30823
|
-
start: start,
|
|
30824
|
-
end: end
|
|
30825
|
-
} = this.state;
|
|
30826
|
-
this._startValue = this._statePointToData(start), this._endValue = this._statePointToData(end);
|
|
30827
|
-
const {
|
|
30828
30748
|
position: position,
|
|
30829
30749
|
width: width,
|
|
30830
30750
|
height: height
|
|
30831
|
-
} = this.
|
|
30832
|
-
|
|
30833
|
-
|
|
30834
|
-
componentBoundsLike = {
|
|
30835
|
-
x1: position.x,
|
|
30836
|
-
y1: position.y,
|
|
30837
|
-
x2: position.x + width,
|
|
30838
|
-
y2: position.y + height
|
|
30839
|
-
};
|
|
30840
|
-
let startTextPosition, endTextPosition, startTextAlignStyle, endTextAlignStyle;
|
|
30841
|
-
this._isHorizontal ? (startTextPosition = {
|
|
30842
|
-
x: position.x + start * width,
|
|
30843
|
-
y: position.y + height / 2
|
|
30844
|
-
}, endTextPosition = {
|
|
30845
|
-
x: position.x + end * width,
|
|
30846
|
-
y: position.y + height / 2
|
|
30847
|
-
}, startTextAlignStyle = {
|
|
30848
|
-
textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "left" : "right",
|
|
30849
|
-
textBaseline: null !== (_b = null === (_a = null == restStartTextStyle ? void 0 : restStartTextStyle.textStyle) || void 0 === _a ? void 0 : _a.textBaseline) && void 0 !== _b ? _b : "middle"
|
|
30850
|
-
}, endTextAlignStyle = {
|
|
30851
|
-
textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "right" : "left",
|
|
30852
|
-
textBaseline: null !== (_d = null === (_c = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _c ? void 0 : _c.textBaseline) && void 0 !== _d ? _d : "middle"
|
|
30853
|
-
}) : (startTextPosition = {
|
|
30854
|
-
x: position.x + width / 2,
|
|
30855
|
-
y: position.y + start * height
|
|
30856
|
-
}, endTextPosition = {
|
|
30857
|
-
x: position.x + width / 2,
|
|
30858
|
-
y: position.y + end * height
|
|
30859
|
-
}, startTextAlignStyle = {
|
|
30860
|
-
textAlign: null !== (_f = null === (_e = null == restStartTextStyle ? void 0 : restStartTextStyle.textStyle) || void 0 === _e ? void 0 : _e.textAlign) && void 0 !== _f ? _f : "center",
|
|
30861
|
-
textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "top" : "bottom"
|
|
30862
|
-
}, endTextAlignStyle = {
|
|
30863
|
-
textAlign: null !== (_h = null === (_g = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _g ? void 0 : _g.textAlign) && void 0 !== _h ? _h : "center",
|
|
30864
|
-
textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "bottom" : "top"
|
|
30865
|
-
}), this._startText = this.maybeAddLabel(this._container, merge$2({}, restStartTextStyle, {
|
|
30866
|
-
text: startTextValue,
|
|
30867
|
-
x: startTextPosition.x,
|
|
30868
|
-
y: startTextPosition.y,
|
|
30869
|
-
visible: this._showText,
|
|
30870
|
-
pickable: !1,
|
|
30871
|
-
childrenPickable: !1,
|
|
30872
|
-
textStyle: startTextAlignStyle
|
|
30873
|
-
}), `data-zoom-start-text-${position}`), this._endText = this.maybeAddLabel(this._container, merge$2({}, restEndTextStyle, {
|
|
30874
|
-
text: endTextValue,
|
|
30875
|
-
x: endTextPosition.x,
|
|
30876
|
-
y: endTextPosition.y,
|
|
30877
|
-
visible: this._showText,
|
|
30878
|
-
pickable: !1,
|
|
30879
|
-
childrenPickable: !1,
|
|
30880
|
-
textStyle: endTextAlignStyle
|
|
30881
|
-
}), `data-zoom-end-text-${position}`);
|
|
30882
|
-
}
|
|
30883
|
-
renderText() {
|
|
30884
|
-
let startTextBounds = null,
|
|
30885
|
-
endTextBounds = null;
|
|
30886
|
-
this.setTextAttr(startTextBounds, endTextBounds), startTextBounds = this._startText.AABBBounds, endTextBounds = this._endText.AABBBounds, this.setTextAttr(startTextBounds, endTextBounds), startTextBounds = this._startText.AABBBounds, endTextBounds = this._endText.AABBBounds;
|
|
30887
|
-
const {
|
|
30888
|
-
x1: x1,
|
|
30889
|
-
x2: x2,
|
|
30890
|
-
y1: y1,
|
|
30891
|
-
y2: y2
|
|
30892
|
-
} = startTextBounds,
|
|
30893
|
-
{
|
|
30894
|
-
dx: startTextDx = 0,
|
|
30895
|
-
dy: startTextDy = 0
|
|
30896
|
-
} = this.attribute.startTextStyle;
|
|
30897
|
-
if (new Bounds$1().set(x1, y1, x2, y2).intersects(endTextBounds)) {
|
|
30898
|
-
const direction = "bottom" === this.attribute.orient || "right" === this.attribute.orient ? -1 : 1;
|
|
30899
|
-
if (this._isHorizontal) {
|
|
30900
|
-
const boundsYDiff = Math.abs(endTextBounds.y1 - endTextBounds.y2);
|
|
30901
|
-
this._startText.setAttribute("dy", startTextDy + direction * (Number.isFinite(boundsYDiff) ? boundsYDiff : 0));
|
|
30902
|
-
} else {
|
|
30903
|
-
const boundsXDiff = Math.abs(endTextBounds.x1 - endTextBounds.x2);
|
|
30904
|
-
this._startText.setAttribute("dx", startTextDx + direction * (Number.isFinite(boundsXDiff) ? boundsXDiff : 0));
|
|
30905
|
-
}
|
|
30906
|
-
} else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
|
|
30907
|
-
}
|
|
30908
|
-
getLayoutAttrFromConfig() {
|
|
30909
|
-
var _a, _b, _c, _d, _e, _f;
|
|
30910
|
-
if (this._layoutAttrFromConfig) return this._layoutAttrFromConfig;
|
|
30911
|
-
const {
|
|
30912
|
-
position: positionConfig,
|
|
30913
|
-
size: size,
|
|
30914
|
-
orient: orient,
|
|
30915
|
-
middleHandlerStyle = {},
|
|
30916
|
-
startHandlerStyle = {},
|
|
30917
|
-
endHandlerStyle = {},
|
|
30918
|
-
backgroundStyle = {}
|
|
30919
|
-
} = this.attribute,
|
|
30920
|
-
{
|
|
30921
|
-
width: widthConfig,
|
|
30922
|
-
height: heightConfig
|
|
30923
|
-
} = size,
|
|
30924
|
-
middleHandlerSize = null !== (_b = null === (_a = middleHandlerStyle.background) || void 0 === _a ? void 0 : _a.size) && void 0 !== _b ? _b : 10;
|
|
30925
|
-
let width, height, position;
|
|
30926
|
-
middleHandlerStyle.visible ? this._isHorizontal ? (width = widthConfig, height = heightConfig - middleHandlerSize, position = {
|
|
30927
|
-
x: positionConfig.x,
|
|
30928
|
-
y: positionConfig.y + middleHandlerSize
|
|
30929
|
-
}) : (width = widthConfig - middleHandlerSize, height = heightConfig, position = {
|
|
30930
|
-
x: positionConfig.x + ("left" === orient ? middleHandlerSize : 0),
|
|
30931
|
-
y: positionConfig.y
|
|
30932
|
-
}) : (width = widthConfig, height = heightConfig, position = positionConfig);
|
|
30933
|
-
const startHandlerSize = null !== (_c = startHandlerStyle.size) && void 0 !== _c ? _c : this._isHorizontal ? height : width,
|
|
30934
|
-
endHandlerSize = null !== (_d = endHandlerStyle.size) && void 0 !== _d ? _d : this._isHorizontal ? height : width;
|
|
30935
|
-
return startHandlerStyle.visible && (this._isHorizontal ? (width -= (startHandlerSize + endHandlerSize) / 2, position = {
|
|
30936
|
-
x: position.x + startHandlerSize / 2,
|
|
30937
|
-
y: position.y
|
|
30938
|
-
}) : (height -= (startHandlerSize + endHandlerSize) / 2, position = {
|
|
30751
|
+
} = this._getLayoutAttrFromConfig(),
|
|
30752
|
+
group = this._getContainer();
|
|
30753
|
+
this._background = group.createOrUpdateChild("background", Object.assign(Object.assign({
|
|
30939
30754
|
x: position.x,
|
|
30940
|
-
y: position.y
|
|
30941
|
-
})), height += null !== (_e = backgroundStyle.lineWidth / 2) && void 0 !== _e ? _e : 1, width += null !== (_f = backgroundStyle.lineWidth / 2) && void 0 !== _f ? _f : 1, this._layoutAttrFromConfig = {
|
|
30942
|
-
position: position,
|
|
30755
|
+
y: position.y,
|
|
30943
30756
|
width: width,
|
|
30944
|
-
height: height
|
|
30945
|
-
|
|
30757
|
+
height: height,
|
|
30758
|
+
cursor: brushSelect ? "crosshair" : "auto"
|
|
30759
|
+
}, backgroundStyle), {
|
|
30760
|
+
pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
|
|
30761
|
+
}), "rect");
|
|
30946
30762
|
}
|
|
30947
|
-
|
|
30948
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2
|
|
30949
|
-
this._layoutAttrFromConfig = null;
|
|
30763
|
+
_renderHandler() {
|
|
30764
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
30950
30765
|
const {
|
|
30951
30766
|
orient: orient,
|
|
30952
|
-
backgroundStyle: backgroundStyle,
|
|
30953
|
-
backgroundChartStyle = {},
|
|
30954
|
-
selectedBackgroundStyle = {},
|
|
30955
|
-
selectedBackgroundChartStyle = {},
|
|
30956
30767
|
middleHandlerStyle = {},
|
|
30957
30768
|
startHandlerStyle = {},
|
|
30958
30769
|
endHandlerStyle = {},
|
|
30959
|
-
brushSelect: brushSelect,
|
|
30960
30770
|
zoomLock: zoomLock
|
|
30961
30771
|
} = this.attribute,
|
|
30962
30772
|
{
|
|
30963
30773
|
start: start,
|
|
30964
30774
|
end: end
|
|
30965
|
-
} = this.
|
|
30775
|
+
} = this._getState(),
|
|
30966
30776
|
{
|
|
30967
30777
|
position: position,
|
|
30968
30778
|
width: width,
|
|
30969
30779
|
height: height
|
|
30970
|
-
} = this.
|
|
30780
|
+
} = this._getLayoutAttrFromConfig(),
|
|
30971
30781
|
startHandlerMinSize = null !== (_a = startHandlerStyle.triggerMinSize) && void 0 !== _a ? _a : 40,
|
|
30972
30782
|
endHandlerMinSize = null !== (_b = endHandlerStyle.triggerMinSize) && void 0 !== _b ? _b : 40,
|
|
30973
|
-
group = this.
|
|
30974
|
-
if (this.
|
|
30975
|
-
x: position.x,
|
|
30976
|
-
y: position.y,
|
|
30977
|
-
width: width,
|
|
30978
|
-
height: height,
|
|
30979
|
-
cursor: brushSelect ? "crosshair" : "auto"
|
|
30980
|
-
}, backgroundStyle), {
|
|
30981
|
-
pickable: !zoomLock && (null === (_c = backgroundStyle.pickable) || void 0 === _c || _c)
|
|
30982
|
-
}), "rect"), (null === (_d = backgroundChartStyle.line) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("line", group), (null === (_e = backgroundChartStyle.area) || void 0 === _e ? void 0 : _e.visible) && this.setPreviewAttributes("area", group), brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
30983
|
-
x: position.x + start * width,
|
|
30984
|
-
y: position.y,
|
|
30985
|
-
width: (end - start) * width,
|
|
30986
|
-
height: height,
|
|
30987
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
30988
|
-
}, selectedBackgroundStyle), {
|
|
30989
|
-
pickable: !zoomLock && (null === (_f = selectedBackgroundChartStyle.pickable) || void 0 === _f || _f)
|
|
30990
|
-
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
30991
|
-
x: position.x,
|
|
30992
|
-
y: position.y + start * height,
|
|
30993
|
-
width: width,
|
|
30994
|
-
height: (end - start) * height,
|
|
30995
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
30996
|
-
}, selectedBackgroundStyle), {
|
|
30997
|
-
pickable: !zoomLock && (null === (_g = selectedBackgroundStyle.pickable) || void 0 === _g || _g)
|
|
30998
|
-
}), "rect"), (null === (_h = selectedBackgroundChartStyle.line) || void 0 === _h ? void 0 : _h.visible) && this.setSelectedPreviewAttributes("line", group), (null === (_j = selectedBackgroundChartStyle.area) || void 0 === _j ? void 0 : _j.visible) && this.setSelectedPreviewAttributes("area", group), this._isHorizontal) {
|
|
30783
|
+
group = this._getContainer();
|
|
30784
|
+
if (this._isHorizontal) {
|
|
30999
30785
|
if (middleHandlerStyle.visible) {
|
|
31000
|
-
const middleHandlerBackgroundSize = (null === (
|
|
30786
|
+
const middleHandlerBackgroundSize = (null === (_c = middleHandlerStyle.background) || void 0 === _c ? void 0 : _c.size) || 10;
|
|
31001
30787
|
this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
|
|
31002
30788
|
x: position.x + start * width,
|
|
31003
30789
|
y: position.y - middleHandlerBackgroundSize,
|
|
31004
30790
|
width: (end - start) * width,
|
|
31005
30791
|
height: middleHandlerBackgroundSize
|
|
31006
|
-
}, null === (
|
|
31007
|
-
pickable: !zoomLock && (null === (
|
|
30792
|
+
}, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
|
|
30793
|
+
pickable: !zoomLock && (null === (_g = null === (_f = null === (_e = middleHandlerStyle.background) || void 0 === _e ? void 0 : _e.style) || void 0 === _f ? void 0 : _f.pickable) || void 0 === _g || _g)
|
|
31008
30794
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
31009
30795
|
x: position.x + (start + end) / 2 * width,
|
|
31010
30796
|
y: position.y - middleHandlerBackgroundSize / 2,
|
|
31011
30797
|
strokeBoundsBuffer: 0,
|
|
31012
30798
|
angle: 0,
|
|
31013
|
-
symbolType: null !== (
|
|
30799
|
+
symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
|
|
31014
30800
|
}, middleHandlerStyle.icon), {
|
|
31015
|
-
pickable: !zoomLock && (null === (
|
|
30801
|
+
pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
|
|
31016
30802
|
}), "symbol");
|
|
31017
30803
|
}
|
|
31018
30804
|
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
31019
30805
|
x: position.x + start * width,
|
|
31020
30806
|
y: position.y + height / 2,
|
|
31021
30807
|
size: height,
|
|
31022
|
-
symbolType: null !== (
|
|
30808
|
+
symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
|
|
31023
30809
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
|
|
31024
|
-
pickable: !zoomLock && (null === (
|
|
30810
|
+
pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
|
|
31025
30811
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
31026
30812
|
x: position.x + end * width,
|
|
31027
30813
|
y: position.y + height / 2,
|
|
31028
30814
|
size: height,
|
|
31029
|
-
symbolType: null !== (
|
|
30815
|
+
symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
|
|
31030
30816
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
|
|
31031
|
-
pickable: !zoomLock && (null === (
|
|
30817
|
+
pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
|
|
31032
30818
|
}), "symbol");
|
|
31033
30819
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
|
|
31034
30820
|
startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize),
|
|
@@ -31057,38 +30843,38 @@
|
|
|
31057
30843
|
}), "rect");
|
|
31058
30844
|
} else {
|
|
31059
30845
|
if (middleHandlerStyle.visible) {
|
|
31060
|
-
const middleHandlerBackgroundSize = (null === (
|
|
30846
|
+
const middleHandlerBackgroundSize = (null === (_q = middleHandlerStyle.background) || void 0 === _q ? void 0 : _q.size) || 10;
|
|
31061
30847
|
this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
|
|
31062
30848
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
|
|
31063
30849
|
y: position.y + start * height,
|
|
31064
30850
|
width: middleHandlerBackgroundSize,
|
|
31065
30851
|
height: (end - start) * height
|
|
31066
|
-
}, null === (
|
|
31067
|
-
pickable: !zoomLock && (null === (
|
|
30852
|
+
}, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
|
|
30853
|
+
pickable: !zoomLock && (null === (_u = null === (_t = null === (_s = middleHandlerStyle.background) || void 0 === _s ? void 0 : _s.style) || void 0 === _t ? void 0 : _t.pickable) || void 0 === _u || _u)
|
|
31068
30854
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
31069
30855
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize / 2 : position.x + width + middleHandlerBackgroundSize / 2,
|
|
31070
30856
|
y: position.y + (start + end) / 2 * height,
|
|
31071
30857
|
angle: Math.PI / 180 * 90,
|
|
31072
|
-
symbolType: null !== (
|
|
30858
|
+
symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
|
|
31073
30859
|
strokeBoundsBuffer: 0
|
|
31074
30860
|
}, middleHandlerStyle.icon), {
|
|
31075
|
-
pickable: !zoomLock && (null === (
|
|
30861
|
+
pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
|
|
31076
30862
|
}), "symbol");
|
|
31077
30863
|
}
|
|
31078
30864
|
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
31079
30865
|
x: position.x + width / 2,
|
|
31080
30866
|
y: position.y + start * height,
|
|
31081
30867
|
size: width,
|
|
31082
|
-
symbolType: null !== (
|
|
30868
|
+
symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
|
|
31083
30869
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
|
|
31084
|
-
pickable: !zoomLock && (null === (
|
|
30870
|
+
pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
|
|
31085
30871
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
31086
30872
|
x: position.x + width / 2,
|
|
31087
30873
|
y: position.y + end * height,
|
|
31088
30874
|
size: width,
|
|
31089
|
-
symbolType: null !== (
|
|
30875
|
+
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
31090
30876
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
|
|
31091
|
-
pickable: !zoomLock && (null === (
|
|
30877
|
+
pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
|
|
31092
30878
|
}), "symbol");
|
|
31093
30879
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
|
|
31094
30880
|
startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize),
|
|
@@ -31116,9 +30902,107 @@
|
|
|
31116
30902
|
pickable: !zoomLock
|
|
31117
30903
|
}), "rect");
|
|
31118
30904
|
}
|
|
31119
|
-
this._showText && this.renderText();
|
|
31120
30905
|
}
|
|
31121
|
-
|
|
30906
|
+
_renderSelectedBackground() {
|
|
30907
|
+
var _a, _b;
|
|
30908
|
+
const {
|
|
30909
|
+
selectedBackgroundStyle = {},
|
|
30910
|
+
selectedBackgroundChartStyle = {},
|
|
30911
|
+
brushSelect: brushSelect,
|
|
30912
|
+
zoomLock: zoomLock
|
|
30913
|
+
} = this.attribute,
|
|
30914
|
+
{
|
|
30915
|
+
start: start,
|
|
30916
|
+
end: end
|
|
30917
|
+
} = this._getState(),
|
|
30918
|
+
{
|
|
30919
|
+
position: position,
|
|
30920
|
+
width: width,
|
|
30921
|
+
height: height
|
|
30922
|
+
} = this._getLayoutAttrFromConfig(),
|
|
30923
|
+
group = this._getContainer();
|
|
30924
|
+
this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
30925
|
+
x: position.x + start * width,
|
|
30926
|
+
y: position.y,
|
|
30927
|
+
width: (end - start) * width,
|
|
30928
|
+
height: height,
|
|
30929
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
30930
|
+
}, selectedBackgroundStyle), {
|
|
30931
|
+
pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
|
|
30932
|
+
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
30933
|
+
x: position.x,
|
|
30934
|
+
y: position.y + start * height,
|
|
30935
|
+
width: width,
|
|
30936
|
+
height: (end - start) * height,
|
|
30937
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
30938
|
+
}, selectedBackgroundStyle), {
|
|
30939
|
+
pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
|
|
30940
|
+
}), "rect");
|
|
30941
|
+
}
|
|
30942
|
+
_setPreviewAttributes(type, group) {
|
|
30943
|
+
this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
|
|
30944
|
+
pickable: !1
|
|
30945
|
+
}, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
|
|
30946
|
+
curveType: "basis"
|
|
30947
|
+
}, "area");
|
|
30948
|
+
const {
|
|
30949
|
+
backgroundChartStyle = {}
|
|
30950
|
+
} = this.attribute;
|
|
30951
|
+
"line" === type && this._previewLine.setAttributes(Object.assign({
|
|
30952
|
+
points: this._getPreviewLinePoints(),
|
|
30953
|
+
curveType: "basis",
|
|
30954
|
+
pickable: !1
|
|
30955
|
+
}, backgroundChartStyle.line)), "area" === type && this._previewArea.setAttributes(Object.assign({
|
|
30956
|
+
points: this._getPreviewAreaPoints(),
|
|
30957
|
+
curveType: "basis",
|
|
30958
|
+
pickable: !1
|
|
30959
|
+
}, backgroundChartStyle.area));
|
|
30960
|
+
}
|
|
30961
|
+
_setSelectedPreviewClipAttributes(type, group) {
|
|
30962
|
+
this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
|
|
30963
|
+
pickable: !1
|
|
30964
|
+
}, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
|
|
30965
|
+
const {
|
|
30966
|
+
start: start,
|
|
30967
|
+
end: end
|
|
30968
|
+
} = this._getState(),
|
|
30969
|
+
{
|
|
30970
|
+
position: position,
|
|
30971
|
+
width: width,
|
|
30972
|
+
height: height
|
|
30973
|
+
} = this._getLayoutAttrFromConfig();
|
|
30974
|
+
this._selectedPreviewGroupClip.setAttributes({
|
|
30975
|
+
x: this._isHorizontal ? position.x + start * width : position.x,
|
|
30976
|
+
y: this._isHorizontal ? position.y : position.y + start * height,
|
|
30977
|
+
width: this._isHorizontal ? (end - start) * width : width,
|
|
30978
|
+
height: this._isHorizontal ? height : (end - start) * height,
|
|
30979
|
+
clip: !0,
|
|
30980
|
+
pickable: !1
|
|
30981
|
+
}), this._selectedPreviewGroup.setAttributes({
|
|
30982
|
+
x: -(this._isHorizontal ? position.x + start * width : position.x),
|
|
30983
|
+
y: -(this._isHorizontal ? position.y : position.y + start * height),
|
|
30984
|
+
width: this._isHorizontal ? (end - start) * width : width,
|
|
30985
|
+
height: this._isHorizontal ? height : (end - start) * height,
|
|
30986
|
+
pickable: !1
|
|
30987
|
+
});
|
|
30988
|
+
}
|
|
30989
|
+
_setSelectedPreviewAttributes(type) {
|
|
30990
|
+
const {
|
|
30991
|
+
selectedBackgroundChartStyle = {}
|
|
30992
|
+
} = this.attribute;
|
|
30993
|
+
"line" === type ? this._selectedPreviewLine = this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine", {}, "line") : this._selectedPreviewArea = this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea", {
|
|
30994
|
+
curveType: "basis"
|
|
30995
|
+
}, "area"), "line" === type && this._selectedPreviewLine.setAttributes(Object.assign({
|
|
30996
|
+
points: this._getPreviewLinePoints(),
|
|
30997
|
+
curveType: "basis",
|
|
30998
|
+
pickable: !1
|
|
30999
|
+
}, selectedBackgroundChartStyle.line)), "area" === type && this._selectedPreviewArea.setAttributes(Object.assign({
|
|
31000
|
+
points: this._getPreviewAreaPoints(),
|
|
31001
|
+
curveType: "basis",
|
|
31002
|
+
pickable: !1
|
|
31003
|
+
}, selectedBackgroundChartStyle.area));
|
|
31004
|
+
}
|
|
31005
|
+
_computeBasePoints() {
|
|
31122
31006
|
const {
|
|
31123
31007
|
orient: orient
|
|
31124
31008
|
} = this.attribute,
|
|
@@ -31126,7 +31010,7 @@
|
|
|
31126
31010
|
position: position,
|
|
31127
31011
|
width: width,
|
|
31128
31012
|
height: height
|
|
31129
|
-
} = this.
|
|
31013
|
+
} = this._getLayoutAttrFromConfig();
|
|
31130
31014
|
let basePointStart, basePointEnd;
|
|
31131
31015
|
return this._isHorizontal ? (basePointStart = [{
|
|
31132
31016
|
x: position.x,
|
|
@@ -31151,7 +31035,7 @@
|
|
|
31151
31035
|
basePointEnd: basePointEnd
|
|
31152
31036
|
};
|
|
31153
31037
|
}
|
|
31154
|
-
|
|
31038
|
+
_simplifyPoints(points) {
|
|
31155
31039
|
var _a;
|
|
31156
31040
|
if (points.length > 1e4) {
|
|
31157
31041
|
const tolerance = null !== (_a = this.attribute.tolerance) && void 0 !== _a ? _a : this._previewData.length / 1e4;
|
|
@@ -31159,20 +31043,20 @@
|
|
|
31159
31043
|
}
|
|
31160
31044
|
return points;
|
|
31161
31045
|
}
|
|
31162
|
-
|
|
31046
|
+
_getPreviewLinePoints() {
|
|
31163
31047
|
let previewPoints = this._previewData.map(d => ({
|
|
31164
31048
|
x: this._previewPointsX && this._previewPointsX(d),
|
|
31165
31049
|
y: this._previewPointsY && this._previewPointsY(d)
|
|
31166
31050
|
}));
|
|
31167
31051
|
if (0 === previewPoints.length) return previewPoints;
|
|
31168
|
-
previewPoints = this.
|
|
31052
|
+
previewPoints = this._simplifyPoints(previewPoints);
|
|
31169
31053
|
const {
|
|
31170
31054
|
basePointStart: basePointStart,
|
|
31171
31055
|
basePointEnd: basePointEnd
|
|
31172
|
-
} = this.
|
|
31056
|
+
} = this._computeBasePoints();
|
|
31173
31057
|
return basePointStart.concat(previewPoints).concat(basePointEnd);
|
|
31174
31058
|
}
|
|
31175
|
-
|
|
31059
|
+
_getPreviewAreaPoints() {
|
|
31176
31060
|
let previewPoints = this._previewData.map(d => ({
|
|
31177
31061
|
x: this._previewPointsX && this._previewPointsX(d),
|
|
31178
31062
|
y: this._previewPointsY && this._previewPointsY(d),
|
|
@@ -31180,99 +31064,459 @@
|
|
|
31180
31064
|
y1: this._previewPointsY1 && this._previewPointsY1(d)
|
|
31181
31065
|
}));
|
|
31182
31066
|
if (0 === previewPoints.length) return previewPoints;
|
|
31183
|
-
previewPoints = this.
|
|
31067
|
+
previewPoints = this._simplifyPoints(previewPoints);
|
|
31184
31068
|
const {
|
|
31185
31069
|
basePointStart: basePointStart,
|
|
31186
31070
|
basePointEnd: basePointEnd
|
|
31187
|
-
} = this.
|
|
31071
|
+
} = this._computeBasePoints();
|
|
31188
31072
|
return basePointStart.concat(previewPoints).concat(basePointEnd);
|
|
31189
31073
|
}
|
|
31190
|
-
|
|
31191
|
-
|
|
31192
|
-
|
|
31193
|
-
|
|
31194
|
-
|
|
31195
|
-
|
|
31196
|
-
|
|
31197
|
-
|
|
31198
|
-
|
|
31199
|
-
|
|
31200
|
-
|
|
31201
|
-
|
|
31202
|
-
|
|
31203
|
-
|
|
31204
|
-
|
|
31205
|
-
|
|
31206
|
-
|
|
31207
|
-
|
|
31074
|
+
renderText() {
|
|
31075
|
+
let startTextBounds = null,
|
|
31076
|
+
endTextBounds = null;
|
|
31077
|
+
if (this._setTextAttr(startTextBounds, endTextBounds), this._showText) {
|
|
31078
|
+
startTextBounds = this._startText.AABBBounds, endTextBounds = this._endText.AABBBounds, this._setTextAttr(startTextBounds, endTextBounds), startTextBounds = this._startText.AABBBounds, endTextBounds = this._endText.AABBBounds;
|
|
31079
|
+
const {
|
|
31080
|
+
x1: x1,
|
|
31081
|
+
x2: x2,
|
|
31082
|
+
y1: y1,
|
|
31083
|
+
y2: y2
|
|
31084
|
+
} = startTextBounds,
|
|
31085
|
+
{
|
|
31086
|
+
dx: startTextDx = 0,
|
|
31087
|
+
dy: startTextDy = 0
|
|
31088
|
+
} = this.attribute.startTextStyle;
|
|
31089
|
+
if (new Bounds$1().set(x1, y1, x2, y2).intersects(endTextBounds)) {
|
|
31090
|
+
const direction = "bottom" === this.attribute.orient || "right" === this.attribute.orient ? -1 : 1;
|
|
31091
|
+
this._isHorizontal ? this._startText.setAttribute("dy", startTextDy + direction * Math.abs(endTextBounds.y1 - endTextBounds.y2)) : this._startText.setAttribute("dx", startTextDx + direction * Math.abs(endTextBounds.x1 - endTextBounds.x2));
|
|
31092
|
+
} else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
|
|
31093
|
+
}
|
|
31208
31094
|
}
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
pickable: !1
|
|
31212
|
-
}, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group")), "line" === type ? this._selectedPreviewLine = this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine", {}, "line") : this._selectedPreviewArea = this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea", {
|
|
31213
|
-
curveType: "basis"
|
|
31214
|
-
}, "area");
|
|
31095
|
+
_setTextAttr(startTextBounds, endTextBounds) {
|
|
31096
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
31215
31097
|
const {
|
|
31216
|
-
|
|
31098
|
+
startTextStyle: startTextStyle,
|
|
31099
|
+
endTextStyle: endTextStyle
|
|
31217
31100
|
} = this.attribute,
|
|
31101
|
+
{
|
|
31102
|
+
formatMethod: startTextFormat
|
|
31103
|
+
} = startTextStyle,
|
|
31104
|
+
restStartTextStyle = __rest$3(startTextStyle, ["formatMethod"]),
|
|
31105
|
+
{
|
|
31106
|
+
formatMethod: endTextFormat
|
|
31107
|
+
} = endTextStyle,
|
|
31108
|
+
restEndTextStyle = __rest$3(endTextStyle, ["formatMethod"]),
|
|
31218
31109
|
{
|
|
31219
31110
|
start: start,
|
|
31220
31111
|
end: end
|
|
31221
|
-
} = this.
|
|
31222
|
-
|
|
31112
|
+
} = this._getState();
|
|
31113
|
+
this._startValue = this._statePointToData(start), this._endValue = this._statePointToData(end);
|
|
31114
|
+
const {
|
|
31223
31115
|
position: position,
|
|
31224
31116
|
width: width,
|
|
31225
31117
|
height: height
|
|
31226
|
-
} = this.
|
|
31227
|
-
|
|
31228
|
-
|
|
31229
|
-
|
|
31230
|
-
|
|
31231
|
-
|
|
31232
|
-
|
|
31233
|
-
|
|
31234
|
-
|
|
31235
|
-
|
|
31236
|
-
|
|
31237
|
-
|
|
31238
|
-
|
|
31239
|
-
|
|
31240
|
-
|
|
31241
|
-
|
|
31242
|
-
|
|
31243
|
-
|
|
31244
|
-
|
|
31245
|
-
|
|
31246
|
-
|
|
31247
|
-
|
|
31248
|
-
}
|
|
31118
|
+
} = this._getLayoutAttrFromConfig(),
|
|
31119
|
+
startTextValue = startTextFormat ? startTextFormat(this._startValue) : this._startValue,
|
|
31120
|
+
endTextValue = endTextFormat ? endTextFormat(this._endValue) : this._endValue,
|
|
31121
|
+
componentBoundsLike = {
|
|
31122
|
+
x1: position.x,
|
|
31123
|
+
y1: position.y,
|
|
31124
|
+
x2: position.x + width,
|
|
31125
|
+
y2: position.y + height
|
|
31126
|
+
};
|
|
31127
|
+
let startTextPosition, endTextPosition, startTextAlignStyle, endTextAlignStyle;
|
|
31128
|
+
this._isHorizontal ? (startTextPosition = {
|
|
31129
|
+
x: position.x + start * width,
|
|
31130
|
+
y: position.y + height / 2
|
|
31131
|
+
}, endTextPosition = {
|
|
31132
|
+
x: position.x + end * width,
|
|
31133
|
+
y: position.y + height / 2
|
|
31134
|
+
}, startTextAlignStyle = {
|
|
31135
|
+
textAlign: isTextOverflow(componentBoundsLike, startTextBounds, "start", this._isHorizontal) ? "left" : "right",
|
|
31136
|
+
textBaseline: null !== (_b = null === (_a = null == restStartTextStyle ? void 0 : restStartTextStyle.textStyle) || void 0 === _a ? void 0 : _a.textBaseline) && void 0 !== _b ? _b : "middle"
|
|
31137
|
+
}, endTextAlignStyle = {
|
|
31138
|
+
textAlign: isTextOverflow(componentBoundsLike, endTextBounds, "end", this._isHorizontal) ? "right" : "left",
|
|
31139
|
+
textBaseline: null !== (_d = null === (_c = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _c ? void 0 : _c.textBaseline) && void 0 !== _d ? _d : "middle"
|
|
31140
|
+
}) : (startTextPosition = {
|
|
31141
|
+
x: position.x + width / 2,
|
|
31142
|
+
y: position.y + start * height
|
|
31143
|
+
}, endTextPosition = {
|
|
31144
|
+
x: position.x + width / 2,
|
|
31145
|
+
y: position.y + end * height
|
|
31146
|
+
}, startTextAlignStyle = {
|
|
31147
|
+
textAlign: null !== (_f = null === (_e = null == restStartTextStyle ? void 0 : restStartTextStyle.textStyle) || void 0 === _e ? void 0 : _e.textAlign) && void 0 !== _f ? _f : "center",
|
|
31148
|
+
textBaseline: isTextOverflow(componentBoundsLike, startTextBounds, "start", this._isHorizontal) ? "top" : "bottom"
|
|
31149
|
+
}, endTextAlignStyle = {
|
|
31150
|
+
textAlign: null !== (_h = null === (_g = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _g ? void 0 : _g.textAlign) && void 0 !== _h ? _h : "center",
|
|
31151
|
+
textBaseline: isTextOverflow(componentBoundsLike, endTextBounds, "end", this._isHorizontal) ? "bottom" : "top"
|
|
31152
|
+
}), this._startText = this._maybeAddLabel(this._getContainer(), merge$2({}, restStartTextStyle, {
|
|
31153
|
+
text: startTextValue,
|
|
31154
|
+
x: startTextPosition.x,
|
|
31155
|
+
y: startTextPosition.y,
|
|
31156
|
+
visible: this._showText,
|
|
31157
|
+
pickable: !1,
|
|
31158
|
+
childrenPickable: !1,
|
|
31159
|
+
textStyle: startTextAlignStyle
|
|
31160
|
+
}), "data-zoom-start-text"), this._endText = this._maybeAddLabel(this._getContainer(), merge$2({}, restEndTextStyle, {
|
|
31161
|
+
text: endTextValue,
|
|
31162
|
+
x: endTextPosition.x,
|
|
31163
|
+
y: endTextPosition.y,
|
|
31164
|
+
visible: this._showText,
|
|
31165
|
+
pickable: !1,
|
|
31166
|
+
childrenPickable: !1,
|
|
31167
|
+
textStyle: endTextAlignStyle
|
|
31168
|
+
}), "data-zoom-end-text");
|
|
31249
31169
|
}
|
|
31250
|
-
|
|
31251
|
-
let labelShape =
|
|
31252
|
-
return labelShape ? labelShape.setAttributes(attributes) : (labelShape = new Tag$1(attributes), labelShape.name = name
|
|
31170
|
+
_maybeAddLabel(container, attributes, name) {
|
|
31171
|
+
let labelShape = container.find(node => node.name === name, !0);
|
|
31172
|
+
return labelShape ? labelShape.setAttributes(attributes) : (labelShape = new Tag$1(attributes), labelShape.name = name, container.add(labelShape)), labelShape;
|
|
31253
31173
|
}
|
|
31254
|
-
|
|
31174
|
+
}
|
|
31175
|
+
|
|
31176
|
+
const delayMap = {
|
|
31177
|
+
debounce: debounce$2,
|
|
31178
|
+
throttle: throttle$2
|
|
31179
|
+
};
|
|
31180
|
+
class DataZoomInteraction extends EventEmitter {
|
|
31181
|
+
constructor(props) {
|
|
31182
|
+
super(), this._activeState = !1, this._activeCache = {
|
|
31183
|
+
startPos: {
|
|
31184
|
+
x: 0,
|
|
31185
|
+
y: 0
|
|
31186
|
+
},
|
|
31187
|
+
lastPos: {
|
|
31188
|
+
x: 0,
|
|
31189
|
+
y: 0
|
|
31190
|
+
}
|
|
31191
|
+
}, this._layoutCache = {
|
|
31192
|
+
attPos: "x",
|
|
31193
|
+
attSize: "width",
|
|
31194
|
+
size: 0
|
|
31195
|
+
}, this._handleTouchMove = e => {
|
|
31196
|
+
this._activeState && e.preventDefault();
|
|
31197
|
+
}, this._onHandlerPointerDown = (e, tag) => {
|
|
31198
|
+
this.clearDragEvents(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this._eventPosToStagePos(e), this._activeCache.lastPos = this._eventPosToStagePos(e);
|
|
31199
|
+
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
31200
|
+
triggers = getEndTriggersOfDrag();
|
|
31201
|
+
evtTarget.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
31202
|
+
capture: !0
|
|
31203
|
+
}), this.on("pointermove", this._onHandlerPointerMove, {
|
|
31204
|
+
capture: !0
|
|
31205
|
+
}), triggers.forEach(trigger => {
|
|
31206
|
+
evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
|
|
31207
|
+
});
|
|
31208
|
+
}, this._pointerMove = e => {
|
|
31209
|
+
const {
|
|
31210
|
+
brushSelect: brushSelect
|
|
31211
|
+
} = this.attribute,
|
|
31212
|
+
{
|
|
31213
|
+
position: position
|
|
31214
|
+
} = this._getLayoutAttrFromConfig(),
|
|
31215
|
+
pos = this._eventPosToStagePos(e),
|
|
31216
|
+
{
|
|
31217
|
+
attPos: attPos,
|
|
31218
|
+
size: size,
|
|
31219
|
+
attSize: attSize
|
|
31220
|
+
} = this._layoutCache,
|
|
31221
|
+
dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / size,
|
|
31222
|
+
statePos = (pos[attPos] - position[attPos]) / this._getLayoutAttrFromConfig()[attSize];
|
|
31223
|
+
let {
|
|
31224
|
+
start: start,
|
|
31225
|
+
end: end
|
|
31226
|
+
} = this._getState(),
|
|
31227
|
+
shouldRender = !0;
|
|
31228
|
+
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? ({
|
|
31229
|
+
start: start,
|
|
31230
|
+
end: end
|
|
31231
|
+
} = this._moveZoomWithMiddle(dis)) : this._activeTag === DataZoomActiveTag.startHandler ? ({
|
|
31232
|
+
start: start,
|
|
31233
|
+
end: end
|
|
31234
|
+
} = this._moveZoomWithHandler(statePos, "start")) : this._activeTag === DataZoomActiveTag.endHandler ? ({
|
|
31235
|
+
start: start,
|
|
31236
|
+
end: end
|
|
31237
|
+
} = this._moveZoomWithHandler(statePos, "end")) : this._activeTag === DataZoomActiveTag.background && brushSelect && (({
|
|
31238
|
+
start: start,
|
|
31239
|
+
end: end
|
|
31240
|
+
} = this._moveZoomWithBackground(statePos)), shouldRender = !1, this._dispatchEvent(IDataZoomInteractiveEvent.maskUpdate)), this._activeCache.lastPos = pos), this._getState().start === start && this._getState().end === end || (this._setStateAttr(start, end), this._dispatchEvent(IDataZoomInteractiveEvent.stateUpdate, {
|
|
31241
|
+
start: this._getState().start,
|
|
31242
|
+
end: this._getState().end,
|
|
31243
|
+
shouldRender: shouldRender,
|
|
31244
|
+
tag: this._activeTag
|
|
31245
|
+
}), this.attribute.realTime && this._dispatchEvent(IDataZoomInteractiveEvent.dataZoomUpdate, {
|
|
31246
|
+
start: this._getState().start,
|
|
31247
|
+
end: this._getState().end,
|
|
31248
|
+
shouldRender: !0,
|
|
31249
|
+
tag: this._activeTag
|
|
31250
|
+
}));
|
|
31251
|
+
}, this._onHandlerPointerUp = e => {
|
|
31252
|
+
this._activeState && this._activeTag === DataZoomActiveTag.background && (this._setStateAttr(this._getState().start, this._getState().end), this._dispatchEvent(IDataZoomInteractiveEvent.stateUpdate, {
|
|
31253
|
+
start: this._getState().start,
|
|
31254
|
+
end: this._getState().end,
|
|
31255
|
+
shouldRender: !0,
|
|
31256
|
+
tag: this._activeTag
|
|
31257
|
+
})), this._activeState = !1, this._dispatchEvent(IDataZoomInteractiveEvent.dataZoomUpdate, {
|
|
31258
|
+
start: this._getState().start,
|
|
31259
|
+
end: this._getState().end,
|
|
31260
|
+
shouldRender: !0,
|
|
31261
|
+
tag: this._activeTag
|
|
31262
|
+
}), this.clearDragEvents();
|
|
31263
|
+
}, this._initAttrs(props);
|
|
31264
|
+
}
|
|
31265
|
+
setAttributes(props) {
|
|
31266
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31267
|
+
this._initAttrs(props), this._onHandlerPointerMove = 0 === (null !== (_b = null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.delayTime) && void 0 !== _b ? _b : 0) ? this._pointerMove : delayMap[null !== (_d = null === (_c = this.attribute) || void 0 === _c ? void 0 : _c.delayType) && void 0 !== _d ? _d : "debounce"](this._pointerMove, null !== (_f = null === (_e = this.attribute) || void 0 === _e ? void 0 : _e.delayTime) && void 0 !== _f ? _f : 0);
|
|
31268
|
+
}
|
|
31269
|
+
_initAttrs(props) {
|
|
31270
|
+
this.stage = props.stage, this.attribute = props.attribute, this._startHandlerMask = props.startHandlerMask, this._endHandlerMask = props.endHandlerMask, this._middleHandlerSymbol = props.middleHandlerSymbol, this._middleHandlerRect = props.middleHandlerRect, this._selectedBackground = props.selectedBackground, this._background = props.background, this._previewGroup = props.previewGroup, this._selectedPreviewGroup = props.selectedPreviewGroup, this._getLayoutAttrFromConfig = props.getLayoutAttrFromConfig, this._getState = props.getState, this._setState = props.setState;
|
|
31255
31271
|
const {
|
|
31256
|
-
|
|
31257
|
-
|
|
31272
|
+
width: width,
|
|
31273
|
+
height: height
|
|
31274
|
+
} = this._getLayoutAttrFromConfig();
|
|
31275
|
+
this._spanCache = this._getState().end - this._getState().start;
|
|
31276
|
+
const isHorizontal = "top" === this.attribute.orient || "bottom" === this.attribute.orient;
|
|
31277
|
+
this._layoutCache.size = isHorizontal ? width : height, this._layoutCache.attPos = isHorizontal ? "x" : "y", this._layoutCache.attSize = isHorizontal ? "width" : "height", this._getGlobalTransMatrix = props.getGlobalTransMatrix;
|
|
31278
|
+
}
|
|
31279
|
+
clearDragEvents() {
|
|
31280
|
+
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
31281
|
+
triggers = getEndTriggersOfDrag();
|
|
31282
|
+
evtTarget.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
31283
|
+
capture: !0
|
|
31284
|
+
}), triggers.forEach(trigger => {
|
|
31285
|
+
evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
31286
|
+
}), this.off("pointermove", this._onHandlerPointerMove, {
|
|
31287
|
+
capture: !0
|
|
31288
|
+
});
|
|
31289
|
+
}
|
|
31290
|
+
clearVGlobalEvents() {
|
|
31291
|
+
("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
31292
|
+
passive: !1
|
|
31293
|
+
});
|
|
31294
|
+
}
|
|
31295
|
+
bindEvents() {
|
|
31296
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
31297
|
+
const {
|
|
31298
|
+
brushSelect: brushSelect
|
|
31299
|
+
} = this.attribute;
|
|
31300
|
+
null === (_a = this._startHandlerMask) || void 0 === _a || _a.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "start")), null === (_b = this._endHandlerMask) || void 0 === _b || _b.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "end")), null === (_c = this._middleHandlerSymbol) || void 0 === _c || _c.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "middleSymbol")), null === (_d = this._middleHandlerRect) || void 0 === _d || _d.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "middleRect"));
|
|
31301
|
+
const selectedTag = brushSelect ? "background" : "middleRect";
|
|
31302
|
+
null === (_e = this._selectedBackground) || void 0 === _e || _e.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), brushSelect && (null === (_f = this._background) || void 0 === _f || _f.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background"))), brushSelect && (null === (_g = this._previewGroup) || void 0 === _g || _g.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background"))), null === (_h = this._selectedPreviewGroup) || void 0 === _h || _h.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
31303
|
+
passive: !1
|
|
31304
|
+
});
|
|
31305
|
+
}
|
|
31306
|
+
_setStateAttr(start, end) {
|
|
31307
|
+
const {
|
|
31308
|
+
zoomLock = !1,
|
|
31309
|
+
minSpan = 0,
|
|
31310
|
+
maxSpan = 1
|
|
31311
|
+
} = this.attribute,
|
|
31312
|
+
span = end - start;
|
|
31313
|
+
span !== this._spanCache && (zoomLock || span < minSpan || span > maxSpan) || (this._spanCache = span, this._setState({
|
|
31314
|
+
start: start,
|
|
31315
|
+
end: end
|
|
31316
|
+
}));
|
|
31317
|
+
}
|
|
31318
|
+
_moveZoomWithMiddle(dis) {
|
|
31319
|
+
const {
|
|
31320
|
+
start: staetState,
|
|
31321
|
+
end: endState
|
|
31322
|
+
} = this._getState();
|
|
31323
|
+
return dis > 0 && endState + dis > 1 ? dis = 1 - endState : dis < 0 && staetState + dis < 0 && (dis = -staetState), {
|
|
31324
|
+
start: clamp$3(staetState + dis, 0, 1),
|
|
31325
|
+
end: clamp$3(endState + dis, 0, 1)
|
|
31326
|
+
};
|
|
31327
|
+
}
|
|
31328
|
+
_moveZoomWithHandler(statePos, handler) {
|
|
31329
|
+
const {
|
|
31330
|
+
start: start,
|
|
31331
|
+
end: end
|
|
31332
|
+
} = this._getState();
|
|
31333
|
+
let newStart = start,
|
|
31334
|
+
newEnd = end;
|
|
31335
|
+
return "start" === handler ? statePos > end ? (newStart = end, newEnd = statePos, this._activeTag = DataZoomActiveTag.endHandler) : newStart = statePos : "end" === handler && (statePos < start ? (newEnd = start, newStart = statePos, this._activeTag = DataZoomActiveTag.startHandler) : newEnd = statePos), {
|
|
31336
|
+
start: clamp$3(newStart, 0, 1),
|
|
31337
|
+
end: clamp$3(newEnd, 0, 1)
|
|
31338
|
+
};
|
|
31339
|
+
}
|
|
31340
|
+
_moveZoomWithBackground(statePos) {
|
|
31341
|
+
const {
|
|
31342
|
+
position: position
|
|
31343
|
+
} = this._getLayoutAttrFromConfig(),
|
|
31344
|
+
{
|
|
31345
|
+
attSize: attSize
|
|
31346
|
+
} = this._layoutCache,
|
|
31347
|
+
startPos = (this._activeCache.startPos[this._layoutCache.attPos] - position[this._layoutCache.attPos]) / this._getLayoutAttrFromConfig()[attSize],
|
|
31348
|
+
endPos = statePos;
|
|
31349
|
+
let start = clamp$3(startPos, 0, 1),
|
|
31350
|
+
end = clamp$3(endPos, 0, 1);
|
|
31351
|
+
return start > end && ([start, end] = [end, start]), {
|
|
31352
|
+
start: start,
|
|
31353
|
+
end: end
|
|
31354
|
+
};
|
|
31355
|
+
}
|
|
31356
|
+
_eventPosToStagePos(e) {
|
|
31357
|
+
var _a, _b;
|
|
31358
|
+
const result = {
|
|
31359
|
+
x: 0,
|
|
31360
|
+
y: 0
|
|
31361
|
+
},
|
|
31362
|
+
stagePoints = null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventPointTransform(e)) && void 0 !== _b ? _b : {
|
|
31363
|
+
x: 0,
|
|
31364
|
+
y: 0
|
|
31365
|
+
};
|
|
31366
|
+
return this._getGlobalTransMatrix().transformPoint(stagePoints, result), result;
|
|
31367
|
+
}
|
|
31368
|
+
_dispatchEvent(eventName, details) {
|
|
31369
|
+
this.emit(eventName, details);
|
|
31370
|
+
}
|
|
31371
|
+
}
|
|
31372
|
+
|
|
31373
|
+
function loadDataZoomComponent() {
|
|
31374
|
+
loadTagComponent(), registerRect(), registerSymbol(), registerArea(), registerLine();
|
|
31375
|
+
}
|
|
31376
|
+
|
|
31377
|
+
loadDataZoomComponent();
|
|
31378
|
+
class DataZoom extends AbstractComponent {
|
|
31379
|
+
constructor(attributes, options) {
|
|
31380
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, DataZoom.defaultAttributes, attributes)), this.name = "dataZoom", this._state = {
|
|
31381
|
+
start: 0,
|
|
31382
|
+
end: 1
|
|
31383
|
+
}, this.getLayoutAttrFromConfig = () => {
|
|
31384
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31385
|
+
if (this._layoutCacheFromConfig) return this._layoutCacheFromConfig;
|
|
31386
|
+
const {
|
|
31387
|
+
position: positionConfig,
|
|
31388
|
+
size: size,
|
|
31389
|
+
orient: orient,
|
|
31390
|
+
middleHandlerStyle = {},
|
|
31391
|
+
startHandlerStyle = {},
|
|
31392
|
+
endHandlerStyle = {},
|
|
31393
|
+
backgroundStyle = {}
|
|
31394
|
+
} = this.attribute,
|
|
31395
|
+
{
|
|
31396
|
+
width: widthConfig,
|
|
31397
|
+
height: heightConfig
|
|
31398
|
+
} = size,
|
|
31399
|
+
middleHandlerSize = null !== (_b = null === (_a = middleHandlerStyle.background) || void 0 === _a ? void 0 : _a.size) && void 0 !== _b ? _b : 10;
|
|
31400
|
+
let width, height, position;
|
|
31401
|
+
middleHandlerStyle.visible ? this._isHorizontal ? (width = widthConfig, height = heightConfig - middleHandlerSize, position = {
|
|
31402
|
+
x: positionConfig.x,
|
|
31403
|
+
y: positionConfig.y + middleHandlerSize
|
|
31404
|
+
}) : (width = widthConfig - middleHandlerSize, height = heightConfig, position = {
|
|
31405
|
+
x: positionConfig.x + ("left" === orient ? middleHandlerSize : 0),
|
|
31406
|
+
y: positionConfig.y
|
|
31407
|
+
}) : (width = widthConfig, height = heightConfig, position = positionConfig);
|
|
31408
|
+
const startHandlerSize = null !== (_c = startHandlerStyle.size) && void 0 !== _c ? _c : this._isHorizontal ? height : width,
|
|
31409
|
+
endHandlerSize = null !== (_d = endHandlerStyle.size) && void 0 !== _d ? _d : this._isHorizontal ? height : width;
|
|
31410
|
+
return startHandlerStyle.visible && (this._isHorizontal ? (width -= (startHandlerSize + endHandlerSize) / 2, position = {
|
|
31411
|
+
x: position.x + startHandlerSize / 2,
|
|
31412
|
+
y: position.y
|
|
31413
|
+
}) : (height -= (startHandlerSize + endHandlerSize) / 2, position = {
|
|
31414
|
+
x: position.x,
|
|
31415
|
+
y: position.y + startHandlerSize / 2
|
|
31416
|
+
})), height += (null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 2) / 2, width += (null !== (_f = backgroundStyle.lineWidth) && void 0 !== _f ? _f : 2) / 2, this._layoutCacheFromConfig = {
|
|
31417
|
+
position: position,
|
|
31418
|
+
width: width,
|
|
31419
|
+
height: height
|
|
31420
|
+
}, this._layoutCacheFromConfig;
|
|
31421
|
+
};
|
|
31422
|
+
const {
|
|
31423
|
+
start: start,
|
|
31424
|
+
end: end,
|
|
31425
|
+
orient: orient
|
|
31258
31426
|
} = this.attribute;
|
|
31259
|
-
|
|
31427
|
+
this._isHorizontal = "top" === orient || "bottom" === orient, start && (this._state.start = start), end && (this._state.end = end), this._renderer = new DataZoomRenderer(this._getRendererAttrs()), this._interaction = new DataZoomInteraction(this._getInteractionAttrs());
|
|
31428
|
+
}
|
|
31429
|
+
_getRendererAttrs() {
|
|
31430
|
+
return {
|
|
31431
|
+
attribute: this.attribute,
|
|
31432
|
+
getLayoutAttrFromConfig: this.getLayoutAttrFromConfig,
|
|
31433
|
+
setState: state => {
|
|
31434
|
+
this._state = state;
|
|
31435
|
+
},
|
|
31436
|
+
getState: () => this._state,
|
|
31437
|
+
getContainer: () => this._container
|
|
31438
|
+
};
|
|
31439
|
+
}
|
|
31440
|
+
_getInteractionAttrs() {
|
|
31441
|
+
return {
|
|
31442
|
+
stage: this.stage,
|
|
31443
|
+
attribute: this.attribute,
|
|
31444
|
+
startHandlerMask: this._renderer.startHandlerMask,
|
|
31445
|
+
endHandlerMask: this._renderer.endHandlerMask,
|
|
31446
|
+
middleHandlerSymbol: this._renderer.middleHandlerSymbol,
|
|
31447
|
+
middleHandlerRect: this._renderer.middleHandlerRect,
|
|
31448
|
+
selectedBackground: this._renderer.selectedBackground,
|
|
31449
|
+
background: this._renderer.background,
|
|
31450
|
+
previewGroup: this._renderer.previewGroup,
|
|
31451
|
+
selectedPreviewGroup: this._renderer.selectedPreviewGroup,
|
|
31452
|
+
getLayoutAttrFromConfig: this.getLayoutAttrFromConfig,
|
|
31453
|
+
setState: state => {
|
|
31454
|
+
this._state = state;
|
|
31455
|
+
},
|
|
31456
|
+
getState: () => this._state,
|
|
31457
|
+
getGlobalTransMatrix: () => this.globalTransMatrix
|
|
31458
|
+
};
|
|
31459
|
+
}
|
|
31460
|
+
bindEvents() {
|
|
31461
|
+
this.attribute.disableTriggerEvent ? this.setAttribute("childrenPickable", !1) : (this._interaction.bindEvents(), this._interaction.on(IDataZoomInteractiveEvent.stateUpdate, ({
|
|
31462
|
+
shouldRender: shouldRender
|
|
31463
|
+
}) => {
|
|
31464
|
+
shouldRender && this._renderer.renderDataZoom(!0);
|
|
31465
|
+
}), this._interaction.on(IDataZoomInteractiveEvent.dataZoomUpdate, ({
|
|
31260
31466
|
start: start,
|
|
31261
31467
|
end: end,
|
|
31262
|
-
tag:
|
|
31468
|
+
tag: tag
|
|
31469
|
+
}) => {
|
|
31470
|
+
this._dispatchEvent(IDataZoomEvent.dataZoomChange, {
|
|
31471
|
+
start: start,
|
|
31472
|
+
end: end,
|
|
31473
|
+
tag: tag
|
|
31474
|
+
});
|
|
31475
|
+
}), this._interaction.on(IDataZoomInteractiveEvent.maskUpdate, () => {
|
|
31476
|
+
this._renderer.renderDragMask();
|
|
31477
|
+
}), "auto" === this.attribute.showDetail && (this._container.addEventListener("pointerenter", () => {
|
|
31478
|
+
this._renderer.showText = !0, this._renderer.renderText();
|
|
31479
|
+
}), this._container.addEventListener("pointerleave", () => {
|
|
31480
|
+
this._renderer.showText = !1, this._renderer.renderText();
|
|
31263
31481
|
})));
|
|
31264
31482
|
}
|
|
31483
|
+
setAttributes(params, forceUpdateTag) {
|
|
31484
|
+
const {
|
|
31485
|
+
start: start,
|
|
31486
|
+
end: end
|
|
31487
|
+
} = this.attribute;
|
|
31488
|
+
start && (this._state.start = start), end && (this._state.end = end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
|
|
31489
|
+
}
|
|
31490
|
+
render() {
|
|
31491
|
+
this._layoutCacheFromConfig = null, this._container = this.createOrUpdateChild("datazoom-container", {}, "group"), this._renderer.renderDataZoom(), this._interaction.setAttributes(this._getInteractionAttrs());
|
|
31492
|
+
}
|
|
31493
|
+
release(all) {
|
|
31494
|
+
super.release(all), this._interaction.clearDragEvents();
|
|
31495
|
+
}
|
|
31496
|
+
setStartAndEnd(start, end) {
|
|
31497
|
+
const {
|
|
31498
|
+
start: startState,
|
|
31499
|
+
end: endState
|
|
31500
|
+
} = this._state;
|
|
31501
|
+
isValid$5(start) && isValid$5(end) && (start !== startState || end !== endState) && (this._state = {
|
|
31502
|
+
start: start,
|
|
31503
|
+
end: end
|
|
31504
|
+
}, this._renderer.renderDataZoom(!0), this._dispatchEvent(IDataZoomEvent.dataZoomChange, {
|
|
31505
|
+
start: start,
|
|
31506
|
+
end: end
|
|
31507
|
+
}));
|
|
31508
|
+
}
|
|
31265
31509
|
setPreviewData(data) {
|
|
31266
|
-
this.
|
|
31510
|
+
this._renderer.previewData = data;
|
|
31267
31511
|
}
|
|
31268
31512
|
setText(text, tag) {
|
|
31269
|
-
"start" === tag ? this.
|
|
31513
|
+
"start" === tag ? this._renderer.startText.setAttribute("text", text) : this._renderer.endText.setAttribute("text", text);
|
|
31270
31514
|
}
|
|
31271
31515
|
getStartValue() {
|
|
31272
|
-
return this.
|
|
31516
|
+
return this._renderer.startValue;
|
|
31273
31517
|
}
|
|
31274
31518
|
getEndTextValue() {
|
|
31275
|
-
return this.
|
|
31519
|
+
return this._renderer.endValue;
|
|
31276
31520
|
}
|
|
31277
31521
|
getMiddleHandlerSize() {
|
|
31278
31522
|
var _a, _b, _c, _d;
|
|
@@ -31284,24 +31528,19 @@
|
|
|
31284
31528
|
return Math.max(middleHandlerRectSize, ...array$1(middleHandlerSymbolSize));
|
|
31285
31529
|
}
|
|
31286
31530
|
setPreviewPointsX(callback) {
|
|
31287
|
-
isFunction$7(callback) && (this.
|
|
31531
|
+
isFunction$7(callback) && (this._renderer.previewPointsX = callback);
|
|
31288
31532
|
}
|
|
31289
31533
|
setPreviewPointsY(callback) {
|
|
31290
|
-
isFunction$7(callback) && (this.
|
|
31534
|
+
isFunction$7(callback) && (this._renderer.previewPointsY = callback);
|
|
31291
31535
|
}
|
|
31292
31536
|
setPreviewPointsX1(callback) {
|
|
31293
|
-
isFunction$7(callback) && (this.
|
|
31537
|
+
isFunction$7(callback) && (this._renderer.previewPointsX1 = callback);
|
|
31294
31538
|
}
|
|
31295
31539
|
setPreviewPointsY1(callback) {
|
|
31296
|
-
isFunction$7(callback) && (this.
|
|
31540
|
+
isFunction$7(callback) && (this._renderer.previewPointsY1 = callback);
|
|
31297
31541
|
}
|
|
31298
31542
|
setStatePointToData(callback) {
|
|
31299
|
-
isFunction$7(callback) && (this.
|
|
31300
|
-
}
|
|
31301
|
-
release(all) {
|
|
31302
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
31303
|
-
passive: !1
|
|
31304
|
-
}), this._clearDragEvents();
|
|
31543
|
+
isFunction$7(callback) && (this._renderer.statePointToData = callback);
|
|
31305
31544
|
}
|
|
31306
31545
|
}
|
|
31307
31546
|
DataZoom.defaultAttributes = DEFAULT_DATA_ZOOM_ATTRIBUTES;
|
|
@@ -35845,6 +36084,7 @@
|
|
|
35845
36084
|
gantt.parsedOptions.startDateField = options.taskBar?.startDateField ?? 'startDate';
|
|
35846
36085
|
gantt.parsedOptions.endDateField = options.taskBar?.endDateField ?? 'endDate';
|
|
35847
36086
|
gantt.parsedOptions.progressField = options.taskBar?.progressField ?? 'progress';
|
|
36087
|
+
gantt.parsedOptions.taskBarClip = options?.taskBar?.clip ?? true;
|
|
35848
36088
|
gantt.parsedOptions.projectSubTasksExpandable = options?.projectSubTasksExpandable ?? true;
|
|
35849
36089
|
const { unit: minTimeUnit, startOfWeek, step } = gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
35850
36090
|
gantt.parsedOptions.minDate = options?.minDate
|
|
@@ -38450,7 +38690,7 @@
|
|
|
38450
38690
|
maxing = !1,
|
|
38451
38691
|
leading = !1,
|
|
38452
38692
|
trailing = !0;
|
|
38453
|
-
const useRAF = !wait && 0 !== wait && "function" == typeof
|
|
38693
|
+
const useRAF = !wait && 0 !== wait && "function" == typeof vglobal.getRequestAnimationFrame();
|
|
38454
38694
|
if ("function" != typeof func) throw new TypeError("Expected a function");
|
|
38455
38695
|
function invokeFunc(time) {
|
|
38456
38696
|
const args = lastArgs,
|
|
@@ -38458,7 +38698,7 @@
|
|
|
38458
38698
|
return lastThis = void 0, lastArgs = void 0, lastInvokeTime = time, result = func.apply(thisArg, args), result;
|
|
38459
38699
|
}
|
|
38460
38700
|
function startTimer(pendingFunc, wait) {
|
|
38461
|
-
return useRAF ?
|
|
38701
|
+
return useRAF ? vglobal.getRequestAnimationFrame()(pendingFunc) : setTimeout(pendingFunc, wait);
|
|
38462
38702
|
}
|
|
38463
38703
|
function shouldInvoke(time) {
|
|
38464
38704
|
const timeSinceLastCall = time - lastCallTime;
|
|
@@ -46387,14 +46627,15 @@
|
|
|
46387
46627
|
symbolX = 0,
|
|
46388
46628
|
symbolY = 0,
|
|
46389
46629
|
symbolRotate = Math.PI;
|
|
46390
|
-
const linePoints = []
|
|
46391
|
-
|
|
46630
|
+
const linePoints = [],
|
|
46631
|
+
movingColumnOrRow = this.table.stateManager.columnMove.movingColumnOrRow;
|
|
46632
|
+
return "columnHeader" === cellLocation && void 0 === movingColumnOrRow || "column" === movingColumnOrRow ? (rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos, rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1), rectHeight = this.table.tableNoFrameHeight, rectWidth = mergeInfo ? this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col) : this.table.getColWidth(col), rectDx = rectX - delta, symbolX = rectX + rectWidth, symbolY = 2, linePoints.push({
|
|
46392
46633
|
x: 0,
|
|
46393
46634
|
y: 0
|
|
46394
46635
|
}), linePoints.push({
|
|
46395
46636
|
x: 0,
|
|
46396
46637
|
y: this.table.tableNoFrameHeight
|
|
46397
|
-
})) : ("rowHeader" === cellLocation || this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) && (rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos, rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1), rectWidth = this.table.tableNoFrameWidth, rectHeight = mergeInfo ? this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row) : this.table.getRowHeight(row), rectDy = rectY - delta, symbolX = 2, symbolY = rectY + rectHeight, symbolRotate = Math.PI / 2, linePoints.push({
|
|
46638
|
+
})) : ("rowHeader" === cellLocation || this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) || "row" === movingColumnOrRow) && (rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos, rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1), rectWidth = this.table.tableNoFrameWidth, rectHeight = mergeInfo ? this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row) : this.table.getRowHeight(row), rectDy = rectY - delta, symbolX = 2, symbolY = rectY + rectHeight, symbolRotate = Math.PI / 2, linePoints.push({
|
|
46398
46639
|
x: 0,
|
|
46399
46640
|
y: 0
|
|
46400
46641
|
}), linePoints.push({
|
|
@@ -47378,7 +47619,7 @@
|
|
|
47378
47619
|
isValid$3(count) && (batchRenderChartCount = count);
|
|
47379
47620
|
}
|
|
47380
47621
|
function clearChartRenderQueue() {
|
|
47381
|
-
chartRenderKeys = [], chartRenderQueueList = [], isHandlingChartQueue = !1,
|
|
47622
|
+
chartRenderKeys = [], chartRenderQueueList = [], isHandlingChartQueue = !1, vglobal.getCancelAnimationFrame()(requestAnimationFrameId);
|
|
47382
47623
|
}
|
|
47383
47624
|
function IsHandlingChartQueue() {
|
|
47384
47625
|
return isHandlingChartQueue;
|
|
@@ -47457,7 +47698,7 @@
|
|
|
47457
47698
|
tickMode: null === (_e = axis.tick) || void 0 === _e ? void 0 : _e.tickMode
|
|
47458
47699
|
}
|
|
47459
47700
|
}, !0);
|
|
47460
|
-
}), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
47701
|
+
}), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.getChart().setLayoutTag(!0), chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
47461
47702
|
const dataBatch = [];
|
|
47462
47703
|
for (const dataIdStr in dataId) {
|
|
47463
47704
|
const dataIdAndField = dataId[dataIdStr],
|
|
@@ -47471,7 +47712,7 @@
|
|
|
47471
47712
|
fields: null === (_e = null == series ? void 0 : series.data) || void 0 === _e ? void 0 : _e.fields
|
|
47472
47713
|
}), chartInstance.updateFullDataSync || chartInstance.updateDataSync(dataIdStr, dataIdAndField ? null !== (_f = null == data ? void 0 : data.filter(item => item.hasOwnProperty(dataIdAndField))) && void 0 !== _f ? _f : [] : null != data ? data : []);
|
|
47473
47714
|
}
|
|
47474
|
-
null === (_g = chartInstance.updateFullDataSync) || void 0 === _g || _g.call(chartInstance, dataBatch);
|
|
47715
|
+
chartInstance.getChart().setLayoutTag(!0), null === (_g = chartInstance.updateFullDataSync) || void 0 === _g || _g.call(chartInstance, dataBatch);
|
|
47475
47716
|
}
|
|
47476
47717
|
table.fireListeners("before_cache_chart_image", {
|
|
47477
47718
|
chartInstance: chartInstance
|
|
@@ -47479,7 +47720,7 @@
|
|
|
47479
47720
|
cacheStageCanvas(chartInstance.getStage(), chart);
|
|
47480
47721
|
}
|
|
47481
47722
|
function startRenderChartQueue(table) {
|
|
47482
|
-
isHandlingChartQueue = !0, chartRenderQueueList.length > 0 ? requestAnimationFrameId =
|
|
47723
|
+
isHandlingChartQueue = !0, chartRenderQueueList.length > 0 ? requestAnimationFrameId = vglobal.getRequestAnimationFrame()(() => {
|
|
47483
47724
|
const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);
|
|
47484
47725
|
chartRenderKeys.splice(0, batchRenderChartCount), chartsToRender.forEach(chart => {
|
|
47485
47726
|
renderChart(chart), chart.addUpdateBoundTag();
|
|
@@ -48418,10 +48659,12 @@
|
|
|
48418
48659
|
actualWidth = 0;
|
|
48419
48660
|
for (let col = 0; col < table.colCount; col++) {
|
|
48420
48661
|
const colWidth = update && null !== (_f = newWidths[col]) && void 0 !== _f ? _f : table.getColWidth(col);
|
|
48421
|
-
(col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
|
|
48662
|
+
"only-body" === table.widthAdaptiveMode && (col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
|
|
48422
48663
|
}
|
|
48423
48664
|
if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
|
|
48424
|
-
|
|
48665
|
+
let startCol = 0,
|
|
48666
|
+
endCol = table.colCount;
|
|
48667
|
+
"only-body" === table.widthAdaptiveMode && (startCol = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount), getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
|
|
48425
48668
|
}
|
|
48426
48669
|
}
|
|
48427
48670
|
if (update) {
|
|
@@ -52106,12 +52349,12 @@
|
|
|
52106
52349
|
actualWidth = 0;
|
|
52107
52350
|
for (let col = 0; col < table.colCount; col++) {
|
|
52108
52351
|
const colWidth = table.getColWidth(col);
|
|
52109
|
-
(col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
|
|
52352
|
+
"only-body" === table.widthAdaptiveMode && (col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
|
|
52110
52353
|
}
|
|
52111
52354
|
if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
|
|
52112
|
-
|
|
52113
|
-
endCol = table.
|
|
52114
|
-
getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
|
|
52355
|
+
let startCol = 0,
|
|
52356
|
+
endCol = table.colCount;
|
|
52357
|
+
"only-body" === table.widthAdaptiveMode && (startCol = table.rowHeaderLevelCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount), getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
|
|
52115
52358
|
}
|
|
52116
52359
|
}
|
|
52117
52360
|
let bodyWidth = 0;
|
|
@@ -53076,24 +53319,26 @@
|
|
|
53076
53319
|
return target;
|
|
53077
53320
|
}
|
|
53078
53321
|
|
|
53079
|
-
function startMoveCol(col, row, x, y, state, event) {
|
|
53322
|
+
function startMoveCol(col, row, x, y, state, event, dragColumnOrRow) {
|
|
53080
53323
|
var _a;
|
|
53081
53324
|
if (!("canMoveHeaderPosition" in state.table.internalProps.layoutMap)) return;
|
|
53082
|
-
if (state.columnMove.moving = !0, state.columnMove.colSource = col, state.columnMove.rowSource = row, state.table.isListTable()) {
|
|
53325
|
+
if (state.columnMove.movingColumnOrRow = dragColumnOrRow, state.columnMove.moving = !0, state.columnMove.colSource = col, state.columnMove.rowSource = row, state.table.isListTable()) {
|
|
53083
53326
|
const nodeIndex = state.table.getRecordIndexByCell(col, row),
|
|
53084
53327
|
nodeData = state.table.getRecordByCell(col, row),
|
|
53085
53328
|
hierarchyState = state.table.getRecordHierarchyState(col, row);
|
|
53086
53329
|
state.columnMove.rowSourceSize = computeChildrenNodeLength(nodeIndex, hierarchyState, nodeData) + 1;
|
|
53087
53330
|
}
|
|
53088
|
-
|
|
53089
|
-
|
|
53090
|
-
|
|
53091
|
-
|
|
53092
|
-
|
|
53093
|
-
|
|
53094
|
-
|
|
53095
|
-
|
|
53096
|
-
|
|
53331
|
+
let delta;
|
|
53332
|
+
if (state.columnMove.x = x - state.table.tableX, state.columnMove.y = y - state.table.tableY, "column" === dragColumnOrRow) delta = state.columnMove.x;else if ("row" === dragColumnOrRow) delta = state.columnMove.y;else {
|
|
53333
|
+
const cellLocation = state.table.getCellLocation(col, row);
|
|
53334
|
+
delta = "columnHeader" === cellLocation ? state.columnMove.x : "rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ? state.columnMove.y : 0;
|
|
53335
|
+
}
|
|
53336
|
+
const {
|
|
53337
|
+
backX: backX,
|
|
53338
|
+
lineX: lineX,
|
|
53339
|
+
backY: backY,
|
|
53340
|
+
lineY: lineY
|
|
53341
|
+
} = state.table.scenegraph.component.showMoveCol(col, row, delta);
|
|
53097
53342
|
state.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, {
|
|
53098
53343
|
col: col,
|
|
53099
53344
|
row: row,
|
|
@@ -53103,7 +53348,8 @@
|
|
|
53103
53348
|
lineX: lineX,
|
|
53104
53349
|
backY: backY,
|
|
53105
53350
|
lineY: lineY,
|
|
53106
|
-
event: event
|
|
53351
|
+
event: event,
|
|
53352
|
+
movingColumnOrRow: dragColumnOrRow
|
|
53107
53353
|
});
|
|
53108
53354
|
const isHasSelected = !!(null === (_a = state.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
53109
53355
|
state.table.stateManager.updateSelectPos(-1, -1), state.table.stateManager.endSelectCells(!0, isHasSelected), state.table.scenegraph.updateNextFrame();
|
|
@@ -53133,7 +53379,7 @@
|
|
|
53133
53379
|
let lineX, backX, lineY, backY;
|
|
53134
53380
|
state.updateCursor("grabbing");
|
|
53135
53381
|
const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
|
|
53136
|
-
"columnHeader" === cellLocation ? (backX = state.columnMove.x, lineX = state.table.isLeftFrozenColumn(col) ? state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1) : state.table.isRightFrozenColumn(col) ? state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1) : (state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1)) - state.table.stateManager.scroll.horizontalBarPos) : ("rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) && (backY = state.columnMove.y, lineY = state.table.isFrozenRow(row) ? state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1) : state.table.isBottomFrozenRow(row) ? state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1) : (state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) - state.table.stateManager.scroll.verticalBarPos), state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY), state.table.fireListeners(TABLE_EVENT_TYPE.CHANGING_HEADER_POSITION, {
|
|
53382
|
+
"columnHeader" === cellLocation ? (backX = state.columnMove.x, lineX = state.table.isLeftFrozenColumn(col) ? state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1) : state.table.isRightFrozenColumn(col) ? state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1) : (state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1)) - state.table.stateManager.scroll.horizontalBarPos) : ("rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) || "row" === state.columnMove.movingColumnOrRow) && (backY = state.columnMove.y, lineY = state.table.isFrozenRow(row) ? state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1) : state.table.isBottomFrozenRow(row) ? state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1) : (state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) - state.table.stateManager.scroll.verticalBarPos), state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY), state.table.fireListeners(TABLE_EVENT_TYPE.CHANGING_HEADER_POSITION, {
|
|
53137
53383
|
col: col,
|
|
53138
53384
|
row: row,
|
|
53139
53385
|
x: x,
|
|
@@ -53142,14 +53388,15 @@
|
|
|
53142
53388
|
lineX: lineX,
|
|
53143
53389
|
backY: backY,
|
|
53144
53390
|
lineY: lineY,
|
|
53145
|
-
event: event
|
|
53391
|
+
event: event,
|
|
53392
|
+
movingColumnOrRow: state.columnMove.movingColumnOrRow
|
|
53146
53393
|
}), state.table.scenegraph.updateNextFrame();
|
|
53147
53394
|
} else state.updateCursor("not-allowed"), state.columnMove.colTarget = state.columnMove.colSource, state.columnMove.rowTarget = state.columnMove.rowSource;
|
|
53148
53395
|
}
|
|
53149
53396
|
function endMoveCol(state) {
|
|
53150
53397
|
var _a, _b;
|
|
53151
53398
|
let moveColResult = !1;
|
|
53152
|
-
if ("canMoveHeaderPosition" in state.table.internalProps.layoutMap && state.columnMove.moving && state.columnMove.colSource >= 0 && state.columnMove.rowSource >= 0 && state.columnMove.colTarget >= 0 && state.columnMove.rowTarget >= 0 && !0 !== (null === (_a = state.table.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) {
|
|
53399
|
+
if ("canMoveHeaderPosition" in state.table.internalProps.layoutMap && state.columnMove.moving && (state.columnMove.colSource >= 0 || "row" === state.columnMove.movingColumnOrRow) && (state.columnMove.rowSource >= 0 || "column" === state.columnMove.movingColumnOrRow) && (state.columnMove.colTarget >= 0 || "row" === state.columnMove.movingColumnOrRow) && (state.columnMove.rowTarget >= 0 || "column" === state.columnMove.movingColumnOrRow) && !0 !== (null === (_a = state.table.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) {
|
|
53153
53400
|
const oldSourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource),
|
|
53154
53401
|
oldTargetMergeInfo = state.table.getCellRange(state.columnMove.colTarget, state.columnMove.rowTarget),
|
|
53155
53402
|
moveContext = state.table._moveHeaderPosition({
|
|
@@ -53159,7 +53406,9 @@
|
|
|
53159
53406
|
col: state.columnMove.colTarget,
|
|
53160
53407
|
row: state.columnMove.rowTarget
|
|
53161
53408
|
});
|
|
53162
|
-
if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return state.updateCursor(), state.columnMove.moving = !1,
|
|
53409
|
+
if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return state.updateCursor(), state.columnMove.moving = !1, setTimeout(() => {
|
|
53410
|
+
delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget, state.columnMove.movingColumnOrRow = void 0;
|
|
53411
|
+
}, 0), state.table.scenegraph.component.hideMoveCol(), state.table.scenegraph.updateNextFrame(), !1;
|
|
53163
53412
|
{
|
|
53164
53413
|
state.table.internalProps.useOneRowHeightFillAll = !1, state.table.internalProps.layoutMap.clearCellRangeMap();
|
|
53165
53414
|
const sourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource),
|
|
@@ -53168,11 +53417,11 @@
|
|
|
53168
53417
|
colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col),
|
|
53169
53418
|
rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
|
|
53170
53419
|
let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
|
|
53171
|
-
"row" === moveContext.moveType && "tree" === state.table.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1),
|
|
53420
|
+
"row" === moveContext.moveType && "tree" === state.table.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), state.table.transpose || !state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) && "row" !== state.columnMove.movingColumnOrRow || (state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), state.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)), "column" === moveContext.moveType ? clearWidthsAndHeightsCache(colMin, colMax, 0, -1, state.table) : clearWidthsAndHeightsCache(0, -1, rowMin, rowMax, state.table), state.table.clearCellStyleCache(), state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) || "row" === state.columnMove.movingColumnOrRow ? state.table.scenegraph.updateHeaderPosition(state.table.scenegraph.proxy.colStart, state.table.scenegraph.proxy.colEnd, state.table.scenegraph.proxy.rowStart, state.table.scenegraph.proxy.rowEnd, moveContext.moveType) : "column" === moveContext.moveType ? state.table.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : state.table.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType), "adjustFrozenCount" === state.table.internalProps.frozenColDragHeaderMode && state.table.isListTable() && (state.table.isLeftFrozenColumn(state.columnMove.colTarget) && !state.table.isLeftFrozenColumn(state.columnMove.colSource) ? state.table.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isLeftFrozenColumn(state.columnMove.colSource) && !state.table.isLeftFrozenColumn(state.columnMove.colTarget) && (state.table.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1), state.table.isRightFrozenColumn(state.columnMove.colTarget) && !state.table.isRightFrozenColumn(state.columnMove.colSource) ? state.table.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isRightFrozenColumn(state.columnMove.colSource) && !state.table.isRightFrozenColumn(state.columnMove.colTarget) && (state.table.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)), moveColResult = !0;
|
|
53172
53421
|
}
|
|
53173
53422
|
}
|
|
53174
53423
|
return state.columnMove.moving = !1, setTimeout(() => {
|
|
53175
|
-
delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget;
|
|
53424
|
+
delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget, state.columnMove.movingColumnOrRow = void 0;
|
|
53176
53425
|
}, 0), state.table.scenegraph.component.hideMoveCol(), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? (state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen), state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount)) : state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount) : state.table.options.frozenColCount ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1) : state.table.options.rightFrozenColCount && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame(), !0 === (null === (_b = state.table.options.customConfig) || void 0 === _b ? void 0 : _b.notUpdateInColumnRowMove) || moveColResult;
|
|
53177
53426
|
}
|
|
53178
53427
|
function clearWidthsAndHeightsCache(colMin, colMax, rowMin, rowMax, table) {
|
|
@@ -53210,6 +53459,7 @@
|
|
|
53210
53459
|
}
|
|
53211
53460
|
|
|
53212
53461
|
function updateResizeColumn(xInTable, yInTable, state) {
|
|
53462
|
+
var _a;
|
|
53213
53463
|
xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
|
|
53214
53464
|
let detaX = state.columnResize.isRightFrozen ? state.columnResize.x - xInTable : xInTable - state.columnResize.x;
|
|
53215
53465
|
if (Math.abs(detaX) < 1) return;
|
|
@@ -53234,7 +53484,9 @@
|
|
|
53234
53484
|
}
|
|
53235
53485
|
rightColWidth - detaX < state.table.internalProps.limitMinWidth && (detaX = rightColWidth - state.table.internalProps.limitMinWidth);
|
|
53236
53486
|
}
|
|
53237
|
-
detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.table._updateSize(),
|
|
53487
|
+
detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.table._updateSize(), null === (_a = state.table.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
|
|
53488
|
+
null == legend || legend.resize();
|
|
53489
|
+
}), state.table.internalProps.title && state.table.internalProps.title.resize(), state.table.internalProps.emptyTip && state.table.internalProps.emptyTip.resize(), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.table.options.frozenColCount && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1), (state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose || state.table.options.rightFrozenColCount) && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame();
|
|
53238
53490
|
}
|
|
53239
53491
|
function updateResizeColForColumn(detaX, state) {
|
|
53240
53492
|
"adaptive" === state.table.widthMode && state.columnResize.col < state.table.colCount - 1 ? (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.scenegraph.updateColWidth(state.columnResize.col + 1, -detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col), state.table.internalProps._widthResizedColMap.add(state.columnResize.col + 1)) : (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col));
|
|
@@ -53548,6 +53800,7 @@
|
|
|
53548
53800
|
}
|
|
53549
53801
|
|
|
53550
53802
|
function updateResizeRow(xInTable, yInTable, state) {
|
|
53803
|
+
var _a;
|
|
53551
53804
|
xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
|
|
53552
53805
|
let detaY = state.rowResize.isBottomFrozen ? state.rowResize.y - yInTable : yInTable - state.rowResize.y;
|
|
53553
53806
|
if (Math.abs(detaY) < 1) return;
|
|
@@ -53557,7 +53810,9 @@
|
|
|
53557
53810
|
let bottomRowHeight = state.table.getRowHeight(state.rowResize.row + 1);
|
|
53558
53811
|
bottomRowHeight -= detaY, bottomRowHeight - detaY < state.table.internalProps.limitMinHeight && (detaY = bottomRowHeight - state.table.internalProps.limitMinHeight);
|
|
53559
53812
|
}
|
|
53560
|
-
detaY = Math.ceil(detaY), state.rowResize.row < state.table.columnHeaderLevelCount || state.rowResize.row >= state.table.rowCount - state.table.bottomFrozenRowCount ? updateResizeColForRow(detaY, state) : "indicator" === state.table.internalProps.rowResizeType ? updateResizeColForIndicator(detaY, state) : "indicatorGroup" === state.table.internalProps.rowResizeType ? updateResizeColForIndicatorGroup(detaY, state) : "all" === state.table.internalProps.rowResizeType ? updateResizeColForAll(detaY, state) : updateResizeColForRow(detaY, state), state.rowResize.y = yInTable, state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen), state.table._updateSize(), state.table.
|
|
53813
|
+
detaY = Math.ceil(detaY), state.rowResize.row < state.table.columnHeaderLevelCount || state.rowResize.row >= state.table.rowCount - state.table.bottomFrozenRowCount ? updateResizeColForRow(detaY, state) : "indicator" === state.table.internalProps.rowResizeType ? updateResizeColForIndicator(detaY, state) : "indicatorGroup" === state.table.internalProps.rowResizeType ? updateResizeColForIndicatorGroup(detaY, state) : "all" === state.table.internalProps.rowResizeType ? updateResizeColForAll(detaY, state) : updateResizeColForRow(detaY, state), state.rowResize.y = yInTable, state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen), state.table._updateSize(), null === (_a = state.table.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
|
|
53814
|
+
null == legend || legend.resize();
|
|
53815
|
+
}), state.table.internalProps.title && state.table.internalProps.title.resize(), state.table.internalProps.emptyTip && state.table.internalProps.emptyTip.resize(), state.table.scenegraph.updateNextFrame();
|
|
53561
53816
|
}
|
|
53562
53817
|
function updateResizeColForRow(detaY, state) {
|
|
53563
53818
|
"adaptive" === state.table.heightMode && state.rowResize.row < state.table.rowCount - 1 ? (state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY), state.table.scenegraph.updateRowHeight(state.rowResize.row + 1, -detaY), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row + 1)) : (state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row));
|
|
@@ -53729,7 +53984,8 @@
|
|
|
53729
53984
|
rowTargetSize: 0,
|
|
53730
53985
|
x: 0,
|
|
53731
53986
|
y: 0,
|
|
53732
|
-
moving: !1
|
|
53987
|
+
moving: !1,
|
|
53988
|
+
movingColumnOrRow: void 0
|
|
53733
53989
|
}, this.menu = {
|
|
53734
53990
|
x: -1,
|
|
53735
53991
|
y: -1,
|
|
@@ -53796,7 +54052,8 @@
|
|
|
53796
54052
|
rowTargetSize: 0,
|
|
53797
54053
|
x: 0,
|
|
53798
54054
|
y: 0,
|
|
53799
|
-
moving: !1
|
|
54055
|
+
moving: !1,
|
|
54056
|
+
movingColumnOrRow: void 0
|
|
53800
54057
|
}, this.menu = {
|
|
53801
54058
|
x: -1,
|
|
53802
54059
|
y: -1,
|
|
@@ -53963,7 +54220,7 @@
|
|
|
53963
54220
|
if (this.select.selecting) {
|
|
53964
54221
|
if (this.select.selecting = !1, 0 === this.select.ranges.length) return;
|
|
53965
54222
|
const currentRange = this.select.ranges[this.select.ranges.length - 1];
|
|
53966
|
-
this.table.isSeriesNumber(this.select.cellPos.col, this.select.cellPos.row) || this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row) || expendCellRange(currentRange, this.table);
|
|
54223
|
+
this.table.isSeriesNumber(this.select.cellPos.col, this.select.cellPos.row) || this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row) || this.table.isSeriesNumberInBody(currentRange.start.col, currentRange.start.row) || expendCellRange(currentRange, this.table);
|
|
53967
54224
|
let isSame = !1;
|
|
53968
54225
|
for (let i = 0; i < this.select.ranges.length - 1; i++) {
|
|
53969
54226
|
const range = this.select.ranges[i];
|
|
@@ -54019,8 +54276,8 @@
|
|
|
54019
54276
|
direction: this.fillHandle.direction
|
|
54020
54277
|
}), this.fillHandle.beforeFillMaxCol = void 0, this.fillHandle.beforeFillMaxRow = void 0, this.fillHandle.beforeFillMinCol = void 0, this.fillHandle.beforeFillMinRow = void 0;
|
|
54021
54278
|
}
|
|
54022
|
-
startMoveCol(col, row, x, y, event) {
|
|
54023
|
-
startMoveCol(col, row, x, y, this, event);
|
|
54279
|
+
startMoveCol(col, row, x, y, event, dragColumnOrRow) {
|
|
54280
|
+
startMoveCol(col, row, x, y, this, event, dragColumnOrRow);
|
|
54024
54281
|
}
|
|
54025
54282
|
updateMoveCol(col, row, x, y, event) {
|
|
54026
54283
|
updateMoveCol(col, row, x, y, this, event);
|
|
@@ -54677,7 +54934,7 @@
|
|
|
54677
54934
|
this.scrollHandle = scrollHandle;
|
|
54678
54935
|
}
|
|
54679
54936
|
startInertia(speedX, speedY, friction) {
|
|
54680
|
-
this.lastTime = Date.now(), this.speedX = speedX, this.speedY = speedY, this.friction = friction, this.runingId || (this.runingId =
|
|
54937
|
+
this.lastTime = Date.now(), this.speedX = speedX, this.speedY = speedY, this.friction = friction, this.runingId || (this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this)));
|
|
54681
54938
|
}
|
|
54682
54939
|
inertia() {
|
|
54683
54940
|
var _a;
|
|
@@ -54689,10 +54946,10 @@
|
|
|
54689
54946
|
newSpeedY = f * this.speedY;
|
|
54690
54947
|
let dx = 0,
|
|
54691
54948
|
dy = 0;
|
|
54692
|
-
Math.abs(newSpeedX) > .05 && (stopped = !1, dx = (this.speedX + newSpeedX) / 2 * dffTime), Math.abs(newSpeedY) > .05 && (stopped = !1, dy = (this.speedY + newSpeedY) / 2 * dffTime), null === (_a = this.scrollHandle) || void 0 === _a || _a.call(this, dx, dy), stopped ? this.runingId = null : (this.lastTime = now, this.speedX = newSpeedX, this.speedY = newSpeedY, this.runingId =
|
|
54949
|
+
Math.abs(newSpeedX) > .05 && (stopped = !1, dx = (this.speedX + newSpeedX) / 2 * dffTime), Math.abs(newSpeedY) > .05 && (stopped = !1, dy = (this.speedY + newSpeedY) / 2 * dffTime), null === (_a = this.scrollHandle) || void 0 === _a || _a.call(this, dx, dy), stopped ? this.runingId = null : (this.lastTime = now, this.speedX = newSpeedX, this.speedY = newSpeedY, this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this)));
|
|
54693
54950
|
}
|
|
54694
54951
|
endInertia() {
|
|
54695
|
-
|
|
54952
|
+
vglobal.getCancelAnimationFrame()(this.runingId), this.runingId = null;
|
|
54696
54953
|
}
|
|
54697
54954
|
isInertiaScrolling() {
|
|
54698
54955
|
return !!this.runingId;
|
|
@@ -54707,7 +54964,8 @@
|
|
|
54707
54964
|
colSource: colSource,
|
|
54708
54965
|
rowSource: rowSource,
|
|
54709
54966
|
colTarget: colTarget,
|
|
54710
|
-
rowTarget: rowTarget
|
|
54967
|
+
rowTarget: rowTarget,
|
|
54968
|
+
movingColumnOrRow: movingColumnOrRow
|
|
54711
54969
|
} = table.stateManager.columnMove,
|
|
54712
54970
|
rowSourceSize = null !== (_e = table.stateManager.columnMove.rowSourceSize) && void 0 !== _e ? _e : 0,
|
|
54713
54971
|
rowTargetSize = null !== (_f = table.stateManager.columnMove.rowTargetSize) && void 0 !== _f ? _f : 0;
|
|
@@ -54720,6 +54978,7 @@
|
|
|
54720
54978
|
col: colSource,
|
|
54721
54979
|
row: rowSource
|
|
54722
54980
|
},
|
|
54981
|
+
movingColumnOrRow: movingColumnOrRow,
|
|
54723
54982
|
event: e
|
|
54724
54983
|
});
|
|
54725
54984
|
}
|
|
@@ -54735,6 +54994,7 @@
|
|
|
54735
54994
|
col: table.stateManager.columnMove.colSource,
|
|
54736
54995
|
row: table.stateManager.columnMove.rowSource
|
|
54737
54996
|
},
|
|
54997
|
+
movingColumnOrRow: table.stateManager.columnMove.movingColumnOrRow,
|
|
54738
54998
|
event: e
|
|
54739
54999
|
});
|
|
54740
55000
|
}
|
|
@@ -54760,7 +55020,7 @@
|
|
|
54760
55020
|
event: e.nativeEvent,
|
|
54761
55021
|
target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
|
|
54762
55022
|
mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
|
|
54763
|
-
}), stateManager.interactionState === InteractionState.grabing) return void (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1 && (stateManager.isResizeCol() || stateManager.isResizeRow() ||
|
|
55023
|
+
}), stateManager.interactionState === InteractionState.grabing) return void (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1 && (stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || (stateManager.isFillHandle() ? eventManager.dealFillSelect(eventArgsSet, !0) : (null === (_g = table.options.select) || void 0 === _g ? void 0 : _g.disableDragSelect) || eventManager.dealTableSelect(eventArgsSet, !0))));
|
|
54764
55024
|
!(null === (_h = table.options.select) || void 0 === _h ? void 0 : _h.disableDragSelect) && table.eventManager.isDraging && stateManager.isSelecting() && !(null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) && eventManager.dealTableSelect(eventArgsSet, !0);
|
|
54765
55025
|
const cellGoup = e.path.find(node => "cell" === node.role);
|
|
54766
55026
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && (-1 === table.stateManager.hover.cellPos.col || -1 === table.stateManager.hover.cellPos.row || (null == cellGoup ? void 0 : cellGoup.col) === table.stateManager.hover.cellPos.col && (null == cellGoup ? void 0 : cellGoup.row) === table.stateManager.hover.cellPos.row || table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
@@ -55430,7 +55690,7 @@
|
|
|
55430
55690
|
!1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) ? e.preventDefault() : globalPointerupCallback(e);
|
|
55431
55691
|
}), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
|
|
55432
55692
|
var _a;
|
|
55433
|
-
table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio$1()), e.windowSizeNotChange || table.resize());
|
|
55693
|
+
table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight || "adaptive" === table.widthMode || "adaptive" === table.heightMode) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio$1()), e.windowSizeNotChange || table.resize());
|
|
55434
55694
|
});
|
|
55435
55695
|
const globalPointerdownCallback = e => {
|
|
55436
55696
|
var _a;
|
|
@@ -55512,10 +55772,10 @@
|
|
|
55512
55772
|
stateManager.interactionState === InteractionState.grabing && (stateManager.isResizeCol() ? (eventManager.dealColumnResize(x, y), table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN) && table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {
|
|
55513
55773
|
col: table.stateManager.columnResize.col,
|
|
55514
55774
|
colWidth: table.getColWidth(table.stateManager.columnResize.col)
|
|
55515
|
-
})) : stateManager.isResizeRow()
|
|
55775
|
+
})) : stateManager.isResizeRow() ? (eventManager.dealRowResize(x, y), table.hasListeners(TABLE_EVENT_TYPE.RESIZE_ROW) && table.fireListeners(TABLE_EVENT_TYPE.RESIZE_ROW, {
|
|
55516
55776
|
row: table.stateManager.rowResize.row,
|
|
55517
55777
|
rowHeight: table.getRowHeight(table.stateManager.rowResize.row)
|
|
55518
|
-
})));
|
|
55778
|
+
})) : stateManager.isMoveCol() && eventManager.dealColumnMover(x, y, e));
|
|
55519
55779
|
const isSelecting = table.stateManager.isSelecting();
|
|
55520
55780
|
if (eventManager._enableTableScroll && eventManager.isDraging && isSelecting && (null === (_e = table.stateManager.select.ranges) || void 0 === _e ? void 0 : _e.length) > 0) {
|
|
55521
55781
|
const drawRange = table.getDrawRange(),
|
|
@@ -56129,12 +56389,10 @@
|
|
|
56129
56389
|
} = eventArgsSet;
|
|
56130
56390
|
return !(!eventArgs || !this.table._canDragHeaderPosition(eventArgs.col, eventArgs.row)) && (this.table.stateManager.startMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = null == eventArgs ? void 0 : eventArgs.event) || void 0 === _a ? void 0 : _a.nativeEvent), !0);
|
|
56131
56391
|
}
|
|
56132
|
-
dealColumnMover(
|
|
56133
|
-
|
|
56134
|
-
|
|
56135
|
-
|
|
56136
|
-
} = eventArgsSet;
|
|
56137
|
-
isValid$3(eventArgs.col) && isValid$3(eventArgs.row) && this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = null == eventArgs ? void 0 : eventArgs.event) || void 0 === _a ? void 0 : _a.nativeEvent);
|
|
56392
|
+
dealColumnMover(x, y, event) {
|
|
56393
|
+
let col = this.table.getColAtRelativePosition(x),
|
|
56394
|
+
row = this.table.getRowAtRelativePosition(y);
|
|
56395
|
+
-1 === col && "row" === this.table.stateManager.columnMove.movingColumnOrRow && (col = 0), -1 === row && "column" === this.table.stateManager.columnMove.movingColumnOrRow && (row = 0), isValid$3(col) && isValid$3(row) && this.table.stateManager.updateMoveCol(col, row, x, y, event);
|
|
56138
56396
|
}
|
|
56139
56397
|
startColumnResize(eventArgsSet) {}
|
|
56140
56398
|
dealIconClick(e, eventArgsSet) {
|
|
@@ -57601,12 +57859,12 @@
|
|
|
57601
57859
|
clearRange() {
|
|
57602
57860
|
this.cumulativeSum.clear(), this.difference.clear();
|
|
57603
57861
|
}
|
|
57604
|
-
|
|
57862
|
+
_add(position, value) {
|
|
57605
57863
|
if (!isValid$3(value)) return;
|
|
57606
57864
|
const defaultValue = this.table.getRowHeight(position);
|
|
57607
57865
|
this.data.has(position) || (this._keys.push(position), this._sorted = !1), this.data.set(position, value), this.totalSum += value, this.updateDifference(position, value - defaultValue);
|
|
57608
57866
|
}
|
|
57609
|
-
|
|
57867
|
+
_remove(position) {
|
|
57610
57868
|
if (this.data.has(position)) {
|
|
57611
57869
|
const value = this.data.get(position);
|
|
57612
57870
|
this.data.delete(position);
|
|
@@ -57623,7 +57881,7 @@
|
|
|
57623
57881
|
this.data.set(position, newValue);
|
|
57624
57882
|
const difference = newValue - oldValue;
|
|
57625
57883
|
this.totalSum += difference, this.updateDifference(position, difference);
|
|
57626
|
-
} else this.
|
|
57884
|
+
} else this._add(position, newValue);
|
|
57627
57885
|
}
|
|
57628
57886
|
get(position) {
|
|
57629
57887
|
return this.data.get(position);
|
|
@@ -57690,21 +57948,38 @@
|
|
|
57690
57948
|
}
|
|
57691
57949
|
insert(position, value) {
|
|
57692
57950
|
for (let i = position; i <= this.getLastIndex(); i++) this.cumulativeSum.delete(i);
|
|
57693
|
-
const lastIndex = this.getLastIndex() + 1
|
|
57694
|
-
|
|
57951
|
+
const lastIndex = this.getLastIndex() + 1,
|
|
57952
|
+
values = [];
|
|
57953
|
+
for (let i = position; i <= lastIndex; i++) this.has(i) && (values.push({
|
|
57954
|
+
position: i,
|
|
57955
|
+
value: this.get(i)
|
|
57956
|
+
}), this._remove(i));
|
|
57957
|
+
isValid$3(value) && this.put(position, value);
|
|
57958
|
+
for (const {
|
|
57959
|
+
position: position,
|
|
57960
|
+
value: value
|
|
57961
|
+
} of values) this.put(position + 1, value);
|
|
57695
57962
|
}
|
|
57696
57963
|
getLastIndex() {
|
|
57697
57964
|
return this._sort(), this._keys[this._keys.length - 1];
|
|
57698
57965
|
}
|
|
57699
57966
|
delLast() {
|
|
57700
57967
|
const lastIndex = this.getLastIndex();
|
|
57701
|
-
this.
|
|
57968
|
+
this._remove(lastIndex);
|
|
57702
57969
|
}
|
|
57703
57970
|
delete(position) {
|
|
57704
|
-
if (!this.has(position)) return;
|
|
57705
57971
|
for (let i = position; i <= this.getLastIndex(); i++) this.cumulativeSum.delete(i);
|
|
57706
57972
|
const lastIndex = this.getLastIndex();
|
|
57707
|
-
this.
|
|
57973
|
+
this.has(position) && this._remove(position);
|
|
57974
|
+
const values = [];
|
|
57975
|
+
for (let i = position + 1; i <= lastIndex; i++) this.has(i) && values.push({
|
|
57976
|
+
position: i,
|
|
57977
|
+
value: this.get(i)
|
|
57978
|
+
});
|
|
57979
|
+
for (const {
|
|
57980
|
+
position: position,
|
|
57981
|
+
value: value
|
|
57982
|
+
} of values) this._remove(position), this._add(position - 1, value);
|
|
57708
57983
|
}
|
|
57709
57984
|
adjustOrder(sourceIndex, targetIndex, moveCount) {
|
|
57710
57985
|
this.clearRange(), this._sort();
|
|
@@ -57732,28 +58007,12 @@
|
|
|
57732
58007
|
}
|
|
57733
58008
|
}
|
|
57734
58009
|
exchangeOrder(sourceIndex, sourceCount, targetIndex, targetCount, insertIndex) {
|
|
57735
|
-
const
|
|
57736
|
-
|
|
57737
|
-
|
|
57738
|
-
|
|
57739
|
-
|
|
57740
|
-
|
|
57741
|
-
for (let i = indexFirst(keys, targetIndex); i < indexFirst(keys, sourceIndex) + sourceCount; i++) {
|
|
57742
|
-
const key = keys[i];
|
|
57743
|
-
key >= sourceIndex && key < sourceIndex + sourceCount ? sourceVals.push(this.get(key)) : targetVals.push(this.get(key));
|
|
57744
|
-
}
|
|
57745
|
-
for (let i = 0; i < sourceCount; i++) this.put(insertIndex + i, sourceVals[i]);
|
|
57746
|
-
for (let i = 0; i < targetVals.length; i++) this.put(insertIndex + sourceCount + i, targetVals[i]);
|
|
57747
|
-
} else {
|
|
57748
|
-
const targetVals = [],
|
|
57749
|
-
sourceVals = [];
|
|
57750
|
-
for (let i = indexFirst(keys, sourceIndex); i < indexFirst(keys, targetIndex) + targetCount; i++) {
|
|
57751
|
-
const key = keys[i];
|
|
57752
|
-
key >= sourceIndex && key < sourceIndex + sourceCount ? sourceVals.push(this.get(key)) : targetVals.push(this.get(key));
|
|
57753
|
-
}
|
|
57754
|
-
for (let i = 0; i < sourceCount; i++) this.put(insertIndex + i, sourceVals[i]);
|
|
57755
|
-
for (let i = 0; i < targetVals.length; i++) this.put(sourceIndex + i, targetVals[i]);
|
|
57756
|
-
}
|
|
58010
|
+
const values = [];
|
|
58011
|
+
for (let i = sourceIndex + sourceCount - 1; i >= sourceIndex; i--) values.push({
|
|
58012
|
+
position: i,
|
|
58013
|
+
value: this.get(i)
|
|
58014
|
+
}), this.delete(i);
|
|
58015
|
+
for (let i = 0; i < sourceCount; i++) this.insert(insertIndex, values[i].value);
|
|
57757
58016
|
}
|
|
57758
58017
|
}
|
|
57759
58018
|
function indexFirst(arr, elm) {
|
|
@@ -57764,7 +58023,8 @@
|
|
|
57764
58023
|
if (arr[i] === elm) return i;
|
|
57765
58024
|
arr[i] > elm ? high = i - 1 : low = i + 1;
|
|
57766
58025
|
}
|
|
57767
|
-
|
|
58026
|
+
const tempI = high < 0 ? 0 : high;
|
|
58027
|
+
return arr[tempI] === elm ? tempI : -1;
|
|
57768
58028
|
}
|
|
57769
58029
|
|
|
57770
58030
|
class RowSeriesNumberHelper {
|
|
@@ -58180,6 +58440,34 @@
|
|
|
58180
58440
|
row: -1
|
|
58181
58441
|
};
|
|
58182
58442
|
}
|
|
58443
|
+
function getColAtRelativePosition(x, _this) {
|
|
58444
|
+
let leftFrozen = !1;
|
|
58445
|
+
(x -= _this.tableX) > 0 && x < _this.getFrozenColsWidth() && (leftFrozen = !0);
|
|
58446
|
+
let rightFrozen = !1;
|
|
58447
|
+
x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth && x <= _this.getAllColsWidth() && (rightFrozen = !0);
|
|
58448
|
+
const colInfo = getTargetColAtConsiderRightFrozen((leftFrozen || rightFrozen ? x : x + _this.scrollLeft) + _this.tableX, rightFrozen, _this);
|
|
58449
|
+
if (colInfo) {
|
|
58450
|
+
const {
|
|
58451
|
+
col: col
|
|
58452
|
+
} = colInfo;
|
|
58453
|
+
return col;
|
|
58454
|
+
}
|
|
58455
|
+
return -1;
|
|
58456
|
+
}
|
|
58457
|
+
function getRowAtRelativePosition(y, _this) {
|
|
58458
|
+
let topFrozen = !1;
|
|
58459
|
+
(y -= _this.tableY) > 0 && y < _this.getFrozenRowsHeight() && (topFrozen = !0);
|
|
58460
|
+
let bottomFrozen = !1;
|
|
58461
|
+
y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight && y <= _this.getAllRowsHeight() && (bottomFrozen = !0);
|
|
58462
|
+
const rowInfo = getTargetRowAtConsiderBottomFrozen((topFrozen || bottomFrozen ? y : y + _this.scrollTop) + _this.tableY, bottomFrozen, _this);
|
|
58463
|
+
if (rowInfo) {
|
|
58464
|
+
const {
|
|
58465
|
+
row: row
|
|
58466
|
+
} = rowInfo;
|
|
58467
|
+
return row;
|
|
58468
|
+
}
|
|
58469
|
+
return -1;
|
|
58470
|
+
}
|
|
58183
58471
|
|
|
58184
58472
|
function isValidAlignDomain(domain) {
|
|
58185
58473
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -59098,7 +59386,7 @@
|
|
|
59098
59386
|
}
|
|
59099
59387
|
constructor(container, options = {}) {
|
|
59100
59388
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
59101
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.
|
|
59389
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
59102
59390
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
59103
59391
|
options: options,
|
|
59104
59392
|
container: container
|
|
@@ -59850,6 +60138,12 @@
|
|
|
59850
60138
|
getCellAtRelativePosition(relativeX, relativeY) {
|
|
59851
60139
|
return getCellAtRelativePosition(relativeX, relativeY, this);
|
|
59852
60140
|
}
|
|
60141
|
+
getColAtRelativePosition(relativeX) {
|
|
60142
|
+
return getColAtRelativePosition(relativeX, this);
|
|
60143
|
+
}
|
|
60144
|
+
getRowAtRelativePosition(relativeY) {
|
|
60145
|
+
return getRowAtRelativePosition(relativeY, this);
|
|
60146
|
+
}
|
|
59853
60147
|
_checkRowCol(col, row) {
|
|
59854
60148
|
return col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount;
|
|
59855
60149
|
}
|
|
@@ -61233,6 +61527,22 @@
|
|
|
61233
61527
|
height: !1
|
|
61234
61528
|
};
|
|
61235
61529
|
}
|
|
61530
|
+
isColumnSelected(col) {
|
|
61531
|
+
const selectRange = this.stateManager.select.ranges;
|
|
61532
|
+
for (let i = 0; i <= selectRange.length - 1; i++) {
|
|
61533
|
+
const range = selectRange[i];
|
|
61534
|
+
if (range.start.col <= col && range.end.col >= col && 0 === range.start.row && range.end.row === this.rowCount - 1) return !0;
|
|
61535
|
+
}
|
|
61536
|
+
return !1;
|
|
61537
|
+
}
|
|
61538
|
+
isRowSelected(row) {
|
|
61539
|
+
const selectRange = this.stateManager.select.ranges;
|
|
61540
|
+
for (let i = 0; i <= selectRange.length - 1; i++) {
|
|
61541
|
+
const range = selectRange[i];
|
|
61542
|
+
if (range.start.row <= row && range.end.row >= row && 0 === range.start.col && range.end.col === this.colCount - 1) return !0;
|
|
61543
|
+
}
|
|
61544
|
+
return !1;
|
|
61545
|
+
}
|
|
61236
61546
|
}
|
|
61237
61547
|
|
|
61238
61548
|
const chartTypes = {};
|
|
@@ -63260,13 +63570,14 @@
|
|
|
63260
63570
|
}
|
|
63261
63571
|
}
|
|
63262
63572
|
canMoveHeaderPosition(source, target) {
|
|
63573
|
+
const dragColumnOrRow = this._table.stateManager.columnMove.movingColumnOrRow;
|
|
63263
63574
|
if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) return !1;
|
|
63264
|
-
if (!this.transpose && this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row)) {
|
|
63575
|
+
if (!this.transpose && (this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) || "row" === dragColumnOrRow)) {
|
|
63265
63576
|
const sourceIndex = this.getRecordShowIndexByCell(0, source.row),
|
|
63266
63577
|
targetIndex = this.getRecordShowIndexByCell(0, target.row);
|
|
63267
63578
|
return this._table.dataSource.canChangeOrder(sourceIndex, targetIndex);
|
|
63268
63579
|
}
|
|
63269
|
-
if (this.transpose && this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) && (this.getBody(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode && this.getBody(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode ? (source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1, target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1) : (source.col = source.col + this.leftRowSeriesNumberColumnCount, target.col = target.col + this.leftRowSeriesNumberColumnCount)), source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
|
|
63580
|
+
if (this.transpose && (this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) || "row" === dragColumnOrRow) && (this.getBody(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode && this.getBody(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode ? (source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1, target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1) : (source.col = source.col + this.leftRowSeriesNumberColumnCount, target.col = target.col + this.leftRowSeriesNumberColumnCount)), source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
|
|
63270
63581
|
if ("disabled" === this._table.internalProps.frozenColDragHeaderMode && this._table.isFrozenColumn(target.col)) return !1;
|
|
63271
63582
|
const sourceCellRange = this.getCellRange(source.col, source.row);
|
|
63272
63583
|
if (this.isColumnHeader(source.col, source.row)) {
|
|
@@ -63278,7 +63589,7 @@
|
|
|
63278
63589
|
return !1;
|
|
63279
63590
|
}
|
|
63280
63591
|
moveHeaderPosition(source, target) {
|
|
63281
|
-
var _a, _b;
|
|
63592
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
63282
63593
|
if ((!(null === (_a = this._table.options.dragOrder) || void 0 === _a ? void 0 : _a.validateDragOrderOnEnd) || (null === (_b = this._table.options.dragOrder) || void 0 === _b ? void 0 : _b.validateDragOrderOnEnd(source, target))) && this.canMoveHeaderPosition(source, target)) {
|
|
63283
63594
|
let sourceCellRange = this.getCellRange(source.col, source.row);
|
|
63284
63595
|
if (this.isColumnHeader(source.col, source.row)) {
|
|
@@ -63290,8 +63601,18 @@
|
|
|
63290
63601
|
const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
|
|
63291
63602
|
sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
|
|
63292
63603
|
}
|
|
63604
|
+
if (null === (_c = this._table.options.dragOrder) || void 0 === _c ? void 0 : _c.maintainArrayDataOrder) for (let j = 0; j < (null === (_d = this._table.dataSource.dataSourceObj) || void 0 === _d ? void 0 : _d.records.length); j++) {
|
|
63605
|
+
const rowRecords = null === (_e = this._table.dataSource.dataSourceObj) || void 0 === _e ? void 0 : _e.records[j];
|
|
63606
|
+
if (Array.isArray(rowRecords)) {
|
|
63607
|
+
rowRecords.length - 1 < targetIndex && rowRecords.push(...Array(targetIndex - rowRecords.length + 1).fill(void 0));
|
|
63608
|
+
const sourceData = rowRecords.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
|
|
63609
|
+
sourceData.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(rowRecords, sourceData);
|
|
63610
|
+
}
|
|
63611
|
+
}
|
|
63293
63612
|
const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
|
|
63294
|
-
|
|
63613
|
+
if (sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._columns, sourceColumns), null === (_f = this._table.options.dragOrder) || void 0 === _f ? void 0 : _f.maintainArrayDataOrder) for (let i = 0; i < this._columns.length; i++) this._columns[i].field = i;
|
|
63614
|
+
if (this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount), null === (_g = this._table.options.dragOrder) || void 0 === _g ? void 0 : _g.maintainArrayDataOrder) for (let i = 0; i < this.columnTree.tree.children.length; i++) this.columnTree.tree.children[i].field = i;
|
|
63615
|
+
return this.columnTree.reset(this.columnTree.tree.children), this._cellRangeMap = new Map(), {
|
|
63295
63616
|
sourceIndex: sourceCellRange.start.col,
|
|
63296
63617
|
targetIndex: targetIndex,
|
|
63297
63618
|
sourceSize: sourceSize,
|
|
@@ -63318,7 +63639,7 @@
|
|
|
63318
63639
|
moveType: "row"
|
|
63319
63640
|
};
|
|
63320
63641
|
}
|
|
63321
|
-
if (this.isSeriesNumberInBody(source.col, source.row)) return {
|
|
63642
|
+
if (this.isSeriesNumberInBody(source.col, source.row) || "row" === this._table.stateManager.columnMove.movingColumnOrRow) return {
|
|
63322
63643
|
sourceIndex: source.row,
|
|
63323
63644
|
targetIndex: target.row,
|
|
63324
63645
|
sourceSize: 1,
|
|
@@ -64290,14 +64611,17 @@
|
|
|
64290
64611
|
get recordsCount() {
|
|
64291
64612
|
return this.dataSource.records.length;
|
|
64292
64613
|
}
|
|
64293
|
-
updateColumns(columns, options
|
|
64614
|
+
updateColumns(columns, options = {
|
|
64615
|
+
clearColWidthCache: !1,
|
|
64616
|
+
clearRowHeightCache: !0
|
|
64617
|
+
}) {
|
|
64294
64618
|
var _a, _b, _c, _d;
|
|
64295
64619
|
this.scenegraph.clearCells();
|
|
64296
64620
|
const oldHoverState = {
|
|
64297
64621
|
col: this.stateManager.hover.cellPos.col,
|
|
64298
64622
|
row: this.stateManager.hover.cellPos.row
|
|
64299
64623
|
};
|
|
64300
|
-
this.internalProps.columns = cloneDeepSpec(columns, ["children"]), generateAggregationForColumn(this), (null == options ? void 0 : options.clearColWidthCache) && this.internalProps._widthResizedColMap.clear(), this.options.columns = columns, this.internalProps.headerHelper.setTableColumnsEditor(), this._hasAutoImageColumn = void 0, this.refreshHeader(), null === (_b = (_a = this.dataSource).updateColumns) || void 0 === _b || _b.call(_a, this.internalProps.columns), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_d = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records) && void 0 !== _d ? _d : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
|
|
64624
|
+
this.internalProps.columns = cloneDeepSpec(columns, ["children"]), generateAggregationForColumn(this), (null == options ? void 0 : options.clearColWidthCache) && this.internalProps._widthResizedColMap.clear(), this.options.columns = columns, this.internalProps.headerHelper.setTableColumnsEditor(), this._hasAutoImageColumn = void 0, this.refreshHeader(), null === (_b = (_a = this.dataSource).updateColumns) || void 0 === _b || _b.call(_a, this.internalProps.columns), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_d = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records) && void 0 !== _d ? _d : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
|
|
64301
64625
|
}
|
|
64302
64626
|
_recreateSceneForStateChange() {
|
|
64303
64627
|
var _a, _b;
|
|
@@ -64309,15 +64633,23 @@
|
|
|
64309
64633
|
this._hasAutoImageColumn = void 0, this.refreshHeader(), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_b = null === (_a = this.dataSource.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this._updateSize(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
|
|
64310
64634
|
}
|
|
64311
64635
|
addColumns(toAddColumns, colIndex, isMaintainArrayData = !0) {
|
|
64636
|
+
var _a;
|
|
64312
64637
|
const columns = this.options.columns;
|
|
64313
|
-
|
|
64638
|
+
void 0 === colIndex ? (colIndex = columns.length, columns.push(...toAddColumns)) : columns.splice(colIndex, 0, ...toAddColumns);
|
|
64639
|
+
for (let i = 0; i < toAddColumns.length; i++) this.colWidthsMap.addAndReorder(colIndex + i, null !== (_a = toAddColumns[i].width) && void 0 !== _a ? _a : this.internalProps.defaultColWidth);
|
|
64640
|
+
this.internalProps._colRangeWidthsMap.clear();
|
|
64641
|
+
const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
|
|
64642
|
+
for (let i = 0; i < resizedColIndexs.length; i++) resizedColIndexs[i] >= colIndex && (this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]), this.internalProps._widthResizedColMap.add(resizedColIndexs[i] + toAddColumns.length));
|
|
64643
|
+
if (isMaintainArrayData) {
|
|
64314
64644
|
for (let i = 0; i < columns.length; i++) columns[i].field = i;
|
|
64315
64645
|
for (let i = 0; i < this.records.length; i++) {
|
|
64316
64646
|
const record = this.records[i];
|
|
64317
64647
|
Array.isArray(record) && record.splice(colIndex, 0, ...Array(toAddColumns.length).fill(void 0));
|
|
64318
64648
|
}
|
|
64319
64649
|
}
|
|
64320
|
-
this.updateColumns(columns
|
|
64650
|
+
this.updateColumns(columns, {
|
|
64651
|
+
clearRowHeightCache: !1
|
|
64652
|
+
}), this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
|
|
64321
64653
|
columnIndex: colIndex,
|
|
64322
64654
|
columnCount: toAddColumns.length,
|
|
64323
64655
|
columns: columns
|
|
@@ -64326,12 +64658,20 @@
|
|
|
64326
64658
|
deleteColumns(deleteColIndexs, isMaintainArrayData = !0) {
|
|
64327
64659
|
const columns = this.options.columns;
|
|
64328
64660
|
deleteColIndexs.sort((a, b) => b - a);
|
|
64329
|
-
for (let i = 0; i < deleteColIndexs.length; i++) if (columns.splice(deleteColIndexs[i], 1), isMaintainArrayData) for (let j = 0; j < this.records.length; j++) {
|
|
64661
|
+
for (let i = 0; i < deleteColIndexs.length; i++) if (columns.splice(deleteColIndexs[i], 1), this.colWidthsMap.delAndReorder(deleteColIndexs[i]), this.internalProps._widthResizedColMap.delete(deleteColIndexs[i]), isMaintainArrayData) for (let j = 0; j < this.records.length; j++) {
|
|
64330
64662
|
const record = this.records[j];
|
|
64331
64663
|
Array.isArray(record) && record.splice(deleteColIndexs[i], 1);
|
|
64332
64664
|
}
|
|
64665
|
+
this.internalProps._colRangeWidthsMap.clear();
|
|
64666
|
+
const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
|
|
64667
|
+
for (let i = 0; i < resizedColIndexs.length; i++) for (let j = 0; j < deleteColIndexs.length; j++) if (resizedColIndexs[i] > deleteColIndexs[j]) {
|
|
64668
|
+
this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]), this.internalProps._widthResizedColMap.add(resizedColIndexs[i] - (deleteColIndexs.length - j));
|
|
64669
|
+
break;
|
|
64670
|
+
}
|
|
64333
64671
|
if (isMaintainArrayData) for (let i = 0; i < columns.length; i++) columns[i].field = i;
|
|
64334
|
-
this.updateColumns(columns
|
|
64672
|
+
this.updateColumns(columns, {
|
|
64673
|
+
clearRowHeightCache: !1
|
|
64674
|
+
}), this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
|
|
64335
64675
|
deleteColIndexs: deleteColIndexs,
|
|
64336
64676
|
columns: columns
|
|
64337
64677
|
});
|
|
@@ -70229,7 +70569,7 @@
|
|
|
70229
70569
|
cornerRadius: isMilestone
|
|
70230
70570
|
? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius
|
|
70231
70571
|
: taskBarStyle.cornerRadius,
|
|
70232
|
-
clip:
|
|
70572
|
+
clip: this._scene._gantt.parsedOptions.taskBarClip
|
|
70233
70573
|
});
|
|
70234
70574
|
barGroup.name = 'task-bar-group';
|
|
70235
70575
|
barGroupBox.appendChild(barGroup);
|
|
@@ -72522,7 +72862,7 @@
|
|
|
72522
72862
|
let maxing = false;
|
|
72523
72863
|
let leading = false;
|
|
72524
72864
|
let trailing = true;
|
|
72525
|
-
const useRAF = !wait && wait !== 0 && typeof
|
|
72865
|
+
const useRAF = !wait && wait !== 0 && typeof vglobal.getRequestAnimationFrame() === 'function';
|
|
72526
72866
|
if (typeof func !== 'function') {
|
|
72527
72867
|
throw new TypeError('Expected a function');
|
|
72528
72868
|
}
|
|
@@ -72546,7 +72886,7 @@
|
|
|
72546
72886
|
}
|
|
72547
72887
|
function startTimer(pendingFunc, wait) {
|
|
72548
72888
|
if (useRAF) {
|
|
72549
|
-
return
|
|
72889
|
+
return vglobal.getRequestAnimationFrame()(pendingFunc);
|
|
72550
72890
|
}
|
|
72551
72891
|
return setTimeout(pendingFunc, wait);
|
|
72552
72892
|
}
|
|
@@ -72936,7 +73276,7 @@
|
|
|
72936
73276
|
this.speedY = speedY;
|
|
72937
73277
|
this.friction = friction;
|
|
72938
73278
|
if (!this.runingId) {
|
|
72939
|
-
this.runingId =
|
|
73279
|
+
this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this));
|
|
72940
73280
|
}
|
|
72941
73281
|
}
|
|
72942
73282
|
inertia() {
|
|
@@ -72967,10 +73307,10 @@
|
|
|
72967
73307
|
this.lastTime = now;
|
|
72968
73308
|
this.speedX = newSpeedX;
|
|
72969
73309
|
this.speedY = newSpeedY;
|
|
72970
|
-
this.runingId =
|
|
73310
|
+
this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this));
|
|
72971
73311
|
}
|
|
72972
73312
|
endInertia() {
|
|
72973
|
-
|
|
73313
|
+
vglobal.getCancelAnimationFrame()(this.runingId);
|
|
72974
73314
|
this.runingId = null;
|
|
72975
73315
|
this.stopped = true;
|
|
72976
73316
|
}
|
|
@@ -73899,7 +74239,10 @@
|
|
|
73899
74239
|
startOffsetY: null,
|
|
73900
74240
|
targetStartX: null,
|
|
73901
74241
|
creating: false,
|
|
73902
|
-
|
|
74242
|
+
firstTaskBarPosition: 'left',
|
|
74243
|
+
secondTaskBarPosition: 'left',
|
|
74244
|
+
secondTaskBarNode: null,
|
|
74245
|
+
lastHighLightLinkPoint: null
|
|
73903
74246
|
};
|
|
73904
74247
|
this.updateVerticalScrollBar = this.updateVerticalScrollBar.bind(this);
|
|
73905
74248
|
this.updateHorizontalScrollBar = this.updateHorizontalScrollBar.bind(this);
|
|
@@ -74352,6 +74695,13 @@
|
|
|
74352
74695
|
this._gantt.scenegraph.updateNextFrame();
|
|
74353
74696
|
}
|
|
74354
74697
|
startAdjustProgressBar(target, x, y) {
|
|
74698
|
+
if (!target || !target.record) {
|
|
74699
|
+
return;
|
|
74700
|
+
}
|
|
74701
|
+
const progressField = this._gantt.parsedOptions.progressField;
|
|
74702
|
+
if (!progressField || target.record[progressField] === undefined || target.record[progressField] === null) {
|
|
74703
|
+
return;
|
|
74704
|
+
}
|
|
74355
74705
|
const { progress } = this._gantt.getTaskInfoByTaskListIndex(target.task_index, target.sub_task_index);
|
|
74356
74706
|
this.adjustProgressBar.target = target;
|
|
74357
74707
|
this.adjustProgressBar.adjusting = true;
|
|
@@ -74364,13 +74714,23 @@
|
|
|
74364
74714
|
}
|
|
74365
74715
|
endAdjustProgressBar(x) {
|
|
74366
74716
|
const target = this.adjustProgressBar.target;
|
|
74717
|
+
if (!target) {
|
|
74718
|
+
return;
|
|
74719
|
+
}
|
|
74367
74720
|
const taskBarWidth = target.attribute.width;
|
|
74368
74721
|
const deltaX = x - this.adjustProgressBar.startX;
|
|
74369
74722
|
const newProgress = Math.max(0, Math.min(100, this.adjustProgressBar.originalProgress + (deltaX / taskBarWidth) * 100));
|
|
74370
74723
|
if (Math.abs(newProgress - this.adjustProgressBar.originalProgress) >= 0.1) {
|
|
74371
74724
|
const taskIndex = target.task_index;
|
|
74372
74725
|
const subTaskIndex = target.sub_task_index;
|
|
74373
|
-
this._gantt.
|
|
74726
|
+
const progressField = this._gantt.parsedOptions.progressField;
|
|
74727
|
+
if (progressField && target.record) {
|
|
74728
|
+
target.record[progressField] = Math.round(newProgress * 10) / 10;
|
|
74729
|
+
}
|
|
74730
|
+
if (this.shouldSyncProgressToTable(taskIndex, subTaskIndex)) {
|
|
74731
|
+
this._gantt._updateProgressToTaskRecord(Math.round(newProgress * 10) / 10, taskIndex, subTaskIndex);
|
|
74732
|
+
}
|
|
74733
|
+
this._gantt.scenegraph.taskBar.updateTaskBarNode(taskIndex, subTaskIndex);
|
|
74374
74734
|
const newRecord = this._gantt.getRecordByIndex(taskIndex, subTaskIndex);
|
|
74375
74735
|
if (this._gantt.hasListeners(GANTT_EVENT_TYPE.PROGRESS_UPDATE)) {
|
|
74376
74736
|
this._gantt.fireListeners(GANTT_EVENT_TYPE.PROGRESS_UPDATE, {
|
|
@@ -74390,9 +74750,40 @@
|
|
|
74390
74750
|
this.adjustProgressBar.startY = null;
|
|
74391
74751
|
this.adjustProgressBar.originalProgress = 0;
|
|
74392
74752
|
}
|
|
74753
|
+
shouldSyncProgressToTable(taskIndex, subTaskIndex) {
|
|
74754
|
+
const tasksShowMode = this._gantt.parsedOptions.tasksShowMode;
|
|
74755
|
+
if (tasksShowMode === TasksShowMode.Tasks_Separate) {
|
|
74756
|
+
return true;
|
|
74757
|
+
}
|
|
74758
|
+
if (!isValid$3(subTaskIndex)) {
|
|
74759
|
+
return true;
|
|
74760
|
+
}
|
|
74761
|
+
switch (tasksShowMode) {
|
|
74762
|
+
case TasksShowMode.Sub_Tasks_Inline:
|
|
74763
|
+
case TasksShowMode.Sub_Tasks_Arrange:
|
|
74764
|
+
case TasksShowMode.Sub_Tasks_Compact:
|
|
74765
|
+
return false;
|
|
74766
|
+
case TasksShowMode.Sub_Tasks_Separate:
|
|
74767
|
+
return true;
|
|
74768
|
+
case TasksShowMode.Project_Sub_Tasks_Inline:
|
|
74769
|
+
const parentRecord = this._gantt.getRecordByIndex(taskIndex);
|
|
74770
|
+
if (parentRecord && parentRecord.type === TaskType.PROJECT) {
|
|
74771
|
+
return parentRecord.hierarchyState === 'expand';
|
|
74772
|
+
}
|
|
74773
|
+
return false;
|
|
74774
|
+
default:
|
|
74775
|
+
return false;
|
|
74776
|
+
}
|
|
74777
|
+
}
|
|
74393
74778
|
dealAdjustProgressBar(e) {
|
|
74394
74779
|
const target = this.adjustProgressBar.target;
|
|
74780
|
+
if (!target || !this.adjustProgressBar.adjusting) {
|
|
74781
|
+
return;
|
|
74782
|
+
}
|
|
74395
74783
|
const taskBarWidth = target.attribute.width;
|
|
74784
|
+
if (!taskBarWidth || taskBarWidth <= 0) {
|
|
74785
|
+
return;
|
|
74786
|
+
}
|
|
74396
74787
|
const deltaX = e.x - this.adjustProgressBar.startX;
|
|
74397
74788
|
const newProgress = Math.max(0, Math.min(100, this.adjustProgressBar.originalProgress + (deltaX / taskBarWidth) * 100));
|
|
74398
74789
|
if (target.progressRect) {
|
|
@@ -74402,8 +74793,12 @@
|
|
|
74402
74793
|
this._gantt.scenegraph.taskBar.hoverBarProgressHandle.attribute.visibleAll) {
|
|
74403
74794
|
this._gantt.scenegraph.taskBar.hoverBarProgressHandle.setAttribute('x', (taskBarWidth * newProgress) / 100 - 6);
|
|
74404
74795
|
}
|
|
74405
|
-
if (target.textLabel && target.record) {
|
|
74406
|
-
const
|
|
74796
|
+
if (target.textLabel && target.record && this._gantt.parsedOptions.taskBarLabelText) {
|
|
74797
|
+
const progressField = this._gantt.parsedOptions.progressField;
|
|
74798
|
+
const tempRecord = {
|
|
74799
|
+
...target.record,
|
|
74800
|
+
[progressField]: Math.round(newProgress * 10) / 10
|
|
74801
|
+
};
|
|
74407
74802
|
const newText = parseStringTemplate(this._gantt.parsedOptions.taskBarLabelText, tempRecord);
|
|
74408
74803
|
target.textLabel.setAttribute('text', newText);
|
|
74409
74804
|
}
|
|
@@ -75191,7 +75586,7 @@
|
|
|
75191
75586
|
}
|
|
75192
75587
|
});
|
|
75193
75588
|
this.stage.defaultLayer.add(this.dataZoomAxis);
|
|
75194
|
-
|
|
75589
|
+
vglobal.getRequestAnimationFrame()(() => {
|
|
75195
75590
|
if (this.isInitializing) {
|
|
75196
75591
|
const boundaries = this.getGanttViewBoundaries();
|
|
75197
75592
|
this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);
|
|
@@ -76905,7 +77300,7 @@
|
|
|
76905
77300
|
PluginManager: PluginManager
|
|
76906
77301
|
});
|
|
76907
77302
|
|
|
76908
|
-
const version = "1.22.
|
|
77303
|
+
const version = "1.22.1";
|
|
76909
77304
|
|
|
76910
77305
|
exports.Gantt = Gantt;
|
|
76911
77306
|
exports.TYPES = index$4;
|