@visactor/vrender-components 0.17.2-alpha.3 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/cjs/axis/base.js +2 -12
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/brush/brush.d.ts +3 -12
  4. package/cjs/brush/brush.js +29 -28
  5. package/cjs/brush/brush.js.map +1 -1
  6. package/cjs/checkbox/checkbox.js +4 -8
  7. package/cjs/checkbox/checkbox.js.map +1 -1
  8. package/cjs/core/base.d.ts +2 -0
  9. package/cjs/core/base.js +6 -0
  10. package/cjs/core/base.js.map +1 -1
  11. package/cjs/data-zoom/config.d.ts +18 -0
  12. package/cjs/data-zoom/config.js +19 -1
  13. package/cjs/data-zoom/config.js.map +1 -1
  14. package/cjs/data-zoom/data-zoom.d.ts +4 -3
  15. package/cjs/data-zoom/data-zoom.js +130 -113
  16. package/cjs/data-zoom/data-zoom.js.map +1 -1
  17. package/cjs/data-zoom/type.d.ts +6 -2
  18. package/cjs/data-zoom/type.js.map +1 -1
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/legend/discrete/discrete.d.ts +1 -1
  23. package/cjs/legend/discrete/discrete.js +33 -37
  24. package/cjs/legend/discrete/discrete.js.map +1 -1
  25. package/cjs/pager/pager.js +4 -9
  26. package/cjs/pager/pager.js.map +1 -1
  27. package/cjs/player/base-player.js +2 -5
  28. package/cjs/player/base-player.js.map +1 -1
  29. package/cjs/player/controller/controller.d.ts +0 -1
  30. package/cjs/player/controller/controller.js +5 -16
  31. package/cjs/player/controller/controller.js.map +1 -1
  32. package/cjs/scrollbar/scrollbar.d.ts +0 -1
  33. package/cjs/scrollbar/scrollbar.js +4 -10
  34. package/cjs/scrollbar/scrollbar.js.map +1 -1
  35. package/cjs/slider/slider.js +2 -4
  36. package/cjs/slider/slider.js.map +1 -1
  37. package/dist/index.js +206 -197
  38. package/dist/index.min.js +1 -1
  39. package/es/axis/base.js +2 -12
  40. package/es/axis/base.js.map +1 -1
  41. package/es/brush/brush.d.ts +3 -12
  42. package/es/brush/brush.js +31 -30
  43. package/es/brush/brush.js.map +1 -1
  44. package/es/checkbox/checkbox.js +5 -9
  45. package/es/checkbox/checkbox.js.map +1 -1
  46. package/es/core/base.d.ts +2 -0
  47. package/es/core/base.js +7 -1
  48. package/es/core/base.js.map +1 -1
  49. package/es/data-zoom/config.d.ts +18 -0
  50. package/es/data-zoom/config.js +19 -0
  51. package/es/data-zoom/config.js.map +1 -1
  52. package/es/data-zoom/data-zoom.d.ts +4 -3
  53. package/es/data-zoom/data-zoom.js +131 -114
  54. package/es/data-zoom/data-zoom.js.map +1 -1
  55. package/es/data-zoom/type.d.ts +6 -2
  56. package/es/data-zoom/type.js.map +1 -1
  57. package/es/index.d.ts +1 -1
  58. package/es/index.js +1 -1
  59. package/es/index.js.map +1 -1
  60. package/es/legend/discrete/discrete.d.ts +1 -1
  61. package/es/legend/discrete/discrete.js +33 -38
  62. package/es/legend/discrete/discrete.js.map +1 -1
  63. package/es/pager/pager.js +5 -10
  64. package/es/pager/pager.js.map +1 -1
  65. package/es/player/base-player.js +1 -6
  66. package/es/player/base-player.js.map +1 -1
  67. package/es/player/controller/controller.d.ts +0 -1
  68. package/es/player/controller/controller.js +5 -18
  69. package/es/player/controller/controller.js.map +1 -1
  70. package/es/scrollbar/scrollbar.d.ts +0 -1
  71. package/es/scrollbar/scrollbar.js +5 -11
  72. package/es/scrollbar/scrollbar.js.map +1 -1
  73. package/es/slider/slider.js +3 -5
  74. package/es/slider/slider.js.map +1 -1
  75. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -12759,24 +12759,25 @@
12759
12759
  var halfPi = vutils.pi / 2;
12760
12760
  function createRectPath(path, x, y, width, height, rectCornerRadius) {
12761
12761
  var cornerRadius;
12762
- if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), vutils.isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius, rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
12762
+ if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), vutils.isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = vutils.abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
12763
12763
  var cornerRadiusArr = rectCornerRadius;
12764
+ var cr0, cr1;
12764
12765
  switch (cornerRadiusArr.length) {
12765
12766
  case 0:
12766
12767
  cornerRadius = [0, 0, 0, 0];
12767
12768
  break;
12768
12769
  case 1:
12769
- cornerRadius = [cornerRadiusArr[0], cornerRadiusArr[0], cornerRadiusArr[0], cornerRadiusArr[0]];
12770
+ cr0 = vutils.abs(cornerRadiusArr[0]), cornerRadius = [cr0, cr0, cr0, cr0];
12770
12771
  break;
12771
12772
  case 2:
12772
12773
  case 3:
12773
- cornerRadius = [cornerRadiusArr[0], cornerRadiusArr[1], cornerRadiusArr[0], cornerRadiusArr[1]];
12774
+ cr0 = vutils.abs(cornerRadiusArr[0]), cr1 = vutils.abs(cornerRadiusArr[1]), cornerRadius = [cr0, cr1, cr0, cr1];
12774
12775
  break;
12775
12776
  default:
12776
- cornerRadius = cornerRadiusArr.slice(0, 5);
12777
+ cornerRadius = cornerRadiusArr, cornerRadius[0] = vutils.abs(cornerRadius[0]), cornerRadius[1] = vutils.abs(cornerRadius[1]), cornerRadius[2] = vutils.abs(cornerRadius[2]), cornerRadius[3] = vutils.abs(cornerRadius[3]);
12777
12778
  }
12778
12779
  } else cornerRadius = [0, 0, 0, 0];
12779
- if (width < 0 || Math.abs(cornerRadius[0]) + Math.abs(cornerRadius[1]) + Math.abs(cornerRadius[2]) + Math.abs(cornerRadius[3]) < 1e-12) return path.rect(x, y, width, height);
12780
+ if (width < 0 || cornerRadius[0] + cornerRadius[1] + cornerRadius[2] + cornerRadius[3] < 1e-12) return path.rect(x, y, width, height);
12780
12781
  var leftTop = [x, y],
12781
12782
  rightTop = [x + width, y],
12782
12783
  rightBottom = [x + width, y + height],
@@ -14915,11 +14916,8 @@
14915
14916
  context.highPerformanceSave();
14916
14917
  var g = graphic.shadowRoot,
14917
14918
  currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
