@visactor/vrender-components 0.21.5-vstory.1 → 0.21.5-vstory.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 (42) hide show
  1. package/cjs/index.d.ts +2 -1
  2. package/cjs/index.js +3 -2
  3. package/cjs/index.js.map +1 -1
  4. package/cjs/label-item/index.d.ts +2 -0
  5. package/cjs/label-item/index.js +21 -0
  6. package/cjs/label-item/index.js.map +1 -0
  7. package/cjs/label-item/label-item.d.ts +29 -0
  8. package/cjs/label-item/label-item.js +265 -0
  9. package/cjs/label-item/label-item.js.map +1 -0
  10. package/cjs/label-item/register.d.ts +1 -0
  11. package/cjs/label-item/register.js +15 -0
  12. package/cjs/label-item/register.js.map +1 -0
  13. package/cjs/label-item/type.d.ts +31 -0
  14. package/cjs/label-item/type.js +6 -0
  15. package/cjs/label-item/type.js.map +1 -0
  16. package/cjs/poptip/poptip.d.ts +14 -2
  17. package/cjs/poptip/poptip.js +137 -51
  18. package/cjs/poptip/poptip.js.map +1 -1
  19. package/cjs/poptip/type.d.ts +6 -0
  20. package/cjs/poptip/type.js.map +1 -1
  21. package/dist/index.es.js +432 -65
  22. package/es/index.d.ts +2 -1
  23. package/es/index.js +3 -1
  24. package/es/index.js.map +1 -1
  25. package/es/label-item/index.d.ts +2 -0
  26. package/es/label-item/index.js +4 -0
  27. package/es/label-item/index.js.map +1 -0
  28. package/es/label-item/label-item.d.ts +29 -0
  29. package/es/label-item/label-item.js +263 -0
  30. package/es/label-item/label-item.js.map +1 -0
  31. package/es/label-item/register.d.ts +1 -0
  32. package/es/label-item/register.js +6 -0
  33. package/es/label-item/register.js.map +1 -0
  34. package/es/label-item/type.d.ts +31 -0
  35. package/es/label-item/type.js +2 -0
  36. package/es/label-item/type.js.map +1 -0
  37. package/es/poptip/poptip.d.ts +14 -2
  38. package/es/poptip/poptip.js +136 -49
  39. package/es/poptip/poptip.js.map +1 -1
  40. package/es/poptip/type.d.ts +6 -0
  41. package/es/poptip/type.js.map +1 -1
  42. package/package.json +3 -3
package/dist/index.es.js CHANGED
@@ -2341,7 +2341,8 @@ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute),
2341
2341
  justifyContent: "flex-start",
2342
2342
  alignItems: "flex-start",
2343
2343
  alignContent: "flex-start",
2344
- baseOpacity: 1
2344
+ baseOpacity: 1,
2345
+ cornerType: "round"
2345
2346
  });
2346
2347
  const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2347
2348
  path: "",
@@ -2378,7 +2379,8 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
2378
2379
  x1: 0,
2379
2380
  y1: 0,
2380
2381
  strokeBoundsBuffer: 0,
2381
- cornerRadius: 0
2382
+ cornerRadius: 0,
2383
+ cornerType: "round"
2382
2384
  });
2383
2385
  Object.assign(Object.assign({}, DefaultAttribute), {
2384
2386
  width: 0,
@@ -2386,7 +2388,8 @@ Object.assign(Object.assign({}, DefaultAttribute), {
2386
2388
  x1: 0,
2387
2389
  y1: 0,
2388
2390
  cornerRadius: 0,
2389
- length: 0
2391
+ length: 0,
2392
+ cornerType: "round"
2390
2393
  });
2391
2394
  const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2392
2395
  symbolType: "circle",
@@ -2422,7 +2425,8 @@ const DefaultImageAttribute = Object.assign(Object.assign({
2422
2425
  height: 0
2423
2426
  }, DefaultAttribute), {
2424
2427
  fill: !0,
2425
- cornerRadius: 0
2428
+ cornerRadius: 0,
2429
+ cornerType: "round"
2426
2430
  });
2427
2431
  const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
2428
2432
  backgroundShowMode: "never",
@@ -4271,6 +4275,13 @@ class Easing {
4271
4275
  Easing[name] = func;
4272
4276
  }
4273
4277
  }
4278
+ function flicker(t, n) {
4279
+ const step = 1 / n;
4280
+ let flag = 1;
4281
+ for (; t > step;) t -= step, flag *= -1;
4282
+ const v = flag * t / step;
4283
+ return v > 0 ? v : 1 + v;
4284
+ }
4274
4285
  Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing.quadInOut = Easing.getPowInOut(2), Easing.cubicIn = Easing.getPowIn(3), Easing.cubicOut = Easing.getPowOut(3), Easing.cubicInOut = Easing.getPowInOut(3), Easing.quartIn = Easing.getPowIn(4), Easing.quartOut = Easing.getPowOut(4), Easing.quartInOut = Easing.getPowInOut(4), Easing.quintIn = Easing.getPowIn(5), Easing.quintOut = Easing.getPowOut(5), Easing.quintInOut = Easing.getPowInOut(5), Easing.backIn = Easing.getBackIn(1.7), Easing.backOut = Easing.getBackOut(1.7), Easing.backInOut = Easing.getBackInOut(1.7), Easing.elasticIn = Easing.getElasticIn(1, .3), Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5), Easing.easeInOutQuad = t => (t /= .5) < 1 ? .5 * Math.pow(t, 2) : -.5 * ((t -= 2) * t - 2), Easing.easeOutElastic = x => {
4275
4286
  const c4 = 2 * Math.PI / 3;
4276
4287
  return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
@@ -4278,6 +4289,8 @@ Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing
4278
4289
  const c5 = 2 * Math.PI / 4.5;
4279
4290
  return 0 === x ? 0 : 1 === x ? 1 : x < .5 ? -Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
4280
4291
  };
