gantri-components 2.90.0-beta.4 → 2.90.0-beta.6
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/table/index.d.ts +1 -1
- package/dist/components/table/table.context.d.ts +2 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-provider/index.d.ts +1 -0
- package/dist/hooks/use-provider/use-provider.d.ts +33 -0
- package/dist/hooks/use-provider/use-provider.types.d.ts +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { GetAfterRowComponentDef, AfterRowComponentDef, } from './components/after-row-component/after-row-component.types';
|
|
2
|
-
export * from './table
|
|
2
|
+
export * from './table';
|
|
3
3
|
export * from './table.types';
|
|
4
4
|
export * from './components/table-row/table-row.constants';
|
|
5
5
|
export * from './components/table-actions-wrapper/table-actions-wrapper.types';
|
|
@@ -4,19 +4,19 @@ export declare const RowSelectionProviders: ({ children, }: PropsWithChildren<Re
|
|
|
4
4
|
/** 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
5
|
export declare const useTableContext: () => {
|
|
6
6
|
clearSelectedRows: () => void;
|
|
7
|
-
/** Can be used to deselect rows outside of the default behavior. */
|
|
8
7
|
deselectRows: (rowIds: (string | number)[]) => void;
|
|
9
8
|
getIsRowSelected: (rowId: number | string) => boolean;
|
|
10
9
|
getSelectedRowData: <TData extends RowData<import("./table.types").CustomTData>>(props: {
|
|
11
10
|
idProperty: keyof TData;
|
|
12
11
|
records: TData[];
|
|
13
12
|
}) => (TData | undefined)[];
|
|
13
|
+
/** Can be used to deselect rows outside of the default behavior. */
|
|
14
14
|
isRowSelectionCheckboxes: boolean;
|
|
15
15
|
isRowSelectionDisabled: boolean;
|
|
16
16
|
lastSelectedId: string;
|
|
17
17
|
rowSelectionState: RowSelectionState;
|
|
18
|
-
/** Can be used to select rows outside of the default behavior. */
|
|
19
18
|
selectRows: (rowIds: (string | number)[]) => void;
|
|
19
|
+
/** Can be used to select rows outside of the default behavior. */
|
|
20
20
|
setIsRowSelectionCheckboxes: React.Dispatch<React.SetStateAction<boolean>>;
|
|
21
21
|
setIsRowSelectionDisabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
22
22
|
setLastSelectedId: React.Dispatch<React.SetStateAction<string>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-provider';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { GenericContextValue } from './use-provider.types';
|
|
3
|
+
export declare const createGenericContext: <Type>(defaultValue: Type) => React.Context<GenericContextValue<Type>>;
|
|
4
|
+
/**
|
|
5
|
+
* ```
|
|
6
|
+
* const defaultMyValue = 'foo';
|
|
7
|
+
*
|
|
8
|
+
* const MyContext = createGenericContext(defaultMyValue);
|
|
9
|
+
*
|
|
10
|
+
* const OuterWrapper = () => {
|
|
11
|
+
* const MyProvider = useProvider({
|
|
12
|
+
* Context: MyContext,
|
|
13
|
+
* defaultValue: defaultMyValue,
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* return (
|
|
17
|
+
* <MyProvider>
|
|
18
|
+
* <InnerComponent />
|
|
19
|
+
* </MyProvider>
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* const InnerComponent = () => {
|
|
24
|
+
* const [myValue, setMyValue] = useContext(MyContext);
|
|
25
|
+
*
|
|
26
|
+
* // ...
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const useProvider: <Type>(props: {
|
|
31
|
+
Context: React.Context<GenericContextValue<Type>>;
|
|
32
|
+
defaultValue: Type;
|
|
33
|
+
}) => ({ children }: PropsWithChildren<Record<never, never>>) => JSX.Element;
|