@visactor/vrender-components 0.16.14-alpha.2 → 0.16.14-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5348,6 +5348,137 @@
5348
5348
  return containPath(commands, lineWidth, !0, x, y);
5349
5349
  }
5350
5350
 
5351
+ var Edge;
5352
+ !function (Edge) {
5353
+ Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
5354
+ }(Edge || (Edge = {}));
5355
+ var _strokeVec4 = [!1, !1, !1, !1];
5356
+ var parseStroke = function parseStroke(stroke) {
5357
+ var _a;
5358
+ var isFullStroke = !0;
5359
+ if (vutils.isBoolean(stroke, !0)) {
5360
+ for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
5361
+ isFullStroke = stroke;
5362
+ } else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
5363
+ return {
5364
+ isFullStroke: isFullStroke,
5365
+ stroke: _strokeVec4
5366
+ };
5367
+ };
5368
+ var _paddingVec4 = [0, 0, 0, 0];
5369
+ var parsePadding = function parsePadding(padding) {
5370
+ return padding ? vutils.isArray(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
5371
+ };
5372
+ var _coords = [{
5373
+ x: 0,
5374
+ y: 0
5375
+ }, {
5376
+ x: 0,
5377
+ y: 0
5378
+ }, {
5379
+ x: 0,
5380
+ y: 0
5381
+ }, {
5382
+ x: 0,
5383
+ y: 0
5384
+ }],
5385
+ indexList = [1, 2, 3, 0, 1, 2, 3, 0];
5386
+ function circleBounds(startAngle, endAngle, radius, bounds) {
5387
+ for (; startAngle >= vutils.pi2;) startAngle -= vutils.pi2;
5388
+ for (; startAngle < 0;) startAngle += vutils.pi2;
5389
+ for (; startAngle > endAngle;) endAngle += vutils.pi2;
5390
+ _coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
5391
+ var startIdx = Math.ceil(startAngle / vutils.halfPi) % 4,
5392
+ endIdx = Math.ceil(endAngle / vutils.halfPi) % 4;
5393
+ if (bounds.add(vutils.cos(startAngle) * radius, vutils.sin(startAngle) * radius), bounds.add(vutils.cos(endAngle) * radius, vutils.sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > vutils.pi) {
5394
+ var match = !1;
5395
+ for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
5396
+ if (match && endIdx === indexList[i]) break;
5397
+ if (match) {
5398
+ var p = _coords[indexList[i]];
5399
+ bounds.add(p.x, p.y);
5400
+ }
5401
+ } else {
5402
+ match = !0;
5403
+ var _p = _coords[startIdx];
5404
+ bounds.add(_p.x, _p.y);
5405
+ }
5406
+ }
5407
+ }
5408
+ function pointInterpolation(pointA, pointB, ratio) {
5409
+ var _pointAt = vutils.pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
5410
+ x = _pointAt.x,
5411
+ y = _pointAt.y,
5412
+ _pointAt2 = vutils.pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
5413
+ x1 = _pointAt2.x,
5414
+ y1 = _pointAt2.y,
5415
+ point = new vutils.Point(x, y, x1, y1);
5416
+ return point.defined = pointB.defined, point;
5417
+ }
5418
+ function pointsInterpolation(pointsA, pointsB, ratio) {
5419
+ if (!pointsA || !pointsB) return [];
5420
+ Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
5421
+ var points = [];
5422
+ if (pointsA.length > pointsB.length) {
5423
+ points = pointsB.map(function (point) {
5424
+ var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
5425
+ return p.defined = point.defined, p;
5426
+ });
5427
+ for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
5428
+ } else {
5429
+ points = pointsB.map(function (point) {
5430
+ var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
5431
+ return p.defined = point.defined, p;
5432
+ });
5433
+ for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
5434
+ }
5435
+ return points;
5436
+ }
5437
+ function getAttributeFromDefaultAttrList(attr, key) {
5438
+ if (vutils.isArray(attr)) {
5439
+ var val;
5440
+ for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
5441
+ return val;
5442
+ }
5443
+ return attr[key];
5444
+ }
5445
+ var RafBasedSTO = /*#__PURE__*/function () {
5446
+ function RafBasedSTO() {
5447
+ _classCallCheck(this, RafBasedSTO);
5448
+ this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
5449
+ }
5450
+ _createClass(RafBasedSTO, [{
5451
+ key: "call",
5452
+ value: function call(cb) {
5453
+ var _this = this;
5454
+ return this.lastDate = Date.now(), setTimeout(function () {
5455
+ _this.appendDuration(Date.now() - _this.lastDate), cb(0);
5456
+ }, this.timeout, !0);
5457
+ }
5458
+ }, {
5459
+ key: "clear",
5460
+ value: function clear(h) {
5461
+ clearTimeout(h);
5462
+ }
5463
+ }, {
5464
+ key: "appendDuration",
5465
+ value: function appendDuration(d) {
5466
+ this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
5467
+ return a + b;
5468
+ }, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
5469
+ }
5470
+ }]);
5471
+ return RafBasedSTO;
5472
+ }();
5473
+ RafBasedSTO.TimeOut = 1e3 / 60;
5474
+ new RafBasedSTO();
5475
+ var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
5476
+ if (vutils.isString(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
5477
+ return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
5478
+ }
5479
+ return lineHeight;
5480
+ };
5481
+
5351
5482
  var __decorate$U = undefined && undefined.__decorate || function (decorators, target, key, desc) {
5352
5483
  var d,
5353
5484
  c = arguments.length,
@@ -5424,7 +5555,9 @@
5424
5555
  },
