@visactor/vtable 0.18.3 → 0.18.5-alpha.0
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/core/BaseTable.d.ts +1 -1
- package/cjs/core/BaseTable.js +25 -11
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/icons.js +10 -0
- package/cjs/icons.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/draw-interceptor.d.ts +13 -0
- package/cjs/scenegraph/graphic/contributions/draw-interceptor.js +90 -0
- package/cjs/scenegraph/graphic/contributions/draw-interceptor.js.map +1 -0
- package/cjs/scenegraph/graphic/contributions/index.js +4 -2
- package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +38 -18
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -2
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +5 -5
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/keep-aspect-ratio.js +5 -4
- package/cjs/scenegraph/utils/keep-aspect-ratio.js.map +1 -1
- package/cjs/state/select/update-position.js +10 -1
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -2
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/ts-types/base-table.d.ts +1 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +708 -414
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.d.ts +1 -1
- package/es/core/BaseTable.js +26 -11
- package/es/core/BaseTable.js.map +1 -1
- package/es/icons.js +10 -0
- package/es/icons.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/graphic/contributions/draw-interceptor.d.ts +13 -0
- package/es/scenegraph/graphic/contributions/draw-interceptor.js +64 -0
- package/es/scenegraph/graphic/contributions/draw-interceptor.js.map +1 -0
- package/es/scenegraph/graphic/contributions/index.js +5 -2
- package/es/scenegraph/graphic/contributions/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +35 -17
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -2
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +1 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +5 -5
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/keep-aspect-ratio.js +5 -4
- package/es/scenegraph/utils/keep-aspect-ratio.js.map +1 -1
- package/es/state/select/update-position.js +10 -1
- package/es/state/select/update-position.js.map +1 -1
- package/es/themes/ARCO.js +1 -2
- package/es/themes/BRIGHT.js +2 -1
- package/es/ts-types/base-table.d.ts +1 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +9 -9
package/dist/vtable.js
CHANGED
|
@@ -1329,14 +1329,14 @@
|
|
|
1329
1329
|
const isDate = value => isType$1(value, "Date");
|
|
1330
1330
|
var isDate$1 = isDate;
|
|
1331
1331
|
|
|
1332
|
-
const isNumber$
|
|
1332
|
+
const isNumber$1 = function (value) {
|
|
1333
1333
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1334
1334
|
const type = typeof value;
|
|
1335
1335
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
1336
1336
|
};
|
|
1337
|
-
var isNumber$
|
|
1337
|
+
var isNumber$2 = isNumber$1;
|
|
1338
1338
|
|
|
1339
|
-
const isValidNumber = value => isNumber$
|
|
1339
|
+
const isValidNumber = value => isNumber$2(value) && Number.isFinite(value);
|
|
1340
1340
|
var isValidNumber$1 = isValidNumber;
|
|
1341
1341
|
|
|
1342
1342
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
@@ -1382,7 +1382,7 @@
|
|
|
1382
1382
|
if (!isValid$1(value) || "object" != typeof value) return value;
|
|
1383
1383
|
const isArr = isArray$1(value),
|
|
1384
1384
|
length = value.length;
|
|
1385
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$
|
|
1385
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$2(value) || isString$2(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
1386
1386
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1387
1387
|
let index = -1;
|
|
1388
1388
|
if (result) for (; ++index < (props || value).length;) {
|
|
@@ -1767,10 +1767,10 @@
|
|
|
1767
1767
|
return this.x = x, this.y = y, this;
|
|
1768
1768
|
}
|
|
1769
1769
|
add(point) {
|
|
1770
|
-
return isNumber$
|
|
1770
|
+
return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1771
1771
|
}
|
|
1772
1772
|
sub(point) {
|
|
1773
|
-
return isNumber$
|
|
1773
|
+
return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1774
1774
|
}
|
|
1775
1775
|
multi(point) {
|
|
1776
1776
|
throw new Error("暂不支持");
|
|
@@ -2357,10 +2357,10 @@
|
|
|
2357
2357
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
2358
2358
|
}
|
|
2359
2359
|
function rgb(value) {
|
|
2360
|
-
return isNumber$
|
|
2360
|
+
return isNumber$2(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
2361
2361
|
}
|
|
2362
2362
|
function rgba(value) {
|
|
2363
|
-
return isNumber$
|
|
2363
|
+
return isNumber$2(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
2364
2364
|
}
|
|
2365
2365
|
function SRGBToLinear(c) {
|
|
2366
2366
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -2929,7 +2929,7 @@
|
|
|
2929
2929
|
}(LoggerLevel || (LoggerLevel = {}));
|
|
2930
2930
|
class Logger {
|
|
2931
2931
|
static getInstance(level, method) {
|
|
2932
|
-
return Logger._instance && isNumber$
|
|
2932
|
+
return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
2933
2933
|
}
|
|
2934
2934
|
static setInstance(logger) {
|
|
2935
2935
|
return Logger._instance = logger;
|
|
@@ -4726,9 +4726,6 @@
|
|
|
4726
4726
|
function wrapCanvas(params) {
|
|
4727
4727
|
return container.getNamed(CanvasFactory, application.global.env)(params);
|
|
4728
4728
|
}
|
|
4729
|
-
function isNumber$1(data) {
|
|
4730
|
-
return "number" == typeof data && Number.isFinite(data);
|
|
4731
|
-
}
|
|
4732
4729
|
|
|
4733
4730
|
class DefaultCanvasAllocate {
|
|
4734
4731
|
constructor() {
|
|
@@ -5154,7 +5151,7 @@
|
|
|
5154
5151
|
}
|
|
5155
5152
|
const globalTheme = new Theme();
|
|
5156
5153
|
function getTheme(graphic, theme) {
|
|
5157
|
-
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
5154
|
+
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
5158
5155
|
}
|
|
5159
5156
|
function getThemeFromGroup(graphic) {
|
|
5160
5157
|
let g;
|
|
@@ -5324,7 +5321,7 @@
|
|
|
5324
5321
|
let child = this._firstChild;
|
|
5325
5322
|
for (; child;) {
|
|
5326
5323
|
const next = child._next;
|
|
5327
|
-
child.parent = null, child._prev = null, child._next = null, child = next;
|
|
5324
|
+
child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
|
|
5328
5325
|
}
|
|
5329
5326
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
5330
5327
|
}
|
|
@@ -7236,7 +7233,7 @@
|
|
|
7236
7233
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
7237
7234
|
application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
7238
7235
|
const bounds = this.doUpdateAABBBounds(full);
|
|
7239
|
-
return
|
|
7236
|
+
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
|
|
7240
7237
|
}
|
|
7241
7238
|
combindShadowAABBBounds(bounds) {
|
|
7242
7239
|
if (this.shadowRoot) {
|
|
@@ -8074,7 +8071,7 @@
|
|
|
8074
8071
|
const SYMBOL_NUMBER_TYPE = genNumberType();
|
|
8075
8072
|
const TEXT_NUMBER_TYPE = genNumberType();
|
|
8076
8073
|
const GraphicService = Symbol.for("GraphicService");
|
|
8077
|
-
const GraphicCreator$
|
|
8074
|
+
const GraphicCreator$2 = Symbol.for("GraphicCreator");
|
|
8078
8075
|
const SVG_PARSE_ATTRIBUTE_MAP = {
|
|
8079
8076
|
"stroke-linecap": "lineCap",
|
|
8080
8077
|
"stroke-linejoin": "lineJoin",
|
|
@@ -9534,7 +9531,7 @@
|
|
|
9534
9531
|
|
|
9535
9532
|
class BaseSymbol {
|
|
9536
9533
|
bounds(size, bounds) {
|
|
9537
|
-
if (isNumber$
|
|
9534
|
+
if (isNumber$2(size)) {
|
|
9538
9535
|
const halfS = size / 2;
|
|
9539
9536
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
9540
9537
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
@@ -9965,10 +9962,10 @@
|
|
|
9965
9962
|
super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
9966
9963
|
}
|
|
9967
9964
|
draw(ctx, size, x, y) {
|
|
9968
|
-
return isNumber$
|
|
9965
|
+
return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
9969
9966
|
}
|
|
9970
9967
|
drawOffset(ctx, size, x, y, offset) {
|
|
9971
|
-
return isNumber$
|
|
9968
|
+
return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
9972
9969
|
}
|
|
9973
9970
|
}
|
|
9974
9971
|
var rect = new RectSymbol();
|
|
@@ -10446,16 +10443,7 @@
|
|
|
10446
10443
|
deltaY = -height;
|
|
10447
10444
|
}
|
|
10448
10445
|
let deltaX = 0;
|
|
10449
|
-
|
|
10450
|
-
case "left":
|
|
10451
|
-
deltaX = 0;
|
|
10452
|
-
break;
|
|
10453
|
-
case "center":
|
|
10454
|
-
deltaX = -width / 2;
|
|
10455
|
-
break;
|
|
10456
|
-
case "right":
|
|
10457
|
-
deltaX = -width;
|
|
10458
|
-
}
|
|
10446
|
+
"right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
|
|
10459
10447
|
let frameHeight = this[this.directionKey.height];
|
|
10460
10448
|
this.singleLine && (frameHeight = this.lines[0].height + 1);
|
|
10461
10449
|
let lastLineTag = !1;
|
|
@@ -10604,9 +10592,9 @@
|
|
|
10604
10592
|
let direction = this.direction;
|
|
10605
10593
|
if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
10606
10594
|
if ("hide" === this.ellipsis) return;
|
|
10607
|
-
if ("add" === this.ellipsis) text += "...", "right"
|
|
10595
|
+
if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
10608
10596
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
10609
|
-
if (text = text.slice(0, index), text += "...", "right" === textAlign) {
|
|
10597
|
+
if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
|
|
10610
10598
|
const {
|
|
10611
10599
|
width: width
|
|
10612
10600
|
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
@@ -10797,17 +10785,7 @@
|
|
|
10797
10785
|
maxHeight = this.height;
|
|
10798
10786
|
let x = this.left,
|
|
10799
10787
|
spacing = 0;
|
|
10800
|
-
|
|
10801
|
-
case "right":
|
|
10802
|
-
x = width - this.actualWidth;
|
|
10803
|
-
break;
|
|
10804
|
-
case "center":
|
|
10805
|
-
x = (width - this.actualWidth) / 2;
|
|
10806
|
-
break;
|
|
10807
|
-
case "justify":
|
|
10808
|
-
this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1);
|
|
10809
|
-
}
|
|
10810
|
-
this.paragraphs.map(function (paragraph) {
|
|
10788
|
+
this.actualWidth < width && !isWidthMax && ("right" === this.textAlign || "end" === this.textAlign ? x = width - this.actualWidth : "center" === this.textAlign ? x = (width - this.actualWidth) / 2 : "justify" === this.textAlign && (this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1))), this.paragraphs.map(function (paragraph) {
|
|
10811
10789
|
paragraph instanceof RichTextIcon ? (paragraph["_" + directionKey.x] = x, x += paragraph[directionKey.width] + spacing, paragraph["_" + directionKey.y] = "top" === paragraph.attribute.textBaseline ? 0 : "bottom" === paragraph.attribute.textBaseline ? maxHeight - paragraph.height : (maxHeight - paragraph.height) / 2) : (paragraph[directionKey.left] = x, x += paragraph[directionKey.width] + spacing);
|
|
10812
10790
|
});
|
|
10813
10791
|
}
|
|
@@ -11031,10 +11009,10 @@
|
|
|
11031
11009
|
}
|
|
11032
11010
|
} else {
|
|
11033
11011
|
const richTextConfig = textConfig[i];
|
|
11034
|
-
if (isNumber$
|
|
11012
|
+
if (isNumber$2(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
11035
11013
|
const textParts = richTextConfig.text.split("\n");
|
|
11036
11014
|
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
11037
|
-
} else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
11015
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
11038
11016
|
}
|
|
11039
11017
|
const maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
11040
11018
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -11279,7 +11257,7 @@
|
|
|
11279
11257
|
} = this.attribute;
|
|
11280
11258
|
if (0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
11281
11259
|
const deltaRadius = Math.abs(outerRadius - innerRadius);
|
|
11282
|
-
return Math.min(isNumber$
|
|
11260
|
+
return Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
11283
11261
|
}
|
|
11284
11262
|
getParsedAngle() {
|
|
11285
11263
|
const arcTheme = getTheme(this).arc;
|
|
@@ -12312,9 +12290,9 @@
|
|
|
12312
12290
|
return !!visible || (aabbBounds.clear(), !1);
|
|
12313
12291
|
}
|
|
12314
12292
|
};
|
|
12315
|
-
DefaultGraphicService = __decorate$19([injectable(), __param$F(0, inject(GraphicCreator$
|
|
12293
|
+
DefaultGraphicService = __decorate$19([injectable(), __param$F(0, inject(GraphicCreator$2)), __metadata$S("design:paramtypes", [Object])], DefaultGraphicService);
|
|
12316
12294
|
|
|
12317
|
-
class GraphicCreator {
|
|
12295
|
+
let GraphicCreator$1 = class GraphicCreator {
|
|
12318
12296
|
constructor() {
|
|
12319
12297
|
this.store = new Map();
|
|
12320
12298
|
}
|
|
@@ -12325,12 +12303,12 @@
|
|
|
12325
12303
|
const cb = this.store.get(name);
|
|
12326
12304
|
return cb ? cb(params) : null;
|
|
12327
12305
|
}
|
|
12328
|
-
}
|
|
12329
|
-
const graphicCreator = new GraphicCreator();
|
|
12306
|
+
};
|
|
12307
|
+
const graphicCreator$1 = new GraphicCreator$1();
|
|
12330
12308
|
|
|
12331
|
-
let text;
|
|
12332
|
-
function getTextBounds(params) {
|
|
12333
|
-
return text || (text = graphicCreator.CreateGraphic("text", {})), text.initAttributes(params), text.AABBBounds;
|
|
12309
|
+
let text$1;
|
|
12310
|
+
function getTextBounds$1(params) {
|
|
12311
|
+
return text$1 || (text$1 = graphicCreator$1.CreateGraphic("text", {})), text$1.initAttributes(params), text$1.AABBBounds;
|
|
12334
12312
|
}
|
|
12335
12313
|
|
|
12336
12314
|
const result = {
|
|
@@ -13120,7 +13098,7 @@
|
|
|
13120
13098
|
const halfPi = pi / 2;
|
|
13121
13099
|
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
13122
13100
|
let cornerRadius;
|
|
13123
|
-
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
13101
|
+
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
13124
13102
|
const cornerRadiusArr = rectCornerRadius;
|
|
13125
13103
|
let cr0, cr1;
|
|
13126
13104
|
switch (cornerRadiusArr.length) {
|
|
@@ -13228,7 +13206,7 @@
|
|
|
13228
13206
|
y = bounds.y1,
|
|
13229
13207
|
width = bounds.width(),
|
|
13230
13208
|
height = bounds.height();
|
|
13231
|
-
return isNumber$
|
|
13209
|
+
return isNumber$2(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
|
|
13232
13210
|
x: x,
|
|
13233
13211
|
y: y,
|
|
13234
13212
|
width: width,
|
|
@@ -15069,7 +15047,7 @@
|
|
|
15069
15047
|
getShadowRoot(interactiveLayer) {
|
|
15070
15048
|
var _a;
|
|
15071
15049
|
let group = interactiveLayer.getElementById("_interactive_group");
|
|
15072
|
-
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
15050
|
+
return group || (group = graphicCreator$1.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
15073
15051
|
}
|
|
15074
15052
|
}
|
|
15075
15053
|
class Canvas3DDrawItemInterceptor {
|
|
@@ -15322,7 +15300,7 @@
|
|
|
15322
15300
|
});
|
|
15323
15301
|
|
|
15324
15302
|
var graphicModule = new ContainerModule(bind => {
|
|
15325
|
-
bind(GraphicService).to(DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$
|
|
15303
|
+
bind(GraphicService).to(DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$2).toConstantValue(graphicCreator$1);
|
|
15326
15304
|
});
|
|
15327
15305
|
|
|
15328
15306
|
const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
|
|
@@ -15741,20 +15719,26 @@
|
|
|
15741
15719
|
height: height
|
|
15742
15720
|
} = drawContext;
|
|
15743
15721
|
if (!context) return;
|
|
15722
|
+
if (drawContext.keepMatrix) {
|
|
15723
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
15724
|
+
const t = context.nativeContext.getTransform();
|
|
15725
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
15726
|
+
}
|
|
15727
|
+
} else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
15744
15728
|
const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
|
|
15745
15729
|
if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
|
|
15746
15730
|
const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
|
|
15747
15731
|
dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
|
|
15748
15732
|
}
|
|
15749
15733
|
const d = context.dpr % 1;
|
|
15750
|
-
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds)
|
|
15734
|
+
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
|
|
15751
15735
|
const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
15752
|
-
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.
|
|
15736
|
+
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
15753
15737
|
var _a, _b;
|
|
15754
15738
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
15755
15739
|
}).forEach(group => {
|
|
15756
15740
|
group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
|
|
15757
|
-
}), context.restore(), context.restore(), context.draw(), context.inuse = !1;
|
|
15741
|
+
}), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
|
|
15758
15742
|
}
|
|
15759
15743
|
doRegister() {
|
|
15760
15744
|
throw new Error("暂不支持");
|
|
@@ -15807,7 +15791,7 @@
|
|
|
15807
15791
|
}, subLayers.set(group._uid, incrementalLayer));
|
|
15808
15792
|
const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
|
|
15809
15793
|
idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
|
|
15810
|
-
idc.dirtyBounds.
|
|
15794
|
+
idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
|
|
15811
15795
|
drawContribution: idc,
|
|
15812
15796
|
clear: "transparent",
|
|
15813
15797
|
layer: incrementalLayer.layer,
|
|
@@ -16155,14 +16139,22 @@
|
|
|
16155
16139
|
x = 0,
|
|
16156
16140
|
y = 0
|
|
16157
16141
|
} = drawContext;
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16142
|
+
if (context) {
|
|
16143
|
+
if (drawContext.keepMatrix) {
|
|
16144
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
16145
|
+
const t = context.nativeContext.getTransform();
|
|
16146
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
16147
|
+
}
|
|
16148
|
+
} else context.inuse = !0, context.clearMatrix();
|
|
16149
|
+
context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
16150
|
+
var _a, _b;
|
|
16151
|
+
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
16152
|
+
}).forEach(group => {
|
|
16153
|
+
this.renderGroup(group, drawContext);
|
|
16154
|
+
}), this.hooks.completeDraw.tap("top-draw", () => {
|
|
16155
|
+
context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
|
|
16156
|
+
});
|
|
16157
|
+
}
|
|
16166
16158
|
});
|
|
16167
16159
|
}
|
|
16168
16160
|
_increaseRender(group, drawContext) {
|
|
@@ -16463,34 +16455,48 @@
|
|
|
16463
16455
|
constructor() {
|
|
16464
16456
|
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
16465
16457
|
}
|
|
16458
|
+
pauseLayout(p) {
|
|
16459
|
+
this.pause = p;
|
|
16460
|
+
}
|
|
16461
|
+
tryLayoutChildren(graphic) {
|
|
16462
|
+
graphic.firstChild && this.tryLayout(graphic.firstChild);
|
|
16463
|
+
}
|
|
16466
16464
|
tryLayout(graphic) {
|
|
16467
|
-
|
|
16468
|
-
this.
|
|
16465
|
+
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
16466
|
+
if (this.pause) return;
|
|
16469
16467
|
const p = graphic.parent;
|
|
16470
|
-
if (!
|
|
16468
|
+
if (!(force || p && graphic.needUpdateLayout())) return;
|
|
16471
16469
|
const theme = getTheme(p).group,
|
|
16472
16470
|
{
|
|
16473
16471
|
display = theme.display
|
|
16474
16472
|
} = p.attribute;
|
|
16475
16473
|
if ("flex" !== display) return;
|
|
16476
16474
|
const {
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16481
|
-
|
|
16482
|
-
|
|
16475
|
+
flexDirection = theme.flexDirection,
|
|
16476
|
+
flexWrap = theme.flexWrap,
|
|
16477
|
+
alignItems = theme.alignItems,
|
|
16478
|
+
clip = theme.clip
|
|
16479
|
+
} = p.attribute,
|
|
16480
|
+
{
|
|
16481
|
+
alignContent = null != alignItems ? alignItems : theme.alignContent
|
|
16482
|
+
} = p.attribute;
|
|
16483
|
+
let {
|
|
16484
|
+
width: width,
|
|
16485
|
+
height: height,
|
|
16486
|
+
justifyContent = theme.justifyContent
|
|
16483
16487
|
} = p.attribute;
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16488
|
+
const children = p.getChildren();
|
|
16489
|
+
if (null == width || null == height) {
|
|
16490
|
+
let childrenWidth = 0,
|
|
16491
|
+
childrenHeight = 0,
|
|
16492
|
+
boundsLegal = 0;
|
|
16493
|
+
if (children.forEach(child => {
|
|
16494
|
+
const bounds = this.getAABBBounds(child);
|
|
16495
|
+
bounds.empty() || ("column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2);
|
|
16496
|
+
}), !isFinite(boundsLegal)) return;
|
|
16497
|
+
width = childrenWidth, height = childrenHeight;
|
|
16498
|
+
}
|
|
16499
|
+
p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
|
|
16494
16500
|
const result = {
|
|
16495
16501
|
main: {
|
|
16496
16502
|
len: width,
|
|
@@ -16499,18 +16505,18 @@
|
|
|
16499
16505
|
cross: {
|
|
16500
16506
|
len: height,
|
|
16501
16507
|
field: "y"
|
|
16502
|
-
}
|
|
16503
|
-
dir: 1
|
|
16508
|
+
}
|
|
16504
16509
|
},
|
|
16505
16510
|
main = result.main,
|
|
16506
16511
|
cross = result.cross;
|
|
16507
|
-
"
|
|
16512
|
+
"column" !== flexDirection && "column-reverse" !== flexDirection || (main.len = height, cross.len = width, main.field = "y", cross.field = "x"), "row-reverse" !== flexDirection && "column-reverse" !== flexDirection || ("flex-start" === justifyContent ? justifyContent = "flex-end" : "flex-end" === justifyContent ? justifyContent = "flex-start" : children.reverse());
|
|
16508
16513
|
let mainLen = 0,
|
|
16509
16514
|
crossLen = 0;
|
|
16510
16515
|
const mianLenArray = [];
|
|
16511
|
-
|
|
16512
|
-
const b = c
|
|
16513
|
-
|
|
16516
|
+
children.forEach(c => {
|
|
16517
|
+
const b = this.getAABBBounds(c);
|
|
16518
|
+
if (b.empty()) return;
|
|
16519
|
+
const ml = "x" === main.field ? b.width() : b.height(),
|
|
16514
16520
|
cl = "x" === cross.field ? b.width() : b.height();
|
|
16515
16521
|
mianLenArray.push({
|
|
16516
16522
|
mainLen: ml,
|
|
@@ -16545,107 +16551,168 @@
|
|
|
16545
16551
|
mainLen: mainLen,
|
|
16546
16552
|
crossLen: crossLen
|
|
16547
16553
|
});
|
|
16548
|
-
const children = p.getChildren();
|
|
16549
16554
|
let lastIdx = 0;
|
|
16550
16555
|
if (mainList.forEach(s => {
|
|
16551
16556
|
this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
|
|
16552
16557
|
}), crossLen = mainList.reduce((a, b) => a + b.crossLen, 0), 1 === mainList.length) {
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
} else children.forEach(child => {
|
|
16560
|
-
child.attribute[cross.field] = getPadding(child, cross.field);
|
|
16561
|
-
});
|
|
16558
|
+
const anchorPosMap = {
|
|
16559
|
+
"flex-start": 0,
|
|
16560
|
+
"flex-end": cross.len,
|
|
16561
|
+
center: cross.len / 2
|
|
16562
|
+
};
|
|
16563
|
+
this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
|
|
16562
16564
|
} else if ("flex-start" === alignContent) {
|
|
16563
16565
|
lastIdx = 0;
|
|
16564
16566
|
let anchorPos = 0;
|
|
16565
16567
|
mainList.forEach((s, i) => {
|
|
16566
|
-
|
|
16568
|
+
const anchorPosMap = {
|
|
16569
|
+
"flex-start": anchorPos,
|
|
16570
|
+
"flex-end": anchorPos + s.crossLen,
|
|
16571
|
+
center: anchorPos + s.crossLen / 2
|
|
16572
|
+
};
|
|
16573
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
16567
16574
|
});
|
|
16568
16575
|
} else if ("center" === alignContent) {
|
|
16569
16576
|
lastIdx = 0;
|
|
16570
16577
|
let anchorPos = Math.max(0, (cross.len - crossLen) / 2);
|
|
16571
16578
|
mainList.forEach((s, i) => {
|
|
16572
|
-
|
|
16579
|
+
const anchorPosMap = {
|
|
16580
|
+
"flex-start": anchorPos,
|
|
16581
|
+
"flex-end": anchorPos + s.crossLen,
|
|
16582
|
+
center: anchorPos + s.crossLen / 2
|
|
16583
|
+
};
|
|
16584
|
+
this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
16573
16585
|
});
|
|
16574
16586
|
} else if ("space-around" === alignContent) {
|
|
16575
16587
|
lastIdx = 0;
|
|
16576
16588
|
const padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
|
|
16577
16589
|
let anchorPos = padding;
|
|
16578
16590
|
mainList.forEach((s, i) => {
|
|
16579
|
-
|
|
16591
|
+
const anchorPosMap = {
|
|
16592
|
+
"flex-start": anchorPos,
|
|
16593
|
+
"flex-end": anchorPos + s.crossLen,
|
|
16594
|
+
center: anchorPos + s.crossLen / 2
|
|
16595
|
+
};
|
|
16596
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
|
|
16580
16597
|
});
|
|
16581
16598
|
} else if ("space-between" === alignContent) {
|
|
16582
16599
|
lastIdx = 0;
|
|
16583
16600
|
const padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
|
|
16584
16601
|
let anchorPos = 0;
|
|
16585
16602
|
mainList.forEach((s, i) => {
|
|
16586
|
-
|
|
16603
|
+
const anchorPosMap = {
|
|
16604
|
+
"flex-start": anchorPos,
|
|
16605
|
+
"flex-end": anchorPos + s.crossLen,
|
|
16606
|
+
center: anchorPos + s.crossLen / 2
|
|
16607
|
+
};
|
|
16608
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
|
|
16587
16609
|
});
|
|
16588
16610
|
}
|
|
16589
16611
|
children.forEach((child, idx) => {
|
|
16590
16612
|
child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
|
|
16591
|
-
}), p.addUpdateLayoutTag()
|
|
16613
|
+
}), p.addUpdateLayoutTag();
|
|
16614
|
+
const b = this.getAABBBounds(p);
|
|
16615
|
+
clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
|
|
16616
|
+
}
|
|
16617
|
+
getAABBBounds(graphic) {
|
|
16618
|
+
this.skipBoundsTrigger = !0;
|
|
16619
|
+
const b = graphic.AABBBounds;
|
|
16620
|
+
return this.skipBoundsTrigger = !1, b;
|
|
16621
|
+
}
|
|
16622
|
+
updateChildPos(posBaseLeftTop, lastP, lastBP) {
|
|
16623
|
+
return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
|
|
16592
16624
|
}
|
|
16593
16625
|
layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
|
|
16594
16626
|
if ("flex-start" === justifyContent) {
|
|
16595
16627
|
let pos = 0;
|
|
16596
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16628
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16629
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16630
|
+
b = this.getAABBBounds(children[i]);
|
|
16631
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
16632
|
+
}
|
|
16597
16633
|
} else if ("flex-end" === justifyContent) {
|
|
16598
16634
|
let pos = main.len;
|
|
16599
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16635
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16636
|
+
pos -= mianLenArray[i].mainLen;
|
|
16637
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16638
|
+
b = this.getAABBBounds(children[i]);
|
|
16639
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`]));
|
|
16640
|
+
}
|
|
16600
16641
|
} else if ("space-around" === justifyContent) {
|
|
16601
16642
|
if (currSeg.mainLen >= main.len) {
|
|
16602
16643
|
let pos = 0;
|
|
16603
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16644
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16645
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16646
|
+
b = this.getAABBBounds(children[i]);
|
|
16647
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
16648
|
+
}
|
|
16604
16649
|
} else {
|
|
16605
16650
|
const size = currSeg.idx - lastIdx + 1,
|
|
16606
16651
|
padding = (main.len - currSeg.mainLen) / size / 2;
|
|
16607
16652
|
let pos = padding;
|
|
16608
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16653
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16654
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16655
|
+
b = this.getAABBBounds(children[i]);
|
|
16656
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen + 2 * padding;
|
|
16657
|
+
}
|
|
16609
16658
|
}
|
|
16610
16659
|
} else if ("space-between" === justifyContent) {
|
|
16611
16660
|
if (currSeg.mainLen >= main.len) {
|
|
16612
16661
|
let pos = 0;
|
|
16613
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16662
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16663
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16664
|
+
b = this.getAABBBounds(children[i]);
|
|
16665
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
16666
|
+
}
|
|
16614
16667
|
} else {
|
|
16615
16668
|
const size = currSeg.idx - lastIdx + 1,
|
|
16616
16669
|
padding = (main.len - currSeg.mainLen) / (2 * size - 2);
|
|
16617
16670
|
let pos = 0;
|
|
16618
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16671
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16672
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16673
|
+
b = this.getAABBBounds(children[i]);
|
|
16674
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen + 2 * padding;
|
|
16675
|
+
}
|
|
16619
16676
|
}
|
|
16620
16677
|
} else if ("center" === justifyContent) {
|
|
16621
16678
|
let pos = (main.len - currSeg.mainLen) / 2;
|
|
16622
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
16679
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16680
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
16681
|
+
b = this.getAABBBounds(children[i]);
|
|
16682
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
16683
|
+
}
|
|
16623
16684
|
}
|
|
16624
16685
|
}
|
|
16625
|
-
layoutCross(children, alignItem, cross,
|
|
16626
|
-
|
|
16686
|
+
layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
|
|
16687
|
+
var _a;
|
|
16688
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
16689
|
+
const child = children[i];
|
|
16690
|
+
let {
|
|
16691
|
+
alignSelf: alignSelf
|
|
16692
|
+
} = child.attribute;
|
|
16693
|
+
alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
|
|
16694
|
+
const b = this.getAABBBounds(child),
|
|
16695
|
+
anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
|
|
16696
|
+
"flex-end" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`])) : "center" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`])) : !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`]));
|
|
16697
|
+
}
|
|
16627
16698
|
}
|
|
16628
16699
|
activate(context) {
|
|
16629
16700
|
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
|
|
16630
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic
|
|
16701
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === this.pluginService.stage && this.tryLayout(graphic, !1);
|
|
16631
16702
|
}), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
|
|
16632
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
|
|
16703
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
|
|
16633
16704
|
}), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
16634
|
-
stage && stage === this.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) ||
|
|
16705
|
+
stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
|
|
16635
16706
|
}), application.graphicService.hooks.onSetStage.tap(this.key, graphic => {
|
|
16636
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic
|
|
16707
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
|
|
16637
16708
|
});
|
|
16638
16709
|
}
|
|
16639
16710
|
deactivate(context) {
|
|
16640
|
-
application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
|
|
16711
|
+
application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
|
|
16641
16712
|
}
|
|
16642
16713
|
}
|
|
16643
16714
|
function getPadding(graphic, field) {
|
|
16644
|
-
|
|
16645
|
-
if (isNumber$1(graphic.attribute.boundsPadding)) return graphic.attribute.boundsPadding;
|
|
16646
|
-
if (isArray$1(graphic.attribute.boundsPadding) && 1 === graphic.attribute.boundsPadding.length) return graphic.attribute.boundsPadding[0];
|
|
16647
|
-
const paddingArray = parsePadding(graphic.attribute.boundsPadding);
|
|
16648
|
-
return "x" === field ? paddingArray[3] : "y" === field ? paddingArray[0] : 0;
|
|
16715
|
+
return 0;
|
|
16649
16716
|
}
|
|
16650
16717
|
|
|
16651
16718
|
const defaultTicker = new DefaultTicker();
|
|
@@ -17064,6 +17131,9 @@
|
|
|
17064
17131
|
this.pluginService.unRegister(plugin);
|
|
17065
17132
|
}));
|
|
17066
17133
|
}
|
|
17134
|
+
getPluginsByName(name) {
|
|
17135
|
+
return this.pluginService.findPluginsByName(name);
|
|
17136
|
+
}
|
|
17067
17137
|
tryUpdateAABBBounds() {
|
|
17068
17138
|
const viewBox = this._viewBox;
|
|
17069
17139
|
return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
|
|
@@ -17097,7 +17167,7 @@
|
|
|
17097
17167
|
render(layers, params) {
|
|
17098
17168
|
this.ticker.start(), this.timeline.resume();
|
|
17099
17169
|
const state = this.state;
|
|
17100
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
17170
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
17101
17171
|
}
|
|
17102
17172
|
combineLayersToWindow() {}
|
|
17103
17173
|
renderNextFrame(layers, force) {
|
|
@@ -17124,7 +17194,8 @@
|
|
|
17124
17194
|
background: layer === this.defaultLayer ? this.background : void 0,
|
|
17125
17195
|
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
17126
17196
|
}, Object.assign({
|
|
17127
|
-
renderStyle: this.renderStyle
|
|
17197
|
+
renderStyle: this.renderStyle,
|
|
17198
|
+
keepMatrix: this.params.renderKeepMatrix
|
|
17128
17199
|
}, params)));
|
|
17129
17200
|
}), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
|
|
17130
17201
|
renderService: this.renderService,
|
|
@@ -17507,11 +17578,17 @@
|
|
|
17507
17578
|
if (!params.bounds.contains(point.x, point.y)) return result;
|
|
17508
17579
|
offsetX = params.bounds.x1, offsetY = params.bounds.y1;
|
|
17509
17580
|
}
|
|
17510
|
-
|
|
17581
|
+
if (this.pickContext) if (params.keepMatrix) {
|
|
17582
|
+
if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
|
|
17583
|
+
const t = this.pickContext.nativeContext.getTransform();
|
|
17584
|
+
this.pickContext.setTransformFromMatrix(t, !0, 1);
|
|
17585
|
+
}
|
|
17586
|
+
} else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
|
|
17587
|
+
params.pickContext = this.pickContext;
|
|
17511
17588
|
const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
|
|
17512
17589
|
let group;
|
|
17513
17590
|
for (let i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
|
|
17514
|
-
if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
|
|
17591
|
+
if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
|
|
17515
17592
|
let g = result.graphic;
|
|
17516
17593
|
for (; g.parent;) g = g.parent;
|
|
17517
17594
|
g.shadowHost && (result.params = {
|
|
@@ -18129,75 +18206,75 @@
|
|
|
18129
18206
|
});
|
|
18130
18207
|
|
|
18131
18208
|
function registerArcGraphic() {
|
|
18132
|
-
graphicCreator.RegisterGraphicCreator("arc", createArc);
|
|
18209
|
+
graphicCreator$1.RegisterGraphicCreator("arc", createArc);
|
|
18133
18210
|
}
|
|
18134
18211
|
|
|
18135
18212
|
function registerArc3dGraphic() {
|
|
18136
|
-
graphicCreator.RegisterGraphicCreator("arc3d", createArc3d);
|
|
18213
|
+
graphicCreator$1.RegisterGraphicCreator("arc3d", createArc3d);
|
|
18137
18214
|
}
|
|
18138
18215
|
|
|
18139
18216
|
function registerAreaGraphic() {
|
|
18140
|
-
graphicCreator.RegisterGraphicCreator("area", createArea);
|
|
18217
|
+
graphicCreator$1.RegisterGraphicCreator("area", createArea);
|
|
18141
18218
|
}
|
|
18142
18219
|
|
|
18143
18220
|
function registerCircleGraphic() {
|
|
18144
|
-
graphicCreator.RegisterGraphicCreator("circle", createCircle);
|
|
18221
|
+
graphicCreator$1.RegisterGraphicCreator("circle", createCircle);
|
|
18145
18222
|
}
|
|
18146
18223
|
|
|
18147
18224
|
function registerGlyphGraphic() {
|
|
18148
|
-
graphicCreator.RegisterGraphicCreator("glyph", createGlyph);
|
|
18225
|
+
graphicCreator$1.RegisterGraphicCreator("glyph", createGlyph);
|
|
18149
18226
|
}
|
|
18150
18227
|
|
|
18151
18228
|
function registerGroupGraphic() {
|
|
18152
|
-
graphicCreator.RegisterGraphicCreator("group", createGroup);
|
|
18229
|
+
graphicCreator$1.RegisterGraphicCreator("group", createGroup);
|
|
18153
18230
|
}
|
|
18154
18231
|
|
|
18155
18232
|
function registerImageGraphic() {
|
|
18156
|
-
graphicCreator.RegisterGraphicCreator("image", createImage);
|
|
18233
|
+
graphicCreator$1.RegisterGraphicCreator("image", createImage);
|
|
18157
18234
|
}
|
|
18158
18235
|
|
|
18159
18236
|
function registerLineGraphic() {
|
|
18160
|
-
graphicCreator.RegisterGraphicCreator("line", createLine);
|
|
18237
|
+
graphicCreator$1.RegisterGraphicCreator("line", createLine);
|
|
18161
18238
|
}
|
|
18162
18239
|
|
|
18163
18240
|
function registerPathGraphic() {
|
|
18164
|
-
graphicCreator.RegisterGraphicCreator("path", createPath);
|
|
18241
|
+
graphicCreator$1.RegisterGraphicCreator("path", createPath);
|
|
18165
18242
|
}
|
|
18166
18243
|
|
|
18167
18244
|
function registerPolygonGraphic() {
|
|
18168
|
-
graphicCreator.RegisterGraphicCreator("polygon", createPolygon);
|
|
18245
|
+
graphicCreator$1.RegisterGraphicCreator("polygon", createPolygon);
|
|
18169
18246
|
}
|
|
18170
18247
|
|
|
18171
18248
|
function registerPyramid3dGraphic() {
|
|
18172
|
-
graphicCreator.RegisterGraphicCreator("pyramid3d", createPyramid3d);
|
|
18249
|
+
graphicCreator$1.RegisterGraphicCreator("pyramid3d", createPyramid3d);
|
|
18173
18250
|
}
|
|
18174
18251
|
|
|
18175
18252
|
function registerRectGraphic() {
|
|
18176
|
-
graphicCreator.RegisterGraphicCreator("rect", createRect);
|
|
18253
|
+
graphicCreator$1.RegisterGraphicCreator("rect", createRect);
|
|
18177
18254
|
}
|
|
18178
18255
|
|
|
18179
18256
|
function registerRect3dGraphic() {
|
|
18180
|
-
graphicCreator.RegisterGraphicCreator("rect3d", createRect3d);
|
|
18257
|
+
graphicCreator$1.RegisterGraphicCreator("rect3d", createRect3d);
|
|
18181
18258
|
}
|
|
18182
18259
|
|
|
18183
18260
|
function registerRichtextGraphic() {
|
|
18184
|
-
graphicCreator.RegisterGraphicCreator("richtext", createRichText);
|
|
18261
|
+
graphicCreator$1.RegisterGraphicCreator("richtext", createRichText);
|
|
18185
18262
|
}
|
|
18186
18263
|
|
|
18187
18264
|
function registerSymbolGraphic() {
|
|
18188
|
-
graphicCreator.RegisterGraphicCreator("symbol", createSymbol);
|
|
18265
|
+
graphicCreator$1.RegisterGraphicCreator("symbol", createSymbol);
|
|
18189
18266
|
}
|
|
18190
18267
|
|
|
18191
18268
|
function registerTextGraphic() {
|
|
18192
|
-
graphicCreator.RegisterGraphicCreator("text", createText);
|
|
18269
|
+
graphicCreator$1.RegisterGraphicCreator("text", createText);
|
|
18193
18270
|
}
|
|
18194
18271
|
|
|
18195
18272
|
function registerShadowRootGraphic() {
|
|
18196
|
-
graphicCreator.RegisterGraphicCreator("shadowRoot", createShadowRoot);
|
|
18273
|
+
graphicCreator$1.RegisterGraphicCreator("shadowRoot", createShadowRoot);
|
|
18197
18274
|
}
|
|
18198
18275
|
|
|
18199
18276
|
function registerWrapTextGraphic() {
|
|
18200
|
-
graphicCreator.RegisterGraphicCreator("wrapText", createWrapText);
|
|
18277
|
+
graphicCreator$1.RegisterGraphicCreator("wrapText", createWrapText);
|
|
18201
18278
|
}
|
|
18202
18279
|
|
|
18203
18280
|
const REACT_TO_CANOPUS_EVENTS = {
|
|
@@ -18248,40 +18325,40 @@
|
|
|
18248
18325
|
onDblClick: "dblclick"
|
|
18249
18326
|
};
|
|
18250
18327
|
function VArc(params) {
|
|
18251
|
-
return graphicCreator.arc(params ? params.attribute : {});
|
|
18328
|
+
return graphicCreator$1.arc(params ? params.attribute : {});
|
|
18252
18329
|
}
|
|
18253
18330
|
function VArea(params) {
|
|
18254
|
-
return graphicCreator.area(params ? params.attribute : {});
|
|
18331
|
+
return graphicCreator$1.area(params ? params.attribute : {});
|
|
18255
18332
|
}
|
|
18256
18333
|
function VCircle(params) {
|
|
18257
|
-
return graphicCreator.circle(params ? params.attribute : {});
|
|
18334
|
+
return graphicCreator$1.circle(params ? params.attribute : {});
|
|
18258
18335
|
}
|
|
18259
18336
|
function VGroup(params) {
|
|
18260
|
-
return graphicCreator.group(params ? params.attribute : {});
|
|
18337
|
+
return graphicCreator$1.group(params ? params.attribute : {});
|
|
18261
18338
|
}
|
|
18262
18339
|
function VGlyph(params) {
|
|
18263
|
-
return graphicCreator.glyph(params ? params.attribute : {});
|
|
18340
|
+
return graphicCreator$1.glyph(params ? params.attribute : {});
|
|
18264
18341
|
}
|
|
18265
18342
|
function VImage(params) {
|
|
18266
|
-
return graphicCreator.image(params ? params.attribute : {});
|
|
18343
|
+
return graphicCreator$1.image(params ? params.attribute : {});
|
|
18267
18344
|
}
|
|
18268
18345
|
function VLine(params) {
|
|
18269
|
-
return graphicCreator.line(params ? params.attribute : {});
|
|
18346
|
+
return graphicCreator$1.line(params ? params.attribute : {});
|
|
18270
18347
|
}
|
|
18271
18348
|
function VPath(params) {
|
|
18272
|
-
return graphicCreator.path(params ? params.attribute : {});
|
|
18349
|
+
return graphicCreator$1.path(params ? params.attribute : {});
|
|
18273
18350
|
}
|
|
18274
18351
|
function VPolygon(params) {
|
|
18275
|
-
return graphicCreator.polygon(params ? params.attribute : {});
|
|
18352
|
+
return graphicCreator$1.polygon(params ? params.attribute : {});
|
|
18276
18353
|
}
|
|
18277
18354
|
function VRect(params) {
|
|
18278
|
-
return graphicCreator.rect(params ? params.attribute : {});
|
|
18355
|
+
return graphicCreator$1.rect(params ? params.attribute : {});
|
|
18279
18356
|
}
|
|
18280
18357
|
function VSymbol(params) {
|
|
18281
|
-
return graphicCreator.symbol(params ? params.attribute : {});
|
|
18358
|
+
return graphicCreator$1.symbol(params ? params.attribute : {});
|
|
18282
18359
|
}
|
|
18283
18360
|
function VText(params) {
|
|
18284
|
-
return graphicCreator.text(params ? params.attribute : {});
|
|
18361
|
+
return graphicCreator$1.text(params ? params.attribute : {});
|
|
18285
18362
|
}
|
|
18286
18363
|
|
|
18287
18364
|
var __rest$4 = undefined && undefined.__rest || function (s, e) {
|
|
@@ -18306,7 +18383,7 @@
|
|
|
18306
18383
|
} = _a,
|
|
18307
18384
|
props = __rest$4(_a, ["key", "attribute", "stateProxy"]);
|
|
18308
18385
|
let c = type;
|
|
18309
|
-
isString$2(type) && (c = graphicCreator[type]);
|
|
18386
|
+
isString$2(type) && (c = graphicCreator$1[type]);
|
|
18310
18387
|
const childrenList = [];
|
|
18311
18388
|
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
18312
18389
|
children[_key - 2] = arguments[_key];
|
|
@@ -20039,7 +20116,7 @@
|
|
|
20039
20116
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
20040
20117
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
20041
20118
|
let picked = !0;
|
|
20042
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
20119
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
20043
20120
|
if (picked) return !0;
|
|
20044
20121
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
20045
20122
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
@@ -20107,7 +20184,7 @@
|
|
|
20107
20184
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
20108
20185
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
20109
20186
|
let picked = !0;
|
|
20110
|
-
if (!onlyTranslate || isNumber$
|
|
20187
|
+
if (!onlyTranslate || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
20111
20188
|
if (picked) return !0;
|
|
20112
20189
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
20113
20190
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
@@ -24666,7 +24743,7 @@
|
|
|
24666
24743
|
width: 0,
|
|
24667
24744
|
height: 0
|
|
24668
24745
|
};
|
|
24669
|
-
const bounds = getTextBounds({
|
|
24746
|
+
const bounds = getTextBounds$1({
|
|
24670
24747
|
text: text,
|
|
24671
24748
|
fontFamily: null !== (_a = textSpec.fontFamily) && void 0 !== _a ? _a : fontFamily,
|
|
24672
24749
|
fontSize: textSpec.fontSize || 12,
|
|
@@ -24682,6 +24759,14 @@
|
|
|
24682
24759
|
height: bounds.height()
|
|
24683
24760
|
};
|
|
24684
24761
|
}
|
|
24762
|
+
function isRichText(attributes) {
|
|
24763
|
+
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
24764
|
+
return typeKey in attributes && "rich" === attributes[typeKey] || isObject$4(attributes.text) && "rich" === attributes.text.type;
|
|
24765
|
+
}
|
|
24766
|
+
function richTextAttributeTransform(attributes) {
|
|
24767
|
+
var _a, _b;
|
|
24768
|
+
return attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.maxWidth = attributes.maxLineWidth, attributes.textConfig = attributes.text.text || attributes.text, attributes;
|
|
24769
|
+
}
|
|
24685
24770
|
|
|
24686
24771
|
function loadTagComponent() {
|
|
24687
24772
|
registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
|
|
@@ -24702,7 +24787,7 @@
|
|
|
24702
24787
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, Tag.defaultAttributes, attributes)), this.name = "tag";
|
|
24703
24788
|
}
|
|
24704
24789
|
render() {
|
|
24705
|
-
var _a, _b
|
|
24790
|
+
var _a, _b;
|
|
24706
24791
|
const {
|
|
24707
24792
|
text = "",
|
|
24708
24793
|
textStyle = {},
|
|
@@ -24734,7 +24819,7 @@
|
|
|
24734
24819
|
shapeStyle = __rest$3(shape, ["visible"]);
|
|
24735
24820
|
if (isBoolean$2(shapeVisible)) {
|
|
24736
24821
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
24737
|
-
maxSize = isNumber$
|
|
24822
|
+
maxSize = isNumber$2(size) ? size : Math.max(size[0], size[1]);
|
|
24738
24823
|
symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
|
|
24739
24824
|
symbolType: "circle",
|
|
24740
24825
|
size: size,
|
|
@@ -24746,39 +24831,15 @@
|
|
|
24746
24831
|
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
24747
24832
|
}
|
|
24748
24833
|
let textShape;
|
|
24749
|
-
|
|
24750
|
-
|
|
24751
|
-
|
|
24752
|
-
|
|
24753
|
-
},
|
|
24754
|
-
|
|
24755
|
-
|
|
24756
|
-
|
|
24757
|
-
height: null !== (_b = textStyle.height) && void 0 !== _b ? _b : 0
|
|
24758
|
-
});
|
|
24759
|
-
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
|
|
24760
|
-
const {
|
|
24761
|
-
visible: bgVisible
|
|
24762
|
-
} = panel,
|
|
24763
|
-
backgroundStyle = __rest$3(panel, ["visible"]);
|
|
24764
|
-
if (visible && isBoolean$2(bgVisible)) {
|
|
24765
|
-
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
24766
|
-
visible: bgVisible && !!text,
|
|
24767
|
-
x: textShape.AABBBounds.x1,
|
|
24768
|
-
y: textShape.AABBBounds.y1,
|
|
24769
|
-
width: textShape.AABBBounds.width(),
|
|
24770
|
-
height: textShape.AABBBounds.height()
|
|
24771
|
-
}), "rect");
|
|
24772
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
24773
|
-
}
|
|
24774
|
-
} else if ("html" === type) {
|
|
24775
|
-
const richTextAttrs = Object.assign(Object.assign({
|
|
24776
|
-
textConfig: [],
|
|
24834
|
+
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
24835
|
+
if (isRichText({
|
|
24836
|
+
text: text
|
|
24837
|
+
}) || "rich" === type) {
|
|
24838
|
+
const richTextAttrs = Object.assign(Object.assign(Object.assign({}, richTextAttributeTransform(Object.assign({
|
|
24839
|
+
type: type,
|
|
24840
|
+
text: text
|
|
24841
|
+
}, textStyle))), textStyle), {
|
|
24777
24842
|
visible: isValid$1(text) && !1 !== visible,
|
|
24778
|
-
html: Object.assign(Object.assign({
|
|
24779
|
-
dom: text
|
|
24780
|
-
}, DEFAULT_HTML_TEXT_SPEC), textStyle)
|
|
24781
|
-
}, textStyle), {
|
|
24782
24843
|
x: textX,
|
|
24783
24844
|
y: 0
|
|
24784
24845
|
});
|
|
@@ -24799,7 +24860,7 @@
|
|
|
24799
24860
|
}
|
|
24800
24861
|
} else {
|
|
24801
24862
|
const textAttrs = Object.assign(Object.assign({
|
|
24802
|
-
text: text,
|
|
24863
|
+
text: isObject$4(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
24803
24864
|
visible: isValid$1(text) && !1 !== visible,
|
|
24804
24865
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
24805
24866
|
}, textStyle), {
|
|
@@ -24807,12 +24868,12 @@
|
|
|
24807
24868
|
y: 0
|
|
24808
24869
|
});
|
|
24809
24870
|
isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
|
|
24810
|
-
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (
|
|
24871
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme().text.fontFamily),
|
|
24811
24872
|
textWidth = textBounds.width,
|
|
24812
24873
|
textHeight = textBounds.height;
|
|
24813
24874
|
tagWidth += textWidth;
|
|
24814
|
-
const size = null !== (
|
|
24815
|
-
maxSize = isNumber$
|
|
24875
|
+
const size = null !== (_b = shape.size) && void 0 !== _b ? _b : 10,
|
|
24876
|
+
maxSize = isNumber$2(size) ? size : Math.max(size[0], size[1]);
|
|
24816
24877
|
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
24817
24878
|
const {
|
|
24818
24879
|
textAlign: textAlign,
|
|
@@ -24820,11 +24881,21 @@
|
|
|
24820
24881
|
} = textStyle;
|
|
24821
24882
|
(isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
|
|
24822
24883
|
let x = 0,
|
|
24823
|
-
y = 0
|
|
24824
|
-
|
|
24825
|
-
|
|
24826
|
-
|
|
24827
|
-
|
|
24884
|
+
y = 0,
|
|
24885
|
+
flag = 0;
|
|
24886
|
+
if ("left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)), textAlwaysCenter && flag) {
|
|
24887
|
+
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
24888
|
+
tsWidth = textWidth + symbolPlaceWidth,
|
|
24889
|
+
textX = (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2,
|
|
24890
|
+
symbolX = (containerWidth - tsWidth) / 2 + maxSize / 2;
|
|
24891
|
+
textShape.setAttributes({
|
|
24892
|
+
x: textX * flag,
|
|
24893
|
+
textAlign: "center"
|
|
24894
|
+
}), null == symbol || symbol.setAttributes({
|
|
24895
|
+
x: symbolX * flag
|
|
24896
|
+
}), group.setAttribute("x", parsedPadding[2 + flag] * flag);
|
|
24897
|
+
}
|
|
24898
|
+
"middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
|
|
24828
24899
|
const {
|
|
24829
24900
|
visible: bgVisible
|
|
24830
24901
|
} = panel,
|
|
@@ -25314,7 +25385,7 @@
|
|
|
25314
25385
|
}
|
|
25315
25386
|
points.forEach((point, index) => {
|
|
25316
25387
|
var _a, _b;
|
|
25317
|
-
const line = graphicCreator.line(Object.assign(Object.assign({
|
|
25388
|
+
const line = graphicCreator$1.line(Object.assign(Object.assign({
|
|
25318
25389
|
points: point
|
|
25319
25390
|
}, isArray$1(lineStyle) ? null !== (_a = lineStyle[index]) && void 0 !== _a ? _a : lineStyle[lineStyle.length - 1] : lineStyle), {
|
|
25320
25391
|
fill: !1
|
|
@@ -25322,7 +25393,7 @@
|
|
|
25322
25393
|
line.name = `${this.name}-line`, line.id = this._getNodeId("line" + index), isEmpty(null == state ? void 0 : state.line) || (line.states = isArray$1(state.line) ? null !== (_b = state.line[index]) && void 0 !== _b ? _b : state.line[state.line.length - 1] : state.line), this.add(line);
|
|
25323
25394
|
});
|
|
25324
25395
|
} else {
|
|
25325
|
-
const line = graphicCreator.polygon(Object.assign(Object.assign({
|
|
25396
|
+
const line = graphicCreator$1.polygon(Object.assign(Object.assign({
|
|
25326
25397
|
points: this._clipPoints(this.attribute.points)
|
|
25327
25398
|
}, array$1(lineStyle)[0]), {
|
|
25328
25399
|
fill: !1,
|
|
@@ -25361,7 +25432,7 @@
|
|
|
25361
25432
|
}, rotate = startAngle + Math.PI / 2) : (position = {
|
|
25362
25433
|
x: end.x + (isValidNumber$1(endAngle) ? refX * Math.cos(endAngle) + refY * Math.cos(endAngle - Math.PI / 2) : 0),
|
|
25363
25434
|
y: end.y + (isValidNumber$1(endAngle) ? refX * Math.sin(endAngle) + refY * Math.sin(endAngle - Math.PI / 2) : 0)
|
|
25364
|
-
}, rotate = endAngle + Math.PI / 2), symbol = graphicCreator.symbol(Object.assign(Object.assign(Object.assign({}, position), {
|
|
25435
|
+
}, rotate = endAngle + Math.PI / 2), symbol = graphicCreator$1.symbol(Object.assign(Object.assign(Object.assign({}, position), {
|
|
25365
25436
|
symbolType: symbolType,
|
|
25366
25437
|
size: size,
|
|
25367
25438
|
angle: autoRotate ? rotate + refAngle : 0,
|
|
@@ -25554,14 +25625,14 @@
|
|
|
25554
25625
|
getBoundsWithoutRender(attributes) {
|
|
25555
25626
|
const currentAttribute = cloneDeep(this.attribute);
|
|
25556
25627
|
merge(this.attribute, attributes);
|
|
25557
|
-
const offscreenGroup = graphicCreator.group({
|
|
25628
|
+
const offscreenGroup = graphicCreator$1.group({
|
|
25558
25629
|
x: this.attribute.x,
|
|
25559
25630
|
y: this.attribute.y
|
|
25560
25631
|
});
|
|
25561
25632
|
return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
|
|
25562
25633
|
}
|
|
25563
25634
|
render() {
|
|
25564
|
-
this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
25635
|
+
this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator$1.group({
|
|
25565
25636
|
x: 0,
|
|
25566
25637
|
y: 0,
|
|
25567
25638
|
pickable: !1
|
|
@@ -25583,13 +25654,13 @@
|
|
|
25583
25654
|
line: line,
|
|
25584
25655
|
items: items
|
|
25585
25656
|
} = this.attribute,
|
|
25586
|
-
axisContainer = graphicCreator.group({
|
|
25657
|
+
axisContainer = graphicCreator$1.group({
|
|
25587
25658
|
x: 0,
|
|
25588
25659
|
y: 0,
|
|
25589
25660
|
zIndex: 1
|
|
25590
25661
|
});
|
|
25591
25662
|
if (axisContainer.name = AXIS_ELEMENT_NAME.axisContainer, axisContainer.id = this._getNodeId("container"), axisContainer.setMode(this.mode), this.axisContainer = axisContainer, container.add(axisContainer), line && line.visible && this.renderLine(axisContainer), items && items.length && (this.data = this._transformItems(items[0]), tick && tick.visible && this.renderTicks(axisContainer), label && label.visible)) {
|
|
25592
|
-
const labelGroup = graphicCreator.group({
|
|
25663
|
+
const labelGroup = graphicCreator$1.group({
|
|
25593
25664
|
x: 0,
|
|
25594
25665
|
y: 0,
|
|
25595
25666
|
pickable: !1
|
|
@@ -25622,14 +25693,14 @@
|
|
|
25622
25693
|
}
|
|
25623
25694
|
renderTicks(container) {
|
|
25624
25695
|
const tickLineItems = this.getTickLineItems(),
|
|
25625
|
-
tickLineGroup = graphicCreator.group({
|
|
25696
|
+
tickLineGroup = graphicCreator$1.group({
|
|
25626
25697
|
x: 0,
|
|
25627
25698
|
y: 0,
|
|
25628
25699
|
pickable: !1
|
|
25629
25700
|
});
|
|
25630
25701
|
tickLineGroup.name = AXIS_ELEMENT_NAME.tickContainer, tickLineGroup.id = this._getNodeId("tick-container"), container.add(tickLineGroup), tickLineItems.forEach((item, index) => {
|
|
25631
25702
|
var _a;
|
|
25632
|
-
const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
|
|
25703
|
+
const line = graphicCreator$1.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
|
|
25633
25704
|
if (line.name = AXIS_ELEMENT_NAME.tick, line.id = this._getNodeId(item.id), isEmpty(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.state)) line.states = DEFAULT_STATES$2;else {
|
|
25634
25705
|
const data = this.data[index],
|
|
25635
25706
|
tickLineState = merge({}, DEFAULT_STATES$2, this.attribute.tick.state);
|
|
@@ -25645,7 +25716,7 @@
|
|
|
25645
25716
|
if (subTick && subTick.visible) {
|
|
25646
25717
|
const subTickLineItems = this.getSubTickLineItems();
|
|
25647
25718
|
subTickLineItems.length && subTickLineItems.forEach((item, index) => {
|
|
25648
|
-
const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
|
|
25719
|
+
const line = graphicCreator$1.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
|
|
25649
25720
|
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
|
|
25650
25721
|
const subTickLineState = merge({}, DEFAULT_STATES$2, subTick.state);
|
|
25651
25722
|
Object.keys(subTickLineState).forEach(key => {
|
|
@@ -25662,18 +25733,16 @@
|
|
|
25662
25733
|
} = this.attribute.label;
|
|
25663
25734
|
dataFilter && isFunction$1(dataFilter) && (items = dataFilter(items, layer));
|
|
25664
25735
|
const data = this._transformItems(items),
|
|
25665
|
-
labelGroup = graphicCreator.group({
|
|
25736
|
+
labelGroup = graphicCreator$1.group({
|
|
25666
25737
|
x: 0,
|
|
25667
25738
|
y: 0,
|
|
25668
25739
|
pickable: !1
|
|
25669
25740
|
});
|
|
25670
25741
|
return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
|
|
25671
|
-
var _a
|
|
25742
|
+
var _a;
|
|
25672
25743
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
25673
25744
|
let text;
|
|
25674
|
-
if (
|
|
25675
|
-
dom: labelStyle.text
|
|
25676
|
-
}, DEFAULT_HTML_TEXT_SPEC), labelStyle), text = graphicCreator.richtext(labelStyle)) : text = graphicCreator.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_c = this.attribute.label) || void 0 === _c ? void 0 : _c.state)) text.states = DEFAULT_STATES$2;else {
|
|
25745
|
+
if (text = isRichText(labelStyle) ? graphicCreator$1.richtext(richTextAttributeTransform(labelStyle)) : graphicCreator$1.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.state)) text.states = DEFAULT_STATES$2;else {
|
|
25677
25746
|
const labelState = merge({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
25678
25747
|
Object.keys(labelState).forEach(key => {
|
|
25679
25748
|
isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
@@ -26129,7 +26198,7 @@
|
|
|
26129
26198
|
if (panel && panel.visible) {
|
|
26130
26199
|
const axisContainer = this.axisContainer,
|
|
26131
26200
|
axisContainerBounds = axisContainer.AABBBounds,
|
|
26132
|
-
bgRect = graphicCreator.rect(Object.assign({
|
|
26201
|
+
bgRect = graphicCreator$1.rect(Object.assign({
|
|
26133
26202
|
x: axisContainerBounds.x1,
|
|
26134
26203
|
y: axisContainerBounds.y1,
|
|
26135
26204
|
width: axisContainerBounds.width(),
|
|
@@ -26386,7 +26455,7 @@
|
|
|
26386
26455
|
const minSize = this._getAxisLabelLimitLength(verticalMinSize, layerCount);
|
|
26387
26456
|
let x, y;
|
|
26388
26457
|
axisLabelContainerSize = Math.max(axisLabelContainerSize, minSize), "left" === orient ? (x = axisLabelContainerBounds.x2 - axisLabelContainerSize, y = axisLabelContainerBounds.y1) : "right" === orient ? (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y1) : "top" === orient ? (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y2 - axisLabelContainerSize) : "bottom" === orient && (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y1);
|
|
26389
|
-
const bgRect = graphicCreator.rect({
|
|
26458
|
+
const bgRect = graphicCreator$1.rect({
|
|
26390
26459
|
x: x,
|
|
26391
26460
|
y: y,
|
|
26392
26461
|
width: isHorizontal ? axisLabelContainerBounds.width() : axisLabelContainerSize,
|
|
@@ -26491,7 +26560,7 @@
|
|
|
26491
26560
|
this._current = defaultCurrent;
|
|
26492
26561
|
const parsedPadding = normalizePadding(padding),
|
|
26493
26562
|
isHorizontal = "horizontal" === layout,
|
|
26494
|
-
container = graphicCreator.group({
|
|
26563
|
+
container = graphicCreator$1.group({
|
|
26495
26564
|
x: 0,
|
|
26496
26565
|
y: 0
|
|
26497
26566
|
}),
|
|
@@ -26504,7 +26573,7 @@
|
|
|
26504
26573
|
nextShape: nextShape
|
|
26505
26574
|
} = handler;
|
|
26506
26575
|
preShape || (preShape = isHorizontal ? "triangleLeft" : "triangleUp"), nextShape || (nextShape = isHorizontal ? "triangleRight" : "triangleDown");
|
|
26507
|
-
const preHandler = graphicCreator.symbol(Object.assign(Object.assign({
|
|
26576
|
+
const preHandler = graphicCreator$1.symbol(Object.assign(Object.assign({
|
|
26508
26577
|
strokeBoundsBuffer: 0,
|
|
26509
26578
|
pickMode: "imprecise"
|
|
26510
26579
|
}, handlerStyle), {
|
|
@@ -26521,9 +26590,9 @@
|
|
|
26521
26590
|
textAlign: "center",
|
|
26522
26591
|
textBaseline: "middle"
|
|
26523
26592
|
}, textStyle), null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme().text.fontFamily),
|
|
26524
|
-
handlerSizeX = isNumber$
|
|
26525
|
-
handlerSizeY = isNumber$
|
|
26526
|
-
text = graphicCreator.text(Object.assign({
|
|
26593
|
+
handlerSizeX = isNumber$2(handlerSize) ? handlerSize : handlerSize[0],
|
|
26594
|
+
handlerSizeY = isNumber$2(handlerSize) ? handlerSize : handlerSize[1],
|
|
26595
|
+
text = graphicCreator$1.text(Object.assign({
|
|
26527
26596
|
x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
|
|
26528
26597
|
y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
|
|
26529
26598
|
text: `${defaultCurrent}/${total}`,
|
|
@@ -26532,7 +26601,7 @@
|
|
|
26532
26601
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
26533
26602
|
}, textStyle));
|
|
26534
26603
|
this.text = text, container.add(text);
|
|
26535
|
-
const nextHandler = graphicCreator.symbol(Object.assign(Object.assign({
|
|
26604
|
+
const nextHandler = graphicCreator$1.symbol(Object.assign(Object.assign({
|
|
26536
26605
|
strokeBoundsBuffer: 0,
|
|
26537
26606
|
pickMode: "imprecise"
|
|
26538
26607
|
}, handlerStyle), {
|
|
@@ -26595,7 +26664,7 @@
|
|
|
26595
26664
|
padding = 0
|
|
26596
26665
|
} = this.attribute,
|
|
26597
26666
|
parsedPadding = normalizePadding(padding),
|
|
26598
|
-
innerView = graphicCreator.group({
|
|
26667
|
+
innerView = graphicCreator$1.group({
|
|
26599
26668
|
x: parsedPadding[3],
|
|
26600
26669
|
y: parsedPadding[0],
|
|
26601
26670
|
pickable: interactive,
|
|
@@ -26742,7 +26811,7 @@
|
|
|
26742
26811
|
if (!1 === item.visible || isEmpty(items)) return;
|
|
26743
26812
|
let legendItems = items;
|
|
26744
26813
|
reversed && (legendItems = null == items ? void 0 : items.reverse());
|
|
26745
|
-
const itemsContainer = graphicCreator.group({
|
|
26814
|
+
const itemsContainer = graphicCreator$1.group({
|
|
26746
26815
|
x: 0,
|
|
26747
26816
|
y: 0
|
|
26748
26817
|
});
|
|
@@ -26819,15 +26888,15 @@
|
|
|
26819
26888
|
backgroundStyle = this._handleStyle(background, item, isSelected, index, items),
|
|
26820
26889
|
parsedPadding = normalizePadding(padding);
|
|
26821
26890
|
let itemGroup;
|
|
26822
|
-
!1 === background.visible ? (itemGroup = graphicCreator.group({
|
|
26891
|
+
!1 === background.visible ? (itemGroup = graphicCreator$1.group({
|
|
26823
26892
|
x: 0,
|
|
26824
26893
|
y: 0,
|
|
26825
26894
|
cursor: null === (_a = backgroundStyle.style) || void 0 === _a ? void 0 : _a.cursor
|
|
26826
|
-
}), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = graphicCreator.group(Object.assign({
|
|
26895
|
+
}), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = graphicCreator$1.group(Object.assign({
|
|
26827
26896
|
x: 0,
|
|
26828
26897
|
y: 0
|
|
26829
26898
|
}, backgroundStyle.style)), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state)), itemGroup.id = `${null != id ? id : label}-${index}`, itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);
|
|
26830
|
-
const innerGroup = graphicCreator.group({
|
|
26899
|
+
const innerGroup = graphicCreator$1.group({
|
|
26831
26900
|
x: 0,
|
|
26832
26901
|
y: 0,
|
|
26833
26902
|
pickable: !1
|
|
@@ -26840,7 +26909,7 @@
|
|
|
26840
26909
|
if (shapeAttr && !1 !== shapeAttr.visible) {
|
|
26841
26910
|
const s = get$5(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
26842
26911
|
shapeSize = isArray$1(s) ? s[0] || 0 : s, shapeSpace = get$5(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
26843
|
-
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
26912
|
+
const itemShape = graphicCreator$1.symbol(Object.assign(Object.assign({
|
|
26844
26913
|
x: 0,
|
|
26845
26914
|
y: 0,
|
|
26846
26915
|
symbolType: "circle",
|
|
@@ -26851,10 +26920,11 @@
|
|
|
26851
26920
|
shape.fill && isNil$1(shapeStyle.state[key].fill) && color && (shapeStyle.state[key].fill = color), shape.stroke && isNil$1(shapeStyle.state[key].stroke) && color && (shapeStyle.state[key].stroke = color);
|
|
26852
26921
|
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
26853
26922
|
}
|
|
26854
|
-
let
|
|
26923
|
+
let labelShape,
|
|
26924
|
+
focusSpace = 0;
|
|
26855
26925
|
if (focus) {
|
|
26856
26926
|
const focusSize = get$5(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
|
|
26857
|
-
focusShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
26927
|
+
focusShape = graphicCreator$1.symbol(Object.assign(Object.assign({
|
|
26858
26928
|
x: 0,
|
|
26859
26929
|
y: -focusSize / 2 - 1,
|
|
26860
26930
|
strokeBoundsBuffer: 0
|
|
@@ -26864,29 +26934,32 @@
|
|
|
26864
26934
|
boundsPadding: parsedPadding
|
|
26865
26935
|
})), this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup), focusSpace = focusSize;
|
|
26866
26936
|
}
|
|
26867
|
-
const
|
|
26868
|
-
|
|
26869
|
-
|
|
26870
|
-
|
|
26871
|
-
|
|
26872
|
-
|
|
26873
|
-
|
|
26874
|
-
|
|
26875
|
-
|
|
26876
|
-
|
|
26937
|
+
const text = labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label,
|
|
26938
|
+
labelAttributes = Object.assign(Object.assign({
|
|
26939
|
+
x: shapeSize / 2 + shapeSpace,
|
|
26940
|
+
y: 0,
|
|
26941
|
+
textAlign: "start",
|
|
26942
|
+
textBaseline: "middle",
|
|
26943
|
+
lineHeight: null === (_b = labelStyle.style) || void 0 === _b ? void 0 : _b.fontSize
|
|
26944
|
+
}, labelStyle.style), {
|
|
26945
|
+
text: text
|
|
26946
|
+
});
|
|
26947
|
+
labelShape = isRichText(labelAttributes) ? graphicCreator$1.richtext(richTextAttributeTransform(labelAttributes)) : graphicCreator$1.text(labelAttributes), this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
26877
26948
|
const labelSpace = get$5(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
26878
26949
|
if (isValid$1(value)) {
|
|
26879
26950
|
const valueSpace = get$5(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
26880
|
-
|
|
26951
|
+
valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value,
|
|
26952
|
+
valueAttributes = Object.assign(Object.assign({
|
|
26881
26953
|
x: 0,
|
|
26882
26954
|
y: 0,
|
|
26883
26955
|
textAlign: "start",
|
|
26884
26956
|
textBaseline: "middle",
|
|
26885
26957
|
lineHeight: valueStyle.style.fontSize
|
|
26886
26958
|
}, valueStyle.style), {
|
|
26887
|
-
text:
|
|
26888
|
-
})
|
|
26889
|
-
|
|
26959
|
+
text: valueText
|
|
26960
|
+
});
|
|
26961
|
+
let valueShape;
|
|
26962
|
+
if (valueShape = isRichText(valueAttributes) ? graphicCreator$1.richtext(richTextAttributeTransform(valueAttributes)) : graphicCreator$1.text(valueAttributes), this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser) {
|
|
26890
26963
|
const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace,
|
|
26891
26964
|
valueBounds = valueShape.AABBBounds,
|
|
26892
26965
|
labelBounds = labelShape.AABBBounds,
|
|
@@ -26984,7 +27057,7 @@
|
|
|
26984
27057
|
});
|
|
26985
27058
|
}
|
|
26986
27059
|
pager.defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(pager.defaultCurrent - 1) * (pageHeight + spaceRow)) : itemsContainer.setAttribute("x", -(pager.defaultCurrent - 1) * (pageWidth + spaceCol)));
|
|
26987
|
-
const clipGroup = graphicCreator.group({
|
|
27060
|
+
const clipGroup = graphicCreator$1.group({
|
|
26988
27061
|
x: 0,
|
|
26989
27062
|
y: renderStartY,
|
|
26990
27063
|
width: pageWidth,
|
|
@@ -27566,7 +27639,7 @@
|
|
|
27566
27639
|
return this._isFixed && !!this._bandwidth;
|
|
27567
27640
|
}
|
|
27568
27641
|
_isBandwidthFixedByUser() {
|
|
27569
|
-
return this._isFixed && this._userBandwidth && isNumber$
|
|
27642
|
+
return this._isFixed && this._userBandwidth && isNumber$2(this._userBandwidth);
|
|
27570
27643
|
}
|
|
27571
27644
|
clone() {
|
|
27572
27645
|
var _a, _b, _c;
|
|
@@ -27834,13 +27907,13 @@
|
|
|
27834
27907
|
}
|
|
27835
27908
|
}
|
|
27836
27909
|
function parseNiceOptions(originalDomain, option) {
|
|
27837
|
-
const hasForceMin = isNumber$
|
|
27838
|
-
hasForceMax = isNumber$
|
|
27910
|
+
const hasForceMin = isNumber$2(option.forceMin),
|
|
27911
|
+
hasForceMax = isNumber$2(option.forceMax);
|
|
27839
27912
|
let niceType = null;
|
|
27840
27913
|
const niceMinMax = [];
|
|
27841
27914
|
let niceDomain = null;
|
|
27842
27915
|
const domainValidator = hasForceMin && hasForceMax ? x => x >= option.forceMin && x <= option.forceMax : hasForceMin ? x => x >= option.forceMin : hasForceMax ? x => x <= option.forceMax : null;
|
|
27843
|
-
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$
|
|
27916
|
+
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$2(option.min) && option.min <= Math.min(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[0] = option.min), hasForceMax ? niceMinMax[1] = option.forceMax : isNumber$2(option.max) && option.max >= Math.max(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[1] = option.max), isNumber$2(niceMinMax[0]) && isNumber$2(niceMinMax[1]) ? (niceDomain = originalDomain.slice(), niceDomain[0] = niceMinMax[0], niceDomain[niceDomain.length - 1] = niceMinMax[1]) : niceType = isNumber$2(niceMinMax[0]) || isNumber$2(niceMinMax[1]) ? isNumber$2(niceMinMax[0]) ? "max" : "min" : "all", {
|
|
27844
27917
|
niceType: niceType,
|
|
27845
27918
|
niceDomain: niceDomain,
|
|
27846
27919
|
niceMinMax: niceMinMax,
|
|
@@ -27848,6 +27921,30 @@
|
|
|
27848
27921
|
};
|
|
27849
27922
|
}
|
|
27850
27923
|
const fixPrecision = (start, stop, value) => Math.abs(stop - start) < 1 ? +value.toFixed(1) : Math.round(+value);
|
|
27924
|
+
const d3TicksForLog = memoize((start, stop, count, base, transformer, untransformer, options) => {
|
|
27925
|
+
let u = start,
|
|
27926
|
+
v = stop;
|
|
27927
|
+
const r = v < u;
|
|
27928
|
+
r && ([u, v] = [v, u]);
|
|
27929
|
+
let k,
|
|
27930
|
+
t,
|
|
27931
|
+
i = transformer(u),
|
|
27932
|
+
j = transformer(v),
|
|
27933
|
+
z = [];
|
|
27934
|
+
if (!(base % 1) && j - i < count) {
|
|
27935
|
+
if (i = Math.floor(i), j = Math.ceil(j), u > 0) {
|
|
27936
|
+
for (; i <= j; ++i) for (k = 1; k < base; ++k) if (t = i < 0 ? k / untransformer(-i) : k * untransformer(i), !(t < u)) {
|
|
27937
|
+
if (t > v) break;
|
|
27938
|
+
z.push(t);
|
|
27939
|
+
}
|
|
27940
|
+
} else for (; i <= j; ++i) for (k = base - 1; k >= 1; --k) if (t = i > 0 ? k / untransformer(-i) : k * untransformer(i), !(t < u)) {
|
|
27941
|
+
if (t > v) break;
|
|
27942
|
+
z.push(t);
|
|
27943
|
+
}
|
|
27944
|
+
2 * z.length < count && (z = ticks$1(u, v, count));
|
|
27945
|
+
} else z = ticks$1(i, j, Math.min(j - i, count)).map(untransformer);
|
|
27946
|
+
return z = z.filter(t => 0 !== t), (null == options ? void 0 : options.noDecimals) && (z = Array.from(new Set(z.map(t => Math.floor(t))))), r ? z.reverse() : z;
|
|
27947
|
+
});
|
|
27851
27948
|
const ticksBaseTransform = memoize((start, stop, count, base, transformer, untransformer) => {
|
|
27852
27949
|
const ticksResult = [],
|
|
27853
27950
|
ticksMap = {},
|
|
@@ -27986,29 +28083,11 @@
|
|
|
27986
28083
|
}
|
|
27987
28084
|
d3Ticks() {
|
|
27988
28085
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
27989
|
-
|
|
27990
|
-
|
|
28086
|
+
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
28087
|
+
const d = this.domain(),
|
|
28088
|
+
u = this._limit(d[0]),
|
|
27991
28089
|
v = this._limit(d[d.length - 1]);
|
|
27992
|
-
|
|
27993
|
-
r && ([u, v] = [v, u]);
|
|
27994
|
-
let k,
|
|
27995
|
-
t,
|
|
27996
|
-
i = this._logs(u),
|
|
27997
|
-
j = this._logs(v),
|
|
27998
|
-
z = [];
|
|
27999
|
-
if (!(this._base % 1) && j - i < count) {
|
|
28000
|
-
if (i = Math.floor(i), j = Math.ceil(j), u > 0) {
|
|
28001
|
-
for (; i <= j; ++i) for (k = 1; k < this._base; ++k) if (t = i < 0 ? k / this._pows(-i) : k * this._pows(i), !(t < u)) {
|
|
28002
|
-
if (t > v) break;
|
|
28003
|
-
z.push(t);
|
|
28004
|
-
}
|
|
28005
|
-
} else for (; i <= j; ++i) for (k = this._base - 1; k >= 1; --k) if (t = i > 0 ? k / this._pows(-i) : k * this._pows(i), !(t < u)) {
|
|
28006
|
-
if (t > v) break;
|
|
28007
|
-
z.push(t);
|
|
28008
|
-
}
|
|
28009
|
-
2 * z.length < count && (z = ticks$1(u, v, count));
|
|
28010
|
-
} else z = ticks$1(i, j, Math.min(j - i, count)).map(this._pows);
|
|
28011
|
-
return z = z.filter(t => 0 !== t), r ? z.reverse() : z;
|
|
28090
|
+
return d3TicksForLog(u, v, count, this._base, this.transformer, this.untransformer, options);
|
|
28012
28091
|
}
|
|
28013
28092
|
ticks() {
|
|
28014
28093
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
@@ -28073,6 +28152,14 @@
|
|
|
28073
28152
|
constant(_, slience) {
|
|
28074
28153
|
return arguments.length ? (this._const = _, this.transformer = symlog(_), this.untransformer = symexp(_), this.rescale(slience)) : this._const;
|
|
28075
28154
|
}
|
|
28155
|
+
d3Ticks() {
|
|
28156
|
+
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
28157
|
+
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
28158
|
+
const d = this.domain(),
|
|
28159
|
+
u = d[0],
|
|
28160
|
+
v = d[d.length - 1];
|
|
28161
|
+
return d3TicksForLog(u, v, count, this._const, this.transformer, this.untransformer, options);
|
|
28162
|
+
}
|
|
28076
28163
|
ticks() {
|
|
28077
28164
|
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
28078
28165
|
const d = this.calculateVisibleDomain(this._range);
|
|
@@ -28289,7 +28376,7 @@
|
|
|
28289
28376
|
};
|
|
28290
28377
|
const isHorizontal = "horizontal" === layout;
|
|
28291
28378
|
this._isHorizontal = isHorizontal;
|
|
28292
|
-
const innerView = graphicCreator.group({
|
|
28379
|
+
const innerView = graphicCreator$1.group({
|
|
28293
28380
|
x: 0,
|
|
28294
28381
|
y: 0
|
|
28295
28382
|
});
|
|
@@ -28297,7 +28384,7 @@
|
|
|
28297
28384
|
let startTextShape,
|
|
28298
28385
|
startLen = 0;
|
|
28299
28386
|
if (startText && startText.visible) {
|
|
28300
|
-
startTextShape = graphicCreator.text(Object.assign({
|
|
28387
|
+
startTextShape = graphicCreator$1.text(Object.assign({
|
|
28301
28388
|
x: isHorizontal ? 0 : railWidth / 2,
|
|
28302
28389
|
y: isHorizontal ? railHeight / 2 : 0,
|
|
28303
28390
|
textAlign: isHorizontal ? "start" : "center",
|
|
@@ -28308,19 +28395,19 @@
|
|
|
28308
28395
|
const space = isValid$1(startText.space) ? startText.space : 0;
|
|
28309
28396
|
startLen += (isHorizontal ? startTextShape.AABBBounds.width() : startTextShape.AABBBounds.height()) + space;
|
|
28310
28397
|
}
|
|
28311
|
-
const mainContainer = graphicCreator.group({
|
|
28398
|
+
const mainContainer = graphicCreator$1.group({
|
|
28312
28399
|
x: isHorizontal ? startLen : 0,
|
|
28313
28400
|
y: isHorizontal ? 0 : startLen
|
|
28314
28401
|
});
|
|
28315
28402
|
innerView.add(mainContainer);
|
|
28316
|
-
const railContainer = graphicCreator.group({
|
|
28403
|
+
const railContainer = graphicCreator$1.group({
|
|
28317
28404
|
x: 0,
|
|
28318
28405
|
y: 0
|
|
28319
28406
|
});
|
|
28320
28407
|
let endTextShape;
|
|
28321
28408
|
if (railContainer.name = SLIDER_ELEMENT_NAME.railContainer, this._railContainer = railContainer, mainContainer.add(railContainer), this._renderRail(railContainer), startLen += isHorizontal ? railWidth : railHeight, endText && endText.visible) {
|
|
28322
28409
|
const space = isValid$1(endText.space) ? endText.space : 0;
|
|
28323
|
-
endTextShape = graphicCreator.text(Object.assign({
|
|
28410
|
+
endTextShape = graphicCreator$1.text(Object.assign({
|
|
28324
28411
|
x: isHorizontal ? startLen + space : railWidth / 2,
|
|
28325
28412
|
y: isHorizontal ? railHeight / 2 : startLen + space,
|
|
28326
28413
|
textAlign: isHorizontal ? "start" : "center",
|
|
@@ -28340,7 +28427,7 @@
|
|
|
28340
28427
|
} = this.attribute;
|
|
28341
28428
|
let cursor = "default";
|
|
28342
28429
|
!1 !== slidable && (cursor = "pointer");
|
|
28343
|
-
const railShape = graphicCreator.rect(Object.assign({
|
|
28430
|
+
const railShape = graphicCreator$1.rect(Object.assign({
|
|
28344
28431
|
x: 0,
|
|
28345
28432
|
y: 0,
|
|
28346
28433
|
width: railWidth,
|
|
@@ -28416,7 +28503,7 @@
|
|
|
28416
28503
|
const isHorizontal = this._isHorizontal,
|
|
28417
28504
|
railLen = isHorizontal ? railWidth : railHeight;
|
|
28418
28505
|
range || (startValue = min);
|
|
28419
|
-
const trackContainer = graphicCreator.group({
|
|
28506
|
+
const trackContainer = graphicCreator$1.group({
|
|
28420
28507
|
x: 0,
|
|
28421
28508
|
y: 0,
|
|
28422
28509
|
width: railWidth,
|
|
@@ -28431,7 +28518,7 @@
|
|
|
28431
28518
|
cursor = !1 === slidable ? "default" : !1 === range || !1 === draggableTrack ? "pointer" : getDefaultCursor(isHorizontal);
|
|
28432
28519
|
const trackWidth = max === min ? railLen : (endValue - startValue) / (max - min) * railLen,
|
|
28433
28520
|
startPos = max === min ? 0 : (startValue - min) / (max - min) * railLen,
|
|
28434
|
-
track = graphicCreator.rect(Object.assign({
|
|
28521
|
+
track = graphicCreator$1.rect(Object.assign({
|
|
28435
28522
|
x: isHorizontal ? startPos : 0,
|
|
28436
28523
|
y: isHorizontal ? 0 : startPos,
|
|
28437
28524
|
width: isHorizontal ? trackWidth : railWidth,
|
|
@@ -28441,7 +28528,7 @@
|
|
|
28441
28528
|
track.name = SLIDER_ELEMENT_NAME.track, this._track = track, trackContainer.add(track), container.add(trackContainer);
|
|
28442
28529
|
}
|
|
28443
28530
|
_renderHandler(style) {
|
|
28444
|
-
return graphicCreator.symbol(style);
|
|
28531
|
+
return graphicCreator$1.symbol(style);
|
|
28445
28532
|
}
|
|
28446
28533
|
_renderHandlerText(value, position) {
|
|
28447
28534
|
var _a, _b, _c;
|
|
@@ -28465,7 +28552,7 @@
|
|
|
28465
28552
|
cursor: !1 === slidable ? "default" : getDefaultCursor(isHorizontal)
|
|
28466
28553
|
};
|
|
28467
28554
|
isHorizontal ? "top" === align ? (textStyle.textBaseline = "bottom", textStyle.textAlign = "center", textStyle.x = handlerStart, textStyle.y = (railHeight - handlerSize) / 2 - textSpace) : (textStyle.textBaseline = "top", textStyle.textAlign = "center", textStyle.x = handlerStart, textStyle.y = (railHeight + handlerSize) / 2 + textSpace) : "left" === align ? (textStyle.textBaseline = "middle", textStyle.textAlign = "end", textStyle.x = (railWidth - handlerSize) / 2 - textSpace, textStyle.y = handlerStart) : (textStyle.textBaseline = "middle", textStyle.textAlign = "start", textStyle.x = (railWidth + handlerSize) / 2 + textSpace, textStyle.y = handlerStart);
|
|
28468
|
-
return graphicCreator.text(Object.assign(Object.assign({}, textStyle), handlerText.style));
|
|
28555
|
+
return graphicCreator$1.text(Object.assign(Object.assign({}, textStyle), handlerText.style));
|
|
28469
28556
|
}
|
|
28470
28557
|
_bindEvents() {
|
|
28471
28558
|
if (this.attribute.disableTriggerEvent) return;
|
|
@@ -28808,7 +28895,7 @@
|
|
|
28808
28895
|
sizeBackground: sizeBackground,
|
|
28809
28896
|
disableTriggerEvent: disableTriggerEvent
|
|
28810
28897
|
} = this.attribute,
|
|
28811
|
-
mainContainer = graphicCreator.group({
|
|
28898
|
+
mainContainer = graphicCreator$1.group({
|
|
28812
28899
|
x: 0,
|
|
28813
28900
|
y: 0
|
|
28814
28901
|
});
|
|
@@ -28846,7 +28933,7 @@
|
|
|
28846
28933
|
let path,
|
|
28847
28934
|
start = 0;
|
|
28848
28935
|
"horizontal" === layout ? "top" === align ? (path = `M0,0L${railWidth},0L${railWidth},12Z`, start = railHeight) : (path = `M0,12L${railWidth},12L${railWidth},0Z`, slider.setAttribute("y", 12)) : "left" === align ? path = `M${railWidth},0L${railWidth},0L${railWidth + 12},${railHeight}L${railWidth},${railHeight}Z` : (path = `M0,${railHeight}L12,${railHeight}L12,0Z`, slider.setAttribute("x", 12));
|
|
28849
|
-
const background = graphicCreator.path(Object.assign(Object.assign({
|
|
28936
|
+
const background = graphicCreator$1.path(Object.assign(Object.assign({
|
|
28850
28937
|
x: 0,
|
|
28851
28938
|
y: start,
|
|
28852
28939
|
path: path
|
|
@@ -29777,6 +29864,25 @@
|
|
|
29777
29864
|
|
|
29778
29865
|
const DEFAULT_CONTINUOUS_TICK_COUNT$1 = 5;
|
|
29779
29866
|
|
|
29867
|
+
class GraphicCreator {
|
|
29868
|
+
constructor() {
|
|
29869
|
+
this.store = new Map();
|
|
29870
|
+
}
|
|
29871
|
+
RegisterGraphicCreator(name, cb) {
|
|
29872
|
+
this.store.set(name, cb), this[name] = cb;
|
|
29873
|
+
}
|
|
29874
|
+
CreateGraphic(name, params) {
|
|
29875
|
+
const cb = this.store.get(name);
|
|
29876
|
+
return cb ? cb(params) : null;
|
|
29877
|
+
}
|
|
29878
|
+
}
|
|
29879
|
+
const graphicCreator = new GraphicCreator();
|
|
29880
|
+
|
|
29881
|
+
let text;
|
|
29882
|
+
function getTextBounds(params) {
|
|
29883
|
+
return text || (text = graphicCreator.CreateGraphic("text", {})), text.initAttributes(params), text.AABBBounds;
|
|
29884
|
+
}
|
|
29885
|
+
|
|
29780
29886
|
const initTextMeasure$1 = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure(Object.assign({
|
|
29781
29887
|
defaultFontParams: Object.assign({
|
|
29782
29888
|
fontFamily: "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",
|
|
@@ -31635,7 +31741,7 @@
|
|
|
31635
31741
|
}
|
|
31636
31742
|
|
|
31637
31743
|
function getQuadProps(paddingOrigin) {
|
|
31638
|
-
if (isNumber$
|
|
31744
|
+
if (isNumber$2(paddingOrigin) || isString$2(paddingOrigin) || isArray$1(paddingOrigin)) {
|
|
31639
31745
|
let padding = parsePadding(paddingOrigin);
|
|
31640
31746
|
if (typeof padding === 'number' || typeof padding === 'string') {
|
|
31641
31747
|
padding = [padding, padding, padding, padding];
|
|
@@ -31901,7 +32007,7 @@
|
|
|
31901
32007
|
if (isNil$1(v)) {
|
|
31902
32008
|
return false;
|
|
31903
32009
|
}
|
|
31904
|
-
if (isNumber$
|
|
32010
|
+
if (isNumber$2(v)) {
|
|
31905
32011
|
return true;
|
|
31906
32012
|
}
|
|
31907
32013
|
return +v === +v;
|
|
@@ -32867,6 +32973,16 @@
|
|
|
32867
32973
|
cursor: 'pointer'
|
|
32868
32974
|
};
|
|
32869
32975
|
},
|
|
32976
|
+
get loading_pic() {
|
|
32977
|
+
return {
|
|
32978
|
+
type: 'svg',
|
|
32979
|
+
svg: '<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',
|
|
32980
|
+
width: 400,
|
|
32981
|
+
height: 300,
|
|
32982
|
+
name: 'loading_pic',
|
|
32983
|
+
positionType: IconPosition.left
|
|
32984
|
+
};
|
|
32985
|
+
},
|
|
32870
32986
|
get expand() {
|
|
32871
32987
|
return {
|
|
32872
32988
|
type: 'svg',
|
|
@@ -32939,15 +33055,21 @@
|
|
|
32939
33055
|
}
|
|
32940
33056
|
|
|
32941
33057
|
function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
|
|
32942
|
-
|
|
32943
|
-
|
|
32944
|
-
|
|
32945
|
-
|
|
32946
|
-
|
|
33058
|
+
const rectWidth = width;
|
|
33059
|
+
const rectHeight = height;
|
|
33060
|
+
const containerWidth = maxWidth;
|
|
33061
|
+
const containerHeight = maxHeight;
|
|
33062
|
+
const containerRatio = containerWidth / containerHeight;
|
|
33063
|
+
const rectRatio = rectWidth / rectHeight;
|
|
33064
|
+
let newWidth;
|
|
33065
|
+
let newHeight;
|
|
33066
|
+
if (rectRatio > containerRatio) {
|
|
33067
|
+
newWidth = containerWidth;
|
|
33068
|
+
newHeight = newWidth / rectRatio;
|
|
32947
33069
|
}
|
|
32948
|
-
|
|
32949
|
-
newHeight =
|
|
32950
|
-
newWidth =
|
|
33070
|
+
else {
|
|
33071
|
+
newHeight = containerHeight;
|
|
33072
|
+
newWidth = newHeight * rectRatio;
|
|
32951
33073
|
}
|
|
32952
33074
|
return {
|
|
32953
33075
|
width: newWidth,
|
|
@@ -32975,7 +33097,6 @@
|
|
|
32975
33097
|
return { x, y };
|
|
32976
33098
|
}
|
|
32977
33099
|
|
|
32978
|
-
get$1();
|
|
32979
33100
|
function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
|
|
32980
33101
|
const headerStyle = table._getCellStyle(col, row);
|
|
32981
33102
|
const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
|
|
@@ -33019,31 +33140,29 @@
|
|
|
33019
33140
|
image.name = 'image';
|
|
33020
33141
|
image.keepAspectRatio = keepAspectRatio;
|
|
33021
33142
|
if (keepAspectRatio || imageAutoSizing) {
|
|
33022
|
-
image.
|
|
33023
|
-
|
|
33024
|
-
|
|
33025
|
-
|
|
33026
|
-
|
|
33027
|
-
|
|
33028
|
-
|
|
33029
|
-
|
|
33030
|
-
|
|
33031
|
-
|
|
33032
|
-
|
|
33033
|
-
y: pos.y,
|
|
33034
|
-
width: imageWidth,
|
|
33035
|
-
height: imageHeight,
|
|
33036
|
-
dx: isMerge ? -table.getColsWidth(cellGroup.mergeStartCol, col - 1) : 0,
|
|
33037
|
-
dy: isMerge ? -table.getRowsHeight(cellGroup.mergeStartRow, row - 1) : 0
|
|
33038
|
-
});
|
|
33039
|
-
}
|
|
33040
|
-
table.scenegraph.updateNextFrame();
|
|
33041
|
-
};
|
|
33143
|
+
if (image.resources &&
|
|
33144
|
+
image.resources.has(image.attribute.image) &&
|
|
33145
|
+
image.resources.get(image.attribute.image).state === 'success') {
|
|
33146
|
+
updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
|
|
33147
|
+
}
|
|
33148
|
+
else {
|
|
33149
|
+
image.successCallback = () => {
|
|
33150
|
+
updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
|
|
33151
|
+
table.scenegraph.updateNextFrame();
|
|
33152
|
+
};
|
|
33153
|
+
}
|
|
33042
33154
|
}
|
|
33043
33155
|
else {
|
|
33044
|
-
image.
|
|
33156
|
+
if (image.resources &&
|
|
33157
|
+
image.resources.has(image.attribute.image) &&
|
|
33158
|
+
image.resources.get(image.attribute.image).state === 'success') {
|
|
33045
33159
|
updateImageCellContentWhileResize(cellGroup, col, row, table);
|
|
33046
|
-
}
|
|
33160
|
+
}
|
|
33161
|
+
else {
|
|
33162
|
+
image.successCallback = () => {
|
|
33163
|
+
updateImageCellContentWhileResize(cellGroup, col, row, table);
|
|
33164
|
+
};
|
|
33165
|
+
}
|
|
33047
33166
|
}
|
|
33048
33167
|
image.failCallback = () => {
|
|
33049
33168
|
const regedIcons = get$1();
|
|
@@ -33156,6 +33275,47 @@
|
|
|
33156
33275
|
isMerge: false
|
|
33157
33276
|
};
|
|
33158
33277
|
}
|
|
33278
|
+
function updateImageDxDy(startCol, endCol, startRow, endRow, table) {
|
|
33279
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
33280
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
33281
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
33282
|
+
if (cellGroup) {
|
|
33283
|
+
const image = cellGroup.getChildByName('image');
|
|
33284
|
+
if (image) {
|
|
33285
|
+
image.setAttributes({
|
|
33286
|
+
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
33287
|
+
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
33288
|
+
});
|
|
33289
|
+
}
|
|
33290
|
+
}
|
|
33291
|
+
}
|
|
33292
|
+
}
|
|
33293
|
+
}
|
|
33294
|
+
function updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table) {
|
|
33295
|
+
const originImage = image.resources.get(image.attribute.image).data;
|
|
33296
|
+
const { col, row } = cellGroup;
|
|
33297
|
+
if (imageAutoSizing && !isDamagePic(image)) {
|
|
33298
|
+
_adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
|
|
33299
|
+
}
|
|
33300
|
+
if (keepAspectRatio || isDamagePic(image)) {
|
|
33301
|
+
const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
|
|
33302
|
+
const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellWidth - padding[1] - padding[3], cellHeight - padding[0] - padding[2]);
|
|
33303
|
+
const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
|
|
33304
|
+
image.setAttributes({
|
|
33305
|
+
x: pos.x,
|
|
33306
|
+
y: pos.y,
|
|
33307
|
+
width: imageWidth,
|
|
33308
|
+
height: imageHeight
|
|
33309
|
+
});
|
|
33310
|
+
if (isMerge) {
|
|
33311
|
+
updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
33312
|
+
}
|
|
33313
|
+
}
|
|
33314
|
+
}
|
|
33315
|
+
function isDamagePic(image) {
|
|
33316
|
+
const regedIcons = get$1();
|
|
33317
|
+
return image.attribute.image === regedIcons.damage_pic.svg;
|
|
33318
|
+
}
|
|
33159
33319
|
|
|
33160
33320
|
function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table) {
|
|
33161
33321
|
if (progressBarDefine.dependField) {
|
|
@@ -34262,8 +34422,8 @@
|
|
|
34262
34422
|
iconAttribute.funcType = icon.funcType;
|
|
34263
34423
|
iconAttribute.interactive = icon.interactive;
|
|
34264
34424
|
let hierarchyOffset = 0;
|
|
34265
|
-
if (isNumber$
|
|
34266
|
-
isNumber$
|
|
34425
|
+
if (isNumber$2(col) &&
|
|
34426
|
+
isNumber$2(row) &&
|
|
34267
34427
|
table &&
|
|
34268
34428
|
(icon.funcType === IconFuncTypeEnum.collapse || icon.funcType === IconFuncTypeEnum.expand)) {
|
|
34269
34429
|
hierarchyOffset = range
|
|
@@ -35706,10 +35866,10 @@
|
|
|
35706
35866
|
|
|
35707
35867
|
function isMergeCellGroup(cellGroup) {
|
|
35708
35868
|
if (cellGroup.role === 'cell' &&
|
|
35709
|
-
isNumber$
|
|
35710
|
-
isNumber$
|
|
35711
|
-
isNumber$
|
|
35712
|
-
isNumber$
|
|
35869
|
+
isNumber$2(cellGroup.mergeStartCol) &&
|
|
35870
|
+
isNumber$2(cellGroup.mergeStartRow) &&
|
|
35871
|
+
isNumber$2(cellGroup.mergeEndCol) &&
|
|
35872
|
+
isNumber$2(cellGroup.mergeEndRow)) {
|
|
35713
35873
|
return true;
|
|
35714
35874
|
}
|
|
35715
35875
|
return false;
|
|
@@ -35731,10 +35891,10 @@
|
|
|
35731
35891
|
max = domainMax + (domainMax - domainMin) * axisOption.expand.max;
|
|
35732
35892
|
}
|
|
35733
35893
|
}
|
|
35734
|
-
if (isNumber$
|
|
35894
|
+
if (isNumber$2(axisOption?.min)) {
|
|
35735
35895
|
min = axisOption.min;
|
|
35736
35896
|
}
|
|
35737
|
-
if (isNumber$
|
|
35897
|
+
if (isNumber$2(axisOption?.max)) {
|
|
35738
35898
|
max = axisOption.max;
|
|
35739
35899
|
}
|
|
35740
35900
|
let scale;
|
|
@@ -35776,7 +35936,7 @@
|
|
|
35776
35936
|
delete scale._niceType;
|
|
35777
35937
|
let scaleTicks;
|
|
35778
35938
|
if (!skipTick) {
|
|
35779
|
-
scaleTicks = scale.ticks(isNumber$
|
|
35939
|
+
scaleTicks = scale.ticks(isNumber$2(axisOption?.tickCount) ? axisOption?.tickCount : DEFAULT_CONTINUOUS_TICK_COUNT, {
|
|
35780
35940
|
noDecimals: axisOption?.tick?.noDecimals
|
|
35781
35941
|
});
|
|
35782
35942
|
}
|
|
@@ -36011,13 +36171,13 @@
|
|
|
36011
36171
|
}
|
|
36012
36172
|
}
|
|
36013
36173
|
}
|
|
36014
|
-
if (isNumber$
|
|
36174
|
+
if (isNumber$2(axisOption?.min)) {
|
|
36015
36175
|
range.min = axisOption.min;
|
|
36016
36176
|
if (range.min > 0) {
|
|
36017
36177
|
axisOption.zero = false;
|
|
36018
36178
|
}
|
|
36019
36179
|
}
|
|
36020
|
-
if (isNumber$
|
|
36180
|
+
if (isNumber$2(axisOption?.max)) {
|
|
36021
36181
|
range.max = axisOption.max;
|
|
36022
36182
|
if (range.max < 0) {
|
|
36023
36183
|
axisOption.zero = false;
|
|
@@ -36062,13 +36222,13 @@
|
|
|
36062
36222
|
}
|
|
36063
36223
|
}
|
|
36064
36224
|
}
|
|
36065
|
-
if (isNumber$
|
|
36225
|
+
if (isNumber$2(axisOption?.min)) {
|
|
36066
36226
|
range.min = axisOption.min;
|
|
36067
36227
|
if (range.min > 0) {
|
|
36068
36228
|
axisOption.zero = false;
|
|
36069
36229
|
}
|
|
36070
36230
|
}
|
|
36071
|
-
if (isNumber$
|
|
36231
|
+
if (isNumber$2(axisOption?.max)) {
|
|
36072
36232
|
range.max = axisOption.max;
|
|
36073
36233
|
if (range.max < 0) {
|
|
36074
36234
|
axisOption.zero = false;
|
|
@@ -36144,13 +36304,13 @@
|
|
|
36144
36304
|
}
|
|
36145
36305
|
}
|
|
36146
36306
|
}
|
|
36147
|
-
if (isNumber$
|
|
36307
|
+
if (isNumber$2(axisOption?.min)) {
|
|
36148
36308
|
range.min = axisOption.min;
|
|
36149
36309
|
if (range.min > 0) {
|
|
36150
36310
|
axisOption.zero = false;
|
|
36151
36311
|
}
|
|
36152
36312
|
}
|
|
36153
|
-
if (isNumber$
|
|
36313
|
+
if (isNumber$2(axisOption?.max)) {
|
|
36154
36314
|
range.max = axisOption.max;
|
|
36155
36315
|
if (range.max < 0) {
|
|
36156
36316
|
axisOption.zero = false;
|
|
@@ -36192,13 +36352,13 @@
|
|
|
36192
36352
|
}
|
|
36193
36353
|
}
|
|
36194
36354
|
}
|
|
36195
|
-
if (isNumber$
|
|
36355
|
+
if (isNumber$2(axisOption?.min)) {
|
|
36196
36356
|
range.min = axisOption.min;
|
|
36197
36357
|
if (range.min > 0) {
|
|
36198
36358
|
axisOption.zero = false;
|
|
36199
36359
|
}
|
|
36200
36360
|
}
|
|
36201
|
-
if (isNumber$
|
|
36361
|
+
if (isNumber$2(axisOption?.max)) {
|
|
36202
36362
|
range.max = axisOption.max;
|
|
36203
36363
|
if (range.max < 0) {
|
|
36204
36364
|
axisOption.zero = false;
|
|
@@ -36378,13 +36538,13 @@
|
|
|
36378
36538
|
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, layout._table.getColWidth(col));
|
|
36379
36539
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
36380
36540
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
36381
|
-
if (isNumber$
|
|
36541
|
+
if (isNumber$2(axisOption?.min)) {
|
|
36382
36542
|
range.min = axisOption.min;
|
|
36383
36543
|
if (range.min > 0) {
|
|
36384
36544
|
axisOption.zero = false;
|
|
36385
36545
|
}
|
|
36386
36546
|
}
|
|
36387
|
-
if (isNumber$
|
|
36547
|
+
if (isNumber$2(axisOption?.max)) {
|
|
36388
36548
|
range.max = axisOption.max;
|
|
36389
36549
|
if (range.max < 0) {
|
|
36390
36550
|
axisOption.zero = false;
|
|
@@ -36860,7 +37020,7 @@
|
|
|
36860
37020
|
}
|
|
36861
37021
|
else {
|
|
36862
37022
|
const defaultHeight = table.getDefaultRowHeight(row);
|
|
36863
|
-
if (isNumber$
|
|
37023
|
+
if (isNumber$2(defaultHeight)) {
|
|
36864
37024
|
return defaultHeight;
|
|
36865
37025
|
}
|
|
36866
37026
|
}
|
|
@@ -36894,7 +37054,7 @@
|
|
|
36894
37054
|
: table.getBodyColumnType(col, row);
|
|
36895
37055
|
if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {
|
|
36896
37056
|
const defaultHeight = table.getDefaultRowHeight(row);
|
|
36897
|
-
maxHeight = Math.max(maxHeight, isNumber$
|
|
37057
|
+
maxHeight = Math.max(maxHeight, isNumber$2(defaultHeight) ? defaultHeight : table.defaultRowHeight);
|
|
36898
37058
|
continue;
|
|
36899
37059
|
}
|
|
36900
37060
|
const textHeight = computeTextHeight(col, row, cellType, table);
|
|
@@ -37168,7 +37328,7 @@
|
|
|
37168
37328
|
wordBreak: 'break-word',
|
|
37169
37329
|
whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
|
|
37170
37330
|
});
|
|
37171
|
-
maxHeight = utilTextMark.AABBBounds.height();
|
|
37331
|
+
maxHeight = utilTextMark.AABBBounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
|
|
37172
37332
|
}
|
|
37173
37333
|
else {
|
|
37174
37334
|
maxHeight = lines.length * lineHeight;
|
|
@@ -39732,6 +39892,90 @@
|
|
|
39732
39892
|
injectable()
|
|
39733
39893
|
], SplitRectAfterRenderContribution);
|
|
39734
39894
|
|
|
39895
|
+
let loadingImage;
|
|
39896
|
+
let VTableDrawItemInterceptorContribution = class VTableDrawItemInterceptorContribution {
|
|
39897
|
+
order = 1;
|
|
39898
|
+
interceptors;
|
|
39899
|
+
constructor() {
|
|
39900
|
+
this.interceptors = [new ImageDrawItemInterceptorContribution()];
|
|
39901
|
+
}
|
|
39902
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
39903
|
+
for (let i = 0; i < this.interceptors.length; i++) {
|
|
39904
|
+
if (this.interceptors[i].afterDrawItem &&
|
|
39905
|
+
this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) {
|
|
39906
|
+
return true;
|
|
39907
|
+
}
|
|
39908
|
+
}
|
|
39909
|
+
return false;
|
|
39910
|
+
}
|
|
39911
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
39912
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) &&
|
|
39913
|
+
!graphic.shadowRoot &&
|
|
39914
|
+
!(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) {
|
|
39915
|
+
return false;
|
|
39916
|
+
}
|
|
39917
|
+
for (let i = 0; i < this.interceptors.length; i++) {
|
|
39918
|
+
if (this.interceptors[i].beforeDrawItem &&
|
|
39919
|
+
this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) {
|
|
39920
|
+
return true;
|
|
39921
|
+
}
|
|
39922
|
+
}
|
|
39923
|
+
return false;
|
|
39924
|
+
}
|
|
39925
|
+
};
|
|
39926
|
+
VTableDrawItemInterceptorContribution = __decorate([
|
|
39927
|
+
injectable()
|
|
39928
|
+
], VTableDrawItemInterceptorContribution);
|
|
39929
|
+
class ImageDrawItemInterceptorContribution {
|
|
39930
|
+
order = 1;
|
|
39931
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
39932
|
+
if (graphic.type === 'image') {
|
|
39933
|
+
this.drawItem(graphic, renderService, drawContext, drawContribution, params);
|
|
39934
|
+
}
|
|
39935
|
+
return false;
|
|
39936
|
+
}
|
|
39937
|
+
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
39938
|
+
const { image: url } = graphic.attribute;
|
|
39939
|
+
if (!url || !graphic.resources) {
|
|
39940
|
+
return false;
|
|
39941
|
+
}
|
|
39942
|
+
const res = graphic.resources.get(url);
|
|
39943
|
+
if (res.state !== 'loading') {
|
|
39944
|
+
return false;
|
|
39945
|
+
}
|
|
39946
|
+
if (!loadingImage) {
|
|
39947
|
+
const regedIcons = get$1();
|
|
39948
|
+
const svg = regedIcons.loading_pic.svg;
|
|
39949
|
+
const width = regedIcons.loading_pic.width;
|
|
39950
|
+
const height = regedIcons.loading_pic.height;
|
|
39951
|
+
loadingImage = createImage({
|
|
39952
|
+
width,
|
|
39953
|
+
height,
|
|
39954
|
+
image: svg
|
|
39955
|
+
});
|
|
39956
|
+
}
|
|
39957
|
+
const { image: loadingUrl } = loadingImage.attribute;
|
|
39958
|
+
if (!url || !loadingImage.resources) {
|
|
39959
|
+
return false;
|
|
39960
|
+
}
|
|
39961
|
+
const loadingRes = loadingImage.resources.get(loadingUrl);
|
|
39962
|
+
if (loadingRes.state !== 'success') {
|
|
39963
|
+
return false;
|
|
39964
|
+
}
|
|
39965
|
+
const { context } = drawContext;
|
|
39966
|
+
context.highPerformanceSave();
|
|
39967
|
+
graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);
|
|
39968
|
+
graphic.glyphHost &&
|
|
39969
|
+
graphic.glyphHost.parent &&
|
|
39970
|
+
context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, true);
|
|
39971
|
+
const b = graphic.AABBBounds;
|
|
39972
|
+
const { width, height } = calcKeepAspectRatioSize(loadingRes.data.width, loadingRes.data.height, b.width(), b.height());
|
|
39973
|
+
context.drawImage(loadingRes.data, b.x1 + (b.width() - width) / 2, b.y1 + (b.height() - height) / 2, width, height);
|
|
39974
|
+
context.highPerformanceRestore();
|
|
39975
|
+
return true;
|
|
39976
|
+
}
|
|
39977
|
+
}
|
|
39978
|
+
|
|
39735
39979
|
var splitModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
39736
39980
|
if (isBound(SplitRectBeforeRenderContribution$1)) {
|
|
39737
39981
|
rebind(SplitRectBeforeRenderContribution$1).to(SplitRectBeforeRenderContribution).inSingletonScope();
|
|
@@ -39774,6 +40018,8 @@
|
|
|
39774
40018
|
bind(GroupRenderContribution).toService(ClipBodyGroupBeforeRenderContribution);
|
|
39775
40019
|
bind(ClipBodyGroupAfterRenderContribution).toSelf().inSingletonScope();
|
|
39776
40020
|
bind(GroupRenderContribution).toService(ClipBodyGroupAfterRenderContribution);
|
|
40021
|
+
bind(VTableDrawItemInterceptorContribution).toSelf().inSingletonScope();
|
|
40022
|
+
bind(DrawItemInterceptor).toService(VTableDrawItemInterceptorContribution);
|
|
39777
40023
|
});
|
|
39778
40024
|
|
|
39779
40025
|
function computeColsWidth(table, colStart, colEnd, update) {
|
|
@@ -40185,7 +40431,7 @@
|
|
|
40185
40431
|
columnGroup.role = 'column';
|
|
40186
40432
|
columnGroup.col = i;
|
|
40187
40433
|
containerGroup.addChild(columnGroup);
|
|
40188
|
-
const { width: default2Width, height: default2Height } = createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, table.scenegraph.mergeMap, cellLocation === 'columnHeader' && isNumber$
|
|
40434
|
+
const { width: default2Width, height: default2Height } = createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, table.scenegraph.mergeMap, cellLocation === 'columnHeader' && isNumber$2(defaultHeaderRowHeight) ? defaultHeaderRowHeight : defaultRowHeight, table, cellLocation, rowLimit);
|
|
40189
40435
|
x += default2Width;
|
|
40190
40436
|
heightMax = Math.max(heightMax, default2Height);
|
|
40191
40437
|
}
|
|
@@ -40403,7 +40649,7 @@
|
|
|
40403
40649
|
const deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
|
|
40404
40650
|
proxy.table.scenegraph.proxy.deltaX += deltaX;
|
|
40405
40651
|
proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
|
|
40406
|
-
proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
|
|
40652
|
+
proxy.totalCol = Math.max(0, Math.min(proxy.table.colCount - 1, direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count));
|
|
40407
40653
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
|
|
40408
40654
|
proxy.colUpdatePos = distStartCol;
|
|
40409
40655
|
proxy.colUpdateDirection = direction;
|
|
@@ -40440,7 +40686,7 @@
|
|
|
40440
40686
|
proxy.table.scenegraph.proxy.deltaX = deltaX;
|
|
40441
40687
|
}
|
|
40442
40688
|
proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
|
|
40443
|
-
proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
|
|
40689
|
+
proxy.totalCol = Math.max(0, Math.min(proxy.table.colCount - 1, direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count));
|
|
40444
40690
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
|
|
40445
40691
|
proxy.colUpdatePos = proxy.colStart;
|
|
40446
40692
|
proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';
|
|
@@ -41104,7 +41350,7 @@
|
|
|
41104
41350
|
computeColsWidth(this.table, this.currentCol + 1, endCol);
|
|
41105
41351
|
for (let row = 0; row < this.table.rowCount; row++) {
|
|
41106
41352
|
const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
|
|
41107
|
-
if (isNumber$
|
|
41353
|
+
if (isNumber$2(cellGroup.mergeStartCol) && cellGroup.mergeStartCol > this.currentCol) {
|
|
41108
41354
|
this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
|
|
41109
41355
|
}
|
|
41110
41356
|
}
|
|
@@ -41912,7 +42158,7 @@
|
|
|
41912
42158
|
const beforeRow = removeRows[removeRows.length - 1] - 1;
|
|
41913
42159
|
const afterRow = removeRows[0] - removeRows.length + 1;
|
|
41914
42160
|
const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
|
|
41915
|
-
isNumber$
|
|
42161
|
+
isNumber$2(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
|
|
41916
42162
|
}
|
|
41917
42163
|
scene.table._clearRowRangeHeightsMap();
|
|
41918
42164
|
let updateAfter;
|
|
@@ -41926,7 +42172,7 @@
|
|
|
41926
42172
|
const beforeRow = addRows[0] - 1;
|
|
41927
42173
|
const afterRow = addRows[addRows.length - 1] + 1;
|
|
41928
42174
|
const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
|
|
41929
|
-
isNumber$
|
|
42175
|
+
isNumber$2(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
|
|
41930
42176
|
}
|
|
41931
42177
|
for (let col = 0; col < table.colCount; col++) {
|
|
41932
42178
|
updateRows.forEach(r => {
|
|
@@ -41947,9 +42193,9 @@
|
|
|
41947
42193
|
const beforeRow = updateRows[0] - 1;
|
|
41948
42194
|
const afterRow = updateRows[updateRows.length - 1] + 1;
|
|
41949
42195
|
const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
|
|
41950
|
-
isNumber$
|
|
42196
|
+
isNumber$2(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
|
|
41951
42197
|
}
|
|
41952
|
-
if (isNumber$
|
|
42198
|
+
if (isNumber$2(updateAfter)) {
|
|
41953
42199
|
for (let col = 0; col < table.colCount; col++) {
|
|
41954
42200
|
for (let row = updateAfter; row < table.rowCount; row++) {
|
|
41955
42201
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
@@ -41959,7 +42205,7 @@
|
|
|
41959
42205
|
scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, updateAfter);
|
|
41960
42206
|
}
|
|
41961
42207
|
if (addRows.length) {
|
|
41962
|
-
if (!isNumber$
|
|
42208
|
+
if (!isNumber$2(updateAfter)) {
|
|
41963
42209
|
const minRow = Math.min(...addRows);
|
|
41964
42210
|
scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);
|
|
41965
42211
|
}
|
|
@@ -42267,7 +42513,7 @@
|
|
|
42267
42513
|
});
|
|
42268
42514
|
});
|
|
42269
42515
|
});
|
|
42270
|
-
changedCells.
|
|
42516
|
+
changedCells.clear();
|
|
42271
42517
|
const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
|
|
42272
42518
|
const frozenRowsHeight = table.getFrozenRowsHeight();
|
|
42273
42519
|
const frozenColsWidth = table.getFrozenColsWidth();
|
|
@@ -42331,10 +42577,10 @@
|
|
|
42331
42577
|
}
|
|
42332
42578
|
}
|
|
42333
42579
|
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, table) {
|
|
42334
|
-
if (isNumber$
|
|
42335
|
-
isNumber$
|
|
42336
|
-
isNumber$
|
|
42337
|
-
isNumber$
|
|
42580
|
+
if (isNumber$2(cellGroup.mergeStartCol) &&
|
|
42581
|
+
isNumber$2(cellGroup.mergeStartRow) &&
|
|
42582
|
+
isNumber$2(cellGroup.mergeEndCol) &&
|
|
42583
|
+
isNumber$2(cellGroup.mergeEndRow)) {
|
|
42338
42584
|
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
|
|
42339
42585
|
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
42340
42586
|
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
@@ -42366,34 +42612,36 @@
|
|
|
42366
42612
|
const textBottom = graphic.globalAABBBounds.y2;
|
|
42367
42613
|
if (textTop < minTop) {
|
|
42368
42614
|
const deltaHeight = textTop - minTop;
|
|
42369
|
-
changedCells.
|
|
42370
|
-
col
|
|
42371
|
-
|
|
42372
|
-
|
|
42373
|
-
|
|
42374
|
-
|
|
42615
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42616
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42617
|
+
col: cellGroup.col,
|
|
42618
|
+
row: cellGroup.row,
|
|
42619
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42620
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42621
|
+
});
|
|
42375
42622
|
cellGroup.forEachChildren((child) => {
|
|
42376
42623
|
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
|
|
42377
42624
|
});
|
|
42378
42625
|
}
|
|
42379
42626
|
else if (textBottom > maxTop) {
|
|
42380
42627
|
const deltaHeight = textBottom - maxTop;
|
|
42381
|
-
changedCells.
|
|
42382
|
-
col
|
|
42383
|
-
|
|
42384
|
-
|
|
42385
|
-
|
|
42386
|
-
|
|
42628
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42629
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42630
|
+
col: cellGroup.col,
|
|
42631
|
+
row: cellGroup.row,
|
|
42632
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42633
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42634
|
+
});
|
|
42387
42635
|
cellGroup.forEachChildren((child) => {
|
|
42388
42636
|
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
|
|
42389
42637
|
});
|
|
42390
42638
|
}
|
|
42391
42639
|
}
|
|
42392
42640
|
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, table) {
|
|
42393
|
-
if (isNumber$
|
|
42394
|
-
isNumber$
|
|
42395
|
-
isNumber$
|
|
42396
|
-
isNumber$
|
|
42641
|
+
if (isNumber$2(cellGroup.mergeStartCol) &&
|
|
42642
|
+
isNumber$2(cellGroup.mergeStartRow) &&
|
|
42643
|
+
isNumber$2(cellGroup.mergeEndCol) &&
|
|
42644
|
+
isNumber$2(cellGroup.mergeEndRow)) {
|
|
42397
42645
|
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
|
|
42398
42646
|
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
42399
42647
|
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
@@ -42415,24 +42663,26 @@
|
|
|
42415
42663
|
const textRight = text.globalAABBBounds.x2;
|
|
42416
42664
|
if (textLeft < minLeft) {
|
|
42417
42665
|
const deltaWidth = textLeft - minLeft;
|
|
42418
|
-
changedCells.
|
|
42419
|
-
col
|
|
42420
|
-
|
|
42421
|
-
|
|
42422
|
-
|
|
42423
|
-
|
|
42666
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42667
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42668
|
+
col: cellGroup.col,
|
|
42669
|
+
row: cellGroup.row,
|
|
42670
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42671
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42672
|
+
});
|
|
42424
42673
|
cellGroup.forEachChildren((child) => {
|
|
42425
42674
|
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
|
|
42426
42675
|
});
|
|
42427
42676
|
}
|
|
42428
42677
|
else if (textRight > maxLeft) {
|
|
42429
42678
|
const deltaWidth = textRight - maxLeft;
|
|
42430
|
-
changedCells.
|
|
42431
|
-
col
|
|
42432
|
-
|
|
42433
|
-
|
|
42434
|
-
|
|
42435
|
-
|
|
42679
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42680
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42681
|
+
col: cellGroup.col,
|
|
42682
|
+
row: cellGroup.row,
|
|
42683
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42684
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42685
|
+
});
|
|
42436
42686
|
cellGroup.forEachChildren((child) => {
|
|
42437
42687
|
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
|
|
42438
42688
|
});
|
|
@@ -42983,7 +43233,7 @@
|
|
|
42983
43233
|
fontFamily: DefaultTextStyle.fontFamily,
|
|
42984
43234
|
fontSize: DefaultTextStyle.fontSize
|
|
42985
43235
|
},
|
|
42986
|
-
getTextBounds: useNaiveCanvas ? undefined : getTextBounds,
|
|
43236
|
+
getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
|
|
42987
43237
|
specialCharSet: `{}()//&-/: .,@%'"~…${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789`,
|
|
42988
43238
|
...(option ?? {})
|
|
42989
43239
|
}, textSpec);
|
|
@@ -43425,7 +43675,7 @@
|
|
|
43425
43675
|
}
|
|
43426
43676
|
}
|
|
43427
43677
|
});
|
|
43428
|
-
if (isNumber$
|
|
43678
|
+
if (isNumber$2(updateAfter)) {
|
|
43429
43679
|
for (let col = updateAfter; col < table.colCount; col++) {
|
|
43430
43680
|
for (let row = 0; row < table.rowCount; row++) {
|
|
43431
43681
|
const cellGroup = scene.highPerformanceGetCell(col, row, true);
|
|
@@ -43435,7 +43685,7 @@
|
|
|
43435
43685
|
scene.proxy.colUpdatePos = updateAfter;
|
|
43436
43686
|
}
|
|
43437
43687
|
if (addCols.length) {
|
|
43438
|
-
if (!isNumber$
|
|
43688
|
+
if (!isNumber$2(updateAfter)) {
|
|
43439
43689
|
const minCol = Math.min(...addCols);
|
|
43440
43690
|
scene.proxy.colUpdatePos = minCol;
|
|
43441
43691
|
}
|
|
@@ -45209,7 +45459,10 @@
|
|
|
45209
45459
|
}
|
|
45210
45460
|
else if (col >= 0 && row >= 0) {
|
|
45211
45461
|
const cellRange = table.getCellRange(col, row);
|
|
45212
|
-
state.select.ranges.push(
|
|
45462
|
+
state.select.ranges.push({
|
|
45463
|
+
start: { col: cellRange.start.col, row: cellRange.start.row },
|
|
45464
|
+
end: { col: cellRange.end.col, row: cellRange.end.row }
|
|
45465
|
+
});
|
|
45213
45466
|
}
|
|
45214
45467
|
cellPos.col = col;
|
|
45215
45468
|
cellPos.row = row;
|
|
@@ -51028,7 +51281,7 @@
|
|
|
51028
51281
|
return TABLE_EVENT_TYPE;
|
|
51029
51282
|
}
|
|
51030
51283
|
options;
|
|
51031
|
-
version = "0.18.
|
|
51284
|
+
version = "0.18.5-alpha.0";
|
|
51032
51285
|
pagination;
|
|
51033
51286
|
id = `VTable${Date.now()}`;
|
|
51034
51287
|
headerStyleCache;
|
|
@@ -51083,7 +51336,7 @@
|
|
|
51083
51336
|
internalProps.context = internalProps.canvas.getContext('2d');
|
|
51084
51337
|
}
|
|
51085
51338
|
internalProps.handler = new EventHandler();
|
|
51086
|
-
if (isNumber$
|
|
51339
|
+
if (isNumber$2(this.options.resizeTime)) {
|
|
51087
51340
|
internalProps.handler.resizeTime = this.options.resizeTime;
|
|
51088
51341
|
}
|
|
51089
51342
|
internalProps.pixelRatio = pixelRatio;
|
|
@@ -51173,7 +51426,7 @@
|
|
|
51173
51426
|
this.headerStyleCache = new Map();
|
|
51174
51427
|
this.bodyStyleCache = new Map();
|
|
51175
51428
|
this.bodyBottomStyleCache = new Map();
|
|
51176
|
-
internalProps.stick = { changedCells:
|
|
51429
|
+
internalProps.stick = { changedCells: new Map() };
|
|
51177
51430
|
internalProps.customMergeCell = options.customMergeCell;
|
|
51178
51431
|
}
|
|
51179
51432
|
throttleInvalidate = throttle2(this.render.bind(this), 200);
|
|
@@ -51477,11 +51730,11 @@
|
|
|
51477
51730
|
return Math.round(w);
|
|
51478
51731
|
}
|
|
51479
51732
|
getRowHeight(row) {
|
|
51480
|
-
if (this.rowHeightsMap.get(row)) {
|
|
51733
|
+
if (isValid$1(this.rowHeightsMap.get(row))) {
|
|
51481
51734
|
return this.rowHeightsMap.get(row);
|
|
51482
51735
|
}
|
|
51483
51736
|
const defaultHeight = this.getDefaultRowHeight(row);
|
|
51484
|
-
if (isNumber$
|
|
51737
|
+
if (isNumber$2(defaultHeight)) {
|
|
51485
51738
|
return defaultHeight;
|
|
51486
51739
|
}
|
|
51487
51740
|
return this.defaultRowHeight;
|
|
@@ -51515,9 +51768,9 @@
|
|
|
51515
51768
|
const height = Math.round(cachedLowerRowHeight +
|
|
51516
51769
|
(this.rowHeightsMap.get(endRow) ??
|
|
51517
51770
|
(this.isColumnHeader(0, endRow) || this.isCornerHeader(0, endRow)
|
|
51518
|
-
? Array.isArray(this.defaultHeaderRowHeight) && isNumber$
|
|
51771
|
+
? Array.isArray(this.defaultHeaderRowHeight) && isNumber$2(this.defaultHeaderRowHeight[endRow])
|
|
51519
51772
|
? this.defaultHeaderRowHeight[endRow]
|
|
51520
|
-
: isNumber$
|
|
51773
|
+
: isNumber$2(this.defaultHeaderRowHeight)
|
|
51521
51774
|
? this.defaultHeaderRowHeight
|
|
51522
51775
|
: this.internalProps.defaultRowHeight
|
|
51523
51776
|
: this.internalProps.defaultRowHeight)));
|
|
@@ -51701,7 +51954,7 @@
|
|
|
51701
51954
|
const height = this.getRowHeight(row);
|
|
51702
51955
|
if (isFrozenCell && isFrozenCell.row) {
|
|
51703
51956
|
if (this.isBottomFrozenRow(col, row)) {
|
|
51704
|
-
|
|
51957
|
+
absoluteTop = this.tableNoFrameHeight - (this.getRowsHeight(row, this.rowCount - 1) ?? 0);
|
|
51705
51958
|
}
|
|
51706
51959
|
else {
|
|
51707
51960
|
absoluteTop = this.getRowsHeight(0, row - 1);
|
|
@@ -51722,14 +51975,54 @@
|
|
|
51722
51975
|
return new Rect$1(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
|
|
51723
51976
|
}
|
|
51724
51977
|
getCellRelativeRect(col, row) {
|
|
51725
|
-
|
|
51978
|
+
const isFrozenCell = this.isFrozenCell(col, row);
|
|
51979
|
+
let relativeX = true;
|
|
51980
|
+
let relativeY = true;
|
|
51981
|
+
if (isFrozenCell?.col && isFrozenCell?.row) {
|
|
51982
|
+
relativeX = false;
|
|
51983
|
+
relativeY = false;
|
|
51984
|
+
}
|
|
51985
|
+
else if (isFrozenCell?.col) {
|
|
51986
|
+
relativeX = false;
|
|
51987
|
+
}
|
|
51988
|
+
else if (isFrozenCell?.row) {
|
|
51989
|
+
relativeY = false;
|
|
51990
|
+
}
|
|
51991
|
+
const cellRect = this.getCellRect(col, row);
|
|
51992
|
+
return this._toRelativeRect(cellRect, relativeX, relativeY);
|
|
51726
51993
|
}
|
|
51727
51994
|
getCellRangeRelativeRect(range) {
|
|
51728
51995
|
if (range.start) {
|
|
51729
|
-
|
|
51996
|
+
const isFrozenCell = this.isFrozenCell(range.start.col, range.start.row);
|
|
51997
|
+
let relativeX = true;
|
|
51998
|
+
let relativeY = true;
|
|
51999
|
+
if (isFrozenCell?.col && isFrozenCell?.row) {
|
|
52000
|
+
relativeX = false;
|
|
52001
|
+
relativeY = false;
|
|
52002
|
+
}
|
|
52003
|
+
else if (isFrozenCell?.col) {
|
|
52004
|
+
relativeX = false;
|
|
52005
|
+
}
|
|
52006
|
+
else if (isFrozenCell?.row) {
|
|
52007
|
+
relativeY = false;
|
|
52008
|
+
}
|
|
52009
|
+
return this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
51730
52010
|
}
|
|
51731
52011
|
const cellRange = this.getCellRange(range.col, range.row);
|
|
51732
|
-
|
|
52012
|
+
const isFrozenCell = this.isFrozenCell(range.col, range.row);
|
|
52013
|
+
let relativeX = true;
|
|
52014
|
+
let relativeY = true;
|
|
52015
|
+
if (isFrozenCell?.col && isFrozenCell?.row) {
|
|
52016
|
+
relativeX = false;
|
|
52017
|
+
relativeY = false;
|
|
52018
|
+
}
|
|
52019
|
+
else if (isFrozenCell?.col) {
|
|
52020
|
+
relativeX = false;
|
|
52021
|
+
}
|
|
52022
|
+
else if (isFrozenCell?.row) {
|
|
52023
|
+
relativeY = false;
|
|
52024
|
+
}
|
|
52025
|
+
return this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
51733
52026
|
}
|
|
51734
52027
|
getVisibleCellRangeRelativeRect(range) {
|
|
51735
52028
|
let cellRange;
|
|
@@ -51919,11 +52212,11 @@
|
|
|
51919
52212
|
}, 0);
|
|
51920
52213
|
});
|
|
51921
52214
|
}
|
|
51922
|
-
_toRelativeRect(absoluteRect) {
|
|
52215
|
+
_toRelativeRect(absoluteRect, relativeX = true, relativeY = true) {
|
|
51923
52216
|
const rect = absoluteRect.copy();
|
|
51924
52217
|
const visibleRect = this.getVisibleRect();
|
|
51925
|
-
rect.offsetLeft(this.tableX - visibleRect.left);
|
|
51926
|
-
rect.offsetTop(this.tableY - visibleRect.top);
|
|
52218
|
+
rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
|
|
52219
|
+
rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
|
|
51927
52220
|
return rect;
|
|
51928
52221
|
}
|
|
51929
52222
|
getVisibleRect() {
|
|
@@ -52139,6 +52432,7 @@
|
|
|
52139
52432
|
this.colWidthsMap = new NumberMap();
|
|
52140
52433
|
this.colContentWidthsMap = new NumberMap();
|
|
52141
52434
|
this.colWidthsLimit = {};
|
|
52435
|
+
internalProps.stick.changedCells.clear();
|
|
52142
52436
|
internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
|
|
52143
52437
|
this.scenegraph.updateStageBackground();
|
|
52144
52438
|
internalProps.autoWrapText = options.autoWrapText;
|
|
@@ -53595,10 +53889,10 @@
|
|
|
53595
53889
|
}
|
|
53596
53890
|
}
|
|
53597
53891
|
}
|
|
53598
|
-
if (isNumber$
|
|
53892
|
+
if (isNumber$2(axisOption?.min)) {
|
|
53599
53893
|
range.min = axisOption.min;
|
|
53600
53894
|
}
|
|
53601
|
-
if (isNumber$
|
|
53895
|
+
if (isNumber$2(axisOption?.max)) {
|
|
53602
53896
|
range.max = axisOption.max;
|
|
53603
53897
|
}
|
|
53604
53898
|
axes.push(merge({
|
|
@@ -53651,10 +53945,10 @@
|
|
|
53651
53945
|
}
|
|
53652
53946
|
}
|
|
53653
53947
|
}
|
|
53654
|
-
if (isNumber$
|
|
53948
|
+
if (isNumber$2(axisOption?.min)) {
|
|
53655
53949
|
range.min = axisOption.min;
|
|
53656
53950
|
}
|
|
53657
|
-
if (isNumber$
|
|
53951
|
+
if (isNumber$2(axisOption?.max)) {
|
|
53658
53952
|
range.max = axisOption.max;
|
|
53659
53953
|
}
|
|
53660
53954
|
axes.push(merge({
|
|
@@ -53734,10 +54028,10 @@
|
|
|
53734
54028
|
range.min = axisRange[0];
|
|
53735
54029
|
range.max = axisRange[1];
|
|
53736
54030
|
}
|
|
53737
|
-
if (isNumber$
|
|
54031
|
+
if (isNumber$2(axisOption?.min)) {
|
|
53738
54032
|
range.min = axisOption.min;
|
|
53739
54033
|
}
|
|
53740
|
-
if (isNumber$
|
|
54034
|
+
if (isNumber$2(axisOption?.max)) {
|
|
53741
54035
|
range.max = axisOption.max;
|
|
53742
54036
|
}
|
|
53743
54037
|
return {
|
|
@@ -62286,7 +62580,7 @@
|
|
|
62286
62580
|
}
|
|
62287
62581
|
|
|
62288
62582
|
registerForVrender();
|
|
62289
|
-
const version = "0.18.
|
|
62583
|
+
const version = "0.18.5-alpha.0";
|
|
62290
62584
|
function getIcons() {
|
|
62291
62585
|
return get$1();
|
|
62292
62586
|
}
|