@visactor/vrender-components 0.21.2-vstory.1 → 0.21.2-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
@@ -2311,7 +2311,8 @@ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute),
2311
2311
  justifyContent: "flex-start",
2312
2312
  alignItems: "flex-start",
2313
2313
  alignContent: "flex-start",
2314
- baseOpacity: 1
2314
+ baseOpacity: 1,
2315
+ cornerType: "round"
2315
2316
  });
2316
2317
  const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2317
2318
  path: "",
@@ -2348,7 +2349,8 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
2348
2349
  x1: 0,
2349
2350
  y1: 0,
2350
2351
  strokeBoundsBuffer: 0,
2351
- cornerRadius: 0
2352
+ cornerRadius: 0,
2353
+ cornerType: "round"
2352
2354
  });
2353
2355
  Object.assign(Object.assign({}, DefaultAttribute), {
2354
2356
  width: 0,
@@ -2356,7 +2358,8 @@ Object.assign(Object.assign({}, DefaultAttribute), {
2356
2358
  x1: 0,
2357
2359
  y1: 0,
2358
2360
  cornerRadius: 0,
2359
- length: 0
2361
+ length: 0,
2362
+ cornerType: "round"
2360
2363
  });
2361
2364
  const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2362
2365
  symbolType: "circle",
@@ -2392,7 +2395,8 @@ const DefaultImageAttribute = Object.assign(Object.assign({
2392
2395
  height: 0
2393
2396
  }, DefaultAttribute), {
2394
2397
  fill: !0,
2395
- cornerRadius: 0
2398
+ cornerRadius: 0,
2399
+ cornerType: "round"
2396
2400
  });
2397
2401
  const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
2398
2402
  backgroundShowMode: "never",
@@ -4241,6 +4245,13 @@ class Easing {
4241
4245
  Easing[name] = func;
4242
4246
  }
4243
4247
  }
4248
+ function flicker(t, n) {
4249
+ const step = 1 / n;
4250
+ let flag = 1;
4251
+ for (; t > step;) t -= step, flag *= -1;
4252
+ const v = flag * t / step;
4253
+ return v > 0 ? v : 1 + v;
4254
+ }
4244
4255
  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 => {
4245
4256
  const c4 = 2 * Math.PI / 3;
4246
4257
  return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
@@ -4248,6 +4259,8 @@ Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing
4248
4259
  const c5 = 2 * Math.PI / 4.5;
4249
4260
  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;
4250
4261
  };
4262
+ for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
4263
+ for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
4251
4264
 
4252
4265
  class DefaultTimeline {
4253
4266
  constructor() {
@@ -4781,6 +4794,37 @@ var Direction;
4781
4794
  !function (Direction) {
4782
4795
  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";
4783
4796
  }(Direction || (Direction = {}));
4797
+ class InputText extends ACustomAnimate {
4798
+ constructor() {
4799
+ super(...arguments), this.fromText = "", this.toText = "";
4800
+ }
4801
+ getEndProps() {
4802
+ return !1 === this.valid ? {} : {
4803
+ text: this.to
4804
+ };
4805
+ }
4806
+ onBind() {
4807
+ var _a, _b, _c;
4808
+ 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()));
4809
+ }
4810
+ onEnd() {
4811
+ this.target.detachShadow();
4812
+ }
4813
+ onUpdate(end, ratio, out) {
4814
+ if (!1 === this.valid) return;
4815
+ const fromCount = this.fromText.length,
4816
+ toTextIsArray = isArray(this.toText),
4817
+ toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
4818
+ count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
4819
+ if (toTextIsArray) {
4820
+ out.text = [];
4821
+ let len = 0;
4822
+ this.toText.forEach(t => {
4823
+ len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
4824
+ });
4825
+ } else out.text = this.toText.substr(0, count);
4826
+ }
4827
+ }
4784
4828
 
4785
4829
  const normalizeRectAttributes = attribute => {
4786
4830
  if (!attribute) return {
@@ -5630,6 +5674,20 @@ class Graphic extends Node {
5630
5674
  });
5631
5675
  return color && (nextAttributes[key] = color), !0;
5632
5676
  }
5677
+ if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
5678
+ const nextList = [];
5679
+ let valid = !0;
5680
+ for (let i = 0; i < nextStepVal.length; i++) {
5681
+ const v = lastStepVal[i],
5682
+ val = v + (nextStepVal[i] - v) * ratio;
5683
+ if (!Number.isFinite(val)) {
5684
+ valid = !1;
5685
+ break;
5686
+ }
5687
+ nextList.push(val);
5688
+ }
5689
+ valid && (nextAttributes[key] = nextList);
5690
+ }
5633
5691
  return !1;
