@visactor/vtable 0.17.7 → 0.17.9-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/cjs/core/BaseTable.js +12 -12
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/event/event.js +5 -1
  4. package/cjs/event/event.js.map +1 -1
  5. package/cjs/event/listener/container-dom.js +2 -2
  6. package/cjs/event/listener/container-dom.js.map +1 -1
  7. package/cjs/event/scroll.js +0 -1
  8. package/cjs/event/util.js +1 -0
  9. package/cjs/index.d.ts +1 -1
  10. package/cjs/index.js +1 -1
  11. package/cjs/index.js.map +1 -1
  12. package/cjs/scenegraph/component/custom.js +19 -2
  13. package/cjs/scenegraph/component/custom.js.map +1 -1
  14. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
  15. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  16. package/cjs/scenegraph/layout/update-row.js +6 -4
  17. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  18. package/cjs/scenegraph/select/update-select-border.js +34 -17
  19. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  20. package/cjs/state/cell-move/index.js +2 -1
  21. package/cjs/state/cell-move/index.js.map +1 -1
  22. package/cjs/ts-types/customLayout.d.ts +1 -1
  23. package/cjs/ts-types/customLayout.js.map +1 -1
  24. package/dist/vtable.js +113 -32
  25. package/dist/vtable.min.js +2 -2
  26. package/es/core/BaseTable.js +12 -12
  27. package/es/core/BaseTable.js.map +1 -1
  28. package/es/event/event.js +5 -1
  29. package/es/event/event.js.map +1 -1
  30. package/es/event/listener/container-dom.js +2 -2
  31. package/es/event/listener/container-dom.js.map +1 -1
  32. package/es/event/scroll.js +1 -2
  33. package/es/event/util.js +2 -1
  34. package/es/index.d.ts +1 -1
  35. package/es/index.js +1 -1
  36. package/es/index.js.map +1 -1
  37. package/es/scenegraph/component/custom.js +20 -3
  38. package/es/scenegraph/component/custom.js.map +1 -1
  39. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +2 -2
  40. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  41. package/es/scenegraph/layout/update-row.js +6 -4
  42. package/es/scenegraph/layout/update-row.js.map +1 -1
  43. package/es/scenegraph/select/update-select-border.js +34 -17
  44. package/es/scenegraph/select/update-select-border.js.map +1 -1
  45. package/es/state/cell-move/index.js +2 -1
  46. package/es/state/cell-move/index.js.map +1 -1
  47. package/es/ts-types/customLayout.d.ts +1 -1
  48. package/es/ts-types/customLayout.js.map +1 -1
  49. package/package.json +6 -6
@@ -45,7 +45,7 @@ class BaseTable extends EventTarget_1.EventTarget {
45
45
  }
46
46
  constructor(container, options = {}) {
47
47
  var _a, _b, _c, _d, _e, _f, _g;
48
- if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.17.7",
48
+ if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.17.9-alpha.0",
49
49
  this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {},
50
50
  this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200), !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
51
51
  const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, keyboardOptions: keyboardOptions, columnResizeMode: columnResizeMode, dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth} = options;
@@ -289,27 +289,27 @@ class BaseTable extends EventTarget_1.EventTarget {
289
289
  this.internalProps.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
290
290
  }
291
291
  _updateSize() {
292
- 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;
292
+ 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;
293
293
  const {padding: padding} = this;
294
294
  let widthP = 0, heightP = 0;
295
295
  if ("browser" === env_1.Env.mode) {
296
- const element = this.getElement(), width1 = null !== (_b = null === (_a = element.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) && void 0 !== _b ? _b : 0, height1 = null !== (_d = null === (_c = element.parentElement) || void 0 === _c ? void 0 : _c.offsetHeight) && void 0 !== _d ? _d : 0;
296
+ const element = this.getElement(), width1 = (element.offsetWidth || (null === (_a = element.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) || 1) - 1, height1 = (element.offsetHeight || (null === (_b = element.parentElement) || void 0 === _b ? void 0 : _b.offsetHeight) || 1) - 1;
297
297
  element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
298
298
  element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
299
299
  const {canvas: canvas} = this.internalProps;
300
- widthP = null !== (_f = null === (_e = canvas.parentElement) || void 0 === _e ? void 0 : _e.offsetWidth) && void 0 !== _f ? _f : 0,
301
- heightP = null !== (_h = null === (_g = canvas.parentElement) || void 0 === _g ? void 0 : _g.offsetHeight) && void 0 !== _h ? _h : 0,
302
- (null === (_j = null == this ? void 0 : this.scenegraph) || void 0 === _j ? void 0 : _j.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
300
+ widthP = null !== (_d = null === (_c = canvas.parentElement) || void 0 === _c ? void 0 : _c.offsetWidth) && void 0 !== _d ? _d : 0,
301
+ heightP = null !== (_f = null === (_e = canvas.parentElement) || void 0 === _e ? void 0 : _e.offsetHeight) && void 0 !== _f ? _f : 0,
302
+ (null === (_g = null == this ? void 0 : this.scenegraph) || void 0 === _g ? void 0 : _g.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
303
303
  canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
304
304
  canvas.style.height = `${heightP}px`);
305
305
  } else "node" === env_1.Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
306
306
  const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
307
- if (null === (_k = this.internalProps.theme) || void 0 === _k ? void 0 : _k.frameStyle) {
308
- const lineWidths = toBoxArray(null !== (_m = null === (_l = this.internalProps.theme.frameStyle) || void 0 === _l ? void 0 : _l.borderLineWidth) && void 0 !== _m ? _m : [ null ]), shadowWidths = toBoxArray(null !== (_p = null === (_o = this.internalProps.theme.frameStyle) || void 0 === _o ? void 0 : _o.shadowBlur) && void 0 !== _p ? _p : [ 0 ]);
309
- this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0),
310
- this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
311
- 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)),
312
- 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));
307
+ if (null === (_h = this.internalProps.theme) || void 0 === _h ? void 0 : _h.frameStyle) {
308
+ const lineWidths = toBoxArray(null !== (_k = null === (_j = this.internalProps.theme.frameStyle) || void 0 === _j ? void 0 : _j.borderLineWidth) && void 0 !== _k ? _k : [ null ]), shadowWidths = toBoxArray(null !== (_m = null === (_l = this.internalProps.theme.frameStyle) || void 0 === _l ? void 0 : _l.shadowBlur) && void 0 !== _m ? _m : [ 0 ]);
309
+ this.tableX = (null !== (_o = lineWidths[3]) && void 0 !== _o ? _o : 0) + (null !== (_p = shadowWidths[3]) && void 0 !== _p ? _p : 0),
310
+ this.tableY = (null !== (_q = lineWidths[0]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[0]) && void 0 !== _r ? _r : 0),
311
+ this.tableNoFrameWidth = width - ((null !== (_s = lineWidths[1]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[1]) && void 0 !== _t ? _t : 0)) - ((null !== (_u = lineWidths[3]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[3]) && void 0 !== _v ? _v : 0)),
312
+ this.tableNoFrameHeight = height - ((null !== (_w = lineWidths[0]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[0]) && void 0 !== _x ? _x : 0)) - ((null !== (_y = lineWidths[2]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[2]) && void 0 !== _z ? _z : 0));
313
313
  }
314
314
  }
315
315
  get rowHierarchyType() {