gantri-components 2.90.0-beta.7 → 2.90.0-beta.9
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,28 +1,29 @@
|
|
|
1
1
|
import { RowData, RowSelectionState } from '@tanstack/react-table';
|
|
2
2
|
import React, { PropsWithChildren } from 'react';
|
|
3
|
-
|
|
3
|
+
import { GenericContextValue } from '../../hooks/use-provider/use-provider.types';
|
|
4
|
+
export declare const RowSelectionContext: React.Context<GenericContextValue<RowSelectionState>>;
|
|
5
|
+
export declare const LastSelectedIdContext: React.Context<GenericContextValue<string>>;
|
|
6
|
+
export declare const IsRowSelectionDisabledContext: React.Context<GenericContextValue<boolean>>;
|
|
7
|
+
export declare const IsRowSelectionCheckboxesContext: React.Context<GenericContextValue<boolean>>;
|
|
8
|
+
export declare const RowSelectionProviders: React.MemoExoticComponent<({ children }: PropsWithChildren<Record<never, never>>) => JSX.Element>;
|
|
4
9
|
/** If you need to call any of these helpers outside of the `Table` component, you must wrap your code in `RowSelectionProviders` at a higher level */
|
|
5
10
|
export declare const useTableContext: () => {
|
|
6
|
-
clearSelectedRows: () => void;
|
|
7
|
-
/** Can be used to deselect rows outside of the default behavior. */
|
|
8
11
|
isRowSelectionCheckboxes: boolean;
|
|
9
12
|
isRowSelectionDisabled: boolean;
|
|
10
13
|
lastSelectedId: string;
|
|
11
14
|
rowSelectionState: RowSelectionState;
|
|
12
|
-
/** Can be used to select rows outside of the default behavior. */
|
|
13
15
|
setIsRowSelectionCheckboxes: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
16
|
setIsRowSelectionDisabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
17
|
setLastSelectedId: React.Dispatch<React.SetStateAction<string>>;
|
|
16
18
|
setRowSelectionState: React.Dispatch<React.SetStateAction<RowSelectionState>>;
|
|
17
19
|
};
|
|
18
|
-
export declare const useGetSelectedRowData: () => <TData extends RowData<import("./table.types").CustomTData>>(props: {
|
|
19
|
-
idProperty?: keyof TData | undefined;
|
|
20
|
-
records: TData[];
|
|
21
|
-
}) => TData[];
|
|
22
20
|
export declare const useRowSelection: () => {
|
|
23
|
-
|
|
21
|
+
clearSelectedRows: () => void;
|
|
24
22
|
deselectRows: (rowIds: (string | number)[]) => void;
|
|
25
23
|
getIsRowSelected: (rowId: number | string) => boolean;
|
|
26
|
-
|
|
24
|
+
getSelectedRowsData: <TData extends RowData<import("./table.types").CustomTData>>(props: {
|
|
25
|
+
idProperty: keyof TData | undefined;
|
|
26
|
+
records: TData[];
|
|
27
|
+
}) => TData[];
|
|
27
28
|
selectRows: (rowIds: (string | number)[]) => void;
|
|
28
29
|
};
|
|
@@ -30,4 +30,4 @@ export declare const createGenericContext: <Type>(defaultValue: Type) => React.C
|
|
|
30
30
|
export declare const useProvider: <Type>(props: {
|
|
31
31
|
Context: React.Context<GenericContextValue<Type>>;
|
|
32
32
|
defaultValue: Type;
|
|
33
|
-
}) => ({ children }: PropsWithChildren<Record<never, never>>) => JSX.Element
|
|
33
|
+
}) => React.MemoExoticComponent<({ children }: PropsWithChildren<Record<never, never>>) => JSX.Element>;
|