@homebound/beam 4.40.0 → 4.40.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.
- package/dist/index.cjs +22 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6780,7 +6780,7 @@ var ColumnState = class {
|
|
|
6780
6780
|
constructor(states, storage, column2) {
|
|
6781
6781
|
this.states = states;
|
|
6782
6782
|
this.column = column2;
|
|
6783
|
-
this.visible = storage.wasVisible(column2.id) ??
|
|
6783
|
+
this.visible = !column2.canHide || (storage.wasVisible(column2.id) ?? !(column2.initHidden ?? true));
|
|
6784
6784
|
if (this.visible && (storage.wasExpanded(column2.id) ?? column2.initExpanded)) {
|
|
6785
6785
|
this.expanded = true;
|
|
6786
6786
|
this.doExpand();
|
|
@@ -6791,10 +6791,17 @@ var ColumnState = class {
|
|
|
6791
6791
|
children = void 0;
|
|
6792
6792
|
visible = true;
|
|
6793
6793
|
expanded = false;
|
|
6794
|
+
/**
|
|
6795
|
+
* Whether this column is shown. We check `canHide` here too b/c when `props.columns` changes,
|
|
6796
|
+
* `addColumn` can replace a hidden column's definition with one that can't be hidden.
|
|
6797
|
+
*/
|
|
6798
|
+
get isVisible() {
|
|
6799
|
+
return this.visible || !this.column.canHide;
|
|
6800
|
+
}
|
|
6794
6801
|
setVisible(visible) {
|
|
6795
|
-
const wasVisible = this.
|
|
6796
|
-
this.visible = visible;
|
|
6797
|
-
if (!wasVisible && visible && this.column.initExpanded && this.children === void 0) {
|
|
6802
|
+
const wasVisible = this.isVisible;
|
|
6803
|
+
this.visible = visible || !this.column.canHide;
|
|
6804
|
+
if (!wasVisible && this.visible && this.column.initExpanded && this.children === void 0) {
|
|
6798
6805
|
this.expanded = true;
|
|
6799
6806
|
this.doExpand();
|
|
6800
6807
|
}
|
|
@@ -6818,9 +6825,13 @@ var ColumnState = class {
|
|
|
6818
6825
|
this.children = expandColumns.map((ec) => this.states.addColumn(ec));
|
|
6819
6826
|
}
|
|
6820
6827
|
}
|
|
6828
|
+
/** Returns this column and all of its loaded children, whether visible and expanded or not. */
|
|
6829
|
+
get selfAndChildren() {
|
|
6830
|
+
return [this, ...(this.children ?? []).flatMap((c) => c.selfAndChildren)];
|
|
6831
|
+
}
|
|
6821
6832
|
/** Returns this column, if visible, and its children, if expanded. */
|
|
6822
6833
|
get maybeSelfAndChildren() {
|
|
6823
|
-
if (!this.
|
|
6834
|
+
if (!this.isVisible) {
|
|
6824
6835
|
return [];
|
|
6825
6836
|
} else if (this.expanded && this.children) {
|
|
6826
6837
|
return [this, ...this.children.flatMap((c) => c.maybeSelfAndChildren)];
|
|
@@ -8070,9 +8081,13 @@ var ColumnStates = class {
|
|
|
8070
8081
|
allVisibleColumns(showIn) {
|
|
8071
8082
|
return this.columns.flatMap((cs) => cs.maybeSelfAndChildren).filter((cs) => !cs.column.showIn || cs.column.showIn === showIn).filter((cs) => showIn === "csv" ? isContentColumn(cs.column) : true);
|
|
8072
8083
|
}
|
|
8084
|
+
/**
|
|
8085
|
+
* Shows the current columns in `ids` and hides the others. Columns that can't be hidden, like layout gutters, stay shown.
|
|
8086
|
+
* Columns not currently in the table keep their visibility, so a column that's temporarily removed comes back as it was.
|
|
8087
|
+
*/
|
|
8073
8088
|
setVisibleColumns(ids) {
|
|
8074
|
-
for (const cs of this.
|
|
8075
|
-
cs.setVisible(
|
|
8089
|
+
for (const cs of this.columns.flatMap((c) => c.selfAndChildren)) {
|
|
8090
|
+
cs.setVisible(ids.includes(cs.column.id));
|
|
8076
8091
|
}
|
|
8077
8092
|
}
|
|
8078
8093
|
loadExpanded(storageKey) {
|