@visactor/vtable 0.18.1 → 0.18.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/cjs/core/BaseTable.js +3 -3
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/icons.js +10 -0
  4. package/cjs/icons.js.map +1 -1
  5. package/cjs/index.d.ts +1 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/index.js.map +1 -1
  8. package/cjs/scenegraph/graphic/contributions/draw-interceptor.d.ts +13 -0
  9. package/cjs/scenegraph/graphic/contributions/draw-interceptor.js +90 -0
  10. package/cjs/scenegraph/graphic/contributions/draw-interceptor.js.map +1 -0
  11. package/cjs/scenegraph/graphic/contributions/index.js +4 -2
  12. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  13. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +38 -18
  14. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  15. package/cjs/scenegraph/stick-text/index.js +5 -5
  16. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  17. package/cjs/scenegraph/utils/keep-aspect-ratio.js +5 -4
  18. package/cjs/scenegraph/utils/keep-aspect-ratio.js.map +1 -1
  19. package/cjs/themes/ARCO.js +1 -2
  20. package/cjs/themes/BRIGHT.js +2 -1
  21. package/cjs/ts-types/base-table.d.ts +1 -1
  22. package/cjs/ts-types/base-table.js.map +1 -1
  23. package/cjs/vrender.js.map +1 -1
  24. package/dist/vtable.js +802 -356
  25. package/dist/vtable.min.js +2 -2
  26. package/es/core/BaseTable.js +4 -3
  27. package/es/core/BaseTable.js.map +1 -1
  28. package/es/icons.js +10 -0
  29. package/es/icons.js.map +1 -1
  30. package/es/index.d.ts +1 -1
  31. package/es/index.js +1 -1
  32. package/es/index.js.map +1 -1
  33. package/es/scenegraph/graphic/contributions/draw-interceptor.d.ts +13 -0
  34. package/es/scenegraph/graphic/contributions/draw-interceptor.js +64 -0
  35. package/es/scenegraph/graphic/contributions/draw-interceptor.js.map +1 -0
  36. package/es/scenegraph/graphic/contributions/index.js +5 -2
  37. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  38. package/es/scenegraph/group-creater/cell-type/image-cell.js +35 -17
  39. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  40. package/es/scenegraph/stick-text/index.js +5 -5
  41. package/es/scenegraph/stick-text/index.js.map +1 -1
  42. package/es/scenegraph/utils/keep-aspect-ratio.js +5 -4
  43. package/es/scenegraph/utils/keep-aspect-ratio.js.map +1 -1
  44. package/es/themes/ARCO.js +1 -2
  45. package/es/themes/BRIGHT.js +2 -1
  46. package/es/ts-types/base-table.d.ts +1 -1
  47. package/es/ts-types/base-table.js.map +1 -1
  48. package/es/vrender.js.map +1 -1
  49. package/package.json +7 -7
package/dist/vtable.js CHANGED
@@ -5321,7 +5321,10 @@
5321
5321
  removeAllChild() {
5322
5322
  if (!this._idMap) return;
5323
5323
  let child = this._firstChild;
5324
- for (; child;) child.parent = null, child._prev = null, child._next = null, child = child._next;
5324
+ for (; child;) {
5325
+ const next = child._next;
5326
+ child.parent = null, child._prev = null, child._next = null, child = next;
5327
+ }
5325
5328
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
5326
5329
  }
5327
5330
  replaceChild(newChild, oldChild) {
@@ -7054,18 +7057,10 @@
7054
7057
  class ResourceLoader {
7055
7058
  static GetImage(url, mark) {
7056
7059
  var _a;
7057
- let data = ResourceLoader.cache.get(url);
7060
+ const data = ResourceLoader.cache.get(url);
7058
7061
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(() => {
7059
7062
  mark.imageLoadFail(url);
7060
- }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
7061
- type: "image",
7062
- loadState: "init"
7063
- }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(res => {
7064
- var _a;
7065
- data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
7066
- (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
7067
- });
7068
- })) : (data.loadState = "fail", mark.imageLoadFail(url)));
7063
+ }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
7069
7064
  }
7070
7065
  static GetSvg(svgStr, mark) {
7071
7066
  var _a;
@@ -7091,8 +7086,60 @@
7091
7086
  loadState: "init"
7092
7087
  }, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
7093
7088
  }
7089
+ static loading() {
7090
+ setTimeout(() => {
7091
+ if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
7092
+ ResourceLoader.isLoading = !0;
7093
+ const tasks = ResourceLoader.toLoadAueue.splice(0, 10),
7094
+ promises = [];
7095
+ tasks.forEach(task => {
7096
+ const {
7097
+ url: url,
7098
+ marks: marks
7099
+ } = task,
7100
+ data = {
7101
+ type: "image",
7102
+ loadState: "init"
7103
+ };
7104
+ if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
7105
+ data.waitingMark = marks;
7106
+ const end = data.dataPromise.then(res => {
7107
+ var _a;
7108
+ data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
7109
+ (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
7110
+ });
7111
+ });
7112
+ promises.push(end);
7113
+ } else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
7114
+ }), Promise.all(promises).then(() => {
7115
+ ResourceLoader.isLoading = !1, ResourceLoader.loading();
7116
+ }).catch(error => {
7117
+ ResourceLoader.isLoading = !1, ResourceLoader.loading();
7118
+ });
7119
+ }
7120
+ }, 0);
7121
+ }
7122
+ static loadImage(url, mark) {
7123
+ const index = getIndex(url, ResourceLoader.toLoadAueue);
7124
+ if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
7125
+ ResourceLoader.toLoadAueue.push({
7126
+ url: url,
7127
+ marks: [mark]
7128
+ }), ResourceLoader.loading();
7129
+ }
7130
+ static improveImageLoading(url) {
7131
+ const index = getIndex(url, ResourceLoader.toLoadAueue);
7132
+ if (-1 !== index) {
7133
+ const elememt = ResourceLoader.toLoadAueue.splice(index, 1);
7134
+ ResourceLoader.toLoadAueue.unshift(elememt[0]);
7135
+ }
7136
+ }
7137
+ }
7138
+ function getIndex(url, arr) {
7139
+ for (let i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
7140
+ return -1;
7094
7141
  }
7095
- ResourceLoader.cache = new Map();
7142
+ ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
7096
7143
 
7097
7144
  const tempMatrix = new Matrix(),
7098
7145
  tempBounds$1 = new AABBBounds();
@@ -7290,7 +7337,7 @@
7290
7337
  const context = {
7291
7338
  type: AttributeUpdateType.INIT
7292
7339
  };
7293
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), this._updateTag = UpdateTag.INIT, this.onAttributeUpdate(context);
7340
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
7294
7341
  }
7295
7342
  translate(x, y) {
7296
7343
  var _a, _b;
@@ -7708,7 +7755,7 @@
7708
7755
  data: "init",
7709
7756
  state: null
7710
7757
  };
7711
- this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
7758
+ this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$4(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
7712
7759
  }
7713
7760
  imageLoadSuccess(url, image, cb) {
7714
7761
  if (!this.resources) return;
@@ -10646,6 +10693,12 @@
10646
10693
  this.failCallback && this.failCallback();
10647
10694
  });
10648
10695
  }
10696
+ setAttributes(params, forceUpdateTag, context) {
10697
+ return params.image && this.loadImage(params.image), super.setAttributes(params, forceUpdateTag, context);
10698
+ }
10699
+ setAttribute(key, value, forceUpdateTag, context) {
10700
+ return "image" === key && this.loadImage(value), super.setAttribute(key, value, forceUpdateTag, context);
10701
+ }
10649
10702
  doUpdateAABBBounds() {
10650
10703
  const imageTheme = getTheme(this).image;
10651
10704
  this._AABBBounds.setValue(1 / 0, 1 / 0, -1 / 0, -1 / 0);
@@ -12271,7 +12324,7 @@
12271
12324
 
12272
12325
  let text;
12273
12326
  function getTextBounds(params) {
12274
- return text || (text = graphicCreator.CreateGraphic("text", {})), text.setAttributes(params), text.AABBBounds;
12327
+ return text || (text = graphicCreator.CreateGraphic("text", {})), text.initAttributes(params), text.AABBBounds;
12275
12328
  }
12276
12329
 
12277
12330
  const result = {
@@ -12402,6 +12455,234 @@
12402
12455
  }
12403
12456
  }
12404
12457
 