14918
- newPoint = new vutils.Point(point.x, point.y);
14919
- parentMatrix.transformPoint(newPoint, newPoint);
14920
- var transMatrix = graphic.transMatrix;
14921
- currentGroupMatrix.multiply(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);
14922
- var result = pickerService.pickGroup(g, newPoint.clone(), currentGroupMatrix, pickParams);
14919
+ newPoint = new vutils.Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
14920
+ result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
14923
14921
  return context.highPerformanceRestore(), result;
14924
14922
  }
14925
14923
  }]);
@@ -16928,6 +16926,12 @@
16928
16926
  _getNodeId(id) {
16929
16927
  return `${this.id}-${this.name}-${id}`;
16930
16928
  }
16929
+ _dispatchEvent(eventName, details) {
16930
+ var _a;
16931
+ const changeEvent = new CustomEvent(eventName, details);
16932
+ changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
16933
+ this.dispatchEvent(changeEvent);
16934
+ }
16931
16935
  }
16932
16936
 
16933
16937
  function __rest(s, e) {
@@ -18590,7 +18594,7 @@
18590
18594
  const [currentPos, currentScrollValue] = this._computeScrollValue(e);
18591
18595
  const range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
18592
18596
  if (!realTime) {
18593
- this._onChange({
18597
+ this._dispatchEvent('scroll', {
18594
18598
  pre: preRange,
18595
18599
  value: vutils.clampRange(range, limitRange[0], limitRange[1])
18596
18600
  });
@@ -18626,7 +18630,7 @@
18626
18630
  }
18627
18631
  this.attribute.range = currScrollRange;
18628
18632
  if (realTime) {
18629
- this._onChange({
18633
+ this._dispatchEvent('scroll', {
18630
18634
  pre: preRange,
18631
18635
  value: currScrollRange
18632
18636
  });
@@ -18695,8 +18699,8 @@
18695
18699
  y1: top,
18696
18700
  x2: width - right,
18697
18701
  y2: height - bottom,
18698
- width: width - (left + right),
18699
- height: height - (top + bottom)
18702
+ width: Math.max(0, width - (left + right)),
18703
+ height: Math.max(0, height - (top + bottom))
18700
18704
  };
18701
18705
  this._sliderRenderBounds = renderBounds;
18702
18706
  return renderBounds;
@@ -18729,12 +18733,6 @@
18729
18733
  ? vutils.clampRange([x1 + min * width, x1 + max * width], x1, width - sliderSize)
18730
18734
  : vutils.clampRange([y1 + min * height, y1 + max * height], y1, height - sliderSize);
18731
18735
  }
18732
- _onChange(detail) {
18733
- var _a;
18734
- const changeEvent = new CustomEvent('scroll', detail);
18735
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
18736
- this.dispatchEvent(changeEvent);
18737
- }
18738
18736
  _reset() {
18739
18737
  this._sliderRenderBounds = null;
18740
18738
  this._sliderLimitRange = null;
@@ -22614,7 +22612,7 @@
22614
22612
  }
22615
22613
  _getLabelAttribute(tickDatum, index, tickData, layer) {
22616
22614
  var _a, _b, _c, _d, _e, _f;
22617
- const _g = this.attribute.label, { space = 4, inside = false, formatMethod, type = 'text', text } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod", "type", "text"]);
22615
+ const { space = 4, inside = false, formatMethod, type = 'text', text } = this.attribute.label;
22618
22616
  let offset = space;
22619
22617
  let tickLength = 0;
22620
22618
  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) {
@@ -22638,7 +22636,7 @@
22638
22636
  const textContent = formatMethod
22639
22637
  ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
22640
22638
  : tickDatum.label;
22641
- let { style: textStyle } = tagAttributes;
22639
+ let { style: textStyle } = this.attribute.label;
22642
22640
  textStyle = vutils.isFunction(textStyle)
22643
22641
  ? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
22644
22642
  : textStyle;
@@ -24280,6 +24278,7 @@
24280
24278
  },
24281
24279
  startHandlerStyle: {
24282
24280
  visible: true,
24281
+ triggerMinSize: 40,
24283
24282
  symbolType: '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',
24284
24283
  fill: 'white',
24285
24284
  stroke: '#B0C8F9',
@@ -24287,6 +24286,7 @@
24287
24286
  },
24288
24287
  endHandlerStyle: {
24289
24288
  visible: true,
24289
+ triggerMinSize: 40,
24290
24290
  symbolType: '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',
24291
24291
  fill: 'white',
24292
24292
  stroke: '#B0C8F9',
@@ -24307,6 +24307,22 @@
24307
24307
  }
24308
24308
  }
24309
24309
  };
24310
+ const DEFAULT_HANDLER_ATTR_MAP = {
24311
+ horizontal: {
24312
+ angle: 0,
24313
+ strokeBoundsBuffer: 0,
24314
+ boundsPadding: 2,
24315
+ pickMode: 'imprecise',
24316
+ cursor: 'ew-resize'
24317
+ },
24318
+ vertical: {
24319
+ angle: 90 * (Math.PI / 180),
24320
+ cursor: 'ns-resize',
24321
+ boundsPadding: 2,
24322
+ pickMode: 'imprecise',
24323
+ strokeBoundsBuffer: 0
24324
+ }
24325
+ };
24310
24326
 
24311
24327
  exports.DataZoomActiveTag = void 0;
24312
24328
  (function (DataZoomActiveTag) {
@@ -24353,11 +24369,11 @@
24353
24369
  e.stopPropagation();
24354
24370
  if (tag === 'start') {
24355
24371
  this._activeTag = exports.DataZoomActiveTag.startHandler;
24356
- this._activeItem = this._startHandler;
24372
+ this._activeItem = this._startHandlerMask;
24357
24373
  }
24358
24374
  else if (tag === 'end') {
24359
24375
  this._activeTag = exports.DataZoomActiveTag.endHandler;
24360
- this._activeItem = this._endHandler;
24376
+ this._activeItem = this._endHandlerMask;
24361
24377
  }
24362
24378
  else if (tag === 'middleRect') {
24363
24379
  this._activeTag = exports.DataZoomActiveTag.middleHandler;
@@ -24374,9 +24390,13 @@
24374
24390
  this._activeState = true;
24375
24391
  this._activeCache.startPos = this.eventPosToStagePos(e);
24376
24392
  this._activeCache.lastPos = this.eventPosToStagePos(e);
24393
+ if (vglobal.env === 'browser') {
24394
+ vglobal.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
24395
+ vglobal.addEventListener('pointerup', this._onHandlerPointerUp.bind(this));
24396
+ }
24397
+ this.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
24377
24398
  };
24378
- this._onHandlerPointerMove = (e) => {
24379
- var _a;
24399
+ this._onHandlerPointerMove = delayMap$1[this.attribute.delayType]((e) => {
24380
24400
  e.stopPropagation();
24381
24401
  const { start: startAttr, end: endAttr, brushSelect, realTime = true } = this.attribute;
24382
24402
  const pos = this.eventPosToStagePos(e);
@@ -24414,10 +24434,13 @@
24414
24434
  end = Math.min(Math.max(end, 0), 1);
24415
24435
  if (startAttr !== start || endAttr !== end) {
24416
24436
  this.setStateAttr(start, end, true);
24417
- realTime && ((_a = this._updateStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, start, end, this._activeTag));
24418
- this._dispatchChangeEvent(start, end);
24437
+ this._dispatchEvent('change', {
24438
+ start,
24439
+ end,
24440
+ tag: this._activeTag
24441
+ });
24419
24442
  }
24420
- };
24443
+ }, this.attribute.delayTime);
24421
24444
  const { start, end, size, orient, showDetail, position, previewData, previewPointsX, previewPointsY, previewPointsX1, previewPointsY1, updateStateCallback } = this.attribute;
24422
24445
  const { width, height } = size;
24423
24446
  start && (this.state.start = start);
@@ -24440,18 +24463,17 @@
24440
24463
  vutils.isFunction(previewPointsY) && (this._previewPointsY = previewPointsY);
24441
24464
  vutils.isFunction(previewPointsX1) && (this._previewPointsX1 = previewPointsX1);
24442
24465
  vutils.isFunction(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
24443
- vutils.isFunction(updateStateCallback) && (this._updateStateCallback = updateStateCallback);
24444
24466
  }
24445
24467
  bindEvents() {
24446
24468
  if (this.attribute.disableTriggerEvent) {
24447
24469
  return;
24448
24470
  }
24449
- const { showDetail, brushSelect, delayType = 'throttle', delayTime = 0 } = this.attribute;
24450
- if (this._startHandler) {
24451
- this._startHandler.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'start'));
24471
+ const { showDetail, brushSelect } = this.attribute;
24472
+ if (this._startHandlerMask) {
24473
+ this._startHandlerMask.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'start'));
24452
24474
  }
24453
- if (this._endHandler) {
24454
- this._endHandler.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'end'));
24475
+ if (this._endHandlerMask) {
24476
+ this._endHandlerMask.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'end'));
24455
24477
  }
