@homebound/beam 2.181.1 → 2.181.2
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.
|
@@ -84,19 +84,19 @@ class RowState {
|
|
|
84
84
|
if (rows !== this.rows) {
|
|
85
85
|
const currentCollapsedIds = this.collapsedIds;
|
|
86
86
|
// Create a list of the (maybe) new rows that should be initially collapsed
|
|
87
|
-
const
|
|
87
|
+
const maybeNewCollapsedRowIds = flattenRows(rows)
|
|
88
|
+
.filter((r) => r.initCollapsed)
|
|
89
|
+
.map((r) => r.id);
|
|
88
90
|
// Check against local storage for collapsed state only if this is the first render of "data" (non-header or totals) rows.
|
|
89
91
|
const checkLocalStorage = this.persistCollapse && !this.rows.some((r) => r.kind !== "totals" && r.kind !== "header");
|
|
90
92
|
// If the list of collapsed rows are different, then determine which are net-new rows and should be added to the newCollapsedIds array
|
|
91
|
-
if (currentCollapsedIds.length !==
|
|
92
|
-
!currentCollapsedIds.every((id) =>
|
|
93
|
+
if (currentCollapsedIds.length !== maybeNewCollapsedRowIds.length ||
|
|
94
|
+
!currentCollapsedIds.every((id) => maybeNewCollapsedRowIds.includes(id))) {
|
|
93
95
|
// Flatten out the existing rows to make checking for new rows easier
|
|
94
96
|
const flattenedExistingIds = flattenRows(this.rows).map((r) => r.id);
|
|
95
|
-
const newCollapsedIds =
|
|
96
|
-
.filter((maybeNewRow) => !flattenedExistingIds.includes(maybeNewRow.id) &&
|
|
97
|
+
const newCollapsedIds = maybeNewCollapsedRowIds.filter((maybeNewRowId) => !flattenedExistingIds.includes(maybeNewRowId) &&
|
|
97
98
|
// Using `!` on `this.persistCollapse!` as `checkLocalStorage` ensures this.persistCollapse is truthy
|
|
98
|
-
(!checkLocalStorage || readLocalCollapseState(this.persistCollapse).includes(
|
|
99
|
-
.map((row) => row.id);
|
|
99
|
+
(!checkLocalStorage || readLocalCollapseState(this.persistCollapse).includes(maybeNewRowId)));
|
|
100
100
|
// If there are new rows that should be collapsed then update the collapsedRows arrays
|
|
101
101
|
if (newCollapsedIds.length > 0) {
|
|
102
102
|
this.collapsedRows.replace(currentCollapsedIds.concat(newCollapsedIds));
|
|
@@ -31,3 +31,5 @@ export { TabActions, TabContent, Tabs, TabsWithContent } from "./Tabs";
|
|
|
31
31
|
export type { RouteTab, RouteTabWithContent, Tab, TabWithContent } from "./Tabs";
|
|
32
32
|
export * from "./Tag";
|
|
33
33
|
export * from "./Tooltip";
|
|
34
|
+
export * from "./Accordion";
|
|
35
|
+
export * from "./AccordionList";
|
package/dist/components/index.js
CHANGED
|
@@ -49,3 +49,5 @@ Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { re
|
|
|
49
49
|
Object.defineProperty(exports, "TabsWithContent", { enumerable: true, get: function () { return Tabs_1.TabsWithContent; } });
|
|
50
50
|
__exportStar(require("./Tag"), exports);
|
|
51
51
|
__exportStar(require("./Tooltip"), exports);
|
|
52
|
+
__exportStar(require("./Accordion"), exports);
|
|
53
|
+
__exportStar(require("./AccordionList"), exports);
|