12458
+ const parse$3 = function () {
12459
+ const tokens = {
12460
+ linearGradient: /^(linear\-gradient)/i,
12461
+ radialGradient: /^(radial\-gradient)/i,
12462
+ conicGradient: /^(conic\-gradient)/i,
12463
+ sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,
12464
+ extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
12465
+ positionKeywords: /^(left|center|right|top|bottom)/i,
12466
+ pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
12467
+ percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
12468
+ emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
12469
+ angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
12470
+ fromAngleValue: /^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
12471
+ startCall: /^\(/,
12472
+ endCall: /^\)/,
12473
+ comma: /^,/,
12474
+ hexColor: /(^\#[0-9a-fA-F]+)/,
12475
+ literalColor: /^([a-zA-Z]+)/,
12476
+ rgbColor: /^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,
12477
+ rgbaColor: /^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,
12478
+ number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
12479
+ };
12480
+ let input = "";
12481
+ function error(msg) {
12482
+ const err = new Error(input + ": " + msg);
12483
+ throw err.source = input, err;
12484
+ }
12485
+ function getAST() {
12486
+ const ast = matchListing(matchDefinition);
12487
+ return input.length > 0 && error("Invalid input not EOF"), ast;
12488
+ }
12489
+ function matchDefinition() {
12490
+ return matchGradient("linear", tokens.linearGradient, matchLinearOrientation) || matchGradient("radial", tokens.radialGradient, matchListRadialOrientations) || matchGradient("conic", tokens.conicGradient, matchConicalOrientation);
12491
+ }
12492
+ function matchGradient(gradientType, pattern, orientationMatcher) {
12493
+ return function (pattern, callback) {
12494
+ const captures = scan(pattern);
12495
+ if (captures) {
12496
+ scan(tokens.startCall) || error("Missing (");
12497
+ const result = callback(captures);
12498
+ return scan(tokens.endCall) || error("Missing )"), result;
12499
+ }
12500
+ }(pattern, function (captures) {
12501
+ const orientation = orientationMatcher();
12502
+ return orientation && (scan(tokens.comma) || error("Missing comma before color stops")), {
12503
+ type: gradientType,
12504
+ orientation: orientation,
12505
+ colorStops: matchListing(matchColorStop)
12506
+ };
12507
+ });
12508
+ }
12509
+ function matchLinearOrientation() {
12510
+ return match("directional", tokens.sideOrCorner, 1) || match("angular", tokens.angleValue, 1);
12511
+ }
12512
+ function matchConicalOrientation() {
12513
+ return match("angular", tokens.fromAngleValue, 1);
12514
+ }
12515
+ function matchListRadialOrientations() {
12516
+ let radialOrientations,
12517
+ lookaheadCache,
12518
+ radialOrientation = matchRadialOrientation();
12519
+ return radialOrientation && (radialOrientations = [], radialOrientations.push(radialOrientation), lookaheadCache = input, scan(tokens.comma) && (radialOrientation = matchRadialOrientation(), radialOrientation ? radialOrientations.push(radialOrientation) : input = lookaheadCache)), radialOrientations;
12520
+ }
12521
+ function matchRadialOrientation() {
12522
+ let radialType = function () {
12523
+ const circle = match("shape", /^(circle)/i, 0);
12524
+ circle && (circle.style = matchLength() || matchExtentKeyword());
12525
+ return circle;
12526
+ }() || function () {
12527
+ const ellipse = match("shape", /^(ellipse)/i, 0);
12528
+ ellipse && (ellipse.style = matchDistance() || matchExtentKeyword());
12529
+ return ellipse;
12530
+ }();
12531
+ if (radialType) radialType.at = matchAtPosition();else {
12532
+ const extent = matchExtentKeyword();
12533
+ if (extent) {
12534
+ radialType = extent;
12535
+ const positionAt = matchAtPosition();
12536
+ positionAt && (radialType.at = positionAt);
12537
+ } else {
12538
+ const defaultPosition = matchPositioning();
12539
+ defaultPosition && (radialType = {
12540
+ type: "default-radial",
12541
+ at: defaultPosition
12542
+ });
12543
+ }
12544
+ }
12545
+ return radialType;
12546
+ }
12547
+ function matchExtentKeyword() {
12548
+ return match("extent-keyword", tokens.extentKeywords, 1);
12549
+ }
12550
+ function matchAtPosition() {
12551
+ if (match("position", /^at/, 0)) {
12552
+ const positioning = matchPositioning();
12553
+ return positioning || error("Missing positioning value"), positioning;
12554
+ }
12555
+ }
12556
+ function matchPositioning() {
12557
+ const location = {
12558
+ x: matchDistance(),
12559
+ y: matchDistance()
12560
+ };
12561
+ if (location.x || location.y) return {
12562
+ type: "position",
12563
+ value: location
12564
+ };
12565
+ }
12566
+ function matchListing(matcher) {
12567
+ let captures = matcher();
12568
+ const result = [];
12569
+ if (captures) for (result.push(captures); scan(tokens.comma);) captures = matcher(), captures ? result.push(captures) : error("One extra comma");
12570
+ return result;
12571
+ }
12572
+ function matchColorStop() {
12573
+ const color = match("hex", tokens.hexColor, 1) || match("rgba", tokens.rgbaColor, 1) || match("rgb", tokens.rgbColor, 1) || match("literal", tokens.literalColor, 0);
12574
+ return color || error("Expected color definition"), color.length = matchDistance(), color;
12575
+ }
12576
+ function matchDistance() {
12577
+ return match("%", tokens.percentageValue, 1) || match("position-keyword", tokens.positionKeywords, 1) || matchLength();
12578
+ }
12579
+ function matchLength() {
12580
+ return match("px", tokens.pixelValue, 1) || match("em", tokens.emValue, 1);
12581
+ }
12582
+ function match(type, pattern, captureIndex) {
12583
+ const captures = scan(pattern);
12584
+ if (captures) return {
12585
+ type: type,
12586
+ value: captures[captureIndex]
12587
+ };
12588
+ }
12589
+ function scan(regexp) {
12590
+ const blankCaptures = /^[\n\r\t\s]+/.exec(input);
12591
+ blankCaptures && consume(blankCaptures[0].length);
12592
+ const captures = regexp.exec(input);
12593
+ return captures && consume(captures[0].length), captures;
12594
+ }
12595
+ function consume(size) {
12596
+ input = input.substr(size);
12597
+ }
12598
+ return function (code) {
12599
+ return input = code.toString(), getAST();
12600
+ };
12601
+ }();
12602
+ class GradientParser {
12603
+ static IsGradient(c) {
12604
+ return !("string" == typeof c && c.length < 10);
12605
+ }
12606
+ static IsGradientStr(c) {
12607
+ return "string" == typeof c && c.length > 10;
12608
+ }
12609
+ static Parse(c) {
12610
+ if (GradientParser.IsGradientStr(c)) try {
12611
+ const datum = parse$3(c)[0];
12612
+ if (datum) {
12613
+ if ("linear" === datum.type) return GradientParser.ParseLinear(datum);
12614
+ if ("radial" === datum.type) return GradientParser.ParseRadial(datum);
12615
+ if ("conic" === datum.type) return GradientParser.ParseConic(datum);
12616
+ }
12617
+ } catch (err) {
12618
+ return c;
12619
+ }
12620
+ return c;
12621
+ }
12622
+ static ParseConic(datum) {
12623
+ const {
12624
+ orientation: orientation,
12625
+ colorStops = []
12626
+ } = datum,
12627
+ halfPi = pi / 2,
12628
+ sa = parseFloat(orientation.value) / 180 * pi - halfPi;
12629
+ return {
12630
+ gradient: "conical",
12631
+ x: .5,
12632
+ y: .5,
12633
+ startAngle: sa,
12634
+ endAngle: sa + pi2,
12635
+ stops: colorStops.map(item => ({
12636
+ color: item.value,
12637
+ offset: parseFloat(item.length.value) / 100
12638
+ }))
12639
+ };
12640
+ }
12641
+ static ParseRadial(datum) {
12642
+ const {
12643
+ colorStops = []
12644
+ } = datum;
12645
+ return {
12646
+ gradient: "radial",
12647
+ x0: .5,
12648
+ y0: .5,
12649
+ x1: .5,
12650
+ y1: .5,
12651
+ r0: 0,
12652
+ r1: 1,
12653
+ stops: colorStops.map(item => ({
12654
+ color: item.value,
12655
+ offset: parseFloat(item.length.value) / 100
12656
+ }))
12657
+ };
12658
+ }
12659
+ static ParseLinear(datum) {
12660
+ const {
12661
+ orientation: orientation,
12662
+ colorStops = []
12663
+ } = datum,
12664
+ halfPi = pi / 2;
12665
+ let angle = "angular" === orientation.type ? parseFloat(orientation.value) / 180 * pi : 0;
12666
+ for (; angle < 0;) angle += pi2;
12667
+ for (; angle > pi2;) angle -= pi2;
12668
+ let x0 = 0,
12669
+ y0 = 0,
12670
+ x1 = 0,
12671
+ y1 = 0;
12672
+ return angle < halfPi ? (x0 = 0, y0 = 1, x1 = Math.sin(angle), y1 = Math.cos(angle)) : angle < pi ? (x0 = 0, y0 = 0, x1 = Math.cos(angle - halfPi), y1 = Math.sin(angle - halfPi)) : angle < pi + halfPi ? (x0 = 1, y0 = 0, x1 = x0 - Math.sin(angle - pi), y1 = Math.cos(angle - pi)) : (x0 = 1, x1 = x0 - Math.cos(angle - halfPi - pi), y1 -= Math.sin(angle - halfPi - pi)), {
12673
+ gradient: "linear",
12674
+ x0: x0,
12675
+ y0: y0,
12676
+ x1: x1,
12677
+ y1: y1,
12678
+ stops: colorStops.map(item => ({
12679
+ color: item.value,
12680
+ offset: parseFloat(item.length.value) / 100
12681
+ }))
12682
+ };
12683
+ }
12684
+ }
12685
+
12405
12686
  function getScaledStroke(context, width, dpr) {
12406
12687
  let strokeWidth = width;
12407
12688
  const {
@@ -12418,7 +12699,7 @@
12418
12699
  if (!c || !0 === c) return "black";
12419
12700
  let result, color;
12420
12701
  if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
12421
- return "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)), result || "orange");
12702
+ return color = GradientParser.Parse(color), "string" == typeof color ? color : ("linear" === color.gradient ? result = createLinearGradient(context, color, params, offsetX, offsetY) : "conical" === color.gradient ? result = createConicGradient(context, color, params, offsetX, offsetY) : "radial" === color.gradient && (result = createRadialGradient(context, color, params, offsetX, offsetY)), result || "orange");
12422
12703
  }
12423
12704
  function createLinearGradient(context, color, params) {
12424
12705
  let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
@@ -14631,7 +14912,9 @@
14631
14912
  image: url
14632
14913
  } = image.attribute;
14633
14914
  if (!url || !image.resources) return;
14634
- if ("success" !== image.resources.get(url).state) return;
14915
+ const res = image.resources.get(url);
14916
+ if ("loading" === res.state && isString$2(url)) return void ResourceLoader.improveImageLoading(url);
14917
+ if ("success" !== res.state) return;
14635
14918
  const {
14636
14919
  context: context
14637
14920
  } = renderService.drawParams;
@@ -14671,6 +14954,197 @@
14671
14954
  },
14672
14955
  __metadata$H = undefined && undefined.__metadata || function (k, v) {
14673
14956
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
14957
+ };
14958
+ const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
14959
+ const tempDirtyBounds = new AABBBounds();
14960
+ class ShadowRootDrawItemInterceptorContribution {
14961
+ constructor() {
14962
+ this.order = 1;
14963
+ }
14964
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
14965
+ return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
14966
+ }
14967
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
14968
+ return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
14969
+ }
14970
+ drawItem(graphic, renderService, drawContext, drawContribution, params) {
14971
+ if (!graphic.shadowRoot) return !1;
14972
+ const {
14973
+ context: context
14974
+ } = drawContext;
14975
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
14976
+ tempDirtyBounds.copy(drawContribution.dirtyBounds);
14977
+ const m = graphic.globalTransMatrix.getInverse();
14978
+ drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
14979
+ }
14980
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
14981
+ }
14982
+ }
14983
+ class DebugDrawItemInterceptorContribution {
14984
+ constructor() {
14985
+ this.order = 1;
14986
+ }
14987
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
14988
+ return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
14989
+ }
14990
+ drawItem(graphic, renderService, drawContext, drawContribution, params) {
14991
+ if (!graphic.attribute._debug_bounds) return !1;
14992
+ const {
14993
+ context: context
14994
+ } = drawContext;
14995
+ context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
14996
+ const b = graphic.AABBBounds;
14997
+ return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
14998
+ }
14999
+ }
15000
+ let CommonDrawItemInterceptorContribution = class {
15001
+ constructor() {
15002
+ this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
15003
+ }
15004
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15005
+ for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
15006
+ return !1;
15007
+ }
15008
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15009
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
15010
+ for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
15011
+ return !1;
15012
+ }
15013
+ };
15014
+ CommonDrawItemInterceptorContribution = __decorate$Y([injectable(), __metadata$H("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
15015
+ class InteractiveDrawItemInterceptorContribution {
15016
+ constructor() {
15017
+ this.order = 1;
15018
+ }
15019
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15020
+ return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
15021
+ }
15022
+ beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
15023
+ let interactiveGraphic = graphic.interactiveGraphic;
15024
+ if (graphic.attribute.globalZIndex) {
15025
+ interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
15026
+ globalZIndex: 0,
15027
+ zIndex: graphic.attribute.globalZIndex
15028
+ }, !1, {
15029
+ skipUpdateCallback: !0
15030
+ }), drawContext.stage.tryInitInteractiveLayer();
15031
+ const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
15032
+ if (interactiveLayer) {
15033
+ this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
15034
+ }
15035
+ return !0;
15036
+ }
15037
+ if (interactiveGraphic) {
15038
+ drawContext.stage.tryInitInteractiveLayer();
15039
+ const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
15040
+ if (interactiveLayer) {
15041
+ this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
15042
+ }
15043
+ graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
15044
+ }
15045
+ return !1;
15046
+ }
15047
+ beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
15048
+ const baseGraphic = graphic.baseGraphic;
15049
+ if (baseGraphic) {
15050
+ this.processing = !0;
15051
+ const {
15052
+ context: context
15053
+ } = drawContext;
15054
+ return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
15055
+ }
15056
+ return !1;
15057
+ }
15058
+ getShadowRoot(interactiveLayer) {
15059
+ var _a;
15060
+ let group = interactiveLayer.getElementById("_interactive_group");
15061
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
15062
+ }
15063
+ }
15064
+ class Canvas3DDrawItemInterceptor {
15065
+ constructor() {
15066
+ this.order = 1;
15067
+ }
15068
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15069
+ if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
15070
+ drawContext.in3dInterceptor = !0;
15071
+ const {
15072
+ context: context,
15073
+ stage: stage
15074
+ } = renderService.drawParams;
15075
+ context.canvas;
15076
+ context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
15077
+ const m = context.currentMatrix;
15078
+ m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
15079
+ const matrix = mat4Allocate.allocate();
15080
+ mat3Tomat4(matrix, m);
15081
+ const lastModelMatrix = context.modelMatrix;
15082
+ if (lastModelMatrix) {
15083
+ if (matrix) {
15084
+ const m = mat4Allocate.allocate();
15085
+ context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
15086
+ }
15087
+ } else context.modelMatrix = matrix;
15088
+ if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
15089
+ let isPie = !1,
15090
+ is3d = !1;
15091
+ if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
15092
+ const children = graphic.getChildren(),
15093
+ sortedChildren = [...children];
15094
+ sortedChildren.sort((a, b) => {
15095
+ var _a, _b, _c, _d;
15096
+ let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
15097
+ angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
15098
+ for (; angle1 < 0;) angle1 += pi2;
15099
+ for (; angle2 < 0;) angle2 += pi2;
15100
+ return angle2 - angle1;
15101
+ }), sortedChildren.forEach(c => {
15102
+ c._next = null, c._prev = null;
15103
+ }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
15104
+ graphic.appendChild(c);
15105
+ });
15106
+ const m = graphic.parent.globalTransMatrix;
15107
+ drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, m), graphic.removeAllChild(), children.forEach(c => {
15108
+ c._next = null, c._prev = null;
15109
+ }), children.forEach(c => {
15110
+ graphic.appendChild(c);
15111
+ });
15112
+ } else if (is3d) {
15113
+ const children = graphic.getChildren(),
15114
+ zChildren = children.map(g => ({
15115
+ ave_z: g.findFace().vertices.map(v => {
15116
+ var _a;
15117
+ return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
15118
+ }).reduce((a, b) => a + b, 0),
15119
+ g: g
15120
+ }));
15121
+ zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
15122
+ i.g._next = null, i.g._prev = null;
15123
+ }), graphic.update(), zChildren.forEach(i => {
15124
+ graphic.add(i.g);
15125
+ }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
15126
+ g._next = null, g._prev = null;
15127
+ }), graphic.update(), children.forEach(g => {
15128
+ graphic.add(g);
15129
+ });
15130
+ } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
15131
+ } else drawContribution.renderItem(graphic, drawContext);
15132
+ return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
15133
+ }
15134
+ initCanvasCtx(context) {
15135
+ context.setTransformForCurrent();
15136
+ }
15137
+ }
15138
+
15139
+ var __decorate$X = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15140
+ var d,
15141
+ c = arguments.length,
15142
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
15143
+ if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
15144
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15145
+ },
15146
+ __metadata$G = undefined && undefined.__metadata || function (k, v) {
15147
+ if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
14674
15148
  },
