@visactor/vtable 0.17.8 → 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.
- package/cjs/core/BaseTable.js +12 -12
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/listener/container-dom.js +2 -2
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/themes/BRIGHT.js +1 -2
- package/cjs/themes/DARK.js +2 -1
- package/dist/vtable.js +8 -5
- package/dist/vtable.min.js +1 -1
- package/es/core/BaseTable.js +12 -12
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/listener/container-dom.js +2 -2
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/themes/BRIGHT.js +1 -2
- package/es/themes/DARK.js +2 -1
- package/package.json +5 -5
package/es/core/BaseTable.js
CHANGED
|
@@ -74,7 +74,7 @@ export class BaseTable extends EventTarget {
|
|
|
74
74
|
}
|
|
75
75
|
constructor(container, options = {}) {
|
|
76
76
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
77
|
-
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.17.
|
|
77
|
+
if (super(), this.showFrozenIcon = !0, this.showSort = !0, this.version = "0.17.9-alpha.0",
|
|
78
78
|
this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {},
|
|
79
79
|
this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
80
80
|
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 = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth} = options;
|
|
@@ -315,27 +315,27 @@ export class BaseTable extends EventTarget {
|
|
|
315
315
|
this.internalProps.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
|
|
316
316
|
}
|
|
317
317
|
_updateSize() {
|
|
318
|
-
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
|
|
318
|
+
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;
|
|
319
319
|
const {padding: padding} = this;
|
|
320
320
|
let widthP = 0, heightP = 0;
|
|
321
321
|
if ("browser" === Env.mode) {
|
|
322
|
-
const element = this.getElement(), width1 =
|
|
322
|
+
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;
|
|
323
323
|
element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
|
|
324
324
|
element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
|
|
325
325
|
const {canvas: canvas} = this.internalProps;
|
|
326
|
-
widthP = null !== (
|
|
327
|
-
heightP = null !== (
|
|
328
|
-
(null === (
|
|
326
|
+
widthP = null !== (_d = null === (_c = canvas.parentElement) || void 0 === _c ? void 0 : _c.offsetWidth) && void 0 !== _d ? _d : 0,
|
|
327
|
+
heightP = null !== (_f = null === (_e = canvas.parentElement) || void 0 === _e ? void 0 : _e.offsetHeight) && void 0 !== _f ? _f : 0,
|
|
328
|
+
(null === (_g = null == this ? void 0 : this.scenegraph) || void 0 === _g ? void 0 : _g.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
|
|
329
329
|
canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
|
|
330
330
|
canvas.style.height = `${heightP}px`);
|
|
331
331
|
} else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
|
|
332
332
|
const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
|
|
333
|
-
if (null === (
|
|
334
|
-
const lineWidths = toBoxArray(null !== (
|
|
335
|
-
this.tableX = (null !== (
|
|
336
|
-
this.tableY = (null !== (
|
|
337
|
-
this.tableNoFrameWidth = width - ((null !== (
|
|
338
|
-
this.tableNoFrameHeight = height - ((null !== (
|
|
333
|
+
if (null === (_h = this.internalProps.theme) || void 0 === _h ? void 0 : _h.frameStyle) {
|
|
334
|
+
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 ]);
|
|
335
|
+
this.tableX = (null !== (_o = lineWidths[3]) && void 0 !== _o ? _o : 0) + (null !== (_p = shadowWidths[3]) && void 0 !== _p ? _p : 0),
|
|
336
|
+
this.tableY = (null !== (_q = lineWidths[0]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[0]) && void 0 !== _r ? _r : 0),
|
|
337
|
+
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)),
|
|
338
|
+
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));
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
get rowHierarchyType() {
|