@visactor/vrender-components 0.16.14-alpha.6 → 0.16.14-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/base.js +2 -2
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.d.ts +1 -1
- package/cjs/label/type.js.map +1 -1
- package/cjs/tooltip/tooltip.js +1 -1
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/dist/index.js +166 -34
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/base.js +2 -2
- package/es/label/base.js.map +1 -1
- package/es/label/type.d.ts +1 -1
- package/es/label/type.js.map +1 -1
- package/es/tooltip/tooltip.js +2 -2
- package/es/tooltip/tooltip.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4470,7 +4470,10 @@
|
|
|
4470
4470
|
direction: "horizontal",
|
|
4471
4471
|
wordBreak: "break-all",
|
|
4472
4472
|
ignoreBuf: !1,
|
|
4473
|
-
verticalMode: 0
|
|
4473
|
+
verticalMode: 0,
|
|
4474
|
+
whiteSpace: "no-wrap",
|
|
4475
|
+
heightLimit: 1 / 0,
|
|
4476
|
+
lineClamp: 1 / 0
|
|
4474
4477
|
};
|
|
4475
4478
|
var DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
4476
4479
|
opacity: 1,
|
|
@@ -7460,6 +7463,12 @@
|
|
|
7460
7463
|
}();
|
|
7461
7464
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7462
7465
|
new RafBasedSTO();
|
|
7466
|
+
var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
|
|
7467
|
+
if (vutils.isString(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
7468
|
+
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
7469
|
+
}
|
|
7470
|
+
return lineHeight;
|
|
7471
|
+
};
|
|
7463
7472
|
|
|
7464
7473
|
var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
|
|
7465
7474
|
_inherits(IncreaseCount, _ACustomAnimate);
|
|
@@ -9963,7 +9972,7 @@
|
|
|
9963
9972
|
return CanvasTextLayout;
|
|
9964
9973
|
}();
|
|
9965
9974
|
|
|
9966
|
-
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
9975
|
+
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
9967
9976
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
9968
9977
|
_inherits(Text, _Graphic);
|
|
9969
9978
|
var _super = _createSuper(Text);
|
|
@@ -10037,6 +10046,117 @@
|
|
|
10037
10046
|
paddingArray = parsePadding(boundsPadding);
|
|
10038
10047
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
10039
10048
|
}
|
|
10049
|
+
}, {
|
|
10050
|
+
key: "updateWrapAABBBounds",
|
|
10051
|
+
value: function updateWrapAABBBounds(text) {
|
|
10052
|
+
var _a, _b, _c, _d;
|
|
10053
|
+
var textTheme = getTheme(this).text,
|
|
10054
|
+
_this$attribute = this.attribute,
|
|
10055
|
+
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
10056
|
+
fontFamily = _this$attribute$fontF === void 0 ? textTheme.fontFamily : _this$attribute$fontF,
|
|
10057
|
+
_this$attribute$textA = _this$attribute.textAlign,
|
|
10058
|
+
textAlign = _this$attribute$textA === void 0 ? textTheme.textAlign : _this$attribute$textA,
|
|
10059
|
+
_this$attribute$textB = _this$attribute.textBaseline,
|
|
10060
|
+
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10061
|
+
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10062
|
+
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
10063
|
+
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10064
|
+
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10065
|
+
maxLineWidth = _this$attribute.maxLineWidth,
|
|
10066
|
+
_this$attribute$strok = _this$attribute.stroke,
|
|
10067
|
+
stroke = _this$attribute$strok === void 0 ? textTheme.stroke : _this$attribute$strok,
|
|
10068
|
+
_this$attribute$lineW = _this$attribute.lineWidth,
|
|
10069
|
+
lineWidth = _this$attribute$lineW === void 0 ? textTheme.lineWidth : _this$attribute$lineW,
|
|
10070
|
+
_this$attribute$wordB = _this$attribute.wordBreak,
|
|
10071
|
+
wordBreak = _this$attribute$wordB === void 0 ? textTheme.wordBreak : _this$attribute$wordB,
|
|
10072
|
+
_this$attribute$fontW = _this$attribute.fontWeight,
|
|
10073
|
+
fontWeight = _this$attribute$fontW === void 0 ? textTheme.fontWeight : _this$attribute$fontW,
|
|
10074
|
+
_this$attribute$ignor = _this$attribute.ignoreBuf,
|
|
10075
|
+
ignoreBuf = _this$attribute$ignor === void 0 ? textTheme.ignoreBuf : _this$attribute$ignor,
|
|
10076
|
+
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10077
|
+
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10078
|
+
lineClamp = _this$attribute.lineClamp,
|
|
10079
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
10080
|
+
buf = ignoreBuf ? 0 : 2;
|
|
10081
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10082
|
+
var _bbox = this.cache.layoutData.bbox;
|
|
10083
|
+
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10084
|
+
}
|
|
10085
|
+
var textMeasure = application.graphicUtil.textMeasure,
|
|
10086
|
+
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
10087
|
+
fontSize: fontSize,
|
|
10088
|
+
fontWeight: fontWeight,
|
|
10089
|
+
fontFamily: fontFamily
|
|
10090
|
+
}, textMeasure),
|
|
10091
|
+
lines = vutils.isArray(text) ? text.map(function (l) {
|
|
10092
|
+
return l.toString();
|
|
10093
|
+
}) : [text.toString()],
|
|
10094
|
+
linesLayout = [],
|
|
10095
|
+
bboxWH = [0, 0];
|
|
10096
|
+
var lineCountLimit = 1 / 0;
|
|
10097
|
+
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
10098
|
+
if (maxLineWidth > 0) for (var i = 0; i < lines.length; i++) {
|
|
10099
|
+
var str = lines[i];
|
|
10100
|
+
var needCut = !0;
|
|
10101
|
+
if (i === lineCountLimit - 1) {
|
|
10102
|
+
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10103
|
+
linesLayout.push({
|
|
10104
|
+
str: _clip.str,
|
|
10105
|
+
width: _clip.width
|
|
10106
|
+
});
|
|
10107
|
+
break;
|
|
10108
|
+
}
|
|
10109
|
+
var clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
10110
|
+
if ("" !== str && "" === clip.str) {
|
|
10111
|
+
if (ellipsis) {
|
|
10112
|
+
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10113
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
10114
|
+
} else clip.str = "", clip.width = 0;
|
|
10115
|
+
needCut = !1;
|
|
10116
|
+
}
|
|
10117
|
+
if (linesLayout.push({
|
|
10118
|
+
str: clip.str,
|
|
10119
|
+
width: clip.width
|
|
10120
|
+
}), clip.str.length === str.length) ;else if (needCut) {
|
|
10121
|
+
var newStr = str.substring(clip.str.length);
|
|
10122
|
+
lines.splice(i + 1, 0, newStr);
|
|
10123
|
+
}
|
|
10124
|
+
}
|
|
10125
|
+
var maxWidth = 0;
|
|
10126
|
+
linesLayout.forEach(function (layout) {
|
|
10127
|
+
maxWidth = Math.max(maxWidth, layout.width);
|
|
10128
|
+
}), bboxWH[0] = maxWidth;
|
|
10129
|
+
} else {
|
|
10130
|
+
var width,
|
|
10131
|
+
_text,
|
|
10132
|
+
_lineWidth = 0;
|
|
10133
|
+
for (var _i = 0, len = lines.length; _i < len; _i++) {
|
|
10134
|
+
if (_i === lineCountLimit - 1) {
|
|
10135
|
+
var _clip2 = layoutObj.textMeasure.clipTextWithSuffix(lines[_i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10136
|
+
linesLayout.push({
|
|
10137
|
+
str: _clip2.str,
|
|
10138
|
+
width: _clip2.width
|
|
10139
|
+
}), _lineWidth = Math.max(_lineWidth, _clip2.width);
|
|
10140
|
+
break;
|
|
10141
|
+
}
|
|
10142
|
+
_text = lines[_i], width = layoutObj.textMeasure.measureTextWidth(_text, layoutObj.textOptions, "break-word" === wordBreak), _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
|
|
10143
|
+
str: _text,
|
|
10144
|
+
width: width
|
|
10145
|
+
});
|
|
10146
|
+
}
|
|
10147
|
+
bboxWH[0] = _lineWidth;
|
|
10148
|
+
}
|
|
10149
|
+
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
10150
|
+
var bbox = {
|
|
10151
|
+
xOffset: 0,
|
|
10152
|
+
yOffset: 0,
|
|
10153
|
+
width: bboxWH[0],
|
|
10154
|
+
height: bboxWH[1]
|
|
10155
|
+
};
|
|
10156
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
10157
|
+
var layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
10158
|
+
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10159
|
+
}
|
|
10040
10160
|
}, {
|
|
10041
10161
|
key: "updateSingallineAABBBounds",
|
|
10042
10162
|
value: function updateSingallineAABBBounds(text) {
|
|
@@ -10083,9 +10203,12 @@
|
|
|
10083
10203
|
_attribute$wordBreak === void 0 ? textTheme.wordBreak : _attribute$wordBreak;
|
|
10084
10204
|
var _attribute$ignoreBuf = attribute.ignoreBuf,
|
|
10085
10205
|
ignoreBuf = _attribute$ignoreBuf === void 0 ? textTheme.ignoreBuf : _attribute$ignoreBuf,
|
|
10086
|
-
|
|
10087
|
-
_attribute$
|
|
10088
|
-
|
|
10206
|
+
_attribute$whiteSpace = attribute.whiteSpace,
|
|
10207
|
+
whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace;
|
|
10208
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
10209
|
+
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
10210
|
+
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
10211
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
10089
10212
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
10090
10213
|
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
10091
10214
|
var _dx = textDrawOffsetX(textAlign, width),
|
|
@@ -10155,12 +10278,11 @@
|
|
|
10155
10278
|
fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
|
|
10156
10279
|
_attribute$stroke2 = attribute.stroke,
|
|
10157
10280
|
stroke = _attribute$stroke2 === void 0 ? textTheme.stroke : _attribute$stroke2,
|
|
10158
|
-
_attribute$lineHeight2 = attribute.lineHeight,
|
|
10159
|
-
lineHeight = _attribute$lineHeight2 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight2,
|
|
10160
10281
|
_attribute$lineWidth2 = attribute.lineWidth,
|
|
10161
10282
|
lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
|
|
10162
10283
|
_attribute$verticalMo = attribute.verticalMode,
|
|
10163
|
-
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo
|
|
10284
|
+
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo,
|
|
10285
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
10164
10286
|
var _attribute$textAlign2 = attribute.textAlign,
|
|
10165
10287
|
textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
|
|
10166
10288
|
_attribute$textBaseli2 = attribute.textBaseline,
|
|
@@ -10210,7 +10332,7 @@
|
|
|
10210
10332
|
}, {
|
|
10211
10333
|
key: "updateHorizontalMultilineAABBBounds",
|
|
10212
10334
|
value: function updateHorizontalMultilineAABBBounds(text) {
|
|
10213
|
-
var _a;
|
|
10335
|
+
var _a, _b;
|
|
10214
10336
|
var textTheme = getTheme(this).text,
|
|
10215
10337
|
attribute = this.attribute,
|
|
10216
10338
|
_attribute$fontFamily3 = attribute.fontFamily,
|
|
@@ -10223,8 +10345,6 @@
|
|
|
10223
10345
|
fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
|
|
10224
10346
|
_attribute$fontWeight3 = attribute.fontWeight,
|
|
10225
10347
|
fontWeight = _attribute$fontWeight3 === void 0 ? textTheme.fontWeight : _attribute$fontWeight3,
|
|
10226
|
-
_attribute$lineHeight3 = attribute.lineHeight,
|
|
10227
|
-
lineHeight = _attribute$lineHeight3 === void 0 ? attribute.lineHeight || attribute.fontSize || textTheme.fontSize : _attribute$lineHeight3,
|
|
10228
10348
|
_attribute$ellipsis3 = attribute.ellipsis,
|
|
10229
10349
|
ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
|
|
10230
10350
|
maxLineWidth = attribute.maxLineWidth,
|
|
@@ -10232,11 +10352,13 @@
|
|
|
10232
10352
|
stroke = _attribute$stroke3 === void 0 ? textTheme.stroke : _attribute$stroke3,
|
|
10233
10353
|
_attribute$lineWidth3 = attribute.lineWidth,
|
|
10234
10354
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
10235
|
-
_attribute$
|
|
10236
|
-
_attribute$
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10355
|
+
_attribute$whiteSpace2 = attribute.whiteSpace,
|
|
10356
|
+
whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2,
|
|
10357
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
10358
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
10359
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10360
|
+
var _bbox2 = this.cache.layoutData.bbox;
|
|
10361
|
+
return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10240
10362
|
}
|
|
10241
10363
|
var textMeasure = application.graphicUtil.textMeasure,
|
|
10242
10364
|
layoutData = new CanvasTextLayout(fontFamily, {
|
|
@@ -10270,12 +10392,11 @@
|
|
|
10270
10392
|
fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
|
|
10271
10393
|
_attribute$stroke4 = attribute.stroke,
|
|
10272
10394
|
stroke = _attribute$stroke4 === void 0 ? textTheme.stroke : _attribute$stroke4,
|
|
10273
|
-
_attribute$lineHeight4 = attribute.lineHeight,
|
|
10274
|
-
lineHeight = _attribute$lineHeight4 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight4,
|
|
10275
10395
|
_attribute$lineWidth4 = attribute.lineWidth,
|
|
10276
10396
|
lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
|
|
10277
10397
|
_attribute$verticalMo2 = attribute.verticalMode,
|
|
10278
|
-
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2
|
|
10398
|
+
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2,
|
|
10399
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
10279
10400
|
var _attribute$textAlign4 = attribute.textAlign,
|
|
10280
10401
|
textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
|
|
10281
10402
|
_attribute$textBaseli4 = attribute.textBaseline,
|
|
@@ -10408,7 +10529,7 @@
|
|
|
10408
10529
|
}, {
|
|
10409
10530
|
key: "updateMultilineAABBBounds",
|
|
10410
10531
|
value: function updateMultilineAABBBounds(text) {
|
|
10411
|
-
var _a, _b, _c;
|
|
10532
|
+
var _a, _b, _c, _d;
|
|
10412
10533
|
var textTheme = getTheme(this).text,
|
|
10413
10534
|
_this$attribute = this.attribute,
|
|
10414
10535
|
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
@@ -10419,8 +10540,6 @@
|
|
|
10419
10540
|
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10420
10541
|
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10421
10542
|
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
10422
|
-
_this$attribute$lineH = _this$attribute.lineHeight,
|
|
10423
|
-
lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
|
|
10424
10543
|
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10425
10544
|
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10426
10545
|
maxLineWidth = _this$attribute.maxLineWidth,
|
|
@@ -10437,8 +10556,9 @@
|
|
|
10437
10556
|
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10438
10557
|
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10439
10558
|
lineClamp = _this$attribute.lineClamp,
|
|
10559
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
10440
10560
|
buf = ignoreBuf ? 0 : 2;
|
|
10441
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
10561
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10442
10562
|
var _bbox = this.cache.layoutData.bbox;
|
|
10443
10563
|
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10444
10564
|
}
|
|
@@ -10470,7 +10590,7 @@
|
|
|
10470
10590
|
if ("" !== str && "" === clip.str) {
|
|
10471
10591
|
if (ellipsis) {
|
|
10472
10592
|
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10473
|
-
clip.str = null !== (
|
|
10593
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
10474
10594
|
} else clip.str = "", clip.width = 0;
|
|
10475
10595
|
needCut = !1;
|
|
10476
10596
|
}
|
|
@@ -11286,6 +11406,13 @@
|
|
|
11286
11406
|
builtinSymbols.forEach(function (symbol) {
|
|
11287
11407
|
builtinSymbolsMap[symbol.type] = symbol;
|
|
11288
11408
|
});
|
|
11409
|
+
var builtInSymbolStrMap = {
|
|
11410
|
+
arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
|
|
11411
|
+
arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
|
|
11412
|
+
rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
|
|
11413
|
+
rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
|
|
11414
|
+
roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
|
|
11415
|
+
};
|
|
11289
11416
|
|
|
11290
11417
|
var SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
11291
11418
|
var _Symbol = /*#__PURE__*/function (_Graphic) {
|
|
@@ -11319,12 +11446,13 @@
|
|
|
11319
11446
|
}, {
|
|
11320
11447
|
key: "doUpdateParsedPath",
|
|
11321
11448
|
value: function doUpdateParsedPath() {
|
|
11322
|
-
var symbolTheme = getTheme(this).symbol
|
|
11323
|
-
|
|
11324
|
-
symbolType = _this$attribute$symbo === void 0 ? symbolTheme.symbolType : _this$attribute$symbo
|
|
11325
|
-
|
|
11449
|
+
var symbolTheme = getTheme(this).symbol;
|
|
11450
|
+
var _this$attribute$symbo = this.attribute.symbolType,
|
|
11451
|
+
symbolType = _this$attribute$symbo === void 0 ? symbolTheme.symbolType : _this$attribute$symbo,
|
|
11452
|
+
path = builtinSymbolsMap[symbolType];
|
|
11326
11453
|
if (path) return this._parsedPath = path, path;
|
|
11327
11454
|
if (path = _Symbol.userSymbolMap[symbolType], path) return this._parsedPath = path, path;
|
|
11455
|
+
symbolType = builtInSymbolStrMap[symbolType] || symbolType;
|
|
11328
11456
|
if (!0 === isSvg(symbolType)) {
|
|
11329
11457
|
var parser = new XMLParser(),
|
|
11330
11458
|
_parser$parse = parser.parse(symbolType),
|
|
@@ -11810,7 +11938,9 @@
|
|
|
11810
11938
|
var Paragraph = /*#__PURE__*/function () {
|
|
11811
11939
|
function Paragraph(text, newLine, character) {
|
|
11812
11940
|
_classCallCheck(this, Paragraph);
|
|
11813
|
-
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic"
|
|
11941
|
+
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic";
|
|
11942
|
+
var lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
11943
|
+
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
11814
11944
|
var _measureTextCanvas = measureTextCanvas(text, character),
|
|
11815
11945
|
ascent = _measureTextCanvas.ascent,
|
|
11816
11946
|
height = _measureTextCanvas.height,
|
|
@@ -15341,7 +15471,7 @@
|
|
|
15341
15471
|
var t = textAlign;
|
|
15342
15472
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
15343
15473
|
}
|
|
15344
|
-
var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
|
|
15474
|
+
var lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
|
|
15345
15475
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
15346
15476
|
if (!data) return;
|
|
15347
15477
|
var fVisible = data.fVisible,
|
|
@@ -22181,7 +22311,7 @@
|
|
|
22181
22311
|
}
|
|
22182
22312
|
_createLabelText(attributes) {
|
|
22183
22313
|
var _a, _b;
|
|
22184
|
-
if (attributes.
|
|
22314
|
+
if (attributes.textType === 'rich') {
|
|
22185
22315
|
attributes.textConfig = attributes.text;
|
|
22186
22316
|
attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
|
|
22187
22317
|
attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -22190,7 +22320,7 @@
|
|
|
22190
22320
|
this._setStatesOfText(text);
|
|
22191
22321
|
return text;
|
|
22192
22322
|
}
|
|
22193
|
-
else if (attributes.
|
|
22323
|
+
else if (attributes.textType === 'html') {
|
|
22194
22324
|
attributes.textConfig = [];
|
|
22195
22325
|
attributes.html = Object.assign({ dom: attributes.text, container: '', width: 30, height: 30, style: {} }, attributes);
|
|
22196
22326
|
const text = createRichText(attributes);
|
|
@@ -31002,7 +31132,9 @@
|
|
|
31002
31132
|
let x = 0;
|
|
31003
31133
|
if (isVisible(itemAttr.shape)) {
|
|
31004
31134
|
itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, Object.assign({ visible: true, x: itemAttr.shape.size / 2, y: itemAttr.shape.size / 2 +
|
|
31005
|
-
(((_a = itemAttr.key.lineHeight) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) -
|
|
31135
|
+
(((_a = calculateLineHeight(itemAttr.key.lineHeight, itemAttr.key.fontSize)) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) -
|
|
31136
|
+
itemAttr.shape.size) /
|
|
31137
|
+
2 }, itemAttr.shape), 'symbol');
|
|
31006
31138
|
}
|
|
31007
31139
|
if (hasContentShape) {
|
|
31008
31140
|
x += itemAttr.shape.size + itemAttr.shape.spacing;
|
|
@@ -31383,7 +31515,7 @@
|
|
|
31383
31515
|
}
|
|
31384
31516
|
};
|
|
31385
31517
|
|
|
31386
|
-
const version = "0.16.14-alpha.
|
|
31518
|
+
const version = "0.16.14-alpha.8";
|
|
31387
31519
|
|
|
31388
31520
|
exports.AbstractComponent = AbstractComponent;
|
|
31389
31521
|
exports.ArcInfo = ArcInfo;
|