@danielgindi/dgtable.js 2.0.8 → 2.0.10
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/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/lib.cjs.js +13 -4
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +14 -5
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +13 -4
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/dist/private_types.d.ts +3 -2
- package/dist/private_types.d.ts.map +1 -1
- package/package.json +10 -1
- package/src/index.ts +20 -14
- package/src/private_types.ts +3 -2
package/dist/lib.es6.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/dgtable.js 2.0.
|
|
2
|
+
* @danielgindi/dgtable.js 2.0.10
|
|
3
3
|
* git://github.com/danielgindi/dgtable.js.git
|
|
4
4
|
*/
|
|
5
5
|
import { getScrollHorz, setScrollHorz } from '@danielgindi/dom-utils/lib/ScrollHelper.js';
|
|
@@ -5847,6 +5847,7 @@ const PreviewCellSymbol = Symbol('preview_cell');
|
|
|
5847
5847
|
const OriginalCellSymbol = Symbol('cell');
|
|
5848
5848
|
const RelatedTouchSymbol = Symbol('related_touch');
|
|
5849
5849
|
const OriginalRowIndex = Symbol('original_row_index');
|
|
5850
|
+
const IsDestroyedSymbol = Symbol('destroyed');
|
|
5850
5851
|
|
|
5851
5852
|
/**
|
|
5852
5853
|
* A collection of rows that extends Array functionality with sorting and filtering
|
|
@@ -8158,10 +8159,14 @@ class DGTable {
|
|
|
8158
8159
|
setupHovers(this);
|
|
8159
8160
|
}
|
|
8160
8161
|
on(event, handler) {
|
|
8162
|
+
if (this[IsDestroyedSymbol])
|
|
8163
|
+
return this;
|
|
8161
8164
|
this._p.mitt.on(event, handler);
|
|
8162
8165
|
return this;
|
|
8163
8166
|
}
|
|
8164
8167
|
once(event, handler) {
|
|
8168
|
+
if (this[IsDestroyedSymbol])
|
|
8169
|
+
return this;
|
|
8165
8170
|
const wrapped = (value) => {
|
|
8166
8171
|
this._p.mitt.off(event, wrapped);
|
|
8167
8172
|
handler(value);
|
|
@@ -8170,6 +8175,8 @@ class DGTable {
|
|
|
8170
8175
|
return this;
|
|
8171
8176
|
}
|
|
8172
8177
|
off(event, handler) {
|
|
8178
|
+
if (this[IsDestroyedSymbol])
|
|
8179
|
+
return this;
|
|
8173
8180
|
if (!event && !handler) {
|
|
8174
8181
|
this._p.mitt.all.clear();
|
|
8175
8182
|
} else
|
|
@@ -8179,6 +8186,8 @@ class DGTable {
|
|
|
8179
8186
|
return this;
|
|
8180
8187
|
}
|
|
8181
8188
|
emit(event, value) {
|
|
8189
|
+
if (this[IsDestroyedSymbol])
|
|
8190
|
+
return this;
|
|
8182
8191
|
this._p.mitt.emit(event, value);
|
|
8183
8192
|
return this;
|
|
8184
8193
|
}
|
|
@@ -8191,7 +8200,7 @@ class DGTable {
|
|
|
8191
8200
|
destroy() {var _p$virtualListHelper, _p$table, _p$tbody;
|
|
8192
8201
|
const p = this._p;
|
|
8193
8202
|
const el = this.el;
|
|
8194
|
-
if (this
|
|
8203
|
+
if (this[IsDestroyedSymbol] || !p) {
|
|
8195
8204
|
return this;
|
|
8196
8205
|
}
|
|
8197
8206
|
if (p.resizer) {
|
|
@@ -8220,7 +8229,7 @@ class DGTable {
|
|
|
8220
8229
|
this[prop] = null;
|
|
8221
8230
|
}
|
|
8222
8231
|
}
|
|
8223
|
-
this
|
|
8232
|
+
this[IsDestroyedSymbol] = true;
|
|
8224
8233
|
if (el) {
|
|
8225
8234
|
el.remove();
|
|
8226
8235
|
}
|
|
@@ -8244,7 +8253,7 @@ class DGTable {
|
|
|
8244
8253
|
if (!p._deferredRender) {
|
|
8245
8254
|
p._deferredRender = setTimeout(() => {
|
|
8246
8255
|
p._deferredRender = null;
|
|
8247
|
-
if (!this
|
|
8256
|
+
if (!this[IsDestroyedSymbol] && this.el.offsetParent) {
|
|
8248
8257
|
this.render();
|
|
8249
8258
|
}
|
|
8250
8259
|
});
|
|
@@ -9252,6 +9261,6 @@ class DGTable {
|
|
|
9252
9261
|
DGTable.VERSION = '@@VERSION';
|
|
9253
9262
|
DGTable.Width = Width;
|
|
9254
9263
|
|
|
9255
|
-
export { DGTable as default };
|
|
9264
|
+
export { DGTable, DGTable as default };
|
|
9256
9265
|
|
|
9257
9266
|
//# sourceMappingURL=lib.es6.js.map
|