@visactor/vtable-calendar 1.18.2-alpha.1 → 1.18.2-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -492,11 +492,14 @@
492
492
  const ContributionProvider = Symbol("ContributionProvider");
493
493
  class ContributionProviderCache {
494
494
  constructor(serviceIdentifier, container) {
495
- this.serviceIdentifier = serviceIdentifier, this.container = container;
495
+ this.serviceIdentifier = serviceIdentifier, this.container = container, ContributionStore.setStore(this.serviceIdentifier, this);
496
496
  }
497
497
  getContributions() {
498
498
  return this.caches || (this.caches = [], this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier))), this.caches;
499
499
  }
500
+ refresh() {
501
+ this.caches && (this.caches.length = 0, this.container && this.container.isBound(this.serviceIdentifier) && this.caches.push(...this.container.getAll(this.serviceIdentifier)));
502
+ }
500
503
  }
501
504
  function bindContributionProvider(bind, id) {
502
505
  bind(ContributionProvider).toDynamicValue(_ref => {
@@ -514,6 +517,20 @@
514
517
  return new ContributionProviderCache(id, container);
515
518
  }).whenTargetNamed(id);
516
519
  }
520
+ class ContributionStore {
521
+ static getStore(id) {
522
+ return this.store.get(id);
523
+ }
524
+ static setStore(id, cache) {
525
+ this.store.set(id, cache);
526
+ }
527
+ static refreshAllContributions() {
528
+ this.store.forEach(cache => {
529
+ cache.refresh();
530
+ });
531
+ }
532
+ }
533
+ ContributionStore.store = new Map();
517
534
 
518
535
  class Hook {
519
536
  constructor(args, name) {
@@ -580,6 +597,48 @@
580
597
  const VGlobal = Symbol.for("VGlobal");
581
598
  const DEFAULT_TEXT_FONT_FAMILY$2 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
582
599
 
600
+ class EventListenerManager {
601
+ constructor() {
602
+ this._listenerMap = new Map(), this._eventListenerTransformer = event => event;
603
+ }
604
+ setEventListenerTransformer(transformer) {
605
+ this._eventListenerTransformer = transformer || (event => event);
606
+ }
607
+ addEventListener(type, listener, options) {
608
+ if (!listener) return;
609
+ const wrappedListener = event => {
610
+ const transformedEvent = this._eventListenerTransformer(event);
611
+ "function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
612
+ };
613
+ this._listenerMap.has(type) || this._listenerMap.set(type, new Map()), this._listenerMap.get(type).set(listener, wrappedListener), this._nativeAddEventListener(type, wrappedListener, options);
614
+ }
615
+ removeEventListener(type, listener, options) {
616
+ var _a;
617
+ if (!listener) return;
618
+ const wrappedListener = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener);
619
+ wrappedListener && (this._nativeRemoveEventListener(type, wrappedListener, options), this._listenerMap.get(type).delete(listener), 0 === this._listenerMap.get(type).size && this._listenerMap.delete(type));
620
+ }
621
+ dispatchEvent(event) {
622
+ return this._nativeDispatchEvent(event);
623
+ }
624
+ clearAllEventListeners() {
625
+ this._listenerMap.forEach((listenersMap, type) => {
626
+ listenersMap.forEach((wrappedListener, originalListener) => {
627
+ this._nativeRemoveEventListener(type, wrappedListener, void 0);
628
+ });
629
+ }), this._listenerMap.clear();
630
+ }
631
+ _nativeAddEventListener(type, listener, options) {
632
+ throw new Error("_nativeAddEventListener must be implemented by derived classes");
633
+ }
634
+ _nativeRemoveEventListener(type, listener, options) {
635
+ throw new Error("_nativeRemoveEventListener must be implemented by derived classes");
636
+ }
637
+ _nativeDispatchEvent(event) {
638
+ throw new Error("_nativeDispatchEvent must be implemented by derived classes");
639
+ }
640
+ }
641
+
583
642
  var __decorate$16 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
584
643
  var d,
585
644
  c = arguments.length,
@@ -620,7 +679,7 @@
620
679
  step((generator = generator.apply(thisArg, _arguments || [])).next());
621
680
  });
622
681
  };
623
- let DefaultGlobal = class {
682
+ let DefaultGlobal = class extends EventListenerManager {
624
683
  get env() {
625
684
  return this._env;
626
685
  }
@@ -664,10 +723,19 @@
664
723
  this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
665
724
  }
666
725
  constructor(contributions) {
667
- this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
726
+ super(), this.contributions = contributions, this._isImageAnonymous = !0, this.eventListenerTransformer = event => event, this.id = Generator.GenAutoIncrementId(), this.hooks = {
668
727
  onSetEnv: new SyncHook(["lastEnv", "env", "global"])
669
728
  }, this.measureTextMethod = "native", this.optimizeVisible = !1;
670
729
  }
730
+ _nativeAddEventListener(type, listener, options) {
731
+ return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
732
+ }
733
+ _nativeRemoveEventListener(type, listener, options) {
734
+ return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
735
+ }
736
+ _nativeDispatchEvent(event) {
737
+ return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
738
+ }
671
739
  bindContribution(params) {
672
740
  const promiseArr = [];
673
741
  if (this.contributions.getContributions().forEach(contribution => {
@@ -708,15 +776,6 @@
708
776
  releaseCanvas(canvas) {
709
777
  return this._env || this.setEnv("browser"), this.envContribution.releaseCanvas(canvas);
710
778
  }
711
- addEventListener(type, listener, options) {
712
- return this._env || this.setEnv("browser"), this.envContribution.addEventListener(type, listener, options);
713
- }
714
- removeEventListener(type, listener, options) {
715
- return this._env || this.setEnv("browser"), this.envContribution.removeEventListener(type, listener, options);
716
- }
717
- dispatchEvent(event) {
718
- return this._env || this.setEnv("browser"), this.envContribution.dispatchEvent(event);
719
- }
720
779
  getRequestAnimationFrame() {
721
780
  return this._env || this.setEnv("browser"), this.envContribution.getRequestAnimationFrame();
722
781
  }
@@ -5587,7 +5646,7 @@
5587
5646
  };
5588
5647
  const VWindow = Symbol.for("VWindow");
5589
5648
  const WindowHandlerContribution = Symbol.for("WindowHandlerContribution");
5590
- let DefaultWindow = class {
5649
+ let DefaultWindow = class extends EventListenerManager {
5591
5650
  get width() {
5592
5651
  if (this._handler) {
5593
5652
  const wh = this._handler.getWH();
@@ -5606,7 +5665,7 @@
5606
5665
  return this._handler.getDpr();
5607
5666
  }
5608
5667
  constructor() {
5609
- this.hooks = {
5668
+ super(), this.hooks = {
5610
5669
  onChange: new SyncHook(["x", "y", "width", "height"])
5611
5670
  }, this.active = () => {
5612
5671
  const global = this.global;
@@ -5614,6 +5673,15 @@
5614
5673
  container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
5615
5674
  }, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
5616
5675
  }
5676
+ _nativeAddEventListener(type, listener, options) {
5677
+ return this._handler.addEventListener(type, listener, options);
5678
+ }
5679
+ _nativeRemoveEventListener(type, listener, options) {
5680
+ return this._handler.removeEventListener(type, listener, options);
5681
+ }
5682
+ _nativeDispatchEvent(event) {
5683
+ return this._handler.dispatchEvent(event);
5684
+ }
5617
5685
  postInit() {
5618
5686
  this.global.hooks.onSetEnv.tap("window", this.active), this.active();
5619
5687
  }
@@ -5653,7 +5721,7 @@
5653
5721
  throw new Error("暂不支持");
5654
5722
  }
5655
5723
  release() {
5656
- return this.global.hooks.onSetEnv.unTap("window", this.active), this._handler.releaseWindow();
5724
+ return this.global.hooks.onSetEnv.unTap("window", this.active), this.clearAllEventListeners(), this._handler.releaseWindow();
5657
5725
  }
5658
5726
  getContext() {
5659
5727
  return this._handler.getContext();
@@ -5664,15 +5732,6 @@
5664
5732
  getImageBuffer(type) {
5665
5733
  return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
5666
5734
  }
5667
- addEventListener(type, listener, options) {
5668
- return this._handler.addEventListener(type, listener, options);
5669
- }
5670
- removeEventListener(type, listener, options) {
5671
- return this._handler.removeEventListener(type, listener, options);
5672
- }
5673
- dispatchEvent(event) {
5674
- return this._handler.dispatchEvent(event);
5675
- }
5676
5735
  getBoundingClientRect() {
5677
5736
  return this._handler.getBoundingClientRect();
5678
5737
  }
@@ -6881,19 +6940,17 @@
6881
6940
  globalObj: globalObj,
6882
6941
  domElement: domElement
6883
6942
  } = this;
6884
- this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.getDocument().addEventListener("pointermove", this.onPointerMove, !0), globalObj.getDocument().addEventListener("pointerup", this.onPointerUp, !0)) : (domElement.addEventListener("pointermove", this.onPointerMove, !0), domElement.addEventListener("pointerup", this.onPointerUp, !0)), domElement.addEventListener("pointerdown", this.onPointerDown, !0), domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), domElement.addEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.getDocument().addEventListener("mousemove", this.onPointerMove, !0), globalObj.getDocument().addEventListener("mouseup", this.onPointerUp, !0)) : (domElement.addEventListener("mousemove", this.onPointerMove, !0), domElement.addEventListener("mouseup", this.onPointerUp, !0)), domElement.addEventListener("mousedown", this.onPointerDown, !0), domElement.addEventListener("mouseout", this.onPointerOverOut, !0), domElement.addEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.addEventListener("touchstart", this.onPointerDown, !0), domElement.addEventListener("touchend", this.onPointerUp, !0), domElement.addEventListener("touchmove", this.onPointerMove, !0)), domElement.addEventListener("wheel", this.onWheel, {
6943
+ this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.addEventListener("pointermove", this.onPointerMove, !0), globalObj.addEventListener("pointerup", this.onPointerUp, !0)) : (domElement.addEventListener("pointermove", this.onPointerMove, !0), domElement.addEventListener("pointerup", this.onPointerUp, !0)), domElement.addEventListener("pointerdown", this.onPointerDown, !0), domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), domElement.addEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.addEventListener("mousemove", this.onPointerMove, !0), globalObj.addEventListener("mouseup", this.onPointerUp, !0)) : (domElement.addEventListener("mousemove", this.onPointerMove, !0), domElement.addEventListener("mouseup", this.onPointerUp, !0)), domElement.addEventListener("mousedown", this.onPointerDown, !0), domElement.addEventListener("mouseout", this.onPointerOverOut, !0), domElement.addEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.addEventListener("touchstart", this.onPointerDown, !0), domElement.addEventListener("touchend", this.onPointerUp, !0), domElement.addEventListener("touchmove", this.onPointerMove, !0)), domElement.addEventListener("wheel", this.onWheel, {
6885
6944
  capture: !0
6886
6945
  }), this.eventsAdded = !0;
6887
6946
  }
