///
import { CheckboxType, CheckboxValueType } from "../CheckboxTree";
export type MultiselectType = CheckboxType;
export type OptionValueType = CheckboxValueType;
export interface AllSelectionType extends MultiselectType {
allOptions: Array;
}
export interface MultiselectArgs {
id: string | number;
name: string | undefined;
selectedData?: Array | null;
removedData?: MultiselectType;
}
export interface MultiselectSelectedOptionsType {
id: string | number;
parentId: string | number | null;
data?: any;
}
export interface MultiselectProps {
/** Component id. */
id?: string;
/**Provided options data.
* * MultiselectType
*
* {
*
* id: string | number;
*
* parentId: string | number | null;
*
* value?: OptionValueType;
*
* label?: string;
*
* children?: Array;
*
* level?: number;
*
* selectable?: boolean;
*
* tooltipText?: string | null;
*
* data?: any;
*
*}
*
*/
options: Array;
/**Custom placeholder. */
placeholder?: string;
/**Set 'disabled' attribute on menu input. */
disabled?: boolean;
/**Enable/disable "All select/unselect" option.
*
* Default value is false
*
*/
allSelection?: boolean;
/**Component custom CSS class. */
className?: string;
/**Component custom style. */
style?: React.CSSProperties;
/**Option left padding size.
*
* Default is 10.
*
*/
optionLeftPadding?: number;
/**menu list custom CSS class */
menuListClassName?: string;
/** Option custom CSS class. */
menuOptionClassName?: string;
/**Custom name for the component. */
name?: string | undefined;
/**Selected options provided to the component.
*
* Pass only option "id" which one you want to see as selected.
*
* DON'T pass "id"s of children too. It is not necessary.
*
* Component will detect option's children too and will mark as selected
*
* selectedOptions children(if those ones are available) must have true "selectable" property in options props
*
* MultiselectSelectedOptionsType
*
* {
*
* id:string;
*
* data?:any;
*
* }
*
*/
selectedOptions?: Array;
/**Executes after option selection
*
* MultiselectArgs
*
* {
*
* id: string | number;
*
* name: string | undefined;
*
* selectedData: Array;
*
* }
*
* @param {MultiselectArgs} data selected option data
*/
onSelect?: (data: MultiselectArgs) => void;
/**Executes after selected option deletion
*
* @param {MultiselectArgs} data removed option data
*
*/
onRemoveItem?: (data: MultiselectArgs) => void;
/**Executes after menu close */
onClose?: (data: MultiselectArgs) => void;
/**Executes after menu blur */
onBlur?: (data: MultiselectArgs) => void;
/**Whether or not menu opened part is fixed to document
*
* Default is false.
*
*/
isFixedMenu?: boolean;
}
export interface ScrollbarType {
height: number;
width: number;
}
export interface ItemMockType {
id: string;
parentId: null;
value: false;
label: "";
}
export interface MultiselectListStyleType {
"--listWrapperTop"?: string;
"--listWrapperLeft"?: string;
"--listWrapperWidth"?: string;
"--listWrapperPosition"?: string;
}
export interface MultiselectFadeStyleType {
"--fadeRight"?: string;
"--fadeHeight"?: string;
}