@visactor/vtable 1.17.3-alpha.3 → 1.17.3-alpha.5

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 (83) hide show
  1. package/cjs/PivotTable.d.ts +5 -0
  2. package/cjs/PivotTable.js +13 -0
  3. package/cjs/PivotTable.js.map +1 -1
  4. package/cjs/core/BaseTable.js +16 -22
  5. package/cjs/core/BaseTable.js.map +1 -1
  6. package/cjs/core/TABLE_EVENT_TYPE.d.ts +0 -1
  7. package/cjs/core/TABLE_EVENT_TYPE.js +0 -1
  8. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  9. package/cjs/dataset/dataset-pivot-table.js +1 -2
  10. package/cjs/dataset/dataset.js +6 -4
  11. package/cjs/dataset/dataset.js.map +1 -1
  12. package/cjs/edit/editors.js +2 -1
  13. package/cjs/index.d.ts +1 -1
  14. package/cjs/index.js +1 -1
  15. package/cjs/index.js.map +1 -1
  16. package/cjs/layout/pivot-header-layout.js +10 -11
  17. package/cjs/layout/pivot-header-layout.js.map +1 -1
  18. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  19. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  20. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  21. package/cjs/scenegraph/layout/frozen.js +5 -5
  22. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  23. package/cjs/scenegraph/select/create-select-border.js +13 -2
  24. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  25. package/cjs/scenegraph/select/update-select-border.js +1 -5
  26. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  27. package/cjs/state/select/update-position.js +2 -2
  28. package/cjs/state/select/update-position.js.map +1 -1
  29. package/cjs/state/state.js +79 -47
  30. package/cjs/state/state.js.map +1 -1
  31. package/cjs/ts-types/base-table.d.ts +1 -0
  32. package/cjs/ts-types/base-table.js.map +1 -1
  33. package/cjs/ts-types/common.d.ts +3 -1
  34. package/cjs/ts-types/common.js.map +1 -1
  35. package/cjs/ts-types/events.d.ts +3 -8
  36. package/cjs/ts-types/events.js.map +1 -1
  37. package/cjs/ts-types/table-engine.d.ts +1 -0
  38. package/cjs/ts-types/table-engine.js.map +1 -1
  39. package/cjs/ts-types/theme.js.map +1 -1
  40. package/cjs/vrender.js.map +1 -1
  41. package/dist/vtable.js +205 -121
  42. package/dist/vtable.min.js +2 -2
  43. package/es/PivotTable.d.ts +5 -0
  44. package/es/PivotTable.js +13 -0
  45. package/es/PivotTable.js.map +1 -1
  46. package/es/core/BaseTable.js +16 -22
  47. package/es/core/BaseTable.js.map +1 -1
  48. package/es/core/TABLE_EVENT_TYPE.d.ts +0 -1
  49. package/es/core/TABLE_EVENT_TYPE.js +0 -1
  50. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  51. package/es/dataset/dataset-pivot-table.js +1 -2
  52. package/es/dataset/dataset.js +6 -4
  53. package/es/dataset/dataset.js.map +1 -1
  54. package/es/edit/editors.js +2 -1
  55. package/es/index.d.ts +1 -1
  56. package/es/index.js +1 -1
  57. package/es/index.js.map +1 -1
  58. package/es/layout/pivot-header-layout.js +10 -10
  59. package/es/layout/pivot-header-layout.js.map +1 -1
  60. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  61. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  62. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  63. package/es/scenegraph/layout/frozen.js +5 -5
  64. package/es/scenegraph/layout/frozen.js.map +1 -1
  65. package/es/scenegraph/select/create-select-border.js +13 -2
  66. package/es/scenegraph/select/create-select-border.js.map +1 -1
  67. package/es/scenegraph/select/update-select-border.js +1 -5
  68. package/es/scenegraph/select/update-select-border.js.map +1 -1
  69. package/es/state/select/update-position.js +2 -2
  70. package/es/state/select/update-position.js.map +1 -1
  71. package/es/state/state.js +79 -47
  72. package/es/state/state.js.map +1 -1
  73. package/es/ts-types/base-table.d.ts +1 -0
  74. package/es/ts-types/base-table.js.map +1 -1
  75. package/es/ts-types/common.d.ts +3 -1
  76. package/es/ts-types/common.js.map +1 -1
  77. package/es/ts-types/events.d.ts +3 -8
  78. package/es/ts-types/events.js.map +1 -1
  79. package/es/ts-types/table-engine.d.ts +1 -0
  80. package/es/ts-types/table-engine.js.map +1 -1
  81. package/es/ts-types/theme.js.map +1 -1
  82. package/es/vrender.js.map +1 -1
  83. package/package.json +4 -4
