gantri-components 2.89.0 → 2.90.0-beta.2

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.
Files changed (34) hide show
  1. package/dist/components/table/components/table-actions-wrapper/table-actions-wrapper.styles.d.ts +4 -0
  2. package/dist/components/table/components/table-actions-wrapper/table-actions-wrapper.types.d.ts +1 -1
  3. package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts +0 -3
  4. package/dist/components/table/components/table-row/table-row.types.d.ts +2 -1
  5. package/dist/components/table/components/table-row-cells/components/table-cell/table-cell.types.d.ts +2 -1
  6. package/dist/components/table/components/table-row-cells/table-row-cells.types.d.ts +2 -1
  7. package/dist/components/table/components/table-row-overlay/table-row-overlay.types.d.ts +3 -2
  8. package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.d.ts +2 -0
  9. package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.styles.d.ts +2 -0
  10. package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/index.d.ts +1 -0
  11. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/index.d.ts +1 -0
  12. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.d.ts +4 -0
  13. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.styles.d.ts +2 -0
  14. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.types.d.ts +6 -0
  15. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/index.d.ts +1 -0
  16. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.d.ts +2 -0
  17. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.types.d.ts +5 -0
  18. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/index.d.ts +1 -0
  19. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.d.ts +4 -0
  20. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.types.d.ts +5 -0
  21. package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/get-row-range.d.ts +2 -0
  22. package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/index.d.ts +1 -0
  23. package/dist/components/table/hooks/use-selectable-table-rows/index.d.ts +1 -0
  24. package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.constants.d.ts +6 -0
  25. package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.d.ts +10 -0
  26. package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.types.d.ts +6 -0
  27. package/dist/components/table/index.d.ts +2 -1
  28. package/dist/components/table/table.context.d.ts +23 -0
  29. package/dist/components/table/table.providers.d.ts +3 -0
  30. package/dist/components/table/table.types.d.ts +2 -0
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.esm.js +1 -1
  33. package/dist/index.umd.js +1 -1
  34. package/package.json +1 -1
@@ -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,4 +1 @@
1
- export declare const StyledDraggableRowTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
2
- reorderEnabled: boolean;
3
- }, never>;
4
1
  export declare const StyledDraggableRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,4 +1,4 @@
1
- import { Row, RowData } from '@tanstack/react-table';
1
+ import { Row, RowData, Table } from '@tanstack/react-table';
2
2
  import { CustomRowProps, GetCellProps, OnRowClick, RowReorderingProps } from '../../table.types';
3
3
  import { GetAfterRowComponentDef } from '../after-row-component/after-row-component.types';