24456
24478
  if (this._middleHandlerSymbol) {
24457
24479
  this._middleHandlerSymbol.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'middleSymbol'));
@@ -24472,15 +24494,6 @@
24472
24494
  if (this._selectedPreviewGroup) {
24473
24495
  this._selectedPreviewGroup.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, selectedTag));
24474
24496
  }
24475
- if (vglobal.env === 'browser') {
24476
- vglobal.addEventListener('pointermove', delayMap$1[delayType](this._onHandlerPointerMove.bind(this), delayTime), {
24477
- capture: true
24478
- });
24479
- vglobal.addEventListener('pointerup', this._onHandlerPointerUp.bind(this));
24480
- }
24481
- this.addEventListener('pointermove', delayMap$1[delayType](this._onHandlerPointerMove, delayTime), {
24482
- capture: true
24483
- });
24484
24497
  this.addEventListener('pointerup', this._onHandlerPointerUp);
24485
24498
  this.addEventListener('pointerupoutside', this._onHandlerPointerUp);
24486
24499
  if (showDetail === 'auto') {
@@ -24511,15 +24524,14 @@
24511
24524
  shouldRender && this.setAttributes({ start, end });
24512
24525
  }
24513
24526
  eventPosToStagePos(e) {
24514
- var _a, _b, _c;
24515
- const stagePosition = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.window.getBoundingClientRect();
24527
+ var _a, _b;
24528
+ const { x, y } = vglobal.mapToCanvasPoint(e);
24516
24529
  return {
24517
- x: e.clientX - ((stagePosition === null || stagePosition === void 0 ? void 0 : stagePosition.left) || 0) - (((_b = this.stage) === null || _b === void 0 ? void 0 : _b.x) || 0),
24518
- y: e.clientY - ((stagePosition === null || stagePosition === void 0 ? void 0 : stagePosition.top) || 0) - (((_c = this.stage) === null || _c === void 0 ? void 0 : _c.y) || 0)
24530
+ x: x - (((_a = this.stage) === null || _a === void 0 ? void 0 : _a.x) || 0),
24531
+ y: y - (((_b = this.stage) === null || _b === void 0 ? void 0 : _b.y) || 0)
24519
24532
  };
24520
24533
  }
24521
24534
  _onHandlerPointerUp(e) {
24522
- var _a;
24523
24535
  e.preventDefault();
24524
24536
  const { start, end, brushSelect, realTime = true } = this.attribute;
24525
24537
  if (this._activeState) {
@@ -24532,9 +24544,17 @@
24532
24544
  brushSelect && this.renderDragMask();
24533
24545
  if (!realTime || start !== this.state.start || end !== this.state.end) {
24534
24546
  this.setStateAttr(this.state.start, this.state.end, true);
24535
- (_a = this._updateStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, this.state.start, this.state.end, this._activeTag);
24536
- this._dispatchChangeEvent(this.state.start, this.state.end);
24547
+ this._dispatchEvent('change', {
24548
+ start: this.state.start,
24549
+ end: this.state.end,
24550
+ tag: this._activeTag
24551
+ });
24552
+ }
24553
+ if (vglobal.env === 'browser') {
24554
+ vglobal.removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
24555
+ vglobal.removeEventListener('pointerup', this._onHandlerPointerUp.bind(this));
24537
24556
  }
24557
+ this.removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
24538
24558
  }
24539
24559
  _onHandlerPointerEnter(e) {
24540
24560
  e.stopPropagation();
@@ -24711,17 +24731,19 @@
24711
24731
  return this._layoutAttrFromConfig;
24712
24732
  }
24713
24733
  render() {
24714
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
24734
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
24715
24735
  this._layoutAttrFromConfig = null;
24716
24736
  const { orient, backgroundStyle, backgroundChartStyle, selectedBackgroundStyle, selectedBackgroundChartStyle, middleHandlerStyle, startHandlerStyle, endHandlerStyle, brushSelect } = this.attribute;
24717
24737
  const { start, end } = this.state;
24718
24738
  const { position, width, height } = this.getLayoutAttrFromConfig();
24739
+ const startHandlerMinSize = (_a = startHandlerStyle.triggerMinSize) !== null && _a !== void 0 ? _a : 40;
24740
+ const endHandlerMinSize = (_b = endHandlerStyle.triggerMinSize) !== null && _b !== void 0 ? _b : 40;
24719
24741
  const group = this.createOrUpdateChild('dataZoom-container', {}, 'group');
24720
24742
  this._container = group;
24721
24743
  this._background = group.createOrUpdateChild('background', Object.assign({ x: position.x, y: position.y, width,
24722
24744
  height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), 'rect');
24723
- ((_a = backgroundChartStyle === null || backgroundChartStyle === void 0 ? void 0 : backgroundChartStyle.line) === null || _a === void 0 ? void 0 : _a.visible) && this.setPreviewAttributes('line', group);
24724
- ((_b = backgroundChartStyle === null || backgroundChartStyle === void 0 ? void 0 : backgroundChartStyle.area) === null || _b === void 0 ? void 0 : _b.visible) && this.setPreviewAttributes('area', group);
24745
+ ((_c = backgroundChartStyle === null || backgroundChartStyle === void 0 ? void 0 : backgroundChartStyle.line) === null || _c === void 0 ? void 0 : _c.visible) && this.setPreviewAttributes('line', group);
24746
+ ((_d = backgroundChartStyle === null || backgroundChartStyle === void 0 ? void 0 : backgroundChartStyle.area) === null || _d === void 0 ? void 0 : _d.visible) && this.setPreviewAttributes('area', group);
24725
24747
  brushSelect && this.renderDragMask();
24726
24748
  if (this._isHorizontal) {
24727
24749
  this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), 'rect');
@@ -24729,28 +24751,40 @@
24729
24751
  else {
24730
24752
  this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), 'rect');
24731
24753
  }
