gantri-components 2.56.0 → 2.56.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.
@@ -17,6 +17,7 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
17
17
  /** Can optionally include `disabled: true` to any index to disable that item. */
18
18
  items?: T[];
19
19
  keyProperty?: (option?: T) => string;
20
+ labelPosition?: 'top' | 'left';
20
21
  labelText?: string;
21
22
  labelTx?: string;
22
23
  /**
@@ -38,6 +39,7 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
38
39
  processing?: boolean;
39
40
  processingText?: string;
40
41
  processingTx?: string;
42
+ required?: boolean;
41
43
  resetSelectionOnDisabled?: boolean;
42
44
  /**
43
45
  * If internal, the component will search over the provided list of items,
@@ -48,5 +50,4 @@ export interface SearchFieldProps<T = Record<string, unknown>> extends Omit<Drop
48
50
  selectedItemsList?: (keyof T)[];
49
51
  style?: CSSProperties;
50
52
  variant?: 'line' | 'filled';
51
- labelPosition?: 'top' | 'left';
52
53
  }
@@ -1,6 +1,11 @@
1
1
  import { DragEndEvent, DragStartEvent } from '@dnd-kit/core';
2
+ import { RowData } from '@tanstack/react-table';
2
3
  import { UseDragAndDropRowsProps } from './use-drag-and-drop-rows.types';
3
- export declare const useDragAndDropRows: (props: UseDragAndDropRowsProps) => {
4
+ export declare const useDragAndDropRows: <TData extends RowData<{
5
+ [key: string]: unknown;
6
+ id?: string | number | undefined;
7
+ subRows?: any[] | undefined;
8
+ }>>(props: UseDragAndDropRowsProps<TData>) => {
4
9
  activeIndex: number;
5
10
  handleDragEnd: (event: DragEndEvent) => void;
6
11
  handleDragStart: (event: DragStartEvent) => void;
@@ -1,9 +1,7 @@
1
+ import { RowData } from '@tanstack/react-table';
1
2
  import { RowReorderingProps } from '../../table.types';
2
- export interface DragRowData {
3
- id: string | number;
4
- }
5
- export type UseDragAndDropRowsProps = {
6
- data: DragRowData[];
7
- reordering?: RowReorderingProps<DragRowData> | undefined;
8
- setData: (records: DragRowData[]) => void;
3
+ export type UseDragAndDropRowsProps<TData extends RowData> = {
4
+ data: TData[];
5
+ reordering?: RowReorderingProps<TData> | undefined;
6
+ setData: (records: TData[]) => void;
9
7
  };
@@ -9,11 +9,12 @@ export interface RowReorderingProps<TData extends RowData> {
9
9
  isActive: boolean;
10
10
  isAvailable: boolean;
11
11
  /** Is fired when the dragged element is dropped. */
12
- onReorder: (data: TData[], oldIndex?: number, newIndex?: number) => Promise<void>;
12
+ onReorder: OnReorder<TData>;
13
13
  setIsActive: Dispatch<SetStateAction<boolean>>;
14
14
  tooltipPosition?: OverlayPosition;
15
15
  tooltipText?: string;
16
16
  }
17
+ export type OnReorder<TData extends RowData> = (data: TData[], oldIndex?: number, newIndex?: number) => Promise<void>;
17
18
  export interface ColumnConfig {
18
19
  hidden?: boolean;
19
20
  id?: string;