@danielgindi/dgtable.js 2.0.9 → 2.0.11
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 +77 -59
- 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 +77 -59
- 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 +77 -59
- 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 +11 -8
- package/dist/private_types.d.ts.map +1 -1
- package/dist/rendering.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -10
- package/src/private_types.ts +10 -8
- package/src/rendering.ts +62 -55
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DGTableOptions, RowData, FilterFunction, ColumnOptions, CellFormatter, HeaderCellFormatter, OnComparatorRequired, CustomSortingProvider, SerializedColumn, SerializedColumnSort, DGTableEventMap } from './types';
|
|
2
|
-
import
|
|
2
|
+
import { DGTableInternalOptions, DGTablePrivateState, IsDestroyedSymbol } from './private_types';
|
|
3
3
|
declare class DGTable {
|
|
4
4
|
static VERSION: string;
|
|
5
5
|
static Width: {
|
|
@@ -9,9 +9,9 @@ declare class DGTable {
|
|
|
9
9
|
};
|
|
10
10
|
VERSION: string;
|
|
11
11
|
el: HTMLElement;
|
|
12
|
-
_o: DGTableInternalOptions;
|
|
13
|
-
_p: DGTablePrivateState;
|
|
14
|
-
|
|
12
|
+
readonly _o: DGTableInternalOptions;
|
|
13
|
+
readonly _p: DGTablePrivateState;
|
|
14
|
+
private [IsDestroyedSymbol]?;
|
|
15
15
|
/**
|
|
16
16
|
* @param options - initialization options
|
|
17
17
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuEA,OAAO,EACH,cAAc,EACd,OAAO,EAEP,cAAc,EACd,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACH,sBAAsB,EACtB,mBAAmB,EAAE,iBAAiB,EACzC,MAAM,iBAAiB,CAAC;AASzB,cAAM,OAAO;IAET,MAAM,CAAC,OAAO,SAAe;IAC7B,MAAM,CAAC,KAAK;;;;MAAS;IAGrB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAG,WAAW,CAAC;IACjB,QAAQ,CAAC,EAAE,EAAG,sBAAsB,CAAC;IACrC,QAAQ,CAAC,EAAE,EAAG,mBAAmB,CAAC;IAClC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAU;IAEtC;;OAEG;gBACS,OAAO,CAAC,EAAE,cAAc;IAwGpC;;;OAGG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,eAAe,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IACjG,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI;IAQtE;;;OAGG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,eAAe,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,eA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AkB,EAClB,oBAAoB,EACpB,qBAAqB,EAErB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAET,eAAe,GAClB,MAAM,SAAS,CAAC"}
|
package/dist/lib.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/dgtable.js 2.0.
|
|
2
|
+
* @danielgindi/dgtable.js 2.0.11
|
|
3
3
|
* git://github.com/danielgindi/dgtable.js.git
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -5849,6 +5849,7 @@ const PreviewCellSymbol = Symbol('preview_cell');
|
|
|
5849
5849
|
const OriginalCellSymbol = Symbol('cell');
|
|
5850
5850
|
const RelatedTouchSymbol = Symbol('related_touch');
|
|
5851
5851
|
const OriginalRowIndex = Symbol('original_row_index');
|
|
5852
|
+
const IsDestroyedSymbol = Symbol('destroyed');
|
|
5852
5853
|
|
|
5853
5854
|
/**
|
|
5854
5855
|
* A collection of rows that extends Array functionality with sorting and filtering
|
|
@@ -7095,11 +7096,11 @@ function setupVirtualTable(table) {var _p$filteredRows;
|
|
|
7095
7096
|
if (column.stickyPos) {
|
|
7096
7097
|
cell.className += ' ' + stickyClassName;
|
|
7097
7098
|
cell.style.position = 'sticky';
|
|
7098
|
-
cell.style[column.stickyPos.
|
|
7099
|
+
cell.style[column.stickyPos.absDirection] = column.stickyPos.offset + 'px';
|
|
7099
7100
|
const isStickySide = isStickyColumns === null || isStickyColumns === void 0 ? void 0 : isStickyColumns.get(colIndex);
|
|
7100
|
-
if (isStickySide === '
|
|
7101
|
+
if (isStickySide === 'start' && !p.lastIsRtl || isStickySide === 'end' && p.lastIsRtl)
|
|
7101
7102
|
cell.classList.add('is-sticky-left');else
|
|
7102
|
-
if (isStickySide === '
|
|
7103
|
+
if (isStickySide === 'start' && p.lastIsRtl || isStickySide === 'end' && !p.lastIsRtl)
|
|
7103
7104
|
cell.classList.add('is-sticky-right');
|
|
7104
7105
|
}
|
|
7105
7106
|
if (allowCellPreview) {
|
|
@@ -7407,14 +7408,15 @@ function updateStickyColumnPositions(table) {var _p$scrollbarWidth;
|
|
|
7407
7408
|
const stickyClassName = tableClassName + '-sticky';
|
|
7408
7409
|
const headerRow = p.headerRow;
|
|
7409
7410
|
const rtl = isTableRtl(table);
|
|
7411
|
+
p.lastIsRtl = rtl;
|
|
7410
7412
|
const scrollbarWidth = (_p$scrollbarWidth = p.scrollbarWidth) !== null && _p$scrollbarWidth !== void 0 ? _p$scrollbarWidth : 0;
|
|
7411
7413
|
let stickColLeft = 0;
|
|
7412
7414
|
let stickColRight = 0;
|
|
7413
7415
|
let boxSizing = null;
|
|
7414
|
-
const
|
|
7415
|
-
const
|
|
7416
|
-
let
|
|
7417
|
-
let
|
|
7416
|
+
const stickiesStart = [];
|
|
7417
|
+
const stickiesEnd = [];
|
|
7418
|
+
let stickyStartGroup = null;
|
|
7419
|
+
let stickyEndGroup = [];
|
|
7418
7420
|
for (let currentCellEl = headerRow.firstElementChild; currentCellEl; currentCellEl = currentCellEl.nextElementSibling) {
|
|
7419
7421
|
const columnName = currentCellEl.getAttribute('data-column');
|
|
7420
7422
|
if (!columnName)
|
|
@@ -7439,27 +7441,27 @@ function updateStickyColumnPositions(table) {var _p$scrollbarWidth;
|
|
|
7439
7441
|
parseFloat(computedStyle.borderLeftWidth) || 0) + (
|
|
7440
7442
|
parseFloat(computedStyle.borderRightWidth) || 0);
|
|
7441
7443
|
}
|
|
7442
|
-
const
|
|
7443
|
-
if (
|
|
7444
|
-
column.stickyPos = { direction: 'left', offset: stickColLeft };
|
|
7445
|
-
currentCellEl.style.
|
|
7444
|
+
const isStart = column.sticky === 'start';
|
|
7445
|
+
if (isStart) {
|
|
7446
|
+
const stickyPos = column.stickyPos = { direction: 'start', absDirection: rtl ? 'right' : 'left', offset: stickColLeft };
|
|
7447
|
+
currentCellEl.style[stickyPos.absDirection] = stickColLeft + 'px';
|
|
7446
7448
|
stickColLeft += colFullWidth;
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7449
|
+
stickyEndGroup.length = 0;
|
|
7450
|
+
stickyStartGroup = [currentCellEl];
|
|
7451
|
+
stickiesStart.push(stickyStartGroup);
|
|
7450
7452
|
} else
|
|
7451
7453
|
{
|
|
7452
|
-
column.stickyPos = { direction: 'right', offset: stickColRight };
|
|
7453
|
-
currentCellEl.style.
|
|
7454
|
+
const stickyPos = column.stickyPos = { direction: 'end', absDirection: rtl ? 'left' : 'right', offset: stickColRight };
|
|
7455
|
+
currentCellEl.style[stickyPos.absDirection] = stickColRight + scrollbarWidth + 'px';
|
|
7454
7456
|
stickColRight += colFullWidth;
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
+
stickiesEnd.push([currentCellEl, ...stickyEndGroup]);
|
|
7458
|
+
stickyEndGroup.length = 0;
|
|
7457
7459
|
}
|
|
7458
7460
|
} else
|
|
7459
|
-
{var
|
|
7461
|
+
{var _stickyStartGroup;
|
|
7460
7462
|
delete column.stickyPos;
|
|
7461
|
-
(
|
|
7462
|
-
|
|
7463
|
+
(_stickyStartGroup = stickyStartGroup) === null || _stickyStartGroup === void 0 || _stickyStartGroup.push(currentCellEl);
|
|
7464
|
+
stickyEndGroup === null || stickyEndGroup === void 0 || stickyEndGroup.push(currentCellEl);
|
|
7463
7465
|
if (currentCellEl.style.position === 'sticky') {
|
|
7464
7466
|
currentCellEl.classList.remove(stickyClassName);
|
|
7465
7467
|
currentCellEl.style.position = '';
|
|
@@ -7468,8 +7470,8 @@ function updateStickyColumnPositions(table) {var _p$scrollbarWidth;
|
|
|
7468
7470
|
}
|
|
7469
7471
|
}
|
|
7470
7472
|
}
|
|
7471
|
-
p.
|
|
7472
|
-
p.
|
|
7473
|
+
p.stickiesStart = stickiesStart;
|
|
7474
|
+
p.stickiesEnd = stickiesEnd;
|
|
7473
7475
|
syncHorizontalStickies(table);
|
|
7474
7476
|
}
|
|
7475
7477
|
/**
|
|
@@ -7479,20 +7481,21 @@ function syncHorizontalStickies(table) {
|
|
|
7479
7481
|
const p = table._p;
|
|
7480
7482
|
if (!p.table || !p.headerRow || !p.tbody)
|
|
7481
7483
|
return;
|
|
7482
|
-
const
|
|
7483
|
-
const
|
|
7484
|
-
const
|
|
7485
|
-
const
|
|
7486
|
-
const
|
|
7487
|
-
const
|
|
7488
|
-
if (
|
|
7484
|
+
const stickiesStart = p.stickiesStart;
|
|
7485
|
+
const stickiesEnd = p.stickiesEnd;
|
|
7486
|
+
const oldStickiesSetStart = p.stickiesSetStart;
|
|
7487
|
+
const oldStickiesSetEnd = p.stickiesSetEnd;
|
|
7488
|
+
const stickiesSetStart = p.stickiesSetStart = new Set();
|
|
7489
|
+
const stickiesSetEnd = p.stickiesSetEnd = new Set();
|
|
7490
|
+
if (stickiesStart !== null && stickiesStart !== void 0 && stickiesStart.length || stickiesEnd !== null && stickiesEnd !== void 0 && stickiesEnd.length) {
|
|
7489
7491
|
const scrollLeft = p.table.scrollLeft;
|
|
7490
7492
|
if (scrollLeft === p.lastStickyScrollLeft)
|
|
7491
7493
|
return;
|
|
7492
7494
|
p.lastStickyScrollLeft = scrollLeft;
|
|
7493
7495
|
const allHeaderCells = p.headerRow.children;
|
|
7494
7496
|
const tolerance = 1.5;
|
|
7495
|
-
const
|
|
7497
|
+
const isRtl = p.lastIsRtl;
|
|
7498
|
+
const processStickies = (stickies, isStart, indicesSet) => {
|
|
7496
7499
|
if (!stickies || !stickies.length)
|
|
7497
7500
|
return;
|
|
7498
7501
|
for (const sticky of stickies) {
|
|
@@ -7503,14 +7506,21 @@ function syncHorizontalStickies(table) {
|
|
|
7503
7506
|
if (!el || !el.getBoundingClientRect)
|
|
7504
7507
|
continue;
|
|
7505
7508
|
const sRect = el.getBoundingClientRect();
|
|
7509
|
+
const isLeft = isStart !== isRtl;
|
|
7506
7510
|
let overlapsFollowing = false;
|
|
7507
7511
|
if (first && last) {
|
|
7508
7512
|
const fRect = first.getBoundingClientRect();
|
|
7509
7513
|
const lRect = last.getBoundingClientRect();
|
|
7510
|
-
if (
|
|
7514
|
+
if (isStart) {
|
|
7515
|
+
if (isRtl)
|
|
7516
|
+
overlapsFollowing = sRect.right - tolerance > lRect.left && sRect.left + tolerance < fRect.right;else
|
|
7517
|
+
|
|
7511
7518
|
overlapsFollowing = sRect.right - tolerance > fRect.left && sRect.left + tolerance < lRect.right;
|
|
7512
7519
|
} else
|
|
7513
7520
|
{
|
|
7521
|
+
if (isRtl)
|
|
7522
|
+
overlapsFollowing = sRect.left + tolerance < fRect.right && sRect.right - tolerance > lRect.left;else
|
|
7523
|
+
|
|
7514
7524
|
overlapsFollowing = sRect.left + tolerance < lRect.right && sRect.right - tolerance > fRect.left;
|
|
7515
7525
|
}
|
|
7516
7526
|
}
|
|
@@ -7520,26 +7530,26 @@ function syncHorizontalStickies(table) {
|
|
|
7520
7530
|
}
|
|
7521
7531
|
}
|
|
7522
7532
|
};
|
|
7523
|
-
processStickies(
|
|
7524
|
-
processStickies(
|
|
7533
|
+
processStickies(stickiesStart, true, stickiesSetStart);
|
|
7534
|
+
processStickies(stickiesEnd, false, stickiesSetEnd);
|
|
7525
7535
|
}
|
|
7526
7536
|
const newStickies = [];
|
|
7527
7537
|
const removeStickies = [];
|
|
7528
|
-
for (const idx of
|
|
7529
|
-
if (!(
|
|
7530
|
-
newStickies.push({ index: idx,
|
|
7531
|
-
for (const idx of
|
|
7532
|
-
if (!(
|
|
7533
|
-
newStickies.push({ index: idx,
|
|
7534
|
-
if (
|
|
7535
|
-
for (const idx of
|
|
7536
|
-
if (!
|
|
7537
|
-
removeStickies.push({ index: idx,
|
|
7538
|
-
}
|
|
7539
|
-
if (
|
|
7540
|
-
for (const idx of
|
|
7541
|
-
if (!
|
|
7542
|
-
removeStickies.push({ index: idx,
|
|
7538
|
+
for (const idx of stickiesSetStart)
|
|
7539
|
+
if (!(oldStickiesSetStart !== null && oldStickiesSetStart !== void 0 && oldStickiesSetStart.has(idx)))
|
|
7540
|
+
newStickies.push({ index: idx, start: true });
|
|
7541
|
+
for (const idx of stickiesSetEnd)
|
|
7542
|
+
if (!(oldStickiesSetEnd !== null && oldStickiesSetEnd !== void 0 && oldStickiesSetEnd.has(idx)))
|
|
7543
|
+
newStickies.push({ index: idx, start: false });
|
|
7544
|
+
if (oldStickiesSetStart) {
|
|
7545
|
+
for (const idx of oldStickiesSetStart)
|
|
7546
|
+
if (!stickiesSetStart.has(idx))
|
|
7547
|
+
removeStickies.push({ index: idx, start: true });
|
|
7548
|
+
}
|
|
7549
|
+
if (oldStickiesSetEnd) {
|
|
7550
|
+
for (const idx of oldStickiesSetEnd)
|
|
7551
|
+
if (!stickiesSetEnd.has(idx))
|
|
7552
|
+
removeStickies.push({ index: idx, start: false });
|
|
7543
7553
|
}
|
|
7544
7554
|
if (!newStickies.length && !removeStickies.length)
|
|
7545
7555
|
return;
|
|
@@ -7547,16 +7557,16 @@ function syncHorizontalStickies(table) {
|
|
|
7547
7557
|
while (rowEl) {
|
|
7548
7558
|
const children = rowEl.children;
|
|
7549
7559
|
for (const sticky of removeStickies) {var _children$sticky$inde;
|
|
7550
|
-
(_children$sticky$inde = children[sticky.index]) === null || _children$sticky$inde === void 0 || _children$sticky$inde.classList.remove(sticky.
|
|
7560
|
+
(_children$sticky$inde = children[sticky.index]) === null || _children$sticky$inde === void 0 || _children$sticky$inde.classList.remove(sticky.start !== p.lastIsRtl ? 'is-sticky-left' : 'is-sticky-right');}
|
|
7551
7561
|
for (const sticky of newStickies) {var _children$sticky$inde2;
|
|
7552
|
-
(_children$sticky$inde2 = children[sticky.index]) === null || _children$sticky$inde2 === void 0 || _children$sticky$inde2.classList.add(sticky.
|
|
7562
|
+
(_children$sticky$inde2 = children[sticky.index]) === null || _children$sticky$inde2 === void 0 || _children$sticky$inde2.classList.add(sticky.start !== p.lastIsRtl ? 'is-sticky-left' : 'is-sticky-right');}
|
|
7553
7563
|
rowEl = rowEl.nextElementSibling;
|
|
7554
7564
|
}
|
|
7555
7565
|
p.isStickyColumns = new Map();
|
|
7556
|
-
for (const idx of
|
|
7557
|
-
p.isStickyColumns.set(idx, '
|
|
7558
|
-
for (const idx of
|
|
7559
|
-
p.isStickyColumns.set(idx, '
|
|
7566
|
+
for (const idx of stickiesSetStart)
|
|
7567
|
+
p.isStickyColumns.set(idx, 'start');
|
|
7568
|
+
for (const idx of stickiesSetEnd)
|
|
7569
|
+
p.isStickyColumns.set(idx, 'end');
|
|
7560
7570
|
}
|
|
7561
7571
|
/**
|
|
7562
7572
|
* Resize column elements
|
|
@@ -8160,10 +8170,14 @@ class DGTable {
|
|
|
8160
8170
|
setupHovers(this);
|
|
8161
8171
|
}
|
|
8162
8172
|
on(event, handler) {
|
|
8173
|
+
if (this[IsDestroyedSymbol])
|
|
8174
|
+
return this;
|
|
8163
8175
|
this._p.mitt.on(event, handler);
|
|
8164
8176
|
return this;
|
|
8165
8177
|
}
|
|
8166
8178
|
once(event, handler) {
|
|
8179
|
+
if (this[IsDestroyedSymbol])
|
|
8180
|
+
return this;
|
|
8167
8181
|
const wrapped = (value) => {
|
|
8168
8182
|
this._p.mitt.off(event, wrapped);
|
|
8169
8183
|
handler(value);
|
|
@@ -8172,6 +8186,8 @@ class DGTable {
|
|
|
8172
8186
|
return this;
|
|
8173
8187
|
}
|
|
8174
8188
|
off(event, handler) {
|
|
8189
|
+
if (this[IsDestroyedSymbol])
|
|
8190
|
+
return this;
|
|
8175
8191
|
if (!event && !handler) {
|
|
8176
8192
|
this._p.mitt.all.clear();
|
|
8177
8193
|
} else
|
|
@@ -8181,6 +8197,8 @@ class DGTable {
|
|
|
8181
8197
|
return this;
|
|
8182
8198
|
}
|
|
8183
8199
|
emit(event, value) {
|
|
8200
|
+
if (this[IsDestroyedSymbol])
|
|
8201
|
+
return this;
|
|
8184
8202
|
this._p.mitt.emit(event, value);
|
|
8185
8203
|
return this;
|
|
8186
8204
|
}
|
|
@@ -8193,7 +8211,7 @@ class DGTable {
|
|
|
8193
8211
|
destroy() {var _p$virtualListHelper, _p$table, _p$tbody;
|
|
8194
8212
|
const p = this._p;
|
|
8195
8213
|
const el = this.el;
|
|
8196
|
-
if (this
|
|
8214
|
+
if (this[IsDestroyedSymbol] || !p) {
|
|
8197
8215
|
return this;
|
|
8198
8216
|
}
|
|
8199
8217
|
if (p.resizer) {
|
|
@@ -8222,7 +8240,7 @@ class DGTable {
|
|
|
8222
8240
|
this[prop] = null;
|
|
8223
8241
|
}
|
|
8224
8242
|
}
|
|
8225
|
-
this
|
|
8243
|
+
this[IsDestroyedSymbol] = true;
|
|
8226
8244
|
if (el) {
|
|
8227
8245
|
el.remove();
|
|
8228
8246
|
}
|
|
@@ -8246,7 +8264,7 @@ class DGTable {
|
|
|
8246
8264
|
if (!p._deferredRender) {
|
|
8247
8265
|
p._deferredRender = setTimeout(() => {
|
|
8248
8266
|
p._deferredRender = null;
|
|
8249
|
-
if (!this
|
|
8267
|
+
if (!this[IsDestroyedSymbol] && this.el.offsetParent) {
|
|
8250
8268
|
this.render();
|
|
8251
8269
|
}
|
|
8252
8270
|
});
|