4
4
  export interface TableRowProps<TData extends RowData> {
@@ -9,4 +9,5 @@ export interface TableRowProps<TData extends RowData> {
9
9
  onRowClick?: OnRowClick<TData>;
10
10
  reordering: RowReorderingProps<TData> | undefined;
11
11
  row: Row<TData>;
12
+ table: Table<TData>;
12
13
  }
@@ -1,4 +1,4 @@
1
- import { Cell, Row, RowData } from '@tanstack/react-table';
1
+ import { Cell, Row, RowData, Table } from '@tanstack/react-table';
2
2
  import { DraggableAttributes } from '@dnd-kit/core';
3
3
  import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
4
4
  import { GetCellProps, RowReorderingProps } from '../../../../table.types';
@@ -12,4 +12,5 @@ export interface TableCellProps<TData extends RowData> {
12
12
  index: number;
13
13
  reordering: RowReorderingProps<TData> | undefined;
14
14
  row: Row<TData>;
15
+ table: Table<TData>;
15
16
  }
@@ -1,4 +1,4 @@
1
- import { Row, RowData } from '@tanstack/react-table';
1
+ import { Row, RowData, Table } from '@tanstack/react-table';
2
2
  import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
3
3
  import { DraggableAttributes } from '@dnd-kit/core';
4
4
  import { GetCellProps, RowReorderingProps } from '../../table.types';
@@ -11,4 +11,5 @@ export interface TableRowCellsProps<TData extends RowData> {
11
11
  reordering: RowReorderingProps<TData> | undefined;
12
12
  row: Row<TData>;
13
13
  size?: number;
14
+ table: Table<TData>;
14
15
  }
@@ -1,9 +1,10 @@
1
- import { HeaderGroup, RowData } from '@tanstack/react-table';
1
+ import { HeaderGroup, RowData, Table } from '@tanstack/react-table';
2
2
  import { TableRowProps } from '../table-row/table-row.types';
3
3
  import { GetHeaderCellProps, RowReorderingProps } from '../../table.types';
4
4
  export interface TableRowOverlayProps<TData extends RowData> extends Pick<TableRowProps<TData>, 'row' | 'getCellProps'> {
5
5
  getHeaderCellProps?: GetHeaderCellProps<TData>;
6
6
  getHeaderGroups?: () => HeaderGroup<TData>[];
7
7
  reordering: RowReorderingProps<TData> | undefined;
8
- table: HTMLElement;
8
+ table: Table<TData>;
9
+ tableEl: HTMLElement;
9
10
  }
@@ -0,0 +1,2 @@
1
+ export declare const dataAttrClearSelected = "data-clear-selected";
2
+ export declare const ClearSelectedRows: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledPointerFlex: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../flex/flex.types").FlexProps & import("react").RefAttributes<import("../../../../../flex/flex.types").FlexProps>>, import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,4 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { RowData } from '@tanstack/react-table';
3
+ import { SelectableRowCellProps } from './selectable-row-cell.types';
4
+ export declare const SelectableRowCell: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowCellProps<TData>>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledCheckboxCell: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../cell/cell.types").CellProps & import("react").RefAttributes<import("../../../../../cell/cell.types").CellProps>>, import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,6 @@
1
+ import { Row, RowData, Table } from '@tanstack/react-table';
2
+ export interface SelectableRowCellProps<TData extends RowData> {
3
+ index: number;
4
+ row: Row<TData>;
5
+ table: Table<TData>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './selectable-table-row-footer';
@@ -0,0 +1,2 @@
1
+ import { SelectableRowFooterProps } from './selectable-table-row-footer.types';
2
+ export declare const SelectableRowFooter: (props: SelectableRowFooterProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { JSXElementConstructor } from 'react';
2
+ export type SelectableRowFooterTypeDef = JSXElementConstructor<SelectableRowFooterProps>;
3
+ export interface SelectableRowFooterProps {
4
+ text: string;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './selectable-table-row-header';
@@ -0,0 +1,4 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { RowData } from '@tanstack/react-table';
3
+ import { SelectableRowHeaderProps } from './selectable-table-row-header.types';
4
+ export declare const SelectableRowHeader: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowHeaderProps<TData>>) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { RowData, Table } from '@tanstack/react-table';
2
+ export interface SelectableRowHeaderProps<TData extends RowData> {
3
+ index: number;
4
+ table: Table<TData>;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { Row, RowData } from '@tanstack/react-table';
2
+ export declare const getRowRange: <TData extends RowData<import("../../../..").CustomTData>>(rows: Row<TData>[], currentId: number, selectedId: number) => Row<TData>[];
@@ -0,0 +1 @@
1
+ export * from './use-selectable-table-rows';
@@ -0,0 +1,6 @@
1
+ export declare const selectableRowsCheckboxSize = "2rem";
2
+ export declare const dataAttrIsRowSelected = "data-is-row-selected";
3
+ export declare const rowSelectionTypes: {
4
+ readonly checkboxes: "checkboxes";
5
+ readonly custom: "custom";
6
+ };
@@ -0,0 +1,10 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ export declare const useSelectableTableRows: <TData extends RowData<import("../..").CustomTData>>() => {
3
+ deselectRows: (rowIds: (string | number)[]) => void;
4
+ getIsRowSelected: (rowId: number | string) => boolean;
5
+ getSelectedRowData: (props: {
6
+ idProperty: keyof TData;
7
+ records: TData[];
8
+ }) => (TData | undefined)[];
9
+ selectRows: (rowIds: (string | number)[]) => void;
10
+ };
@@ -0,0 +1,6 @@
1
+ import { rowSelectionTypes } from './use-selectable-table-rows.constants';
2
+ export interface RowSelection {
3
+ disabled?: boolean;
4
+ type: RowSelectionType;
5
+ }
6
+ export type RowSelectionType = typeof rowSelectionTypes[keyof typeof rowSelectionTypes];
@@ -1,5 +1,6 @@
1
1
  export type { GetAfterRowComponentDef, AfterRowComponentDef, } from './components/after-row-component/after-row-component.types';
2
- export * from './table';
2
+ 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 { useTableContext as useRowSelectionContext } from './table.context';
@@ -0,0 +1,23 @@
1
+ import { RowData, RowSelectionState } from '@tanstack/react-table';
2
+ import React, { PropsWithChildren } from 'react';
3
+ export declare const RowSelectionProviders: ({ children, }: PropsWithChildren<Record<never, never>>) => JSX.Element;
4
+ export declare const useTableContext: () => {
5
+ clearSelectedRows: () => void;
6
+ /** Can be used to deselect rows outside of the default behavior. */
7
+ deselectRows: (rowIds: (string | number)[]) => void;
8
+ getIsRowSelected: (rowId: number | string) => boolean;
9
+ getSelectedRowData: <TData extends RowData<import("./table.types").CustomTData>>(props: {
10
+ idProperty: keyof TData;
11
+ records: TData[];
12
+ }) => (TData | undefined)[];
13
+ isRowSelectionCheckboxes: boolean;
14
+ isRowSelectionDisabled: boolean;
15
+ lastSelectedId: string;
16
+ rowSelectionState: RowSelectionState;
17
+ /** Can be used to select rows outside of the default behavior. */
18
+ selectRows: (rowIds: (string | number)[]) => void;
19
+ setIsRowSelectionCheckboxes: React.Dispatch<React.SetStateAction<boolean>>;
20
+ setIsRowSelectionDisabled: React.Dispatch<React.SetStateAction<boolean>>;
21
+ setLastSelectedId: React.Dispatch<React.SetStateAction<string>>;
22
+ setRowSelectionState: React.Dispatch<React.SetStateAction<RowSelectionState>>;
23
+ };
@@ -0,0 +1,3 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { TableProps } from './table.types';
3
+ export declare const Table: <TData extends RowData<import("./table.types").CustomTData>>(props: TableProps<TData>) => JSX.Element;
@@ -6,6 +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-selectable-table-rows/use-selectable-table-rows.types';
9
10
  export interface RowReorderingProps<TData extends RowData> {
10
11
  disabled?: boolean;
11
12
  getDisableSortableRow?: (row: Row<TData>) => boolean;
@@ -63,6 +64,7 @@ export interface TableProps<TData extends RowData> extends Partial<TableDefaultP
63
64
  options?: Partial<TableOptions<TData>>;
64
65
  paging?: PagingProps;
65
66
  reordering?: RowReorderingProps<TData>;
67
+ rowSelection?: RowSelection;
66
68
  search?: SearchProps;
67
69
  sorting?: SortProps;
68
70
  syncState?: SyncState;