14675
15149
  __param$u = undefined && undefined.__param || function (paramIndex, decorator) {
14676
15150
  return function (target, key) {
@@ -14709,7 +15183,7 @@
14709
15183
  this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
14710
15184
  }
14711
15185
  };
14712
- DefaultRenderService = __decorate$Y([injectable(), __param$u(0, inject(DrawContribution)), __metadata$H("design:paramtypes", [Object])], DefaultRenderService);
15186
+ DefaultRenderService = __decorate$X([injectable(), __param$u(0, inject(DrawContribution)), __metadata$G("design:paramtypes", [Object])], DefaultRenderService);
14713
15187
 
14714
15188
  var renderModule$1 = new ContainerModule(bind => {
14715
15189
  bind(RenderService).to(DefaultRenderService).inSingletonScope();
@@ -14718,7 +15192,7 @@
14718
15192
  const PickerService = Symbol.for("PickerService");
14719
15193
  const GlobalPickerService = Symbol.for("GlobalPickerService");
14720
15194
 
14721
- var __decorate$X = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15195
+ var __decorate$W = undefined && undefined.__decorate || function (decorators, target, key, desc) {
14722
15196
  var d,
14723
15197
  c = arguments.length,
14724
15198
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
@@ -14751,7 +15225,7 @@
14751
15225
  return context.highPerformanceRestore(), result;
14752
15226
  }
14753
15227
  };
14754
- ShadowRootPickItemInterceptorContribution = __decorate$X([injectable()], ShadowRootPickItemInterceptorContribution);
15228
+ ShadowRootPickItemInterceptorContribution = __decorate$W([injectable()], ShadowRootPickItemInterceptorContribution);
14755
15229
  let InteractivePickItemInterceptorContribution = class {
14756
15230
  constructor() {
14757
15231
  this.order = 1;
@@ -14770,7 +15244,7 @@
14770
15244
  return null;
14771
15245
  }
14772
15246
  };
14773
- InteractivePickItemInterceptorContribution = __decorate$X([injectable()], InteractivePickItemInterceptorContribution);
15247
+ InteractivePickItemInterceptorContribution = __decorate$W([injectable()], InteractivePickItemInterceptorContribution);
14774
15248
  let Canvas3DPickItemInterceptor = class {
14775
15249
  constructor() {
14776
15250
  this.order = 1;
@@ -14830,7 +15304,7 @@
14830
15304
  context.setTransformForCurrent();
14831
15305
  }
14832
15306
  };
14833
- Canvas3DPickItemInterceptor = __decorate$X([injectable()], Canvas3DPickItemInterceptor);
15307
+ Canvas3DPickItemInterceptor = __decorate$W([injectable()], Canvas3DPickItemInterceptor);
14834
15308
 
14835
15309
  var pickModule = new ContainerModule((bind, unbind, isBound) => {
14836
15310
  isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(Canvas3DPickItemInterceptor), bind(ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(ShadowRootPickItemInterceptorContribution), bind(InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
@@ -14843,14 +15317,14 @@
14843
15317
  const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
14844
15318
  const PluginService = Symbol.for("PluginService");
14845
15319
 
14846
- var __decorate$W = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15320
+ var __decorate$V = undefined && undefined.__decorate || function (decorators, target, key, desc) {
14847
15321
  var d,
14848
15322
  c = arguments.length,
14849
15323
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
14850
15324
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
14851
15325
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14852
15326
  },
14853
- __metadata$G = undefined && undefined.__metadata || function (k, v) {
15327
+ __metadata$F = undefined && undefined.__metadata || function (k, v) {
14854
15328
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
14855
15329
  },
14856
15330
  __param$t = undefined && undefined.__param || function (paramIndex, decorator) {
@@ -14893,7 +15367,7 @@
14893
15367
  }), this.onRegisterPlugin = [];
14894
15368
  }
14895
15369
  };
14896
- DefaultPluginService = __decorate$W([injectable(), __param$t(0, inject(ContributionProvider)), __param$t(0, named(AutoEnablePlugins)), __metadata$G("design:paramtypes", [Object])], DefaultPluginService);
15370
+ DefaultPluginService = __decorate$V([injectable(), __param$t(0, inject(ContributionProvider)), __param$t(0, named(AutoEnablePlugins)), __metadata$F("design:paramtypes", [Object])], DefaultPluginService);
14897
15371
 
14898
15372
  var pluginModule = new ContainerModule(bind => {
14899
15373
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -14907,14 +15381,14 @@
14907
15381
  bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
14908
15382
  });
14909
15383
 
14910
- var __decorate$V = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15384
+ var __decorate$U = undefined && undefined.__decorate || function (decorators, target, key, desc) {
14911
15385
  var d,
14912
15386
  c = arguments.length,
14913
15387
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
14914
15388
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
14915
15389
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14916
15390
  },
14917
- __metadata$F = undefined && undefined.__metadata || function (k, v) {
15391
+ __metadata$E = undefined && undefined.__metadata || function (k, v) {
14918
15392
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
14919
15393
  };
14920
15394
  let CanvasLayerHandlerContribution = class {
@@ -14984,16 +15458,16 @@
14984
15458
  this.canvas.release();
14985
15459
  }
14986
15460
  };
14987
- CanvasLayerHandlerContribution = __decorate$V([injectable(), __metadata$F("design:paramtypes", [])], CanvasLayerHandlerContribution);
15461
+ CanvasLayerHandlerContribution = __decorate$U([injectable(), __metadata$E("design:paramtypes", [])], CanvasLayerHandlerContribution);
14988
15462
 
14989
- var __decorate$U = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15463
+ var __decorate$T = undefined && undefined.__decorate || function (decorators, target, key, desc) {
14990
15464
  var d,
14991
15465
  c = arguments.length,
14992
15466
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
14993
15467
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
14994
15468
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14995
15469
  },
14996
- __metadata$E = undefined && undefined.__metadata || function (k, v) {
15470
+ __metadata$D = undefined && undefined.__metadata || function (k, v) {
14997
15471
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
14998
15472
  };
14999
15473
  let EmptyLayerHandlerContribution = class {
@@ -15028,16 +15502,16 @@
15028
15502
  }
15029
15503
  release() {}
15030
15504
  };
15031
- EmptyLayerHandlerContribution = __decorate$U([injectable(), __metadata$E("design:paramtypes", [])], EmptyLayerHandlerContribution);
15505
+ EmptyLayerHandlerContribution = __decorate$T([injectable(), __metadata$D("design:paramtypes", [])], EmptyLayerHandlerContribution);
15032
15506
 
15033
- var __decorate$T = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15507
+ var __decorate$S = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15034
15508
  var d,
15035
15509
  c = arguments.length,
15036
15510
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
15037
15511
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
15038
15512
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15039
15513
  },
15040
- __metadata$D = undefined && undefined.__metadata || function (k, v) {
15514
+ __metadata$C = undefined && undefined.__metadata || function (k, v) {
15041
15515
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
15042
15516
  };
15043
15517
  let OffscreenLayerHandlerContribution = class {
@@ -15099,7 +15573,7 @@
15099
15573
  }
15100
15574
  merge(layerHandlers) {}
15101
15575
  };
15102
- OffscreenLayerHandlerContribution = __decorate$T([injectable(), __metadata$D("design:paramtypes", [])], OffscreenLayerHandlerContribution);
15576
+ OffscreenLayerHandlerContribution = __decorate$S([injectable(), __metadata$C("design:paramtypes", [])], OffscreenLayerHandlerContribution);
15103
15577
 
15104
15578
  var layerHandlerModules = new ContainerModule(bind => {
15105
15579
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -15215,197 +15689,6 @@
15215
15689
  return result;
15216
15690
  }
15217
15691
 
15218
- var __decorate$S = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15219
- var d,
15220
- c = arguments.length,
15221
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
15222
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
15223
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15224
- },
15225
- __metadata$C = undefined && undefined.__metadata || function (k, v) {
15226
- if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
15227
- };
15228
- const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
15229
- const tempDirtyBounds = new AABBBounds();
15230
- class ShadowRootDrawItemInterceptorContribution {
15231
- constructor() {
15232
- this.order = 1;
15233
- }
15234
- afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15235
- return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
15236
- }
15237
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15238
- return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
15239
- }
15240
- drawItem(graphic, renderService, drawContext, drawContribution, params) {
15241
- if (!graphic.shadowRoot) return !1;
15242
- const {
15243
- context: context
15244
- } = drawContext;
15245
- if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
15246
- tempDirtyBounds.copy(drawContribution.dirtyBounds);
15247
- const m = graphic.globalTransMatrix.getInverse();
15248
- drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
15249
- }
15250
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
15251
- }
15252
- }
15253
- class DebugDrawItemInterceptorContribution {
15254
- constructor() {
15255
- this.order = 1;
15256
- }
15257
- afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15258
- return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
15259
- }
15260
- drawItem(graphic, renderService, drawContext, drawContribution, params) {
15261
- if (!graphic.attribute._debug_bounds) return !1;
15262
- const {
15263
- context: context
15264
- } = drawContext;
15265
- context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
15266
- const b = graphic.AABBBounds;
15267
- return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
15268
- }
15269
- }
15270
- let CommonDrawItemInterceptorContribution = class {
15271
- constructor() {
15272
- this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
15273
- }
15274
- afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15275
- for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
15276
- return !1;
15277
- }
15278
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15279
- if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
15280
- for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
15281
- return !1;
15282
- }
15283
- };
15284
- CommonDrawItemInterceptorContribution = __decorate$S([injectable(), __metadata$C("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
15285
- class InteractiveDrawItemInterceptorContribution {
15286
- constructor() {
15287
- this.order = 1;
15288
- }
15289
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15290
- return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
15291
- }
15292
- beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
15293
- let interactiveGraphic = graphic.interactiveGraphic;
15294
- if (graphic.attribute.globalZIndex) {
15295
- interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
15296
- globalZIndex: 0,
15297
- zIndex: graphic.attribute.globalZIndex
15298
- }, !1, {
15299
- skipUpdateCallback: !0
15300
- }), drawContext.stage.tryInitInteractiveLayer();
15301
- const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
15302
- if (interactiveLayer) {
15303
- this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
15304
- }
15305
- return !0;
15306
- }
15307
- if (interactiveGraphic) {
15308
- drawContext.stage.tryInitInteractiveLayer();
15309
- const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
15310
- if (interactiveLayer) {
15311
- this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
15312
- }
15313
- graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
15314
- }
15315
- return !1;
15316
- }
15317
- beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
15318
- const baseGraphic = graphic.baseGraphic;
15319
- if (baseGraphic) {
15320
- this.processing = !0;
15321
- const {
15322
- context: context
15323
- } = drawContext;
15324
- return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
15325
- }
15326
- return !1;
15327
- }
15328
- getShadowRoot(interactiveLayer) {
15329
- var _a;
15330
- let group = interactiveLayer.getElementById("_interactive_group");
15331
- return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
15332
- }
15333
- }
15334
- class Canvas3DDrawItemInterceptor {
15335
- constructor() {
15336
- this.order = 1;
15337
- }
15338
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
15339
- if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
15340
- drawContext.in3dInterceptor = !0;
15341
- const {
15342
- context: context,
15343
- stage: stage
15344
- } = renderService.drawParams;
15345
- context.canvas;
15346
- context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
15347
- const m = context.currentMatrix;
15348
- m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
15349
- const matrix = mat4Allocate.allocate();
15350
- mat3Tomat4(matrix, m);
15351
- const lastModelMatrix = context.modelMatrix;
15352
- if (lastModelMatrix) {
15353
- if (matrix) {
15354
- const m = mat4Allocate.allocate();
15355
- context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
15356
- }
15357
- } else context.modelMatrix = matrix;
15358
- if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
15359
- let isPie = !1,
15360
- is3d = !1;
15361
- if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
15362
- const children = graphic.getChildren(),
15363
- sortedChildren = [...children];
15364
- sortedChildren.sort((a, b) => {
15365
- var _a, _b, _c, _d;
15366
- let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
15367
- angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
15368
- for (; angle1 < 0;) angle1 += pi2;
15369
- for (; angle2 < 0;) angle2 += pi2;
15370
- return angle2 - angle1;
15371
- }), sortedChildren.forEach(c => {
15372
- c._next = null, c._prev = null;
15373
- }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
15374
- graphic.appendChild(c);
15375
- });
15376
- const m = graphic.parent.globalTransMatrix;
15377
- drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, m), graphic.removeAllChild(), children.forEach(c => {
15378
- c._next = null, c._prev = null;
15379
- }), children.forEach(c => {
15380
- graphic.appendChild(c);
15381
- });
15382
- } else if (is3d) {
15383
- const children = graphic.getChildren(),
15384
- zChildren = children.map(g => ({
15385
- ave_z: g.findFace().vertices.map(v => {
15386
- var _a;
15387
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
15388
- }).reduce((a, b) => a + b, 0),
15389
- g: g
15390
- }));
15391
- zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
15392
- i.g._next = null, i.g._prev = null;
15393
- }), graphic.update(), zChildren.forEach(i => {
15394
- graphic.add(i.g);
15395
- }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
15396
- g._next = null, g._prev = null;
15397
- }), graphic.update(), children.forEach(g => {
15398
- graphic.add(g);
15399
- });
15400
- } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
15401
- } else drawContribution.renderItem(graphic, drawContext);
15402
- return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
15403
- }
15404
- initCanvasCtx(context) {
15405
- context.setTransformForCurrent();
15406
- }
15407
- }
15408
-
15409
15692
  var __decorate$R = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15410