4292
+ for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
4293
+ for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
4281
4294
 
4282
4295
  class DefaultTimeline {
4283
4296
  constructor() {
@@ -4811,6 +4824,37 @@ var Direction;
4811
4824
  !function (Direction) {
4812
4825
  Direction[Direction.LEFT_TO_RIGHT = 0] = "LEFT_TO_RIGHT", Direction[Direction.RIGHT_TO_LEFT = 1] = "RIGHT_TO_LEFT", Direction[Direction.TOP_TO_BOTTOM = 2] = "TOP_TO_BOTTOM", Direction[Direction.BOTTOM_TO_TOP = 3] = "BOTTOM_TO_TOP", Direction[Direction.STROKE = 4] = "STROKE";
4813
4826
  }(Direction || (Direction = {}));
4827
+ class InputText extends ACustomAnimate {
4828
+ constructor() {
4829
+ super(...arguments), this.fromText = "", this.toText = "";
4830
+ }
4831
+ getEndProps() {
4832
+ return !1 === this.valid ? {} : {
4833
+ text: this.to
4834
+ };
4835
+ }
4836
+ onBind() {
4837
+ var _a, _b, _c;
4838
+ this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "", this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "", (!this.toText || isArray(this.toText) && 0 === this.toText.length) && (this.valid = !1), isArray(this.toText) && (this.toText = this.toText.map(item => (item || "").toString()));
4839
+ }
4840
+ onEnd() {
4841
+ this.target.detachShadow();
4842
+ }
4843
+ onUpdate(end, ratio, out) {
4844
+ if (!1 === this.valid) return;
4845
+ const fromCount = this.fromText.length,
4846
+ toTextIsArray = isArray(this.toText),
4847
+ toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
4848
+ count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
4849
+ if (toTextIsArray) {
4850
+ out.text = [];
4851
+ let len = 0;
4852
+ this.toText.forEach(t => {
4853
+ len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
4854
+ });
4855
+ } else out.text = this.toText.substr(0, count);
4856
+ }
4857
+ }
4814
4858
 
4815
4859
  const normalizeRectAttributes = attribute => {
4816
4860
  if (!attribute) return {
@@ -5660,6 +5704,20 @@ class Graphic extends Node {
5660
5704
  });
5661
5705
  return color && (nextAttributes[key] = color), !0;
5662
5706
  }
5707
+ if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
5708
+ const nextList = [];
5709
+ let valid = !0;
5710
+ for (let i = 0; i < nextStepVal.length; i++) {
5711
+ const v = lastStepVal[i],
5712
+ val = v + (nextStepVal[i] - v) * ratio;
5713
+ if (!Number.isFinite(val)) {
5714
+ valid = !1;
5715
+ break;
5716
+ }
5717
+ nextList.push(val);
5718
+ }
5719
+ valid && (nextAttributes[key] = nextList);
5720
+ }
5663
5721
  return !1;
5664
5722
  }
5665
5723
  _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
@@ -10298,7 +10356,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
10298
10356
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
10299
10357
 
10300
10358
  const halfPi = pi / 2;
10301
- function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
10359
+ function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
10302
10360
  let cornerRadius;
10303
10361
  if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
10304
10362
  const cornerRadiusArr = rectCornerRadius;
@@ -10330,27 +10388,29 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
10330
10388
  rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
10331
10389
  leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
10332
10390
  leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
10333
- if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
10334
- edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
10335
- const centerX = rightTopPoint1[0],
10336
- centerY = rightTopPoint1[1] + _cornerRadius[1];
10337
- path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
10338
- }
10339
- if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
10340
- const centerX = rightBottomPoint2[0] - _cornerRadius[2],
10341
- centerY = rightBottomPoint2[1];
10342
- edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
10343
- }
10344
- if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
10345
- const centerX = leftBottomPoint1[0],
10346
- centerY = leftBottomPoint1[1] - _cornerRadius[3];
10347
- edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
10348
- }
10349
- if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
10350
- const centerX = leftTopPoint1[0],
10351
- centerY = leftTopPoint1[1] + _cornerRadius[0];
10352
- edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
10353
- }
10391
+ if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
10392
+ if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
10393
+ edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
10394
+ const centerX = rightTopPoint1[0],
10395
+ centerY = rightTopPoint1[1] + _cornerRadius[1];
10396
+ path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
10397
+ }
10398
+ if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
10399
+ const centerX = rightBottomPoint2[0] - _cornerRadius[2],
10400
+ centerY = rightBottomPoint2[1];
10401
+ edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
10402
+ }
10403
+ if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
10404
+ const centerX = leftBottomPoint1[0],
10405
+ centerY = leftBottomPoint1[1] - _cornerRadius[3];
10406
+ edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
10407
+ }
10408
+ if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
10409
+ const centerX = leftTopPoint1[0],
10410
+ centerY = leftTopPoint1[1] + _cornerRadius[0];
10411
+ edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
10412
+ }
10413
+ } else edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1]) : path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1]) : path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
10354
10414
  return !edgeCb && path.closePath(), path;
