gantri-components 2.42.0-beta.2 → 2.42.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.
Files changed (48) hide show
  1. package/dist/components/filter-button/filter-button.types.d.ts +1 -1
  2. package/dist/components/table/components/custom-columns-wrapper/custom-columns-wrapper.styles.d.ts +0 -1
  3. package/dist/components/table/components/custom-columns-wrapper/custom-columns-wrapper.types.d.ts +1 -0
  4. package/dist/components/table/components/custom-columns-wrapper/hooks/index.d.ts +1 -1
  5. package/dist/components/table/components/custom-columns-wrapper/hooks/useDetectHorizontalScroll.d.ts +6 -0
  6. package/dist/components/table/components/index.d.ts +3 -0
  7. package/dist/components/table/components/table-actions-wrapper/components/paging/paging.types.d.ts +1 -1
  8. package/dist/components/table/components/table-actions-wrapper/components/search/search.types.d.ts +1 -1
  9. package/dist/components/table/components/table-actions-wrapper/components/sort/sort.types.d.ts +1 -1
  10. package/dist/components/table/components/table-actions-wrapper/hooks/index.d.ts +1 -1
  11. package/dist/components/table/components/table-actions-wrapper/hooks/useConfirmInteraction.d.ts +16 -0
  12. package/dist/components/table/components/table-draggable-row/index.d.ts +1 -0
  13. package/dist/components/table/components/table-draggable-row/table-draggable-row.d.ts +7 -0
  14. package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts +4 -0
  15. package/dist/components/table/components/table-draggable-row/table-draggable-row.types.d.ts +4 -0
  16. package/dist/components/table/components/table-header/table-header.styles.d.ts +3 -0
  17. package/dist/components/table/components/table-header/table-header.types.d.ts +2 -0
  18. package/dist/components/table/components/table-row/table-row.styles.d.ts +1 -4
  19. package/dist/components/table/components/table-row/table-row.types.d.ts +3 -7
  20. package/dist/components/table/components/table-row-cells/index.d.ts +1 -0
  21. package/dist/components/table/components/table-row-cells/table-row-cells.d.ts +7 -0
  22. package/dist/components/table/components/table-row-cells/table-row-cells.styles.d.ts +2 -0
  23. package/dist/components/table/components/table-row-cells/table-row-cells.types.d.ts +5 -0
  24. package/dist/components/table/components/table-row-overlay/index.d.ts +1 -0
  25. package/dist/components/table/components/table-row-overlay/table-row-overlay.d.ts +7 -0
  26. package/dist/components/table/components/table-row-overlay/table-row-overlay.styles.d.ts +1 -0
  27. package/dist/components/table/components/table-row-overlay/table-row-overlay.types.d.ts +8 -0
  28. package/dist/components/table/hooks/index.d.ts +2 -2
  29. package/dist/components/table/hooks/useMoveRow.d.ts +14 -0
  30. package/dist/components/table/hooks/useTrackStickyCells.d.ts +16 -0
  31. package/dist/components/table/table.d.ts +1 -4
  32. package/dist/components/table/table.styles.d.ts +5 -3
  33. package/dist/components/table/table.types.d.ts +1 -1
  34. package/dist/index.cjs.js +1 -1
  35. package/dist/index.esm.js +1 -1
  36. package/dist/index.umd.js +1 -1
  37. package/package.json +3 -7
  38. package/dist/components/icon/generated/ui-control/ExlamationCircleFilled.d.ts +0 -3
  39. package/dist/components/icon/generated/ui-control/ExlamationCircleFilled24.d.ts +0 -3
  40. package/dist/components/paging/__tests__/paging.test.d.ts +0 -1
  41. package/dist/components/paging/index.d.ts +0 -1
  42. package/dist/components/paging/paging.d.ts +0 -5
  43. package/dist/components/paging/paging.presets.d.ts +0 -2
  44. package/dist/components/paging/paging.styles.d.ts +0 -3
  45. package/dist/components/paging/paging.types.d.ts +0 -13
  46. package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-mapping/get-sort-mapping.d.ts +0 -3
  47. package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-mapping/get-sort-mapping.types.d.ts +0 -2
  48. package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-mapping/index.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
2
2
  import { ButtonSize } from '../button/button.types';