24732
- ((_c = selectedBackgroundChartStyle === null || selectedBackgroundChartStyle === void 0 ? void 0 : selectedBackgroundChartStyle.line) === null || _c === void 0 ? void 0 : _c.visible) && this.setSelectedPreviewAttributes('line', group);
24733
- ((_d = selectedBackgroundChartStyle === null || selectedBackgroundChartStyle === void 0 ? void 0 : selectedBackgroundChartStyle.area) === null || _d === void 0 ? void 0 : _d.visible) && this.setSelectedPreviewAttributes('area', group);
24754
+ ((_e = selectedBackgroundChartStyle === null || selectedBackgroundChartStyle === void 0 ? void 0 : selectedBackgroundChartStyle.line) === null || _e === void 0 ? void 0 : _e.visible) && this.setSelectedPreviewAttributes('line', group);
24755
+ ((_f = selectedBackgroundChartStyle === null || selectedBackgroundChartStyle === void 0 ? void 0 : selectedBackgroundChartStyle.area) === null || _f === void 0 ? void 0 : _f.visible) && this.setSelectedPreviewAttributes('area', group);
24734
24756
  if (this._showText) {
24735
24757
  this.renderText();
24736
24758
  }
24737
24759
  if (this._isHorizontal) {
24738
- this._startHandler = group.createOrUpdateChild('startHandler', Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, angle: 0, symbolType: (_e = startHandlerStyle === null || startHandlerStyle === void 0 ? void 0 : startHandlerStyle.symbolType) !== null && _e !== void 0 ? _e : 'square', cursor: 'ew-resize', strokeBoundsBuffer: 0, boundsPadding: 2, pickMode: 'imprecise' }, startHandlerStyle), 'symbol');
24739
- this._endHandler = group.createOrUpdateChild('endHandler', Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, angle: 0, symbolType: (_f = endHandlerStyle === null || endHandlerStyle === void 0 ? void 0 : endHandlerStyle.symbolType) !== null && _f !== void 0 ? _f : 'square', cursor: 'ew-resize', strokeBoundsBuffer: 0, boundsPadding: 2, pickMode: 'imprecise' }, endHandlerStyle), 'symbol');
24760
+ this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_g = startHandlerStyle === null || startHandlerStyle === void 0 ? void 0 : startHandlerStyle.symbolType) !== null && _g !== void 0 ? _g : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), 'symbol');
24761
+ this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_h = endHandlerStyle === null || endHandlerStyle === void 0 ? void 0 : endHandlerStyle.symbolType) !== null && _h !== void 0 ? _h : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), 'symbol');
24762
+ const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
24763
+ const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
24764
+ const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
24765
+ const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
24766
+ this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign({ x: position.x + start * width - startHandlerWidth / 2, y: position.y + height / 2 - startHandlerHeight / 2, width: startHandlerWidth, height: startHandlerHeight, fill: 'white', fillOpacity: 0 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), 'rect');
24767
+ this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign({ x: position.x + end * width - endHandlerWidth / 2, y: position.y + height / 2 - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, fill: 'white', fillOpacity: 0 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), 'rect');
24740
24768
  if (middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.visible) {
24741
- this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: position.x + start * width, y: position.y - (((_g = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _g === void 0 ? void 0 : _g.size) || 10), width: (end - start) * width, height: ((_h = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _h === void 0 ? void 0 : _h.size) || 10 }, (_j = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _j === void 0 ? void 0 : _j.style), 'rect');
24742
- this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - (((_k = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _k === void 0 ? void 0 : _k.size) || 10) / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_m = (_l = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon) === null || _l === void 0 ? void 0 : _l.symbolType) !== null && _m !== void 0 ? _m : 'square' }, middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon), 'symbol');
24769
+ this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: position.x + start * width, y: position.y - (((_j = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _j === void 0 ? void 0 : _j.size) || 10), width: (end - start) * width, height: ((_k = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _k === void 0 ? void 0 : _k.size) || 10 }, (_l = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _l === void 0 ? void 0 : _l.style), 'rect');
24770
+ this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - (((_m = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _m === void 0 ? void 0 : _m.size) || 10) / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_p = (_o = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon) === null || _o === void 0 ? void 0 : _o.symbolType) !== null && _p !== void 0 ? _p : 'square' }, middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon), 'symbol');
24743
24771
  }
24744
24772
  }
24745
24773
  else {
24746
- this._startHandler = group.createOrUpdateChild('startHandler', Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, angle: 90 * (Math.PI / 180), symbolType: (_o = startHandlerStyle === null || startHandlerStyle === void 0 ? void 0 : startHandlerStyle.symbolType) !== null && _o !== void 0 ? _o : 'square', cursor: 'ns-resize', boundsPadding: 2, pickMode: 'imprecise', strokeBoundsBuffer: 0 }, startHandlerStyle), 'symbol');
24774
+ this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_q = startHandlerStyle === null || startHandlerStyle === void 0 ? void 0 : startHandlerStyle.symbolType) !== null && _q !== void 0 ? _q : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), 'symbol');
24775
+ this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_r = endHandlerStyle === null || endHandlerStyle === void 0 ? void 0 : endHandlerStyle.symbolType) !== null && _r !== void 0 ? _r : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), 'symbol');
24776
+ const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
24777
+ const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
24778
+ const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
24779
+ const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
24780
+ this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign({ x: position.x + width / 2 - startHandlerWidth / 2, y: position.y + start * height - startHandlerHeight / 2, width: startHandlerWidth, height: startHandlerHeight, symbolType: 'rect', fill: 'white', fillOpacity: 0 }, DEFAULT_HANDLER_ATTR_MAP.vertical), 'symbol');
24781
+ this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign({ x: position.x + width / 2 - endHandlerWidth / 2, y: position.y + end * height - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, symbolType: 'rect', fill: 'white', fillOpacity: 0 }, DEFAULT_HANDLER_ATTR_MAP.vertical), 'symbol');
24747
24782
  if (middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.visible) {
24748
- this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: orient === 'left' ? position.x - (((_p = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _p === void 0 ? void 0 : _p.size) || 10) : position.x + width, y: position.y + start * height, width: ((_q = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _q === void 0 ? void 0 : _q.size) || 10, height: (end - start) * height }, (_r = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _r === void 0 ? void 0 : _r.style), 'rect');
24783
+ this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: orient === 'left' ? position.x - (((_s = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _s === void 0 ? void 0 : _s.size) || 10) : position.x + width, y: position.y + start * height, width: ((_t = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _t === void 0 ? void 0 : _t.size) || 10, height: (end - start) * height }, (_u = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _u === void 0 ? void 0 : _u.style), 'rect');
24749
24784
  this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: orient === 'left'
24750
- ? position.x - (((_s = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _s === void 0 ? void 0 : _s.size) || 10) / 2
24751
- : position.x + width + (((_t = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _t === void 0 ? void 0 : _t.size) || 10) / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_v = (_u = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon) === null || _u === void 0 ? void 0 : _u.symbolType) !== null && _v !== void 0 ? _v : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon), 'symbol');
24785
+ ? position.x - (((_v = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _v === void 0 ? void 0 : _v.size) || 10) / 2
24786
+ : position.x + width + (((_w = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.background) === null || _w === void 0 ? void 0 : _w.size) || 10) / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_y = (_x = middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon) === null || _x === void 0 ? void 0 : _x.symbolType) !== null && _y !== void 0 ? _y : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle === null || middleHandlerStyle === void 0 ? void 0 : middleHandlerStyle.icon), 'symbol');
24752
24787
  }
