gantri-components 2.90.0-beta.8 → 2.90.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/dist/components/table/components/selectable-row-checkbox-wrapper/index.d.ts +1 -0
- package/dist/components/table/components/selectable-row-checkbox-wrapper/selectable-row-checkbox-wrapper.d.ts +3 -0
- package/dist/components/table/components/selectable-row-checkbox-wrapper/selectable-row-checkbox-wrapper.types.d.ts +4 -0
- package/dist/components/table/{hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.d.ts → components/table-actions-wrapper/components/clear-selected-rows/clear-selected-rows.constants.d.ts} +0 -1
- package/dist/components/table/components/table-actions-wrapper/components/clear-selected-rows/clear-selected-rows.d.ts +1 -0
- package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts +3 -0
- package/dist/components/table/components/table-footer/components/selectable-row-footer-wrapper/index.d.ts +1 -0
- package/dist/components/table/components/table-footer/components/selectable-row-footer-wrapper/selectable-row-footer-wrapper.d.ts +3 -0
- package/dist/components/table/components/table-footer/components/selectable-row-footer-wrapper/selectable-row-footer-wrapper.types.d.ts +3 -0
- package/dist/components/table/components/table-header/components/selectable-row-header-wrapper/index.d.ts +1 -0
- package/dist/components/table/components/table-header/components/selectable-row-header-wrapper/selectable-row-header-wrapper.d.ts +4 -0
- package/dist/components/table/{hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.types.d.ts → components/table-header/components/selectable-row-header-wrapper/selectable-row-header-wrapper.types.d.ts} +1 -1
- package/dist/components/table/components/table-row-cells/components/selectable-row-cell-wrapper/helpers/get-row-range/get-row-range.d.ts +3 -0
- package/dist/components/table/components/table-row-cells/components/selectable-row-cell-wrapper/helpers/get-row-range/get-row-range.types.d.ts +6 -0
- package/dist/components/table/components/table-row-cells/components/selectable-row-cell-wrapper/index.d.ts +1 -0
- package/dist/components/table/components/table-row-cells/components/selectable-row-cell-wrapper/selectable-row-cell-wrapper.d.ts +4 -0
- package/dist/components/table/{hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.types.d.ts → components/table-row-cells/components/selectable-row-cell-wrapper/selectable-row-cell-wrapper.types.d.ts} +1 -1
- package/dist/components/table/hooks/use-get-selected-table-rows-data/index.d.ts +1 -0
- package/dist/components/table/hooks/use-get-selected-table-rows-data/use-get-selected-table-rows-data.d.ts +7 -0
- package/dist/components/table/hooks/use-row-selection/index.d.ts +1 -0
- package/dist/components/table/hooks/{use-selectable-table-rows/use-selectable-table-rows.constants.d.ts → use-row-selection/use-row-selection.constants.d.ts} +0 -1
- package/dist/components/table/hooks/use-row-selection/use-row-selection.d.ts +8 -0
- package/dist/components/table/hooks/{use-selectable-table-rows/use-selectable-table-rows.types.d.ts → use-row-selection/use-row-selection.types.d.ts} +1 -1
- package/dist/components/table/index.d.ts +3 -1
- package/dist/components/table/table.context.d.ts +15 -22
- package/dist/components/table/table.providers.d.ts +2 -3
- package/dist/components/table/table.types.d.ts +2 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/index.d.ts +0 -1
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.d.ts +0 -4
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/index.d.ts +0 -1
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.d.ts +0 -3
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.types.d.ts +0 -3
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/index.d.ts +0 -1
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.d.ts +0 -4
- package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/get-row-range.d.ts +0 -2
- package/dist/components/table/hooks/use-selectable-table-rows/index.d.ts +0 -1
- package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.d.ts +0 -10
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/use-provider/index.d.ts +0 -1
- package/dist/hooks/use-provider/use-provider.d.ts +0 -33
- package/dist/hooks/use-provider/use-provider.types.d.ts +0 -2
- /package/dist/components/table/{hooks/use-selectable-table-rows → components/table-actions-wrapper}/components/clear-selected-rows/clear-selected-rows.styles.d.ts +0 -0
- /package/dist/components/table/{hooks/use-selectable-table-rows → components/table-actions-wrapper}/components/clear-selected-rows/index.d.ts +0 -0
- /package/dist/components/table/{hooks/use-selectable-table-rows → components/table-row-cells/components/selectable-row-cell-wrapper}/helpers/get-row-range/index.d.ts +0 -0
- /package/dist/components/table/{hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.styles.d.ts → components/table-row-cells/components/selectable-row-cell-wrapper/selectable-row-cell-wrapper.styles.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-row-checkbox-wrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ClearSelectedRows: () => JSX.Element;
|
package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
+
export declare const StyledDraggableRowTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
|
|
2
|
+
reorderEnabled: boolean;
|
|
3
|
+
}, never>;
|
|
1
4
|
export declare const StyledDraggableRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-row-footer-wrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-row-header-wrapper';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
import { SelectableRowHeaderWrapperProps } from './selectable-row-header-wrapper.types';
|
|
4
|
+
export declare const SelectableRowHeaderWrapper: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowHeaderWrapperProps<TData>>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-row-cell-wrapper';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
import { SelectableRowCellWrapperProps } from './selectable-row-cell-wrapper.types';
|
|
4
|
+
export declare const SelectableRowCellWrapper: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowCellWrapperProps<TData>>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-get-selected-table-rows-data';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
export declare const useGetSelectedRowsData: () => {
|
|
3
|
+
getSelectedRowsData: <TData extends RowData<import("../..").CustomTData>>(props: {
|
|
4
|
+
idProperty: keyof TData | undefined;
|
|
5
|
+
records: TData[];
|
|
6
|
+
}) => TData[];
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-row-selection';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const useRowSelection: () => {
|
|
2
|
+
clearSelectedRows: () => void;
|
|
3
|
+
/** Can be used to deselect rows outside of the default behavior. */
|
|
4
|
+
deselectRows: (rowIds: (string | number)[]) => void;
|
|
5
|
+
getIsRowSelected: (rowId: number | string) => boolean;
|
|
6
|
+
/** Can be used to select rows outside of the default behavior. */
|
|
7
|
+
selectRows: (rowIds: (string | number)[]) => void;
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RowData } from '@tanstack/react-table';
|
|
2
|
-
import { rowSelectionTypes } from './use-
|
|
2
|
+
import { rowSelectionTypes } from './use-row-selection.constants';
|
|
3
3
|
export interface RowSelection<TData extends RowData> {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
idProperty?: keyof TData;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type { GetAfterRowComponentDef, AfterRowComponentDef, } from './components/after-row-component/after-row-component.types';
|
|
2
|
+
export * from './hooks/use-row-selection/use-row-selection.constants';
|
|
2
3
|
export * from './table';
|
|
4
|
+
export * from './table.providers';
|
|
3
5
|
export * from './table.types';
|
|
4
6
|
export * from './components/table-row/table-row.constants';
|
|
5
7
|
export * from './components/table-actions-wrapper/table-actions-wrapper.types';
|
|
6
|
-
export * from './
|
|
8
|
+
export * from './hooks/use-row-selection';
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
1
|
+
import { RowSelectionState } from '@tanstack/react-table';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type GenericContextValue<Type> = [Type, Dispatch<SetStateAction<Type>>];
|
|
4
|
+
export declare const defaultRowSelectionState: RowSelectionState;
|
|
5
|
+
export declare const defaultLastSelectedId: string;
|
|
6
|
+
export declare const defaultIsRowSelectionDisabled: boolean;
|
|
7
|
+
export declare const defaultIsRowSelectionCheckboxes: boolean;
|
|
8
|
+
export declare const RowSelectionContext: import("react").Context<GenericContextValue<RowSelectionState>>;
|
|
9
|
+
export declare const LastSelectedIdContext: import("react").Context<GenericContextValue<string>>;
|
|
10
|
+
export declare const IsRowSelectionDisabledContext: import("react").Context<GenericContextValue<boolean>>;
|
|
11
|
+
export declare const IsRowSelectionCheckboxesContext: import("react").Context<GenericContextValue<boolean>>;
|
|
9
12
|
export declare const useTableContext: () => {
|
|
10
13
|
isRowSelectionCheckboxes: boolean;
|
|
11
14
|
isRowSelectionDisabled: boolean;
|
|
12
15
|
lastSelectedId: string;
|
|
13
16
|
rowSelectionState: RowSelectionState;
|
|
14
|
-
setIsRowSelectionCheckboxes:
|
|
15
|
-
setIsRowSelectionDisabled:
|
|
16
|
-
setLastSelectedId:
|
|
17
|
-
setRowSelectionState:
|
|
18
|
-
};
|
|
19
|
-
export declare const useRowSelection: () => {
|
|
20
|
-
clearSelectedRows: () => void;
|
|
21
|
-
deselectRows: (rowIds: (string | number)[]) => void;
|
|
22
|
-
getIsRowSelected: (rowId: number | string) => boolean;
|
|
23
|
-
getSelectedRowsData: <TData extends RowData<import("./table.types").CustomTData>>(props: {
|
|
24
|
-
idProperty: keyof TData | undefined;
|
|
25
|
-
records: TData[];
|
|
26
|
-
}) => TData[];
|
|
27
|
-
selectRows: (rowIds: (string | number)[]) => void;
|
|
17
|
+
setIsRowSelectionCheckboxes: Dispatch<SetStateAction<boolean>>;
|
|
18
|
+
setIsRowSelectionDisabled: Dispatch<SetStateAction<boolean>>;
|
|
19
|
+
setLastSelectedId: Dispatch<SetStateAction<string>>;
|
|
20
|
+
setRowSelectionState: Dispatch<SetStateAction<RowSelectionState>>;
|
|
28
21
|
};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const Table: <TData extends RowData<import("./table.types").CustomTData>>(props: TableProps<TData>) => JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare const RowSelectionProviders: ({ children, }: PropsWithChildren<Record<never, never>>) => JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { CustomActionProps, FiltersProps, SearchProps } from './components/table
|
|
|
6
6
|
import { SortProps } from './components/table-actions-wrapper/components/sort/sort.types';
|
|
7
7
|
import { OverlayPosition } from '../overlay/overlay.types';
|
|
8
8
|
import { GetAfterRowComponentDef } from './components/after-row-component/after-row-component.types';
|
|
9
|
-
import { RowSelection } from './hooks/use-
|
|
9
|
+
import { RowSelection } from './hooks/use-row-selection/use-row-selection.types';
|
|
10
10
|
export interface RowReorderingProps<TData extends RowData> {
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
getDisableSortableRow?: (row: Row<TData>) => boolean;
|
|
@@ -64,6 +64,7 @@ export interface TableProps<TData extends RowData> extends Partial<TableDefaultP
|
|
|
64
64
|
options?: Partial<TableOptions<TData>>;
|
|
65
65
|
paging?: PagingProps;
|
|
66
66
|
reordering?: RowReorderingProps<TData>;
|
|
67
|
+
/** If using row selection, you must wrap your component in `RowSelectionProviders`. This should be done outside the parent the component using the `Table`. `useRowSelection` provides additional helpful functions you may wish to utilize. */
|
|
67
68
|
rowSelection?: RowSelection<TData>;
|
|
68
69
|
search?: SearchProps;
|
|
69
70
|
sorting?: SortProps;
|