10355
10415
  }
10356
10416
 
@@ -10375,6 +10435,7 @@ class DefaultRectRenderContribution {
10375
10435
  if (!doOuterBorder && !doInnerBorder) return;
10376
10436
  const {
10377
10437
  cornerRadius = rectAttribute.cornerRadius,
10438
+ cornerType = rectAttribute.cornerType,
10378
10439
  opacity = rectAttribute.opacity,
10379
10440
  x: originX = rectAttribute.x,
10380
10441
  y: originY = rectAttribute.y,
@@ -10399,7 +10460,7 @@ class DefaultRectRenderContribution {
10399
10460
  nextX = x + sign * d,
10400
10461
  nextY = y + sign * d,
10401
10462
  dw = 2 * d;
10402
- if (0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
10463
+ if (0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, "round" === cornerType)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
10403
10464
  const lastOpacity = rectAttribute[key].opacity;
10404
10465
  rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
10405
10466
  }
@@ -10430,7 +10491,8 @@ let SplitRectAfterRenderContribution = class {
10430
10491
  x: originX = groupAttribute.x,
10431
10492
  y: originY = groupAttribute.y,
10432
10493
  stroke = groupAttribute.stroke,
10433
- cornerRadius = groupAttribute.cornerRadius
10494
+ cornerRadius = groupAttribute.cornerRadius,
10495
+ cornerType = groupAttribute.cornerType
10434
10496
  } = rect.attribute;
10435
10497
  let {
10436
10498
  width: width,
@@ -10440,7 +10502,7 @@ let SplitRectAfterRenderContribution = class {
10440
10502
  if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num))) {
10441
10503
  let lastStroke,
10442
10504
  lastStrokeI = 0;
10443
- return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
10505
+ return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
10444
10506
  stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
10445
10507
  stroke: stroke[i]
10446
10508
  }), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
@@ -10501,7 +10563,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
10501
10563
  width: width,
10502
10564
  height: height
10503
10565
  } = getActualPosition(graphic);
10504
- cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
10566
+ cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius, !0) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
10505
10567
  } else context.beginPath(), context.rect(x, y, width || 0, height || 0), context.fillStyle = background, context.globalAlpha = 1, context.fill();
10506
10568
  }
10507
10569
  }
@@ -11602,6 +11664,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
11602
11664
  background: background,
11603
11665
  stroke = rectAttribute.stroke,
11604
11666
  cornerRadius = rectAttribute.cornerRadius,
11667
+ cornerType = rectAttribute.cornerType,
11605
11668
  opacity = rectAttribute.opacity,
11606
11669
  fillOpacity = rectAttribute.fillOpacity,
11607
11670
  lineWidth = rectAttribute.lineWidth,
@@ -11625,7 +11688,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
11625
11688
  if (!rect.valid || !visible) return;
11626
11689
  if (!doFill && !doStroke) return;
11627
11690
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
11628
- 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
11691
+ 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
11629
11692
  const doFillOrStroke = {
11630
11693
  doFill: doFill,
11631
11694
  doStroke: doStroke
@@ -11803,7 +11866,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
11803
11866
  const {
11804
11867
  backgroundCornerRadius: backgroundCornerRadius
11805
11868
  } = graphic.attribute;
11806
- context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
11869
+ context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
11807
11870
  }
11808
11871
  shouldReCalBounds && boundsAllocate.free(b), restore();
11809
11872
  }
@@ -12104,6 +12167,7 @@ let DefaultCanvasGroupRender = class {
12104
12167
  lineWidth = groupAttribute.lineWidth,
12105
12168
  visible = groupAttribute.visible,
12106
12169
  fillStrokeOrder = groupAttribute.fillStrokeOrder,
12170
+ cornerType = groupAttribute.cornerType,
12107
12171
  x: originX = groupAttribute.x,
12108
12172
  y: originY = groupAttribute.y
12109
12173
  } = group.attribute,
@@ -12123,7 +12187,7 @@ let DefaultCanvasGroupRender = class {
12123
12187
  context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
12124
12188
  drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
12125
12189
  }), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
12126
- } else 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
12190
+ } else 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
12127
12191
  this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
12128
12192
  const doFillOrStroke = {
12129
12193
  doFill: doFill,
@@ -12205,6 +12269,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
12205
12269
  y: originY = imageAttribute.y,
12206
12270
  cornerRadius = imageAttribute.cornerRadius,
12207
12271
  fillStrokeOrder = imageAttribute.fillStrokeOrder,
12272
+ cornerType = imageAttribute.cornerType,
12208
12273
  image: url
12209
12274
  } = image.attribute,
12210
12275
  data = this.valid(image, imageAttribute, fillCb);
@@ -12222,7 +12287,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
12222
12287
  const res = image.resources.get(url);
12223
12288
  if ("success" !== res.state) return;
12224
12289
  let needRestore = !1;
12225
- 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
12290
+ 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
12226
12291
  let repeat = 0;
12227
12292
  if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
12228
12293
  const pattern = context.createPattern(res.data, repeatStr[repeat]);
@@ -13497,7 +13562,7 @@ let DefaultCanvasRichTextRender = class extends BaseRender {
13497
13562
  if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
13498
13563
  const expandX = (backgroundWidth - width) / 2,
13499
13564
  expandY = (backgroundHeight - height) / 2;
13500
- 0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
13565
+ 0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
13501
13566
  }
13502
13567
  const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
13503
13568
  res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