24753
- this._endHandler = group.createOrUpdateChild('endHandler', Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, angle: 90 * (Math.PI / 180), symbolType: (_w = endHandlerStyle === null || endHandlerStyle === void 0 ? void 0 : endHandlerStyle.symbolType) !== null && _w !== void 0 ? _w : 'square', cursor: 'ns-resize', boundsPadding: 2, pickMode: 'imprecise', strokeBoundsBuffer: 0 }, endHandlerStyle), 'symbol');
24754
24788
  }
24755
24789
  }
24756
24790
  computeBasePoints() {
@@ -24895,25 +24929,18 @@
24895
24929
  container.add(labelShape);
24896
24930
  return labelShape;
24897
24931
  }
24898
- _dispatchChangeEvent(start, end) {
24899
- var _a;
24900
- const changeEvent = new CustomEvent('change', {
24901
- start,
24902
- end
24903
- });
24904
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
24905
- this.dispatchEvent(changeEvent);
24906
- }
24907
24932
  setStartAndEnd(start, end) {
24908
- var _a;
24909
24933
  const { start: startAttr, end: endAttr } = this.attribute;
24910
24934
  if (vutils.isValid(start) && vutils.isValid(end) && (start !== this.state.start || end !== this.state.end)) {
24911
24935
  this.state.start = start;
24912
24936
  this.state.end = end;
24913
24937
  if (startAttr !== this.state.start || endAttr !== this.state.end) {
24914
24938
  this.setStateAttr(start, end, true);
24915
- (_a = this._updateStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, start, end, this._activeTag);
24916
- this._dispatchChangeEvent(start, end);
24939
+ this._dispatchEvent('change', {
24940
+ start,
24941
+ end,
24942
+ tag: this._activeTag
24943
+ });
24917
24944
  }
24918
24945
  }
24919
24946
  }
@@ -24941,9 +24968,6 @@
24941
24968
  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;
24942
24969
  return Math.max(middleHandlerRectSize, ...vutils.array(middleHandlerSymbolSize));
24943
24970
  }
24944
- setUpdateStateCallback(callback) {
24945
- vutils.isFunction(callback) && (this._updateStateCallback = callback);
24946
- }
24947
24971
  setPreviewPointsX(callback) {
24948
24972
  vutils.isFunction(callback) && (this._previewPointsX = callback);
24949
24973
  }
@@ -25765,7 +25789,6 @@
25765
25789
  target.removeState('hover');
25766
25790
  };
25767
25791
  this._onClick = (e) => {
25768
- var _a, _b;
25769
25792
  const target = e.target;
25770
25793
  if (target.name === 'preHandler') {
25771
25794
  if (this._current === 1) {
@@ -25778,14 +25801,12 @@
25778
25801
  else {
25779
25802
  target.removeState('disable');
25780
25803
  }
25781
- const changeEvent = new CustomEvent('toPrev', {
25804
+ this._dispatchEvent('toPrev', {
25782
25805
  current: this._current,
25783
25806
  total: this._total,
25784
25807
  direction: 'pre',
25785
25808
  event: e
25786
25809
  });
25787
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
25788
- this.dispatchEvent(changeEvent);
25789
25810
  }
25790
25811
  if (target.name === 'nextHandler') {
25791
25812
  if (this._current === this._total) {
@@ -25798,14 +25819,12 @@
25798
25819
  else {
25799
25820
  target.removeState('disable');
25800
25821
  }
25801
- const changeEvent = new CustomEvent('toNext', {
25822
+ this._dispatchEvent('toNext', {
25802
25823
  current: this._current,
25803
25824
  total: this._total,
25804
25825
  direction: 'next',
25805
25826
  event: e
25806
25827
  });
25807
- changeEvent.manager = (_b = this.stage) === null || _b === void 0 ? void 0 : _b.eventSystem.manager;
25808
- this.dispatchEvent(changeEvent);
25809
25828
  }
25810
25829
  if (this._current > 1) {
25811
25830
  this.preHandler.removeState('disable');
@@ -26108,7 +26127,7 @@
26108
26127
  const currentSelectedItems = this._getSelectedLegends();
26109
26128
  if (selectMode === 'multiple') {
26110
26129
  if (allowAllCanceled === false && isSelected && currentSelectedItems.length === 1) {
26111
- this._dispatchEvent(exports.LegendEvent.legendItemClick, legendItem, e);
26130
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemClick, legendItem, e);
26112
26131
  return;
26113
26132
  }
26114
26133
  if (isSelected) {
@@ -26131,7 +26150,7 @@
26131
26150
  });
26132
26151
  }
26133
26152
  }
26134
- this._dispatchEvent(exports.LegendEvent.legendItemClick, legendItem, e);
26153
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemClick, legendItem, e);
26135
26154
  }
26136
26155
  };
26137
26156
  }
@@ -26268,26 +26287,27 @@
26268
26287
  }
26269
26288
  }
