@homebound/beam 4.56.0 → 4.56.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.d.cts CHANGED
@@ -5678,8 +5678,6 @@ type SelectedState = "checked" | "unchecked" | "partial";
5678
5678
  declare class TableState<R extends Kinded> {
5679
5679
  private persistCollapse;
5680
5680
  private rows;
5681
- /** Deepest data-row level, set with the rows. `0` when the table has a single level. Every row's type is chosen from this. */
5682
- maxNestingLevel: number;
5683
5681
  columns: GridColumnWithId<R>[];
5684
5682
  readonly api: GridTableApi<R>;
5685
5683
  private readonly rowStates;
@@ -5780,8 +5778,6 @@ declare class RowStates<R extends Kinded> {
5780
5778
  private keptGroupRow;
5781
5779
  /** The first level of rows, i.e. not the header (or kept group), but the totals + top-level children. */
5782
5780
  private topRows;
5783
- /** Deepest data-row level from the latest `setRows`. `0` when every body row is top-level. */
5784
- maxNestingLevel: number;
5785
5781
  constructor(table: TableState<R>);
5786
5782
  /** Returns a flat list of all of our RowStates. */
5787
5783
  get allStates(): RowState<R>[];
package/dist/index.d.ts CHANGED
@@ -5678,8 +5678,6 @@ type SelectedState = "checked" | "unchecked" | "partial";
5678
5678
  declare class TableState<R extends Kinded> {
5679
5679
  private persistCollapse;
5680
5680
  private rows;
5681
- /** Deepest data-row level, set with the rows. `0` when the table has a single level. Every row's type is chosen from this. */
5682
- maxNestingLevel: number;
5683
5681
  columns: GridColumnWithId<R>[];
5684
5682
  readonly api: GridTableApi<R>;
5685
5683
  private readonly rowStates;
@@ -5780,8 +5778,6 @@ declare class RowStates<R extends Kinded> {
5780
5778
  private keptGroupRow;
5781
5779
  /** The first level of rows, i.e. not the header (or kept group), but the totals + top-level children. */
5782
5780
  private topRows;
5783
- /** Deepest data-row level from the latest `setRows`. `0` when every body row is top-level. */
5784
- maxNestingLevel: number;
5785
5781
  constructor(table: TableState<R>);
5786
5782
  /** Returns a flat list of all of our RowStates. */
5787
5783
  get allStates(): RowState<R>[];
package/dist/index.js CHANGED
@@ -6762,13 +6762,13 @@ function hierarchyFirstContentCss(opts) {
6762
6762
  const {
6763
6763
  level,
6764
6764
  skipIndent,
6765
- maxLevel
6765
+ hasChildren
6766
6766
  } = opts;
6767
6767
  const paddingLeft = skipIndent ? void 0 : hierarchyIndentPaddingPx(level);
6768
- const type = hierarchyLevelType(level, maxLevel);
6769
- if (!type && paddingLeft === void 0) return void 0;
6768
+ const typeStyle = hierarchyLevelType(level, hasChildren);
6769
+ if (!typeStyle && paddingLeft === void 0) return void 0;
6770
6770
  return {
6771
- ...type ?? {},
6771
+ ...typeStyle ?? {},
6772
6772
  ...paddingLeft !== void 0 ? {
6773
6773
  paddingLeft: ["pl_var", {
6774
6774
  "--paddingLeft": `${paddingLeft}px`
@@ -6776,16 +6776,20 @@ function hierarchyFirstContentCss(opts) {
6776
6776
  } : {}
6777
6777
  };
6778
6778
  }
6779
- function hierarchyLevelType(level, maxLevel) {
6780
- if (level >= maxLevel) return void 0;
6781
- return level === 0 ? {
6779
+ function hierarchyLevelType(level, hasChildren) {
6780
+ if (level === 0) return hasChildren ? {
6782
6781
  fontWeight: "fw6",
6783
6782
  fontSize: "fz_14px",
6784
6783
  lineHeight: "lh_20px"
6785
- } : {
6784
+ } : void 0;
6785
+ return hasChildren ? {
6786
6786
  fontWeight: "fw6",
6787
6787
  fontSize: "fz_12px",
6788
6788
  lineHeight: "lh_16px"
6789
+ } : {
6790
+ fontWeight: "fw4",
6791
+ fontSize: "fz_12px",
6792
+ lineHeight: "lh_16px"
6789
6793
  };
6790
6794
  }
6791
6795
  var loadingTableCss = {
@@ -8316,8 +8320,6 @@ var RowStates = class {
8316
8320
  keptGroupRow;
8317
8321
  /** The first level of rows, i.e. not the header (or kept group), but the totals + top-level children. */
8318
8322
  topRows = [];
8319
- /** Deepest data-row level from the latest `setRows`. `0` when every body row is top-level. */
8320
- maxNestingLevel = 0;
8321
8323
  constructor(table) {
8322
8324
  this.table = table;
8323
8325
  this.header = this.createHeaderRow();
@@ -8345,8 +8347,7 @@ var RowStates = class {
8345
8347
  const map = this.map;
8346
8348
  const seenIds = /* @__PURE__ */ new Set();
8347
8349
  const maybeKept = new Set(this.map.values());
8348
- let maxNestingLevel = 0;
8349
- function addRowAndChildren(parent, row, level) {
8350
+ function addRowAndChildren(parent, row) {
8350
8351
  const key = row.id;
8351
8352
  if (seenIds.has(key)) {
8352
8353
  throw new Error(`Duplicate row id ${key}`);
@@ -8363,15 +8364,12 @@ var RowStates = class {
8363
8364
  state.removed = false;
8364
8365
  maybeKept.delete(state);
8365
8366
  }
8366
- const reserved = reservedRowKinds.includes(row.kind);
8367
- if (!reserved && level > maxNestingLevel) maxNestingLevel = level;
8368
- state.children = row.children?.map((child) => addRowAndChildren(state, child, reserved ? level : level + 1));
8367
+ state.children = row.children?.map((child) => addRowAndChildren(state, child));
8369
8368
  return state;
8370
8369
  }
8371
8370
  const headerRow = rows.find((r) => r.kind === HEADER);
8372
8371
  this.header.row = headerRow || missingHeader;
8373
- this.topRows = rows.filter((row) => row !== headerRow).map((row) => addRowAndChildren(this.header, row, 0));
8374
- this.maxNestingLevel = maxNestingLevel;
8372
+ this.topRows = rows.filter((row) => row !== headerRow).map((row) => addRowAndChildren(this.header, row));
8375
8373
  this.header.children = [this.keptGroupRow, ...this.topRows];
8376
8374
  for (const state of maybeKept) state.markRemoved();
8377
8375
  if (this.topRows.some((rs) => !reservedRowKinds.includes(rs.row.kind))) {
@@ -8573,8 +8571,6 @@ var TableState = class {
8573
8571
  persistCollapse;
8574
8572
  // The current list of rows, basically a useRef.current. Only shallow reactive.
8575
8573
  rows = [];
8576
- /** Deepest data-row level, set with the rows. `0` when the table has a single level. Every row's type is chosen from this. */
8577
- maxNestingLevel = 0;
8578
8574
  // The current list of columns, basically a useRef.current. Only ref reactive.
8579
8575
  columns = [];
8580
8576
  api;
@@ -8672,7 +8668,6 @@ var TableState = class {
8672
8668
  setRows(rows) {
8673
8669
  this.rowStates.setRows(rows);
8674
8670
  this.rows = rows;
8675
- this.maxNestingLevel = this.rowStates.maxNestingLevel;
8676
8671
  }
8677
8672
  setColumns(columns, visibleColumnsStorageKey) {
8678
8673
  if (columns !== this.columns) {
@@ -10866,7 +10861,7 @@ function RowImpl(props) {
10866
10861
  ...isBodyRow && applyFirstContentColumnStyles && hierarchyFirstContentCss({
10867
10862
  level,
10868
10863
  skipIndent: levelIndent !== void 0 || !hasCollapseColumn,
10869
- maxLevel: tableState.maxNestingLevel
10864
+ hasChildren: !!row.children?.length
10870
10865
  }),
10871
10866
  // Apply any declarative column border styling after header/body defaults.
10872
10867
  ...getColumnBorderCss(column2.border, style),