@@ -15879,6 +15944,20 @@ function setPoptipTheme(defaultPoptipTheme) {
15879
15944
 
15880
15945
  const _tBounds = new AABBBounds();
15881
15946
  loadPoptipComponent();
15947
+ const tlStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z';
15948
+ const blStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z';
15949
+ const trStr = 'M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z';
15950
+ const brStr = 'M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z';
15951
+ const conciseSymbolMap = {
15952
+ tl: tlStr,
15953
+ tr: trStr,
15954
+ bl: blStr,
15955
+ br: brStr,
15956
+ lt: tlStr,
15957
+ lb: blStr,
15958
+ rt: trStr,
15959
+ rb: brStr
15960
+ };
15882
15961
  class PopTip extends AbstractComponent {
15883
15962
  constructor(attributes, options) {
15884
15963
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, PopTip.defaultAttributes, attributes));
@@ -15886,13 +15965,14 @@ class PopTip extends AbstractComponent {
15886
15965
  this.positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];
15887
15966
  }
15888
15967
  render() {
15889
- var _a, _b, _c, _d, _e, _f, _g, _h;
15890
- const { titleStyle = {}, position, contentStyle = {}, panel = {}, space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0 } = this.attribute;
15968
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15969
+ const { titleStyle = {}, position, contentStyle = {}, panel, logoSymbol, logoText, logoTextStyle = {}, triangleMode = 'default', space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0 } = this.attribute;
15891
15970
  let { title = '', content = '' } = this.attribute;
15892
15971
  title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;
15893
15972
  content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
15894
15973
  const parsedPadding = normalizePadding(padding);
15895
15974
  const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group');
15975
+ this.group = group;
15896
15976
  const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];
15897
15977
  const titleVisible = isValid(title) && visible !== false;
15898
15978
  const titleAttrs = Object.assign(Object.assign({ text: isArray(title) ? title : [title], visible: titleVisible, wrap: true }, titleStyle), { x: parsedPadding[3], y: parsedPadding[0], maxLineWidth, textAlign: 'left', textBaseline: 'top' });
