@visactor/vtable-calendar 1.18.3-alpha.1 → 1.18.3-alpha.2

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.
@@ -29860,8 +29860,7 @@
29860
29860
  shadow: {
29861
29861
  width: 4,
29862
29862
  startColor: "rgba(00, 24, 47, 0.05)",
29863
- endColor: "rgba(00, 24, 47, 0)",
29864
- visible: "always"
29863
+ endColor: "rgba(00, 24, 47, 0)"
29865
29864
  }
29866
29865
  },
29867
29866
  selectionStyle: {
@@ -29945,8 +29944,7 @@
29945
29944
  shadow: {
29946
29945
  width: 3,
29947
29946
  startColor: "#CBDCFE",
29948
- endColor: "#CBDCFE",
29949
- visible: "always"
29947
+ endColor: "#CBDCFE"
29950
29948
  }
29951
29949
  },
29952
29950
  selectionStyle: {
@@ -30055,8 +30053,7 @@
30055
30053
  shadow: {
30056
30054
  width: 4,
30057
30055
  startColor: "rgba(00, 24, 47, 0.05)",
30058
- endColor: "rgba(00, 24, 47, 0)",
30059
- visible: "always"
30056
+ endColor: "rgba(00, 24, 47, 0)"
30060
30057
  }
30061
30058
  },
30062
30059
  selectionStyle: {
@@ -30140,8 +30137,7 @@
30140
30137
  shadow: {
30141
30138
  width: 3,
30142
30139
  startColor: "rgba(225, 228, 232, 0.6)",
30143
- endColor: "rgba(225, 228, 232, 0.6)",
30144
- visible: "always"
30140
+ endColor: "rgba(225, 228, 232, 0.6)"
30145
30141
  }
30146
30142
  },
30147
30143
  selectionStyle: {
@@ -30820,10 +30816,6 @@
30820
30816
  get endColor() {
30821
30817
  var _a, _b;
30822
30818
  return null !== (_b = null === (_a = frozenColumnLine.shadow) || void 0 === _a ? void 0 : _a.endColor) && void 0 !== _b ? _b : "rgba(00, 24, 47, 0)";
30823
- },
30824
- get visible() {
30825
- var _a, _b;
30826
- return null !== (_b = null === (_a = frozenColumnLine.shadow) || void 0 === _a ? void 0 : _a.visible) && void 0 !== _b ? _b : "always";
30827
30819
  }
30828
30820
  };
30829
30821
  },
@@ -37377,7 +37369,7 @@
37377
37369
 
37378
37370
  class TableComponent {
37379
37371
  constructor(table) {
37380
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
37372
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
37381
37373
  this.table = table;
37382
37374
  const theme = this.table.theme;
37383
37375
  this.createScrollBar();
@@ -37512,10 +37504,9 @@
37512
37504
  }), this.rowResizeLabel.appendChild(rowResizeLabelBack), this.rowResizeLabel.appendChild(rowResizeLabelText), this.cellMover = new CellMover(this.table);
37513
37505
  const shadowWidth = null === (_o = null === (_m = theme.frozenColumnLine) || void 0 === _m ? void 0 : _m.shadow) || void 0 === _o ? void 0 : _o.width,
37514
37506
  shadowStartColor = null === (_q = null === (_p = theme.frozenColumnLine) || void 0 === _p ? void 0 : _p.shadow) || void 0 === _q ? void 0 : _q.startColor,
37515
- shadowEndColor = null === (_s = null === (_r = theme.frozenColumnLine) || void 0 === _r ? void 0 : _r.shadow) || void 0 === _s ? void 0 : _s.endColor,
37516
- visible = null === (_u = null === (_t = theme.frozenColumnLine) || void 0 === _t ? void 0 : _t.shadow) || void 0 === _u ? void 0 : _u.visible;
37507
+ shadowEndColor = null === (_s = null === (_r = theme.frozenColumnLine) || void 0 === _r ? void 0 : _r.shadow) || void 0 === _s ? void 0 : _s.endColor;
37517
37508
  this.frozenShadowLine = createRect({
37518
- visible: "always" === visible,
37509
+ visible: !0,
37519
37510
  pickable: !1,
37520
37511
  x: 0,
37521
37512
  y: 0,
@@ -37536,7 +37527,7 @@
37536
37527
  }]
37537
37528
  }