6888
6947
  removeEvents() {
6889
- var _a;
6890
6948
  if (!this.eventsAdded || !this.domElement) return;
6891
6949
  const {
6892
- globalObj: globalObj,
6893
- domElement: domElement
6894
- } = this,
6895
- globalDocument = null !== (_a = globalObj.getDocument()) && void 0 !== _a ? _a : domElement;
6896
- this.supportsPointerEvents ? (globalDocument.removeEventListener("pointermove", this.onPointerMove, !0), globalDocument.removeEventListener("pointerup", this.onPointerUp, !0), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalDocument.removeEventListener("mousemove", this.onPointerMove, !0), globalDocument.removeEventListener("mouseup", this.onPointerUp, !0), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
6950
+ globalObj: globalObj,
6951
+ domElement: domElement
6952
+ } = this;
6953
+ this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.removeEventListener("pointermove", this.onPointerMove, !0), globalObj.removeEventListener("pointerup", this.onPointerUp, !0)) : (domElement.removeEventListener("pointermove", this.onPointerMove, !0), domElement.removeEventListener("pointerup", this.onPointerUp, !0)), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.removeEventListener("mousemove", this.onPointerMove, !0), globalObj.removeEventListener("mouseup", this.onPointerUp, !0)) : (domElement.removeEventListener("mousemove", this.onPointerMove, !0), domElement.removeEventListener("mouseup", this.onPointerUp, !0)), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
6897
6954
  }