5425
5556
  getTextBounds: void 0,
5426
5557
  specialCharSet: "-/: .,@%'\"~" + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
5427
- }, null != option ? option : {}), textSpec);
5558
+ }, null != option ? option : {}), Object.assign(Object.assign({}, textSpec), {
5559
+ lineHeight: calculateLineHeight(null == textSpec ? void 0 : textSpec.lineHeight, null == textSpec ? void 0 : textSpec.fontSize)
5560
+ }));
5428
5561
  }
5429
5562
  }]);
5430
5563
  return DefaultGraphicUtil;
@@ -7339,131 +7472,6 @@
7339
7472
  easing: "cubicOut"
7340
7473
  };
7341
7474
 
7342
- var Edge;
7343
- !function (Edge) {
7344
- Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
7345
- }(Edge || (Edge = {}));
7346
- var _strokeVec4 = [!1, !1, !1, !1];
7347
- var parseStroke = function parseStroke(stroke) {
7348
- var _a;
7349
- var isFullStroke = !0;
7350
- if (vutils.isBoolean(stroke, !0)) {
7351
- for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
7352
- isFullStroke = stroke;
7353
- } else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
7354
- return {
7355
- isFullStroke: isFullStroke,
7356
- stroke: _strokeVec4
7357
- };
7358
- };
7359
- var _paddingVec4 = [0, 0, 0, 0];
7360
- var parsePadding = function parsePadding(padding) {
7361
- return padding ? vutils.isArray(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
7362
- };
7363
- var _coords = [{
7364
- x: 0,
7365
- y: 0
7366
- }, {
7367
- x: 0,
7368
- y: 0
7369
- }, {
7370
- x: 0,
7371
- y: 0
7372
- }, {
7373
- x: 0,
7374
- y: 0
7375
- }],
7376
- indexList = [1, 2, 3, 0, 1, 2, 3, 0];
7377
- function circleBounds(startAngle, endAngle, radius, bounds) {
7378
- for (; startAngle >= vutils.pi2;) startAngle -= vutils.pi2;
7379
- for (; startAngle < 0;) startAngle += vutils.pi2;
7380
- for (; startAngle > endAngle;) endAngle += vutils.pi2;
7381
- _coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
7382
- var startIdx = Math.ceil(startAngle / vutils.halfPi) % 4,
7383
- endIdx = Math.ceil(endAngle / vutils.halfPi) % 4;
7384
- if (bounds.add(vutils.cos(startAngle) * radius, vutils.sin(startAngle) * radius), bounds.add(vutils.cos(endAngle) * radius, vutils.sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > vutils.pi) {
7385
- var match = !1;
7386
- for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
7387
- if (match && endIdx === indexList[i]) break;
7388
- if (match) {
7389
- var p = _coords[indexList[i]];
7390
- bounds.add(p.x, p.y);
7391
- }
7392
- } else {
7393
- match = !0;
7394
- var _p = _coords[startIdx];
7395
- bounds.add(_p.x, _p.y);
7396
- }
7397
- }
7398
- }
7399
- function pointInterpolation(pointA, pointB, ratio) {
7400
- var _pointAt = vutils.pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
7401
- x = _pointAt.x,
7402
- y = _pointAt.y,
7403
- _pointAt2 = vutils.pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
7404
- x1 = _pointAt2.x,
7405
- y1 = _pointAt2.y,
7406
- point = new vutils.Point(x, y, x1, y1);
7407
- return point.defined = pointB.defined, point;
7408
- }
7409
- function pointsInterpolation(pointsA, pointsB, ratio) {
7410
- if (!pointsA || !pointsB) return [];
7411
- Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
7412
- var points = [];
7413
- if (pointsA.length > pointsB.length) {
7414
- points = pointsB.map(function (point) {
7415
- var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
7416
- return p.defined = point.defined, p;
7417
- });
7418
- for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
7419
- } else {
7420
- points = pointsB.map(function (point) {
7421
- var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
7422
- return p.defined = point.defined, p;
7423
- });
7424
- for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
7425
- }
7426
- return points;
7427
- }
7428
- function getAttributeFromDefaultAttrList(attr, key) {
7429
- if (vutils.isArray(attr)) {
7430
- var val;
7431
- for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
7432
- return val;
7433
- }
7434
- return attr[key];
7435
- }
7436
- var RafBasedSTO = /*#__PURE__*/function () {
7437
- function RafBasedSTO() {
7438
- _classCallCheck(this, RafBasedSTO);
7439
- this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
7440
- }
7441
- _createClass(RafBasedSTO, [{
7442
- key: "call",
7443
- value: function call(cb) {
7444
- var _this = this;
7445
- return this.lastDate = Date.now(), setTimeout(function () {
7446
- _this.appendDuration(Date.now() - _this.lastDate), cb(0);
7447
- }, this.timeout, !0);
7448
- }
7449
- }, {
7450
- key: "clear",
7451
- value: function clear(h) {
7452
- clearTimeout(h);
7453
- }
7454
- }, {
7455
- key: "appendDuration",
7456
- value: function appendDuration(d) {
7457
- this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
7458
- return a + b;
7459
- }, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
7460
- }
7461
- }]);
7462
- return RafBasedSTO;
7463
- }();
7464
- RafBasedSTO.TimeOut = 1e3 / 60;
7465
- new RafBasedSTO();
7466
-
7467
7475
  var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
