@nanoporetech-digital/components 3.5.1 → 3.7.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/CHANGELOG.md +31 -0
- package/dist/cjs/{date-utils-c581f187.js → date-utils-42fbcb42.js} +5 -3
- package/dist/cjs/date-utils-42fbcb42.js.map +1 -0
- package/dist/cjs/index-41582c2a.js +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +10 -5
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/nano-demo.cjs.entry.js +3 -2
- package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-dropdown.cjs.entry.js +5 -2
- package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-file-upload.cjs.entry.js +4 -0
- package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +1 -2
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-tooltip.cjs.entry.js → nano-progress-bar_2.cjs.entry.js} +28 -4
- package/dist/cjs/nano-progress-bar_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +74 -12
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +2 -0
- package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-067e0c12.js → nano-table-56eb29c1.js} +172 -88
- package/dist/cjs/nano-table-56eb29c1.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-a4d75c46.js → table.worker-b1c53001.js} +3 -3
- package/dist/cjs/table.worker-b1c53001.js.map +1 -0
- package/dist/{esm/table.worker-e9fb087e.js → cjs/table.worker-e2f9ccfa.js} +1 -1
- package/dist/collection/components/datalist/datalist.js +3 -3
- package/dist/collection/components/datalist/datalist.js.map +1 -1
- package/dist/collection/components/demo/demo.js +3 -2
- package/dist/collection/components/demo/demo.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.js +5 -2
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/file-upload/file-upload.js +4 -0
- package/dist/collection/components/file-upload/file-upload.js.map +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/menu/menu.js +8 -3
- package/dist/collection/components/menu/menu.js.map +1 -1
- package/dist/collection/components/nav-item/nav-item.js +1 -2
- package/dist/collection/components/nav-item/nav-item.js.map +1 -1
- package/dist/collection/components/resize-observe/resize-observe.js +118 -14
- package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
- package/dist/collection/components/sticker/sticker.js +2 -0
- package/dist/collection/components/sticker/sticker.js.map +1 -1
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.cell.js +10 -5
- package/dist/collection/components/table/table.cell.js.map +1 -1
- package/dist/collection/components/table/table.css +9 -23
- package/dist/collection/components/table/table.js +236 -93
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +19 -12
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.store.js +1 -1
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.utils.js +4 -4
- package/dist/collection/components/table/table.utils.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +8 -0
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/collection/components/tabs/tab-group.js +1 -1
- package/dist/collection/components/tabs/tab-group.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js +25 -3
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/utils/date-utils.js +4 -2
- package/dist/collection/utils/date-utils.js.map +1 -1
- package/dist/collection/utils/testing/index.js +15 -8
- package/dist/collection/utils/testing/index.js.map +1 -1
- package/dist/components/datalist.js +3 -3
- package/dist/components/datalist.js.map +1 -1
- package/dist/components/date-picker.js +4 -2
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dropdown.js +5 -2
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon.js.map +1 -1
- package/dist/components/menu.js +8 -3
- package/dist/components/menu.js.map +1 -1
- package/dist/components/nano-demo.js +21 -14
- package/dist/components/nano-demo.js.map +1 -1
- package/dist/components/nano-file-upload.js +4 -0
- package/dist/components/nano-file-upload.js.map +1 -1
- package/dist/components/nano-tab-group.js +1 -1
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/nav-item.js +1 -2
- package/dist/components/nav-item.js.map +1 -1
- package/dist/components/resize-observe.js +80 -14
- package/dist/components/resize-observe.js.map +1 -1
- package/dist/components/sticker.js +2 -0
- package/dist/components/sticker.js.map +1 -1
- package/dist/components/table.js +196 -103
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/components/tooltip.js +6 -3
- package/dist/components/tooltip.js.map +1 -1
- package/dist/custom-elements/index.js +285 -120
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/{date-utils-bb82b123.js → date-utils-6b7a6e1f.js} +5 -3
- package/dist/esm/date-utils-6b7a6e1f.js.map +1 -0
- package/dist/esm/index-3c280603.js +2 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-datalist_3.entry.js +10 -5
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-date-input.entry.js +1 -1
- package/dist/esm/nano-date-picker.entry.js +1 -1
- package/dist/esm/nano-demo.entry.js +3 -2
- package/dist/esm/nano-demo.entry.js.map +1 -1
- package/dist/esm/nano-dropdown.entry.js +5 -2
- package/dist/esm/nano-dropdown.entry.js.map +1 -1
- package/dist/esm/nano-file-upload.entry.js +4 -0
- package/dist/esm/nano-file-upload.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +1 -2
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-icon-button.entry.js +1 -1
- package/dist/esm/nano-icon-button.entry.js.map +1 -1
- package/dist/esm/nano-icon.entry.js.map +1 -1
- package/dist/esm/{nano-tooltip.entry.js → nano-progress-bar_2.entry.js} +29 -6
- package/dist/esm/nano-progress-bar_2.entry.js.map +1 -0
- package/dist/esm/nano-resize-observe_2.entry.js +74 -12
- package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
- package/dist/esm/nano-sticker.entry.js +2 -0
- package/dist/esm/nano-sticker.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +1 -1
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/{nano-table-95921f46.js → nano-table-38f3c797.js} +172 -88
- package/dist/esm/nano-table-38f3c797.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/{nano-components/p-e9fb087e.js → esm/table.worker-e2f9ccfa.js} +1 -1
- package/dist/esm/{table.worker-769f1441.js → table.worker-e57fffd8.js} +3 -3
- package/dist/esm/table.worker-e57fffd8.js.map +1 -0
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/p-0b29b22c.js +5 -0
- package/dist/nano-components/{p-26905bca.js.map → p-0b29b22c.js.map} +0 -0
- package/dist/nano-components/p-135fed16.entry.js +5 -0
- package/dist/nano-components/p-135fed16.entry.js.map +1 -0
- package/dist/nano-components/{p-2cb4615b.entry.js → p-2a97ef51.entry.js} +2 -2
- package/dist/nano-components/{p-2cb4615b.entry.js.map → p-2a97ef51.entry.js.map} +0 -0
- package/dist/nano-components/{p-751927d1.entry.js → p-3f25fc76.entry.js} +2 -2
- package/dist/nano-components/p-3f25fc76.entry.js.map +1 -0
- package/dist/nano-components/p-5d149792.entry.js +5 -0
- package/dist/nano-components/p-5d149792.entry.js.map +1 -0
- package/dist/nano-components/p-69e5a37d.entry.js.map +1 -1
- package/dist/nano-components/p-6ad194e4.entry.js +5 -0
- package/dist/nano-components/p-6ad194e4.entry.js.map +1 -0
- package/dist/nano-components/{p-46b348b7.entry.js → p-6cb77d5c.entry.js} +2 -2
- package/dist/nano-components/{p-46b348b7.entry.js.map → p-6cb77d5c.entry.js.map} +0 -0
- package/dist/nano-components/{p-85cfb0af.entry.js → p-9a4297e1.entry.js} +2 -2
- package/dist/nano-components/p-9a4297e1.entry.js.map +1 -0
- package/dist/nano-components/{p-d1c8eca4.entry.js → p-b55ffa92.entry.js} +2 -2
- package/dist/nano-components/p-b55ffa92.entry.js.map +1 -0
- package/dist/nano-components/{p-fb12a45d.entry.js → p-ba9cd047.entry.js} +2 -2
- package/dist/nano-components/{p-fb12a45d.entry.js.map → p-ba9cd047.entry.js.map} +0 -0
- package/dist/nano-components/p-cc5e7acb.entry.js +5 -0
- package/dist/nano-components/p-cc5e7acb.entry.js.map +1 -0
- package/dist/nano-components/p-cecb9af1.js +5 -0
- package/dist/nano-components/p-cecb9af1.js.map +1 -0
- package/dist/nano-components/p-d26b97d1.js +5 -0
- package/dist/nano-components/p-d26b97d1.js.map +1 -0
- package/dist/nano-components/{p-601e18d5.entry.js → p-d5303933.entry.js} +2 -2
- package/dist/nano-components/p-d5303933.entry.js.map +1 -0
- package/dist/nano-components/{p-4f0e14b5.entry.js → p-d565991d.entry.js} +2 -2
- package/dist/nano-components/p-d565991d.entry.js.map +1 -0
- package/dist/nano-components/{p-244223f0.entry.js → p-dc50b93c.entry.js} +2 -2
- package/dist/nano-components/p-dc50b93c.entry.js.map +1 -0
- package/dist/{cjs/table.worker-e9fb087e.js → nano-components/p-e2f9ccfa.js} +1 -1
- package/dist/types/components/icon/icon.d.ts +1 -1
- package/dist/types/components/menu/menu.d.ts +1 -0
- package/dist/types/components/resize-observe/resize-observe.d.ts +20 -1
- package/dist/types/components/table/table-interface.d.ts +35 -24
- package/dist/types/components/table/table.cell.d.ts +1 -1
- package/dist/types/components/table/table.d.ts +49 -15
- package/dist/types/components/table/table.row.d.ts +1 -1
- package/dist/types/components/table/table.store.d.ts +1 -1
- package/dist/types/components/table/table.utils.d.ts +1 -1
- package/dist/types/components/table/table.worker.d.ts +3 -3
- package/dist/types/components/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +59 -14
- package/dist/types/utils/date-utils.d.ts +1 -1
- package/docs-json.json +179 -31
- package/docs-vscode.json +26 -3
- package/package.json +2 -2
- package/dist/cjs/date-utils-c581f187.js.map +0 -1
- package/dist/cjs/nano-progress-bar.cjs.entry.js +0 -33
- package/dist/cjs/nano-progress-bar.cjs.entry.js.map +0 -1
- package/dist/cjs/nano-table-067e0c12.js.map +0 -1
- package/dist/cjs/nano-tooltip.cjs.entry.js.map +0 -1
- package/dist/cjs/table.worker-a4d75c46.js.map +0 -1
- package/dist/esm/date-utils-bb82b123.js.map +0 -1
- package/dist/esm/nano-progress-bar.entry.js +0 -29
- package/dist/esm/nano-progress-bar.entry.js.map +0 -1
- package/dist/esm/nano-table-95921f46.js.map +0 -1
- package/dist/esm/nano-tooltip.entry.js.map +0 -1
- package/dist/esm/table.worker-769f1441.js.map +0 -1
- package/dist/nano-components/p-15a60f7e.js +0 -5
- package/dist/nano-components/p-15a60f7e.js.map +0 -1
- package/dist/nano-components/p-244223f0.entry.js.map +0 -1
- package/dist/nano-components/p-26905bca.js +0 -5
- package/dist/nano-components/p-4f0e14b5.entry.js.map +0 -1
- package/dist/nano-components/p-601e18d5.entry.js.map +0 -1
- package/dist/nano-components/p-751927d1.entry.js.map +0 -1
- package/dist/nano-components/p-85cfb0af.entry.js.map +0 -1
- package/dist/nano-components/p-8fc2a38d.js +0 -5
- package/dist/nano-components/p-8fc2a38d.js.map +0 -1
- package/dist/nano-components/p-9e8c9bac.entry.js +0 -5
- package/dist/nano-components/p-9e8c9bac.entry.js.map +0 -1
- package/dist/nano-components/p-a2e38472.entry.js +0 -5
- package/dist/nano-components/p-a2e38472.entry.js.map +0 -1
- package/dist/nano-components/p-b9c8b99f.entry.js +0 -5
- package/dist/nano-components/p-b9c8b99f.entry.js.map +0 -1
- package/dist/nano-components/p-d1c8eca4.entry.js.map +0 -1
- package/dist/nano-components/p-f43d1d8e.entry.js +0 -5
- package/dist/nano-components/p-f43d1d8e.entry.js.map +0 -1
- package/dist/nano-components/p-feb9f164.entry.js +0 -5
- package/dist/nano-components/p-feb9f164.entry.js.map +0 -1
@@ -11,7 +11,7 @@ import { CSSNAMESPACE } from './table.constants';
|
|
11
11
|
import { generateStore, storeSearch, storeSetConfig, storeSetData, storeSort, storeFilter, } from './table.store';
|
12
12
|
import { arrMove, detectScrollSpeed, findScrollParent, isInViewport, } from './table.utils';
|
13
13
|
function perMark(name, end = false) {
|
14
|
-
if (!Build.isDev)
|
14
|
+
if (!Build.isDev || Build.isTesting || !performance)
|
15
15
|
return;
|
16
16
|
if (end) {
|
17
17
|
performance?.mark('end' + name);
|
@@ -41,22 +41,29 @@ let id = 0;
|
|
41
41
|
*/
|
42
42
|
export class Table {
|
43
43
|
constructor() {
|
44
|
-
this.debounceSetLoading = (l) => {
|
45
|
-
this._loading = l;
|
46
|
-
};
|
47
44
|
this.renderId = 'tbl-' + id++;
|
48
45
|
this.filters = [];
|
49
46
|
this.currentFilters = '[]';
|
50
47
|
this.currentSort = '';
|
48
|
+
this.measureHeight = 0;
|
51
49
|
this.blockIos = new WeakMap();
|
52
50
|
this.blockHeights = [];
|
53
51
|
this.unitHeight = 0;
|
54
52
|
// Scroll / IO used for hiding / showing blocks
|
55
53
|
this.ignoreIO = true;
|
56
54
|
this._isReady = false;
|
55
|
+
/**
|
56
|
+
* Fired when a column is dragged
|
57
|
+
* @param column
|
58
|
+
*/
|
57
59
|
this.colDrag = (column) => {
|
58
60
|
this.nanoTblColDrag.emit({ column });
|
59
61
|
};
|
62
|
+
/**
|
63
|
+
* Fired when a column is dropped after being dragged
|
64
|
+
* @param fromCol
|
65
|
+
* @param toCol
|
66
|
+
*/
|
60
67
|
this.colDrop = (fromCol, toCol) => {
|
61
68
|
const cols = this.store.config.state.columns;
|
62
69
|
const toIndex = cols.findIndex((col) => col.prop === toCol);
|
@@ -69,7 +76,7 @@ export class Table {
|
|
69
76
|
});
|
70
77
|
if (dropEvent.defaultPrevented)
|
71
78
|
return;
|
72
|
-
this.
|
79
|
+
this.columns = arrMove(fromIndex, toIndex, cols);
|
73
80
|
};
|
74
81
|
/**
|
75
82
|
* Start a sort - can be cancelled by `preventDefault`
|
@@ -81,7 +88,7 @@ export class Table {
|
|
81
88
|
// did order change?
|
82
89
|
if (this.currentSort === order + ':' + column)
|
83
90
|
return;
|
84
|
-
this.
|
91
|
+
this._loading = true;
|
85
92
|
const sortEvent = this.nanoTblBeforeSort.emit({ column: column, order });
|
86
93
|
if (sortEvent.defaultPrevented)
|
87
94
|
return;
|
@@ -91,13 +98,24 @@ export class Table {
|
|
91
98
|
this.scrollToTop(element);
|
92
99
|
if (this.customSortFn) {
|
93
100
|
try {
|
94
|
-
await this.customSortFn(column, order);
|
95
|
-
|
101
|
+
const res = await this.customSortFn(column, order);
|
102
|
+
// if the response is 'true', the custom sort did it's thing
|
103
|
+
// handover to finish and stop loading state.
|
104
|
+
// if response is falsey, carry on to do a FE sort
|
105
|
+
if (res === true) {
|
106
|
+
this.sortComplete(order, column);
|
107
|
+
this._loading = false;
|
108
|
+
return;
|
109
|
+
}
|
96
110
|
}
|
97
111
|
catch (e) {
|
112
|
+
// if response errored, stop loading state
|
113
|
+
// clear current sort cache
|
98
114
|
console.warn('custom sort failed', e);
|
115
|
+
this.currentSort = '';
|
116
|
+
this._loading = false;
|
117
|
+
return;
|
99
118
|
}
|
100
|
-
return;
|
101
119
|
}
|
102
120
|
try {
|
103
121
|
await storeSort(this.host, column, order);
|
@@ -108,7 +126,8 @@ export class Table {
|
|
108
126
|
this.currentSort = '';
|
109
127
|
}
|
110
128
|
finally {
|
111
|
-
this.
|
129
|
+
if (this.blocks.length)
|
130
|
+
this._loading = false;
|
112
131
|
}
|
113
132
|
};
|
114
133
|
/**
|
@@ -121,31 +140,34 @@ export class Table {
|
|
121
140
|
if (!el || this.blockIos.has(el))
|
122
141
|
return;
|
123
142
|
const blockIo = new IntersectionObserver(([ioEntry]) => {
|
124
|
-
if (
|
143
|
+
if (ioEntry.intersectionRatio === 0)
|
125
144
|
return;
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
if (this.
|
136
|
-
|
145
|
+
// This is a bit gross
|
146
|
+
// The Intersection Observer (IO) fires in an incorrect order when the scrolling is very fast
|
147
|
+
// i.e. we go past blocks 3, 2, 1 and land on 0, but 3 can fire as 'intersecting' after 0.
|
148
|
+
// To fix that, we check - for realzies - if the block IS visible.
|
149
|
+
// BUT that test is not as sensitive to a block being visible via the IO,
|
150
|
+
// so doesn't always fire if scrolling slowly
|
151
|
+
// *sigh*
|
152
|
+
readTask(() => {
|
153
|
+
if (this.scrollSpeed < 100 || isInViewport(el, 0.01)) {
|
154
|
+
if (!this.ignoreIO) {
|
155
|
+
const potentialBlocks = [
|
137
156
|
blockIndex,
|
138
157
|
blockIndex + 1,
|
139
158
|
Math.max(0, blockIndex - 1),
|
140
159
|
];
|
141
|
-
this.
|
142
|
-
|
143
|
-
|
144
|
-
});
|
145
|
-
requestAnimationFrame(() => this.setBlockHeight());
|
160
|
+
if (potentialBlocks.toString() !== this.activeBlocks.toString()) {
|
161
|
+
this.debouncedBlockChange(potentialBlocks);
|
162
|
+
}
|
146
163
|
}
|
147
|
-
|
148
|
-
|
164
|
+
// fire the event regardless
|
165
|
+
this.nanoTblBlockRendered.emit({
|
166
|
+
block: blockIndex,
|
167
|
+
totalBlocks: this.blockElements.length,
|
168
|
+
});
|
169
|
+
}
|
170
|
+
});
|
149
171
|
}, {
|
150
172
|
threshold: [0],
|
151
173
|
root: this.scrollParent === document.scrollingElement
|
@@ -167,7 +189,8 @@ export class Table {
|
|
167
189
|
this.type = 'table';
|
168
190
|
this.caption = undefined;
|
169
191
|
this.showCaption = false;
|
170
|
-
this.
|
192
|
+
this.loading = undefined;
|
193
|
+
this.internalLoading = false;
|
171
194
|
this.placeholderSize = 5;
|
172
195
|
this.rows = undefined;
|
173
196
|
this.columns = [];
|
@@ -181,26 +204,29 @@ export class Table {
|
|
181
204
|
this.customSortFn = undefined;
|
182
205
|
this.defaultSort = true;
|
183
206
|
this.defaultColDraggable = false;
|
207
|
+
this.virtualTotalItems = 0;
|
184
208
|
this.blocks = [];
|
185
209
|
this.activeBlocks = [0, 1, 2];
|
186
|
-
this.measureHeight = 0;
|
187
210
|
this.debounceSetLoading = debounce(this.debounceSetLoading.bind(this), 50);
|
211
|
+
this.debouncedBlockChange = debounce(this.debouncedBlockChange.bind(this), 100);
|
188
212
|
}
|
189
|
-
|
190
|
-
|
191
|
-
* or when performing custom filtering or sorting */
|
192
|
-
get loading() {
|
193
|
-
return this._loading;
|
213
|
+
get _loading() {
|
214
|
+
return this.loading !== undefined ? this.loading : this.internalLoading;
|
194
215
|
}
|
195
|
-
set
|
216
|
+
set _loading(l) {
|
217
|
+
if (this.loading !== undefined)
|
218
|
+
return;
|
196
219
|
this.debounceSetLoading(l);
|
197
220
|
}
|
221
|
+
debounceSetLoading(l) {
|
222
|
+
this.internalLoading = l;
|
223
|
+
}
|
198
224
|
handleRowsChange() {
|
199
225
|
if (!this.rows) {
|
200
|
-
this.
|
226
|
+
this._loading = true;
|
201
227
|
return;
|
202
228
|
}
|
203
|
-
this.
|
229
|
+
this._loading = true;
|
204
230
|
Promise.resolve(this.rows).then(async (rows) => {
|
205
231
|
await storeSetData(this.host, rows);
|
206
232
|
// reset everything
|
@@ -209,7 +235,7 @@ export class Table {
|
|
209
235
|
await this.columnInit();
|
210
236
|
if (!this.isReady)
|
211
237
|
this.setInitialBlockDimension();
|
212
|
-
this.
|
238
|
+
this._loading = false;
|
213
239
|
});
|
214
240
|
}
|
215
241
|
async handleColsChange() {
|
@@ -224,6 +250,9 @@ export class Table {
|
|
224
250
|
handleSearchTermChange() {
|
225
251
|
this.searchStart();
|
226
252
|
}
|
253
|
+
virtualTotalItemsChangeHandler() {
|
254
|
+
this.setBlocks();
|
255
|
+
}
|
227
256
|
/** Remove any column sorts currently applied
|
228
257
|
* @returns a promise which resolves when complete */
|
229
258
|
async resetSorting() {
|
@@ -264,11 +293,25 @@ export class Table {
|
|
264
293
|
this.filters = this.filters.filter((f) => !columnNames.includes(f.prop));
|
265
294
|
return this.filterStart();
|
266
295
|
}
|
296
|
+
/** Updates a row model at a given index
|
297
|
+
* @param row - the row to update.
|
298
|
+
* *Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property
|
299
|
+
* - rows are augmented with certain properties to aid with efficient rendering
|
300
|
+
* @param rowIndex - the row index to insert this row
|
301
|
+
*/
|
302
|
+
async updateRow(row, rowIndex) {
|
303
|
+
this.rows.splice(rowIndex, 1, row);
|
304
|
+
this.handleRowsChange();
|
305
|
+
}
|
267
306
|
// uses the first 'tr' of an active block as our yard stick
|
268
307
|
set measureEle(el) {
|
269
308
|
if (!el)
|
270
309
|
return;
|
271
|
-
|
310
|
+
const potentialHeight = el.getBoundingClientRect().height;
|
311
|
+
this.measureHeight =
|
312
|
+
Math.abs(this.measureHeight - potentialHeight) < 5
|
313
|
+
? this.measureHeight
|
314
|
+
: potentialHeight;
|
272
315
|
this.unitHeight =
|
273
316
|
el.querySelector('tr')?.getBoundingClientRect().height || this.unitHeight;
|
274
317
|
}
|
@@ -315,7 +358,7 @@ export class Table {
|
|
315
358
|
perMark('sort', true);
|
316
359
|
}
|
317
360
|
async searchStart() {
|
318
|
-
this.
|
361
|
+
this._loading = true;
|
319
362
|
const sortEvent = this.nanoTblBeforeSearch.emit({ term: this.searchTerm });
|
320
363
|
if (sortEvent.defaultPrevented)
|
321
364
|
return;
|
@@ -331,7 +374,7 @@ export class Table {
|
|
331
374
|
console.warn('search failed', e);
|
332
375
|
}
|
333
376
|
finally {
|
334
|
-
this.
|
377
|
+
this._loading = false;
|
335
378
|
}
|
336
379
|
}
|
337
380
|
async filterStart(filters, additive = true) {
|
@@ -348,7 +391,7 @@ export class Table {
|
|
348
391
|
}
|
349
392
|
if (this.currentFilters === JSON.stringify(this.filters))
|
350
393
|
return;
|
351
|
-
this.
|
394
|
+
this._loading = true;
|
352
395
|
const sortEvent = this.nanoTblBeforeFilter.emit({ filters: this.filters });
|
353
396
|
if (sortEvent.defaultPrevented)
|
354
397
|
return;
|
@@ -358,12 +401,21 @@ export class Table {
|
|
358
401
|
this.scrollToTop();
|
359
402
|
if (this.customFilterFn) {
|
360
403
|
try {
|
361
|
-
await this.customFilterFn(this.filters);
|
362
|
-
|
404
|
+
const res = await this.customFilterFn(this.filters);
|
405
|
+
// if the response is 'true', the custom filter did it's thing
|
406
|
+
// handover to finish and stop loading state.
|
407
|
+
// if response is falsey, carry on to do a FE filter
|
408
|
+
if (res === true) {
|
409
|
+
this.filterComplete();
|
410
|
+
this._loading = false;
|
411
|
+
}
|
363
412
|
}
|
364
413
|
catch (e) {
|
414
|
+
// if response errored, stop loading state
|
415
|
+
// clear current sort cache
|
365
416
|
console.warn('custom filter failed', e);
|
366
417
|
this.currentFilters = '';
|
418
|
+
this._loading = false;
|
367
419
|
}
|
368
420
|
return;
|
369
421
|
}
|
@@ -375,7 +427,7 @@ export class Table {
|
|
375
427
|
console.warn('filter failed', e);
|
376
428
|
}
|
377
429
|
finally {
|
378
|
-
this.
|
430
|
+
this._loading = false;
|
379
431
|
}
|
380
432
|
}
|
381
433
|
filterComplete() {
|
@@ -467,24 +519,34 @@ export class Table {
|
|
467
519
|
* These can then be hidden / shown to improve performance.
|
468
520
|
*/
|
469
521
|
setBlocks() {
|
522
|
+
const dRows = this.store.data.state.rows;
|
523
|
+
if (!dRows.length) {
|
524
|
+
this.blocks = [];
|
525
|
+
return;
|
526
|
+
}
|
470
527
|
perMark('setBlocks');
|
471
|
-
this.activeBlocks = [0, 1, 2];
|
472
528
|
this.ignoreIO = true;
|
473
529
|
let i = 1;
|
474
|
-
const l = this.
|
530
|
+
const l = this.virtualTotalItems > dRows.length
|
531
|
+
? this.virtualTotalItems
|
532
|
+
: dRows.length;
|
475
533
|
let rows = [];
|
476
534
|
const blocks = [];
|
477
535
|
this.blockHeights = [];
|
478
536
|
// old skool loop for perf
|
479
537
|
for (i; i <= l; i++) {
|
480
|
-
rows.push(this.store.data.state.rows[i - 1]);
|
538
|
+
rows.push(this.store.data.state.rows[i - 1] || { __uuid: '' });
|
481
539
|
if (i % this.perBlock === 0) {
|
540
|
+
// assign a UUID for the whole block
|
541
|
+
// for block diffing
|
482
542
|
blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });
|
483
543
|
rows = [];
|
484
544
|
}
|
485
545
|
}
|
486
|
-
|
546
|
+
// any leftover rows
|
547
|
+
if (rows.length) {
|
487
548
|
blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });
|
549
|
+
}
|
488
550
|
this.blocks = blocks;
|
489
551
|
perMark('setBlocks', true);
|
490
552
|
}
|
@@ -512,11 +574,11 @@ export class Table {
|
|
512
574
|
}
|
513
575
|
/** cache the height for all active blocks for later renders */
|
514
576
|
setBlockHeight() {
|
515
|
-
|
516
|
-
this.
|
517
|
-
|
518
|
-
|
519
|
-
|
577
|
+
this.activeBlocks.forEach((blockIndex) => {
|
578
|
+
const el = this.blockElements[blockIndex];
|
579
|
+
if (!el)
|
580
|
+
return;
|
581
|
+
readTask(() => {
|
520
582
|
const height = el.getBoundingClientRect().height;
|
521
583
|
// cache height to our block heights array
|
522
584
|
// for subsequent renders
|
@@ -529,6 +591,10 @@ export class Table {
|
|
529
591
|
});
|
530
592
|
});
|
531
593
|
}
|
594
|
+
debouncedBlockChange(newBlocks) {
|
595
|
+
this.activeBlocks = newBlocks;
|
596
|
+
this.setBlockHeight();
|
597
|
+
}
|
532
598
|
/** Process slotted content */
|
533
599
|
processSlots() {
|
534
600
|
// see if we have slot content
|
@@ -558,6 +624,8 @@ export class Table {
|
|
558
624
|
// but we don't want it to cause renders
|
559
625
|
if (['rows', 'columns'].includes(stateName))
|
560
626
|
return false;
|
627
|
+
if (Build.isDev)
|
628
|
+
console.log(stateName, _newVal, _oldVal);
|
561
629
|
}
|
562
630
|
componentWillRender() {
|
563
631
|
perMark('render');
|
@@ -580,18 +648,18 @@ export class Table {
|
|
580
648
|
sortable: this.defaultSort,
|
581
649
|
draggable: this.defaultColDraggable,
|
582
650
|
} }),
|
583
|
-
]))), this._loading && !this.blocks.length && (h("tbody", { class: `${CSSNAMESPACE}__active` }, [...Array(10).keys()].map((rowIndex) => (h("tr", null, this.store.config.state.columns.map((_colModel, colIndex) => (h(TableCell, { rowIndex: rowIndex, colIndex: colIndex, nestedContent: h("nano-skeleton", null) })))))))), !this._loading && !this.blocks.length && (h("tr", null, h("th", { class: `${CSSNAMESPACE}__th`, colSpan: this.store.config.state.columns.length }, h("div", { class: "nano-tbl__cell-content nano-tbl__cell-content--no-result" }, h("slot", { name: "no-results" }, "No results found"))))), this.blocks.map((block, blockIndex) => (h("tbody", { key: block.__uuid, id: `tbody-${this.renderId}-${blockIndex}`, ref: (tb) => {
|
651
|
+
]))), this._loading && !this.blocks.length && (h("tbody", { class: `${CSSNAMESPACE}__active` }, [...Array(10).keys()].map((rowIndex) => (h("tr", null, this.store.config.state.columns.map((_colModel, colIndex) => (h(TableCell, { rowIndex: rowIndex, colIndex: colIndex, nestedContent: () => h("nano-skeleton", null) })))))))), !this._loading && !this.blocks.length && (h("tr", null, h("th", { class: `${CSSNAMESPACE}__th`, colSpan: this.store.config.state.columns.length }, h("div", { class: "nano-tbl__cell-content nano-tbl__cell-content--no-result" }, h("slot", { name: "no-results" }, "No results found"))))), this.blocks.map((block, blockIndex) => (h("tbody", { key: block.__uuid, id: `tbody-${this.renderId}-${blockIndex}`, ref: (tb) => {
|
584
652
|
this.blockElements.push(tb);
|
585
|
-
this.setupBlockIO(tb, blockIndex);
|
653
|
+
requestAnimationFrame(() => this.setupBlockIO(tb, blockIndex));
|
586
654
|
}, class: {
|
587
655
|
[`${CSSNAMESPACE}__inactive`]: !this.activeBlocks.includes(blockIndex),
|
588
656
|
[`${CSSNAMESPACE}__active`]: this.activeBlocks.includes(blockIndex),
|
589
657
|
} }, this.activeBlocks.includes(blockIndex) ? (block.rows.map((row, i) => {
|
590
658
|
const rowIndex = blockIndex > 0 ? blockIndex * this.perBlock + i : i;
|
591
|
-
return (h(TableRow, { rowRenderer: this.rowRender,
|
592
|
-
})) : (h("td", { colSpan: this.store.config.state.columns.length, style: {
|
659
|
+
return (h(TableRow, { rowRenderer: this.rowRender, rowModel: row, rowIndex: rowIndex }, this.store.config.state.columns.map((_colModel, colIndex) => (h(TableCell, { rowIndex: rowIndex, colIndex: colIndex })))));
|
660
|
+
})) : (h("tr", null, h("td", { colSpan: this.store.config.state.columns.length, style: {
|
593
661
|
height: this.getBlockHeight(blockIndex),
|
594
|
-
} }))))), this.showFooter && (h("tfoot", null, h(TableHeadFootRow, { rowRenderer: this.footRender, onColumnPinned: this.handleColumnPinned }, this.store.config.state.columns.map((colModel) => [
|
662
|
+
} })))))), this.showFooter && (h("tfoot", null, h(TableHeadFootRow, { rowRenderer: this.footRender, onColumnPinned: this.handleColumnPinned }, this.store.config.state.columns.map((colModel) => [
|
595
663
|
h(TableColHead, { column: colModel, headRenderer: this.footRender, onColumnPinned: this.handleColumnPinned, onColumnSortClick: this.sortStart, defaults: {
|
596
664
|
sortable: this.defaultSort,
|
597
665
|
draggable: this.defaultColDraggable,
|
@@ -685,13 +753,13 @@ export class Table {
|
|
685
753
|
"optional": false,
|
686
754
|
"docs": {
|
687
755
|
"tags": [],
|
688
|
-
"text": "Will show a loading state when true.\
|
756
|
+
"text": "Will show a loading state when set to true.\nBy default, will be shown automatically if `rows` is a promise waiting to resolve\nor when performing custom filtering or sorting.\n*Note* when set manually, will overwrite any internal loading state.\nSet to 'undefined' to revert to default behaviour."
|
689
757
|
},
|
690
|
-
"getter":
|
691
|
-
"setter":
|
758
|
+
"getter": false,
|
759
|
+
"setter": false,
|
692
760
|
"attribute": "loading",
|
693
761
|
"reflect": false,
|
694
|
-
"defaultValue": "
|
762
|
+
"defaultValue": "undefined"
|
695
763
|
},
|
696
764
|
"placeholderSize": {
|
697
765
|
"type": "number",
|
@@ -715,10 +783,10 @@ export class Table {
|
|
715
783
|
},
|
716
784
|
"rows": {
|
717
785
|
"type": "unknown",
|
718
|
-
"mutable":
|
786
|
+
"mutable": true,
|
719
787
|
"complexType": {
|
720
788
|
"original": "| TableTypes.NanoTable['rows']\n | Promise<TableTypes.NanoTable['rows']>",
|
721
|
-
"resolved": "Promise<
|
789
|
+
"resolved": "Promise<RowGeneric[]> | RowGeneric[]",
|
722
790
|
"references": {
|
723
791
|
"TableTypes": {
|
724
792
|
"location": "import",
|
@@ -743,7 +811,7 @@ export class Table {
|
|
743
811
|
"mutable": true,
|
744
812
|
"complexType": {
|
745
813
|
"original": "TableTypes.NanoTable['columns']",
|
746
|
-
"resolved": "ColumnConfig<
|
814
|
+
"resolved": "ColumnConfig<RowGeneric>[]",
|
747
815
|
"references": {
|
748
816
|
"TableTypes": {
|
749
817
|
"location": "import",
|
@@ -755,7 +823,7 @@ export class Table {
|
|
755
823
|
"optional": false,
|
756
824
|
"docs": {
|
757
825
|
"tags": [],
|
758
|
-
"text": "The column config used to
|
826
|
+
"text": "The column config used to present the rows of data"
|
759
827
|
},
|
760
828
|
"getter": false,
|
761
829
|
"setter": false,
|
@@ -789,7 +857,7 @@ export class Table {
|
|
789
857
|
"mutable": false,
|
790
858
|
"complexType": {
|
791
859
|
"original": "TableTypes.RowRenderer",
|
792
|
-
"resolved": "RowRenderer",
|
860
|
+
"resolved": "RowRenderer<RowData<RowGeneric>>",
|
793
861
|
"references": {
|
794
862
|
"TableTypes": {
|
795
863
|
"location": "import",
|
@@ -911,8 +979,8 @@ export class Table {
|
|
911
979
|
"type": "unknown",
|
912
980
|
"mutable": false,
|
913
981
|
"complexType": {
|
914
|
-
"original": "(filters: TableTypes.Filter[]) => Promise<
|
915
|
-
"resolved": "(filters: Filter[]) => Promise<
|
982
|
+
"original": "(\n filters: TableTypes.Filter[]\n ) => Promise<true | TableTypes.Falsy>",
|
983
|
+
"resolved": "(filters: Filter[]) => Promise<true | Falsy>",
|
916
984
|
"references": {
|
917
985
|
"TableTypes": {
|
918
986
|
"location": "import",
|
@@ -927,7 +995,7 @@ export class Table {
|
|
927
995
|
"optional": true,
|
928
996
|
"docs": {
|
929
997
|
"tags": [],
|
930
|
-
"text": "A custom filtering function. Should return a promise.\
|
998
|
+
"text": "A custom filtering function. Should return a promise.\nIf the promise resolves as `true` the column UI will be updated.\nIf the promise resolves as falsey, the sort will be performed by the component.\nA good use-case would be performing the filter on a server / via fetch.\nThen on success, updating the table's data via the `rows` property"
|
931
999
|
},
|
932
1000
|
"getter": false,
|
933
1001
|
"setter": false
|
@@ -936,8 +1004,8 @@ export class Table {
|
|
936
1004
|
"type": "unknown",
|
937
1005
|
"mutable": false,
|
938
1006
|
"complexType": {
|
939
|
-
"original": "(\n property: TableTypes.Prop,\n order: TableTypes.Order\n ) => Promise<
|
940
|
-
"resolved": "(property: keyof
|
1007
|
+
"original": "(\n property: TableTypes.Prop,\n order: TableTypes.Order\n ) => Promise<true | TableTypes.Falsy>",
|
1008
|
+
"resolved": "(property: keyof RowGeneric, order: Order) => Promise<true | Falsy>",
|
941
1009
|
"references": {
|
942
1010
|
"TableTypes": {
|
943
1011
|
"location": "import",
|
@@ -952,7 +1020,7 @@ export class Table {
|
|
952
1020
|
"optional": true,
|
953
1021
|
"docs": {
|
954
1022
|
"tags": [],
|
955
|
-
"text": "A custom sorting function. Should return a promise.\
|
1023
|
+
"text": "A custom sorting function. Should return a promise.\nIf the promise resolves as `true` the column UI will be updated.\nIf the promise resolves as falsey, the sort will be performed by the component.\nA good use-case would be performing the sort on a server / via fetch.\nThen on success, updating the table's data via the `rows` property"
|
956
1024
|
},
|
957
1025
|
"getter": false,
|
958
1026
|
"setter": false
|
@@ -996,46 +1064,65 @@ export class Table {
|
|
996
1064
|
"attribute": "default-col-draggable",
|
997
1065
|
"reflect": false,
|
998
1066
|
"defaultValue": "false"
|
1067
|
+
},
|
1068
|
+
"virtualTotalItems": {
|
1069
|
+
"type": "number",
|
1070
|
+
"mutable": false,
|
1071
|
+
"complexType": {
|
1072
|
+
"original": "number",
|
1073
|
+
"resolved": "number",
|
1074
|
+
"references": {}
|
1075
|
+
},
|
1076
|
+
"required": false,
|
1077
|
+
"optional": false,
|
1078
|
+
"docs": {
|
1079
|
+
"tags": [],
|
1080
|
+
"text": "Use this to render the table with roughly the correct dimensions.\na use-case might be; fetch a small initial dataset to minimise load-time,\nrender the table with the correct dimensions, the table becomes interactive,\nload the rest of the data"
|
1081
|
+
},
|
1082
|
+
"getter": false,
|
1083
|
+
"setter": false,
|
1084
|
+
"attribute": "virtual-total-items",
|
1085
|
+
"reflect": false,
|
1086
|
+
"defaultValue": "0"
|
999
1087
|
}
|
1000
1088
|
};
|
1001
1089
|
}
|
1002
1090
|
static get states() {
|
1003
1091
|
return {
|
1004
|
-
"
|
1092
|
+
"internalLoading": {},
|
1005
1093
|
"blocks": {},
|
1006
|
-
"activeBlocks": {}
|
1007
|
-
"measureHeight": {}
|
1094
|
+
"activeBlocks": {}
|
1008
1095
|
};
|
1009
1096
|
}
|
1010
1097
|
static get events() {
|
1011
1098
|
return [{
|
1012
|
-
"method": "
|
1013
|
-
"name": "
|
1099
|
+
"method": "nanoTblReady",
|
1100
|
+
"name": "nanoTblReady",
|
1014
1101
|
"bubbles": true,
|
1015
1102
|
"cancelable": true,
|
1016
1103
|
"composed": true,
|
1017
1104
|
"docs": {
|
1018
1105
|
"tags": [],
|
1019
|
-
"text": "Fired
|
1106
|
+
"text": "Fired when the table has done it's first complete render"
|
1020
1107
|
},
|
1021
1108
|
"complexType": {
|
1022
|
-
"original": "
|
1023
|
-
"resolved": "
|
1109
|
+
"original": "any",
|
1110
|
+
"resolved": "any",
|
1024
1111
|
"references": {}
|
1025
1112
|
}
|
1026
1113
|
}, {
|
1027
|
-
"method": "
|
1028
|
-
"name": "
|
1114
|
+
"method": "nanoTblBlockRendered",
|
1115
|
+
"name": "nanoTblBlockRendered",
|
1029
1116
|
"bubbles": true,
|
1030
1117
|
"cancelable": true,
|
1031
1118
|
"composed": true,
|
1032
1119
|
"docs": {
|
1033
1120
|
"tags": [],
|
1034
|
-
"text": "Fired
|
1121
|
+
"text": "Fired whenever a block is activated by scrolling into view / becoming visible\nThis could be leveraged for infinite scrolling / to fetch more data."
|
1035
1122
|
},
|
1036
1123
|
"complexType": {
|
1037
|
-
"original": "
|
1038
|
-
"resolved": "
|
1124
|
+
"original": "{\n block: number;\n totalBlocks: number;\n }",
|
1125
|
+
"resolved": "{ block: number; totalBlocks: number; }",
|
1039
1126
|
"references": {}
|
1040
1127
|
}
|
1041
1128
|
}, {
|
@@ -1050,7 +1137,7 @@ export class Table {
|
|
1050
1137
|
},
|
1051
1138
|
"complexType": {
|
1052
1139
|
"original": "{\n column: TableTypes.Prop;\n order: TableTypes.Order;\n }",
|
1053
|
-
"resolved": "{ column: keyof
|
1140
|
+
"resolved": "{ column: keyof RowGeneric; order: Order; }",
|
1054
1141
|
"references": {
|
1055
1142
|
"TableTypes": {
|
1056
1143
|
"location": "import",
|
@@ -1070,7 +1157,7 @@ export class Table {
|
|
1070
1157
|
},
|
1071
1158
|
"complexType": {
|
1072
1159
|
"original": "{\n column: TableTypes.Prop;\n order: TableTypes.Order;\n }",
|
1073
|
-
"resolved": "{ column: keyof
|
1160
|
+
"resolved": "{ column: keyof RowGeneric; order: Order; }",
|
1074
1161
|
"references": {
|
1075
1162
|
"TableTypes": {
|
1076
1163
|
"location": "import",
|
@@ -1090,7 +1177,7 @@ export class Table {
|
|
1090
1177
|
},
|
1091
1178
|
"complexType": {
|
1092
1179
|
"original": "{\n column: TableTypes.Prop;\n }",
|
1093
|
-
"resolved": "{ column: keyof
|
1180
|
+
"resolved": "{ column: keyof RowGeneric; }",
|
1094
1181
|
"references": {
|
1095
1182
|
"TableTypes": {
|
1096
1183
|
"location": "import",
|
@@ -1110,7 +1197,7 @@ export class Table {
|
|
1110
1197
|
},
|
1111
1198
|
"complexType": {
|
1112
1199
|
"original": "{\n fromCol: TableTypes.Prop;\n toCol: TableTypes.Prop;\n fromIndex: number;\n toIndex: number;\n }",
|
1113
|
-
"resolved": "{ fromCol: keyof
|
1200
|
+
"resolved": "{ fromCol: keyof RowGeneric; toCol: keyof RowGeneric; fromIndex: number; toIndex: number; }",
|
1114
1201
|
"references": {
|
1115
1202
|
"TableTypes": {
|
1116
1203
|
"location": "import",
|
@@ -1188,6 +1275,21 @@ export class Table {
|
|
1188
1275
|
"resolved": "{ term: string; }",
|
1189
1276
|
"references": {}
|
1190
1277
|
}
|
1278
|
+
}, {
|
1279
|
+
"method": "nanoTblBeforeEdit",
|
1280
|
+
"name": "nanoTblBeforeEdit",
|
1281
|
+
"bubbles": true,
|
1282
|
+
"cancelable": true,
|
1283
|
+
"composed": true,
|
1284
|
+
"docs": {
|
1285
|
+
"tags": [],
|
1286
|
+
"text": "Fired before a general search.\n`event.preventDefault()` to stop searching."
|
1287
|
+
},
|
1288
|
+
"complexType": {
|
1289
|
+
"original": "{ term: string }",
|
1290
|
+
"resolved": "{ term: string; }",
|
1291
|
+
"references": {}
|
1292
|
+
}
|
1191
1293
|
}];
|
1192
1294
|
}
|
1193
1295
|
static get methods() {
|
@@ -1331,6 +1433,44 @@ export class Table {
|
|
1331
1433
|
"text": "a promise which resolves when complete"
|
1332
1434
|
}]
|
1333
1435
|
}
|
1436
|
+
},
|
1437
|
+
"updateRow": {
|
1438
|
+
"complexType": {
|
1439
|
+
"signature": "(row: TableTypes.RowData, rowIndex: number) => Promise<void>",
|
1440
|
+
"parameters": [{
|
1441
|
+
"tags": [{
|
1442
|
+
"name": "param",
|
1443
|
+
"text": "row - the row to update.\n*Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property\n- rows are augmented with certain properties to aid with efficient rendering"
|
1444
|
+
}],
|
1445
|
+
"text": "- the row to update.\n*Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property\n- rows are augmented with certain properties to aid with efficient rendering"
|
1446
|
+
}, {
|
1447
|
+
"tags": [{
|
1448
|
+
"name": "param",
|
1449
|
+
"text": "rowIndex - the row index to insert this row"
|
1450
|
+
}],
|
1451
|
+
"text": "- the row index to insert this row"
|
1452
|
+
}],
|
1453
|
+
"references": {
|
1454
|
+
"Promise": {
|
1455
|
+
"location": "global"
|
1456
|
+
},
|
1457
|
+
"TableTypes": {
|
1458
|
+
"location": "import",
|
1459
|
+
"path": "../../interface"
|
1460
|
+
}
|
1461
|
+
},
|
1462
|
+
"return": "Promise<void>"
|
1463
|
+
},
|
1464
|
+
"docs": {
|
1465
|
+
"text": "Updates a row model at a given index",
|
1466
|
+
"tags": [{
|
1467
|
+
"name": "param",
|
1468
|
+
"text": "row - the row to update.\n*Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property\n- rows are augmented with certain properties to aid with efficient rendering"
|
1469
|
+
}, {
|
1470
|
+
"name": "param",
|
1471
|
+
"text": "rowIndex - the row index to insert this row"
|
1472
|
+
}]
|
1473
|
+
}
|
1334
1474
|
}
|
1335
1475
|
};
|
1336
1476
|
}
|
@@ -1345,6 +1485,9 @@ export class Table {
|
|
1345
1485
|
}, {
|
1346
1486
|
"propName": "searchTerm",
|
1347
1487
|
"methodName": "handleSearchTermChange"
|
1488
|
+
}, {
|
1489
|
+
"propName": "virtualTotalItems",
|
1490
|
+
"methodName": "virtualTotalItemsChangeHandler"
|
1348
1491
|
}];
|
1349
1492
|
}
|
1350
1493
|
static get listeners() {
|