@visactor/vtable 1.6.1 → 1.7.0-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.d.ts +2 -0
- package/cjs/core/BaseTable.js +8 -4
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +1 -1
- package/cjs/core/tableHelper.js +5 -4
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/event/listener/table-group.js +6 -4
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +18 -14
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js +9 -14
- package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/cjs/state/state.d.ts +2 -2
- package/cjs/state/state.js +4 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +6 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/style.d.ts +2 -1
- package/cjs/tools/style.js +9 -3
- package/cjs/tools/style.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +46 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +105 -43
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.d.ts +2 -0
- package/es/core/BaseTable.js +9 -6
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/core/tableHelper.d.ts +1 -1
- package/es/core/tableHelper.js +5 -3
- package/es/core/tableHelper.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +1 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/event/listener/table-group.js +6 -4
- package/es/event/listener/table-group.js.map +1 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/component/table-component.js +18 -14
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js +6 -9
- package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/es/state/state.d.ts +2 -2
- package/es/state/state.js +4 -4
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +6 -0
- package/es/themes/theme.js.map +1 -1
- package/es/tools/style.d.ts +2 -1
- package/es/tools/style.js +7 -2
- package/es/tools/style.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +46 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
50
50
|
eventManager: EventManager;
|
|
51
51
|
editorManager: EditManeger;
|
|
52
52
|
_pixelRatio: number;
|
|
53
|
+
canvasSizeSeted?: boolean;
|
|
53
54
|
static get EVENT_TYPE(): typeof TABLE_EVENT_TYPE;
|
|
54
55
|
readonly options: BaseTableConstructorOptions;
|
|
55
56
|
version: string;
|
|
@@ -74,6 +75,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
74
75
|
getContainer(): HTMLElement;
|
|
75
76
|
getElement(): HTMLElement;
|
|
76
77
|
get canvas(): HTMLCanvasElement;
|
|
78
|
+
setCanvasSize(canvasWidth: number, canvasHeight: number): void;
|
|
77
79
|
resize(): void;
|
|
78
80
|
get rowCount(): number;
|
|
79
81
|
set rowCount(rowCount: number);
|
package/es/core/BaseTable.js
CHANGED
|
@@ -78,7 +78,7 @@ export class BaseTable extends EventTarget {
|
|
|
78
78
|
}
|
|
79
79
|
constructor(container, options = {}) {
|
|
80
80
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
81
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.
|
|
81
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.7.0-alpha.0", this.id = `VTable${Date.now()}`,
|
|
82
82
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
83
83
|
!container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
84
84
|
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;
|
|
@@ -93,9 +93,9 @@ export class BaseTable extends EventTarget {
|
|
|
93
93
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding,
|
|
94
94
|
this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top),
|
|
95
95
|
padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left),
|
|
96
|
-
padding.right && (this.padding.right = padding.right))), this.
|
|
97
|
-
this.
|
|
98
|
-
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
|
|
96
|
+
padding.right && (this.padding.right = padding.right))), isValid(canvasHeight) && isValid(canvasWidth) && (this.canvasSizeSeted = !0),
|
|
97
|
+
this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth,
|
|
98
|
+
this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
|
|
99
99
|
const internalProps = this.internalProps = {};
|
|
100
100
|
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
101
101
|
this.options.canvas ? (internalProps.element = this.options.canvas.parentElement,
|
|
@@ -182,6 +182,9 @@ export class BaseTable extends EventTarget {
|
|
|
182
182
|
get canvas() {
|
|
183
183
|
return this.internalProps.canvas;
|
|
184
184
|
}
|
|
185
|
+
setCanvasSize(canvasWidth, canvasHeight) {
|
|
186
|
+
this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.resize();
|
|
187
|
+
}
|
|
185
188
|
resize() {
|
|
186
189
|
var _a;
|
|
187
190
|
this._updateSize(), null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
|
|
@@ -389,7 +392,7 @@ export class BaseTable extends EventTarget {
|
|
|
389
392
|
heightP = this.options.viewBox.y2 - this.options.viewBox.y1, (null === (_a = null == this ? void 0 : this.scenegraph) || void 0 === _a ? void 0 : _a.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP)); else if ("browser" === Env.mode) {
|
|
390
393
|
const element = this.getElement();
|
|
391
394
|
let widthWithoutPadding = 0, heightWithoutPadding = 0;
|
|
392
|
-
if (element.parentElement) {
|
|
395
|
+
if (this.canvasSizeSeted) widthWithoutPadding = this.canvasWidth, heightWithoutPadding = this.canvasHeight; else if (element.parentElement) {
|
|
393
396
|
const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement);
|
|
394
397
|
widthWithoutPadding = element.parentElement.offsetWidth - parseInt(computedStyle.paddingLeft || "0px", 10) - parseInt(computedStyle.paddingRight || "0px", 10),
|
|
395
398
|
heightWithoutPadding = element.parentElement.offsetHeight - parseInt(computedStyle.paddingTop || "0px", 10) - parseInt(computedStyle.paddingBottom || "0px", 20);
|
|
@@ -406,7 +409,7 @@ export class BaseTable extends EventTarget {
|
|
|
406
409
|
this.internalProps.bodyDomContainer.style.height = `${heightP}px`), this.internalProps.headerDomContainer && (this.internalProps.headerDomContainer.style.width = `${widthP}px`,
|
|
407
410
|
this.internalProps.headerDomContainer.style.height = `${heightP}px`);
|
|
408
411
|
} else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
|
|
409
|
-
const width = Math.floor(widthP - style.
|
|
412
|
+
const width = Math.floor(widthP - style.getVerticalScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getHorizontalScrollBarSize(this.getTheme().scrollStyle));
|
|
410
413
|
if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
|
|
411
414
|
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 ]);
|
|
412
415
|
(null === (_m = this.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? (this.tableX = 0,
|