@@ -43,7 +43,7 @@ class BaseTable extends EventTarget_1.EventTarget {
43
43
  }
44
44
  constructor(container, options = {}) {
45
45
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
46
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.3", this.id = `VTable${Date.now()}`,
46
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.5", this.id = `VTable${Date.now()}`,
47
47
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
48
48
  !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49
49
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vrender_1.vglobal.isImageAnonymous = !1);
@@ -192,14 +192,7 @@ class BaseTable extends EventTarget_1.EventTarget {
192
192
  this._updateSize(), null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
193
193
  null == legend || legend.resize();
194
194
  })), this.internalProps.title && this.internalProps.title.resize(), this.internalProps.emptyTip && this.internalProps.emptyTip.resize(),
195
- this.scenegraph.resize(), setTimeout((() => {
196
- this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.RESIZE_TABLE, {
197
- tableX: this.tableX,
198
- tableY: this.tableY,
199
- tableWidth: this.tableNoFrameWidth,
200
- tableHeight: this.tableNoFrameHeight
201
- });
202
- }), 0);
195
+ this.scenegraph.resize();
203
196
  }
204
197
  get rowCount() {
205
198
  return this.internalProps.rowCount;
@@ -420,7 +413,7 @@ class BaseTable extends EventTarget_1.EventTarget {
420
413
  }
421
414
  }
422
415
  _updateSize() {
423
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
416
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
424
417
  const {padding: padding} = this;
425
418
  let widthP = 0, heightP = 0;
426
419
  if (this.tableX = 0, this.tableY = 0, this.options.canvas && this.options.viewBox) widthP = this.options.viewBox.x2 - this.options.viewBox.x1,
@@ -439,24 +432,25 @@ class BaseTable extends EventTarget_1.EventTarget {
439
432
  const {canvas: canvas} = this.internalProps;
440
433
  widthP = (null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 1) - (this.options.tableSizeAntiJitter ? 1 : 0),
441
434
  heightP = (null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 1) - (this.options.tableSizeAntiJitter ? 1 : 0),
442
- (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
435
+ (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) && !(null === (_h = this.options) || void 0 === _h ? void 0 : _h.canvas) && this.scenegraph.stage.resize(widthP, heightP, !1) : (canvas.style.width = "",
443
436
  canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
444
- canvas.style.height = `${heightP}px`);
437
+ canvas.style.height = `${heightP}px`), (null === (_j = this.options) || void 0 === _j ? void 0 : _j.viewBox) && (widthP = this.options.viewBox.x2 - this.options.viewBox.x1,
438
+ heightP = this.options.viewBox.y2 - this.options.viewBox.y1), (null === (_k = null == this ? void 0 : this.scenegraph) || void 0 === _k ? void 0 : _k.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP));
445
439
  } else "node" === env_1.Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
446
440
  const width = Math.floor(widthP - style.getVerticalScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getHorizontalScrollBarSize(this.getTheme().scrollStyle));
