///
export interface OptionType {
id: string | number;
parentId?: string | number | null;
label: string;
data?: any;
children?: Array;
selectable?: boolean;
isFocused?: boolean;
level?: number;
}
export interface DropdownArgs {
id: string | number;
name: string | undefined;
selectedData?: OptionType | null;
removedData?: OptionType | null;
}
export interface DropdownProps {
/** Component id. */
id?: string;
/**Selected option
*
* {
*
* id: string | number;
*
* parentId?: string | number | null;
*
* label: string;
*
* data?: any;
*
* children?: Array;
*
* selectable?: boolean;
*
* isFocused?: boolean;
*
* level?: number;
*
* }
*
*/
option?: OptionType | null;
/**Provided options data.*/
options: Array;
/**Executes after option selection
*
* DropdownArgs
*
* {
*
* id: string | number;
*
* name: string | undefined;
*
* selectedData: OptionType | null;
*
* }
*
* @param {DropdownArgs} data selected option data
*
*/
onSelect?: (data: DropdownArgs) => void;
/**Executes after selected option deletion
*
* @param {DropdownArgs} data removed option data
*
*/
onRemoveItem?: (data: DropdownArgs) => void;
/**Executes after menu blur */
onBlur?: (data: DropdownArgs) => void;
/**Component custom CSS class. */
className?: string;
/**Component custom style. */
style?: React.CSSProperties;
/**Custom placeholder. */
placeholder?: string;
/**Set 'disabled' attribute on menu input. */
disabled?: boolean;
/**Option left padding size.
*
* Default is 10.
*
*/
optionLeftPadding?: number;
/** Option custom CSS class. */
optionClassName?: string;
/**Option remove button.
*
* Default is true.
*
*/
removeButton?: boolean;
/**Custom name for the component. */
name?: string;
/**Whether or not menu opened part is fixed to document
*
* Default is false.
*
*/
isFixedMenu?: boolean;
}
export interface MenuListWrapperStyleType {
"--listWrapperTop"?: string;
"--listWrapperLeft"?: string;
"--listWrapperWidth"?: string;
"--listWrapperPosition"?: string;
}
export interface FadeStyleType {
"--fadeRight"?: string;
"--fadeHeight"?: string;
}
export interface OptionStyleType {
"--leftPadding"?: string;
}