@@ -15919,6 +15999,8 @@ class PopTip extends AbstractComponent {
15919
15999
  if (contentVisible) {
15920
16000
  height += contentHeight;
15921
16001
  }
16002
+ this.titleShape = titleShape;
16003
+ this.contentShape = contentShape;
15922
16004
  let popTipWidth = max(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
15923
16005
  if (popTipWidth > maxWidth) {
15924
16006
  popTipWidth = maxWidth;
@@ -15927,7 +16009,15 @@ class PopTip extends AbstractComponent {
15927
16009
  popTipWidth = minWidth;
15928
16010
  }
15929
16011
  let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
15930
- const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
16012
+ const { visible: bgVisible, square } = panel, backgroundStyle = __rest(panel, ["visible", "square"]);
16013
+ if (square) {
16014
+ const maxWH = max(popTipWidth, poptipHeight);
16015
+ popTipWidth = maxWH;
16016
+ const deltaH = maxWH - poptipHeight;
16017
+ poptipHeight = maxWH;
16018
+ titleShape.setAttributes({ dy: deltaH / 2 });
16019
+ contentShape.setAttributes({ dy: deltaH / 2 });
16020
+ }
15931
16021
  const symbolSize = (_a = backgroundStyle.size) !== null && _a !== void 0 ? _a : 12;
15932
16022
  const spaceSize = isArray(symbolSize)
15933
16023
  ? [symbolSize[0] + ((_b = backgroundStyle.space) !== null && _b !== void 0 ? _b : 0), symbolSize[1] + ((_c = backgroundStyle.space) !== null && _c !== void 0 ? _c : 0)]
@@ -15963,22 +16053,62 @@ class PopTip extends AbstractComponent {
15963
16053
  let maxBBoxSize = -Infinity;
15964
16054
  for (let i = 0; i < this.positionList.length + 1; i++) {
15965
16055
  const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
15966
- const { angle, offset, rectOffset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth]);
16056
+ let symbolType = 'arrow2Left';
16057
+ let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
16058
+ let offsetY = 0;
16059
+ if (p === 'top' || p === 'bottom' || p === 'left' || p === 'right') {
16060
+ symbolType = 'arrow2Left';
16061
+ }
16062
+ else if (triangleMode === 'concise') {
16063
+ symbolType = conciseSymbolMap[p];
16064
+ offsetX = ['tl', 'bl', 'rt', 'rb'].includes(position)
16065
+ ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2
16066
+ : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;
16067
+ offsetY = ['tl', 'tr', 'lb', 'rb'].includes(position)
16068
+ ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2
16069
+ : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;
16070
+ }
16071
+ const { angle, offset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
15967
16072
  if (isBoolean(bgVisible)) {
15968
- const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
15969
- const bgSymbol = group.createOrUpdateChild('poptip-symbol-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: offsetX, y: 0, strokeBoundsBuffer: -1, boundsPadding: -2, anchor: [0, 0], symbolType: 'arrow2Left', angle: angle, dx: offset[0], dy: offset[1], size: symbolSize, zIndex: -9 }), 'symbol');
16073
+ const bgSymbol = group.createOrUpdateChild('poptip-symbol-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: offsetX, y: offsetY, strokeBoundsBuffer: -1, boundsPadding: -2, anchor: [0, 0], symbolType, angle: angle, dx: offset[0], dy: offset[1] - ((_j = backgroundStyle.space) !== null && _j !== void 0 ? _j : 0), size: symbolSize, zIndex: 9 }), 'symbol');
15970
16074
  if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
15971
16075
  bgSymbol.states = state.panel;
15972
16076
  }
15973
- const bgRect = group.createOrUpdateChild('poptip-rect-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: 0, y: 0, width: popTipWidth, height: poptipHeight, zIndex: -8 }), 'rect');
16077
+ let bgRect;
16078
+ if (panel.panelSymbolType) {
16079
+ bgRect = group.createOrUpdateChild('poptip-rect-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: 0, y: 0, symbolType: 'rect', size: [popTipWidth, poptipHeight], zIndex: -8 }), 'symbol');
16080
+ }
16081
+ else {
16082
+ bgRect = group.createOrUpdateChild('poptip-rect-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: 0, y: 0, width: popTipWidth, height: poptipHeight, zIndex: -8 }), 'rect');
16083
+ }
15974
16084
  if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
15975
16085
  bgRect.states = state.panel;
15976
16086
  }
15977
16087
  }
15978
16088
  group.setAttributes({
15979
16089
  x: -offset[0] + dx,
15980
- y: -offset[1] + dy
16090
+ y: -offset[1] + dy,
16091
+ anchor: [offsetX, offsetY]
15981
16092
  });
16093
+ if (logoSymbol) {
16094
+ const { size = 12 } = logoSymbol;
16095
+ const sizeArray = isArray(size) ? size : [size, size];
16096
+ if (sizeArray[1] === 'auto') {
16097
+ sizeArray[1] = poptipHeight;
16098
+ }
16099
+ if (sizeArray[0] === 'auto') {
16100
+ sizeArray[0] = poptipHeight;
16101
+ }
16102
+ const sizeW = sizeArray[0];
16103
+ group.createOrUpdateChild('poptip-logo', Object.assign(Object.assign({}, logoSymbol), { x: 0, y: poptipHeight / 2, visible: bgVisible && (contentVisible || titleVisible), zIndex: 10, size: sizeArray }), 'symbol');
16104
+ group.setAttributes({
16105
+ x: -offset[0] + dx + sizeW / 2,
16106
+ y: -offset[1] + dy
16107
+ });
16108
+ if (logoText) {
16109
+ group.createOrUpdateChild('poptip-logo-text', Object.assign(Object.assign({}, logoTextStyle), { x: 0, y: poptipHeight / 2, visible: bgVisible && (contentVisible || titleVisible), text: logoText, textAlign: 'center', textBaseline: 'middle', zIndex: 10 }), 'text');
16110
+ }
16111
+ }
15982
16112
  if (layout && range) {
15983
16113
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
15984
16114
  const b = _tBounds;
@@ -16000,47 +16130,85 @@ class PopTip extends AbstractComponent {
16000
16130
  }
16001
16131
  }
16002
16132
  }
16003
- getAngleAndOffset(position, width, height, size) {
16004
- const sizeH = size[1] / 2;
16133
+ getAngleAndOffset(position, width, height, size, symbolType) {
16134
+ const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];
16005
16135
  switch (position) {
16006
16136
  case 'tl':
16007
16137
  return {
16008
- angle: (pi / 2) * 3,
16009
- offset: [width / 4, height + sizeH],
16010
- rectOffset: [-width / 4, -height - size[1]]
16138
+ angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,
16139
+ offset: symbolType === 'arrow2Left' ? [width / 4, height + sizeH] : [0, height + sizeH]
16011
16140
  };
16012
16141
  case 'top':
16013
- return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH], rectOffset: [0, -height - size[1]] };
16142
+ return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH] };
16014
16143
  case 'tr':
16015
16144
  return {
16016
- angle: (pi / 2) * 3,
16017
- offset: [(width / 4) * 3, height + sizeH],
16018
- rectOffset: [(width / 4) * 3, -height - size[1]]
16145
+ angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,
16146
+ offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, height + sizeH] : [width, height + sizeH]
16019
16147
  };
16020
16148
  case 'rt':
16021
- return { angle: 0, offset: [-sizeH, height / 5], rectOffset: [(width / 4) * 3, -height - size[1]] };
16149
+ return {
16150
+ angle: 0,
16151
+ offset: symbolType === 'arrow2Left' ? [-sizeH, height / 5] : [-sizeH, 0]
16152
+ };
16022
16153
  case 'right':
16023
- return { angle: 0, offset: [-sizeH, height / 2], rectOffset: [(width / 4) * 3, -height - size[1]] };
16154
+ return { angle: 0, offset: [-sizeH, height / 2] };
16024
16155
  case 'rb':
16025
- return { angle: 0, offset: [-sizeH, (height / 5) * 4], rectOffset: [(width / 4) * 3, -height - size[1]] };
16156
+ return {
16157
+ angle: 0,
16158
+ offset: symbolType === 'arrow2Left' ? [-sizeH, (height / 5) * 4] : [-sizeH, height]
16159
+ };
16026
16160
  case 'bl':
16027
- return { angle: pi / 2, offset: [width / 4, -sizeH], rectOffset: [-width / 4, -height - size[1]] };
16161
+ return {
16162
+ angle: symbolType === 'arrow2Left' ? pi / 2 : 0,
16163
+ offset: symbolType === 'arrow2Left' ? [width / 4, -sizeH] : [0, -sizeH]
16164
+ };
16028
16165
  case 'bottom':
16029
- return { angle: pi / 2, offset: [width / 2, -sizeH], rectOffset: [0, -height - size[1]] };
16166
+ return { angle: pi / 2, offset: [width / 2, -sizeH] };
16030
16167
  case 'br':
16031
- return { angle: pi / 2, offset: [(width / 4) * 3, -sizeH], rectOffset: [(width / 4) * 3, -height - size[1]] };
16168
+ return {
16169
+ angle: symbolType === 'arrow2Left' ? pi / 2 : 0,
16170
+ offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, -sizeH] : [width, -sizeH]
16171
+ };
16032
16172
  case 'lt':
16033
- return { angle: pi, offset: [width + sizeH, height / 5], rectOffset: [-width / 4, -height - size[1]] };
16173
+ return {
16174
+ angle: symbolType === 'arrow2Left' ? pi : 0,
16175
+ offset: symbolType === 'arrow2Left' ? [width + sizeH, height / 5] : [width + sizeH, 0]
16176
+ };
16034
16177
  case 'left':
16035
- return { angle: pi, offset: [width + sizeH, height / 2], rectOffset: [0, -height - size[1]] };
16178
+ return { angle: pi, offset: [width + sizeH, height / 2] };
16036
16179
  case 'lb':
16037
16180
  return {
16038
- angle: pi,
16039
- offset: [width + sizeH, (height / 5) * 4],
16040
- rectOffset: [(width / 4) * 3, -height - size[1]]
16181
+ angle: symbolType === 'arrow2Left' ? pi : 0,
16182
+ offset: symbolType === 'arrow2Left' ? [width + sizeH, (height / 5) * 4] : [width + sizeH, height]
16041
16183
  };
16042
16184
  }
16043
16185
  }
16186
+ appearAnimate(animateConfig) {
16187
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
16188
+ this.setAttributes({ scaleX: 0, scaleY: 0 });
16189
+ this.animate().to({ scaleX: 1, scaleY: 1 }, (duration / 3) * 2, easing);
16190
+ this.titleShape &&
16191
+ this.titleShape
16192
+ .animate()
16193
+ .play(new InputText({ text: '' }, { text: this.titleShape.attribute.text }, duration, easing));
16194
+ this.contentShape &&
16195
+ this.contentShape
16196
+ .animate()
16197
+ .play(new InputText({ text: '' }, { text: this.contentShape.attribute.text }, duration, easing));
16198
+ if (animateConfig.wave) {
16199
+ const dur = duration / 6;
16200
+ this.group
16201
+ .animate()
16202
+ .to({ angle: animateConfig.wave }, dur, easing)
16203
+ .to({ angle: -animateConfig.wave }, dur * 2, easing)
16204
+ .to({ angle: animateConfig.wave }, dur * 2, easing)
16205
+ .to({ angle: 0 }, dur, easing);
16206
+ }
16207
+ }
16208
+ disappearAnimate(animateConfig) {
16209
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
16210
+ this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
16211
+ }
16044
16212
  }
