gantri-components 1.95.1 → 1.96.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.
@@ -1,3 +1,3 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { DropdownProps } from './dropdown.types';
3
- export declare const Dropdown: FC<PropsWithChildren<DropdownProps>>;
3
+ export declare const Dropdown: FC<PropsWithChildren<DropdownProps<any>>>;
@@ -1,2 +1,2 @@
1
1
  import { DropdownProps } from './dropdown.types';
2
- export declare const DropdownPresets: Partial<DropdownProps>;
2
+ export declare const DropdownPresets: Partial<DropdownProps<any>>;
@@ -1,7 +1,7 @@
1
1
  import { ChangeEvent, CSSProperties, FocusEvent, ReactElement } from 'react';
2
2
  import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu.types';
3
3
  import { ErrorMessageType } from '../text-field';
4
- export interface DropdownProps<T = DefaultDropdownRecord> extends Pick<DropdownMenuProps<T>, Exclude<keyof DropdownMenuProps<T>, 'items'>> {
4
+ export interface DropdownProps<T> extends Pick<DropdownMenuProps<T>, Exclude<keyof DropdownMenuProps<T>, 'items'>> {
5
5
  borderless?: boolean;
6
6
  className?: string;
7
7
  disabled?: boolean;
@@ -44,7 +44,7 @@ export interface BlurChangeEvent extends Pick<FocusEvent<HTMLDivElement>, Exclud
44
44
  name: string;
45
45
  };
46
46
  }
47
- export declare type DefaultDropdownRecord = {
47
+ export declare type DefaultDropdownRecord<T extends number | string = string> = {
48
48
  label: string;
49
- value: string | number;
49
+ value: T;
50
50
  };
@@ -1,3 +1,3 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { SearchFieldProps } from './search-field.types';
3
- export declare const SearchField: FC<PropsWithChildren<SearchFieldProps>>;
3
+ export declare const SearchField: FC<PropsWithChildren<SearchFieldProps<any>>>;
@@ -1,2 +1,2 @@
1
1
  import { SearchFieldProps } from './search-field.types';
2
- export declare const SearchFieldPresets: Partial<SearchFieldProps>;
2
+ export declare const SearchFieldPresets: Partial<SearchFieldProps<any>>;
@@ -1,8 +1,8 @@
1
1
  import { CSSProperties, FocusEvent, ReactElement } from 'react';
2
2
  import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu.types';
3
3
  import { ErrorMessageType } from '../text-field';
4
- import { BlurChangeEvent, DefaultDropdownRecord, DropdownChangeEvent } from '../dropdown';
5
- export interface SearchFieldProps<T = DefaultDropdownRecord> extends Pick<DropdownMenuProps<T>, Exclude<keyof DropdownMenuProps<T>, 'items'>> {
4
+ import { BlurChangeEvent, DropdownChangeEvent } from '../dropdown';
5
+ export interface SearchFieldProps<T> extends Pick<DropdownMenuProps<T>, Exclude<keyof DropdownMenuProps<T>, 'items'>> {
6
6
  borderless?: boolean;
7
7
  className?: string;
8
8
  disabled?: boolean;
@@ -27,6 +27,12 @@ export interface SearchFieldProps<T = DefaultDropdownRecord> extends Pick<Dropdo
27
27
  };
28
28
  renderPlaceholder?: (option?: T) => JSX.Element;
29
29
  resetSelectionOnDisabled?: boolean;
30
+ /**
31
+ * If internal, the component will search over the provided list of items,
32
+ * If external, the onTextChange event is emitted, so an external search can be executed
33
+ * the new items must be provided after.
34
+ * */
35
+ searchMode?: 'internal' | 'external';
30
36
  style?: CSSProperties;
31
37
  variant?: 'line' | 'filled';
32
38
  }