@homebound/beam 2.162.0 → 2.165.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.
@@ -80,6 +80,7 @@ export declare const Icons: {
80
80
  buildingHouse: import("@emotion/react/jsx-runtime").JSX.Element;
81
81
  house: import("@emotion/react/jsx-runtime").JSX.Element;
82
82
  flag: import("@emotion/react/jsx-runtime").JSX.Element;
83
+ outlineFlag: import("@emotion/react/jsx-runtime").JSX.Element;
83
84
  projects: import("@emotion/react/jsx-runtime").JSX.Element;
84
85
  tasks: import("@emotion/react/jsx-runtime").JSX.Element;
85
86
  finances: import("@emotion/react/jsx-runtime").JSX.Element;
@@ -85,6 +85,7 @@ exports.Icons = {
85
85
  buildingHouse: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M19.0002 2.00002H9.00019C7.89719 2.00002 7.00019 2.89702 7.00019 4.00002V9.58602L2.29319 14.293C2.00719 14.579 1.92119 15.009 2.07619 15.383C2.23119 15.757 2.59619 16 3.00019 16V17V21C3.00019 21.553 3.44819 22 4.00019 22H12.0002H20.0002C20.5532 22 21.0002 21.553 21.0002 21V4.00002C21.0002 2.89702 20.1032 2.00002 19.0002 2.00002ZM11.0002 20H5.00019V17V15V14.414L8.00019 11.414L11.0002 14.414V15V18V20ZM19.0002 20H13.0002V18V16C13.4042 16 13.7702 15.757 13.9242 15.383C14.0792 15.009 13.9932 14.579 13.7072 14.293L9.00019 9.58602V4.00002H19.0002V20Z" }, void 0), (0, jsx_runtime_1.jsx)("path", { d: "M11 6.00002H13V8.00002H11V6.00002ZM15 6.00002H17V8.00002H15V6.00002ZM15 10.031H17V12H15V10.031ZM15 14H17V16H15V14ZM7 15H9V17H7V15Z" }, void 0)] }, void 0)),
86
86
  house: ((0, jsx_runtime_1.jsx)("path", { d: "M5.00299 22H9.00299H15.003H19.003C20.106 22 21.003 21.103 21.003 20V11C21.003 10.735 20.898 10.48 20.71 10.293L12.71 2.29301C12.319 1.90201 11.687 1.90201 11.296 2.29301L3.29599 10.293C3.10799 10.48 3.00299 10.735 3.00299 11V20C3.00299 21.103 3.89999 22 5.00299 22ZM10.003 20V15H14.003V20H10.003ZM5.00299 11.414L12.003 4.41401L19.003 11.414L19.004 20H16.003V15C16.003 13.897 15.106 13 14.003 13H10.003C8.89999 13 8.00299 13.897 8.00299 15V20H5.00299V11.414Z" }, void 0)),
87
87
  flag: ((0, jsx_runtime_1.jsx)("path", { d: "M19 4H6V2H4V20H3V22H4H6H7V20H6V15H19C19.553 15 20 14.552 20 14V5C20 4.448 19.553 4 19 4Z" }, void 0)),
88
+ outlineFlag: ((0, jsx_runtime_1.jsx)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6 2H4V20H3V22H7V20H6V15H19C19.5523 15 20 14.5523 20 14V5C20 4.44772 19.5523 4 19 4H6V2ZM6 6V13H18V6H6Z" }, void 0)),
88
89
  // Navigation
89
90
  projects: ((0, jsx_runtime_1.jsx)("path", { d: "M4 6H6V8H4V6ZM4 11H6V13H4V11ZM4 16H6V18H4V16ZM20 8V6H18.8H9.2H8.023V8H9.2H18.8H20ZM8 11H20V13H8V11ZM8 16H20V18H8V16Z" }, void 0)),
90
91
  tasks: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M5 22H19C20.103 22 21 21.103 21 20V5C21 3.897 20.103 3 19 3H17C17 2.447 16.553 2 16 2H8C7.447 2 7 2.447 7 3H5C3.897 3 3 3.897 3 5V20C3 21.103 3.897 22 5 22ZM5 5H7V7H17V5H19V20H5V5Z" }, void 0), (0, jsx_runtime_1.jsx)("path", { d: "M11 13.586L9.20697 11.793L7.79297 13.207L11 16.414L16.207 11.207L14.793 9.79297L11 13.586Z" }, void 0)] }, void 0)),
@@ -342,6 +342,8 @@ export declare type GridDataRow<R extends Kinded> = {
342
342
  data: unknown;
343
343
  /** Whether to have the row collapsed (children not visible) on initial load. This will be ignore in subsequent re-renders of the table */
344
344
  initCollapsed?: boolean;
345
+ /** Whether to have the row selected on initial load. This will be ignore in subsequent re-renders of the table */
346
+ initSelected?: boolean;
345
347
  /** Whether row can be selected */
346
348
  selectable?: false;
347
349
  } & IfAny<R, {}, DiscriminateUnion<R, "kind", R["kind"]>>;
@@ -32,6 +32,8 @@ export declare type GridTableApi<R extends Kinded> = {
32
32
  clearSelections(): void;
33
33
  /** Sets the internal state of 'activeRowId' */
34
34
  setActiveRowId: (id: string | undefined) => void;
35
+ /** Set selected state of a row by id */
36
+ selectRow: (id: string, selected?: boolean) => void;
35
37
  };
36
38
  export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<R> {
37
39
  readonly rowState: RowState;
@@ -43,4 +45,5 @@ export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<
43
45
  getSelectedRows(kind?: string): any;
44
46
  clearSelections(id?: string): void;
45
47
  setActiveRowId(id: string | undefined): void;
48
+ selectRow(id: string, selected?: boolean): void;
46
49
  }
@@ -33,6 +33,7 @@ class GridTableApiImpl {
33
33
  /** Called once by the GridTable when it takes ownership of this api instance. */
34
34
  init(persistCollapse, virtuosoRef, rows) {
35
35
  this.rowState.loadCollapse(persistCollapse, rows);
36
+ this.rowState.loadSelected(rows);
36
37
  this.virtuosoRef = virtuosoRef;
37
38
  }
38
39
  scrollToIndex(index) {
@@ -58,5 +59,8 @@ class GridTableApiImpl {
58
59
  setActiveRowId(id) {
59
60
  this.rowState.activeRowId = id;
60
61
  }
62
+ selectRow(id, selected = true) {
63
+ this.rowState.selectRow(id, selected);
64
+ }
61
65
  }
62
66
  exports.GridTableApiImpl = GridTableApiImpl;
@@ -28,6 +28,7 @@ export declare class RowState {
28
28
  */
29
29
  constructor();
30
30
  loadCollapse(persistCollapse: string | undefined, rows: GridDataRow<any>[]): void;
31
+ loadSelected(rows: GridDataRow<any>[]): void;
31
32
  setRows(rows: GridDataRow<any>[]): void;
32
33
  setMatchedRows(rowIds: string[]): void;
33
34
  get selectedIds(): string[];
@@ -67,6 +67,15 @@ class RowState {
67
67
  }
68
68
  }
69
69
  }
70
+ loadSelected(rows) {
71
+ const selectedRows = rows.filter(row => row.initSelected);
72
+ // Initialize with selected rows as defined
73
+ const map = new Map();
74
+ selectedRows.forEach(row => {
75
+ map.set(row.id, "checked");
76
+ });
77
+ this.selectedRows.merge(map);
78
+ }
70
79
  // Updates the list of rows and regenerates the collapsedRows property if needed.
71
80
  setRows(rows) {
72
81
  // If the set of rows are different, and this is the first time adding "data" rows (non "totals" or "header" rows), then collapsedRows may need to be updated.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.162.0",
3
+ "version": "2.165.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",