6898
6955
  mapToViewportPoint(event) {
6899
6956
  return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
@@ -13807,6 +13864,9 @@
13807
13864
  init(contributions) {
13808
13865
  contributions && (this._renderContribitions = contributions.getContributions()), this._renderContribitions || (this._renderContribitions = []), this.builtinContributions || (this.builtinContributions = []), this.builtinContributions.push(defaultBaseClipRenderBeforeContribution), this.builtinContributions.push(defaultBaseClipRenderAfterContribution), this.builtinContributions.forEach(item => this._renderContribitions.push(item)), this._renderContribitions.length && (this._renderContribitions.sort((a, b) => b.order - a.order), this._beforeRenderContribitions = this._renderContribitions.filter(c => c.time === BaseRenderContributionTime.beforeFillStroke), this._afterRenderContribitions = this._renderContribitions.filter(c => c.time === BaseRenderContributionTime.afterFillStroke));
13809
13866
  }
13867
+ reInit() {
13868
+ this.init(this.graphicRenderContributions);
13869
+ }
13810
13870
  beforeRenderStep(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, params) {
13811
13871
  this._beforeRenderContribitions && this._beforeRenderContribitions.forEach(c => {
13812
13872
  if (c.supportedAppName && graphic.stage && graphic.stage.params && graphic.stage.params.context && graphic.stage.params.context.appName) {
@@ -13976,8 +14036,8 @@
13976
14036
  };
13977
14037
  };
13978
14038
  let DefaultCanvasArcRender = class extends BaseRender {
13979
- constructor(arcRenderContribitions) {
13980
- super(), this.arcRenderContribitions = arcRenderContribitions, this.numberType = ARC_NUMBER_TYPE, this.builtinContributions = [defaultArcRenderContribution, defaultArcBackgroundRenderContribution, defaultArcTextureRenderContribution], this.init(arcRenderContribitions);
14039
+ constructor(graphicRenderContributions) {
14040
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = ARC_NUMBER_TYPE, this.builtinContributions = [defaultArcRenderContribution, defaultArcBackgroundRenderContribution, defaultArcTextureRenderContribution], this.init(graphicRenderContributions);
13981
14041
  }
13982
14042
  drawArcTailCapPath(arc, context, cx, cy, outerRadius, innerRadius, _sa, _ea) {
13983
14043
  const capAngle = _ea - _sa,
@@ -14152,8 +14212,8 @@
14152
14212
  };
14153
14213
  };
14154
14214
  let DefaultCanvasCircleRender = class extends BaseRender {
14155
- constructor(circleRenderContribitions) {
14156
- super(), this.circleRenderContribitions = circleRenderContribitions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(circleRenderContribitions);
14215
+ constructor(graphicRenderContributions) {
14216
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
14157
14217
  }
14158
14218
  drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
14159
14219
  const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle,
@@ -14539,8 +14599,8 @@
14539
14599
  };
14540
14600
  };
14541
14601
  let DefaultCanvasAreaRender = class extends BaseRender {
14542
- constructor(areaRenderContribitions) {
14543
- super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
14602
+ constructor(graphicRenderContributions) {
14603
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(graphicRenderContributions);
14544
14604
  }
14545
14605
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
14546
14606
  var _a, _b, _c;
@@ -14783,8 +14843,8 @@
14783
14843
  };
14784
14844
  };
14785
14845
  let DefaultCanvasPathRender = class extends BaseRender {
14786
- constructor(pathRenderContribitions) {
14787
- super(), this.pathRenderContribitions = pathRenderContribitions, this.numberType = PATH_NUMBER_TYPE, this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution], this.init(pathRenderContribitions);
14846
+ constructor(graphicRenderContributions) {
14847
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = PATH_NUMBER_TYPE, this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution], this.init(graphicRenderContributions);
14788
14848
  }
14789
14849
  drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
14790
14850
  var _a, _b, _c;
@@ -14839,8 +14899,8 @@
14839
14899
  };
14840
14900
  };
14841
14901
  let DefaultCanvasRectRender = class extends BaseRender {
14842
- constructor(rectRenderContribitions) {
14843
- super(), this.rectRenderContribitions = rectRenderContribitions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(rectRenderContribitions);
14902
+ constructor(graphicRenderContributions) {
14903
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.type = "rect", this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution], this.init(graphicRenderContributions);
14844
14904
  }
14845
14905
  drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
14846
14906
  var _a;
@@ -14911,8 +14971,8 @@
14911
14971
  };
14912
14972
  };
14913
14973
  let DefaultCanvasSymbolRender = class extends BaseRender {
14914
- constructor(symbolRenderContribitions) {
14915
- super(), this.symbolRenderContribitions = symbolRenderContribitions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(symbolRenderContribitions);
14974
+ constructor(graphicRenderContributions) {
14975
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
14916
14976
  }
14917
14977
  drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
14918
14978
  var _a;
@@ -15083,8 +15143,8 @@
15083
15143
  };
15084
15144
  };
15085
15145
  let DefaultCanvasTextRender = class extends BaseRender {
15086
- constructor(textRenderContribitions) {
15087
- super(), this.textRenderContribitions = textRenderContribitions, this.numberType = TEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init(textRenderContribitions);
15146
+ constructor(graphicRenderContributions) {
15147
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = TEXT_NUMBER_TYPE, this.builtinContributions = [defaultTextBackgroundRenderContribution], this.init(graphicRenderContributions);
15088
15148
  }
15089
15149
  drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
15090
15150
  var _a, _b, _c;
@@ -15288,8 +15348,8 @@
15288
15348
  };
15289
15349
  };
15290
15350
  let DefaultCanvasPolygonRender = class extends BaseRender {
15291
- constructor(polygonRenderContribitions) {
15292
- super(), this.polygonRenderContribitions = polygonRenderContribitions, this.numberType = POLYGON_NUMBER_TYPE, this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution], this.init(polygonRenderContribitions);
15351
+ constructor(graphicRenderContributions) {
15352
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = POLYGON_NUMBER_TYPE, this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution], this.init(graphicRenderContributions);
15293
15353
  }
15294
15354
  drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
15295
15355
  const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon,
@@ -15344,6 +15404,9 @@
15344
15404
  constructor(groupRenderContribitions) {
15345
15405
  this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
15346
15406
  }
15407
+ reInit() {
15408
+ this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution);
15409
+ }
15347
15410
  drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
15348
15411
  const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
15349
15412
  {
@@ -15474,8 +15537,8 @@
15474
15537
  };
15475
15538
  const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
