@homebound/beam 2.312.0 → 2.313.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.
@@ -24,6 +24,10 @@ export declare function useGridTableApi<R extends Kinded>(): GridTableApi<R>;
24
24
  export type GridTableApi<R extends Kinded> = {
25
25
  /** Scrolls row `index` into view; only supported with `as=virtual` and after a `useEffect`. */
26
26
  scrollToIndex(index: number): void;
27
+ /** Returns the currently-visible rows. */
28
+ getVisibleRows(): GridDataRow<R>[];
29
+ /** Returns the currently-visible rows of the given `kind`. */
30
+ getVisibleRows<K extends R["kind"]>(kind: K): GridDataRow<DiscriminateUnion<R, "kind", K>>[];
27
31
  /** Returns the ids of currently-selected rows. */
28
32
  getSelectedRowIds(): string[];
29
33
  getSelectedRowIds<K extends R["kind"]>(kind: K): string[];
@@ -65,6 +69,7 @@ export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<
65
69
  scrollToIndex(index: number): void;
66
70
  getSelectedRowIds(kind?: string): string[];
67
71
  getSelectedRows(kind?: string): any;
72
+ getVisibleRows(kind?: string): any;
68
73
  clearSelections(id?: string): void;
69
74
  setActiveRowId(id: string | undefined): void;
70
75
  setActiveCellId(id: string | undefined): void;
@@ -50,6 +50,10 @@ class GridTableApiImpl {
50
50
  getSelectedRows(kind) {
51
51
  return this.tableState.selectedRows.filter((row) => !kind || row.kind === kind);
52
52
  }
53
+ // The `any` is not great, but getting the overload to handle the optional kind is annoying
54
+ getVisibleRows(kind) {
55
+ return this.tableState.visibleRows.filter((row) => !kind || row.kind === kind);
56
+ }
53
57
  clearSelections(id) {
54
58
  this.tableState.selectRow("header", false);
55
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.312.0",
3
+ "version": "2.313.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",