15693
  var d,
15411
15694
  c = arguments.length,
@@ -15951,11 +16234,10 @@
15951
16234
  container.load(renderModule);
15952
16235
  }
15953
16236
 
15954
- let loaded$l = !1;
15955
16237
  function preLoadAllModule() {
15956
- loaded$l || (loaded$l = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
16238
+ preLoadAllModule.__loaded || (preLoadAllModule.__loaded = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
15957
16239
  }
15958
- preLoadAllModule();
16240
+ preLoadAllModule.__loaded = !1, preLoadAllModule();
15959
16241
  const vglobal = container.get(VGlobal);
15960
16242
  application.global = vglobal;
15961
16243
  const graphicUtil = container.get(GraphicUtil);
@@ -16113,7 +16395,7 @@
16113
16395
  wrapGroup: wrapGroup
16114
16396
  } = _ref;
16115
16397
  application.global.removeDom(wrapGroup);
16116
- }), nativeDom = "string" == typeof dom ? new DOMParser().parseFromString(dom, "text/html").firstChild : dom;
16398
+ }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
16117
16399
  const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
16118
16400
  nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
16119
16401
  const wrapGroup = application.global.createDom({
@@ -18964,10 +19246,11 @@
18964
19246
  };
18965
19247
  DefaultCanvasGroupPicker = __decorate$A([injectable()], DefaultCanvasGroupPicker);
18966
19248
 
18967
- let loaded$k = !1;
18968
- var canvasModule = new ContainerModule((bind, unbind, isBound, rebind) => {
18969
- loaded$k || (loaded$k = !0, bind(CanvasGroupPicker).to(DefaultCanvasGroupPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(bind, CanvasPickerContribution));
19249
+ const m = new ContainerModule((bind, unbind, isBound, rebind) => {
19250
+ m.__vloaded || (m.__vloaded = !0, bind(CanvasGroupPicker).to(DefaultCanvasGroupPicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(bind, CanvasPickerContribution));
18970
19251
  });
19252
+ m.__vloaded = !1;
19253
+ var canvasModule = m;
18971
19254
 
18972
19255
  const canvasPickerModule = new ContainerModule((bind, unbind, isBound, rebind) => {
18973
19256
  isBound(DefaultCanvasPickerService) || bind(DefaultCanvasPickerService).toSelf().inSingletonScope(), isBound(PickerService) ? rebind(PickerService).toService(DefaultCanvasPickerService) : bind(PickerService).toService(DefaultCanvasPickerService);
@@ -19227,7 +19510,7 @@
19227
19510
  }
19228
19511
  getNativeAABBBounds(_dom) {
19229
19512
  let dom = _dom;
19230
- if ("string" == typeof _dom && (dom = new DOMParser().parseFromString(_dom, "text/html").firstChild), dom.getBoundingClientRect) {
19513
+ if ("string" == typeof _dom && (dom = new DOMParser().parseFromString(_dom, "text/html").firstChild, dom.lastChild && (dom = dom.lastChild.firstChild)), dom.getBoundingClientRect) {
19231
19514
  const b = dom.getBoundingClientRect();
19232
19515
  return new DynamicB(b);
19233
19516
  }
@@ -19340,15 +19623,15 @@
19340
19623
  };
19341
19624
  BrowserEnvContribution = __decorate$y([injectable(), __metadata$q("design:paramtypes", [])], BrowserEnvContribution);
19342
19625
 
19343
- let isBrowserBound = !1;
19344
19626
  const browserEnvModule = new ContainerModule(bind => {
19345
- isBrowserBound || (isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
19627
+ browserEnvModule.isBrowserBound || (browserEnvModule.isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
19346
19628
  });
19347
- let loaded$j = !1;
19629
+ browserEnvModule.isBrowserBound = !1;
19348
19630
  function loadBrowserEnv(container) {
19349
19631
  let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19350
- loaded$j || (loaded$j = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
19632
+ loadBrowserEnv.__loaded || (loadBrowserEnv.__loaded = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
19351
19633
  }
19634
+ loadBrowserEnv.__loaded = !1;
19352
19635
 
19353
19636
  var __decorate$x = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19354
19637
  var d,
@@ -19590,14 +19873,14 @@
19590
19873
  };
19591
19874
  NodeEnvContribution = __decorate$u([injectable()], NodeEnvContribution);
19592
19875
 
19593
- let isNodeBound = !1;
19594
19876
  const nodeEnvModule = new ContainerModule(bind => {
19595
- isNodeBound || (isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
19877
+ nodeEnvModule.isNodeBound || (nodeEnvModule.isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
19596
19878
  });
19597
- let loaded$i = !1;
19879
+ nodeEnvModule.isNodeBound = !1;
19598
19880
  function loadNodeEnv(container) {
19599
- loaded$i || (loaded$i = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
19881
+ loadNodeEnv.__loaded || (loadNodeEnv.__loaded = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
19600
19882
  }
19883
+ loadNodeEnv.__loaded = !1;
19601
19884
 
19602
19885
  var __decorate$t = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19603
19886
  var d,
@@ -20905,95 +21188,113 @@
20905
21188
 
20906
21189
  const browser$1 = isBrowserEnv();
20907
21190
 
20908
- let loaded$h = !1;
20909
- function registerArc() {
20910
- loaded$h || (loaded$h = !0, registerArcGraphic(), container.load(arcModule), container.load(browser$1 ? arcCanvasPickModule : arcMathPickModule));
21191
+ function _registerArc() {
21192
+ _registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser$1 ? arcCanvasPickModule : arcMathPickModule));
20911
21193
  }
21194
+ _registerArc.__loaded = !1;
21195
+ const registerArc = _registerArc;
20912
21196
 
20913
- let loaded$g = !1;
20914
- function registerArc3d() {
20915
- loaded$g || (loaded$g = !0, registerArc3dGraphic(), container.load(arc3dModule), container.load(arc3dCanvasPickModule));
21197
+ function _registerArc3d() {
21198
+ _registerArc3d.__loaded || (_registerArc3d.__loaded = !0, registerArc3dGraphic(), container.load(arc3dModule), container.load(arc3dCanvasPickModule));
20916
21199
  }
21200
+ _registerArc3d.__loaded = !1;
21201
+ const registerArc3d = _registerArc3d;
20917
21202
 
20918
- let loaded$f = !1;
20919
- function registerArea() {
20920
- loaded$f || (loaded$f = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser$1 ? areaCanvasPickModule : areaMathPickModule));
21203
+ function _registerArea() {
21204
+ _registerArea.__loaded || (_registerArea.__loaded = !0, registerAreaGraphic(), container.load(areaModule), container.load(browser$1 ? areaCanvasPickModule : areaMathPickModule));
20921
21205
  }
21206
+ _registerArea.__loaded = !1;
21207
+ const registerArea = _registerArea;
20922
21208
 
20923
- let loaded$e = !1;
20924
- function registerCircle() {
20925
- loaded$e || (loaded$e = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser$1 ? circleCanvasPickModule : circleMathPickModule));
21209
+ function _registerCircle() {
21210
+ _registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser$1 ? circleCanvasPickModule : circleMathPickModule));
20926
21211
  }
21212
+ _registerCircle.__loaded = !1;
21213
+ const registerCircle = _registerCircle;
20927
21214
 
20928
- let loaded$d = !1;
20929
- function registerGlyph() {
20930
- loaded$d || (loaded$d = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser$1 ? glyphCanvasPickModule : glyphMathPickModule));
21215
+ function _registerGlyph() {
21216
+ _registerGlyph.__loaded || (_registerGlyph.__loaded = !0, registerGlyphGraphic(), container.load(glyphModule), container.load(browser$1 ? glyphCanvasPickModule : glyphMathPickModule));
20931
21217
  }
21218
+ _registerGlyph.__loaded = !1;
21219
+ const registerGlyph = _registerGlyph;
20932
21220
 
20933
- let loaded$c = !1;
20934
- function registerGroup() {
20935
- loaded$c || (loaded$c = !0, registerGroupGraphic());
21221
+ function _registerGroup() {
21222
+ _registerGroup.__loaded || (_registerGroup.__loaded = !0, registerGroupGraphic());
20936
21223
  }
21224
+ _registerGroup.__loaded = !1;
21225
+ const registerGroup = _registerGroup;
20937
21226
 
20938
- let loaded$b = !1;
20939
- function registerImage() {
20940
- loaded$b || (loaded$b = !0, registerImageGraphic(), container.load(imageModule), container.load(browser$1 ? imageCanvasPickModule : imageMathPickModule));
21227
+ function _registerImage() {
21228
+ _registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser$1 ? imageCanvasPickModule : imageMathPickModule));
20941
21229
  }
21230
+ _registerImage.__loaded = !1;
21231
+ const registerImage = _registerImage;
20942
21232
 
20943
- let loaded$a = !1;
20944
- function registerLine() {
20945
- loaded$a || (loaded$a = !0, registerLineGraphic(), container.load(lineModule), container.load(browser$1 ? lineCanvasPickModule : lineMathPickModule));
21233
+ function _registerLine() {
21234
+ _registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser$1 ? lineCanvasPickModule : lineMathPickModule));
20946
21235
  }
21236
+ _registerLine.__loaded = !1;
21237
+ const registerLine = _registerLine;
20947
21238
 
20948
- let loaded$9 = !1;
20949
- function registerPath() {
20950
- loaded$9 || (loaded$9 = !0, registerPathGraphic(), container.load(pathModule), container.load(browser$1 ? pathCanvasPickModule : pathMathPickModule));
21239
+ function _registerPath() {
21240
+ _registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser$1 ? pathCanvasPickModule : pathMathPickModule));
20951
21241
  }
21242
+ _registerPath.__loaded = !1;
21243
+ const registerPath = _registerPath;
20952
21244
 
20953
- let loaded$8 = !1;
20954
- function registerPolygon() {
20955
- loaded$8 || (loaded$8 = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser$1 ? polygonCanvasPickModule : polygonMathPickModule));
21245
+ function _registerPolygon() {
21246
+ _registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser$1 ? polygonCanvasPickModule : polygonMathPickModule));
20956
21247
  }
21248
+ _registerPolygon.__loaded = !1;
21249
+ const registerPolygon = _registerPolygon;
20957
21250
 
20958
- let loaded$7 = !1;
20959
- function registerPyramid3d() {
20960
- loaded$7 || (loaded$7 = !0, registerPyramid3dGraphic(), container.load(pyramid3dModule), container.load(pyramid3dCanvasPickModule));
21251
+ function _registerPyramid3d() {
21252
+ _registerPyramid3d.__loaded || (_registerPyramid3d.__loaded = !0, registerPyramid3dGraphic(), container.load(pyramid3dModule), container.load(pyramid3dCanvasPickModule));
20961
21253
  }
21254
+ _registerPyramid3d.__loaded = !1;
21255
+ const registerPyramid3d = _registerPyramid3d;
20962
21256
 
20963
- let loaded$6 = !1;
20964
- function registerRect() {
20965
- loaded$6 || (loaded$6 = !0, registerRectGraphic(), container.load(rectModule), container.load(browser$1 ? rectCanvasPickModule : rectMathPickModule));
21257
+ function _registerRect() {
21258
+ _registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser$1 ? rectCanvasPickModule : rectMathPickModule));
20966
21259
  }
21260
+ _registerRect.__loaded = !1;
21261
+ const registerRect = _registerRect;
20967
21262
 
20968
- let loaded$5 = !1;
20969
- function registerRect3d() {
20970
- loaded$5 || (loaded$5 = !0, registerRect3dGraphic(), container.load(rect3dModule), container.load(rect3dCanvasPickModule));
21263
+ function _registerRect3d() {
21264
+ _registerRect3d.__loaded || (_registerRect3d.__loaded = !0, registerRect3dGraphic(), container.load(rect3dModule), container.load(rect3dCanvasPickModule));
20971
21265
  }
21266
+ _registerRect3d.__loaded = !1;
21267
+ const registerRect3d = _registerRect3d;
20972
21268
 
20973
- let loaded$4 = !1;
20974
- function registerRichtext() {
20975
- loaded$4 || (loaded$4 = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser$1 ? richtextCanvasPickModule : richTextMathPickModule));
21269
+ function _registerRichtext() {
21270
+ _registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser$1 ? richtextCanvasPickModule : richTextMathPickModule));
20976
21271
  }
21272
+ _registerRichtext.__loaded = !1;
21273
+ const registerRichtext = _registerRichtext;
20977
21274
 
20978
- let loaded$3 = !1;
20979
- function registerShadowRoot() {
20980
- loaded$3 || (loaded$3 = !0, registerShadowRootGraphic());
21275
+ function _registerShadowRoot() {
21276
+ _registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
20981
21277
  }
21278
+ _registerShadowRoot.__loaded = !1;
21279
+ const registerShadowRoot = _registerShadowRoot;
20982
21280
 
20983
- let loaded$2 = !1;
20984
- function registerSymbol() {
20985
- loaded$2 || (loaded$2 = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser$1 ? symbolCanvasPickModule : symbolMathPickModule));
21281
+ function _registerSymbol() {
21282
+ _registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser$1 ? symbolCanvasPickModule : symbolMathPickModule));
20986
21283
  }
21284
+ _registerSymbol.__loaded = !1;
21285
+ const registerSymbol = _registerSymbol;
20987
21286
 
20988
- let loaded$1 = !1;
20989
- function registerText() {
20990
- loaded$1 || (loaded$1 = !0, registerTextGraphic(), container.load(textModule), container.load(browser$1 ? textCanvasPickModule : textMathPickModule));
21287
+ function _registerText() {
21288
+ _registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser$1 ? textCanvasPickModule : textMathPickModule));
20991
21289
  }
21290
+ _registerText.__loaded = !1;
21291
+ const registerText = _registerText;
20992
21292
 
20993
- let loaded = !1;
20994
- function registerWrapText() {
20995
- loaded || (loaded = !0, registerWrapTextGraphic());
21293
+ function _registerWrapText() {
21294
+ _registerWrapText.__loaded || (_registerWrapText.__loaded = !0, registerWrapTextGraphic());
20996
21295
  }
21296
+ _registerWrapText.__loaded = !1;
21297
+ const registerWrapText = _registerWrapText;
20997
21298
 
20998
21299
  let registed = false;
20999
21300
  function registerForVrender() {
@@ -28635,7 +28936,7 @@
28635
28936
  }, textStyle);
28636
28937
  this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
28637
28938
  } else isValid$1(text) && (this._mainTitle = group.createOrUpdateChild("mainTitle", Object.assign(Object.assign({
28638
- text: [text]
28939
+ text: isArray$1(text) ? text : [text]
28639
28940
  }, textStyle), {
28640
28941
  maxLineWidth: null !== (_t = textStyle.maxLineWidth) && void 0 !== _t ? _t : width,
28641
28942
  heightLimit: textStyle.heightLimit,
@@ -28676,7 +28977,7 @@
28676
28977
  }, subtextStyle);
28677
28978
  this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
28678
28979
  } else isValid$1(subtext) && (this._subTitle = group.createOrUpdateChild("subTitle", Object.assign(Object.assign({
28679
- text: [subtext]
28980
+ text: isArray$1(subtext) ? subtext : [subtext]
28680
28981
  }, subtextStyle), {
28681
28982
  maxLineWidth: null !== (_12 = subtextStyle.maxLineWidth) && void 0 !== _12 ? _12 : width,
28682
28983
  heightLimit: subtextStyle.heightLimit,
@@ -32555,6 +32856,16 @@
32555
32856
  cursor: 'pointer'
32556
32857
  };
32557
32858
  },
32859
+ get loading_pic() {
32860
+ return {
32861
+ type: 'svg',
32862
+ 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>',
32863
+ width: 400,
32864
+ height: 300,
32865
+ name: 'loading_pic',
32866
+ positionType: IconPosition.left
32867
+ };
32868
+ },
32558
32869
  get expand() {
32559
32870
  return {
32560
32871
  type: 'svg',
@@ -32627,15 +32938,21 @@
32627
32938
  }
32628
32939
 
32629
32940
  function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
32630
- let newWidth = width;
32631
- let newHeight = height;
32632
- if (newWidth > maxWidth) {
32633
- newWidth = maxWidth;
32634
- newHeight = (newWidth * height) / width;
32941
+ const rectWidth = width;
32942
+ const rectHeight = height;
32943
+ const containerWidth = maxWidth;
32944
+ const containerHeight = maxHeight;
32945
+ const containerRatio = containerWidth / containerHeight;
32946
+ const rectRatio = rectWidth / rectHeight;
32947
+ let newWidth;
32948
+ let newHeight;
32949
+ if (rectRatio > containerRatio) {
32950
+ newWidth = containerWidth;
32951
+ newHeight = newWidth / rectRatio;
32635
32952
  }
32636
- if (newHeight > maxHeight) {
32637
- newHeight = maxHeight;
32638
- newWidth = (newHeight * width) / height;
32953
+ else {
32954
+ newHeight = containerHeight;
32955
+ newWidth = newHeight * rectRatio;
32639
32956
  }
32640
32957
  return {
32641
32958
  width: newWidth,
@@ -32663,7 +32980,6 @@
32663
32980
  return { x, y };
32664
32981
  }
32665
32982
 
32666
- get$1();
32667
32983
  function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
32668
32984
  const headerStyle = table._getCellStyle(col, row);
32669
32985
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
@@ -32707,31 +33023,29 @@
32707
33023
  image.name = 'image';
32708
33024
  image.keepAspectRatio = keepAspectRatio;
32709
33025
  if (keepAspectRatio || imageAutoSizing) {
32710
- image.successCallback = () => {
32711
- const originImage = image.resources.get(image.attribute.image).data;
32712
- if (imageAutoSizing) {
32713
- _adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
32714
- }
32715
- if (keepAspectRatio) {
32716
- const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
32717
- const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellWidth - padding[1] - padding[3], cellHeight - padding[0] - padding[2]);
32718
- const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
32719
- image.setAttributes({
32720
- x: pos.x,
32721
- y: pos.y,
32722
- width: imageWidth,
32723
- height: imageHeight,
32724
- dx: isMerge ? -table.getColsWidth(cellGroup.mergeStartCol, col - 1) : 0,
32725
- dy: isMerge ? -table.getRowsHeight(cellGroup.mergeStartRow, row - 1) : 0
32726
- });
32727
- }
32728
- table.scenegraph.updateNextFrame();
32729
- };
33026
+ if (image.resources &&
33027
+ image.resources.has(image.attribute.image) &&
33028
+ image.resources.get(image.attribute.image).state === 'success') {
33029
+ updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
33030
+ }
33031
+ else {
33032
+ image.successCallback = () => {
33033
+ updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
33034
+ table.scenegraph.updateNextFrame();
33035
+ };
33036
+ }
32730
33037
  }
32731
33038
  else {
32732
- image.successCallback = () => {
33039
+ if (image.resources &&
33040
+ image.resources.has(image.attribute.image) &&
33041
+ image.resources.get(image.attribute.image).state === 'success') {
32733
33042
  updateImageCellContentWhileResize(cellGroup, col, row, table);
32734
- };
33043
+ }
33044
+ else {
33045
+ image.successCallback = () => {
33046
+ updateImageCellContentWhileResize(cellGroup, col, row, table);
33047
+ };
33048
+ }
32735
33049
  }
32736
33050
  image.failCallback = () => {
32737
33051
  const regedIcons = get$1();
@@ -32844,6 +33158,47 @@
32844
33158
  isMerge: false
32845
33159
  };
32846
33160
  }
33161
+ function updateImageDxDy(startCol, endCol, startRow, endRow, table) {
33162
+ for (let col = startCol; col <= endCol; col++) {
33163
+ for (let row = startRow; row <= endRow; row++) {
33164
+ const cellGroup = table.scenegraph.getCell(col, row);
33165
+ if (cellGroup) {
33166
+ const image = cellGroup.getChildByName('image');
33167
+ if (image) {
33168
+ image.setAttributes({
33169
+ dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
33170
+ dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
33171
+ });
33172
+ }
33173
+ }
33174
+ }
33175
+ }
33176
+ }
33177
+ function updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table) {
33178
+ const originImage = image.resources.get(image.attribute.image).data;
33179
+ const { col, row } = cellGroup;
33180
+ if (imageAutoSizing && !isDamagePic(image)) {
33181
+ _adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
33182
+ }
33183
+ if (keepAspectRatio || isDamagePic(image)) {
33184
+ const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
33185
+ const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellWidth - padding[1] - padding[3], cellHeight - padding[0] - padding[2]);
33186
+ const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
33187
+ image.setAttributes({
33188
+ x: pos.x,
33189
+ y: pos.y,
33190
+ width: imageWidth,
33191
+ height: imageHeight
33192
+ });
33193
+ if (isMerge) {
33194
+ updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
33195
+ }
33196
+ }
33197
+ }
33198
+ function isDamagePic(image) {
33199
+ const regedIcons = get$1();
33200
+ return image.attribute.image === regedIcons.damage_pic.svg;
33201
+ }
32847
33202
 
32848
33203
  function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table) {
32849
33204
  if (progressBarDefine.dependField) {
@@ -39328,6 +39683,90 @@
39328
39683
  injectable()
39329
39684
  ], SplitRectAfterRenderContribution);
39330
39685
 
39686
+ let loadingImage;
39687
+ let VTableDrawItemInterceptorContribution = class VTableDrawItemInterceptorContribution {
39688
+ order = 1;
39689
+ interceptors;
39690
+ constructor() {
39691
+ this.interceptors = [new ImageDrawItemInterceptorContribution()];
39692
+ }
39693
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
39694
+ for (let i = 0; i < this.interceptors.length; i++) {
39695
+ if (this.interceptors[i].afterDrawItem &&
39696
+ this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) {
39697
+ return true;
39698
+ }
39699
+ }
39700
+ return false;
39701
+ }
39702
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
39703
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) &&
39704
+ !graphic.shadowRoot &&
39705
+ !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) {
39706
+ return false;
39707
+ }
39708
+ for (let i = 0; i < this.interceptors.length; i++) {
39709
+ if (this.interceptors[i].beforeDrawItem &&
39710
+ this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) {
39711
+ return true;
39712
+ }
39713
+ }
39714
+ return false;
39715
+ }
39716
+ };
39717
+ VTableDrawItemInterceptorContribution = __decorate([
39718
+ injectable()
39719
+ ], VTableDrawItemInterceptorContribution);
39720
+ class ImageDrawItemInterceptorContribution {
39721
+ order = 1;
39722
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
39723
+ if (graphic.type === 'image') {
39724
+ this.drawItem(graphic, renderService, drawContext, drawContribution, params);
39725
+ }
39726
+ return false;
39727
+ }
39728
+ drawItem(graphic, renderService, drawContext, drawContribution, params) {
39729
+ const { image: url } = graphic.attribute;
39730
+ if (!url || !graphic.resources) {
39731
+ return false;
39732
+ }
39733
+ const res = graphic.resources.get(url);
39734
+ if (res.state !== 'loading') {
39735
+ return false;
39736
+ }
39737
+ if (!loadingImage) {
39738
+ const regedIcons = get$1();
39739
+ const svg = regedIcons.loading_pic.svg;
39740
+ const width = regedIcons.loading_pic.width;
39741
+ const height = regedIcons.loading_pic.height;
39742
+ loadingImage = createImage({
39743
+ width,
39744
+ height,
39745
+ image: svg
39746
+ });
39747
+ }
39748
+ const { image: loadingUrl } = loadingImage.attribute;
39749
+ if (!url || !loadingImage.resources) {
39750
+ return false;
39751
+ }
39752
+ const loadingRes = loadingImage.resources.get(loadingUrl);
39753
+ if (loadingRes.state !== 'success') {
39754
+ return false;
39755
+ }
39756
+ const { context } = drawContext;
39757
+ context.highPerformanceSave();
39758
+ graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);
39759
+ graphic.glyphHost &&
39760
+ graphic.glyphHost.parent &&
39761
+ context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, true);
39762
+ const b = graphic.AABBBounds;
39763
+ const { width, height } = calcKeepAspectRatioSize(loadingRes.data.width, loadingRes.data.height, b.width(), b.height());
39764
+ context.drawImage(loadingRes.data, b.x1 + (b.width() - width) / 2, b.y1 + (b.height() - height) / 2, width, height);
39765
+ context.highPerformanceRestore();
39766
+ return true;
39767
+ }
39768
+ }
39769
+
39331
39770
  var splitModule = new ContainerModule((bind, unbind, isBound, rebind) => {
39332
39771
  if (isBound(SplitRectBeforeRenderContribution$1)) {
39333
39772
  rebind(SplitRectBeforeRenderContribution$1).to(SplitRectBeforeRenderContribution).inSingletonScope();
@@ -39370,6 +39809,8 @@
39370
39809
  bind(GroupRenderContribution).toService(ClipBodyGroupBeforeRenderContribution);
39371
39810
  bind(ClipBodyGroupAfterRenderContribution).toSelf().inSingletonScope();
39372
39811
  bind(GroupRenderContribution).toService(ClipBodyGroupAfterRenderContribution);
39812
+ bind(VTableDrawItemInterceptorContribution).toSelf().inSingletonScope();
39813
+ bind(DrawItemInterceptor).toService(VTableDrawItemInterceptorContribution);
39373
39814
  });
39374
39815
 
39375
39816
  function computeColsWidth(table, colStart, colEnd, update) {
@@ -41863,7 +42304,7 @@
41863
42304
  });