15476
15539
  let DefaultCanvasImageRender = class extends BaseRender {
15477
- constructor(imageRenderContribitions) {
15478
- super(), this.imageRenderContribitions = imageRenderContribitions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(imageRenderContribitions);
15540
+ constructor(graphicRenderContributions) {
15541
+ super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(graphicRenderContributions);
15479
15542
  }
15480
15543
  drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
15481
15544
  const imageAttribute = getTheme(image).image,
@@ -15797,6 +15860,9 @@
15797
15860
  afterDraw(params) {
15798
15861
  this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
15799
15862
  }
15863
+ reInit() {
15864
+ this.drawContribution.reInit();
15865
+ }
15800
15866
  render(groups, params) {
15801
15867
  this.renderTreeRoots = groups, this.drawParams = params;
15802
15868
  const updateBounds = params.updateBounds;
@@ -16198,6 +16264,11 @@
16198
16264
  constructor(contributions, drawItemInterceptorContributions) {
16199
16265
  this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds$1(), this.backupDirtyBounds = new Bounds$1(), this.global = application.global, this.layerService = application.layerService, isArray$9(this.contributions) || (this.contributions = [this.contributions]), this.init();
16200
16266
  }
16267
+ reInit() {
16268
+ this.init(), this.contributions.forEach(item => {
16269
+ item.reInit();
16270
+ });
16271
+ }
16201
16272
  init() {
16202
16273
  this.contributions.forEach(item => {
16203
16274
  if (item.style) {
@@ -17322,6 +17393,9 @@
17322
17393
  getPickerService() {
17323
17394
  return this.pickerService || (this.pickerService = container.get(PickerService)), this.pickerService;
17324
17395
  }
17396
+ reInit() {
17397
+ this.renderService.reInit(), this.pickerService.reInit();
17398
+ }
17325
17399
  }
17326
17400
 
17327
17401
  function createStage(params) {
@@ -17611,6 +17685,9 @@
17611
17685
  constructor(pickItemInterceptorContributions, pickServiceInterceptorContributions) {
17612
17686
  this.pickItemInterceptorContributions = pickItemInterceptorContributions, this.pickServiceInterceptorContributions = pickServiceInterceptorContributions, this.type = "default", this.global = application.global;
17613
17687
  }
17688
+ reInit() {
17689
+ this._init();
17690
+ }
17614
17691
  _init() {
17615
17692
  this.InterceptorContributions = this.pickItemInterceptorContributions.getContributions().sort((a, b) => a.order - b.order), this.pickerServiceInterceptorContributions = this.pickServiceInterceptorContributions.getContributions().sort((a, b) => a.order - b.order);
17616
17693
  }
@@ -31649,7 +31726,7 @@
31649
31726
  }
31650
31727
  release() {
31651
31728
  var _a;
31652
- null === (_a = super.release) || void 0 === _a || _a.call(this), this.lastFilterRules = null;
31729
+ null === (_a = super.release) || void 0 === _a || _a.call(this), this.lastFilterRules = null, this.clearSortedMap(), this.clearCurrentIndexedData(), this.currentPagerIndexedData.length = 0;
31653
31730
  }
31654
31731
  clearSortedMap() {
31655
31732
  this.currentIndexedData && (this.currentIndexedData.length = 0), this.currentIndexedData = null, this.sortedIndexMap.forEach(item => {
@@ -33674,8 +33751,9 @@
33674
33751
  }
33675
33752
  function _setDataSource(table, dataSource) {
33676
33753
  _dealWithUpdateDataSource(table, () => {
33677
- var _a, _b;
33678
- table.internalProps.dataSource && (null === (_b = (_a = table.internalProps.dataSource).release) || void 0 === _b || _b.call(_a)), dataSource ? dataSource instanceof DataSource ? (table.internalProps.dataSource = dataSource, table.internalProps.dataSource.supplementConfig(table.pagination, table.options.columns, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table))) : table.internalProps.dataSource = new CachedDataSource(dataSource) : table.internalProps.dataSource = DataSource.EMPTY, table.addReleaseObj(table.internalProps.dataSource), table.internalProps.records = null;
33754
+ table.internalProps.dataSource && table.internalProps.releaseList.forEach(releaseObj => {
33755
+ releaseObj instanceof DataSource && (releaseObj.release(), table.internalProps.releaseList.splice(table.internalProps.releaseList.indexOf(releaseObj), 1));
33756
+ }), dataSource ? dataSource instanceof DataSource ? (table.internalProps.dataSource = dataSource, table.internalProps.dataSource.supplementConfig(table.pagination, table.options.columns, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table))) : table.internalProps.dataSource = new CachedDataSource(dataSource) : table.internalProps.dataSource = DataSource.EMPTY, table.addReleaseObj(table.internalProps.dataSource), table.internalProps.records = null;
33679
33757
  });
33680
33758
  }
33681
33759
  function _getTargetFrozenRowAt(table, absoluteY) {
@@ -35584,7 +35662,13 @@
35584
35662
  } else if ("sparkline" === type) {
35585
35663
  cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
35586
35664
  } else if ("checkbox" === type) {
35587
- cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
35665
+ const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
35666
+ isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
35667
+ if (isAggregation && isSeriesNumber) {
35668
+ cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
35669
+ } else {
35670
+ cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
35671
+ }
35588
35672
  } else if ("radio" === type) {
35589
35673
  cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
35590
35674
  } else if ("switch" === type) {
@@ -39512,7 +39596,9 @@
39512
39596
  colForDefine = col,
39513
39597
  rowForDefine = row;
39514
39598
  range && (colForDefine = range.start.col, rowForDefine = range.start.row), !table.isPivotTable() && ("columnHeader" === cellLocation || "cornerHeader" === cellLocation) && row >= table.columnHeaderLevelCount && (cellLocation = "body"), define = !table.isPivotTable() && table.isSeriesNumberInBody(col, row) ? table.getBodyColumnDefine(colForDefine, rowForDefine) : "body" !== cellLocation ? table.getHeaderDefine(colForDefine, rowForDefine) : table.getBodyColumnDefine(colForDefine, rowForDefine);
39515
- let mayHaveIcon = "body" !== cellLocation || (null == define ? void 0 : define.dragOrder) || !!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree);
39599
+ const isAggregation = "isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row),
39600
+ isSeriesNumber = table.internalProps.layoutMap.isSeriesNumber(col, row);
39601
+ let mayHaveIcon = "body" !== cellLocation || ((null == define ? void 0 : define.dragOrder) || !!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree)) && !(isAggregation && isSeriesNumber);
39516
39602
  if (!range && (table.internalProps.enableTreeNodeMerge || "body" !== cellLocation || (null == define ? void 0 : define.mergeCell)) && (range = table.getCellRange(col, row), isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row, isMerge)) {
39517
39603
  const mergeSize = dealMerge(range, mergeMap, table, rowStart > range.start.row);
39518
39604
  cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
@@ -41630,7 +41716,9 @@
41630
41716
  var _a;
41631
41717
  let hasSetedHeight = !1;
41632
41718
  for (let i = 0; i < scene.bodyGroup.childrenCount; i++) {
41633
- const rowCell = scene.bodyGroup.children[i].firstChild;
41719
+ const child = scene.bodyGroup.children[i];
41720
+ if (!checkBeforeMove(child)) continue;
41721
+ const rowCell = child.firstChild;
41634
41722
  null === (_a = scene.colHeaderGroup.children[i]) || void 0 === _a || _a.appendChild(rowCell), hasSetedHeight || (scene.colHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height + rowCell.attribute.height), scene.bodyGroup.setAttribute("height", scene.bodyGroup.attribute.height - rowCell.attribute.height), hasSetedHeight = !0);
41635
41723
  }
41636
41724
  }
@@ -41638,7 +41726,9 @@
41638
41726
  var _a;
41639
41727
  let hasSetedHeight = !1;
41640
41728
  for (let i = 0; i < scene.rowHeaderGroup.childrenCount; i++) {
41641
- const rowCell = scene.rowHeaderGroup.children[i].firstChild;
41729
+ const child = scene.rowHeaderGroup.children[i];
41730
+ if (!checkBeforeMove(child)) continue;
41731
+ const rowCell = child.firstChild;
41642
41732
  null === (_a = scene.cornerHeaderGroup.children[i]) || void 0 === _a || _a.appendChild(rowCell), hasSetedHeight || (scene.cornerHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height + rowCell.attribute.height), scene.rowHeaderGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height - rowCell.attribute.height), hasSetedHeight = !0);
41643
41733
  }
41644
41734
  }
@@ -41646,31 +41736,48 @@
41646
41736
  var _a;
41647
41737
  let hasSetedHeight = !1;
41648
41738
  for (let i = 0; i < scene.rightFrozenGroup.childrenCount; i++) {
41649
- const rowCell = scene.rightFrozenGroup.children[i].firstChild;
41739
+ const child = scene.rightFrozenGroup.children[i];
41740
+ if (!checkBeforeMove(child)) continue;
41741
+ const rowCell = child.firstChild;
41650
41742
  null === (_a = scene.rightTopCornerGroup.children[i]) || void 0 === _a || _a.appendChild(rowCell), hasSetedHeight || (scene.rightTopCornerGroup.setAttribute("height", scene.rightTopCornerGroup.attribute.height + rowCell.attribute.height), scene.rightFrozenGroup.setAttribute("height", scene.rightFrozenGroup.attribute.height - rowCell.attribute.height), hasSetedHeight = !0);
41651
41743
  }
41652
41744
  }
41653
41745
  function moveRowFromColHeaderToBody(scene) {
41654
41746
  let hasSetedHeight = !1;
41655
41747
  for (let i = 0; i < scene.colHeaderGroup.childrenCount; i++) {
41656
- const rowCell = scene.colHeaderGroup.children[i].lastChild;
41657
- insertBefore(scene.bodyGroup.children[i], rowCell, scene.bodyGroup.children[i].firstChild), hasSetedHeight || (scene.colHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height - rowCell.attribute.height), scene.bodyGroup.setAttribute("height", scene.bodyGroup.attribute.height + rowCell.attribute.height), hasSetedHeight = !0);
41748
+ const child = scene.colHeaderGroup.children[i];
41749
+ if (!checkBeforeMove(child)) continue;
41750
+ const target = scene.bodyGroup.children[i];
41751
+ if (!target) continue;
41752
+ const rowCell = child.lastChild;
41753
+ insertBefore(target, rowCell, target.firstChild), hasSetedHeight || (scene.colHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height - rowCell.attribute.height), scene.bodyGroup.setAttribute("height", scene.bodyGroup.attribute.height + rowCell.attribute.height), hasSetedHeight = !0);
41658
41754
  }
41659
41755
  }
41660
41756
  function moveRowFromCornerHeaderToRowHeader(scene) {
41661
41757
  let hasSetedHeight = !1;
41662
41758
  for (let i = 0; i < scene.cornerHeaderGroup.childrenCount; i++) {
41663
- const rowCell = scene.cornerHeaderGroup.children[i].lastChild;
41664
- insertBefore(scene.rowHeaderGroup.children[i], rowCell, scene.rowHeaderGroup.children[i].firstChild), hasSetedHeight || (scene.cornerHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height - rowCell.attribute.height), scene.rowHeaderGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height + rowCell.attribute.height), hasSetedHeight = !0);
41759
+ const child = scene.cornerHeaderGroup.children[i];
41760
+ if (!checkBeforeMove(child)) continue;
41761
+ const target = scene.rowHeaderGroup.children[i];
41762
+ if (!target) continue;
41763
+ const rowCell = child.lastChild;
41764
+ insertBefore(target, rowCell, target.firstChild), hasSetedHeight || (scene.cornerHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height - rowCell.attribute.height), scene.rowHeaderGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height + rowCell.attribute.height), hasSetedHeight = !0);
41665
41765
  }
41666
41766
  }