3
- import { OnConfirmInteraction } from '../table/components/table-actions-wrapper/hooks/use-confirm-interaction/use-confirm-interaction.types';
3
+ import { OnConfirmInteraction } from '../table/components/table-actions-wrapper/hooks';
4
4
  export interface FilterButtonProps {
5
5
  Content?: JSX.Element;
6
6
  applyButtonText?: string;
@@ -1,4 +1,3 @@
1
- export declare const StyledTableContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
1
  export declare const StyledToggleWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
2
  isScrolling: boolean;
4
3
  }, never>;
@@ -15,4 +15,5 @@ export interface CustomColumnOption {
15
15
  export type CustomColumnsWrapperProps<TData extends RowData> = PropsWithChildren<{
16
16
  customColumns: CustomColumnsProps<TData> | undefined;
17
17
  table: Table<TData>;
18
+ tableContainerEl: HTMLDivElement | null;
18
19
  }>;
@@ -1 +1 @@
1
- export * from './use-detect-horizontal-scroll';
1
+ export * from './useDetectHorizontalScroll';
@@ -0,0 +1,6 @@
1
+ export declare const useDetectHorizontalScroll: (props: {
2
+ element: HTMLElement | null;
3
+ enabled: boolean;
4
+ onEndScrolling: () => void;
5
+ onStartScrolling: () => void;
6
+ }) => void;
@@ -1,5 +1,8 @@
1
1
  export * from './custom-columns-wrapper';
2
+ export * from './table-draggable-row';
2
3
  export * from './table-actions-wrapper';
3
4
  export * from './table-footer';
4
5
  export * from './table-header';
5
6
  export * from './table-row';
7
+ export * from './table-row-cells';
8
+ export * from './table-row-overlay';
@@ -1,4 +1,4 @@
1
- import { OnConfirmInteraction } from '../../hooks/use-confirm-interaction/use-confirm-interaction.types';
1
+ import { OnConfirmInteraction } from '../../hooks';
2
2
  export interface PagingProps {
3
3
  currentPage: number;
4
4
  onPageChange: (page: number) => void;
@@ -1,5 +1,5 @@
1
1
  import { TextFieldProps } from '../../../../../text-field';
2
- import { OnConfirmInteraction } from '../../hooks/use-confirm-interaction/use-confirm-interaction.types';
2
+ import { OnConfirmInteraction } from '../../hooks';
3
3
  export interface SearchProps extends Partial<SearchDefaultProps> {
4
4
  onChange: TextFieldProps['onTextChange'];
5
5
  }
@@ -1,4 +1,4 @@
1
- import { OnConfirmInteraction } from '../../hooks/use-confirm-interaction/use-confirm-interaction.types';
1
+ import { OnConfirmInteraction } from '../../hooks';
2
2
  export interface SortProps {
3
3
  current: SortInfo;
4
4
  disabled?: boolean;
@@ -1 +1 @@
1
- export * from './use-confirm-interaction';
1
+ export * from './useConfirmInteraction';
@@ -0,0 +1,16 @@
1
+ import { RowData, Table } from '@tanstack/react-table';
2
+ export type TableInteraction = 'FOCUS_SEARCH' | 'OPEN_FILTERS' | 'OPEN_SORT' | 'USE_PAGING' | 'CUSTOM_ACTION';
3
+ export interface UseConfirmInteractionProps<TData extends RowData> {
4
+ table: Table<TData>;
5
+ }
6
+ export type OnConfirmInteraction = (interaction: TableInteraction) => Promise<boolean>;
7
+ export declare const useConfirmInteraction: <TData extends RowData<{
8
+ [key: string]: unknown;
9
+ id?: string | number | undefined;
10
+ subRows?: any[] | undefined;
11
+ }>>(props: UseConfirmInteractionProps<TData>) => {
12
+ /** Not necessary for `onConfirmInteraction`. Only provided in case additional logic is needed. */
13
+ confirmAllInteractions: boolean;
14
+ /** If applicable, renders a discard selections confirmation modal when called. */
15
+ onConfirmInteraction: OnConfirmInteraction;
16
+ };
@@ -0,0 +1 @@
1
+ export * from './table-draggable-row';
@@ -0,0 +1,7 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { DraggableRowProps } from './table-draggable-row.types';
3
+ export declare const TableDraggableRow: <TData extends RowData<{
4
+ [key: string]: unknown;
5
+ id?: string | number | undefined;
6
+ subRows?: any[] | undefined;
7
+ }>>(props: DraggableRowProps<TData>) => JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const StyledDraggableRowTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
2
+ reorderEnabled: boolean;
3
+ }, never>;
4
+ export declare const StyledDraggableRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,4 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { TableRowProps } from '../table-row/table-row.types';
3
+ export interface DraggableRowProps<TData extends RowData> extends TableRowProps<TData> {
4
+ }
@@ -1,3 +1,6 @@
1
1
  export declare const StyledTH: import("styled-components").StyledComponent<"th", import("styled-components").DefaultTheme, {
2
2
  size: number;
3
3
  }, never>;
4
+ export declare const StyledReorderWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
5
+ active: boolean;
6
+ }, never>;
@@ -2,5 +2,7 @@ import { RowData, Table } from '@tanstack/react-table';
2
2
  import { GetHeaderCellProps } from '../../table.types';
3
3
  export type TableHeaderProps<TData extends RowData> = {
4
4
  getHeaderCellProps: GetHeaderCellProps<TData> | undefined;
5
+ reorderEnabled?: boolean;
6
+ reorderable: boolean;
5
7
  table: Table<TData>;
6
8
  };
@@ -1,6 +1,3 @@
1
1
  import { CustomCellProps } from '../../table.types';
2
- export declare const StyledTR: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
3
- canReorder: boolean;
4
- isDragging: boolean | undefined;
5
- }, never>;
2
+ export declare const StyledTD: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, CustomCellProps, never>;
6
3
  export declare const StyledTD: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, CustomCellProps, never>;
