UNPKG

@porsche-design-system/components-react

Version:

Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.

153 lines (152 loc) 4.63 kB
import type { BaseProps } from '../../BaseProps'; import type { SelectDropdownDirection, BreakpointCustomizable, SelectChangeEventDetail, SelectToggleEventDetail, SelectUpdateEventDetail, SelectState, Theme } from '../types'; export type PSelectProps = BaseProps & { /** * Displays as compact version. */ compact?: boolean; /** * The description text. */ description?: string; /** * Disables the select. */ disabled?: boolean; /** * Changes the direction to which the dropdown list appears. */ dropdownDirection?: SelectDropdownDirection; /** * Shows an input in the dropdown allowing options to be filtered. Will be ignored if the `filter` slot is used. */ filter?: boolean; /** * The id of a form element the select should be associated with. */ form?: string; /** * Show or hide label. For better accessibility it is recommended to show the label. */ hideLabel?: BreakpointCustomizable<boolean>; /** * The label text. */ label?: string; /** * The message styled depending on validation state. */ message?: string; /** * The name of the control. */ name: string; /** * Emitted when the select has lost focus. */ onBlur?: (event: CustomEvent<void>) => void; /** * Emitted when the selection is changed. */ onChange?: (event: CustomEvent<SelectChangeEventDetail>) => void; /** * Emitted when the dropdown is toggled. */ onToggle?: (event: CustomEvent<SelectToggleEventDetail>) => void; /** * @deprecated since v3.30.0, will be removed with next major release, use `change` event instead. Emitted when the selection is changed. */ onUpdate?: (event: CustomEvent<SelectUpdateEventDetail>) => void; /** * A Boolean attribute indicating that an option with a non-empty string value must be selected. */ required?: boolean; /** * The validation state. */ state?: SelectState; /** * Adapts the select color depending on the theme. */ theme?: Theme; /** * The selected value. */ value?: string; }; export declare const PSelect: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & { /** * Displays as compact version. */ compact?: boolean; /** * The description text. */ description?: string; /** * Disables the select. */ disabled?: boolean; /** * Changes the direction to which the dropdown list appears. */ dropdownDirection?: SelectDropdownDirection; /** * Shows an input in the dropdown allowing options to be filtered. Will be ignored if the `filter` slot is used. */ filter?: boolean; /** * The id of a form element the select should be associated with. */ form?: string; /** * Show or hide label. For better accessibility it is recommended to show the label. */ hideLabel?: BreakpointCustomizable<boolean>; /** * The label text. */ label?: string; /** * The message styled depending on validation state. */ message?: string; /** * The name of the control. */ name: string; /** * Emitted when the select has lost focus. */ onBlur?: (event: CustomEvent<void>) => void; /** * Emitted when the selection is changed. */ onChange?: (event: CustomEvent<SelectChangeEventDetail>) => void; /** * Emitted when the dropdown is toggled. */ onToggle?: (event: CustomEvent<SelectToggleEventDetail>) => void; /** * @deprecated since v3.30.0, will be removed with next major release, use `change` event instead. Emitted when the selection is changed. */ onUpdate?: (event: CustomEvent<SelectUpdateEventDetail>) => void; /** * A Boolean attribute indicating that an option with a non-empty string value must be selected. */ required?: boolean; /** * The validation state. */ state?: SelectState; /** * Adapts the select color depending on the theme. */ theme?: Theme; /** * The selected value. */ value?: string; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;