API reference: @salmonui/dropdowns/tree-select
TreeSelectSinglePropsinterface
import type { TreeSelectSingleProps } from '@salmonui/dropdowns/tree-select';interface TreeSelectSingleProps<Item> extends TreeSelectOwnProps<Item> {
readonly multiple?: false;
readonly value?: DropdownValue | null;
readonly defaultValue?: DropdownValue | null;
readonly onValueChange?: (value: DropdownValue | null, event: DropdownValueChangeEvent<Item>) => void;
}
| Name | Signature | Description |
|---|---|---|
multipleoptional | readonly multiple?: false; | |
valueoptional | readonly value?: DropdownValue | null; | |
defaultValueoptional | readonly defaultValue?: DropdownValue | null; | |
onValueChangeoptional | readonly onValueChange?: (value: DropdownValue | null, event: DropdownValueChangeEvent<Item>) => void; | |
datainherited | data: readonly Item[]; | Items: nested ( |
getItemValueoptionalinherited | getItemValue?: ((item: Item) => TreeSelectValue); | Default: |
getItemLabeloptionalinherited | getItemLabel?: ((item: Item) => string); | Default: |
getChildrenoptionalinherited | getChildren?: ((item: Item) => readonly Item[] | null | undefined); | Nested data: the children of an item. Default |
getParentIdoptionalinherited | getParentId?: ((item: Item) => TreeSelectValue | null | undefined); | Flat (self-referential) data: the parent value of an item; replaces |
hasChildrenoptionalinherited | hasChildren?: ((item: Item) => boolean); | Shows an expand twisty before the children are known; expanding then calls |
loadChildrenoptionalinherited | loadChildren?: ((item: Item, options: { readonly signal: AbortSignal; }) => Promise<readonly Item[]>); | Load on demand: the children of |
onLoadErroroptionalinherited | onLoadError?: ((error: unknown, item: Item) => void); | |
isItemDisabledoptionalinherited | isItemDisabled?: ((item: Item) => boolean); | Default: |
isItemSelectableoptionalinherited | isItemSelectable?: ((item: Item) => boolean); | Nodes that cannot be chosen still expand (default: every enabled node). |
getItemIconoptionalinherited | getItemIcon?: ((item: Item) => ReactNode); | |
getItemPropsoptionalinherited | getItemProps?: ((item: Item) => (DropdownPartProps & { readonly title?: string | undefined; }) | undefined); | Pure per-item props merged onto the rendered |
selectedItemsoptionalinherited | selectedItems?: readonly Item[]; | Items of the current value that are not in loaded |
expandedoptionalinherited | expanded?: readonly TreeSelectValue[]; | |
defaultExpandedoptionalinherited | defaultExpanded?: readonly TreeSelectValue[]; | |
onExpandedChangeoptionalinherited | onExpandedChange?: ((expanded: readonly TreeSelectValue[], event: TreeSelectExpandedChangeEvent<Item>) => void); | |
expandOnoptionalinherited | expandOn?: TreeSelectExpandOn; | |
openoptionalinherited | open?: boolean; | |
defaultOpenoptionalinherited | defaultOpen?: boolean; | |
onOpenChangeoptionalinherited | onOpenChange?: ((open: boolean, event: DropdownOpenChangeEvent) => void); | |
popupModeoptionalinherited | popupMode?: "auto" | "popover" | "sheet"; |
|
searchableoptionalinherited | searchable?: boolean; | A search field in the popup; matches keep their ancestors visible. |
searchPlaceholderoptionalinherited | searchPlaceholder?: string; | |
searchOperatoroptionalinherited | searchOperator?: "contains" | "endsWith" | "startsWith" | ((item: Item, text: string) => boolean); | |
matchCaseoptionalinherited | matchCase?: boolean; | |
ignoreAccentsoptionalinherited | ignoreAccents?: boolean; | |
onSearchChangeoptionalinherited | onSearchChange?: ((text: string, event: { readonly source: DropdownEventSource; }) => void); | |
indicatoroptionalinherited | indicator?: "check" | "checkbox"; |
|
checkPropagationoptionalinherited | checkPropagation?: "cascade" | "none"; | Checks of a parent and its descendants follow each other (default |
showSelectAlloptionalinherited | showSelectAll?: boolean; | |
closeOnSelectoptionalinherited | closeOnSelect?: boolean; | |
valueDisplayoptionalinherited | valueDisplay?: "chips" | "count" | "text"; | |
maxVisibleValuesoptionalinherited | maxVisibleValues?: number; | |
valueSeparatoroptionalinherited | valueSeparator?: string; | |
showTriggeroptionalinherited | showTrigger?: boolean; | |
clearableoptionalinherited | clearable?: boolean; | |
placeholderoptionalinherited | placeholder?: string; | |
disabledoptionalinherited | disabled?: boolean; | |
readOnlyoptionalinherited | readOnly?: boolean; | |
nameoptionalinherited | name?: string; | |
requiredoptionalinherited | required?: boolean; | |
formoptionalinherited | form?: string; | |
idoptionalinherited | id?: string; | |
autoFocusoptionalinherited | autoFocus?: boolean; | |
maxVisibleItemsoptionalinherited | maxVisibleItems?: number; | Popup height in rows. Default 8. |
virtualizationoptionalinherited | virtualization?: boolean; | Windowed tree; on by default above 100 visible rows. |
localeoptionalinherited | locale?: string; | |
renderItemoptionalinherited | renderItem?: ((props: TreeSelectItemRenderProps<Item>) => ReactNode); | |
renderValueoptionalinherited | renderValue?: ((props: { readonly items: readonly Item[]; readonly labels: readonly string[]; }) => ReactNode); | |
renderEmptyoptionalinherited | renderEmpty?: ((props: { readonly reason: "noData" | "noMatch"; }) => ReactNode); | |
renderErroroptionalinherited | renderError?: ((props: { readonly error: unknown; readonly item: Item; readonly retry: () => void; }) => ReactNode); | |
renderLoadingoptionalinherited | renderLoading?: ((props: { readonly item: Item; }) => ReactNode); | |
popupHeaderoptionalinherited | popupHeader?: ReactNode; | |
popupFooteroptionalinherited | popupFooter?: ReactNode; | |
highlightMatchesoptionalinherited | highlightMatches?: boolean; | |
sizeoptionalinherited | size?: "lg" | "md" | "sm"; | Control size: |
localeTextoptionalinherited | localeText?: Partial<TreeSelectLocaleText>; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
classNamesoptionalinherited | classNames?: Partial<Record<TreeSelectPart, string>>; | |
stylesoptionalinherited | styles?: Partial<Record<TreeSelectPart, CSSProperties>>; | |
refoptionalinherited | ref?: Ref<HTMLButtonElement>; | The trigger |