UNPKG

@ux-aspects/ux-aspects

Version:

Open source user interface framework for building modern, responsive, mobile big data applications

71 lines (70 loc) 4.05 kB
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { MenuTriggerDirective } from '../menu/menu-trigger/menu-trigger.directive'; import * as i0 from "@angular/core"; export declare class InputDropdownComponent<T> implements ControlValueAccessor, AfterViewInit, OnChanges, OnDestroy { private readonly _changeDetector; /** Define the selected item */ selected: T; /** Filter text */ filter: string; /** Hide the filter input */ hideFilter: boolean; /** Define the max height of the dropdown */ set maxHeight(value: string | number); /** Controls the disabled state of the input-dropdown. */ disabled: boolean; /** Define if null values are allowed */ allowNull: boolean; /** Define the placeholder for the filter input */ placeholder: string; /** Aria label of the filter field. If not specified, the placeholder will be used. */ ariaLabel: string; /** ID of the element which serves as a label for the filter field. */ ariaLabelledby: string; /** Aria label of the search button icon. */ searchFilterButtonAriaLabel: string; /** Aria label of the clear button icon. */ clearFilterButtonAriaLabel: string; /** Emit when the selected item is changed */ selectedChange: EventEmitter<T>; /** Emit when the filter text is changed */ filterChange: EventEmitter<string>; /** Emits when `dropdownOpen` changes. */ dropdownOpenChange: EventEmitter<boolean>; /** The status of the dropdown. */ dropdownOpen: boolean; /** Access the display content template if specified */ displayContentRef: TemplateRef<void>; /** Access the dropdown menu trigger directive */ menuTrigger: MenuTriggerDirective; /** Access the filter text input element */ filterInputElement: ElementRef<HTMLInputElement>; /** Store the max height */ _maxHeight: string; /** Store the filter button aria label */ _filterButtonAriaLabel: string; /** Store the change callback provided by Angular Forms */ onChange: (_: T) => void; /** Store the touched callback provided by Angular Forms */ onTouched: () => void; /** Unsubscribe from all observables on component destroy */ private readonly _onDestroy$; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; ngOnDestroy(): void; resetFilter(): void; registerOnChange(onChange: (value: T) => void): void; registerOnTouched(onTouched: () => void): void; writeValue(value: T): void; resetValue(event: Event): void; setDisabledState(isDisabled: boolean): void; onMenuOpen(): void; onMenuClose(): void; _focusFilter(): void; inputFocusHandler(): void; toggleMenu(): void; setFilterButtonAriaLabel(): void; static ɵfac: i0.ɵɵFactoryDeclaration<InputDropdownComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<InputDropdownComponent<any>, "ux-input-dropdown", never, { "selected": { "alias": "selected"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "hideFilter": { "alias": "hideFilter"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "allowNull": { "alias": "allowNull"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; }; "searchFilterButtonAriaLabel": { "alias": "searchFilterButtonAriaLabel"; "required": false; }; "clearFilterButtonAriaLabel": { "alias": "clearFilterButtonAriaLabel"; "required": false; }; "dropdownOpen": { "alias": "dropdownOpen"; "required": false; }; }, { "selectedChange": "selectedChange"; "filterChange": "filterChange"; "dropdownOpenChange": "dropdownOpenChange"; }, ["displayContentRef"], ["*"], false, never>; }