41667
41767
  function moveRowFromTopRightCornerToRight(scene) {
41668
41768
  let hasSetedHeight = !1;
41669
41769
  for (let i = 0; i < scene.rightTopCornerGroup.childrenCount; i++) {
41670
- const rowCell = scene.rightTopCornerGroup.children[i].lastChild;
41671
- insertBefore(scene.rightFrozenGroup.children[i], rowCell, scene.rightFrozenGroup.children[i].firstChild), hasSetedHeight || (scene.rightTopCornerGroup.setAttribute("height", scene.rightTopCornerGroup.attribute.height - rowCell.attribute.height), scene.rightFrozenGroup.setAttribute("height", scene.rightFrozenGroup.attribute.height + rowCell.attribute.height), hasSetedHeight = !0);
41770
+ const child = scene.rightTopCornerGroup.children[i];
41771
+ if (!checkBeforeMove(child)) continue;
41772
+ const target = scene.rightFrozenGroup.children[i];
41773
+ if (!target) continue;
41774
+ const rowCell = child.lastChild;
41775
+ insertBefore(target, rowCell, target.firstChild), hasSetedHeight || (scene.rightTopCornerGroup.setAttribute("height", scene.rightTopCornerGroup.attribute.height - rowCell.attribute.height), scene.rightFrozenGroup.setAttribute("height", scene.rightFrozenGroup.attribute.height + rowCell.attribute.height), hasSetedHeight = !0);
41672
41776
  }
41673
41777
  }
41778
+ function checkBeforeMove(child) {
41779
+ return child instanceof Group && "table-border-rect" !== (null == child ? void 0 : child.name);
41780
+ }
41674
41781
 