16045
16213
  PopTip.defaultAttributes = {
16046
16214
  position: 'rt',
@@ -16059,6 +16227,7 @@ PopTip.defaultAttributes = {
16059
16227
  textAlign: 'left',
16060
16228
  textBaseline: 'top'
16061
16229
  },
16230
+ panel: {},
16062
16231
  maxWidthPercent: 0.8,
16063
16232
  space: 8,
16064
16233
  padding: 10
@@ -30609,6 +30778,204 @@ WeatherBox.defaultAttributes = {
30609
30778
  snowRainBottomPadding: 0
30610
30779
  };
30611
30780
 
30612
- const version = "0.21.5-vstory.1";
30781
+ class StoryLabelItem extends AbstractComponent {
30782
+ constructor(attributes, options) {
30783
+ super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, StoryLabelItem.defaultAttributes, attributes));
30784
+ }
30785
+ render() {
30786
+ const { contentOffsetX, contentOffsetY, lineStyle, symbolStartStyle, symbolEndStyle, symbolStartOuterStyle, titleTop: titleTopText, titleBottom: titleBottomText, titleTopStyle, titleBottomStyle, titleSpace, titleTopPanelStyle, titleBottomPanelStyle, theme } = this.attribute;
30787
+ const group = this.createOrUpdateChild('label-item-container', { x: 0, y: 0, zIndex: 1 }, 'group');
30788
+ const symbolStart = group.createOrUpdateChild('label-item-symbol-start', Object.assign({ x: 0, y: 0 }, symbolStartStyle), 'symbol');
30789
+ const symbolEnd = group.createOrUpdateChild('label-item-symbol-end', Object.assign({ x: contentOffsetX, y: contentOffsetY }, symbolEndStyle), 'symbol');
30790
+ const symbolStartOut = group.createOrUpdateChild('label-item-symbol-start-out', Object.assign({ x: 0, y: 0 }, symbolStartOuterStyle), 'symbol');
30791
+ const spaceW = titleSpace[0];
30792
+ const spaceH = titleSpace[1];
30793
+ const titleTopGroup = group.createOrUpdateChild('label-item-title-top-group', { x: contentOffsetX, y: contentOffsetY, clip: true }, 'group');
30794
+ const titleTop = titleTopGroup.createOrUpdateChild('label-item-title-top', Object.assign(Object.assign({ x: spaceW, y: -spaceH, text: titleTopText }, titleTopStyle), { textBaseline: 'bottom', textAlign: 'left', zIndex: 10 }), 'text');
30795
+ const titleTopBounds = titleTop.AABBBounds;
30796
+ if (contentOffsetX > 0) {
30797
+ titleTopGroup.setAttributes({ x: contentOffsetX - titleTopBounds.width() - spaceW * 2 });
30798
+ }
30799
+ titleTopGroup.setAttributes({
30800
+ width: titleTopBounds.width() + spaceW * 2,
30801
+ height: -titleTopBounds.height() - spaceH * 2
30802
+ });
30803
+ const titleTopPanel = titleTopGroup.createOrUpdateChild('label-item-title-top-panel', Object.assign(Object.assign({}, titleTopPanelStyle), { x: titleTopPanelStyle.padding.left, y: (titleTopGroup.attribute.height > 0 ? 0 : titleTopGroup.attribute.height) + titleTopPanelStyle.padding.top, width: titleTopGroup.attribute.width - titleTopPanelStyle.padding.left - titleTopPanelStyle.padding.right, height: (titleTopGroup.attribute.height > 0 ? 1 : -1) * titleTopGroup.attribute.height -
30804
+ titleTopPanelStyle.padding.bottom -
30805
+ titleTopPanelStyle.padding.top, scaleCenter: [titleTopGroup.attribute.width / 2, titleTopGroup.attribute.height / 2] }), 'rect');
30806
+ this._titleTopPanel = titleTopPanel;
30807
+ const titleBottomGroup = group.createOrUpdateChild('label-item-title-bottom-group', { x: contentOffsetX, y: contentOffsetY, clip: true }, 'group');
30808
+ const titleBottom = titleBottomGroup.createOrUpdateChild('label-item-title-bottom', Object.assign(Object.assign({ x: spaceW, y: spaceH, text: titleBottomText }, titleBottomStyle), { textBaseline: 'top', textAlign: 'left', zIndex: 10 }), 'text');
30809
+ const titleBottomBounds = titleBottom.AABBBounds;
30810
+ if (contentOffsetX > 0) {
30811
+ titleBottomGroup.setAttributes({ x: contentOffsetX - titleBottomBounds.width() - spaceW * 2 });
30812
+ }
30813
+ titleBottomGroup.setAttributes({
30814
+ width: titleBottomBounds.width() + spaceW * 2,
30815
+ height: titleTopBounds.height() + spaceH * 2
30816
+ });
30817
+ const titleBottomPanel = titleBottomGroup.createOrUpdateChild('label-item-title-bottom-panel', Object.assign(Object.assign({}, titleBottomPanelStyle), { x: titleBottomPanelStyle.padding.left, y: (titleBottomGroup.attribute.height > 0 ? 0 : titleBottomGroup.attribute.height) +
30818
+ titleBottomPanelStyle.padding.top, width: titleBottomGroup.attribute.width - titleBottomPanelStyle.padding.left - titleBottomPanelStyle.padding.right, height: (titleBottomGroup.attribute.height > 0 ? 1 : -1) * titleBottomGroup.attribute.height -
30819
+ titleBottomPanelStyle.padding.bottom -
30820
+ titleBottomPanelStyle.padding.top, scaleCenter: [titleBottomGroup.attribute.width / 2, titleBottomGroup.attribute.height / 2] }), 'rect');
30821
+ this._titleBottomPanel = titleBottomPanel;
30822
+ const maxTextWidth = Math.max(titleTop.AABBBounds.width(), titleBottom.AABBBounds.width()) + spaceW * 2;
30823
+ const points = [
30824
+ { x: 0, y: 0 },
30825
+ contentOffsetX > 0
30826
+ ? { x: contentOffsetX - maxTextWidth, y: contentOffsetY }
30827
+ : { x: contentOffsetX + maxTextWidth, y: contentOffsetY },
30828
+ { x: contentOffsetX, y: contentOffsetY }
30829
+ ];
30830
+ if (theme === 'simple') {
30831
+ points.pop();
30832
+ const p = points[1];
30833
+ symbolEnd.setAttributes(p);
30834
+ }
30835
+ const line = group.createOrUpdateChild('label-item-line', Object.assign(Object.assign({ x: 0, y: 0 }, lineStyle), { points }), 'line');
30836
+ this._symbolEnd = symbolEnd;
30837
+ this._symbolStart = symbolStart;
30838
+ this._symbolStartOuter = symbolStartOut;
30839
+ this._titleTop = titleTop;
30840
+ this._titleBottom = titleBottom;
30841
+ this._line = line;
30842
+ }
30843
+ appearAnimate(animateConfig) {
30844
+ const { duration = 1000, easing = 'quadOut', symbolStartOuterType = 'scale', titleType = 'typewriter', titlePanelType = 'scale' } = animateConfig;
30845
+ const symbolTime = duration / 10;
30846
+ this._symbolStart.setAttributes({ scaleX: 0, scaleY: 0 });
30847
+ this._symbolStart.animate().to({ scaleX: 1, scaleY: 1 }, symbolTime * 5, easing);
30848
+ let symbolStartOuterFrom;
30849
+ let symbolStartOuterTo;
30850
+ if (symbolStartOuterType === 'scale') {
30851
+ symbolStartOuterFrom = { scaleX: 0, scaleY: 0 };
30852
+ symbolStartOuterTo = { scaleX: 1, scaleY: 1 };
30853
+ }
30854
+ else {
30855
+ symbolStartOuterFrom = { clipRange: 0 };
30856
+ symbolStartOuterTo = { clipRange: 1 };
30857
+ }
30858
+ this._symbolStartOuter.setAttributes(symbolStartOuterFrom);
30859
+ this._symbolStartOuter.animate().to(symbolStartOuterTo, symbolTime * 5, easing);
30860
+ this._symbolEnd.setAttributes({ scaleX: 0, scaleY: 0 });
30861
+ this._symbolEnd
30862
+ .animate()
30863
+ .wait(symbolTime * 8)
30864
+ .to({ scaleX: 1, scaleY: 1 }, symbolTime * 2, easing);
30865
+ this._line.setAttributes({ clipRange: 0 });
30866
+ this._line.animate().to({ clipRange: 1 }, symbolTime * 9, easing);
30867
+ if (titleType === 'typewriter') {
30868
+ const titleTopText = this._titleTop.attribute.text;
30869
+ this._titleTop.setAttributes({ text: '' });
30870
+ this._titleTop
30871
+ .animate()
30872
+ .wait(symbolTime * 5)
30873
+ .play(new InputText({ text: '' }, { text: titleTopText }, symbolTime * 4, 'linear'));
30874
+ const titleBottomText = this._titleBottom.attribute.text;
30875
+ this._titleBottom.setAttributes({ text: '' });
30876
+ this._titleBottom
30877
+ .animate()
30878
+ .wait(symbolTime * 5)
30879
+ .play(new InputText({ text: '' }, { text: titleBottomText }, symbolTime * 4, 'linear'));
30880
+ }
30881
+ else {
30882
+ this._titleTop.setAttributes({ dy: this._titleTop.AABBBounds.height() + 10 });
30883
+ this._titleTop
30884
+ .animate()
30885
+ .wait(symbolTime * 5)
30886
+ .to({ dy: 0 }, symbolTime * 4, 'linear');
30887
+ this._titleBottom.setAttributes({ dy: -(10 + this._titleBottom.AABBBounds.height()) });
30888
+ this._titleBottom
30889
+ .animate()
30890
+ .wait(symbolTime * 5)
30891
+ .to({ dy: 0 }, symbolTime * 4, 'linear');
30892
+ }
30893
+ if (titlePanelType === 'scale') {
30894
+ [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {
30895
+ const scaleX = panel.attribute.scaleX;
30896
+ panel.setAttributes({ scaleX: 0 });
30897
+ panel.animate().to({ scaleX }, duration, 'circInOut');
30898
+ });
30899
+ }
30900
+ else if (titlePanelType === 'stroke') {
30901
+ [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {
30902
+ const b = panel.AABBBounds;
30903
+ const totalLen = (b.width() + b.height()) * 2;
30904
+ panel.setAttributes({ lineDash: [0, totalLen * 10] });
30905
+ panel.animate().to({ lineDash: [totalLen, totalLen * 10] }, duration, 'quadOut');
30906
+ });
30907
+ }
30908
+ }
30909
+ disappearAnimate(animateConfig) {
30910
+ if (animateConfig.mode === 'scale') {
30911
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
30912
+ this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
30913
+ }
30914
+ else {
30915
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
30916
+ this._line.animate().to({ clipRange: 0 }, duration, easing);
30917
+ this._symbolStart
30918
+ .animate()
30919
+ .wait(duration / 2)
30920
+ .to({ scaleX: 0, scaleY: 0 }, duration / 2, easing);
30921
+ this._symbolEnd.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
30922
+ this._titleTop.animate().to({ dy: this._titleTop.AABBBounds.height() + 10 }, duration / 2, easing);
30923
+ this._titleBottom
30924
+ .animate()
30925
+ .to({ dy: -(10 + this._titleBottom.AABBBounds.height()) }, duration / 2, easing);
30926
+ this._symbolStartOuter
30927
+ .animate()
30928
+ .wait(duration / 2)
30929
+ .to({ clipRange: 0 }, duration / 2, easing);
30930
+ this._titleTopPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');
30931
+ this._titleBottomPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');
30932
+ }
30933
+ }
30934
+ }
30935
+ StoryLabelItem.defaultAttributes = {
30936
+ contentOffsetX: 100,
30937
+ contentOffsetY: -60,
30938
+ titleTopStyle: {
30939
+ fontSize: 12,
30940
+ fill: 'white'
30941
+ },
30942
+ titleBottomStyle: {
30943
+ fontSize: 12,
30944
+ fill: 'white'
30945
+ },
30946
+ lineStyle: {
30947
+ stroke: 'white',
30948
+ lineWidth: 1
30949
+ },
30950
+ symbolStartStyle: {
30951
+ symbolType: 'circle',
30952
+ size: 3,
30953
+ fill: 'white'
30954
+ },
30955
+ symbolEndStyle: {
30956
+ symbolType: 'circle',
30957
+ size: 3,
30958
+ fill: 'white'
30959
+ },
30960
+ symbolStartOuterStyle: {
30961
+ symbolType: 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0',
30962
+ size: 8,
30963
+ stroke: 'white'
30964
+ },
30965
+ titleSpace: [2, 2],
30966
+ titleTopPanelStyle: {
30967
+ visible: false,
30968
+ padding: { left: 0, right: 0, bottom: 2, top: 2 },
30969
+ cornerRadius: 3
30970
+ },
30971
+ titleBottomPanelStyle: {
30972
+ visible: false,
30973
+ padding: { left: 0, right: 0, bottom: 2, top: 2 },
30974
+ cornerRadius: 3
30975
+ },
30976
+ theme: 'default'
30977
+ };
30978
+
30979
+ const version = "0.21.5-vstory.2";
30613
30980
 
30614
- export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
30981
+ export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };