import { SelectHTMLAttributes } from "react"; import { FormControlProps } from "../form-control/FormControl"; export interface SelectOptionBaseProps extends Record { label: string | JSX.Element; value: string; id?: string; disabled?: boolean; note?: string | JSX.Element; group?: string; data?: Data; template?: (item: SelectOptionProps) => JSX.Element; } export interface SelectOptionProps extends SelectOptionBaseProps { options?: SelectOptionProps[]; } export interface SelectProps extends FormControlProps> { layout?: "html5" | "react" | "choicesjs"; /** * Error message */ errorMessage?: string; readonly?: boolean; disableSearch?: boolean; searchEnabled?: boolean; customProperties?: Record; options: (SelectOptionBaseProps | Omit, "value">)[]; } export interface SelectSingle extends SelectProps { multiple?: false | undefined; } export interface SelectMultiple extends SelectProps { multiple: true; } export type AllSelectProps = SelectSingle | SelectMultiple;