stratosphere-ui 2.2.6 → 2.3.1
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.
|
@@ -5,24 +5,28 @@ import { UseTypeaheadQueryOptions } from '../../hooks';
|
|
|
5
5
|
import { BadgeColor } from '../Badge';
|
|
6
6
|
import { FormFieldProps, FormValueMode, InputColor, InputSize } from '../Form';
|
|
7
7
|
import { MenuSize } from '../Menu';
|
|
8
|
-
export interface TypeaheadSelectProps<DataItem extends GenericDataType, Values extends FieldValues> extends UseTypeaheadQueryOptions
|
|
8
|
+
export interface TypeaheadSelectProps<DataItem extends GenericDataType, Values extends FieldValues> extends UseTypeaheadQueryOptions, FormFieldProps<Values> {
|
|
9
9
|
badgeColor?: BadgeColor;
|
|
10
10
|
bordered?: boolean;
|
|
11
11
|
color?: InputColor;
|
|
12
12
|
className?: string;
|
|
13
|
-
|
|
13
|
+
defaultShowDropdown?: boolean;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
disableSingleSelectBadge?: true;
|
|
16
|
+
dropdownInputClassName?: string;
|
|
16
17
|
formValueMode?: FormValueMode;
|
|
17
18
|
getBadgeClassName?: (item: DataItem) => string;
|
|
18
19
|
getBadgeText?: (item: DataItem) => ReactNode;
|
|
19
20
|
getItemText: (data: DataItem) => ReactNode;
|
|
20
21
|
inputClassName?: string;
|
|
21
22
|
inputPlaceholder?: string;
|
|
23
|
+
isLoading?: boolean;
|
|
22
24
|
menuClassName?: string;
|
|
23
25
|
menuSize?: MenuSize;
|
|
24
26
|
multi?: true;
|
|
25
27
|
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
28
|
+
onShowDropdown?: (showDropdown: boolean) => void;
|
|
29
|
+
options?: DataItem[];
|
|
26
30
|
size?: InputSize;
|
|
27
31
|
}
|
|
28
|
-
export declare const TypeaheadSelect: <DataItem extends GenericDataType, Values extends FieldValues>({ badgeColor, bordered, className, color, controllerProps, debounceTime, disabled, disableSingleSelectBadge, dropdownInputClassName, formValueMode, getBadgeClassName, getBadgeText, getItemText, inputClassName, inputPlaceholder, isRequired, labelText, menuClassName, menuSize, multi, name, onDebouncedChange, onKeyDown, options: optionsArray, placeholder, showDirty, size, }: TypeaheadSelectProps<DataItem, Values>) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const TypeaheadSelect: <DataItem extends GenericDataType, Values extends FieldValues>({ badgeColor, bordered, className, color, controllerProps, debounceTime, defaultShowDropdown, disabled, disableSingleSelectBadge, dropdownInputClassName, formValueMode, getBadgeClassName, getBadgeText, getItemText, inputClassName, inputPlaceholder, isLoading, isRequired, labelText, menuClassName, menuSize, multi, name, onDebouncedChange, onKeyDown, onShowDropdown, options: optionsArray, placeholder, showDirty, size, }: TypeaheadSelectProps<DataItem, Values>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
2
|
import { GenericDataType } from '../../common';
|
|
3
3
|
import { TypeaheadSelectProps } from './TypeaheadSelect';
|
|
4
|
-
export type UseTypeaheadSelectOptions<DataItem extends GenericDataType, Values extends FieldValues> = Pick<TypeaheadSelectProps<DataItem, Values>, 'debounceTime' | 'onDebouncedChange' | '
|
|
5
|
-
export declare const useTypeaheadSelect: <DropdownElement extends HTMLElement, DataItem extends GenericDataType, Values extends FieldValues>({ debounceTime, onDebouncedChange,
|
|
4
|
+
export type UseTypeaheadSelectOptions<DataItem extends GenericDataType, Values extends FieldValues> = Pick<TypeaheadSelectProps<DataItem, Values>, 'debounceTime' | 'defaultShowDropdown' | 'onDebouncedChange' | 'onShowDropdown'>;
|
|
5
|
+
export declare const useTypeaheadSelect: <DropdownElement extends HTMLElement, DataItem extends GenericDataType, Values extends FieldValues>({ debounceTime, defaultShowDropdown, onDebouncedChange, onShowDropdown, }: UseTypeaheadSelectOptions<DataItem, Values>) => {
|
|
6
6
|
clearSelectedItem: (index: number) => void;
|
|
7
7
|
dropdownRef: import('react').RefObject<DropdownElement>;
|
|
8
|
-
isLoading: boolean;
|
|
9
8
|
query: string;
|
|
10
9
|
showDropdown: boolean;
|
|
11
10
|
searchInputRef: import('react').MutableRefObject<HTMLInputElement | null>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface UseTypeaheadQueryOptions<DataItem> {
|
|
2
|
+
export interface UseTypeaheadQueryOptions {
|
|
4
3
|
debounceTime?: number;
|
|
5
4
|
onDebouncedChange?: (value: string) => void;
|
|
6
|
-
options?: DataItem[];
|
|
7
5
|
}
|
|
8
6
|
export interface UseTypeaheadQueryResult {
|
|
9
|
-
isLoading: boolean;
|
|
10
7
|
query: string;
|
|
11
8
|
setQuery: Dispatch<SetStateAction<string>>;
|
|
12
9
|
}
|
|
13
|
-
export declare const useTypeaheadQuery:
|
|
10
|
+
export declare const useTypeaheadQuery: ({ debounceTime, onDebouncedChange, }: UseTypeaheadQueryOptions) => UseTypeaheadQueryResult;
|