@@ -1,15 +1,11 @@
1
1
  import { Row, RowData } from '@tanstack/react-table';
2
- import { Dispatch, SetStateAction } from 'react';
3
2
  import { CustomRowProps, GetCellProps, OnRowClick } from '../../table.types';
4
3
  export interface TableRowProps<TData extends RowData> {
5
4
  customRowProps: CustomRowProps;
6
- didMove: boolean;
7
- enableReordering: boolean;
8
5
  getCellProps: GetCellProps<TData> | undefined;
9
- handleOnReorder: () => Promise<void>;
10
- index: number;
11
- moveRow: (startIndex: number, endIndex: number) => void;
6
+ index?: number;
12
7
  onRowClick?: OnRowClick<TData>;
8
+ reorderEnabled?: boolean;
9
+ reorderable?: boolean;
13
10
  row: Row<TData>;
14
- setDidMove: Dispatch<SetStateAction<boolean>>;
15
11
  }
@@ -0,0 +1 @@
1
+ export * from './table-row-cells';
@@ -0,0 +1,7 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { TableRowCellsProps } from './table-row-cells.types';
3
+ export declare const TableRowCells: <TData extends RowData<{
4
+ [key: string]: unknown;
5
+ id?: string | number | undefined;
6
+ subRows?: any[] | undefined;
7
+ }>>(props: TableRowCellsProps<TData>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { CustomCellProps } from '../../table.types';
2
+ export declare const StyledTd: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, CustomCellProps, never>;
@@ -0,0 +1,5 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { TableRowProps } from '../table-row/table-row.types';
3
+ export interface TableRowCellsProps<TData extends RowData> extends Pick<TableRowProps<TData>, 'row' | 'getCellProps' | 'reorderEnabled' | 'reorderable'> {
4
+ size?: number;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './table-row-overlay';
@@ -0,0 +1,7 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { TableRowOverlayProps } from './table-row-overlay.types';
3
+ export declare const TableRowOverlay: <TData extends RowData<{
4
+ [key: string]: unknown;
5
+ id?: string | number | undefined;
6
+ subRows?: any[] | undefined;
7
+ }>>(props: TableRowOverlayProps<TData>) => JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const StyledRowOverlay: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,8 @@
1
+ import { HeaderGroup, RowData } from '@tanstack/react-table';
2
+ import { TableRowProps } from '../table-row/table-row.types';
3
+ import { GetHeaderCellProps } from '../../table.types';
4
+ export interface TableRowOverlayProps<TData extends RowData> extends Pick<TableRowProps<TData>, 'row' | 'getCellProps'> {
5
+ getHeaderCellProps?: GetHeaderCellProps<TData>;
6
+ getHeaderGroups?: () => HeaderGroup<TData>[];
7
+ table: HTMLElement;
8
+ }
@@ -1,2 +1,2 @@
1
- export * from './use-move-row';
2
- export * from './use-track-sticky-cells';
1
+ export * from './useMoveRow';
2
+ export * from './useTrackStickyCells';
@@ -0,0 +1,14 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { Dispatch, SetStateAction } from 'react';
3
+ export interface UseMoveRowProps<TData extends RowData> {
4
+ setData: Dispatch<SetStateAction<TData[]>>;
5
+ }
6
+ export declare const useMoveRow: <TData extends RowData<{
7
+ [key: string]: unknown;
8
+ id?: string | number | undefined;
9
+ subRows?: any[] | undefined;
10
+ }>>(props: UseMoveRowProps<TData>) => {
11
+ didMove: boolean;
12
+ moveRow: (startIndex: number, endIndex: number) => void;
13
+ setDidMove: Dispatch<SetStateAction<boolean>>;
14
+ };
@@ -0,0 +1,16 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { CustomColumnsProps } from '../components/custom-columns-wrapper/custom-columns-wrapper.types';
3
+ export interface UseTrackStickyCellsProps<TData extends RowData> {
4
+ customColumns: CustomColumnsProps<TData> | undefined;
5
+ numRows: number;
6
+ /** The containing element that the child will intersect with. */
7
+ root: Element | null;
8
+ stickyFirstColumn: boolean | undefined;
9
+ stickyLastColumn: boolean | undefined;
10
+ }
11
+ /** Mark table if header and/or first column cells are sticky. */
12
+ export declare const useTrackStickyCells: <TData extends RowData<{
13
+ [key: string]: unknown;
14
+ id?: string | number | undefined;
15
+ subRows?: any[] | undefined;
16
+ }>>(props: UseTrackStickyCellsProps<TData>) => void;
@@ -1,9 +1,6 @@
1
1
  import { RowData } from '@tanstack/react-table';
2
2
  import { TableProps } from './table.types';
3
- /**
4
- * See https://components.gantri.com/?path=/story/core-table for usage examples.
5
- * Official docs: https://tanstack.com/table/v8/docs/guide/overview
6
- */
3
+ /** Official docs: https://tanstack.com/table/v8/docs/guide/overview */
7
4
  export declare const Table: {
8
5
  <TData extends RowData<{
9
6
  [key: string]: unknown;
@@ -1,5 +1,5 @@
1
- export declare const StyledTableContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- export declare const useTableRowBackgroundColors: () => {
1
+ import { DefaultTheme } from 'styled-components';
2
+ export declare const getTableRowBackgroundColors: (theme: DefaultTheme) => {
3
3
  readonly statusErrorClickableHoverColor: string;
4
4
  readonly statusErrorColor: string;
5
5
  readonly statusNoneClickableHoverColor: string;
@@ -7,6 +7,8 @@ export declare const useTableRowBackgroundColors: () => {
7
7
  readonly statusWarningClickableHoverColor: string;
8
8
  readonly statusWarningColor: string;
9
9
  };
10
- export declare const StyledTable: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {
10
+ export declare const StyledTableWrapper: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
11
+ export declare const StyledTableContainer: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
12
+ export declare const StyledTable: import("styled-components").StyledComponent<"table", DefaultTheme, {
11
13
  isCustomColumnsEnabled: boolean;
12
14
  }, never>;
@@ -28,7 +28,7 @@ export interface TableProps<TData extends RowData> extends Partial<TableDefaultP
28
28
  reordering?: {
29
29
  enable: boolean;
30
30
  /** Is fired when the dragged element is dropped. */
31
- onReorder: (data: TData[]) => Promise<void>;
31
+ onReorder: (data: TData[], oldIndex?: number, newIndex?: number) => Promise<void>;
32
32
  };
33
33
  search?: SearchProps;
34
34
  sorting?: SortProps;