@homebound/beam 2.117.0 → 2.117.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.
|
@@ -224,6 +224,7 @@ function GridTable(props) {
|
|
|
224
224
|
tooManyClientSideRows = true;
|
|
225
225
|
filteredRows = filteredRows.slice(0, filterMaxRows);
|
|
226
226
|
}
|
|
227
|
+
rowState.visibleRows.replace(filteredRows.map(([row]) => { var _a; return (_a = row === null || row === void 0 ? void 0 : row.id) !== null && _a !== void 0 ? _a : ""; }));
|
|
227
228
|
// Push back to the caller a way to ask us where a row is.
|
|
228
229
|
const { rowLookup } = props;
|
|
229
230
|
if (rowLookup) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ObservableSet } from "mobx";
|
|
1
2
|
import React, { MutableRefObject } from "react";
|
|
2
3
|
import { GridDataRow } from "./GridTable";
|
|
3
4
|
export declare type SelectedState = "checked" | "unchecked" | "partial";
|
|
@@ -21,6 +22,7 @@ export declare class RowState {
|
|
|
21
22
|
private persistCollapse;
|
|
22
23
|
private readonly collapsedRows;
|
|
23
24
|
private readonly selectedRows;
|
|
25
|
+
visibleRows: ObservableSet<string>;
|
|
24
26
|
activeRowId: string | undefined;
|
|
25
27
|
/**
|
|
26
28
|
* Creates the `RowState` for a given `GridTable`.
|
|
@@ -30,6 +30,8 @@ class RowState {
|
|
|
30
30
|
this.rows = rows;
|
|
31
31
|
this.persistCollapse = persistCollapse;
|
|
32
32
|
this.selectedRows = new mobx_1.ObservableMap();
|
|
33
|
+
// Set of just row ids. Keeps track of which rows are visible. Used to filter out non-visible rows from `selectedIds`
|
|
34
|
+
this.visibleRows = new mobx_1.ObservableSet();
|
|
33
35
|
this.collapsedRows = new mobx_1.ObservableSet(persistCollapse ? readLocalCollapseState(persistCollapse) : []);
|
|
34
36
|
this.activeRowId = activeRowId;
|
|
35
37
|
// Make ourselves an observable so that mobx will do caching of .collapseIds so
|
|
@@ -38,7 +40,9 @@ class RowState {
|
|
|
38
40
|
}
|
|
39
41
|
get selectedIds() {
|
|
40
42
|
// Return only ids that are fully checked, i.e. not partial
|
|
41
|
-
const ids = [...this.selectedRows.entries()]
|
|
43
|
+
const ids = [...this.selectedRows.entries()]
|
|
44
|
+
.filter(([id, v]) => this.visibleRows.has(id) && v === "checked")
|
|
45
|
+
.map(([k]) => k);
|
|
42
46
|
// Hide our header marker
|
|
43
47
|
const headerIndex = ids.indexOf("header");
|
|
44
48
|
if (headerIndex > -1) {
|