26270
26289
  _renderEachItem(item, isSelected, index, items) {
26290
+ var _a, _b;
26271
26291
  const { id, label, value, shape } = item;
26272
- const { padding = 0, focus, focusIconStyle = {} } = this.attribute.item;
26273
- let { shape: shapeAttr = {}, label: labelAttr = {}, value: valueAttr = {}, background = {} } = this.attribute.item;
26274
- shapeAttr = this._handleStyle(shapeAttr, item, isSelected, index, items);
26275
- labelAttr = this._handleStyle(labelAttr, item, isSelected, index, items);
26276
- valueAttr = this._handleStyle(valueAttr, item, isSelected, index, items);
26277
- background = this._handleStyle(background, item, isSelected, index, items);
26292
+ const { padding = 0, focus, focusIconStyle } = this.attribute.item;
26293
+ const { shape: shapeAttr, label: labelAttr, value: valueAttr, background } = this.attribute.item;
26294
+ const shapeStyle = this._handleStyle(shapeAttr, item, isSelected, index, items);
26295
+ const labelStyle = this._handleStyle(labelAttr, item, isSelected, index, items);
26296
+ const valueStyle = this._handleStyle(valueAttr, item, isSelected, index, items);
26297
+ const backgroundStyle = this._handleStyle(background, item, isSelected, index, items);
26278
26298
  const parsedPadding = vutils.normalizePadding(padding);
26279
26299
  let itemGroup;
26280
26300
  if (background.visible === false) {
26281
26301
  itemGroup = graphicCreator.group({
26282
26302
  x: 0,
26283
26303
  y: 0,
26284
- cursor: (background === null || background === void 0 ? void 0 : background.style).cursor
26304
+ cursor: (_a = backgroundStyle.style) === null || _a === void 0 ? void 0 : _a.cursor
26285
26305
  });
26286
26306
  this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup);
26287
26307
  }
26288
26308
  else {
26289
- itemGroup = graphicCreator.group(Object.assign({ x: 0, y: 0 }, background === null || background === void 0 ? void 0 : background.style));
26290
- this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup, background === null || background === void 0 ? void 0 : background.state);
26309
+ itemGroup = graphicCreator.group(Object.assign({ x: 0, y: 0 }, backgroundStyle.style));
26310
+ this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state);
26291
26311
  }
26292
26312
  itemGroup.id = `${id !== null && id !== void 0 ? id : label}-${index}`;
26293
26313
  itemGroup.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
@@ -26301,20 +26321,20 @@
26301
26321
  let shapeSize = 0;
26302
26322
  let shapeSpace = 0;
26303
26323
  if ((shapeAttr === null || shapeAttr === void 0 ? void 0 : shapeAttr.visible) !== false) {
26304
- shapeSize = vutils.get(shapeAttr, 'style.size', DEFAULT_SHAPE_SIZE);
26324
+ shapeSize = vutils.get(shapeStyle, 'style.size', DEFAULT_SHAPE_SIZE);
26305
26325
  shapeSpace = vutils.get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);
26306
- const itemShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: 0, symbolType: 'circle', strokeBoundsBuffer: 0 }, shape), shapeAttr.style));
26307
- Object.keys(shapeAttr.state || {}).forEach(key => {
26308
- const color = shapeAttr.state[key].fill ||
26309
- shapeAttr.state[key].stroke;
26310
- if (shape.fill && vutils.isNil(shapeAttr.state[key].fill) && color) {
26311
- shapeAttr.state[key].fill = color;
26326
+ const itemShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: 0, symbolType: 'circle', strokeBoundsBuffer: 0 }, shape), shapeStyle.style));
26327
+ Object.keys(shapeStyle.state || {}).forEach(key => {
26328
+ const color = shapeStyle.state[key].fill ||
26329
+ shapeStyle.state[key].stroke;
26330
+ if (shape.fill && vutils.isNil(shapeStyle.state[key].fill) && color) {
26331
+ shapeStyle.state[key].fill = color;
26312
26332
  }
26313
- if (shape.stroke && vutils.isNil(shapeAttr.state[key].stroke) && color) {
26314
- shapeAttr.state[key].stroke = color;
26333
+ if (shape.stroke && vutils.isNil(shapeStyle.state[key].stroke) && color) {
26334
+ shapeStyle.state[key].stroke = color;
26315
26335
  }
26316
26336
  });
26317
- this._appendDataToShape(itemShape, exports.LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeAttr === null || shapeAttr === void 0 ? void 0 : shapeAttr.state);
26337
+ this._appendDataToShape(itemShape, exports.LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state);
26318
26338
  itemShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
26319
26339
  innerGroup.add(itemShape);
26320
26340
  }
@@ -26326,15 +26346,15 @@
26326
26346
  this._appendDataToShape(focusShape, exports.LEGEND_ELEMENT_NAME.focus, item, itemGroup);
26327
26347
  focusSpace = focusSize;
26328
26348
  }
26329
- const labelShape = graphicCreator.text(Object.assign(Object.assign({ x: shapeSize / 2 + shapeSpace, y: 0, textAlign: 'start', textBaseline: 'middle', lineHeight: (labelAttr === null || labelAttr === void 0 ? void 0 : labelAttr.style).fontSize }, labelAttr === null || labelAttr === void 0 ? void 0 : labelAttr.style), { text: labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label }));
26330
- this._appendDataToShape(labelShape, exports.LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelAttr === null || labelAttr === void 0 ? void 0 : labelAttr.state);
26349
+ 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 }));
26350
+ this._appendDataToShape(labelShape, exports.LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state);
26331
26351
  labelShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
26332
26352
  innerGroup.add(labelShape);
26333
26353
  const labelSpace = vutils.get(labelAttr, 'space', DEFAULT_LABEL_SPACE);
26334
26354
  if (vutils.isValid(value)) {
26335
26355
  const valueSpace = vutils.get(valueAttr, 'space', focus ? DEFAULT_VALUE_SPACE : 0);
26336
- const valueShape = graphicCreator.text(Object.assign(Object.assign({ x: 0, y: 0, textAlign: 'start', textBaseline: 'middle', lineHeight: (valueAttr === null || valueAttr === void 0 ? void 0 : valueAttr.style).fontSize }, valueAttr === null || valueAttr === void 0 ? void 0 : valueAttr.style), { text: valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value }));
26337
- this._appendDataToShape(valueShape, exports.LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueAttr === null || valueAttr === void 0 ? void 0 : valueAttr.state);
26356
+ 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 }));
26357
+ this._appendDataToShape(valueShape, exports.LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state);
26338
26358
  valueShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
26339
26359
  if (this._itemWidthByUser) {
26340
26360
  const layoutWidth = this._itemWidthByUser -
@@ -26553,7 +26573,7 @@
26553
26573
  if (focusButton) {
26554
26574
  focusButton.setAttribute('visible', true);
26555
26575
  }
26556
- this._dispatchEvent(exports.LegendEvent.legendItemHover, legendItem, e);
26576
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemHover, legendItem, e);
26557
26577
  }
26558
26578
  _unHover(legendItem, e) {
26559
26579
  let attributeUpdate = false;
@@ -26578,9 +26598,9 @@
26578
26598
  focusButton.setAttribute('visible', false);
26579
26599
  }
26580
26600
  if (attributeUpdate) {
26581
- this._dispatchEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
26601
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
26582
26602
  }
26583
- this._dispatchEvent(exports.LegendEvent.legendItemUnHover, legendItem, e);
26603
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemUnHover, legendItem, e);
26584
26604
  }
26585
26605
  _setLegendItemState(legendItem, stateName, e) {
26586
26606
  const keepCurrentStates = true;
@@ -26601,7 +26621,7 @@
26601
26621
  }
