@visactor/vtable 1.0.1 → 1.0.2-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/PivotChart.d.ts +1 -1
- package/cjs/PivotChart.js +10 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +36 -14
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -2
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +54 -19
- package/dist/vtable.min.js +1 -1
- package/es/PivotChart.d.ts +1 -1
- package/es/PivotChart.js +10 -2
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +34 -15
- package/es/core/BaseTable.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/ts-types/base-table.d.ts +2 -2
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/es/core/BaseTable.js
CHANGED
|
@@ -82,7 +82,7 @@ export class BaseTable extends EventTarget {
|
|
|
82
82
|
}
|
|
83
83
|
constructor(container, options = {}) {
|
|
84
84
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
85
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.0.
|
|
85
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.0.2-alpha.0", this.id = `VTable${Date.now()}`,
|
|
86
86
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
87
87
|
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
88
88
|
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, 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;
|
|
@@ -101,7 +101,7 @@ export class BaseTable extends EventTarget {
|
|
|
101
101
|
this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight,
|
|
102
102
|
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
|
|
103
103
|
const internalProps = this.internalProps = {};
|
|
104
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
104
|
+
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
105
105
|
"node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
|
|
106
106
|
internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
|
|
107
107
|
internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d")),
|
|
@@ -135,11 +135,18 @@ export class BaseTable extends EventTarget {
|
|
|
135
135
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
136
136
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
137
137
|
this._vDataSet = new DataSet, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this),
|
|
138
|
-
this.eventManager = new EventManager(this), options.legends
|
|
139
|
-
|
|
138
|
+
this.eventManager = new EventManager(this), options.legends) if (internalProps.legends = [],
|
|
139
|
+
Array.isArray(options.legends)) {
|
|
140
|
+
for (let i = 0; i < options.legends.length; i++) internalProps.legends.push(createLegend(options.legends[i], this));
|
|
141
|
+
this.scenegraph.tableGroup.setAttributes({
|
|
142
|
+
x: this.tableX,
|
|
143
|
+
y: this.tableY
|
|
144
|
+
});
|
|
145
|
+
} else internalProps.legends.push(createLegend(options.legends, this)), this.scenegraph.tableGroup.setAttributes({
|
|
140
146
|
x: this.tableX,
|
|
141
147
|
y: this.tableY
|
|
142
|
-
})
|
|
148
|
+
});
|
|
149
|
+
internalProps.tooltip = Object.assign({
|
|
143
150
|
renderMode: "html",
|
|
144
151
|
isShowOverflowTextTooltip: !1,
|
|
145
152
|
confine: !0
|
|
@@ -164,8 +171,10 @@ export class BaseTable extends EventTarget {
|
|
|
164
171
|
return this.internalProps.canvas;
|
|
165
172
|
}
|
|
166
173
|
resize() {
|
|
167
|
-
|
|
168
|
-
this.
|
|
174
|
+
var _a;
|
|
175
|
+
this._updateSize(), null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
|
|
176
|
+
null == legend || legend.resize();
|
|
177
|
+
})), this.internalProps.title && this.internalProps.title.resize(), this.scenegraph.resize();
|
|
169
178
|
}
|
|
170
179
|
get rowCount() {
|
|
171
180
|
return this.internalProps.rowCount;
|
|
@@ -771,8 +780,10 @@ export class BaseTable extends EventTarget {
|
|
|
771
780
|
IconCache.clearAll(), null === (_e = super.release) || void 0 === _e || _e.call(this),
|
|
772
781
|
null === (_g = null === (_f = internalProps.handler) || void 0 === _f ? void 0 : _f.release) || void 0 === _g || _g.call(_f),
|
|
773
782
|
null === (_j = null === (_h = internalProps.focusControl) || void 0 === _h ? void 0 : _h.release) || void 0 === _j || _j.call(_h),
|
|
774
|
-
null === (_k = internalProps.legends) || void 0 === _k || _k.
|
|
775
|
-
|
|
783
|
+
null === (_k = internalProps.legends) || void 0 === _k || _k.forEach((legend => {
|
|
784
|
+
null == legend || legend.release();
|
|
785
|
+
})), null === (_l = internalProps.title) || void 0 === _l || _l.release(), internalProps.layoutMap.release(),
|
|
786
|
+
internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
776
787
|
var _a;
|
|
777
788
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
778
789
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
@@ -799,7 +810,7 @@ export class BaseTable extends EventTarget {
|
|
|
799
810
|
this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight,
|
|
800
811
|
this.customRender = customRender;
|
|
801
812
|
const internalProps = this.internalProps;
|
|
802
|
-
"node" !== Env.mode && updateRootElementPadding(internalProps.element, this.padding),
|
|
813
|
+
if ("node" !== Env.mode && updateRootElementPadding(internalProps.element, this.padding),
|
|
803
814
|
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal",
|
|
804
815
|
internalProps.frozenColCount = frozenColCount, internalProps.defaultRowHeight = defaultRowHeight,
|
|
805
816
|
internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight,
|
|
@@ -820,14 +831,22 @@ export class BaseTable extends EventTarget {
|
|
|
820
831
|
internalProps.limitMaxAutoWidth = null !== (_d = options.limitMaxAutoWidth) && void 0 !== _d ? _d : 450,
|
|
821
832
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
822
833
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
823
|
-
this._vDataSet = new DataSet, null === (_e = internalProps.legends) || void 0 === _e || _e.
|
|
824
|
-
|
|
834
|
+
this._vDataSet = new DataSet, null === (_e = internalProps.legends) || void 0 === _e || _e.forEach((legend => {
|
|
835
|
+
null == legend || legend.release();
|
|
836
|
+
})), null === (_f = internalProps.title) || void 0 === _f || _f.release(), internalProps.layoutMap.release(),
|
|
825
837
|
this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(),
|
|
826
|
-
this._updateSize(), this.eventManager.updateEventBinder(), options.legends
|
|
827
|
-
|
|
838
|
+
this._updateSize(), this.eventManager.updateEventBinder(), options.legends) if (internalProps.legends = [],
|
|
839
|
+
Array.isArray(options.legends)) {
|
|
840
|
+
for (let i = 0; i < options.legends.length; i++) internalProps.legends.push(createLegend(options.legends[i], this));
|
|
841
|
+
this.scenegraph.tableGroup.setAttributes({
|
|
842
|
+
x: this.tableX,
|
|
843
|
+
y: this.tableY
|
|
844
|
+
});
|
|
845
|
+
} else internalProps.legends.push(createLegend(options.legends, this)), this.scenegraph.tableGroup.setAttributes({
|
|
828
846
|
x: this.tableX,
|
|
829
847
|
y: this.tableY
|
|
830
|
-
})
|
|
848
|
+
});
|
|
849
|
+
internalProps.tooltip = Object.assign({
|
|
831
850
|
renderMode: "html",
|
|
832
851
|
isShowOverflowTextTooltip: !1,
|
|
833
852
|
confine: !0
|