@simoncomputing/mui-bueno-v2 0.27.0 → 0.28.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/CHANGELOG.md CHANGED
@@ -11,6 +11,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  - Minor increment --> singlular/minor changes. Minimal breaking changes.
12
12
  - Patch increment --> singlular/minor changes. Zero breaking changes.
13
13
 
14
+ ## [0.28.1] - 2026-04-14
15
+
16
+ ### Fixed
17
+
18
+ - `Table`, `PaginatedTable`
19
+ - Fixed `selectedRowKey` not allowing `null`
20
+
21
+ ## [0.28.0] - 2026-04-14
22
+
23
+ ### Fixed
24
+
25
+ - `Table`, `PaginatedTable`
26
+ - Fixed cursor/hover styling when `onRowClickObj` or `expandOnRowClick` is defined
27
+ - Fixed inconsistent typing of id/key by adding 2nd generic type for the type of the id/key (string|number)
28
+
29
+ ### Changed
30
+
31
+ - `Table`, `PaginatedTable`
32
+ - Renamed `checkedIds`/`setCheckedIds` to `checkedKeys`/`setCheckedKeys`
33
+
14
34
  ## [0.27.0] - 2026-04-14
15
35
 
16
36
  ### Added
@@ -46,7 +46,7 @@ export type DiffTableInput<T> = {
46
46
  */
47
47
  isEqual?: (obj1: T, obj2: T) => boolean;
48
48
  isMobileScreen?: boolean;
49
- } & Pick<TableProps<T>, 'renderExpand' | 'size'>;
49
+ } & Pick<TableProps<T, number>, 'renderExpand' | 'size'>;
50
50
  export type DiffTableOutput<T> = {
51
51
  unmodifiedCount: number;
52
52
  columns: DiffTableConfig<T>;
@@ -61,4 +61,4 @@ export type DiffTableOutput<T> = {
61
61
  export declare const buildTableDiff: <T extends {
62
62
  id: number;
63
63
  }>(props: DiffTableInput<T>) => DiffTableOutput<T>;
64
- export type BaseDiffTableProps<T> = Pick<TableProps<T>, 'emptyTableMsg' | 'size'>;
64
+ export type BaseDiffTableProps<T> = Pick<TableProps<T, number>, 'emptyTableMsg' | 'size'>;
@@ -1,5 +1,5 @@
1
1
  import { TableProps } from '../Table';
2
- import { ObjectWithId, PaginationState } from '../../../@types';
2
+ import { PaginationState } from '../../../@types';
3
3
  /**
4
4
  * Paginated Table Props
5
5
  */
@@ -32,7 +32,7 @@ type BasePaginatedTableProps = {
32
32
  */
33
33
  rowsPerPageOptions?: Array<number>;
34
34
  };
35
- export type PaginatedTableProps<T> = BasePaginatedTableProps & Omit<TableProps<T>, 'sortField' | 'sortOrder'>;
35
+ export type PaginatedTableProps<T, K> = BasePaginatedTableProps & Omit<TableProps<T, K>, 'sortField' | 'sortOrder'>;
36
36
  /**
37
37
  * Table with Pagination.
38
38
  *
@@ -40,5 +40,5 @@ export type PaginatedTableProps<T> = BasePaginatedTableProps & Omit<TableProps<T
40
40
  *
41
41
  * Pagination controls will auto-hide when the table is empty or hidePaginationControls is true
42
42
  */
43
- export declare const PaginatedTable: <T extends ObjectWithId>(props: PaginatedTableProps<T>) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const PaginatedTable: <T extends object, K extends string | number>(props: PaginatedTableProps<T, K>) => import("react/jsx-runtime").JSX.Element;
44
44
  export default PaginatedTable;
@@ -5,7 +5,7 @@ import { default as React } from 'react';
5
5
  /**
6
6
  * Interface for table props.
7
7
  */
8
- export type BaseTableProps<T> = {
8
+ export type BaseTableProps<T, K> = {
9
9
  /**
10
10
  * Optional identifier for your table; useful when overriding styles for only a single table (NOTE: will render as "mobile-table-{id}" and "table-{id}")
11
11
  */
@@ -13,7 +13,7 @@ export type BaseTableProps<T> = {
13
13
  /**
14
14
  * If the data in your table does not have an id OR your the id is undefined, use `getRowKey` to tell Table how to uniquely identify each row.
15
15
  */
16
- getRowKey?: (row: T) => string | number;
16
+ getRowKey?: (row: T) => K;
17
17
  /**
18
18
  * An array of column definitions
19
19
  */
@@ -25,21 +25,23 @@ export type BaseTableProps<T> = {
25
25
  /**
26
26
  * Function to call when a row is clicked
27
27
  */
28
- onRowClick?: (id?: number | string) => void;
28
+ onRowClick?: (key?: K) => void;
29
29
  /**
30
30
  * Same as onRowClick but provides the whole object.
31
31
  */
32
32
  onRowClickObj?: (obj: T) => void;
33
33
  /**
34
- * For tables with selectable rows. When defined, shows checkbox as first column.
34
+ * For tables with selectable rows (checkboxes). When defined, shows checkbox as first column.
35
35
  *
36
- * Note: data must have IDs.
36
+ * Array will contain ids, or keys if `getRowKey` is defined.
37
37
  */
38
- checkedIds?: number[];
38
+ checkedKeys?: K[];
39
39
  /**
40
40
  * For tables with selectable rows. When defined, shows checkbox as first column.
41
+ *
42
+ * Returns arary of ids, or keys if `getRowKey` is defined.
41
43
  */
42
- setCheckedIds?: React.Dispatch<React.SetStateAction<number[]>>;
44
+ setCheckedKeys?: React.Dispatch<React.SetStateAction<K[]>>;
43
45
  /**
44
46
  * fieldName of field to be sorted (can be provided via redux)
45
47
  */
@@ -92,7 +94,7 @@ export type BaseTableProps<T> = {
92
94
  /**
93
95
  * Function called when a row is clicked. Expands the row and displays the content returned by the function.
94
96
  *
95
- * NOTE: not supported for mobile stack currently. Data must have an ID attribute.
97
+ * NOTE: not supported for mobile stack currently.
96
98
  */
97
99
  renderExpand?: (item: T) => React.ReactNode;
98
100
  /**
@@ -117,7 +119,7 @@ export type BaseTableProps<T> = {
117
119
  * UNCONTROLLED. See `selectedRowKey` for controlled version.
118
120
  * @default false
119
121
  */
120
- highlightSelectedRow?: boolean | string | number;
122
+ highlightSelectedRow?: boolean | K;
121
123
  /**
122
124
  * Defines highlight color for a selected row
123
125
  * @default MUI palette gray
@@ -129,7 +131,7 @@ export type BaseTableProps<T> = {
129
131
  * CONTROLLED. Use with `onRowClick` to update the selected row. Value must be the ID (or key if you've defined `getRowKey`).
130
132
  * See `highlightSelectedRow` for uncontrolled version.
131
133
  */
132
- selectedRowKey?: string | number;
134
+ selectedRowKey?: K | null;
133
135
  /**
134
136
  * Allows overriding of default header row style settings (table only -- this has no effect on the card list for mobile)
135
137
  *
@@ -158,14 +160,14 @@ export type BaseTableProps<T> = {
158
160
  */
159
161
  tooltipColor?: string;
160
162
  };
161
- export type TableProps<T> = BaseTableProps<T> & Omit<MuiTableProps, 'stickyHeader'>;
163
+ export type TableProps<T, K> = BaseTableProps<T, K> & Omit<MuiTableProps, 'stickyHeader'>;
162
164
  /**
163
165
  * The Table is a reusable component for displaying data in a table.
164
166
  * It includes sorting (optional).
165
167
  * If you're looking for a paginated table, use see {@link file://../PagingTable/PagingTable.tsx} or
166
168
  * {@link file://../ListPage/ListPage.tsx} which includes add & search functionality.
167
169
  */
168
- export declare const Table: <T extends object>(props: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
170
+ export declare const Table: <T extends object, K extends string | number>(props: TableProps<T, K>) => import("react/jsx-runtime").JSX.Element;
169
171
  export declare const getFieldKey: <T>(col: TableColumn<T, keyof T>) => string;
170
172
  /**
171
173
  * Helper function to get the value of a generic object.