@monolith-forensics/monolith-ui 1.2.20 → 1.2.22

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.
@@ -1,11 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { Document, Page, pdfjs } from "react-pdf";
3
+ import { Document, Page,
4
+ // pdfjs
5
+ } from "react-pdf";
4
6
  import "react-pdf/dist/esm/Page/AnnotationLayer.css";
5
7
  import "react-pdf/dist/esm/Page/TextLayer.css";
6
8
  import styled from "styled-components";
7
9
  import Loader from "../../Loader";
8
- pdfjs.GlobalWorkerOptions.workerSrc = new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString();
10
+ // pdfjs.GlobalWorkerOptions.workerSrc = new URL(
11
+ // "pdfjs-dist/build/pdf.worker.min.mjs",
12
+ // import.meta.url
13
+ // ).toString();
9
14
  const StyledContainer = styled.div `
10
15
  display: flex;
11
16
  justify-content: center;
@@ -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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",