@visactor/vtable 1.14.0 → 1.14.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.
Files changed (63) hide show
  1. package/cjs/PivotTable.js +5 -4
  2. package/cjs/PivotTable.js.map +1 -1
  3. package/cjs/core/BaseTable.js +8 -7
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/core/record-helper.js +7 -5
  6. package/cjs/core/record-helper.js.map +1 -1
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/layout/chart-helper/get-chart-spec.js +9 -2
  11. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  12. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
  13. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  14. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  15. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  16. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +2 -2
  17. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  18. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +9 -1
  19. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  20. package/cjs/scenegraph/group-creater/progress/update-position/util.js +2 -2
  21. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  22. package/cjs/scenegraph/layout/update-width.js +1 -2
  23. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  24. package/cjs/scenegraph/scenegraph.js +6 -3
  25. package/cjs/scenegraph/scenegraph.js.map +1 -1
  26. package/cjs/state/checkbox/checkbox.js +3 -3
  27. package/cjs/state/checkbox/checkbox.js.map +1 -1
  28. package/cjs/ts-types/base-table.d.ts +1 -0
  29. package/cjs/ts-types/base-table.js.map +1 -1
  30. package/cjs/vrender.js.map +1 -1
  31. package/dist/vtable.js +345 -221
  32. package/dist/vtable.min.js +2 -2
  33. package/es/PivotTable.js +5 -4
  34. package/es/PivotTable.js.map +1 -1
  35. package/es/core/BaseTable.js +8 -7
  36. package/es/core/BaseTable.js.map +1 -1
  37. package/es/core/record-helper.js +7 -5
  38. package/es/core/record-helper.js.map +1 -1
  39. package/es/index.d.ts +1 -1
  40. package/es/index.js +1 -1
  41. package/es/index.js.map +1 -1
  42. package/es/layout/chart-helper/get-chart-spec.js +9 -2
  43. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  44. package/es/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
  45. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  46. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  47. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  48. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +2 -2
  49. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  50. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +9 -1
  51. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  52. package/es/scenegraph/group-creater/progress/update-position/util.js +2 -2
  53. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -1
  54. package/es/scenegraph/layout/update-width.js +1 -2
  55. package/es/scenegraph/layout/update-width.js.map +1 -1
  56. package/es/scenegraph/scenegraph.js +6 -3
  57. package/es/scenegraph/scenegraph.js.map +1 -1
  58. package/es/state/checkbox/checkbox.js +3 -2
  59. package/es/state/checkbox/checkbox.js.map +1 -1
  60. package/es/ts-types/base-table.d.ts +1 -0
  61. package/es/ts-types/base-table.js.map +1 -1
  62. package/es/vrender.js.map +1 -1
  63. package/package.json +7 -7
@@ -86,7 +86,7 @@ export class BaseTable extends EventTarget {
86
86
  }
87
87
  constructor(container, options = {}) {
88
88
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
89
- if (super(), this.showFrozenIcon = !0, this.version = "1.14.0", this.id = `VTable${Date.now()}`,
89
+ if (super(), this.showFrozenIcon = !0, this.version = "1.14.2", this.id = `VTable${Date.now()}`,
90
90
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
91
91
  !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
92
92
  const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
@@ -405,14 +405,15 @@ export class BaseTable extends EventTarget {
405
405
  if (this.canvasSizeSeted) widthWithoutPadding = this.canvasWidth, heightWithoutPadding = this.canvasHeight; else if (element.parentElement) {
406
406
  const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement);
407
407
  widthWithoutPadding = element.parentElement.offsetWidth - parseInt(computedStyle.paddingLeft || "0px", 10) - parseInt(computedStyle.paddingRight || "0px", 10),
408
- heightWithoutPadding = element.parentElement.offsetHeight - parseInt(computedStyle.paddingTop || "0px", 10) - parseInt(computedStyle.paddingBottom || "0px", 20);
408
+ heightWithoutPadding = element.parentElement.offsetHeight - parseInt(computedStyle.paddingTop || "0px", 10) - parseInt(computedStyle.paddingBottom || "0px", 20),
409
+ widthWithoutPadding = (null != widthWithoutPadding ? widthWithoutPadding : 1) - (this.options.tableSizeAntiJitter ? 1 : 0),
410
+ heightWithoutPadding = (null != heightWithoutPadding ? heightWithoutPadding : 1) - (this.options.tableSizeAntiJitter ? 1 : 0);
409
411
  }
410
- const width1 = null != widthWithoutPadding ? widthWithoutPadding : 0, height1 = null != heightWithoutPadding ? heightWithoutPadding : 0;
411
- element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
412
- element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
412
+ element.style.width = widthWithoutPadding && widthWithoutPadding - padding.left - padding.right + "px" || "0px",
413
+ element.style.height = heightWithoutPadding && heightWithoutPadding - padding.top - padding.bottom + "px" || "0px";
413
414
  const {canvas: canvas} = this.internalProps;
414
- widthP = null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 0,
415
- heightP = null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 0,
415
+ widthP = (null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 1) - (this.options.tableSizeAntiJitter ? 1 : 0),
416
+ heightP = (null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 1) - (this.options.tableSizeAntiJitter ? 1 : 0),
416
417
  (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
417
418
  canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
418
419
  canvas.style.height = `${heightP}px`);