grep-components 2.12.0 → 2.13.0-GREPF-2676.1
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/dist/components/GrepSelect/index.d.ts +2 -1
- package/dist/components/SortableTable/components/sortableTableRow.d.ts +10 -0
- package/dist/components/SortableTable/index.d.ts +26 -8
- package/dist/components/SortableTable/stories/SortableTable.stories.d.ts +1 -1
- package/dist/components/SortableTable/styles/row.style.d.ts +3 -5
- package/dist/index.js +4556 -7271
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/dist/components/SortableTable/components/cell.d.ts +0 -7
- package/dist/components/SortableTable/components/row.d.ts +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SelectProps, InputBaseComponentProps } from '@mui/material';
|
|
2
|
+
import { SelectProps, InputBaseComponentProps, InputLabelProps } from '@mui/material';
|
|
3
3
|
export interface SelectItem {
|
|
4
4
|
value: string | number;
|
|
5
5
|
label?: string;
|
|
@@ -14,6 +14,7 @@ export type GrepSelectProps = SelectProps & {
|
|
|
14
14
|
selectItems: SelectItem[];
|
|
15
15
|
unselectOption?: boolean;
|
|
16
16
|
useCheckedSelect?: boolean;
|
|
17
|
+
labelProps?: InputLabelProps;
|
|
17
18
|
inputProps?: InputBaseComponentProps | undefined;
|
|
18
19
|
};
|
|
19
20
|
declare const _default: React.ComponentType<GrepSelectProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
3
|
+
import { TableColumn } from '../../GrepTable';
|
|
4
|
+
interface props<T> extends Omit<React.HTMLProps<HTMLTableRowElement>, 'id'> {
|
|
5
|
+
id: UniqueIdentifier;
|
|
6
|
+
item: T;
|
|
7
|
+
columns: Array<TableColumn<T>>;
|
|
8
|
+
}
|
|
9
|
+
export declare function SortableTableRow2<T>({ id, columns, item, ...props }: props<T>): ReactElement;
|
|
10
|
+
export {};
|
|
@@ -1,20 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
2
2
|
import { TableCellProps } from '@mui/material/TableCell';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { TableColumn } from '../GrepTable';
|
|
3
6
|
export interface CellNode {
|
|
4
7
|
value: ReactNode;
|
|
5
8
|
properties?: TableCellProps;
|
|
6
9
|
}
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
export interface dndModifiers {
|
|
11
|
+
modifiers: 'restrict';
|
|
12
|
+
dragOverlay: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SortableTableProperties<T extends {
|
|
15
|
+
id: UniqueIdentifier;
|
|
16
|
+
}> {
|
|
17
|
+
columns: Array<TableColumn<T>>;
|
|
18
|
+
data: T[];
|
|
19
|
+
/** @default false */
|
|
20
|
+
header?: boolean;
|
|
21
|
+
/** @default "medium"
|
|
22
|
+
* Overrides tablecell sizes
|
|
23
|
+
*/
|
|
24
|
+
size?: 'small' | 'medium';
|
|
25
|
+
/** Disables drag and drop for the component */
|
|
10
26
|
disabled?: boolean;
|
|
11
|
-
identify: (item: T) => string | number;
|
|
12
|
-
headerValue?: (column: keyof T) => CellNode | ReactNode;
|
|
13
|
-
cellValue?: (column: keyof T, item: T) => CellNode | ReactNode;
|
|
14
27
|
onChange?: (order: {
|
|
15
28
|
id: string | number;
|
|
16
29
|
index: number;
|
|
17
30
|
}[]) => void;
|
|
31
|
+
/** Restricts possibility to drag outside the table itself
|
|
32
|
+
* ref: https://docs.dndkit.com/api-documentation/modifiers */
|
|
33
|
+
modifiers?: 'restrict';
|
|
18
34
|
}
|
|
19
|
-
|
|
35
|
+
declare const SortableTable: <T extends {
|
|
36
|
+
id: UniqueIdentifier;
|
|
37
|
+
}>({ data, onChange, ...props }: SortableTableProperties<T>) => ReactElement;
|
|
20
38
|
export default SortableTable;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
isDragging: boolean;
|
|
3
|
-
}, muiStyleOverridesParams?: {
|
|
1
|
+
export declare const useSortableTableStyles: (params: void, muiStyleOverridesParams?: {
|
|
4
2
|
props: Record<string, unknown>;
|
|
5
3
|
ownerState?: Record<string, unknown> | undefined;
|
|
6
4
|
} | undefined) => {
|
|
7
|
-
classes: Record<"
|
|
5
|
+
classes: Record<"dragOverlayRow" | "sortableRow", string>;
|
|
8
6
|
theme: import("@mui/material").Theme;
|
|
9
7
|
css: import("tss-react").Css;
|
|
10
8
|
cx: import("tss-react").Cx;
|
|
11
9
|
};
|
|
12
|
-
export default
|
|
10
|
+
export default useSortableTableStyles;
|