5634
5692
  }
5635
5693
  _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
@@ -10268,7 +10326,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
10268
10326
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
10269
10327
 
10270
10328
  const halfPi = pi / 2;
10271
- function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
10329
+ function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
10272
10330
  let cornerRadius;
10273
10331
  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)) {
10274
10332
  const cornerRadiusArr = rectCornerRadius;
@@ -10300,27 +10358,29 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
10300
10358
  rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
10301
10359
  leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
10302
10360
  leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
10303
- 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)) {
10304
- edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
10305
- const centerX = rightTopPoint1[0],
10306
- centerY = rightTopPoint1[1] + _cornerRadius[1];
10307
- path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
10308
- }
10309
- if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
10310
- const centerX = rightBottomPoint2[0] - _cornerRadius[2],
10311
- centerY = rightBottomPoint2[1];
10312
- edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
10313
- }
10314
- if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
10315
- const centerX = leftBottomPoint1[0],
10316
- centerY = leftBottomPoint1[1] - _cornerRadius[3];
10317
- edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
10318
- }
10319
- if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
10320
- const centerX = leftTopPoint1[0],
10321
- centerY = leftTopPoint1[1] + _cornerRadius[0];
10322
- edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
10323
- }
10361
+ if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
10362
+ if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
10363
+ edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
10364
+ const centerX = rightTopPoint1[0],
10365
+ centerY = rightTopPoint1[1] + _cornerRadius[1];
10366
+ path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
10367
+ }
10368
+ if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
10369
+ const centerX = rightBottomPoint2[0] - _cornerRadius[2],
10370
+ centerY = rightBottomPoint2[1];
10371
+ edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
10372
+ }
10373
+ if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
10374
+ const centerX = leftBottomPoint1[0],
10375
+ centerY = leftBottomPoint1[1] - _cornerRadius[3];
10376
+ edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
10377
+ }
10378
+ if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
10379
+ const centerX = leftTopPoint1[0],
10380
+ centerY = leftTopPoint1[1] + _cornerRadius[0];
10381
+ edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
10382
+ }
10383
+ } 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]);
10324
10384
  return !edgeCb && path.closePath(), path;
10325
10385
  }
10326
10386
 
@@ -10345,6 +10405,7 @@ class DefaultRectRenderContribution {
10345
10405
  if (!doOuterBorder && !doInnerBorder) return;
10346
10406
  const {
10347
10407
  cornerRadius = rectAttribute.cornerRadius,
10408
+ cornerType = rectAttribute.cornerType,
10348
10409
  opacity = rectAttribute.opacity,
10349
10410
  x: originX = rectAttribute.x,
10350
10411
  y: originY = rectAttribute.y,
@@ -10369,7 +10430,7 @@ class DefaultRectRenderContribution {
10369
10430
  nextX = x + sign * d,
10370
10431
  nextY = y + sign * d,
10371
10432
  dw = 2 * d;
10372
- 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) {
10433
+ 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) {
10373
10434
  const lastOpacity = rectAttribute[key].opacity;
10374
10435
  rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
10375
10436
  }
@@ -10400,7 +10461,8 @@ let SplitRectAfterRenderContribution = class {
10400
10461
  x: originX = groupAttribute.x,
10401
10462
  y: originY = groupAttribute.y,
10402
10463
  stroke = groupAttribute.stroke,
10403
- cornerRadius = groupAttribute.cornerRadius
10464
+ cornerRadius = groupAttribute.cornerRadius,
10465
+ cornerType = groupAttribute.cornerType
10404
10466
  } = rect.attribute;
10405
10467
  let {
10406
10468
  width: width,
@@ -10410,7 +10472,7 @@ let SplitRectAfterRenderContribution = class {
10410
10472
  if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num))) {
10411
10473
  let lastStroke,
10412
10474
  lastStrokeI = 0;
10413
- return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
10475
+ return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
10414
10476
  stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
10415
10477
  stroke: stroke[i]
10416
10478
  }), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
@@ -10469,7 +10531,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
10469
10531
  width: width,
10470
10532
  height: height
10471
10533
  } = getActualPosition(graphic);
