@simoncomputing/mui-bueno-v2 0.25.7 → 0.25.8

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,18 @@ 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.8] - 2026-02-18
15
+
16
+ ### Changed
17
+
18
+ - `DiffTable`
19
+ - Changed default comparison algorithm for cell-level diff
20
+
21
+ ### Fixed
22
+
23
+ - `DiffTable`
24
+ - 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.
25
+
14
26
  ## [0.25.7] - 2026-02-17
15
27
 
16
28
  ### Fixed
@@ -1,5 +1,10 @@
1
+ import { default as React, ReactNode } from 'react';
1
2
  import { DiffTableConfig } from '../../../@types';
2
- type ChangeType = 'added' | 'deleted' | 'modified';
3
+ export type ChangeType = 'added' | 'deleted' | 'modified';
4
+ export type DiffObj<T> = T & {
5
+ changeType: ChangeType;
6
+ modifiedDiff?: Record<string, ReactNode>;
7
+ };
3
8
  export type TableDiff<T> = {
4
9
  changeType: ChangeType;
5
10
  obj: T;
@@ -29,4 +34,16 @@ export type DiffTableProps<T> = {
29
34
  export declare const DiffTable: <T extends {
30
35
  id: number;
31
36
  }>(props: DiffTableProps<T>) => import("react/jsx-runtime").JSX.Element;
32
- export {};
37
+ /**
38
+ * Returns an array of only the Added/Modified/Deleted objects between dataA & dataB (with each
39
+ * object marked as Added/Modified/Deleted), AND a count of the number of unchanged objects in both
40
+ * dataA & dataB.
41
+ *
42
+ * IMPORTANT: Data arrays (dataA & dataB) must contain objects with a valid id.
43
+ */
44
+ export declare const buildDiffData: <T extends {
45
+ id: number;
46
+ }>(columns: DiffTableConfig<T>, dataA: T[], dataB: T[], isMobileScreen?: boolean) => {
47
+ dataDiff: DiffObj<T>[];
48
+ unmodifiedCount: number;
49
+ };
@@ -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;