7468
7476
  _inherits(IncreaseCount, _ACustomAnimate);
7469
7477
  var _super = _createSuper(IncreaseCount);
@@ -8580,8 +8588,7 @@
8580
8588
  }, {
8581
8589
  key: "addChild",
8582
8590
  value: function addChild(node) {
8583
- var _this$child$push2;
8584
- "__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push((_this$child$push2 = {}, _defineProperty(_this$child$push2, node.tagname, node.child), _defineProperty(_this$child$push2, ":@", node[":@"]), _this$child$push2)) : this.child.push(_defineProperty({}, node.tagname, node.child));
8591
+ "__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push(_defineProperty(_defineProperty({}, node.tagname, node.child), ":@", node[":@"])) : this.child.push(_defineProperty({}, node.tagname, node.child));
8585
8592
  }
8586
8593
  }]);
8587
8594
  return XmlNode;
@@ -10044,7 +10051,7 @@
10044
10051
  }, {
10045
10052
  key: "updateWrapAABBBounds",
10046
10053
  value: function updateWrapAABBBounds(text) {
10047
- var _a, _b, _c;
10054
+ var _a, _b, _c, _d;
10048
10055
  var textTheme = getTheme(this).text,
10049
10056
  _this$attribute = this.attribute,
10050
10057
  _this$attribute$fontF = _this$attribute.fontFamily,
@@ -10055,8 +10062,6 @@
10055
10062
  textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
10056
10063
  _this$attribute$fontS = _this$attribute.fontSize,
10057
10064
  fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
10058
- _this$attribute$lineH = _this$attribute.lineHeight,
10059
- lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
10060
10065
  _this$attribute$ellip = _this$attribute.ellipsis,
10061
10066
  ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
10062
10067
  maxLineWidth = _this$attribute.maxLineWidth,
@@ -10073,8 +10078,9 @@
10073
10078
  _this$attribute$heigh = _this$attribute.heightLimit,
10074
10079
  heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
10075
10080
  lineClamp = _this$attribute.lineClamp,
10081
+ lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
10076
10082
  buf = ignoreBuf ? 0 : 2;
10077
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
10083
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
10078
10084
  var _bbox = this.cache.layoutData.bbox;
10079
10085
  return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
10080
10086
  }
@@ -10106,7 +10112,7 @@
10106
10112
  if ("" !== str && "" === clip.str) {
10107
10113
  if (ellipsis) {
10108
10114
  var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
10109
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
10115
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
10110
10116
  } else clip.str = "", clip.width = 0;
10111
10117
  needCut = !1;
10112
10118
  }
@@ -10203,8 +10209,8 @@
10203
10209
  whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace;
10204
10210
  if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
10205
10211
  var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
10206
- _attribute$lineHeight = attribute.lineHeight,
10207
- lineHeight = _attribute$lineHeight === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight;
10212
+ textFontSize = attribute.fontSize || textTheme.fontSize,
10213
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
10208
10214
  if (!this.shouldUpdateShape() && this.cache) {
10209
10215
  width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
10210
10216
  var _dx = textDrawOffsetX(textAlign, width),
@@ -10274,12 +10280,11 @@
10274
10280
  fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
10275
10281
  _attribute$stroke2 = attribute.stroke,
10276
10282
  stroke = _attribute$stroke2 === void 0 ? textTheme.stroke : _attribute$stroke2,
10277
- _attribute$lineHeight2 = attribute.lineHeight,
10278
- lineHeight = _attribute$lineHeight2 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight2,
10279
10283
  _attribute$lineWidth2 = attribute.lineWidth,
10280
10284
  lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
10281
10285
  _attribute$verticalMo = attribute.verticalMode,
10282
- verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo;
10286
+ verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo,
10287
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
10283
10288
  var _attribute$textAlign2 = attribute.textAlign,
10284
10289
  textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
10285
10290
  _attribute$textBaseli2 = attribute.textBaseline,
@@ -10329,7 +10334,7 @@
10329
10334
  }, {
10330
10335
  key: "updateHorizontalMultilineAABBBounds",
10331
10336
  value: function updateHorizontalMultilineAABBBounds(text) {
10332
- var _a;
10337
+ var _a, _b;
10333
10338
  var textTheme = getTheme(this).text,
10334
10339
  attribute = this.attribute,
10335
10340
  _attribute$fontFamily3 = attribute.fontFamily,
@@ -10342,8 +10347,6 @@
10342
10347
  fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
10343
10348
  _attribute$fontWeight3 = attribute.fontWeight,
10344
10349
  fontWeight = _attribute$fontWeight3 === void 0 ? textTheme.fontWeight : _attribute$fontWeight3,
10345
- _attribute$lineHeight3 = attribute.lineHeight,
10346
- lineHeight = _attribute$lineHeight3 === void 0 ? attribute.lineHeight || attribute.fontSize || textTheme.fontSize : _attribute$lineHeight3,
10347
10350
  _attribute$ellipsis3 = attribute.ellipsis,
10348
10351
  ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
10349
10352
  maxLineWidth = attribute.maxLineWidth,
@@ -10352,9 +10355,10 @@
10352
10355
  _attribute$lineWidth3 = attribute.lineWidth,
10353
10356
  lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
10354
10357
  _attribute$whiteSpace2 = attribute.whiteSpace,
10355
- whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2;
10358
+ whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2,
10359
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
10356
10360
  if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
10357
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
10361
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
10358
10362
  var _bbox2 = this.cache.layoutData.bbox;
10359
10363
  return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
10360
10364
  }
@@ -10390,12 +10394,11 @@
10390
10394
  fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
10391
10395
  _attribute$stroke4 = attribute.stroke,
10392
10396
  stroke = _attribute$stroke4 === void 0 ? textTheme.stroke : _attribute$stroke4,
10393
- _attribute$lineHeight4 = attribute.lineHeight,
10394
- lineHeight = _attribute$lineHeight4 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight4,
10395
10397
  _attribute$lineWidth4 = attribute.lineWidth,
10396
10398
  lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
10397
10399
  _attribute$verticalMo2 = attribute.verticalMode,
10398
- verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2;
10400
+ verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2,
10401
+ lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
10399
10402
  var _attribute$textAlign4 = attribute.textAlign,
10400
10403
  textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
10401
10404
  _attribute$textBaseli4 = attribute.textBaseline,
@@ -10528,7 +10531,7 @@
10528
10531
  }, {
10529
10532
  key: "updateMultilineAABBBounds",
10530
10533
  value: function updateMultilineAABBBounds(text) {
10531
- var _a, _b, _c;
10534
+ var _a, _b, _c, _d;
10532
10535
  var textTheme = getTheme(this).text,
10533
10536
  _this$attribute = this.attribute,
10534
10537
  _this$attribute$fontF = _this$attribute.fontFamily,
@@ -10539,8 +10542,6 @@
10539
10542
  textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
10540
10543
  _this$attribute$fontS = _this$attribute.fontSize,
10541
10544
  fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
10542
- _this$attribute$lineH = _this$attribute.lineHeight,
10543
- lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
10544
10545
  _this$attribute$ellip = _this$attribute.ellipsis,
10545
10546
  ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
10546
10547
  maxLineWidth = _this$attribute.maxLineWidth,
@@ -10557,8 +10558,9 @@
10557
10558
  _this$attribute$heigh = _this$attribute.heightLimit,
10558
10559
  heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
10559
10560
  lineClamp = _this$attribute.lineClamp,
10561
+ lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
10560
10562
  buf = ignoreBuf ? 0 : 2;
10561
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
10563
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
10562
10564
  var _bbox = this.cache.layoutData.bbox;
10563
10565
  return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
10564
10566
  }
@@ -10590,7 +10592,7 @@
10590
10592
  if ("" !== str && "" === clip.str) {
10591
10593
  if (ellipsis) {
10592
10594
  var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
10593
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
10595
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
10594
10596
  } else clip.str = "", clip.width = 0;
10595
10597
  needCut = !1;
10596
10598
  }
@@ -15461,7 +15463,7 @@
15461
15463
  var t = textAlign;
15462
15464
  textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
15463
15465
  }
15464
- var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
15466
+ var lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
15465
15467
  data = this.valid(text, textAttribute, fillCb, strokeCb);
15466
15468
  if (!data) return;
15467
15469
  var fVisible = data.fVisible,
@@ -20945,7 +20947,7 @@
20945
20947
  return new vutils.TextMeasure(Object.assign({ defaultFontParams: {
20946
20948
  fontFamily: DEFAULT_TEXT_FONT_FAMILY,
20947
20949
  fontSize: DEFAULT_TEXT_FONT_SIZE
20948
- }, getTextBounds: useNaiveCanvas ? undefined : getTextBounds, specialCharSet: '-/: .,@%\'"~' + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), textSpec);
20950
+ }, getTextBounds: useNaiveCanvas ? undefined : getTextBounds, specialCharSet: '-/: .,@%\'"~' + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), Object.assign(Object.assign({}, textSpec), { lineHeight: calculateLineHeight(textSpec === null || textSpec === void 0 ? void 0 : textSpec.lineHeight, textSpec === null || textSpec === void 0 ? void 0 : textSpec.fontSize) }));
20949
20951
  };
