@visactor/vtable 1.25.0 → 1.25.1-alpha.1
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/body-helper/style.js +2 -1
- package/cjs/core/BaseTable.js +48 -20
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.js +1 -2
- package/cjs/data/DataSource.js +1 -2
- package/cjs/edit/edit-manager.js +1 -0
- package/cjs/header-helper/style.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js +1 -2
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +105 -27
- package/dist/vtable.min.js +1 -15
- package/es/body-helper/style.js +2 -1
- package/es/core/BaseTable.js +47 -19
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.js +1 -2
- package/es/data/DataSource.js +1 -2
- package/es/edit/edit-manager.js +2 -1
- package/es/header-helper/style.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js +1 -2
- package/es/vrender.js.map +1 -1
- package/package.json +9 -9
package/cjs/body-helper/style.js
CHANGED
|
@@ -49,4 +49,5 @@ function of(columnStyle, bodyStyle, styleArg, StyleClassDef = Style_1.Style, glo
|
|
|
49
49
|
StyleClassDef === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle_1.RadioStyle ? new RadioStyle_1.RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : StyleClassDef === SwitchStyle_1.SwitchStyle ? new SwitchStyle_1.SwitchStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_c = theme.switchStyle) && void 0 !== _c ? _c : {}) : StyleClassDef === ButtonStyle_1.ButtonStyle ? new ButtonStyle_1.ButtonStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_d = theme.buttonStyle) && void 0 !== _d ? _d : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
|
|
52
|
+
exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
|
|
53
|
+
//# sourceMappingURL=style.js.map
|
package/cjs/core/BaseTable.js
CHANGED
|
@@ -45,9 +45,19 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
45
45
|
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;
|
|
46
46
|
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
|
|
47
47
|
this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
|
|
48
|
-
this.version = "1.25.
|
|
48
|
+
this.version = "1.25.1-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1,
|
|
49
49
|
this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
50
|
-
"
|
|
50
|
+
"undefined" != typeof window) {
|
|
51
|
+
const g = window;
|
|
52
|
+
g[this.id] = this;
|
|
53
|
+
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
54
|
+
byId: Object.create(null),
|
|
55
|
+
list: [],
|
|
56
|
+
last: null
|
|
57
|
+
});
|
|
58
|
+
registry.byId[this.id] = this, registry.list.push(this), registry.last = this, g.__vtable_last_id__ = this.id;
|
|
59
|
+
}
|
|
60
|
+
if ("node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
51
61
|
container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
52
62
|
this.pluginManager = new plugin_manager_1.PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
53
63
|
options: options,
|
|
@@ -87,10 +97,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
87
97
|
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
88
98
|
this.options.canvas ? ("node" !== env_1.Env.mode && (internalProps.element = this.options.canvas.parentElement,
|
|
89
99
|
internalProps.element.style.position = "relative"), internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
|
|
90
|
-
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")
|
|
100
|
+
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d"),
|
|
101
|
+
internalProps.canvas.__vtable__ = this, internalProps.canvas.__vtable_id__ = this.id,
|
|
102
|
+
internalProps.element && (internalProps.element.__vtable__ = this, internalProps.element.__vtable_id__ = this.id)) : "node" !== env_1.Env.mode && (internalProps.element = (0,
|
|
91
103
|
tableHelper_1.createRootElement)(this.padding), internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
|
|
92
104
|
internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas),
|
|
93
|
-
internalProps.context = internalProps.canvas.getContext("2d"),
|
|
105
|
+
internalProps.context = internalProps.canvas.getContext("2d"), internalProps.canvas.__vtable__ = this,
|
|
106
|
+
internalProps.canvas.__vtable_id__ = this.id, internalProps.element.__vtable__ = this,
|
|
107
|
+
internalProps.element.__vtable_id__ = this.id, (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && (0,
|
|
94
108
|
frozen_react_1.createReactContainer)(this)), internalProps.handler = new EventHandler_1.EventHandler,
|
|
95
109
|
(0, vutils_1.isNumber)(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
|
|
96
110
|
internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
|
|
@@ -960,29 +974,43 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
960
974
|
this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
|
|
961
975
|
}
|
|
962
976
|
release() {
|
|
963
|
-
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;
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
977
|
+
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, _2, _3, _4;
|
|
978
|
+
if ("undefined" != typeof window) {
|
|
979
|
+
const g = window;
|
|
980
|
+
(null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
|
|
981
|
+
const registry = null == g ? void 0 : g.__vtable__;
|
|
982
|
+
(null === (_a = null == registry ? void 0 : registry.byId) || void 0 === _a ? void 0 : _a[this.id]) === this && delete registry.byId[this.id];
|
|
983
|
+
const list = null == registry ? void 0 : registry.list;
|
|
984
|
+
if (Array.isArray(list) && list.length) for (let i = list.length - 1; i >= 0; i--) list[i] === this && list.splice(i, 1);
|
|
985
|
+
(null == registry ? void 0 : registry.last) === this && (registry.last = Array.isArray(list) && list.length ? list[list.length - 1] : null),
|
|
986
|
+
(null == g ? void 0 : g.__vtable_last_id__) === this.id && (g.__vtable_last_id__ = null !== (_c = null === (_b = null == registry ? void 0 : registry.last) || void 0 === _b ? void 0 : _b.id) && void 0 !== _c ? _c : null);
|
|
987
|
+
}
|
|
968
988
|
if (this.isReleased) return;
|
|
969
|
-
|
|
970
|
-
null === (
|
|
971
|
-
null === (
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
989
|
+
null === (_f = null === (_e = null === (_d = this.scenegraph) || void 0 === _d ? void 0 : _d.component) || void 0 === _e ? void 0 : _e.vScrollBar) || void 0 === _f || _f.release(),
|
|
990
|
+
null === (_j = null === (_h = null === (_g = this.scenegraph) || void 0 === _g ? void 0 : _g.component) || void 0 === _h ? void 0 : _h.hScrollBar) || void 0 === _j || _j.release(),
|
|
991
|
+
this.animationManager.clear(), this.animationManager.ticker.release(), null === (_m = null === (_l = null === (_k = this.scenegraph) || void 0 === _k ? void 0 : _k.stage) || void 0 === _l ? void 0 : _l.ticker) || void 0 === _m || _m.release();
|
|
992
|
+
const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
|
|
993
|
+
(null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
|
|
994
|
+
delete canvas.__vtable_id__);
|
|
995
|
+
const element = null == internalProps ? void 0 : internalProps.element;
|
|
996
|
+
(null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
|
|
997
|
+
delete element.__vtable_id__), this.clearCorrectTimer(), null === (_p = null === (_o = internalProps.tooltipHandler) || void 0 === _o ? void 0 : _o.release) || void 0 === _p || _p.call(_o),
|
|
998
|
+
null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
|
|
999
|
+
null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
|
|
1000
|
+
null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
|
|
1001
|
+
this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
|
|
1002
|
+
null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
|
|
975
1003
|
null == legend || legend.release();
|
|
976
|
-
})), null === (
|
|
977
|
-
null === (
|
|
1004
|
+
})), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
|
|
1005
|
+
null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
|
|
978
1006
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
979
1007
|
var _a;
|
|
980
1008
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
981
1009
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
982
|
-
const parentElement = null === (
|
|
1010
|
+
const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
|
|
983
1011
|
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
984
|
-
null === (
|
|
985
|
-
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (
|
|
1012
|
+
null === (_3 = null === (_2 = null === (_1 = this.editorManager) || void 0 === _1 ? void 0 : _1.editingEditor) || void 0 === _2 ? void 0 : _2.onEnd) || void 0 === _3 || _3.call(_2),
|
|
1013
|
+
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
|
|
986
1014
|
(0, chart_render_helper_1.clearChartRenderQueue)();
|
|
987
1015
|
}
|
|
988
1016
|
fireListeners(type, event) {
|