41675
41782
  function updateChartSizeForResizeColWidth(scenegraph, col) {
41676
41783
  const {
@@ -42765,12 +42872,15 @@
42765
42872
  if ("adaptive" === table.widthMode) {
42766
42873
  table._clearColRangeWidthsMap();
42767
42874
  const canvasWidth = table.tableNoFrameWidth;
42768
- let actualHeaderWidth = 0;
42769
- for (let col = 0; col < table.colCount; col++) if (col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) {
42770
- actualHeaderWidth += table.getColWidth(col);
42875
+ let actualHeaderWidth = 0,
42876
+ startCol = 0,
42877
+ endCol = table.colCount;
42878
+ if ("only-body" === table.widthAdaptiveMode) {
42879
+ for (let col = 0; col < table.colCount; col++) if (col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) {
42880
+ actualHeaderWidth += table.getColWidth(col);
42881
+ }
42882
+ startCol = table.rowHeaderLevelCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
42771
42883
  }
42772
- const startCol = table.rowHeaderLevelCount,
42773
- endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
42774
42884
  getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
42775
42885
  } else if (table.autoFillWidth) {
42776
42886
  table._clearColRangeWidthsMap();
@@ -45416,42 +45526,7 @@
45416
45526
  target && !target.isDescendantsOf(table.scenegraph.tableGroup) && table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {
45417
45527
  event: e.nativeEvent
45418
45528
  });
45419
- });
45420
- const globalPointerupCallback = e => {
45421
- var _a;
45422
- if (table.isReleased) return;
45423
- const target = e.target;
45424
- if (!table.getElement().contains(target)) {
45425
- const isCompleteEdit = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.completeEdit(e);
45426
- getPromiseValue(isCompleteEdit, isCompleteEdit => {
45427
- !1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
45428
- });
45429
- }
45430
- },
45431
- globalPointerdownCallback = e => {
45432
- var _a;
45433
- if (table.isReleased) return;
45434
- const target = e.target;
45435
- if (!table.getElement().contains(target) && !table.internalProps.menuHandler.containElement(target)) {
45436
- const isCompleteEdit = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.completeEdit(e);
45437
- getPromiseValue(isCompleteEdit, isCompleteEdit => {
45438
- var _a, _b;
45439
- if (!1 !== isCompleteEdit && (null === (_a = table.options.select) || void 0 === _a ? void 0 : _a.outsideClickDeselect)) {
45440
- const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
45441
- eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
45442
- }
45443
- });
45444
- }
45445
- };
45446
- eventManager.globalEventListeners.push({
45447
- name: "pointerup",
45448
- env: "document",
45449
- callback: globalPointerupCallback
45450
- }), eventManager.globalEventListeners.push({
45451
- name: "pointerdown",
45452
- env: "document",
45453
- callback: globalPointerdownCallback
45454
- }), vglobal.addEventListener("pointerup", globalPointerupCallback), vglobal.addEventListener("pointerdown", globalPointerdownCallback), table.scenegraph.tableGroup.addEventListener("pointerdown", e => {
45529
+ }), table.scenegraph.tableGroup.addEventListener("pointerdown", e => {
45455
45530
  var _a, _b, _c, _d, _e;
45456
45531
  if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE) && table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
45457
45532
  event: e.nativeEvent
@@ -45474,7 +45549,7 @@
45474
45549
  if (eventManager.cellIsHeaderCheck(eventArgsSet)) return;
45475
45550
  if ("touch" === e.pointerType) {
45476
45551
  if (eventManager.touchEnd = !1, eventManager.touchSetTimeout = setTimeout(() => {
45477
- eventManager.isTouchdown = !1, eventManager.touchMove = !0, (eventManager.touchEnd || !eventManager.checkColumnResize(eventArgsSet, !0) && !eventManager.checkRowResize(eventArgsSet, !0)) && (eventManager.touchEnd || !eventManager.checkColumnMover(eventArgsSet)) ? eventManager.dealTableSelect(eventArgsSet) && !eventManager.touchEnd && stateManager.updateInteractionState(InteractionState.grabing) : stateManager.updateInteractionState(InteractionState.grabing);
45552
+ eventManager.isTouchdown = !1, eventManager.isLongTouch = !0, (eventManager.touchEnd || !eventManager.checkColumnResize(eventArgsSet, !0) && !eventManager.checkRowResize(eventArgsSet, !0)) && (eventManager.touchEnd || !eventManager.checkColumnMover(eventArgsSet)) ? eventManager.dealTableSelect(eventArgsSet) && !eventManager.touchEnd && stateManager.updateInteractionState(InteractionState.grabing) : stateManager.updateInteractionState(InteractionState.grabing);
45478
45553
  }, 500), table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL)) {
45479
45554
  const cellGoup = e.path.find(node => "cell" === node.role);
45480
45555
  "cell" !== (null == cellGoup ? void 0 : cellGoup.role) || !isValid$3(cellGoup.col) || !isValid$3(cellGoup.row) || cellGoup.col === table.stateManager.hover.cellPos.col && cellGoup.row === table.stateManager.hover.cellPos.row || cellGoup.col === (null === (_e = table.stateManager.hover.cellPosContainHeader) || void 0 === _e ? void 0 : _e.col) && cellGoup.row === (null === (_f = table.stateManager.hover.cellPosContainHeader) || void 0 === _f ? void 0 : _f.row) || table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {
@@ -45578,7 +45653,7 @@
45578
45653
  var _a, _b, _c, _d, _e;
45579
45654
  if (table.stateManager.columnResize.resizing) return;
45580
45655
  const eventArgsSet = getCellEventArgsSet(e);
45581
- if (!eventManager.touchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
45656
+ if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
45582
45657
  const {
45583
45658
  col: col,
45584
45659
  row: row
@@ -46143,18 +46218,32 @@
46143
46218
  return values;
46144
46219
  }
46145
46220
  const globalPointerdownCallback = e => {
46221
+ var _a;
46146
46222
  table.eventManager.LastBodyPointerXY = {
46147
46223
  x: e.x,
46148
46224
  y: e.y
46149
46225
  }, table.eventManager.isDown = !0;
46226
+ const target = e.target;
46227
+ if (!table.getElement().contains(target) && !table.internalProps.menuHandler.containElement(target)) {
46228
+ const isCompleteEdit = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.completeEdit(e);
46229
+ getPromiseValue(isCompleteEdit, isCompleteEdit => {
46230
+ var _a, _b;
46231
+ if (!1 !== isCompleteEdit && (null === (_a = table.options.select) || void 0 === _a ? void 0 : _a.outsideClickDeselect)) {
46232
+ const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
46233
+ eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
46234
+ }
46235
+ });
46236
+ }
46150
46237
  };
46151
46238
  eventManager.globalEventListeners.push({
46152
46239
  name: "pointerdown",
46153
- env: "body",
46240
+ env: "vglobal",
46154
46241
  callback: globalPointerdownCallback
46155
- }), document.body.addEventListener("pointerdown", globalPointerdownCallback);
46242
+ }), vglobal.addEventListener("pointerdown", globalPointerdownCallback);
46156
46243
  const globalPointerupCallback = e => {
46157
- if (e.target !== table.canvas && (e => {
46244
+ var _a;
46245
+ const target = e.target;
46246
+ if (target !== table.canvas && (e => {
46158
46247
  var _a, _b;
46159
46248
  if (stateManager.menu.isShow && setTimeout(() => {
46160
46249
  table.internalProps.menuHandler.pointInMenuElement(e.clientX, e.clientY) || stateManager.menu.isShow && stateManager.hideMenu();
@@ -46179,13 +46268,18 @@
46179
46268
  })(e), table.eventManager.LastBodyPointerXY = null, table.eventManager.isDown = !1, table.eventManager.isDraging = !1, table.eventManager.inertiaScroll.endInertia(), "grabing" === stateManager.interactionState && stateManager.isResizeCol()) endResizeCol(table);else if ("grabing" === stateManager.interactionState && stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
46180
46269
  const endMoveColSuccess = table.stateManager.endMoveCol();
46181
46270
  fireMoveColEventListeners(table, endMoveColSuccess, e);
46271
+ } else if (table.editorManager.editingEditor && !table.getElement().contains(target)) {
46272
+ const isCompleteEdit = null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.completeEdit(e);
46273
+ getPromiseValue(isCompleteEdit, isCompleteEdit => {
46274
+ !1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
46275
+ });
46182
46276
  }
46183
46277
  };
46184
46278
  eventManager.globalEventListeners.push({
46185
46279
  name: "pointerup",
46186
- env: "document",
46280
+ env: "vglobal",
46187
46281
  callback: globalPointerupCallback
46188
- }), document.addEventListener("pointerup", globalPointerupCallback);
46282
+ }), vglobal.addEventListener("pointerup", globalPointerupCallback);
46189
46283
  const globalPointermoveCallback = e => {
46190
46284
  var _a, _b, _c, _d, _e;
46191
46285
  if (table.eventManager.isDown && table.eventManager.LastBodyPointerXY) {
@@ -46241,9 +46335,9 @@
46241
46335
  };
46242
46336
  eventManager.globalEventListeners.push({
46243
46337
  name: "pointermove",
46244
- env: "body",
46338
+ env: "vglobal",
46245
46339
  callback: globalPointermoveCallback
46246
- }), document.body.addEventListener("pointermove", globalPointermoveCallback);
46340
+ }), vglobal.addEventListener("pointermove", globalPointermoveCallback);
46247
46341
  }
46248
46342
 
46249
46343
  function bindTouchListener(eventManager) {
@@ -46251,17 +46345,21 @@
46251
46345
  stateManager = table.stateManager,
46252
46346
  scenegraph = table.scenegraph;
46253
46347
  eventManager.touchMovePoints = [], table.scenegraph.tableGroup.addEventListener("touchstart", e => {
46254
- e.target.isChildOf(scenegraph.component.vScrollBar) || e.target.isChildOf(scenegraph.component.vScrollBar) || (eventManager.isTouchdown = !0, eventManager.touchMovePoints.push({
46255
- x: e.page.x,
46256
- y: e.page.y,
46348
+ var _a, _b, _c, _d, _e, _f, _g, _h;
46349
+ if (e.target.isChildOf(scenegraph.component.vScrollBar) || e.target.isChildOf(scenegraph.component.vScrollBar)) return;
46350
+ eventManager.isTouchdown = !0;
46351
+ const touchEvent = e.nativeEvent;
46352
+ eventManager.touchMovePoints.push({
46353
+ x: table.rotateDegree ? null !== (_c = null === (_b = null === (_a = touchEvent.changedTouches) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b._canvasX) && void 0 !== _c ? _c : null === (_d = e.canvas) || void 0 === _d ? void 0 : _d.x : e.page.x,
46354
+ y: table.rotateDegree ? null !== (_g = null === (_f = null === (_e = touchEvent.changedTouches) || void 0 === _e ? void 0 : _e[0]) || void 0 === _f ? void 0 : _f._canvasY) && void 0 !== _g ? _g : null === (_h = e.canvas) || void 0 === _h ? void 0 : _h.y : e.page.y,
46257
46355
  timestamp: Date.now()
46258
- }));
46356
+ });
46259
46357
  });
46260
46358
  const globalTouchMoveCallback = e => {
46261
46359
  var _a, _b;
46262
- if (eventManager.touchMove && e.preventDefault(), eventManager.isTouchdown && isTouchEvent$1(e)) if ((null === (_b = null === (_a = eventManager.downIcon) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.funcType) === IconFuncTypeEnum.dragReorder) e.preventDefault();else if (eventManager.touchMovePoints.length > 4 && eventManager.touchMovePoints.shift(), eventManager.touchMovePoints.push({
46263
- x: e.changedTouches[0].pageX,
46264
- y: e.changedTouches[0].pageY,
46360
+ if (eventManager.isLongTouch && e.preventDefault(), eventManager.isTouchdown && isTouchEvent$1(e)) if (eventManager.isTouchMove = !0, (null === (_b = null === (_a = eventManager.downIcon) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.funcType) === IconFuncTypeEnum.dragReorder) e.preventDefault();else if (eventManager.touchMovePoints.length > 4 && eventManager.touchMovePoints.shift(), eventManager.touchMovePoints.push({
46361
+ x: table.rotateDegree ? e.changedTouches[0]._canvasX : e.changedTouches[0].pageX,
46362
+ y: table.rotateDegree ? e.changedTouches[0]._canvasY : e.changedTouches[0].pageY,
46265
46363
  timestamp: Date.now()
46266
46364
  }), eventManager._enableTableScroll) {
46267
46365
  const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x + eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x,
@@ -46272,19 +46370,19 @@
46272
46370
  }, stateManager), e.cancelable && ("none" === table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, stateManager) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, stateManager)) && e.preventDefault();
46273
46371
  }
46274
46372
  };
46275
- window.addEventListener("touchmove", globalTouchMoveCallback, {
46373
+ vglobal.addEventListener("touchmove", globalTouchMoveCallback, {
46276
46374
  passive: !1
46277
46375
  }), eventManager.globalEventListeners.push({
46278
46376
  name: "touchmove",
46279
- env: "window",
46377
+ env: "vglobal",
46280
46378
  callback: globalTouchMoveCallback
46281
46379
  });
46282
46380
  const globalTouchEndCallback = e => {
46283
46381
  var _a, _b, _c, _d;
46284
- if (eventManager.touchEnd = !0, eventManager.touchMove = !1, eventManager.isTouchdown && isTouchEvent$1(e)) {
46382
+ if (eventManager.touchEnd = !0, eventManager.isLongTouch = !1, eventManager.isTouchdown && isTouchEvent$1(e)) {
46285
46383
  if ((null === (_b = null === (_a = eventManager.downIcon) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.funcType) === IconFuncTypeEnum.dragReorder) e.preventDefault();else if ((null === (_c = eventManager.touchMovePoints) || void 0 === _c ? void 0 : _c.length) && (eventManager.touchMovePoints.length > 4 && eventManager.touchMovePoints.shift(), eventManager.touchMovePoints.push({
46286
- x: e.changedTouches[0].pageX,
46287
- y: e.changedTouches[0].pageY,
46384
+ x: table.rotateDegree ? e.changedTouches[0]._canvasX : e.changedTouches[0].pageX,
46385
+ y: table.rotateDegree ? e.changedTouches[0]._canvasY : e.changedTouches[0].pageY,
46288
46386
  timestamp: Date.now()
46289
46387
  }), eventManager._enableTableScroll)) {
46290
46388
  const firstPoint = eventManager.touchMovePoints[0],
@@ -46298,20 +46396,20 @@
46298
46396
  }, table.stateManager);
46299
46397
  });
46300
46398
  }
46301
- eventManager.isTouchdown = !1, eventManager.touchMovePoints = [];
46399
+ eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.touchMovePoints = [];
46302
46400
  }
46303
46401
  };
46304
- window.addEventListener("touchend", globalTouchEndCallback), eventManager.globalEventListeners.push({
46402
+ vglobal.addEventListener("touchend", globalTouchEndCallback), eventManager.globalEventListeners.push({
46305
46403
  name: "touchend",
46306
- env: "window",
46404
+ env: "vglobal",
46307
46405
  callback: globalTouchEndCallback
46308
46406
  });
46309
46407
  const globalTouchCancelCallback = e => {
46310
- eventManager.touchEnd = !0, eventManager.touchMove = !1, eventManager.isTouchdown && (eventManager.isTouchdown = !1, eventManager.touchMovePoints = []);
46408
+ eventManager.touchEnd = !0, eventManager.isLongTouch = !1, eventManager.isTouchdown && (eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.touchMovePoints = []);
46311
46409
  };
46312
- window.addEventListener("touchcancel", globalTouchCancelCallback), eventManager.globalEventListeners.push({
46410
+ vglobal.addEventListener("touchcancel", globalTouchCancelCallback), eventManager.globalEventListeners.push({
46313
46411
  name: "touchcancel",
46314
- env: "window",
46412
+ env: "vglobal",
46315
46413
  callback: globalTouchCancelCallback
46316
46414
  });
46317
46415
  }
@@ -46803,7 +46901,7 @@
46803
46901
  }
46804
46902
  release() {
46805
46903
  this.gesture.release(), this.globalEventListeners.forEach(item => {
46806
- "document" === item.env ? document.removeEventListener(item.name, item.callback) : "body" === item.env ? document.body.removeEventListener(item.name, item.callback) : "window" === item.env && window.removeEventListener(item.name, item.callback);
46904
+ "document" === item.env ? document.removeEventListener(item.name, item.callback) : "body" === item.env ? document.body.removeEventListener(item.name, item.callback) : "window" === item.env ? window.removeEventListener(item.name, item.callback) : "vglobal" === item.env && vglobal.removeEventListener(item.name, item.callback);
46807
46905
  }), this.globalEventListeners = [];
46808
46906
  }
46809
46907
  enableScroll() {
@@ -49383,8 +49481,8 @@
49383
49481
  constructor(table, options) {
49384
49482
  var _a;
49385
49483
  this.plugins = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.map(plugin => {
49386
- this.register(plugin), this._bindTableEventForPlugin(plugin);
49387
- });
49484
+ this.register(plugin);
49485
+ }), this.initPlugins(table);
49388
49486
  }
49389
49487
  register(plugin) {
49390
49488
  this.plugins.set(plugin.id, plugin);
@@ -49395,28 +49493,23 @@
49395
49493
  getPlugin(id) {
49396
49494
  return this.plugins.get(id);
49397
49495
  }
49398
- _bindTableEventForPlugin(plugin) {
49399
- var _this = this;
49400
- var _a;
49401
- null === (_a = plugin.runTime) || void 0 === _a || _a.forEach(runTime => {
49402
- this.table.on(runTime, function () {
49403
- var _a;
49404
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49405
- args[_key] = arguments[_key];
49406
- }
49407
- null === (_a = plugin.run) || void 0 === _a || _a.call(plugin, ...args, runTime, _this.table);
49496
+ initPlugins(table) {
49497
+ this.plugins.forEach(plugin => {
49498
+ var _a;
49499
+ null === (_a = plugin.runTime) || void 0 === _a || _a.forEach(runTime => {
49500
+ table.on(runTime, function () {
49501
+ var _a;
49502
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49503
+ args[_key] = arguments[_key];
49504
+ }
49505
+ null === (_a = plugin.run) || void 0 === _a || _a.call(plugin, ...args, runTime, table);
49506
+ });
49408
49507
  });
49409
49508
  });
49410
49509
  }
49411
- updatePlugins(plugins) {
49412
- Array.from(this.plugins.values()).filter(plugin => !(null == plugins ? void 0 : plugins.some(p => p.id === plugin.id))).forEach(plugin => {
49413
- this.release(), this.plugins.delete(plugin.id);
49414
- }), this.plugins.forEach(plugin => {
49415
- plugin.update && plugin.update();
49416
- });
49417
- const addedPlugins = null == plugins ? void 0 : plugins.filter(plugin => !this.plugins.has(plugin.id));
49418
- null == addedPlugins || addedPlugins.forEach(plugin => {
49419
- this.register(plugin), this._bindTableEventForPlugin(plugin);
49510
+ updatePlugins() {
49511
+ this.plugins.forEach(plugin => {
49512
+ plugin.update && plugin.update(this.table);
49420
49513
  });
49421
49514
  }
49422
49515
  release() {
@@ -49442,7 +49535,7 @@
49442
49535
  constructor(container) {
49443
49536
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
49444
49537
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
49445
- if (super(), this.showFrozenIcon = !0, this.version = "1.18.2-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49538
+ if (super(), this.showFrozenIcon = !0, this.version = "1.18.2-alpha.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49446
49539
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
49447
49540
  options: options,
49448
49541
  container: container
@@ -49968,6 +50061,12 @@
49968
50061
  if (this.internalProps.colCount <= 0) return 0;
49969
50062
  return this.getColsWidth(0, this.internalProps.colCount - 1);
49970
50063
  }
50064
+ getColsWidths() {
50065
+ const maxCount = this.colCount,
50066
+ widths = [];
50067
+ for (let col = 0; col < maxCount; col++) widths.push(this.getColWidth(col));
50068
+ return widths;
50069
+ }
49971
50070
  getMaxColWidth(col) {
49972
50071
  var _a;
49973
50072
  const obj = this.colWidthsLimit[col];
@@ -50280,8 +50379,8 @@
50280
50379
  return super.fireListeners(type, event);
50281
50380
  }
50282
50381
  updateOption(options) {
50283
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
50284
- null === (_a = this.editorManager) || void 0 === _a || _a.cancelEdit(), this.options = options, this._hasAutoImageColumn = void 0;
50382
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
50383
+ this.options = options, this._hasAutoImageColumn = void 0;
50285
50384
  const {
50286
50385
  frozenColCount = 0,
50287
50386
  unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth,
@@ -50321,9 +50420,9 @@
50321
50420
  } = options;
50322
50421
  pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio), padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), this.showFrozenIcon = "boolean" != typeof showFrozenIcon || showFrozenIcon, "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.widthMode = null != widthMode ? widthMode : "standard", this.heightMode = null != heightMode ? heightMode : "standard", this._widthAdaptiveMode = null != widthAdaptiveMode ? widthAdaptiveMode : "only-body", this._heightAdaptiveMode = null != heightAdaptiveMode ? heightAdaptiveMode : "only-body", this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight, this.customRender = customRender, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0;
50323
50422
  const internalProps = this.internalProps;
50324
- if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_c = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _c ? _c : columnResizeMode, internalProps.rowResizeMode = null !== (_d = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _d ? _d : rowResizeMode, internalProps.dragHeaderMode = null !== (_f = null !== (_e = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _e ? _e : dragHeaderMode) && void 0 !== _f ? _f : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_g = options.theme) && void 0 !== _g ? _g : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_h = options.allowFrozenColCount) && void 0 !== _h ? _h : 0, internalProps.limitMaxAutoWidth = null !== (_j = options.limitMaxAutoWidth) && void 0 !== _j ? _j : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_k = internalProps.legends) || void 0 === _k || _k.forEach(legend => {
50423
+ if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_b = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _b ? _b : columnResizeMode, internalProps.rowResizeMode = null !== (_c = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _c ? _c : rowResizeMode, internalProps.dragHeaderMode = null !== (_e = null !== (_d = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _d ? _d : dragHeaderMode) && void 0 !== _e ? _e : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_f = options.theme) && void 0 !== _f ? _f : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_g = options.allowFrozenColCount) && void 0 !== _g ? _g : 0, internalProps.limitMaxAutoWidth = null !== (_h = options.limitMaxAutoWidth) && void 0 !== _h ? _h : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_j = internalProps.legends) || void 0 === _j || _j.forEach(legend => {
50325
50424
  null == legend || legend.release();
50326
- }), null === (_l = internalProps.title) || void 0 === _l || _l.release(), internalProps.title = null, null === (_m = internalProps.emptyTip) || void 0 === _m || _m.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
50425
+ }), null === (_k = internalProps.title) || void 0 === _k || _k.release(), internalProps.title = null, null === (_l = internalProps.emptyTip) || void 0 === _l || _l.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
50327
50426
  internalProps.legends = [];
50328
50427
  const createLegend = Factory.getFunction("createLegend");
50329
50428
  if (Array.isArray(options.legends)) {
@@ -50349,11 +50448,11 @@
50349
50448
  }
50350
50449
  if (internalProps.menu = Object.assign({
50351
50450
  renderMode: "html"
50352
- }, options.menu), Array.isArray(null === (_o = options.menu) || void 0 === _o ? void 0 : _o.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_p = options.menu) || void 0 === _p ? void 0 : _p.dropDownMenuHighlight), (Array.isArray(null === (_q = options.menu) || void 0 === _q ? void 0 : _q.defaultHeaderMenuItems) || "function" == typeof (null === (_r = options.menu) || void 0 === _r ? void 0 : _r.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode && !internalProps.menuHandler) {
50451
+ }, options.menu), Array.isArray(null === (_m = options.menu) || void 0 === _m ? void 0 : _m.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_o = options.menu) || void 0 === _o ? void 0 : _o.dropDownMenuHighlight), (Array.isArray(null === (_p = options.menu) || void 0 === _p ? void 0 : _p.defaultHeaderMenuItems) || "function" == typeof (null === (_q = options.menu) || void 0 === _q ? void 0 : _q.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode && !internalProps.menuHandler) {
50353
50452
  const MenuHandler = Factory.getComponent("menuHandler");
50354
50453
  internalProps.menuHandler = new MenuHandler(this);
50355
50454
  }
50356
- this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_s = this.customCellStylePlugin) || void 0 === _s || _s.updateCustomCell(null !== (_t = options.customCellStyle) && void 0 !== _t ? _t : [], null !== (_u = options.customCellStyleArrangement) && void 0 !== _u ? _u : []), this._adjustCanvasSizeByOption();
50455
+ this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_r = this.customCellStylePlugin) || void 0 === _r || _r.updateCustomCell(null !== (_s = options.customCellStyle) && void 0 !== _s ? _s : [], null !== (_t = options.customCellStyleArrangement) && void 0 !== _t ? _t : []), this._adjustCanvasSizeByOption();
50357
50456
  }
50358
50457
  renderWithRecreateCells() {
50359
50458
  this.internalProps.stick.changedCells.clear();
@@ -54207,11 +54306,12 @@
54207
54306
  }
54208
54307
  updateColumns(columns) {
54209
54308
  var _a, _b, _c, _d;
54309
+ this.scenegraph.clearCells();
54210
54310
  const oldHoverState = {
54211
54311
  col: this.stateManager.hover.cellPos.col,
54212
54312
  row: this.stateManager.hover.cellPos.row
54213
54313
  };
54214
- this.internalProps.columns = cloneDeepSpec(columns, ["children"]), generateAggregationForColumn(this), this.options.columns = columns, this.internalProps.headerHelper.setTableColumnsEditor(), this._hasAutoImageColumn = void 0, this.refreshHeader(), null === (_b = (_a = this.dataSource).updateColumns) || void 0 === _b || _b.call(_a, this.internalProps.columns), this.records && checkHasAggregationOnColumnDefine(columns) && this.dataSource.processRecords(null !== (_d = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records) && void 0 !== _d ? _d : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.clearCells(), this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
54314
+ this.internalProps.columns = cloneDeepSpec(columns, ["children"]), generateAggregationForColumn(this), this.options.columns = columns, this.internalProps.headerHelper.setTableColumnsEditor(), this._hasAutoImageColumn = void 0, this.refreshHeader(), null === (_b = (_a = this.dataSource).updateColumns) || void 0 === _b || _b.call(_a, this.internalProps.columns), this.records && checkHasAggregationOnColumnDefine(columns) && this.dataSource.processRecords(null !== (_d = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records) && void 0 !== _d ? _d : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
54215
54315
  }
54216
54316
  addColumn(column) {
54217
54317
  const columns = this.options.columns;
@@ -54251,7 +54351,7 @@
54251
54351
  if (this.options.groupBy) {
54252
54352
  const record = table.getCellRawRecord(col, row);
54253
54353
  if (null == record ? void 0 : record.vtableMerge) return "";
54254
- value = this.dataSource.getGroupSeriesNumber(row - this.columnHeaderLevelCount);
54354
+ table.internalProps.layoutMap.isAggregation(col, row) || (value = this.dataSource.getGroupSeriesNumber(row - this.columnHeaderLevelCount));
54255
54355
  } else value = row - this.columnHeaderLevelCount + 1;
54256
54356
  const {
54257
54357
  format: format
@@ -54382,22 +54482,26 @@
54382
54482
  return ifCan;
54383
54483
  }
54384
54484
  updateOption(options) {
54385
- var _a, _b, _c, _d, _e, _f, _g, _h;
54485
+ let updateConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
54486
+ keepData: !1
54487
+ };
54488
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
54386
54489
  const internalProps = this.internalProps;
54387
- if (super.updateOption(options), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$3(options.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
54388
- var _a;
54389
- return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
54390
- }), internalProps.releaseList = null), options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
54490
+ if (super.updateOption(options), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$3(options.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
54491
+ const releaseObj = internalProps.releaseList[i];
54492
+ updateConfig.keepData && releaseObj instanceof DataSource ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj), internalProps.releaseList.splice(i, 1));
54493
+ }
54494
+ if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
54391
54495
  sortState: options.sortState
54392
- }) : (this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
54496
+ }) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(), this.render()), options.title) {
54393
54497
  const Title = Factory.getComponent("title");
54394
54498
  internalProps.title = new Title(options.title, this), this.scenegraph.resize();
54395
54499
  }
54396
- if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible();else {
54500
+ if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();else {
54397
54501
  const EmptyTip = Factory.getComponent("emptyTip");
54398
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
54502
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
54399
54503
  }
54400
- return this.pluginManager.updatePlugins(options.plugins), new Promise(resolve => {
54504
+ return new Promise(resolve => {
54401
54505
  setTimeout(resolve, 0);
54402
54506
  });
54403
54507
  }