20950
20952
  function measureTextSize(text, textSpec) {
20951
20953
  var _a;
@@ -25956,6 +25958,13 @@
25956
25958
  }
25957
25959
  vutils.mixin(CircleAxisGrid, CircleAxisMixin);
25958
25960
 
25961
+ var DataZoomActiveTag;
25962
+ (function (DataZoomActiveTag) {
25963
+ DataZoomActiveTag["startHandler"] = "startHandler";
25964
+ DataZoomActiveTag["endHandler"] = "endHandler";
25965
+ DataZoomActiveTag["middleHandler"] = "middleHandler";
25966
+ DataZoomActiveTag["background"] = "background";
25967
+ })(DataZoomActiveTag || (DataZoomActiveTag = {}));
25959
25968
  const DEFAULT_DATA_ZOOM_ATTRIBUTES = {
25960
25969
  orient: 'bottom',
25961
25970
  showDetail: 'auto',
@@ -26054,14 +26063,6 @@
26054
26063
  }
26055
26064
  };
26056
26065
 
26057
- exports.DataZoomActiveTag = void 0;
26058
- (function (DataZoomActiveTag) {
26059
- DataZoomActiveTag["startHandler"] = "startHandler";
26060
- DataZoomActiveTag["endHandler"] = "endHandler";
26061
- DataZoomActiveTag["middleHandler"] = "middleHandler";
26062
- DataZoomActiveTag["background"] = "background";
26063
- })(exports.DataZoomActiveTag || (exports.DataZoomActiveTag = {}));
26064
-
26065
26066
  const delayMap$1 = {
26066
26067
  debounce: vutils.debounce,
26067
26068
  throttle: vutils.throttle
@@ -26089,23 +26090,23 @@
26089
26090
  this._onHandlerPointerDown = (e, tag) => {
26090
26091
  e.stopPropagation();
26091
26092
  if (tag === 'start') {
26092
- this._activeTag = exports.DataZoomActiveTag.startHandler;
26093
+ this._activeTag = DataZoomActiveTag.startHandler;
26093
26094
  this._activeItem = this._startHandler;
26094
26095
  }
26095
26096
  else if (tag === 'end') {
26096
- this._activeTag = exports.DataZoomActiveTag.endHandler;
26097
+ this._activeTag = DataZoomActiveTag.endHandler;
26097
26098
  this._activeItem = this._endHandler;
26098
26099
  }
26099
26100
  else if (tag === 'middleRect') {
26100
- this._activeTag = exports.DataZoomActiveTag.middleHandler;
26101
+ this._activeTag = DataZoomActiveTag.middleHandler;
26101
26102
  this._activeItem = this._middleHandlerRect;
26102
26103
  }
26103
26104
  else if (tag === 'middleSymbol') {
26104
- this._activeTag = exports.DataZoomActiveTag.middleHandler;
26105
+ this._activeTag = DataZoomActiveTag.middleHandler;
26105
26106
  this._activeItem = this._middleHandlerSymbol;
26106
26107
  }
26107
26108
  else if (tag === 'background') {
26108
- this._activeTag = exports.DataZoomActiveTag.background;
26109
+ this._activeTag = DataZoomActiveTag.background;
26109
26110
  this._activeItem = this._background;
26110
26111
  }
26111
26112
  this._activeState = true;
@@ -26113,7 +26114,6 @@
26113
26114
  this._activeCache.lastPos = this.eventPosToStagePos(e);
26114
26115
  };
26115
26116
  this._onHandlerPointerMove = (e) => {
26116
- var _a;
26117
26117
  e.stopPropagation();
26118
26118
  const { start: startAttr, end: endAttr, brushSelect, realTime = true } = this.attribute;
26119
26119
  const pos = this.eventPosToStagePos(e);
@@ -26121,24 +26121,24 @@
26121
26121
  const dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / max;
26122
26122
  let { start, end } = this.state;
26123
26123
  if (this._activeState) {
26124
- if (this._activeTag === exports.DataZoomActiveTag.middleHandler) {
26124
+ if (this._activeTag === DataZoomActiveTag.middleHandler) {
26125
26125
  this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis);
26126
26126
  }
26127
- else if (this._activeTag === exports.DataZoomActiveTag.startHandler) {
26127
+ else if (this._activeTag === DataZoomActiveTag.startHandler) {
26128
26128
  if (start + dis > end) {
26129
26129
  start = end;
26130
26130
  end = start + dis;
26131
- this._activeTag = exports.DataZoomActiveTag.endHandler;
26131
+ this._activeTag = DataZoomActiveTag.endHandler;
26132
26132
  }
26133
26133
  else {
26134
26134
  start = start + dis;
26135
26135
  }
26136
26136
  }
26137
- else if (this._activeTag === exports.DataZoomActiveTag.endHandler) {
26137
+ else if (this._activeTag === DataZoomActiveTag.endHandler) {
26138
26138
  if (end + dis < start) {
26139
26139
  end = start;
26140
26140
  start = end + dis;
26141
- this._activeTag = exports.DataZoomActiveTag.startHandler;
26141
+ this._activeTag = DataZoomActiveTag.startHandler;
26142
26142
  }
26143
26143
  else {
26144
26144
  end = end + dis;
@@ -26151,7 +26151,7 @@
26151
26151
  end = Math.min(Math.max(end, 0), 1);
26152
26152
  if (startAttr !== start || endAttr !== end) {
26153
26153
  this.setStateAttr(start, end, true);
26154
- realTime && ((_a = this._updateStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, start, end, this._activeTag));
26154
+ realTime && this._updateStateCallback && this._updateStateCallback(start, end);
26155
26155
  this._dispatchChangeEvent(start, end);
26156
26156
  }
26157
26157
  };
@@ -26256,11 +26256,10 @@
26256
26256
  };
26257
26257
  }
26258
26258
  _onHandlerPointerUp(e) {
26259
- var _a;
26260
26259
  e.preventDefault();
26261
26260
  const { start, end, brushSelect, realTime = true } = this.attribute;
26262
26261
  if (this._activeState) {
26263
- if (this._activeTag === exports.DataZoomActiveTag.background) {
26262
+ if (this._activeTag === DataZoomActiveTag.background) {
26264
26263
  const pos = this.eventPosToStagePos(e);
26265
26264
  this.backgroundDragZoom(this._activeCache.startPos, pos);
26266
26265
  }
@@ -26269,7 +26268,7 @@
26269
26268
  brushSelect && this.renderDragMask();
26270
26269
  if (!realTime || start !== this.state.start || end !== this.state.end) {
26271
26270
  this.setStateAttr(this.state.start, this.state.end, true);
26272
- (_a = this._updateStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, this.state.start, this.state.end, this._activeTag);
26271
+ this._updateStateCallback && this._updateStateCallback(this.state.start, this.state.end);
26273
26272
  this._dispatchChangeEvent(this.state.start, this.state.end);
26274
26273
  }
26275
26274
  }
@@ -26319,11 +26318,11 @@
26319
26318
  const { dragMaskStyle } = this.attribute;
26320
26319
  const { position, width, height } = this.getLayoutAttrFromConfig();
26321
26320
  if (this._isHorizontal) {
26322
- this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.x : this._activeCache.startPos.x, position.x, position.x + width), y: position.y, width: (this._activeState && this._activeTag === exports.DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
26321
+ this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.x : this._activeCache.startPos.x, position.x, position.x + width), y: position.y, width: (this._activeState && this._activeTag === DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
26323
26322
  0, height }, dragMaskStyle), 'rect');
26324
26323
  }
26325
26324
  else {
26326
- this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.y : this._activeCache.startPos.y, position.y, position.y + height), width, height: (this._activeState && this._activeTag === exports.DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
26325
+ this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.y : this._activeCache.startPos.y, position.y, position.y + height), width, height: (this._activeState && this._activeTag === DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
26327
26326
  0 }, dragMaskStyle), 'rect');
26328
26327
  }