10472
- 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());
10534
+ 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());
10473
10535
  } else {
10474
10536
  context.beginPath();
10475
10537
  const b = graphic.AABBBounds;
@@ -11574,6 +11636,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
11574
11636
  background: background,
11575
11637
  stroke = rectAttribute.stroke,
11576
11638
  cornerRadius = rectAttribute.cornerRadius,
11639
+ cornerType = rectAttribute.cornerType,
11577
11640
  opacity = rectAttribute.opacity,
11578
11641
  fillOpacity = rectAttribute.fillOpacity,
11579
11642
  lineWidth = rectAttribute.lineWidth,
@@ -11597,7 +11660,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
11597
11660
  if (!rect.valid || !visible) return;
11598
11661
  if (!doFill && !doStroke) return;
11599
11662
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
11600
- 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));
11663
+ 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));
11601
11664
  const doFillOrStroke = {
11602
11665
  doFill: doFill,
11603
11666
  doStroke: doStroke
@@ -11775,7 +11838,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
11775
11838
  const {
11776
11839
  backgroundCornerRadius: backgroundCornerRadius
11777
11840
  } = graphic.attribute;
11778
- 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();
11841
+ 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();
11779
11842
  }
11780
11843
  shouldReCalBounds && boundsAllocate.free(b), restore();
11781
11844
  }
@@ -12076,6 +12139,7 @@ let DefaultCanvasGroupRender = class {
12076
12139
  lineWidth = groupAttribute.lineWidth,
12077
12140
  visible = groupAttribute.visible,
12078
12141
  fillStrokeOrder = groupAttribute.fillStrokeOrder,
12142
+ cornerType = groupAttribute.cornerType,
12079
12143
  x: originX = groupAttribute.x,
12080
12144
  y: originY = groupAttribute.y
12081
12145
  } = group.attribute,
@@ -12095,7 +12159,7 @@ let DefaultCanvasGroupRender = class {
12095
12159
  context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
12096
12160
  drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
12097
12161
  }), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
12098
- } 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));
12162
+ } 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));
12099
12163
  this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
12100
12164
  const doFillOrStroke = {
12101
12165
  doFill: doFill,
@@ -12177,6 +12241,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
12177
12241
  y: originY = imageAttribute.y,
12178
12242
  cornerRadius = imageAttribute.cornerRadius,
12179
12243
  fillStrokeOrder = imageAttribute.fillStrokeOrder,
12244
+ cornerType = imageAttribute.cornerType,
12180
12245
  image: url
12181
12246
  } = image.attribute,
12182
12247
  data = this.valid(image, imageAttribute, fillCb);
@@ -12194,7 +12259,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
12194
12259
  const res = image.resources.get(url);
12195
12260
  if ("success" !== res.state) return;
12196
12261
  let needRestore = !1;
12197
- 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);
12262
+ 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);
12198
12263
  let repeat = 0;
12199
12264
  if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
12200
12265
  const pattern = context.createPattern(res.data, repeatStr[repeat]);
@@ -13472,7 +13537,7 @@ let DefaultCanvasRichTextRender = class extends BaseRender {
13472
13537
  if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
13473
13538
  const expandX = (backgroundWidth - width) / 2,
13474
13539
  expandY = (backgroundHeight - height) / 2;
13475
- 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());
13540
+ 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());
13476
13541
  }
13477
13542
  const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
13478
13543
  res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
@@ -15854,6 +15919,20 @@ function setPoptipTheme(defaultPoptipTheme) {
15854
15919
 
15855
15920
  const _tBounds = new AABBBounds();
15856
15921
  loadPoptipComponent();
15922
+ const tlStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z';
15923
+ const blStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z';
15924
+ const trStr = 'M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z';
15925
+ const brStr = 'M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z';
15926
+ const conciseSymbolMap = {
15927
+ tl: tlStr,
15928
+ tr: trStr,
15929
+ bl: blStr,
15930
+ br: brStr,
15931
+ lt: tlStr,
15932
+ lb: blStr,
15933
+ rt: trStr,
15934
+ rb: brStr
15935
+ };
15857
15936
  class PopTip extends AbstractComponent {
15858
15937
  constructor(attributes, options) {
15859
15938
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, PopTip.defaultAttributes, attributes));
@@ -15861,13 +15940,14 @@ class PopTip extends AbstractComponent {
15861
15940
  this.positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];
15862
15941
  }
15863
15942
  render() {
15864
- var _a, _b, _c, _d, _e, _f, _g, _h;
15865
- const { titleStyle = {}, position, contentStyle = {}, panel = {}, space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0 } = this.attribute;
15943
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15944
+ 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;
15866
15945
  let { title = '', content = '' } = this.attribute;
15867
15946
  title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;
15868
15947
  content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
15869
15948
  const parsedPadding = normalizePadding(padding);
15870
15949
  const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group');
15950
+ this.group = group;
15871
15951
  const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];