41864
42305
  });
41865
42306
  });
41866
- changedCells.length = 0;
42307
+ changedCells.clear();
41867
42308
  const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
41868
42309
  const frozenRowsHeight = table.getFrozenRowsHeight();
41869
42310
  const frozenColsWidth = table.getFrozenColsWidth();
@@ -41962,24 +42403,26 @@
41962
42403
  const textBottom = graphic.globalAABBBounds.y2;
41963
42404
  if (textTop < minTop) {
41964
42405
  const deltaHeight = textTop - minTop;
41965
- changedCells.push({
41966
- col: cellGroup.col,
41967
- row: cellGroup.row,
41968
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
41969
- dy: cellGroup.firstChild?.attribute.dy ?? 0
41970
- });
42406
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
42407
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
42408
+ col: cellGroup.col,
42409
+ row: cellGroup.row,
42410
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
42411
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
42412
+ });
41971
42413
  cellGroup.forEachChildren((child) => {
41972
42414
  child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
41973
42415
  });
41974
42416
  }
41975
42417
  else if (textBottom > maxTop) {
41976
42418
  const deltaHeight = textBottom - maxTop;
41977
- changedCells.push({
41978
- col: cellGroup.col,
41979
- row: cellGroup.row,
41980
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
41981
- dy: cellGroup.firstChild?.attribute.dy ?? 0
41982
- });
42419
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
42420
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
42421
+ col: cellGroup.col,
42422
+ row: cellGroup.row,
42423
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
42424
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
42425
+ });
41983
42426
  cellGroup.forEachChildren((child) => {
41984
42427
  child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
41985
42428
  });
