@monolith-forensics/monolith-ui 1.2.21 → 1.2.23

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.
@@ -501,6 +501,6 @@ const TableProvider = (_a) => {
501
501
  filterState,
502
502
  compactState,
503
503
  toggleCompact,
504
- getCalculatedSelectionTotal, tableHeight: height, tableMaxHeight: maxHeight, tableMinHeight: minHeight }, props), { data: _data }), children: children }));
504
+ getCalculatedSelectionTotal, tableHeight: height, tableMaxHeight: maxHeight, tableMinHeight: minHeight }, props), { onRowUpdated: (props === null || props === void 0 ? void 0 : props.onRowUpdated) || (() => { }), data: _data }), children: children }));
505
505
  };
506
506
  export default TableProvider;
@@ -7,7 +7,7 @@ import ActionCell from "./ActionCell";
7
7
  import ActionButton from "./ActionButton";
8
8
  import CheckBox from "../CheckBox";
9
9
  const TableRow = ({ rowData, rowStyle }) => {
10
- const { columnState, enableActionButton, onActionButtonClick, actionButtonIcon: Icon, enableSelection, selectRow, deselectRow, isRowSelected, } = useTable();
10
+ const { columnState, enableActionButton, onActionButtonClick, actionButtonIcon: Icon, enableSelection, selectRow, deselectRow, isRowSelected, onRowUpdated, } = useTable();
11
11
  const selected = isRowSelected(rowData);
12
12
  const handleSelectionChange = (e) => {
13
13
  e === true ? selectRow(rowData) : deselectRow(rowData);
@@ -20,7 +20,10 @@ const TableRow = ({ rowData, rowStyle }) => {
20
20
  minWidth: column.minWidth,
21
21
  flex: column.width ? "0 0 auto" : "1",
22
22
  }, children: [(column === null || column === void 0 ? void 0 : column.enableResize) === true && _jsx(ColumnResizer, { column: column }), _jsx(InnerCellContent, { className: "mfui inner-cell-content", children: column.render
23
- ? column.render(rowData)
23
+ ? column.render({
24
+ rowData,
25
+ onRowUpdated,
26
+ })
24
27
  : rowData[column.dataField] })] }, index));
25
28
  })] }));
26
29
  };
@@ -7,6 +7,10 @@ export type StateStorage = {
7
7
  type: "localStorage";
8
8
  key: string;
9
9
  };
10
+ export type RenderOptions = {
11
+ rowData: any;
12
+ onRowUpdated?: () => void;
13
+ };
10
14
  export interface ColumnProps {
11
15
  columnId?: string;
12
16
  dataField: string;
@@ -20,7 +24,7 @@ export interface ColumnProps {
20
24
  enableReorder?: boolean;
21
25
  enableSorting?: boolean;
22
26
  orderValue?: number;
23
- render?: (rowData: any) => React.ReactNode;
27
+ render?: (options: RenderOptions) => React.ReactNode;
24
28
  }
25
29
  export interface ColumnState extends ColumnProps {
26
30
  columnId: string;
@@ -132,6 +136,7 @@ export type TableContextType = {
132
136
  onColumnResize?: (e: OnColumnChangeProps) => void;
133
137
  onColumnReorder?: (e: OnColumnChangeProps) => void;
134
138
  onTableExport?: OnTableExportFn;
139
+ onRowUpdated: () => void;
135
140
  handleColumnReorder: (dragColumn: ColumnState, dropColumn: ColumnState) => void;
136
141
  handleColumnHeaderClick: (column: ColumnState) => void;
137
142
  onColumnStateChange?: (e: ColumnState[]) => void;
@@ -182,6 +187,7 @@ export interface TableProviderProps {
182
187
  column: ColumnState;
183
188
  sort?: SortState | null;
184
189
  }) => void;
190
+ onRowUpdated?: () => void;
185
191
  }
186
192
  export interface TableRowProps {
187
193
  rowData: {
@@ -254,6 +260,7 @@ export interface TableProps {
254
260
  manualFiltering?: boolean;
255
261
  manualExport?: boolean;
256
262
  tableMenuOptions?: TableMenuOptions;
263
+ onRowUpdated?: () => void;
257
264
  onSelectionChange?: onSelectionChangeFn;
258
265
  onActionButtonClick?: (rowData: any) => void;
259
266
  onColumnResize?: (e: OnColumnChangeProps) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.2.21",
3
+ "version": "1.2.23",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",