37538
37529
  }), this.rightFrozenShadowLine = createRect({
37539
- visible: "always" === visible,
37530
+ visible: !0,
37540
37531
  pickable: !1,
37541
37532
  x: 0,
37542
37533
  y: 0,
@@ -37793,40 +37784,28 @@
37793
37784
  this.cellMover.update(backX, lineX, backY, lineY);
37794
37785
  }
37795
37786
  setFrozenColumnShadow(col, isRightFrozen) {
37796
- var _a, _b;
37797
- const colX = getColX(col, this.table, isRightFrozen);
37798
- col < 0 || "always" !== (null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible) ? this.frozenShadowLine.setAttributes({
37799
- visible: !1,
37800
- x: colX,
37801
- height: this.table.getDrawRange().height
37802
- }) : this.frozenShadowLine.setAttributes({
37803
- visible: !0,
37804
- x: colX,
37805
- height: this.table.getDrawRange().height
37806
- });
37787
+ if (col < 0) this.frozenShadowLine.setAttributes({
37788
+ visible: !1
37789
+ });else {
37790
+ const colX = getColX(col, this.table, isRightFrozen);
37791
+ this.frozenShadowLine.setAttributes({
37792
+ visible: !0,
37793
+ x: colX,
37794
+ height: this.table.getDrawRange().height
37795
+ });
37796
+ }
37807
37797
  }
37808
37798
  setRightFrozenColumnShadow(col) {
37809
- var _a, _b;
37810
- const colX = getColX(col, this.table, !0);
37811
- col >= this.table.colCount || "always" !== (null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible) ? this.rightFrozenShadowLine.setAttributes({
37812
- visible: !1,
37813
- x: colX - this.rightFrozenShadowLine.attribute.width,
37814
- height: this.table.getDrawRange().height
37815
- }) : this.rightFrozenShadowLine.setAttributes({
37816
- visible: !0,
37817
- x: colX - this.rightFrozenShadowLine.attribute.width,
37818
- height: this.table.getDrawRange().height
37819
- });
37820
- }
37821
- hideFrozenColumnShadow() {
37822
- var _a, _b, _c, _d, _e;
37823
- const visible1 = null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible;
37824
- "scrolling" === (null !== (_e = null === (_d = null === (_c = this.table.theme.frozenColumnLine) || void 0 === _c ? void 0 : _c.shadow) || void 0 === _d ? void 0 : _d.visible) && void 0 !== _e ? _e : visible1) && (this.frozenShadowLine.setAttribute("visible", !1), this.rightFrozenShadowLine.setAttribute("visible", !1), this.table.scenegraph.updateNextFrame());
37825
- }
37826
- showFrozenColumnShadow() {
37827
- var _a, _b, _c, _d, _e;
37828
- const visible1 = null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible;
37829
- "scrolling" === (null !== (_e = null === (_d = null === (_c = this.table.theme.frozenColumnLine) || void 0 === _c ? void 0 : _c.shadow) || void 0 === _d ? void 0 : _d.visible) && void 0 !== _e ? _e : visible1) && (this.frozenShadowLine.setAttribute("visible", !0), this.rightFrozenShadowLine.setAttribute("visible", !0), this.table.scenegraph.updateNextFrame());
37799
+ if (col >= this.table.colCount) this.rightFrozenShadowLine.setAttributes({
37800
+ visible: !1
37801
+ });else {
37802
+ const colX = getColX(col, this.table, !0);
37803
+ this.rightFrozenShadowLine.setAttributes({
37804
+ visible: !0,
37805
+ x: colX - this.rightFrozenShadowLine.attribute.width,
37806
+ height: this.table.getDrawRange().height
37807
+ });
37808
+ }
37830
37809
  }
37831
37810
  hideVerticalScrollBar() {
37832
37811
  var _a;
@@ -44964,10 +44943,9 @@
44964
44943
  this.table.scenegraph.component.hideHorizontalScrollBar();
44965
44944
  }
44966
44945
  showHorizontalScrollBar(autoHide) {
44967
- var _a;
44968
- this.table.scenegraph.component.showHorizontalScrollBar(), null === (_a = this.table.scenegraph) || void 0 === _a || _a.component.showFrozenColumnShadow(), autoHide && (clearTimeout(this._clearHorizontalScrollBar), this._clearHorizontalScrollBar = setTimeout(() => {
44969
- var _a, _b;
44970
- null === (_a = this.table.scenegraph) || void 0 === _a || _a.component.hideFrozenColumnShadow(), null === (_b = this.table.scenegraph) || void 0 === _b || _b.component.hideHorizontalScrollBar();
44946
+ this.table.scenegraph.component.showHorizontalScrollBar(), autoHide && (clearTimeout(this._clearHorizontalScrollBar), this._clearHorizontalScrollBar = setTimeout(() => {
44947
+ var _a;
44948
+ null === (_a = this.table.scenegraph) || void 0 === _a || _a.component.hideHorizontalScrollBar();
44971
44949
  }, 1e3));
44972
44950
  }
44973
44951
  triggerContextMenu(col, row, x, y) {
@@ -49570,7 +49548,7 @@
49570
49548
  constructor(container) {
49571
49549
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
49572
49550
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
49573
- if (super(), this.showFrozenIcon = !0, this.version = "1.18.3-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");
49551
+ if (super(), this.showFrozenIcon = !0, this.version = "1.18.3-alpha.2", 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");
49574
49552
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
49575
49553
  options: options,
49576
49554
  container: container
@@ -51329,9 +51307,11 @@
51329
51307
  this.render();
51330
51308
  const stage = this.scenegraph.stage;
51331
51309
  if (stage) {
51332
- const contentWidth = this.tableX + this.getAllColsWidth(),
51310
+ let contentWidth = this.tableX + this.getAllColsWidth(),
51333
51311
  contentHeight = this.tableY + this.getAllRowsHeight();
51334
- if (contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
51312
+ if (this.internalProps.legends && this.internalProps.legends.forEach(legend => {
51313
+ "right" === legend.orient ? contentWidth = Math.max(contentWidth, legend.legendComponent.globalAABBBounds.x2) : "bottom" === legend.orient && (contentHeight = Math.max(contentHeight, legend.legendComponent.globalAABBBounds.y2));
51314
+ }), this.internalProps.title && ("right" === this.internalProps.title._titleOption.orient ? contentWidth = Math.max(contentWidth, this.internalProps.title.getComponentGraphic().globalAABBBounds.x2) : "bottom" === this.internalProps.title._titleOption.orient && (contentHeight = Math.max(contentHeight, this.internalProps.title.getComponentGraphic().globalAABBBounds.y2))), contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
51335
51315
  stage.render();
51336
51316
  return stage.window.getImageBuffer(type);
51337
51317
  }