15872
15952
  const titleVisible = isValid(title) && visible !== false;
15873
15953
  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' });
@@ -15894,6 +15974,8 @@ class PopTip extends AbstractComponent {
15894
15974
  if (contentVisible) {
15895
15975
  height += contentHeight;
15896
15976
  }
15977
+ this.titleShape = titleShape;
15978
+ this.contentShape = contentShape;
15897
15979
  let popTipWidth = max(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
15898
15980
  if (popTipWidth > maxWidth) {
15899
15981
  popTipWidth = maxWidth;
@@ -15902,7 +15984,15 @@ class PopTip extends AbstractComponent {
15902
15984
  popTipWidth = minWidth;
15903
15985
  }
15904
15986
  let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
15905
- const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
15987
+ const { visible: bgVisible, square } = panel, backgroundStyle = __rest(panel, ["visible", "square"]);
15988
+ if (square) {
15989
+ const maxWH = max(popTipWidth, poptipHeight);
15990
+ popTipWidth = maxWH;
15991
+ const deltaH = maxWH - poptipHeight;
15992
+ poptipHeight = maxWH;
15993
+ titleShape.setAttributes({ dy: deltaH / 2 });
15994
+ contentShape.setAttributes({ dy: deltaH / 2 });
15995
+ }
15906
15996
  const symbolSize = (_a = backgroundStyle.size) !== null && _a !== void 0 ? _a : 12;
15907
15997
  const spaceSize = isArray(symbolSize)
15908
15998
  ? [symbolSize[0] + ((_b = backgroundStyle.space) !== null && _b !== void 0 ? _b : 0), symbolSize[1] + ((_c = backgroundStyle.space) !== null && _c !== void 0 ? _c : 0)]
@@ -15938,22 +16028,62 @@ class PopTip extends AbstractComponent {
15938
16028
  let maxBBoxSize = -Infinity;
15939
16029
  for (let i = 0; i < this.positionList.length + 1; i++) {
15940
16030
  const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
15941
- const { angle, offset, rectOffset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth]);
16031
+ let symbolType = 'arrow2Left';
16032
+ let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
16033
+ let offsetY = 0;
16034
+ if (p === 'top' || p === 'bottom' || p === 'left' || p === 'right') {
16035
+ symbolType = 'arrow2Left';
16036
+ }
16037
+ else if (triangleMode === 'concise') {
16038
+ symbolType = conciseSymbolMap[p];
16039
+ offsetX = ['tl', 'bl', 'rt', 'rb'].includes(position)
16040
+ ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2
16041
+ : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;
16042
+ offsetY = ['tl', 'tr', 'lb', 'rb'].includes(position)
16043
+ ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2
16044
+ : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;
16045
+ }
16046
+ const { angle, offset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
15942
16047
  if (isBoolean(bgVisible)) {
15943
- const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
15944
- 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');
16048
+ 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');
15945
16049
  if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
15946
16050
  bgSymbol.states = state.panel;
15947
16051
  }
15948
- 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');
16052
+ let bgRect;
16053
+ if (panel.panelSymbolType) {
16054
+ 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');
16055
+ }
16056
+ else {
16057
+ 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');
16058
+ }
15949
16059
  if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
15950
16060
  bgRect.states = state.panel;
15951
16061
  }
15952
16062
  }
15953
16063
  group.setAttributes({
15954
16064
  x: -offset[0] + dx,
15955
- y: -offset[1] + dy
16065
+ y: -offset[1] + dy,
16066
+ anchor: [offsetX, offsetY]
15956
16067
  });
16068
+ if (logoSymbol) {
16069
+ const { size = 12 } = logoSymbol;
16070
+ const sizeArray = isArray(size) ? size : [size, size];
16071
+ if (sizeArray[1] === 'auto') {
16072
+ sizeArray[1] = poptipHeight;
16073
+ }
16074
+ if (sizeArray[0] === 'auto') {
16075
+ sizeArray[0] = poptipHeight;
16076
+ }
16077
+ const sizeW = sizeArray[0];
16078
+ group.createOrUpdateChild('poptip-logo', Object.assign(Object.assign({}, logoSymbol), { x: 0, y: poptipHeight / 2, visible: bgVisible && (contentVisible || titleVisible), zIndex: 10, size: sizeArray }), 'symbol');
16079
+ group.setAttributes({
16080
+ x: -offset[0] + dx + sizeW / 2,
16081
+ y: -offset[1] + dy
16082
+ });
16083
+ if (logoText) {
16084
+ 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');
16085
+ }
16086
+ }
15957
16087
  if (layout && range) {
15958
16088
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
15959
16089
  const b = _tBounds;
@@ -15975,47 +16105,85 @@ class PopTip extends AbstractComponent {
15975
16105
  }
15976
16106
  }
15977
16107
  }
15978
- getAngleAndOffset(position, width, height, size) {
15979
- const sizeH = size[1] / 2;
16108
+ getAngleAndOffset(position, width, height, size, symbolType) {
16109
+ const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];
15980
16110
  switch (position) {
15981
16111
  case 'tl':
15982
16112
  return {
15983
- angle: (pi / 2) * 3,
15984
- offset: [width / 4, height + sizeH],
15985
- rectOffset: [-width / 4, -height - size[1]]
16113
+ angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,
16114
+ offset: symbolType === 'arrow2Left' ? [width / 4, height + sizeH] : [0, height + sizeH]
15986
16115
  };
15987
16116
  case 'top':
15988
- return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH], rectOffset: [0, -height - size[1]] };
16117
+ return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH] };
15989
16118
  case 'tr':
