import { Type } from '@angular/core'; import { DefaultTriggerComponent } from '../components/default-trigger/default-trigger.component'; import { DropDownMenuPositionOptions } from '../enums/drop-down-menu-position-options.enum'; import { DropDownMatMenuPanelStyle } from './drop-down-mat-menu-panel-style.interface'; import { SkinOptions } from '../enums/skin-options.enum'; import { ServerSideOptions } from './drop-down-server-options.interface'; export interface DropDownOptions { /** * Text that will display inside the trigger button. Default value: 'Please Select' */ placeholder?: string; /** * if a css class is provided, a font icon will display on the left side of the placeholder button text. * NOTE: a css class for the font icon is expected here */ placeholderLeftIcon?: string; /** * if a css class is provided, a font icon will display on the right side of the placeholder button text. * NOTE: a css class for the font icon is expected here */ placeholderRightIcon?: string; /** * A text that will display inside the trigger button and replace the placeholder (if exists). */ triggerTitle?: string; /** * set hideTriggerButton to true if need to hide the trigger button. * the trigger element is in the dom but isn't visible. * it might be used with other trigger button that will open the dropdown menu * using the dropdown api openMenu method. * Default value false */ hideTriggerButton?: boolean; /** * Show the trigger arrow. Default value true. */ showTriggerArrow?: boolean; /** * If true -> when item is selected we will display the selected item title inside. Default value true. */ showSelectedTitle?: boolean; /** * Show given text as tooltip */ tooltip?: string; /** * Dynamic item component */ itemComponent?: Type | null; /** * Render dynamic trigger component. Default value DefaultTriggerComponent */ triggerComponent?: Type | null; /** * Render dynamic menu component. Default value DefaultDropDownMenuContainerComponent */ menuComponent?: Type | null; /** * Style of the dropdown */ skinOptions?: SkinOptions; /** * Where the menu will display relatively to the trigger button */ menuPosition?: DropDownMenuPositionOptions; /** * Style for mat menu by given object where key is the style name, for example 'width' and value '100px' */ menuStyle?: DropDownMatMenuPanelStyle; /** * Whether the menu has a backdrop. Default value false */ hasBackdrop?: boolean; /** * In case true -> the search will be displayed. * For CLIENT SIDE the default value is false * For SERVER SIDE the default value is true */ showSearch?: boolean; /** * The min number of chars for start search. Default value 0. */ searchMinNumOfChars?: number; /** * In case true -> Clear Selected will be displayed. clear selected will unselect all items. Default value false. */ showClearSelected?: boolean; /** * In case true -> Select All will be displayed. * on Select All click -> all items which are not disabled and are not links will be selected. * Default value false. * Note: * The select all will NOT display in case: * - single select dropdown * - showSelectAll is false * - server side and reactive form dropdown * - server side dropdown and @Output() selectionChanged subscribed by host */ showSelectAll?: boolean; /** * In case true -> multiple selection is allowed. Default value false. */ isMultipleSelection?: boolean; /** * Show the selected marker. Default value true. */ showSelectedMarker?: boolean; /** * Automation ID prefix. Default value 'drop-down'. */ automationIdPrefix?: string; /** * In case we want to get dropdown items from server */ serverSideOptions?: ServerSideOptions; /** * In case we want dropdown to start open (life-cycle hooks ngAfterViewInit). Default value false. */ startOpen?: boolean; /** * Start item title capitalize. Default value true. */ capitalize?: boolean; /** * Set to true in order to check that at least one item is selected. Default value false. */ requiredValidators?: boolean; /** * Reset the selectedItemsState object * false by default, and it means that that only on the first time the @Input() dropDownOptions is set * we create the selectedItemsState object and then if the @Input() dropDownOptions is changed * we keep the existing selectedItemsState instance. * if the resetSelectedItemsState is set to true -> a new instance of selectedItemsState will be created */ resetSelectedItemsState?: boolean; /** * in case true -> we allow unselecting the selected item. * Note: this is supported only with single select. * Default value false */ allowUnselectInSingleSelect?: boolean; /** * color the skin. * we have a different type of skin, for example the "Transparent Skin" * the default color of this skin is the "primary" color and there are cases * where we want to use the same skin but with different color * * NOTE currently the "Transparent Skin" is the only one that implements the "cyan" color. */ color?: 'primary' | 'cyan' | 'white' | undefined; /** * (ONLY WHEN CLIENT SIDE) * if true the items will be sorted by ASC * set to false in order to stop the ASC sort * Default value true */ useClientSideAscSort?: boolean; /** * set to true in case need to resize the dropdown menu. * Default value false */ resizable?: boolean; /** * Style for mat menu by given object where key is the style name, for example 'width' and value '100px' */ resizableStyle?: DropDownMatMenuPanelStyle; /** * in case we want to suspend the selection items and later to update the selected item via code. * so in case we set it to true and the user selects an item -> the item will not change, but the clickedItem event * will fire and we can keep the item that was clicked and later update it as selected. * Default value false */ suspensionSelection?: boolean; /** * a key value object to override item style. * For example change the item height => {'height': '80px'} */ itemStyle?: Record; /** * setting the debounce time between key strokes * The default time is 200 ms */ searchDebounceTime?: number; /** * this classes to set on the host mat-menu element * and applies them on the menu template that displays in the overlay container. */ menuPanelClass?: string; /** * For Client Side Only * in case we need to use infinite scroll and not pagination. * by default useInfiniteScroll is false */ useInfiniteScroll?: boolean; /** * For Client Side Only * the viewport height of the virtual scroll. * by default 300px */ virtualScrollViewportHeight?: number; /** * For client side only. Custom text to display if there are no items to render in the dropdown. */ noItemsText?: string; } //# sourceMappingURL=drop-down-options.interface.d.ts.map