@@ -42011,24 +42454,26 @@
42011
42454
  const textRight = text.globalAABBBounds.x2;
42012
42455
  if (textLeft < minLeft) {
42013
42456
  const deltaWidth = textLeft - minLeft;
42014
- changedCells.push({
42015
- col: cellGroup.col,
42016
- row: cellGroup.row,
42017
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
42018
- dy: cellGroup.firstChild?.attribute.dy ?? 0
42019
- });
42457
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
42458
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
42459
+ col: cellGroup.col,
42460
+ row: cellGroup.row,
42461
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
42462
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
42463
+ });
42020
42464
  cellGroup.forEachChildren((child) => {
42021
42465
  child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
42022
42466
  });
42023
42467
  }
42024
42468
  else if (textRight > maxLeft) {
42025
42469
  const deltaWidth = textRight - maxLeft;
42026
- changedCells.push({
42027
- col: cellGroup.col,
42028
- row: cellGroup.row,
42029
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
42030
- dy: cellGroup.firstChild?.attribute.dy ?? 0
42031
- });
42470
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
42471
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
42472
+ col: cellGroup.col,
42473
+ row: cellGroup.row,
42474
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
42475
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
42476
+ });
42032
42477
  cellGroup.forEachChildren((child) => {
42033
42478
  child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
42034
42479
  });