15990
16119
  return {
15991
- angle: (pi / 2) * 3,
15992
- offset: [(width / 4) * 3, height + sizeH],
15993
- rectOffset: [(width / 4) * 3, -height - size[1]]
16120
+ angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,
16121
+ offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, height + sizeH] : [width, height + sizeH]
15994
16122
  };
15995
16123
  case 'rt':
15996
- return { angle: 0, offset: [-sizeH, height / 5], rectOffset: [(width / 4) * 3, -height - size[1]] };
16124
+ return {
16125
+ angle: 0,
16126
+ offset: symbolType === 'arrow2Left' ? [-sizeH, height / 5] : [-sizeH, 0]
16127
+ };
15997
16128
  case 'right':
15998
- return { angle: 0, offset: [-sizeH, height / 2], rectOffset: [(width / 4) * 3, -height - size[1]] };
16129
+ return { angle: 0, offset: [-sizeH, height / 2] };
15999
16130
  case 'rb':
16000
- return { angle: 0, offset: [-sizeH, (height / 5) * 4], rectOffset: [(width / 4) * 3, -height - size[1]] };
16131
+ return {
16132
+ angle: 0,
16133
+ offset: symbolType === 'arrow2Left' ? [-sizeH, (height / 5) * 4] : [-sizeH, height]
16134
+ };
16001
16135
  case 'bl':
16002
- return { angle: pi / 2, offset: [width / 4, -sizeH], rectOffset: [-width / 4, -height - size[1]] };
16136
+ return {
16137
+ angle: symbolType === 'arrow2Left' ? pi / 2 : 0,
16138
+ offset: symbolType === 'arrow2Left' ? [width / 4, -sizeH] : [0, -sizeH]
16139
+ };
16003
16140
  case 'bottom':
16004
- return { angle: pi / 2, offset: [width / 2, -sizeH], rectOffset: [0, -height - size[1]] };
16141
+ return { angle: pi / 2, offset: [width / 2, -sizeH] };
16005
16142
  case 'br':
16006
- return { angle: pi / 2, offset: [(width / 4) * 3, -sizeH], rectOffset: [(width / 4) * 3, -height - size[1]] };
16143
+ return {
16144
+ angle: symbolType === 'arrow2Left' ? pi / 2 : 0,
16145
+ offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, -sizeH] : [width, -sizeH]
16146
+ };
16007
16147
  case 'lt':
16008
- return { angle: pi, offset: [width + sizeH, height / 5], rectOffset: [-width / 4, -height - size[1]] };
16148
+ return {
16149
+ angle: symbolType === 'arrow2Left' ? pi : 0,
16150
+ offset: symbolType === 'arrow2Left' ? [width + sizeH, height / 5] : [width + sizeH, 0]
16151
+ };
16009
16152
  case 'left':
16010
- return { angle: pi, offset: [width + sizeH, height / 2], rectOffset: [0, -height - size[1]] };
16153
+ return { angle: pi, offset: [width + sizeH, height / 2] };
16011
16154
  case 'lb':
16012
16155
  return {
16013
- angle: pi,
16014
- offset: [width + sizeH, (height / 5) * 4],
16015
- rectOffset: [(width / 4) * 3, -height - size[1]]
16156
+ angle: symbolType === 'arrow2Left' ? pi : 0,
16157
+ offset: symbolType === 'arrow2Left' ? [width + sizeH, (height / 5) * 4] : [width + sizeH, height]
16016
16158
  };
