@simoncomputing/mui-bueno-v2 0.25.4 → 0.25.6

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,27 @@ 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.6] - 2026-02-13
15
+
16
+ ### Fixed
17
+
18
+ - `DiffCitationTable`
19
+ - Fixed circular JSON structure error caused by 0.25.4 change. Implemented `isEqual` to <b>URL/File Name</b> column and applied `ignoreDiff` to <b>Type</b> column
20
+
21
+ ## [0.25.5] - 2026-02-13
22
+
23
+ ### Added
24
+
25
+ - `DiffTable`
26
+ - Modified rows will now display cell-level changes
27
+
28
+ ### Changed
29
+
30
+ - `DiffTable`
31
+ - Updated `column` type to `DiffTableConfig<T>` which uses `DiffTableColumn<T, K>`. This change was made to include `isEqual` & `ignoreDiff` properties.
32
+ - `isEqual` -- equality check for cells (optional, but highly recommended if your column returns a `ReactNode`). Used to determine if the cell should reflect a content change.
33
+ - `ignoreDiff` -- if true, displays the latest value in the cell instead of displaying the diff
34
+
14
35
  ## [0.25.4] - 2026-02-09
15
36
 
16
37
  ### Added
@@ -131,6 +131,24 @@ export type TableColumn<T, K extends keyof T> = {
131
131
  tooltip?: string;
132
132
  };
133
133
 
134
+ /**
135
+ * Column Definition for DiffTable.
136
+ *
137
+ * Same properties as TableColumn but includes the following:
138
+ * @property {(beforeObject: T, afterObject: T) => boolean} isEqual - (Optional but recommended when `render` is implemented) if provided, used to determine whether the cell has changed
139
+ * @property {boolean} ignoreDiff - (Optional) if true, disables diff for the column and renders the cell normally.
140
+ */
141
+ export type DiffTableColumn<T, K extends keyof T> = TableColumn<T, K> & {
142
+ isEqual?: (beforeObject: T, afterObject: T) => boolean;
143
+ ignoreDiff?: boolean;
144
+ };
145
+
146
+ export type DiffTableConfig<T> = Array<
147
+ {
148
+ [K in keyof T]: DiffTableColumnWithKey<T, K>;
149
+ }[keyof T]
150
+ >;
151
+
134
152
  // Sort order for Tables
135
153
  export type SortOrder = 'asc' | 'desc';
136
154
 
@@ -12,6 +12,8 @@ export type DiffProps = {
12
12
  */
13
13
  mode?: DiffMode;
14
14
  };
15
+ export declare const DIFF_GREEN_HIGHLIGHT = "rgba(194, 249, 112, .5)";
16
+ export declare const DIFF_RED_HIGHLIGHT = "rgba(196, 77,86,0.3)";
15
17
  /**
16
18
  * Displays diff between two strings.
17
19
  *
@@ -78,8 +78,10 @@ export declare const baseCitationTableColumns: (palette: Palette, condenseTable?
78
78
  key: string;
79
79
  label: string;
80
80
  render: (fileName: string | undefined, citation: Citation) => import("react/jsx-runtime").JSX.Element;
81
+ ignoreDiff: boolean;
81
82
  tableCellSx?: undefined;
82
83
  hideCol?: undefined;
84
+ isEqual?: undefined;
83
85
  } | {
84
86
  fieldName: string;
85
87
  tableCellSx: {
@@ -88,13 +90,17 @@ export declare const baseCitationTableColumns: (palette: Palette, condenseTable?
88
90
  render: (title: string) => string;
89
91
  key?: undefined;
90
92
  label?: undefined;
93
+ ignoreDiff?: undefined;
91
94
  hideCol?: undefined;
95
+ isEqual?: undefined;
92
96
  } | {
93
97
  fieldName: string;
94
98
  key: string;
95
99
  label: string;
96
100
  hideCol: boolean;
97
101
  render: (fileName: string, citation: Citation) => import("react/jsx-runtime").JSX.Element;
102
+ isEqual: (citation1: Citation, citation2: Citation) => boolean;
103
+ ignoreDiff?: undefined;
98
104
  tableCellSx?: undefined;
99
105
  } | {
100
106
  fieldName: string;
@@ -102,12 +108,16 @@ export declare const baseCitationTableColumns: (palette: Palette, condenseTable?
102
108
  key?: undefined;
103
109
  label?: undefined;
104
110
  render?: undefined;
111
+ ignoreDiff?: undefined;
105
112
  tableCellSx?: undefined;
113
+ isEqual?: undefined;
106
114
  } | {
107
115
  fieldName: string;
108
116
  hideCol: boolean;
109
117
  render: (accessedAt: string, citation: Citation) => string | undefined;
110
118
  key?: undefined;
111
119
  label?: undefined;
120
+ ignoreDiff?: undefined;
112
121
  tableCellSx?: undefined;
122
+ isEqual?: undefined;
113
123
  })[];
@@ -1,4 +1,4 @@
1
- import { TableConfig } from '../../../@types';
1
+ import { DiffTableConfig } from '../../../@types';
2
2
  type ChangeType = 'added' | 'deleted' | 'modified';
3
3
  export type TableDiff<T> = {
4
4
  changeType: ChangeType;
@@ -10,7 +10,7 @@ export type DiffTableProps<T> = {
10
10
  /**
11
11
  * See Table.columns
12
12
  */
13
- columns: TableConfig<T>;
13
+ columns: DiffTableConfig<T>;
14
14
  /**
15
15
  * See Table.renderExpand
16
16
  *
@@ -25,8 +25,6 @@ export type DiffTableProps<T> = {
25
25
  * rows will be counted and displayed at the bottom, under the table.
26
26
  *
27
27
  * Data sets MUST be objects with an id property.
28
- *
29
- * NOTE: Changed rows only display that the row was changed. Cell-level diff is not yet implemented.
30
28
  */
31
29
  export declare const DiffTable: <T extends {
32
30
  id: number;
@@ -1,6 +1,6 @@
1
1
  import { TableProps as MuiTableProps } from '@mui/material';
2
2
  import { SystemStyleObject, Theme } from '@mui/system';
3
- import { SortOrder, TableConfig } from '../../@types';
3
+ import { TableColumn, SortOrder, TableConfig } from '../../@types';
4
4
  import { default as React } from 'react';
5
5
  /**
6
6
  * Interface for table props.
@@ -146,3 +146,15 @@ export type TableProps<T> = BaseTableProps<T> & Omit<MuiTableProps, 'stickyHeade
146
146
  * {@link file://../ListPage/ListPage.tsx} which includes add & search functionality.
147
147
  */
148
148
  export declare const Table: <T extends object>(props: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
149
+ export declare const getFieldKey: <T>(col: TableColumn<T, keyof T>) => string;
150
+ /**
151
+ * Renders a cell in the table.
152
+ * @param col The configuration for the current column
153
+ * @param obj The object for the current Table row
154
+ * @returns ReactNode of the Table cell
155
+ */
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;