@visactor/vrender-components 0.17.2-alpha.2 → 0.17.2-alpha.4
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/axis/base.js +2 -12
- package/cjs/axis/base.js.map +1 -1
- package/cjs/brush/brush.d.ts +3 -12
- package/cjs/brush/brush.js +29 -28
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/checkbox/checkbox.js +4 -8
- package/cjs/checkbox/checkbox.js.map +1 -1
- package/cjs/core/base.d.ts +2 -0
- package/cjs/core/base.js +6 -0
- package/cjs/core/base.js.map +1 -1
- package/cjs/data-zoom/data-zoom.d.ts +0 -3
- package/cjs/data-zoom/data-zoom.js +35 -37
- package/cjs/data-zoom/data-zoom.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/legend/discrete/discrete.d.ts +1 -1
- package/cjs/legend/discrete/discrete.js +33 -37
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/pager/pager.js +4 -9
- package/cjs/pager/pager.js.map +1 -1
- package/cjs/player/base-player.js +2 -5
- package/cjs/player/base-player.js.map +1 -1
- package/cjs/player/controller/controller.d.ts +0 -1
- package/cjs/player/controller/controller.js +5 -16
- package/cjs/player/controller/controller.js.map +1 -1
- package/cjs/scrollbar/scrollbar.d.ts +0 -1
- package/cjs/scrollbar/scrollbar.js +2 -8
- package/cjs/scrollbar/scrollbar.js.map +1 -1
- package/cjs/slider/slider.js +2 -4
- package/cjs/slider/slider.js.map +1 -1
- package/dist/index.js +257 -166
- package/dist/index.min.js +1 -1
- package/es/axis/base.js +2 -12
- package/es/axis/base.js.map +1 -1
- package/es/brush/brush.d.ts +3 -12
- package/es/brush/brush.js +31 -30
- package/es/brush/brush.js.map +1 -1
- package/es/checkbox/checkbox.js +5 -9
- package/es/checkbox/checkbox.js.map +1 -1
- package/es/core/base.d.ts +2 -0
- package/es/core/base.js +7 -1
- package/es/core/base.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +0 -3
- package/es/data-zoom/data-zoom.js +36 -37
- package/es/data-zoom/data-zoom.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/legend/discrete/discrete.d.ts +1 -1
- package/es/legend/discrete/discrete.js +33 -38
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/pager/pager.js +5 -10
- package/es/pager/pager.js.map +1 -1
- package/es/player/base-player.js +1 -6
- package/es/player/base-player.js.map +1 -1
- package/es/player/controller/controller.d.ts +0 -1
- package/es/player/controller/controller.js +5 -18
- package/es/player/controller/controller.js.map +1 -1
- package/es/scrollbar/scrollbar.d.ts +0 -1
- package/es/scrollbar/scrollbar.js +3 -9
- package/es/scrollbar/scrollbar.js.map +1 -1
- package/es/slider/slider.js +3 -5
- package/es/slider/slider.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -10896,6 +10896,114 @@
|
|
|
10896
10896
|
return new Path(attributes);
|
|
10897
10897
|
}
|
|
10898
10898
|
|
|
10899
|
+
var AREA_UPDATE_TAG_KEY = ["segments", "points", "curveType"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
10900
|
+
var Area = /*#__PURE__*/function (_Graphic) {
|
|
10901
|
+
_inherits(Area, _Graphic);
|
|
10902
|
+
var _super = _createSuper(Area);
|
|
10903
|
+
function Area(params) {
|
|
10904
|
+
var _this;
|
|
10905
|
+
_classCallCheck(this, Area);
|
|
10906
|
+
_this = _super.call(this, params), _this.type = "area", _this.numberType = AREA_NUMBER_TYPE;
|
|
10907
|
+
return _this;
|
|
10908
|
+
}
|
|
10909
|
+
_createClass(Area, [{
|
|
10910
|
+
key: "isValid",
|
|
10911
|
+
value: function isValid() {
|
|
10912
|
+
return _get(_getPrototypeOf(Area.prototype), "isValid", this).call(this) && this._isValid();
|
|
10913
|
+
}
|
|
10914
|
+
}, {
|
|
10915
|
+
key: "_isValid",
|
|
10916
|
+
value: function _isValid() {
|
|
10917
|
+
if (this.pathProxy) return !0;
|
|
10918
|
+
var _this$attribute = this.attribute,
|
|
10919
|
+
points = _this$attribute.points,
|
|
10920
|
+
segments = _this$attribute.segments;
|
|
10921
|
+
return segments ? 0 !== segments.length : !!points && 0 !== points.length;
|
|
10922
|
+
}
|
|
10923
|
+
}, {
|
|
10924
|
+
key: "doUpdateAABBBounds",
|
|
10925
|
+
value: function doUpdateAABBBounds() {
|
|
10926
|
+
var areaTheme = getTheme(this).area;
|
|
10927
|
+
this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
|
|
10928
|
+
var attribute = this.attribute,
|
|
10929
|
+
bounds = application.graphicService.updateAreaAABBBounds(attribute, getTheme(this).area, this._AABBBounds, this),
|
|
10930
|
+
_attribute$boundsPadd = attribute.boundsPadding,
|
|
10931
|
+
boundsPadding = _attribute$boundsPadd === void 0 ? areaTheme.boundsPadding : _attribute$boundsPadd,
|
|
10932
|
+
paddingArray = parsePadding(boundsPadding);
|
|
10933
|
+
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
10934
|
+
}
|
|
10935
|
+
}, {
|
|
10936
|
+
key: "tryUpdateOBBBounds",
|
|
10937
|
+
value: function tryUpdateOBBBounds() {
|
|
10938
|
+
throw new Error("暂不支持");
|
|
10939
|
+
}
|
|
10940
|
+
}, {
|
|
10941
|
+
key: "_interpolate",
|
|
10942
|
+
value: function _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
10943
|
+
"points" === key && (nextAttributes.points = pointsInterpolation(lastStepVal, nextStepVal, ratio));
|
|
10944
|
+
}
|
|
10945
|
+
}, {
|
|
10946
|
+
key: "getDefaultAttribute",
|
|
10947
|
+
value: function getDefaultAttribute(name) {
|
|
10948
|
+
return getTheme(this).area[name];
|
|
10949
|
+
}
|
|
10950
|
+
}, {
|
|
10951
|
+
key: "needUpdateTags",
|
|
10952
|
+
value: function needUpdateTags(keys) {
|
|
10953
|
+
return _get(_getPrototypeOf(Area.prototype), "needUpdateTags", this).call(this, keys, AREA_UPDATE_TAG_KEY);
|
|
10954
|
+
}
|
|
10955
|
+
}, {
|
|
10956
|
+
key: "needUpdateTag",
|
|
10957
|
+
value: function needUpdateTag(key) {
|
|
10958
|
+
return _get(_getPrototypeOf(Area.prototype), "needUpdateTag", this).call(this, key, AREA_UPDATE_TAG_KEY);
|
|
10959
|
+
}
|
|
10960
|
+
}, {
|
|
10961
|
+
key: "toCustomPath",
|
|
10962
|
+
value: function toCustomPath() {
|
|
10963
|
+
var path = new CustomPath2D(),
|
|
10964
|
+
attribute = this.attribute,
|
|
10965
|
+
segments = attribute.segments,
|
|
10966
|
+
parsePoints = function parsePoints(points) {
|
|
10967
|
+
if (points && points.length) {
|
|
10968
|
+
var isFirst = !0;
|
|
10969
|
+
var basePoints = [];
|
|
10970
|
+
if (points.forEach(function (point) {
|
|
10971
|
+
var _a, _b;
|
|
10972
|
+
!1 !== point.defined && (isFirst ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y), basePoints.push({
|
|
10973
|
+
x: null !== (_a = point.x1) && void 0 !== _a ? _a : point.x,
|
|
10974
|
+
y: null !== (_b = point.y1) && void 0 !== _b ? _b : point.y
|
|
10975
|
+
}), isFirst = !1);
|
|
10976
|
+
}), basePoints.length) {
|
|
10977
|
+
for (var i = basePoints.length - 1; i >= 0; i--) path.lineTo(basePoints[i].x, basePoints[i].y);
|
|
10978
|
+
path.closePath();
|
|
10979
|
+
}
|
|
10980
|
+
}
|
|
10981
|
+
};
|
|
10982
|
+
return attribute.points ? parsePoints(attribute.points) : segments && segments.length && segments.forEach(function (seg) {
|
|
10983
|
+
parsePoints(seg.points);
|
|
10984
|
+
}), path;
|
|
10985
|
+
}
|
|
10986
|
+
}, {
|
|
10987
|
+
key: "clone",
|
|
10988
|
+
value: function clone() {
|
|
10989
|
+
return new Area(Object.assign({}, this.attribute));
|
|
10990
|
+
}
|
|
10991
|
+
}, {
|
|
10992
|
+
key: "getNoWorkAnimateAttr",
|
|
10993
|
+
value: function getNoWorkAnimateAttr() {
|
|
10994
|
+
return Area.NOWORK_ANIMATE_ATTR;
|
|
10995
|
+
}
|
|
10996
|
+
}]);
|
|
10997
|
+
return Area;
|
|
10998
|
+
}(Graphic);
|
|
10999
|
+
Area.NOWORK_ANIMATE_ATTR = Object.assign({
|
|
11000
|
+
segments: 1,
|
|
11001
|
+
curveType: 1
|
|
11002
|
+
}, NOWORK_ANIMATE_ATTR);
|
|
11003
|
+
function createArea(attributes) {
|
|
11004
|
+
return new Area(attributes);
|
|
11005
|
+
}
|
|
11006
|
+
|
|
10899
11007
|
var ARC_UPDATE_TAG_KEY = ["innerRadius", "outerRadius", "startAngle", "endAngle", "cornerRadius", "padAngle", "padRadius", "cap"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
10900
11008
|
var Arc = /*#__PURE__*/function (_Graphic) {
|
|
10901
11009
|
_inherits(Arc, _Graphic);
|
|
@@ -16676,6 +16784,10 @@
|
|
|
16676
16784
|
graphicCreator.RegisterGraphicCreator("arc", createArc);
|
|
16677
16785
|
}
|
|
16678
16786
|
|
|
16787
|
+
function registerAreaGraphic() {
|
|
16788
|
+
graphicCreator.RegisterGraphicCreator("area", createArea);
|
|
16789
|
+
}
|
|
16790
|
+
|
|
16679
16791
|
function registerCircleGraphic() {
|
|
16680
16792
|
graphicCreator.RegisterGraphicCreator("circle", createCircle);
|
|
16681
16793
|
}
|
|
@@ -16816,6 +16928,12 @@
|
|
|
16816
16928
|
_getNodeId(id) {
|
|
16817
16929
|
return `${this.id}-${this.name}-${id}`;
|
|
16818
16930
|
}
|
|
16931
|
+
_dispatchEvent(eventName, details) {
|
|
16932
|
+
var _a;
|
|
16933
|
+
const changeEvent = new CustomEvent(eventName, details);
|
|
16934
|
+
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
16935
|
+
this.dispatchEvent(changeEvent);
|
|
16936
|
+
}
|
|
16819
16937
|
}
|
|
16820
16938
|
|
|
16821
16939
|
function __rest(s, e) {
|
|
@@ -18330,7 +18448,7 @@
|
|
|
18330
18448
|
|
|
18331
18449
|
var loaded$b = !1;
|
|
18332
18450
|
function registerArea() {
|
|
18333
|
-
loaded$b || (loaded$b = !0, container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
|
|
18451
|
+
loaded$b || (loaded$b = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser ? areaCanvasPickModule : areaMathPickModule));
|
|
18334
18452
|
}
|
|
18335
18453
|
|
|
18336
18454
|
var loaded$a = !1;
|
|
@@ -18478,7 +18596,7 @@
|
|
|
18478
18596
|
const [currentPos, currentScrollValue] = this._computeScrollValue(e);
|
|
18479
18597
|
const range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
18480
18598
|
if (!realTime) {
|
|
18481
|
-
this.
|
|
18599
|
+
this._dispatchEvent('scroll', {
|
|
18482
18600
|
pre: preRange,
|
|
18483
18601
|
value: vutils.clampRange(range, limitRange[0], limitRange[1])
|
|
18484
18602
|
});
|
|
@@ -18514,7 +18632,7 @@
|
|
|
18514
18632
|
}
|
|
18515
18633
|
this.attribute.range = currScrollRange;
|
|
18516
18634
|
if (realTime) {
|
|
18517
|
-
this.
|
|
18635
|
+
this._dispatchEvent('scroll', {
|
|
18518
18636
|
pre: preRange,
|
|
18519
18637
|
value: currScrollRange
|
|
18520
18638
|
});
|
|
@@ -18617,12 +18735,6 @@
|
|
|
18617
18735
|
? vutils.clampRange([x1 + min * width, x1 + max * width], x1, width - sliderSize)
|
|
18618
18736
|
: vutils.clampRange([y1 + min * height, y1 + max * height], y1, height - sliderSize);
|
|
18619
18737
|
}
|
|
18620
|
-
_onChange(detail) {
|
|
18621
|
-
var _a;
|
|
18622
|
-
const changeEvent = new CustomEvent('scroll', detail);
|
|
18623
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
18624
|
-
this.dispatchEvent(changeEvent);
|
|
18625
|
-
}
|
|
18626
18738
|
_reset() {
|
|
18627
18739
|
this._sliderRenderBounds = null;
|
|
18628
18740
|
this._sliderLimitRange = null;
|
|
@@ -22502,7 +22614,7 @@
|
|
|
22502
22614
|
}
|
|
22503
22615
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
22504
22616
|
var _a, _b, _c, _d, _e, _f;
|
|
22505
|
-
const
|
|
22617
|
+
const { space = 4, inside = false, formatMethod, type = 'text', text } = this.attribute.label;
|
|
22506
22618
|
let offset = space;
|
|
22507
22619
|
let tickLength = 0;
|
|
22508
22620
|
if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.inside) === inside) {
|
|
@@ -22526,7 +22638,7 @@
|
|
|
22526
22638
|
const textContent = formatMethod
|
|
22527
22639
|
? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
|
|
22528
22640
|
: tickDatum.label;
|
|
22529
|
-
let { style: textStyle } =
|
|
22641
|
+
let { style: textStyle } = this.attribute.label;
|
|
22530
22642
|
textStyle = vutils.isFunction(textStyle)
|
|
22531
22643
|
? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
|
|
22532
22644
|
: textStyle;
|
|
@@ -24262,9 +24374,13 @@
|
|
|
24262
24374
|
this._activeState = true;
|
|
24263
24375
|
this._activeCache.startPos = this.eventPosToStagePos(e);
|
|
24264
24376
|
this._activeCache.lastPos = this.eventPosToStagePos(e);
|
|
24377
|
+
if (vglobal.env === 'browser') {
|
|
24378
|
+
vglobal.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
|
|
24379
|
+
vglobal.addEventListener('pointerup', this._onHandlerPointerUp.bind(this));
|
|
24380
|
+
}
|
|
24381
|
+
this.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
|
|
24265
24382
|
};
|
|
24266
|
-
this._onHandlerPointerMove = (e) => {
|
|
24267
|
-
var _a;
|
|
24383
|
+
this._onHandlerPointerMove = delayMap$1[this.attribute.delayType]((e) => {
|
|
24268
24384
|
e.stopPropagation();
|
|
24269
24385
|
const { start: startAttr, end: endAttr, brushSelect, realTime = true } = this.attribute;
|
|
24270
24386
|
const pos = this.eventPosToStagePos(e);
|
|
@@ -24302,10 +24418,13 @@
|
|
|
24302
24418
|
end = Math.min(Math.max(end, 0), 1);
|
|
24303
24419
|
if (startAttr !== start || endAttr !== end) {
|
|
24304
24420
|
this.setStateAttr(start, end, true);
|
|
24305
|
-
|
|
24306
|
-
|
|
24421
|
+
this._dispatchEvent('change', {
|
|
24422
|
+
start,
|
|
24423
|
+
end,
|
|
24424
|
+
tag: this._activeTag
|
|
24425
|
+
});
|
|
24307
24426
|
}
|
|
24308
|
-
};
|
|
24427
|
+
}, this.attribute.delayTime);
|
|
24309
24428
|
const { start, end, size, orient, showDetail, position, previewData, previewPointsX, previewPointsY, previewPointsX1, previewPointsY1, updateStateCallback } = this.attribute;
|
|
24310
24429
|
const { width, height } = size;
|
|
24311
24430
|
start && (this.state.start = start);
|
|
@@ -24328,13 +24447,12 @@
|
|
|
24328
24447
|
vutils.isFunction(previewPointsY) && (this._previewPointsY = previewPointsY);
|
|
24329
24448
|
vutils.isFunction(previewPointsX1) && (this._previewPointsX1 = previewPointsX1);
|
|
24330
24449
|
vutils.isFunction(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
|
|
24331
|
-
vutils.isFunction(updateStateCallback) && (this._updateStateCallback = updateStateCallback);
|
|
24332
24450
|
}
|
|
24333
24451
|
bindEvents() {
|
|
24334
24452
|
if (this.attribute.disableTriggerEvent) {
|
|
24335
24453
|
return;
|
|
24336
24454
|
}
|
|
24337
|
-
const { showDetail, brushSelect
|
|
24455
|
+
const { showDetail, brushSelect } = this.attribute;
|
|
24338
24456
|
if (this._startHandler) {
|
|
24339
24457
|
this._startHandler.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'start'));
|
|
24340
24458
|
}
|
|
@@ -24360,15 +24478,6 @@
|
|
|
24360
24478
|
if (this._selectedPreviewGroup) {
|
|
24361
24479
|
this._selectedPreviewGroup.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, selectedTag));
|
|
24362
24480
|
}
|
|
24363
|
-
if (vglobal.env === 'browser') {
|
|
24364
|
-
vglobal.addEventListener('pointermove', delayMap$1[delayType](this._onHandlerPointerMove.bind(this), delayTime), {
|
|
24365
|
-
capture: true
|
|
24366
|
-
});
|
|
24367
|
-
vglobal.addEventListener('pointerup', this._onHandlerPointerUp.bind(this));
|
|
24368
|
-
}
|
|
24369
|
-
this.addEventListener('pointermove', delayMap$1[delayType](this._onHandlerPointerMove, delayTime), {
|
|
24370
|
-
capture: true
|
|
24371
|
-
});
|
|
24372
24481
|
this.addEventListener('pointerup', this._onHandlerPointerUp);
|
|
24373
24482
|
this.addEventListener('pointerupoutside', this._onHandlerPointerUp);
|
|
24374
24483
|
if (showDetail === 'auto') {
|
|
@@ -24399,15 +24508,14 @@
|
|
|
24399
24508
|
shouldRender && this.setAttributes({ start, end });
|
|
24400
24509
|
}
|
|
24401
24510
|
eventPosToStagePos(e) {
|
|
24402
|
-
var _a, _b
|
|
24403
|
-
const
|
|
24511
|
+
var _a, _b;
|
|
24512
|
+
const { x, y } = vglobal.mapToCanvasPoint(e);
|
|
24404
24513
|
return {
|
|
24405
|
-
x:
|
|
24406
|
-
y:
|
|
24514
|
+
x: x - (((_a = this.stage) === null || _a === void 0 ? void 0 : _a.x) || 0),
|
|
24515
|
+
y: y - (((_b = this.stage) === null || _b === void 0 ? void 0 : _b.y) || 0)
|
|
24407
24516
|
};
|
|
24408
24517
|
}
|
|
24409
24518
|
_onHandlerPointerUp(e) {
|
|
24410
|
-
var _a;
|
|
24411
24519
|
e.preventDefault();
|
|
24412
24520
|
const { start, end, brushSelect, realTime = true } = this.attribute;
|
|
24413
24521
|
if (this._activeState) {
|
|
@@ -24420,9 +24528,17 @@
|
|
|
24420
24528
|
brushSelect && this.renderDragMask();
|
|
24421
24529
|
if (!realTime || start !== this.state.start || end !== this.state.end) {
|
|
24422
24530
|
this.setStateAttr(this.state.start, this.state.end, true);
|
|
24423
|
-
|
|
24424
|
-
|
|
24531
|
+
this._dispatchEvent('change', {
|
|
24532
|
+
start: this.state.start,
|
|
24533
|
+
end: this.state.end,
|
|
24534
|
+
tag: this._activeTag
|
|
24535
|
+
});
|
|
24536
|
+
}
|
|
24537
|
+
if (vglobal.env === 'browser') {
|
|
24538
|
+
vglobal.removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
|
|
24539
|
+
vglobal.removeEventListener('pointerup', this._onHandlerPointerUp.bind(this));
|
|
24425
24540
|
}
|
|
24541
|
+
this.removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
|
|
24426
24542
|
}
|
|
24427
24543
|
_onHandlerPointerEnter(e) {
|
|
24428
24544
|
e.stopPropagation();
|
|
@@ -24783,25 +24899,18 @@
|
|
|
24783
24899
|
container.add(labelShape);
|
|
24784
24900
|
return labelShape;
|
|
24785
24901
|
}
|
|
24786
|
-
_dispatchChangeEvent(start, end) {
|
|
24787
|
-
var _a;
|
|
24788
|
-
const changeEvent = new CustomEvent('change', {
|
|
24789
|
-
start,
|
|
24790
|
-
end
|
|
24791
|
-
});
|
|
24792
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
24793
|
-
this.dispatchEvent(changeEvent);
|
|
24794
|
-
}
|
|
24795
24902
|
setStartAndEnd(start, end) {
|
|
24796
|
-
var _a;
|
|
24797
24903
|
const { start: startAttr, end: endAttr } = this.attribute;
|
|
24798
24904
|
if (vutils.isValid(start) && vutils.isValid(end) && (start !== this.state.start || end !== this.state.end)) {
|
|
24799
24905
|
this.state.start = start;
|
|
24800
24906
|
this.state.end = end;
|
|
24801
24907
|
if (startAttr !== this.state.start || endAttr !== this.state.end) {
|
|
24802
24908
|
this.setStateAttr(start, end, true);
|
|
24803
|
-
|
|
24804
|
-
|
|
24909
|
+
this._dispatchEvent('change', {
|
|
24910
|
+
start,
|
|
24911
|
+
end,
|
|
24912
|
+
tag: this._activeTag
|
|
24913
|
+
});
|
|
24805
24914
|
}
|
|
24806
24915
|
}
|
|
24807
24916
|
}
|
|
@@ -24829,9 +24938,6 @@
|
|
|
24829
24938
|
const middleHandlerSymbolSize = (_d = (_c = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 10;
|
|
24830
24939
|
return Math.max(middleHandlerRectSize, ...vutils.array(middleHandlerSymbolSize));
|
|
24831
24940
|
}
|
|
24832
|
-
setUpdateStateCallback(callback) {
|
|
24833
|
-
vutils.isFunction(callback) && (this._updateStateCallback = callback);
|
|
24834
|
-
}
|
|
24835
24941
|
setPreviewPointsX(callback) {
|
|
24836
24942
|
vutils.isFunction(callback) && (this._previewPointsX = callback);
|
|
24837
24943
|
}
|
|
@@ -25653,7 +25759,6 @@
|
|
|
25653
25759
|
target.removeState('hover');
|
|
25654
25760
|
};
|
|
25655
25761
|
this._onClick = (e) => {
|
|
25656
|
-
var _a, _b;
|
|
25657
25762
|
const target = e.target;
|
|
25658
25763
|
if (target.name === 'preHandler') {
|
|
25659
25764
|
if (this._current === 1) {
|
|
@@ -25666,14 +25771,12 @@
|
|
|
25666
25771
|
else {
|
|
25667
25772
|
target.removeState('disable');
|
|
25668
25773
|
}
|
|
25669
|
-
|
|
25774
|
+
this._dispatchEvent('toPrev', {
|
|
25670
25775
|
current: this._current,
|
|
25671
25776
|
total: this._total,
|
|
25672
25777
|
direction: 'pre',
|
|
25673
25778
|
event: e
|
|
25674
25779
|
});
|
|
25675
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
25676
|
-
this.dispatchEvent(changeEvent);
|
|
25677
25780
|
}
|
|
25678
25781
|
if (target.name === 'nextHandler') {
|
|
25679
25782
|
if (this._current === this._total) {
|
|
@@ -25686,14 +25789,12 @@
|
|
|
25686
25789
|
else {
|
|
25687
25790
|
target.removeState('disable');
|
|
25688
25791
|
}
|
|
25689
|
-
|
|
25792
|
+
this._dispatchEvent('toNext', {
|
|
25690
25793
|
current: this._current,
|
|
25691
25794
|
total: this._total,
|
|
25692
25795
|
direction: 'next',
|
|
25693
25796
|
event: e
|
|
25694
25797
|
});
|
|
25695
|
-
changeEvent.manager = (_b = this.stage) === null || _b === void 0 ? void 0 : _b.eventSystem.manager;
|
|
25696
|
-
this.dispatchEvent(changeEvent);
|
|
25697
25798
|
}
|
|
25698
25799
|
if (this._current > 1) {
|
|
25699
25800
|
this.preHandler.removeState('disable');
|
|
@@ -25996,7 +26097,7 @@
|
|
|
25996
26097
|
const currentSelectedItems = this._getSelectedLegends();
|
|
25997
26098
|
if (selectMode === 'multiple') {
|
|
25998
26099
|
if (allowAllCanceled === false && isSelected && currentSelectedItems.length === 1) {
|
|
25999
|
-
this.
|
|
26100
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemClick, legendItem, e);
|
|
26000
26101
|
return;
|
|
26001
26102
|
}
|
|
26002
26103
|
if (isSelected) {
|
|
@@ -26019,7 +26120,7 @@
|
|
|
26019
26120
|
});
|
|
26020
26121
|
}
|
|
26021
26122
|
}
|
|
26022
|
-
this.
|
|
26123
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemClick, legendItem, e);
|
|
26023
26124
|
}
|
|
26024
26125
|
};
|
|
26025
26126
|
}
|
|
@@ -26156,26 +26257,27 @@
|
|
|
26156
26257
|
}
|
|
26157
26258
|
}
|
|
26158
26259
|
_renderEachItem(item, isSelected, index, items) {
|
|
26260
|
+
var _a, _b;
|
|
26159
26261
|
const { id, label, value, shape } = item;
|
|
26160
|
-
const { padding = 0, focus, focusIconStyle
|
|
26161
|
-
|
|
26162
|
-
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26262
|
+
const { padding = 0, focus, focusIconStyle } = this.attribute.item;
|
|
26263
|
+
const { shape: shapeAttr, label: labelAttr, value: valueAttr, background } = this.attribute.item;
|
|
26264
|
+
const shapeStyle = this._handleStyle(shapeAttr, item, isSelected, index, items);
|
|
26265
|
+
const labelStyle = this._handleStyle(labelAttr, item, isSelected, index, items);
|
|
26266
|
+
const valueStyle = this._handleStyle(valueAttr, item, isSelected, index, items);
|
|
26267
|
+
const backgroundStyle = this._handleStyle(background, item, isSelected, index, items);
|
|
26166
26268
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
26167
26269
|
let itemGroup;
|
|
26168
26270
|
if (background.visible === false) {
|
|
26169
26271
|
itemGroup = graphicCreator.group({
|
|
26170
26272
|
x: 0,
|
|
26171
26273
|
y: 0,
|
|
26172
|
-
cursor: (
|
|
26274
|
+
cursor: (_a = backgroundStyle.style) === null || _a === void 0 ? void 0 : _a.cursor
|
|
26173
26275
|
});
|
|
26174
26276
|
this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup);
|
|
26175
26277
|
}
|
|
26176
26278
|
else {
|
|
26177
|
-
itemGroup = graphicCreator.group(Object.assign({ x: 0, y: 0 },
|
|
26178
|
-
this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup,
|
|
26279
|
+
itemGroup = graphicCreator.group(Object.assign({ x: 0, y: 0 }, backgroundStyle.style));
|
|
26280
|
+
this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state);
|
|
26179
26281
|
}
|
|
26180
26282
|
itemGroup.id = `${id !== null && id !== void 0 ? id : label}-${index}`;
|
|
26181
26283
|
itemGroup.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
|
|
@@ -26189,20 +26291,20 @@
|
|
|
26189
26291
|
let shapeSize = 0;
|
|
26190
26292
|
let shapeSpace = 0;
|
|
26191
26293
|
if ((shapeAttr === null || shapeAttr === void 0 ? void 0 : shapeAttr.visible) !== false) {
|
|
26192
|
-
shapeSize = vutils.get(
|
|
26294
|
+
shapeSize = vutils.get(shapeStyle, 'style.size', DEFAULT_SHAPE_SIZE);
|
|
26193
26295
|
shapeSpace = vutils.get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);
|
|
26194
|
-
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: 0, symbolType: 'circle', strokeBoundsBuffer: 0 }, shape),
|
|
26195
|
-
Object.keys(
|
|
26196
|
-
const color =
|
|
26197
|
-
|
|
26198
|
-
if (shape.fill && vutils.isNil(
|
|
26199
|
-
|
|
26296
|
+
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: 0, symbolType: 'circle', strokeBoundsBuffer: 0 }, shape), shapeStyle.style));
|
|
26297
|
+
Object.keys(shapeStyle.state || {}).forEach(key => {
|
|
26298
|
+
const color = shapeStyle.state[key].fill ||
|
|
26299
|
+
shapeStyle.state[key].stroke;
|
|
26300
|
+
if (shape.fill && vutils.isNil(shapeStyle.state[key].fill) && color) {
|
|
26301
|
+
shapeStyle.state[key].fill = color;
|
|
26200
26302
|
}
|
|
26201
|
-
if (shape.stroke && vutils.isNil(
|
|
26202
|
-
|
|
26303
|
+
if (shape.stroke && vutils.isNil(shapeStyle.state[key].stroke) && color) {
|
|
26304
|
+
shapeStyle.state[key].stroke = color;
|
|
26203
26305
|
}
|
|
26204
26306
|
});
|
|
26205
|
-
this._appendDataToShape(itemShape, exports.LEGEND_ELEMENT_NAME.itemShape, item, itemGroup,
|
|
26307
|
+
this._appendDataToShape(itemShape, exports.LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state);
|
|
26206
26308
|
itemShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
|
|
26207
26309
|
innerGroup.add(itemShape);
|
|
26208
26310
|
}
|
|
@@ -26214,15 +26316,15 @@
|
|
|
26214
26316
|
this._appendDataToShape(focusShape, exports.LEGEND_ELEMENT_NAME.focus, item, itemGroup);
|
|
26215
26317
|
focusSpace = focusSize;
|
|
26216
26318
|
}
|
|
26217
|
-
const labelShape = graphicCreator.text(Object.assign(Object.assign({ x: shapeSize / 2 + shapeSpace, y: 0, textAlign: 'start', textBaseline: 'middle', lineHeight: (
|
|
26218
|
-
this._appendDataToShape(labelShape, exports.LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup,
|
|
26319
|
+
const labelShape = graphicCreator.text(Object.assign(Object.assign({ x: shapeSize / 2 + shapeSpace, y: 0, textAlign: 'start', textBaseline: 'middle', lineHeight: (_b = labelStyle.style) === null || _b === void 0 ? void 0 : _b.fontSize }, labelStyle.style), { text: labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label }));
|
|
26320
|
+
this._appendDataToShape(labelShape, exports.LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state);
|
|
26219
26321
|
labelShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
|
|
26220
26322
|
innerGroup.add(labelShape);
|
|
26221
26323
|
const labelSpace = vutils.get(labelAttr, 'space', DEFAULT_LABEL_SPACE);
|
|
26222
26324
|
if (vutils.isValid(value)) {
|
|
26223
26325
|
const valueSpace = vutils.get(valueAttr, 'space', focus ? DEFAULT_VALUE_SPACE : 0);
|
|
26224
|
-
const valueShape = graphicCreator.text(Object.assign(Object.assign({ x: 0, y: 0, textAlign: 'start', textBaseline: 'middle', lineHeight:
|
|
26225
|
-
this._appendDataToShape(valueShape, exports.LEGEND_ELEMENT_NAME.itemValue, item, itemGroup,
|
|
26326
|
+
const valueShape = graphicCreator.text(Object.assign(Object.assign({ x: 0, y: 0, textAlign: 'start', textBaseline: 'middle', lineHeight: valueStyle.style.fontSize }, valueStyle.style), { text: valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value }));
|
|
26327
|
+
this._appendDataToShape(valueShape, exports.LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state);
|
|
26226
26328
|
valueShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
|
|
26227
26329
|
if (this._itemWidthByUser) {
|
|
26228
26330
|
const layoutWidth = this._itemWidthByUser -
|
|
@@ -26441,7 +26543,7 @@
|
|
|
26441
26543
|
if (focusButton) {
|
|
26442
26544
|
focusButton.setAttribute('visible', true);
|
|
26443
26545
|
}
|
|
26444
|
-
this.
|
|
26546
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemHover, legendItem, e);
|
|
26445
26547
|
}
|
|
26446
26548
|
_unHover(legendItem, e) {
|
|
26447
26549
|
let attributeUpdate = false;
|
|
@@ -26466,9 +26568,9 @@
|
|
|
26466
26568
|
focusButton.setAttribute('visible', false);
|
|
26467
26569
|
}
|
|
26468
26570
|
if (attributeUpdate) {
|
|
26469
|
-
this.
|
|
26571
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
|
|
26470
26572
|
}
|
|
26471
|
-
this.
|
|
26573
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemUnHover, legendItem, e);
|
|
26472
26574
|
}
|
|
26473
26575
|
_setLegendItemState(legendItem, stateName, e) {
|
|
26474
26576
|
const keepCurrentStates = true;
|
|
@@ -26489,7 +26591,7 @@
|
|
|
26489
26591
|
}
|
|
26490
26592
|
});
|
|
26491
26593
|
if (attributeUpdate) {
|
|
26492
|
-
this.
|
|
26594
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
|
|
26493
26595
|
}
|
|
26494
26596
|
}
|
|
26495
26597
|
_removeLegendItemState(legendItem, stateNames, e) {
|
|
@@ -26514,7 +26616,7 @@
|
|
|
26514
26616
|
}
|
|
26515
26617
|
});
|
|
26516
26618
|
if (attributeUpdate) {
|
|
26517
|
-
this.
|
|
26619
|
+
this._dispatchLegendEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
|
|
26518
26620
|
}
|
|
26519
26621
|
}
|
|
26520
26622
|
_getSelectedLegends() {
|
|
@@ -26533,12 +26635,11 @@
|
|
|
26533
26635
|
shape.delegate = delegateShape;
|
|
26534
26636
|
shape.states = vutils.merge({}, DEFAULT_STATES, states);
|
|
26535
26637
|
}
|
|
26536
|
-
|
|
26537
|
-
var _a;
|
|
26638
|
+
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
26538
26639
|
const currentSelectedItems = this._getSelectedLegends();
|
|
26539
26640
|
currentSelectedItems.sort((pre, next) => pre.index - next.index);
|
|
26540
26641
|
const currentSelected = currentSelectedItems.map((obj) => obj.label);
|
|
26541
|
-
|
|
26642
|
+
this._dispatchEvent(eventName, {
|
|
26542
26643
|
item: legendItem,
|
|
26543
26644
|
data: legendItem.data,
|
|
26544
26645
|
selected: legendItem.hasState(exports.LegendStateValue.selected),
|
|
@@ -26546,18 +26647,27 @@
|
|
|
26546
26647
|
currentSelected,
|
|
26547
26648
|
event
|
|
26548
26649
|
});
|
|
26549
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
26550
|
-
this.dispatchEvent(changeEvent);
|
|
26551
26650
|
}
|
|
26552
26651
|
_handleStyle(config, item, isSelected, index, items) {
|
|
26553
|
-
const newConfig =
|
|
26554
|
-
if (config.style
|
|
26555
|
-
|
|
26652
|
+
const newConfig = {};
|
|
26653
|
+
if (config.style) {
|
|
26654
|
+
if (vutils.isFunction(config.style)) {
|
|
26655
|
+
newConfig.style = config.style(item, isSelected, index, items);
|
|
26656
|
+
}
|
|
26657
|
+
else {
|
|
26658
|
+
newConfig.style = config.style;
|
|
26659
|
+
}
|
|
26556
26660
|
}
|
|
26557
26661
|
if (config.state) {
|
|
26662
|
+
newConfig.state = {};
|
|
26558
26663
|
Object.keys(config.state).forEach(key => {
|
|
26559
|
-
if (config.state[key]
|
|
26560
|
-
|
|
26664
|
+
if (config.state[key]) {
|
|
26665
|
+
if (vutils.isFunction(config.state[key])) {
|
|
26666
|
+
newConfig.state[key] = config.state[key](item, isSelected, index, items);
|
|
26667
|
+
}
|
|
26668
|
+
else {
|
|
26669
|
+
newConfig.state[key] = config.state[key];
|
|
26670
|
+
}
|
|
26561
26671
|
}
|
|
26562
26672
|
});
|
|
26563
26673
|
}
|
|
@@ -27222,10 +27332,9 @@
|
|
|
27222
27332
|
}
|
|
27223
27333
|
}
|
|
27224
27334
|
_dispatchChangeEvent() {
|
|
27225
|
-
var _a;
|
|
27226
27335
|
const isRange = !!this.attribute.range;
|
|
27227
27336
|
const currentValue = this._currentValue;
|
|
27228
|
-
|
|
27337
|
+
this._dispatchEvent('change', {
|
|
27229
27338
|
value: isRange
|
|
27230
27339
|
? [
|
|
27231
27340
|
Math.min(currentValue.endValue, currentValue.startValue),
|
|
@@ -27239,8 +27348,6 @@
|
|
|
27239
27348
|
]
|
|
27240
27349
|
: currentValue.startPos
|
|
27241
27350
|
});
|
|
27242
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
27243
|
-
this.dispatchEvent(changeEvent);
|
|
27244
27351
|
}
|
|
27245
27352
|
_getHandlers() {
|
|
27246
27353
|
let startHandler = this._startHandler;
|
|
@@ -28158,12 +28265,6 @@
|
|
|
28158
28265
|
this.forward();
|
|
28159
28266
|
});
|
|
28160
28267
|
};
|
|
28161
|
-
this._createCustomEvent = (eventType) => {
|
|
28162
|
-
var _a;
|
|
28163
|
-
const customEvent = new CustomEvent(eventType, { eventType });
|
|
28164
|
-
customEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
28165
|
-
return customEvent;
|
|
28166
|
-
};
|
|
28167
28268
|
this.renderPlay = () => {
|
|
28168
28269
|
if (this._isPaused) {
|
|
28169
28270
|
this._playController.setAttributes(Object.assign({ symbolType: this._playController.getComputedAttribute('symbolType') }, this._startAttr.style));
|
|
@@ -28179,20 +28280,16 @@
|
|
|
28179
28280
|
this._forwardController.setAttributes(this._forwardAttr.style);
|
|
28180
28281
|
};
|
|
28181
28282
|
this.play = () => {
|
|
28182
|
-
|
|
28183
|
-
this.dispatchEvent(onPlayEvent);
|
|
28283
|
+
this._dispatchEvent('ControllerEventEnum.OnPlay');
|
|
28184
28284
|
};
|
|
28185
28285
|
this.pause = () => {
|
|
28186
|
-
|
|
28187
|
-
this.dispatchEvent(onPauseEvent);
|
|
28286
|
+
this._dispatchEvent('ControllerEventEnum.OnPause');
|
|
28188
28287
|
};
|
|
28189
28288
|
this.forward = () => {
|
|
28190
|
-
|
|
28191
|
-
this.dispatchEvent(onPlayEvent);
|
|
28289
|
+
this._dispatchEvent('ControllerEventEnum.OnForward');
|
|
28192
28290
|
};
|
|
28193
28291
|
this.backward = () => {
|
|
28194
|
-
|
|
28195
|
-
this.dispatchEvent(onPlayEvent);
|
|
28292
|
+
this._dispatchEvent('ControllerEventEnum.OnBackward');
|
|
28196
28293
|
};
|
|
28197
28294
|
this.togglePlay = () => {
|
|
28198
28295
|
this._playController.setAttributes(this._startAttr.style);
|
|
@@ -28467,14 +28564,11 @@
|
|
|
28467
28564
|
this._controller.setAttributes(attrs);
|
|
28468
28565
|
}
|
|
28469
28566
|
dispatchCustomEvent(eventType, dataIndex) {
|
|
28470
|
-
|
|
28471
|
-
const changeEvent = new CustomEvent(eventType, {
|
|
28567
|
+
this._dispatchEvent(eventType, {
|
|
28472
28568
|
eventType,
|
|
28473
28569
|
index: dataIndex,
|
|
28474
28570
|
value: this._data[dataIndex]
|
|
28475
28571
|
});
|
|
28476
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
28477
|
-
this.dispatchEvent(changeEvent);
|
|
28478
28572
|
}
|
|
28479
28573
|
}
|
|
28480
28574
|
BasePlayer.defaultAttributes = {
|
|
@@ -28908,20 +29002,27 @@
|
|
|
28908
29002
|
if (this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick) {
|
|
28909
29003
|
this._container.incrementalClearChild();
|
|
28910
29004
|
this._brushMaskAABBBoundsDict = {};
|
|
28911
|
-
this.
|
|
28912
|
-
this.
|
|
28913
|
-
|
|
28914
|
-
|
|
28915
|
-
|
|
28916
|
-
});
|
|
29005
|
+
this._dispatchEvent(exports.IOperateType.brushClear, {
|
|
29006
|
+
operateMask: this._operatingMask,
|
|
29007
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29008
|
+
event: e
|
|
29009
|
+
});
|
|
28917
29010
|
}
|
|
28918
29011
|
else if (!this._outOfInteractiveRange(e)) {
|
|
28919
|
-
this.
|
|
28920
|
-
this.
|
|
28921
|
-
operateType: this._activeDrawState ? exports.IOperateType.drawEnd : exports.IOperateType.moveEnd,
|
|
29012
|
+
if (this._activeDrawState) {
|
|
29013
|
+
this._dispatchEvent(exports.IOperateType.drawEnd, {
|
|
28922
29014
|
operateMask: this._operatingMask,
|
|
28923
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
|
|
29015
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29016
|
+
event: e
|
|
28924
29017
|
});
|
|
29018
|
+
}
|
|
29019
|
+
if (this._activeMoveState) {
|
|
29020
|
+
this._dispatchEvent(exports.IOperateType.moveEnd, {
|
|
29021
|
+
operateMask: this._operatingMask,
|
|
29022
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29023
|
+
event: e
|
|
29024
|
+
});
|
|
29025
|
+
}
|
|
28925
29026
|
}
|
|
28926
29027
|
this._activeDrawState = false;
|
|
28927
29028
|
this._activeMoveState = false;
|
|
@@ -28929,7 +29030,7 @@
|
|
|
28929
29030
|
(_a = this._operatingMask) === null || _a === void 0 ? void 0 : _a.setAttribute('pickable', false);
|
|
28930
29031
|
};
|
|
28931
29032
|
}
|
|
28932
|
-
|
|
29033
|
+
_bindBrushEvents() {
|
|
28933
29034
|
if (this.attribute.disableTriggerEvent) {
|
|
28934
29035
|
return;
|
|
28935
29036
|
}
|
|
@@ -28967,12 +29068,11 @@
|
|
|
28967
29068
|
this._container.incrementalClearChild();
|
|
28968
29069
|
}
|
|
28969
29070
|
this._addBrushMask();
|
|
28970
|
-
this.
|
|
28971
|
-
this.
|
|
28972
|
-
|
|
28973
|
-
|
|
28974
|
-
|
|
28975
|
-
});
|
|
29071
|
+
this._dispatchEvent(exports.IOperateType.drawStart, {
|
|
29072
|
+
operateMask: this._operatingMask,
|
|
29073
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29074
|
+
event: e
|
|
29075
|
+
});
|
|
28976
29076
|
}
|
|
28977
29077
|
_initMove(e) {
|
|
28978
29078
|
var _a, _b;
|
|
@@ -28989,12 +29089,11 @@
|
|
|
28989
29089
|
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX];
|
|
28990
29090
|
this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY];
|
|
28991
29091
|
this._operatingMask.setAttribute('pickable', true);
|
|
28992
|
-
this.
|
|
28993
|
-
this.
|
|
28994
|
-
|
|
28995
|
-
|
|
28996
|
-
|
|
28997
|
-
});
|
|
29092
|
+
this._dispatchEvent(exports.IOperateType.moveStart, {
|
|
29093
|
+
operateMask: this._operatingMask,
|
|
29094
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29095
|
+
event: e
|
|
29096
|
+
});
|
|
28998
29097
|
}
|
|
28999
29098
|
_drawing(e) {
|
|
29000
29099
|
var _a;
|
|
@@ -29018,12 +29117,11 @@
|
|
|
29018
29117
|
const maskPoints = this._computeMaskPoints();
|
|
29019
29118
|
this._operatingMask.setAttribute('points', maskPoints);
|
|
29020
29119
|
this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
|
|
29021
|
-
this.
|
|
29022
|
-
this.
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
});
|
|
29120
|
+
this._dispatchEvent(exports.IOperateType.drawing, {
|
|
29121
|
+
operateMask: this._operatingMask,
|
|
29122
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29123
|
+
event: e
|
|
29124
|
+
});
|
|
29027
29125
|
}
|
|
29028
29126
|
_moving(e) {
|
|
29029
29127
|
const startPos = this._cacheMovePoint;
|
|
@@ -29042,12 +29140,11 @@
|
|
|
29042
29140
|
dy: moveY
|
|
29043
29141
|
});
|
|
29044
29142
|
this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
|
|
29045
|
-
this.
|
|
29046
|
-
this.
|
|
29047
|
-
|
|
29048
|
-
|
|
29049
|
-
|
|
29050
|
-
});
|
|
29143
|
+
this._dispatchEvent(exports.IOperateType.moving, {
|
|
29144
|
+
operateMask: this._operatingMask,
|
|
29145
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29146
|
+
event: e
|
|
29147
|
+
});
|
|
29051
29148
|
}
|
|
29052
29149
|
_computeMaskPoints() {
|
|
29053
29150
|
const { brushType, xRange = [0, 0], yRange = [0, 0] } = this.attribute;
|
|
@@ -29132,21 +29229,18 @@
|
|
|
29132
29229
|
return false;
|
|
29133
29230
|
}
|
|
29134
29231
|
eventPosToStagePos(e) {
|
|
29135
|
-
var _a, _b
|
|
29136
|
-
const
|
|
29232
|
+
var _a, _b;
|
|
29233
|
+
const { x, y } = vglobal.mapToCanvasPoint(e);
|
|
29137
29234
|
return {
|
|
29138
|
-
x:
|
|
29139
|
-
y:
|
|
29235
|
+
x: x - (((_a = this.stage) === null || _a === void 0 ? void 0 : _a.x) || 0),
|
|
29236
|
+
y: y - (((_b = this.stage) === null || _b === void 0 ? void 0 : _b.y) || 0)
|
|
29140
29237
|
};
|
|
29141
29238
|
}
|
|
29142
29239
|
render() {
|
|
29143
|
-
this.
|
|
29240
|
+
this._bindBrushEvents();
|
|
29144
29241
|
const group = this.createOrUpdateChild('brush-container', {}, 'group');
|
|
29145
29242
|
this._container = group;
|
|
29146
29243
|
}
|
|
29147
|
-
setUpdateDragMaskCallback(callback) {
|
|
29148
|
-
vutils.isFunction(callback) && (this._updateDragMaskCallback = callback);
|
|
29149
|
-
}
|
|
29150
29244
|
releaseBrushEvents() {
|
|
29151
29245
|
const { delayType = 'throttle', delayTime = 0, trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger, updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger, endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger, resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger } = this.attribute;
|
|
29152
29246
|
this.stage.removeEventListener(trigger, this._onBrushStart);
|
|
@@ -29719,7 +29813,6 @@
|
|
|
29719
29813
|
});
|
|
29720
29814
|
}
|
|
29721
29815
|
handleClick() {
|
|
29722
|
-
var _a;
|
|
29723
29816
|
if (this.attribute.disabled) {
|
|
29724
29817
|
return;
|
|
29725
29818
|
}
|
|
@@ -29731,12 +29824,10 @@
|
|
|
29731
29824
|
this.setAttribute('checked', true);
|
|
29732
29825
|
this.setAttribute('indeterminate', false);
|
|
29733
29826
|
}
|
|
29734
|
-
|
|
29827
|
+
this._dispatchEvent('checkbox_state_change', {
|
|
29735
29828
|
eventType: 'checkbox_state_change',
|
|
29736
29829
|
checked: this.attribute.checked
|
|
29737
29830
|
});
|
|
29738
|
-
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
29739
|
-
this.dispatchEvent(changeEvent);
|
|
29740
29831
|
}
|
|
29741
29832
|
}
|
|
29742
29833
|
CheckBox.defaultAttributes = {
|
|
@@ -29777,7 +29868,7 @@
|
|
|
29777
29868
|
}
|
|
29778
29869
|
};
|
|
29779
29870
|
|
|
29780
|
-
const version = "0.17.2-alpha.
|
|
29871
|
+
const version = "0.17.2-alpha.4";
|
|
29781
29872
|
|
|
29782
29873
|
exports.AbstractComponent = AbstractComponent;
|
|
29783
29874
|
exports.ArcInfo = ArcInfo;
|