@simoncomputing/mui-bueno-v2 0.25.7 → 0.25.9

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,30 @@ 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.25.9] - 2026-02-18
15
+
16
+ ### Added
17
+
18
+ - `DiffTable`
19
+ - Added `emptyTableMsg` (see `Table` component), with default "No changes to display"
20
+
21
+ ### Fixed
22
+
23
+ - `DiffTable`
24
+ - Fixed flex spacing from affecting the spacing between the table and the unmodified rows count
25
+
26
+ ## [0.25.8] - 2026-02-18
27
+
28
+ ### Changed
29
+
30
+ - `DiffTable`
31
+ - Changed default comparison algorithm for cell-level diff
32
+
33
+ ### Fixed
34
+
35
+ - `DiffTable`
36
+ - Fixed rows marked as modified but did not show any cell-level modifications. In other words, updated to only compare cell contents rather than comparing the objects directly. `ignoreDiff` is also taken into account when marking rows as modified.
37
+
14
38
  ## [0.25.7] - 2026-02-17
15
39
 
16
40
  ### Fixed
@@ -1,5 +1,11 @@
1
+ import { TableProps } from '../Table';
1
2
  import { DiffTableConfig } from '../../../@types';
2
- type ChangeType = 'added' | 'deleted' | 'modified';
3
+ import { ReactNode } from 'react';
4
+ export type ChangeType = 'added' | 'deleted' | 'modified';
5
+ export type DiffObj<T> = T & {
6
+ changeType: ChangeType;
7
+ modifiedDiff?: Record<string, ReactNode>;
8
+ };
3
9
  export type TableDiff<T> = {
4
10
  changeType: ChangeType;
5
11
  obj: T;
@@ -11,13 +17,7 @@ export type DiffTableProps<T> = {
11
17
  * See Table.columns
12
18
  */
13
19
  columns: DiffTableConfig<T>;
14
- /**
15
- * See Table.renderExpand
16
- *
17
- * DiffProvider will automatically be applied to content.
18
- */
19
- renderExpand?: (item: T) => React.ReactNode;
20
- };
20
+ } & Pick<TableProps<T>, 'renderExpand' | 'emptyTableMsg'>;
21
21
  /**
22
22
  * Used to display changes (additions, modifications, removals) for a set of data.
23
23
  *
@@ -29,4 +29,16 @@ export type DiffTableProps<T> = {
29
29
  export declare const DiffTable: <T extends {
30
30
  id: number;
31
31
  }>(props: DiffTableProps<T>) => import("react/jsx-runtime").JSX.Element;
32
- export {};
32
+ /**
33
+ * Returns an array of only the Added/Modified/Deleted objects between dataA & dataB (with each
34
+ * object marked as Added/Modified/Deleted), AND a count of the number of unchanged objects in both
35
+ * dataA & dataB.
36
+ *
37
+ * IMPORTANT: Data arrays (dataA & dataB) must contain objects with a valid id.
38
+ */
39
+ export declare const buildDiffData: <T extends {
40
+ id: number;
41
+ }>(columns: DiffTableConfig<T>, dataA: T[], dataB: T[], isMobileScreen?: boolean) => {
42
+ dataDiff: DiffObj<T>[];
43
+ unmodifiedCount: number;
44
+ };
@@ -147,14 +147,17 @@ export type TableProps<T> = BaseTableProps<T> & Omit<MuiTableProps, 'stickyHeade
147
147
  */
148
148
  export declare const Table: <T extends object>(props: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
149
149
  export declare const getFieldKey: <T>(col: TableColumn<T, keyof T>) => string;
150
+ /**
151
+ * Helper function to get the value of a generic object.
152
+ * The value can be nested. Ex: `getNestedValue(userObj, 'Organization.name')`
153
+ * @param obj -- object that we need to get the value from
154
+ * @param path -- field name within `obj` (can be nested)
155
+ */
156
+ export declare const getNestedValue: <T>(obj: T, path: string) => any;
150
157
  /**
151
158
  * Renders a cell in the table.
152
159
  * @param col The configuration for the current column
153
160
  * @param obj The object for the current Table row
154
161
  * @returns ReactNode of the Table cell
155
162
  */
156
- export declare const renderCell: <T, K extends keyof T>(col: TableColumn<T, K>, obj: T) => React.ReactNode;
157
- /**
158
- * Renders table cell via render method, if provided, or as-is (value).
159
- */
160
- export declare const renderOrValue: <T, K extends keyof T>(col: TableColumn<T, K>, value: T[K], obj: T, isMobileScreen: boolean) => React.ReactNode;
163
+ export declare const renderCell: <T, K extends keyof T>(col: TableColumn<T, K>, obj: T, isMobileScreen?: boolean) => React.ReactNode;