@homebound/beam 2.204.0 → 2.206.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.
@@ -37,6 +37,8 @@ export declare type GridTableApi<R extends Kinded> = {
37
37
  setActiveCellId: (id: string | undefined) => void;
38
38
  /** Set selected state of a row by id */
39
39
  selectRow: (id: string, selected?: boolean) => void;
40
+ /** Toggle collapse state of a row by id */
41
+ toggleCollapsedRow: (id: string) => void;
40
42
  };
41
43
  export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<R> {
42
44
  readonly tableState: TableState;
@@ -50,4 +52,5 @@ export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<
50
52
  setActiveRowId(id: string | undefined): void;
51
53
  setActiveCellId(id: string | undefined): void;
52
54
  selectRow(id: string, selected?: boolean): void;
55
+ toggleCollapsedRow(id: string): void;
53
56
  }
@@ -65,5 +65,8 @@ class GridTableApiImpl {
65
65
  selectRow(id, selected = true) {
66
66
  this.tableState.selectRow(id, selected);
67
67
  }
68
+ toggleCollapsedRow(id) {
69
+ this.tableState.toggleCollapsed(id);
70
+ }
68
71
  }
69
72
  exports.GridTableApiImpl = GridTableApiImpl;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  interface StaticFieldProps {
3
- label: string;
3
+ label: ReactNode;
4
4
  value?: string;
5
5
  children?: ReactNode;
6
6
  }
@@ -8,7 +8,7 @@ const defaultTestId_1 = require("../utils/defaultTestId");
8
8
  const useTestIds_1 = require("../utils/useTestIds");
9
9
  function StaticField(props) {
10
10
  const { label, value, children } = props;
11
- const tid = (0, useTestIds_1.useTestIds)(props, (0, defaultTestId_1.defaultTestId)(label));
11
+ const tid = (0, useTestIds_1.useTestIds)(props, typeof label === "string" ? (0, defaultTestId_1.defaultTestId)(label) : "staticField");
12
12
  const id = (0, utils_1.useId)();
13
13
  return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", Object.assign({ css: Css_1.Css.db.sm.gray700.mbPx(4).$, htmlFor: id }, tid.label, { children: label }), void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ id: id, css: Css_1.Css.smMd.gray900.df.aic.$ }, tid, { children: value || children }), void 0)] }, void 0));
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.204.0",
3
+ "version": "2.206.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",