@@ -50623,7 +51068,7 @@
50623
51068
  return TABLE_EVENT_TYPE;
50624
51069
  }
50625
51070
  options;
50626
- version = "0.18.1";
51071
+ version = "0.18.2-alpha.1";
50627
51072
  pagination;
50628
51073
  id = `VTable${Date.now()}`;
50629
51074
  headerStyleCache;
@@ -50768,7 +51213,7 @@
50768
51213
  this.headerStyleCache = new Map();
50769
51214
  this.bodyStyleCache = new Map();
50770
51215
  this.bodyBottomStyleCache = new Map();
50771
- internalProps.stick = { changedCells: [] };
51216
+ internalProps.stick = { changedCells: new Map() };
50772
51217
  internalProps.customMergeCell = options.customMergeCell;
50773
51218
  }
50774
51219
  throttleInvalidate = throttle2(this.render.bind(this), 200);
@@ -51734,6 +52179,7 @@
51734
52179
  this.colWidthsMap = new NumberMap();
51735
52180
  this.colContentWidthsMap = new NumberMap();
51736
52181
  this.colWidthsLimit = {};
52182
+ internalProps.stick.changedCells.clear();
51737
52183
  internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
51738
52184
  this.scenegraph.updateStageBackground();
51739
52185
  internalProps.autoWrapText = options.autoWrapText;
@@ -61869,7 +62315,7 @@
61869
62315
  }
61870
62316
 
61871
62317
  registerForVrender();
61872
- const version = "0.18.1";
62318
+ const version = "0.18.2-alpha.1";
61873
62319
  function getIcons() {
61874
62320
  return get$1();
61875
62321
  }