26329
26328
  }
@@ -26642,14 +26641,13 @@
26642
26641
  this.dispatchEvent(changeEvent);
26643
26642
  }
26644
26643
  setStartAndEnd(start, end) {
26645
- var _a;
26646
26644
  const { start: startAttr, end: endAttr } = this.attribute;
26647
26645
  if (vutils.isValid(start) && vutils.isValid(end) && (start !== this.state.start || end !== this.state.end)) {
26648
26646
  this.state.start = start;
26649
26647
  this.state.end = end;
26650
26648
  if (startAttr !== this.state.start || endAttr !== this.state.end) {
26651
26649
  this.setStateAttr(start, end, true);
26652
- (_a = this._updateStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, start, end, this._activeTag);
26650
+ this._updateStateCallback && this._updateStateCallback(start, end);
26653
26651
  this._dispatchChangeEvent(start, end);
26654
26652
  }
26655
26653
  }
@@ -31027,7 +31025,9 @@
31027
31025
  let x = 0;
31028
31026
  if (isVisible(itemAttr.shape)) {
31029
31027
  itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, Object.assign({ visible: true, x: itemAttr.shape.size / 2, y: itemAttr.shape.size / 2 +
31030
- (((_a = itemAttr.key.lineHeight) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) - itemAttr.shape.size) / 2 }, itemAttr.shape), 'symbol');
31028
+ (((_a = calculateLineHeight(itemAttr.key.lineHeight, itemAttr.key.fontSize)) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) -
31029
+ itemAttr.shape.size) /
31030
+ 2 }, itemAttr.shape), 'symbol');
31031
31031
  }
31032
31032
  if (hasContentShape) {
31033
31033
  x += itemAttr.shape.size + itemAttr.shape.spacing;
@@ -31408,7 +31408,7 @@
31408
31408
  }
31409
31409
  };
31410
31410
 
31411
- const version = "0.16.14-alpha.2";
31411
+ const version = "0.16.14-alpha.3";
31412
31412
 
31413
31413
  exports.AbstractComponent = AbstractComponent;
31414
31414
  exports.ArcInfo = ArcInfo;