import type { ComponentType, ReactNode, JSX } from 'react'; import { type ActionMeta, type CommonPropsAndClassName, type GroupBase, type MenuPlacement, type MenuPosition } from 'react-select'; import { type AsyncCreatableProps } from 'react-select/async-creatable'; type TCustomEvent = { target: { id?: string; name?: string; value?: unknown; }; persist: () => void; }; type ReactSelectAsyncCreatableProps = AsyncCreatableProps>; export type TAsyncCreatableSelectInputProps = { /** * Horizontal size limit of the input fields. */ horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto'; /** * Indicates the input field has an error */ hasError?: boolean; /** * Indicates the input field has a warning */ hasWarning?: boolean; /** * Is the select read-only */ isReadOnly?: boolean; /** * Icon to display on the left of the placeholder text and selected value. Has no effect when isMulti is enabled. */ iconLeft?: ReactNode; /** * Aria label (for assistive tech) *
* [Props from React select was used](https://react-select.com/props) */ 'aria-label'?: ReactSelectAsyncCreatableProps['aria-label']; /** * HTML ID of an element that should be used as the label (for assistive tech) *
* [Props from React select was used](https://react-select.com/props) */ 'aria-labelledby'?: ReactSelectAsyncCreatableProps['aria-labelledby']; /** * Indicate if the value entered in the input is invalid. *
* [Props from React select was used](https://react-select.com/props) */ 'aria-invalid'?: ReactSelectAsyncCreatableProps['aria-invalid']; /** * HTML ID of an element containing an error message related to the input. *
* [Props from React select was used](https://react-select.com/props) */ 'aria-errormessage'?: ReactSelectAsyncCreatableProps['aria-errormessage']; /** * Focus the control when it is mounted */ isAutofocussed?: boolean; /** * Remove the currently focused option when the user presses backspace *
* [Props from React select was used](https://react-select.com/props) */ backspaceRemovesValue?: ReactSelectAsyncCreatableProps['backspaceRemovesValue']; /** * Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components) *
* [Props from React select was used](https://react-select.com/props) */ components?: ReactSelectAsyncCreatableProps['components']; /** * Custom method to filter whether an option should be displayed in the menu *
* [Props from React select was used](https://react-select.com/props) */ filterOption?: ReactSelectAsyncCreatableProps['filterOption']; /** * The id of the search input *
* [Props from React select was used](https://react-select.com/props) */ id?: ReactSelectAsyncCreatableProps['inputId']; /** * The value of the search input *
* [Props from React select was used](https://react-select.com/props) */ inputValue?: ReactSelectAsyncCreatableProps['inputValue']; /** * The id to set on the SelectContainer component *
* [Props from React select was used](https://react-select.com/props) */ containerId?: ReactSelectAsyncCreatableProps['id']; /** * Is the select value clearable *
* [Props from React select was used](https://react-select.com/props) */ isClearable?: ReactSelectAsyncCreatableProps['isClearable']; /** * Use this property to reduce the paddings of the component for a ui compact variant */ isCondensed?: boolean; /** * Is the select disabled *
* [Props from React select was used](https://react-select.com/props) */ isDisabled?: ReactSelectAsyncCreatableProps['isDisabled']; /** * Override the built-in logic to detect whether an option is disabled *
* [Props from React select was used](https://react-select.com/props) */ isOptionDisabled?: ReactSelectAsyncCreatableProps['isOptionDisabled']; /** * Support multiple selected options *
* [Props from React select was used](https://react-select.com/props) */ isMulti?: ReactSelectAsyncCreatableProps['isMulti']; /** * Whether to enable search functionality *
* [Props from React select was used](https://react-select.com/props) */ isSearchable?: ReactSelectAsyncCreatableProps['isSearchable']; /** * Maximum height of the menu before scrolling *
* [Props from React select was used](https://react-select.com/props) */ maxMenuHeight?: ReactSelectAsyncCreatableProps['maxMenuHeight']; /** * Dom element to portal the select menu to *
* [Props from React select was used](https://react-select.com/props) */ menuPortalTarget?: ReactSelectAsyncCreatableProps['menuPortalTarget']; /** * z-index value for the menu portal *
* Use in conjunction with `menuPortalTarget` */ menuPortalZIndex?: number; /** * whether the menu should block scroll while open *
* [Props from React select was used](https://react-select.com/props) */ menuShouldBlockScroll?: ReactSelectAsyncCreatableProps['menuShouldBlockScroll']; /** * Whether the menu should close after a value is selected. Defaults to `true`. *
* [Props from React select was used](https://react-select.com/props) */ closeMenuOnSelect?: ReactSelectAsyncCreatableProps['closeMenuOnSelect']; /** * Name of the HTML Input (optional - without this, no input will be rendered) *
* [Props from React select was used](https://react-select.com/props) */ name?: ReactSelectAsyncCreatableProps['name']; /** * Can be used to render a custom value when there are no options (either because of no search results, or all options have been used, or there were none in the first place). Gets called with `{ inputValue: String }`. `inputValue` will be an empty string when no search text is present. *
* [Props from React select was used](https://react-select.com/props) */ noOptionsMessage?: ReactSelectAsyncCreatableProps['noOptionsMessage']; /** * Handle blur events on the control */ onBlur?: (event: TCustomEvent) => void; /** * Called with a fake event when value changes. The event's `target.name` will be the `name` supplied in props. The event's `target.value` will hold the value. The value will be the selected option, or an array of options in case `isMulti` is `true`. */ onChange?: (event: TCustomEvent, info: ActionMeta) => void; /** * Handle focus events on the control *
* [Props from React select was used](https://react-select.com/props) */ onFocus?: ReactSelectAsyncCreatableProps['onFocus']; /** * Handle change events on the input *
* [Props from React select was used](https://react-select.com/props) */ onInputChange?: ReactSelectAsyncCreatableProps['onInputChange']; /** * Placeholder text for the select value *
* [Props from React select was used](https://react-select.com/props) */ placeholder?: ReactSelectAsyncCreatableProps['placeholder']; /** * Sets the tabIndex attribute on the input *
* [Props from React select was used](https://react-select.com/props) */ tabIndex?: ReactSelectAsyncCreatableProps['tabIndex']; /** * Select the currently focused option when the user presses tab *
* [Props from React select was used](https://react-select.com/props) */ tabSelectsValue?: ReactSelectAsyncCreatableProps['tabSelectsValue']; /** * The value of the select; reflected by the selected option *
* [Props from React select was used](https://react-select.com/props) */ value?: ReactSelectAsyncCreatableProps['value']; /** * The default set of options to show before the user starts searching. When set to true, the results for loadOptions('') will be autoloaded. *
* [Props from React select was used](https://react-select.com/props) */ defaultOptions?: ReactSelectAsyncCreatableProps['defaultOptions']; /** * Function that returns a promise, which is the set of options to be used once the promise resolves. *
* [Props from React select was used](https://react-select.com/props) */ loadOptions: ReactSelectAsyncCreatableProps['loadOptions']; /** * If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value. *
* [Props from React select was used](https://react-select.com/props) */ cacheOptions?: ReactSelectAsyncCreatableProps['cacheOptions']; /** * Allow options to be created while the isLoading prop is true. Useful to prevent the "create new ..." option being displayed while async results are still being loaded. *
* [Props from React select was used](https://react-select.com/props) */ allowCreateWhileLoading?: ReactSelectAsyncCreatableProps['allowCreateWhileLoading']; /** * Gets the label for the "create new ..." option in the menu. Is given the current input value. *
* [Props from React select was used](https://react-select.com/props) */ formatCreateLabel?: ReactSelectAsyncCreatableProps['formatCreateLabel']; /** * Determines whether the "create new ..." option should be displayed based on the current input value, select value and options array. *
* [Props from React select was used](https://react-select.com/props) */ isValidNewOption?: ReactSelectAsyncCreatableProps['isValidNewOption']; /** * Returns the data for the new option when it is created. Used to display the value, and is passed to onChange. *
* [Props from React select was used](https://react-select.com/props) */ getNewOptionData?: ReactSelectAsyncCreatableProps['getNewOptionData']; /** * If provided, this will be called with the input value when a new option is created, and onChange will not be called. Use this when you need more control over what happens when new options are created. *
* [Props from React select was used](https://react-select.com/props) */ onCreateOption?: ReactSelectAsyncCreatableProps['onCreateOption']; /** * Sets the position of the createOption element in your options list. *
* [Props from React select was used](https://react-select.com/props) */ createOptionPosition?: ReactSelectAsyncCreatableProps['createOptionPosition']; /** * Determines if option groups will be separated by a divider */ showOptionGroupDivider?: boolean; }; declare const AsyncCreatableSelectInput: { ({ value, isSearchable, menuPortalZIndex, ...props }: TAsyncCreatableSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; isTouched(touched: unknown): boolean; /** * Expose react-select components for customization purposes. */ ClearIndicator: { (props: import("@commercetools-uikit/select-utils").TClearIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; }; Control: >(props: import("react-select").ControlProps) => import("@emotion/react").jsx.JSX.Element; CrossIcon: ComponentType & { size?: number; }>; DownChevron: ComponentType & { size?: number; }>; DropdownIndicator: { (props: import("react-select").DropdownIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; }; Group: >(props: import("react-select").GroupProps) => import("@emotion/react").jsx.JSX.Element; GroupHeading: >(props: import("react-select").GroupHeadingProps) => import("@emotion/react").jsx.JSX.Element; IndicatorSeparator: >(props: import("react-select").IndicatorSeparatorProps) => import("@emotion/react").jsx.JSX.Element; IndicatorsContainer: >(props: import("react-select").IndicatorsContainerProps) => import("@emotion/react").jsx.JSX.Element; Input: >(props: import("react-select").InputProps) => import("@emotion/react").jsx.JSX.Element; LoadingIndicator: { (): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; }; LoadingMessage: >({ children, innerProps, ...restProps }: import("react-select").NoticeProps) => import("@emotion/react").jsx.JSX.Element; Menu: >(props: import("react-select").MenuProps) => import("@emotion/react").jsx.JSX.Element; MenuList: >(props: import("react-select").MenuListProps) => import("@emotion/react").jsx.JSX.Element; MenuPortal: ComponentType> & { appendTo: HTMLElement | undefined; children: ReactNode; controlElement: HTMLDivElement | null; innerProps: JSX.IntrinsicElements["div"]; menuPlacement: MenuPlacement; menuPosition: MenuPosition; }>; MultiValue: >(props: import("react-select").MultiValueProps) => import("@emotion/react").jsx.JSX.Element; MultiValueContainer: >({ children, innerProps, }: import("react-select").MultiValueGenericProps) => import("@emotion/react").jsx.JSX.Element; MultiValueLabel: >({ children, innerProps, }: import("react-select").MultiValueGenericProps) => import("@emotion/react").jsx.JSX.Element; MultiValueRemove: { (props: import("@commercetools-uikit/select-utils").TTagRemoveProps): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; }; NoOptionsMessage: >({ children, innerProps, ...restProps }: import("react-select").NoticeProps) => import("@emotion/react").jsx.JSX.Element; Option: >(props: import("react-select").OptionProps) => import("@emotion/react").jsx.JSX.Element; Placeholder: >(props: import("react-select").PlaceholderProps) => import("@emotion/react").jsx.JSX.Element; SelectContainer: >(props: import("react-select").ContainerProps) => import("@emotion/react").jsx.JSX.Element; SingleValue: >(props: import("react-select").SingleValueProps) => import("@emotion/react").jsx.JSX.Element; ValueContainer: >(props: import("react-select").ValueContainerProps) => import("@emotion/react").jsx.JSX.Element; }; export default AsyncCreatableSelectInput;