16017
16159
  }
16018
16160
  }
16161
+ appearAnimate(animateConfig) {
16162
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
16163
+ this.setAttributes({ scaleX: 0, scaleY: 0 });
16164
+ this.animate().to({ scaleX: 1, scaleY: 1 }, (duration / 3) * 2, easing);
16165
+ this.titleShape &&
16166
+ this.titleShape
16167
+ .animate()
16168
+ .play(new InputText({ text: '' }, { text: this.titleShape.attribute.text }, duration, easing));
16169
+ this.contentShape &&
16170
+ this.contentShape
16171
+ .animate()
16172
+ .play(new InputText({ text: '' }, { text: this.contentShape.attribute.text }, duration, easing));
16173
+ if (animateConfig.wave) {
16174
+ const dur = duration / 6;
16175
+ this.group
16176
+ .animate()
16177
+ .to({ angle: animateConfig.wave }, dur, easing)
16178
+ .to({ angle: -animateConfig.wave }, dur * 2, easing)
16179
+ .to({ angle: animateConfig.wave }, dur * 2, easing)
16180
+ .to({ angle: 0 }, dur, easing);
16181
+ }
16182
+ }
16183
+ disappearAnimate(animateConfig) {
16184
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
16185
+ this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
16186
+ }
16019
16187
  }
