gantri-components 2.90.0-beta.1 → 2.90.0-beta.3

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.
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledBottomActionsFlex: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../flex/flex.types").FlexProps & import("react").RefAttributes<import("../../../flex/flex.types").FlexProps>>, import("styled-components").DefaultTheme, {
3
+ showClearSelectedRows: boolean;
4
+ }, never>;
@@ -18,7 +18,7 @@ export interface CustomActionComponentProps<TData extends RowData> {
18
18
  }
19
19
  export interface CustomActionProps<TData extends RowData> {
20
20
  Component: JSXElementConstructor<CustomActionComponentProps<TData>>;
21
- position: 'left' | 'right' | 'bottom';
21
+ position: 'left' | 'right' | 'bottom' | 'selected-rows';
22
22
  }
23
23
  export interface TableActionsWrapperProps<TData extends RowData> {
24
24
  className: string | undefined;
@@ -1 +1,2 @@
1
+ export declare const dataAttrClearSelected = "data-clear-selected";
1
2
  export declare const ClearSelectedRows: () => JSX.Element;
@@ -3,4 +3,4 @@ export * from './table.providers';
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';
6
- export { useRowSelectionContext } from './table.context';
6
+ export * from './table.context';
@@ -1,12 +1,22 @@
1
- import { RowSelectionState } from '@tanstack/react-table';
1
+ import { RowData, RowSelectionState } from '@tanstack/react-table';
2
2
  import React, { PropsWithChildren } from 'react';
3
3
  export declare const RowSelectionProviders: ({ children, }: PropsWithChildren<Record<never, never>>) => JSX.Element;
4
- export declare const useRowSelectionContext: () => {
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
+ export declare const useTableContext: () => {
5
6
  clearSelectedRows: () => void;
7
+ /** Can be used to deselect rows outside of the default behavior. */
8
+ deselectRows: (rowIds: (string | number)[]) => void;
9
+ getIsRowSelected: (rowId: number | string) => boolean;
10
+ getSelectedRowData: <TData extends RowData<import("./table.types").CustomTData>>(props: {
11
+ idProperty: keyof TData;
12
+ records: TData[];
13
+ }) => (TData | undefined)[];
6
14
  isRowSelectionCheckboxes: boolean;
7
15
  isRowSelectionDisabled: boolean;
8
16
  lastSelectedId: string;
9
17
  rowSelectionState: RowSelectionState;
18
+ /** Can be used to select rows outside of the default behavior. */
19
+ selectRows: (rowIds: (string | number)[]) => void;
10
20
  setIsRowSelectionCheckboxes: React.Dispatch<React.SetStateAction<boolean>>;
11
21
  setIsRowSelectionDisabled: React.Dispatch<React.SetStateAction<boolean>>;
12
22
  setLastSelectedId: React.Dispatch<React.SetStateAction<string>>;