447
- if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
448
- const lineWidths = toBoxArray(null !== (_j = null === (_h = this.internalProps.theme.frameStyle) || void 0 === _h ? void 0 : _h.borderLineWidth) && void 0 !== _j ? _j : [ null ]), shadowWidths = toBoxArray(null !== (_l = null === (_k = this.internalProps.theme.frameStyle) || void 0 === _k ? void 0 : _k.shadowBlur) && void 0 !== _l ? _l : [ 0 ]);
449
- (null === (_m = this.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? (this.tableX = 0,
450
- this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_o = shadowWidths[1]) && void 0 !== _o ? _o : 0),
451
- this.tableNoFrameHeight = height - (null !== (_p = shadowWidths[2]) && void 0 !== _p ? _p : 0)) : (this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0),
452
- this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
453
- this.tableNoFrameWidth = width - ((null !== (_u = lineWidths[1]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[1]) && void 0 !== _v ? _v : 0)) - ((null !== (_w = lineWidths[3]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[3]) && void 0 !== _x ? _x : 0)),
454
- this.tableNoFrameHeight = height - ((null !== (_y = lineWidths[0]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[0]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[2]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[2]) && void 0 !== _1 ? _1 : 0)));
441
+ if (null === (_l = this.internalProps.theme) || void 0 === _l ? void 0 : _l.frameStyle) {
442
+ const lineWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.borderLineWidth) && void 0 !== _o ? _o : [ null ]), shadowWidths = toBoxArray(null !== (_q = null === (_p = this.internalProps.theme.frameStyle) || void 0 === _p ? void 0 : _p.shadowBlur) && void 0 !== _q ? _q : [ 0 ]);
443
+ (null === (_r = this.theme.frameStyle) || void 0 === _r ? void 0 : _r.innerBorder) ? (this.tableX = 0,
444
+ this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_s = shadowWidths[1]) && void 0 !== _s ? _s : 0),
445
+ this.tableNoFrameHeight = height - (null !== (_t = shadowWidths[2]) && void 0 !== _t ? _t : 0)) : (this.tableX = (null !== (_u = lineWidths[3]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[3]) && void 0 !== _v ? _v : 0),
446
+ this.tableY = (null !== (_w = lineWidths[0]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[0]) && void 0 !== _x ? _x : 0),
447
+ this.tableNoFrameWidth = width - ((null !== (_y = lineWidths[1]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[1]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[3]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[3]) && void 0 !== _1 ? _1 : 0)),
448
+ this.tableNoFrameHeight = height - ((null !== (_2 = lineWidths[0]) && void 0 !== _2 ? _2 : 0) + (null !== (_3 = shadowWidths[0]) && void 0 !== _3 ? _3 : 0)) - ((null !== (_4 = lineWidths[2]) && void 0 !== _4 ? _4 : 0) + (null !== (_5 = shadowWidths[2]) && void 0 !== _5 ? _5 : 0)));
455
449
  }
456
450
  }
457
451
  updateViewBox(newViewBox) {
458
- var _a, _b, _c, _d, _e, _f, _g, _h;
459
- const oldWidth = null !== (_d = null !== (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox.x2) && void 0 !== _b ? _b : 0 - (null === (_c = this.options) || void 0 === _c ? void 0 : _c.viewBox.x1)) && void 0 !== _d ? _d : 0, oldHeight = null !== (_h = null !== (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.viewBox.y2) && void 0 !== _f ? _f : 0 - (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox.y1)) && void 0 !== _h ? _h : 0, newWidth = newViewBox.x2 - newViewBox.x1, newHeight = newViewBox.y2 - newViewBox.y1;
452
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
453
+ const oldWidth = (null !== (_c = null === (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox) || void 0 === _b ? void 0 : _b.x2) && void 0 !== _c ? _c : 0) - (null !== (_f = null === (_e = null === (_d = this.options) || void 0 === _d ? void 0 : _d.viewBox) || void 0 === _e ? void 0 : _e.x1) && void 0 !== _f ? _f : 0), oldHeight = (null !== (_j = null === (_h = null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) || void 0 === _h ? void 0 : _h.y2) && void 0 !== _j ? _j : 0) - (null !== (_m = null === (_l = null === (_k = this.options) || void 0 === _k ? void 0 : _k.viewBox) || void 0 === _l ? void 0 : _l.y1) && void 0 !== _m ? _m : 0), newWidth = newViewBox.x2 - newViewBox.x1, newHeight = newViewBox.y2 - newViewBox.y1;
460
454
  this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
461
455
  }
462
456
  setViewBoxTransform(a, b, c, d, e, f) {