16020
16188
  PopTip.defaultAttributes = {
16021
16189
  position: 'rt',
@@ -16034,6 +16202,7 @@ PopTip.defaultAttributes = {
16034
16202
  textAlign: 'left',
16035
16203
  textBaseline: 'top'
16036
16204
  },
16205
+ panel: {},
16037
16206
  maxWidthPercent: 0.8,
16038
16207
  space: 8,
16039
16208
  padding: 10
@@ -30519,6 +30688,204 @@ WeatherBox.defaultAttributes = {
30519
30688
  snowRainBottomPadding: 0
30520
30689
  };
30521
30690
 
30522
- const version = "0.21.2-vstory.1";
30691
+ class StoryLabelItem extends AbstractComponent {
30692
+ constructor(attributes, options) {
30693
+ super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, StoryLabelItem.defaultAttributes, attributes));
30694
+ }
30695
+ render() {
30696
+ const { contentOffsetX, contentOffsetY, lineStyle, symbolStartStyle, symbolEndStyle, symbolStartOuterStyle, titleTop: titleTopText, titleBottom: titleBottomText, titleTopStyle, titleBottomStyle, titleSpace, titleTopPanelStyle, titleBottomPanelStyle, theme } = this.attribute;
30697
+ const group = this.createOrUpdateChild('label-item-container', { x: 0, y: 0, zIndex: 1 }, 'group');
30698
+ const symbolStart = group.createOrUpdateChild('label-item-symbol-start', Object.assign({ x: 0, y: 0 }, symbolStartStyle), 'symbol');
30699
+ const symbolEnd = group.createOrUpdateChild('label-item-symbol-end', Object.assign({ x: contentOffsetX, y: contentOffsetY }, symbolEndStyle), 'symbol');
30700
+ const symbolStartOut = group.createOrUpdateChild('label-item-symbol-start-out', Object.assign({ x: 0, y: 0 }, symbolStartOuterStyle), 'symbol');
30701
+ const spaceW = titleSpace[0];
30702
+ const spaceH = titleSpace[1];
30703
+ const titleTopGroup = group.createOrUpdateChild('label-item-title-top-group', { x: contentOffsetX, y: contentOffsetY, clip: true }, 'group');
30704
+ 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');
30705
+ const titleTopBounds = titleTop.AABBBounds;
30706
+ if (contentOffsetX > 0) {
30707
+ titleTopGroup.setAttributes({ x: contentOffsetX - titleTopBounds.width() - spaceW * 2 });
30708
+ }
30709
+ titleTopGroup.setAttributes({
30710
+ width: titleTopBounds.width() + spaceW * 2,
30711
+ height: -titleTopBounds.height() - spaceH * 2
30712
+ });
30713
+ 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 -
30714
+ titleTopPanelStyle.padding.bottom -
30715
+ titleTopPanelStyle.padding.top, scaleCenter: [titleTopGroup.attribute.width / 2, titleTopGroup.attribute.height / 2] }), 'rect');
30716
+ this._titleTopPanel = titleTopPanel;
30717
+ const titleBottomGroup = group.createOrUpdateChild('label-item-title-bottom-group', { x: contentOffsetX, y: contentOffsetY, clip: true }, 'group');
30718
+ 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');
30719
+ const titleBottomBounds = titleBottom.AABBBounds;
30720
+ if (contentOffsetX > 0) {
30721
+ titleBottomGroup.setAttributes({ x: contentOffsetX - titleBottomBounds.width() - spaceW * 2 });
30722
+ }
30723
+ titleBottomGroup.setAttributes({
30724
+ width: titleBottomBounds.width() + spaceW * 2,
30725
+ height: titleTopBounds.height() + spaceH * 2
30726
+ });
30727
+ 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) +
30728
+ titleBottomPanelStyle.padding.top, width: titleBottomGroup.attribute.width - titleBottomPanelStyle.padding.left - titleBottomPanelStyle.padding.right, height: (titleBottomGroup.attribute.height > 0 ? 1 : -1) * titleBottomGroup.attribute.height -
30729
+ titleBottomPanelStyle.padding.bottom -
30730
+ titleBottomPanelStyle.padding.top, scaleCenter: [titleBottomGroup.attribute.width / 2, titleBottomGroup.attribute.height / 2] }), 'rect');
30731
+ this._titleBottomPanel = titleBottomPanel;
30732
+ const maxTextWidth = Math.max(titleTop.AABBBounds.width(), titleBottom.AABBBounds.width()) + spaceW * 2;
30733
+ const points = [
30734
+ { x: 0, y: 0 },
30735
+ contentOffsetX > 0
30736
+ ? { x: contentOffsetX - maxTextWidth, y: contentOffsetY }
30737
+ : { x: contentOffsetX + maxTextWidth, y: contentOffsetY },
30738
+ { x: contentOffsetX, y: contentOffsetY }
30739
+ ];
30740
+ if (theme === 'simple') {
30741
+ points.pop();
30742
+ const p = points[1];
30743
+ symbolEnd.setAttributes(p);
30744
+ }
30745
+ const line = group.createOrUpdateChild('label-item-line', Object.assign(Object.assign({ x: 0, y: 0 }, lineStyle), { points }), 'line');
30746
+ this._symbolEnd = symbolEnd;
30747
+ this._symbolStart = symbolStart;
30748
+ this._symbolStartOuter = symbolStartOut;
30749
+ this._titleTop = titleTop;
30750
+ this._titleBottom = titleBottom;
30751
+ this._line = line;
30752
+ }
30753
+ appearAnimate(animateConfig) {
30754
+ const { duration = 1000, easing = 'quadOut', symbolStartOuterType = 'scale', titleType = 'typewriter', titlePanelType = 'scale' } = animateConfig;
30755
+ const symbolTime = duration / 10;
30756
+ this._symbolStart.setAttributes({ scaleX: 0, scaleY: 0 });
30757
+ this._symbolStart.animate().to({ scaleX: 1, scaleY: 1 }, symbolTime * 5, easing);
30758
+ let symbolStartOuterFrom;
30759
+ let symbolStartOuterTo;
30760
+ if (symbolStartOuterType === 'scale') {
30761
+ symbolStartOuterFrom = { scaleX: 0, scaleY: 0 };
30762
+ symbolStartOuterTo = { scaleX: 1, scaleY: 1 };
30763
+ }
30764
+ else {
30765
+ symbolStartOuterFrom = { clipRange: 0 };
30766
+ symbolStartOuterTo = { clipRange: 1 };
30767
+ }
30768
+ this._symbolStartOuter.setAttributes(symbolStartOuterFrom);
30769
+ this._symbolStartOuter.animate().to(symbolStartOuterTo, symbolTime * 5, easing);
30770
+ this._symbolEnd.setAttributes({ scaleX: 0, scaleY: 0 });
30771
+ this._symbolEnd
30772
+ .animate()
30773
+ .wait(symbolTime * 8)
30774
+ .to({ scaleX: 1, scaleY: 1 }, symbolTime * 2, easing);
30775
+ this._line.setAttributes({ clipRange: 0 });
30776
+ this._line.animate().to({ clipRange: 1 }, symbolTime * 9, easing);
30777
+ if (titleType === 'typewriter') {
30778
+ const titleTopText = this._titleTop.attribute.text;
30779
+ this._titleTop.setAttributes({ text: '' });
30780
+ this._titleTop
30781
+ .animate()
30782
+ .wait(symbolTime * 5)
30783
+ .play(new InputText({ text: '' }, { text: titleTopText }, symbolTime * 4, 'linear'));
30784
+ const titleBottomText = this._titleBottom.attribute.text;
30785
+ this._titleBottom.setAttributes({ text: '' });
30786
+ this._titleBottom
30787
+ .animate()
30788
+ .wait(symbolTime * 5)
30789
+ .play(new InputText({ text: '' }, { text: titleBottomText }, symbolTime * 4, 'linear'));
30790
+ }
30791
+ else {
30792
+ this._titleTop.setAttributes({ dy: this._titleTop.AABBBounds.height() + 10 });
30793
+ this._titleTop
30794
+ .animate()
30795
+ .wait(symbolTime * 5)
30796
+ .to({ dy: 0 }, symbolTime * 4, 'linear');
30797
+ this._titleBottom.setAttributes({ dy: -(10 + this._titleBottom.AABBBounds.height()) });
30798
+ this._titleBottom
30799
+ .animate()
30800
+ .wait(symbolTime * 5)
30801
+ .to({ dy: 0 }, symbolTime * 4, 'linear');
30802
+ }
30803
+ if (titlePanelType === 'scale') {
30804
+ [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {
30805
+ const scaleX = panel.attribute.scaleX;
30806
+ panel.setAttributes({ scaleX: 0 });
30807
+ panel.animate().to({ scaleX }, duration, 'circInOut');
30808
+ });
30809
+ }
30810
+ else if (titlePanelType === 'stroke') {
30811
+ [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {
30812
+ const b = panel.AABBBounds;
30813
+ const totalLen = (b.width() + b.height()) * 2;
30814
+ panel.setAttributes({ lineDash: [0, totalLen * 10] });
30815
+ panel.animate().to({ lineDash: [totalLen, totalLen * 10] }, duration, 'quadOut');
30816
+ });
30817
+ }
30818
+ }
30819
+ disappearAnimate(animateConfig) {
30820
+ if (animateConfig.mode === 'scale') {
30821
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
30822
+ this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
30823
+ }
30824
+ else {
30825
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
30826
+ this._line.animate().to({ clipRange: 0 }, duration, easing);
30827
+ this._symbolStart
30828
+ .animate()
30829
+ .wait(duration / 2)
30830
+ .to({ scaleX: 0, scaleY: 0 }, duration / 2, easing);
30831
+ this._symbolEnd.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
30832
+ this._titleTop.animate().to({ dy: this._titleTop.AABBBounds.height() + 10 }, duration / 2, easing);
30833
+ this._titleBottom
30834
+ .animate()
30835
+ .to({ dy: -(10 + this._titleBottom.AABBBounds.height()) }, duration / 2, easing);
30836
+ this._symbolStartOuter
30837
+ .animate()
30838
+ .wait(duration / 2)
30839
+ .to({ clipRange: 0 }, duration / 2, easing);
30840
+ this._titleTopPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');
30841
+ this._titleBottomPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');
30842
+ }
30843
+ }
30844
+ }
30845
+ StoryLabelItem.defaultAttributes = {
30846
+ contentOffsetX: 100,
30847
+ contentOffsetY: -60,
30848
+ titleTopStyle: {
30849
+ fontSize: 12,
30850
+ fill: 'white'
30851
+ },
30852
+ titleBottomStyle: {
30853
+ fontSize: 12,
30854
+ fill: 'white'
30855
+ },
30856
+ lineStyle: {
30857
+ stroke: 'white',
30858
+ lineWidth: 1
30859
+ },
30860
+ symbolStartStyle: {
30861
+ symbolType: 'circle',
30862
+ size: 3,
30863
+ fill: 'white'
30864
+ },
30865
+ symbolEndStyle: {
30866
+ symbolType: 'circle',
30867
+ size: 3,
30868
+ fill: 'white'
30869
+ },
30870
+ symbolStartOuterStyle: {
30871
+ symbolType: 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0',
30872
+ size: 8,
30873
+ stroke: 'white'
30874
+ },
30875
+ titleSpace: [2, 2],
30876
+ titleTopPanelStyle: {
30877
+ visible: false,
30878
+ padding: { left: 0, right: 0, bottom: 2, top: 2 },
30879
+ cornerRadius: 3
30880
+ },
30881
+ titleBottomPanelStyle: {
30882
+ visible: false,
30883
+ padding: { left: 0, right: 0, bottom: 2, top: 2 },
30884
+ cornerRadius: 3
30885
+ },
30886
+ theme: 'default'
30887
+ };
30888
+
30889
+ const version = "0.21.2-vstory.2";
30523
30890
 
30524
- 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 };
30891
+ 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 };