26602
26622
  });
26603
26623
  if (attributeUpdate) {
26604
- this._dispatchEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
26624
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
26605
26625
  }
26606
26626
  }
26607
26627
  _removeLegendItemState(legendItem, stateNames, e) {
@@ -26626,7 +26646,7 @@
26626
26646
  }
26627
26647
  });
26628
26648
  if (attributeUpdate) {
26629
- this._dispatchEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
26649
+ this._dispatchLegendEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
26630
26650
  }
26631
26651
  }
26632
26652
  _getSelectedLegends() {
@@ -26645,12 +26665,11 @@
26645
26665
  shape.delegate = delegateShape;
26646
26666
  shape.states = vutils.merge({}, DEFAULT_STATES, states);
26647
26667
  }
26648
- _dispatchEvent(eventName, legendItem, event) {
26649
- var _a;
26668
+ _dispatchLegendEvent(eventName, legendItem, event) {
26650
26669
  const currentSelectedItems = this._getSelectedLegends();
26651
26670
  currentSelectedItems.sort((pre, next) => pre.index - next.index);
26652
26671
  const currentSelected = currentSelectedItems.map((obj) => obj.label);
26653
- const changeEvent = new CustomEvent(eventName, {
26672
+ this._dispatchEvent(eventName, {
26654
26673
  item: legendItem,
26655
26674
  data: legendItem.data,
26656
26675
  selected: legendItem.hasState(exports.LegendStateValue.selected),
@@ -26658,18 +26677,27 @@
26658
26677
  currentSelected,
26659
26678
  event
26660
26679
  });
26661
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
26662
- this.dispatchEvent(changeEvent);
26663
26680
  }
26664
26681
  _handleStyle(config, item, isSelected, index, items) {
26665
- const newConfig = vutils.merge({}, config);
26666
- if (config.style && vutils.isFunction(config.style)) {
26667
- newConfig.style = config.style(item, isSelected, index, items);
26682
+ const newConfig = {};
26683
+ if (config.style) {
26684
+ if (vutils.isFunction(config.style)) {
26685
+ newConfig.style = config.style(item, isSelected, index, items);
26686
+ }
26687
+ else {
26688
+ newConfig.style = config.style;
26689
+ }
26668
26690
  }
26669
26691
  if (config.state) {
26692
+ newConfig.state = {};
26670
26693
  Object.keys(config.state).forEach(key => {
26671
- if (config.state[key] && vutils.isFunction(config.state[key])) {
26672
- newConfig.state[key] = config.state[key](item, isSelected, index, items);
26694
+ if (config.state[key]) {
26695
+ if (vutils.isFunction(config.state[key])) {
26696
+ newConfig.state[key] = config.state[key](item, isSelected, index, items);
26697
+ }
26698
+ else {
26699
+ newConfig.state[key] = config.state[key];
26700
+ }
26673
26701
  }
26674
26702
  });
26675
26703
  }
@@ -27334,10 +27362,9 @@
27334
27362
  }
27335
27363
  }
27336
27364
  _dispatchChangeEvent() {
27337
- var _a;
27338
27365
  const isRange = !!this.attribute.range;
27339
27366
  const currentValue = this._currentValue;
27340
- const changeEvent = new CustomEvent('change', {
27367
+ this._dispatchEvent('change', {
27341
27368
  value: isRange
27342
27369
  ? [
27343
27370
  Math.min(currentValue.endValue, currentValue.startValue),
@@ -27351,8 +27378,6 @@
27351
27378
  ]
27352
27379
  : currentValue.startPos
27353
27380
  });
27354
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
27355
- this.dispatchEvent(changeEvent);
27356
27381
  }
27357
27382
  _getHandlers() {
27358
27383
  let startHandler = this._startHandler;
@@ -28270,12 +28295,6 @@
28270
28295
  this.forward();
28271
28296
  });
28272
28297
  };
28273
- this._createCustomEvent = (eventType) => {
28274
- var _a;
28275
- const customEvent = new CustomEvent(eventType, { eventType });
28276
- customEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
28277
- return customEvent;
28278
- };
28279
28298
  this.renderPlay = () => {
28280
28299
  if (this._isPaused) {
28281
28300
  this._playController.setAttributes(Object.assign({ symbolType: this._playController.getComputedAttribute('symbolType') }, this._startAttr.style));
@@ -28291,20 +28310,16 @@
28291
28310
  this._forwardController.setAttributes(this._forwardAttr.style);
28292
28311
  };
28293
28312
  this.play = () => {
28294
- const onPlayEvent = this._createCustomEvent(ControllerEventEnum.OnPlay);
28295
- this.dispatchEvent(onPlayEvent);
28313
+ this._dispatchEvent('ControllerEventEnum.OnPlay');
28296
28314
  };
28297
28315
  this.pause = () => {
28298
- const onPauseEvent = this._createCustomEvent(ControllerEventEnum.OnPause);
28299
- this.dispatchEvent(onPauseEvent);
28316
+ this._dispatchEvent('ControllerEventEnum.OnPause');
28300
28317
  };
28301
28318
  this.forward = () => {
28302
- const onPlayEvent = this._createCustomEvent(ControllerEventEnum.OnForward);
28303
- this.dispatchEvent(onPlayEvent);
28319
+ this._dispatchEvent('ControllerEventEnum.OnForward');
28304
28320
  };
28305
28321
  this.backward = () => {
28306
- const onPlayEvent = this._createCustomEvent(ControllerEventEnum.OnBackward);
28307
- this.dispatchEvent(onPlayEvent);
28322
+ this._dispatchEvent('ControllerEventEnum.OnBackward');
28308
28323
  };
28309
28324
  this.togglePlay = () => {
28310
28325
  this._playController.setAttributes(this._startAttr.style);
@@ -28579,14 +28594,11 @@
28579
28594
  this._controller.setAttributes(attrs);
28580
28595
  }
28581
28596
  dispatchCustomEvent(eventType, dataIndex) {
28582
- var _a;
28583
- const changeEvent = new CustomEvent(eventType, {
28597
+ this._dispatchEvent(eventType, {
28584
28598
  eventType,
28585
28599
  index: dataIndex,
28586
28600
  value: this._data[dataIndex]
28587
28601
  });
28588
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
28589
- this.dispatchEvent(changeEvent);
28590
28602
  }
28591
28603
  }
28592
28604
  BasePlayer.defaultAttributes = {
@@ -29020,20 +29032,27 @@
29020
29032
  if (this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick) {
29021
29033
  this._container.incrementalClearChild();
29022
29034
  this._brushMaskAABBBoundsDict = {};
29023
- this._updateDragMaskCallback &&
29024
- this._updateDragMaskCallback({
29025
- operateType: exports.IOperateType.brushClear,
29026
- operateMask: this._operatingMask,
29027
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
29028
- });
29035
+ this._dispatchEvent(exports.IOperateType.brushClear, {
29036
+ operateMask: this._operatingMask,
29037
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29038
+ event: e
29039
+ });
29029
29040
  }
29030
29041
  else if (!this._outOfInteractiveRange(e)) {
29031
- this._updateDragMaskCallback &&
29032
- this._updateDragMaskCallback({
29033
- operateType: this._activeDrawState ? exports.IOperateType.drawEnd : exports.IOperateType.moveEnd,
29042
+ if (this._activeDrawState) {
29043
+ this._dispatchEvent(exports.IOperateType.drawEnd, {
29034
29044
  operateMask: this._operatingMask,
29035
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
29045
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29046
+ event: e
29036
29047
  });
29048
+ }
29049
+ if (this._activeMoveState) {
29050
+ this._dispatchEvent(exports.IOperateType.moveEnd, {
29051
+ operateMask: this._operatingMask,
29052
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29053
+ event: e
29054
+ });
29055
+ }
29037
29056
  }
29038
29057
  this._activeDrawState = false;
29039
29058
  this._activeMoveState = false;
@@ -29041,7 +29060,7 @@
29041
29060
  (_a = this._operatingMask) === null || _a === void 0 ? void 0 : _a.setAttribute('pickable', false);
29042
29061
  };
29043
29062
  }
29044
- bindBrushEvents() {
29063
+ _bindBrushEvents() {
29045
29064
  if (this.attribute.disableTriggerEvent) {
29046
29065
  return;
29047
29066
  }
@@ -29079,12 +29098,11 @@
29079
29098
  this._container.incrementalClearChild();
29080
29099
  }
29081
29100
  this._addBrushMask();
29082
- this._updateDragMaskCallback &&
29083
- this._updateDragMaskCallback({
29084
- operateType: exports.IOperateType.drawStart,
29085
- operateMask: this._operatingMask,
29086
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
29087
- });
29101
+ this._dispatchEvent(exports.IOperateType.drawStart, {
29102
+ operateMask: this._operatingMask,
29103
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29104
+ event: e
29105
+ });
29088
29106
  }
29089
29107
  _initMove(e) {
29090
29108
  var _a, _b;
@@ -29101,12 +29119,11 @@
29101
29119
  this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX];
29102
29120
  this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY];
29103
29121
  this._operatingMask.setAttribute('pickable', true);
29104
- this._updateDragMaskCallback &&
29105
- this._updateDragMaskCallback({
29106
- operateType: exports.IOperateType.moveStart,
29107
- operateMask: this._operatingMask,
29108
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
29109
- });
29122
+ this._dispatchEvent(exports.IOperateType.moveStart, {
29123
+ operateMask: this._operatingMask,
29124
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29125
+ event: e
29126
+ });
29110
29127
  }
29111
29128
  _drawing(e) {
29112
29129
  var _a;
@@ -29130,12 +29147,11 @@
29130
29147
  const maskPoints = this._computeMaskPoints();
29131
29148
  this._operatingMask.setAttribute('points', maskPoints);
29132
29149
  this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
29133
- this._updateDragMaskCallback &&
29134
- this._updateDragMaskCallback({
29135
- operateType: exports.IOperateType.drawing,
29136
- operateMask: this._operatingMask,
29137
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
29138
- });
29150
+ this._dispatchEvent(exports.IOperateType.drawing, {
29151
+ operateMask: this._operatingMask,
29152
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29153
+ event: e
29154
+ });
29139
29155
  }
29140
29156
  _moving(e) {
29141
29157
  const startPos = this._cacheMovePoint;
@@ -29154,12 +29170,11 @@
29154
29170
  dy: moveY
29155
29171
  });
29156
29172
  this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
29157
- this._updateDragMaskCallback &&
29158
- this._updateDragMaskCallback({
29159
- operateType: exports.IOperateType.moving,
29160
- operateMask: this._operatingMask,
29161
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict
29162
- });
29173
+ this._dispatchEvent(exports.IOperateType.moving, {
29174
+ operateMask: this._operatingMask,
29175
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
29176
+ event: e
29177
+ });
29163
29178
  }
29164
29179
  _computeMaskPoints() {
29165
29180
  const { brushType, xRange = [0, 0], yRange = [0, 0] } = this.attribute;
@@ -29244,21 +29259,18 @@
29244
29259
  return false;
29245
29260
  }
29246
29261
  eventPosToStagePos(e) {
29247
- var _a, _b, _c;
29248
- const stagePosition = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.window.getBoundingClientRect();
29262
+ var _a, _b;
29263
+ const { x, y } = vglobal.mapToCanvasPoint(e);
29249
29264
  return {
29250
- x: e.clientX - ((stagePosition === null || stagePosition === void 0 ? void 0 : stagePosition.left) || 0) - (((_b = this.stage) === null || _b === void 0 ? void 0 : _b.x) || 0),
29251
- y: e.clientY - ((stagePosition === null || stagePosition === void 0 ? void 0 : stagePosition.top) || 0) - (((_c = this.stage) === null || _c === void 0 ? void 0 : _c.y) || 0)
29265
+ x: x - (((_a = this.stage) === null || _a === void 0 ? void 0 : _a.x) || 0),
29266
+ y: y - (((_b = this.stage) === null || _b === void 0 ? void 0 : _b.y) || 0)
29252
29267
  };
29253
29268
  }
29254
29269
  render() {
29255
- this.bindBrushEvents();
29270
+ this._bindBrushEvents();
29256
29271
  const group = this.createOrUpdateChild('brush-container', {}, 'group');
29257
29272
  this._container = group;
29258
29273
  }
29259
- setUpdateDragMaskCallback(callback) {
29260
- vutils.isFunction(callback) && (this._updateDragMaskCallback = callback);
29261
- }
29262
29274
  releaseBrushEvents() {
29263
29275
  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;
29264
29276
  this.stage.removeEventListener(trigger, this._onBrushStart);
@@ -29831,7 +29843,6 @@
29831
29843
  });
29832
29844
  }
29833
29845
  handleClick() {
29834
- var _a;
29835
29846
  if (this.attribute.disabled) {
29836
29847
  return;
29837
29848
  }
@@ -29843,12 +29854,10 @@
29843
29854
  this.setAttribute('checked', true);
29844
29855
  this.setAttribute('indeterminate', false);
29845
29856
  }
29846
- const changeEvent = new CustomEvent('checkbox_state_change', {
29857
+ this._dispatchEvent('checkbox_state_change', {
29847
29858
  eventType: 'checkbox_state_change',
29848
29859
  checked: this.attribute.checked
29849
29860
  });
29850
- changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
29851
- this.dispatchEvent(changeEvent);
29852
29861
  }
29853
29862
  }
29854
29863
  CheckBox.defaultAttributes = {
@@ -29889,7 +29898,7 @@
29889
29898
  }
29890
29899
  };
29891
29900
 
29892
- const version = "0.17.2-alpha.3";
29901
+ const version = "0.17.2";
29893
29902
 
29894
29903
  exports.AbstractComponent = AbstractComponent;
29895
29904
  exports.ArcInfo = ArcInfo;