@paubox/ui 0.22.0 → 0.23.0
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/index.esm.js +406 -405
- package/package.json +1 -1
- package/src/lib/Table/RowContextMenu.d.ts +15 -0
- package/src/lib/Table/Table.d.ts +0 -1
- package/src/lib/Table/ContextMenuCell.d.ts +0 -11
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
+
export interface RowAction<T> {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick: (row: T) => void;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
disabled?: boolean | ((row: T) => boolean);
|
|
7
|
+
}
|
|
8
|
+
interface RowContextMenuProps<T> {
|
|
9
|
+
anchorRef: MutableRefObject<HTMLElement | null>;
|
|
10
|
+
actions?: RowAction<T>[];
|
|
11
|
+
activeRow: T | null;
|
|
12
|
+
setActiveRow: Dispatch<SetStateAction<T | null>>;
|
|
13
|
+
}
|
|
14
|
+
export declare const RowContextMenu: <T extends object>({ anchorRef, actions, activeRow, setActiveRow, }: RowContextMenuProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
package/src/lib/Table/Table.d.ts
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Row } from '@tanstack/react-table';
|
|
2
|
-
import { RowAction } from './Table';
|
|
3
|
-
interface ContextMenuCellProps<T extends object> {
|
|
4
|
-
row: Row<T>;
|
|
5
|
-
setOpenMenuId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
6
|
-
openMenuId: string | null;
|
|
7
|
-
contextMenuActions: RowAction<T>[];
|
|
8
|
-
testId?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const ContextMenuCell: <T extends object>({ row, setOpenMenuId, openMenuId, contextMenuActions, testId, }: ContextMenuCellProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|