import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2, TemplateRef } from '@angular/core'; import { AbstractControl, ControlContainer, ControlValueAccessor, FormGroupDirective } from '@angular/forms'; import { BzLayoutService } from '../../layout/layout.service'; import { OverlayPositionEnum } from '../../overlay/overlay.enum'; import { CommonService } from '../../utilities/service/common.service'; import { RendererService } from '../../utilities/service/renderer.service'; import { SafeAny, SafeBoolean } from '../../utilities/type/type'; import { BzBaseComponent } from '../base/base.component'; import { BzContextMenuService } from '../context-menu/context-menu.service'; export declare class BzDropdownComponent extends BzBaseComponent implements OnInit, AfterViewInit, ControlValueAccessor, OnDestroy { private _controlContainer; private contextMenuService; private _commonService; private cd; private _renderer; private _layoutService; private _renderer2; formGroupDirective: FormGroupDirective; label: string; multiValue: boolean; private _multiArray; checkedArray: boolean[]; flip: string; disabledValue: boolean; buttonWidth: number; isPlaceholder: boolean; onChanged: any; onTouched: any; private _DEFAULT_STATUS; statusValue: string; positionValue: OverlayPositionEnum; scrollIndex: number; private _subscriptions; selectedValue: any; formControl: AbstractControl | undefined | null; validation: boolean; validStatusClass: string; validationErrorClass: string; private selected; private multiSelected; private _isTouched; private _alreadyInwrite; isTriggerValid: boolean; optionsValue: any[]; noOptionHeight: boolean; set options(values: any[]); optionLabel: string; set multiSelectedOption(value: any[]); set multi(value: boolean | string); set disableAttr(value: boolean | string); formControlName: string; placeholder: string; optionValue: string; template: TemplateRef; set status(value: string); errorStatus: Function; set position(value: string); set selectedOption(value: SafeAny); dropLabel: string; set noOptHeight(value: boolean | string); validKey: string; iconButton: string; onSelect: EventEmitter; onChange: EventEmitter; onChangeFromSecond: EventEmitter; button: ElementRef; constructor(_controlContainer: ControlContainer, contextMenuService: BzContextMenuService, _commonService: CommonService, cd: ChangeDetectorRef, _renderer: RendererService, _layoutService: BzLayoutService, _renderer2: Renderer2, formGroupDirective: FormGroupDirective); ngOnInit(): void; ngAfterViewInit(): void; /** * Set control and status. * * @author Federico Gambardella */ private _setControlAndStatus; /** * Set dropdown value at start. * * @author Federico Gambardella * @return {void} */ private setDropdownValueAtStart; /** * Gets selected item when dropdwon is not multiple. * * @author Federico Gambardella * @param {SafeAny} option */ getOption(option: SafeAny): void; /** * Gets option label by value. * * @author Federico Gambardella * @param {any} value * @returns {any} */ getOptionLabelByValue(value: any): any; /** * Get option value. * * @author Federico Gambardella * @param {any} option * @returns {any} */ getOptionValue(option: any): any; /** * Resolves option by property. * * @author Federico Gambardella * @param {any} option * @param {string} property */ _resolveOption(options: any, property: string): any; /** * Opens context menu. * * @author Federico Gambardella * @param {TemplateRef} templElement * @param {TemplateRef} dropRefNormal * @param {TemplateRef} dropRefMulti * @param {any} options * @param {string} optionLabel */ openContextMenu(templElement: TemplateRef | HTMLElement, dropRefNormal: TemplateRef, dropRefMulti: TemplateRef, options: any, optionLabel: string): void; /** * Sets context menu width. * * @author Federico Gambardella */ private _setContextMenuWidth; /** * Gets selected item when dropdown is multiple. * * @author Federico Gambardella * @param {any} option * @param {HTMLInputElement} input * @param {number} index */ getOptionMulti(option: any, index: number, checked: boolean): void; /** * Sets dropdwon placeholder. * * @author Federico Gambardella */ private _setPlaceholder; /** * Fill form control. * * @author Federico Gambardella * @param {itemArray} itemArray */ private _fillFormControl; /** * Builds label and select checkbox of item selected * when menu is opened. * * @author Federico Gambardella */ private _buildLabelMultiAndItemArray; /** * Builds label of mulitple select. * * @author Federico Gambardella * @param {NumberObject} indexIterator * @param {any} array * @param {number} arrayLength */ private _buildLabelMulti; /** * Sets dropdown label and select * checkbox of item presents in initArraySelected list. * * @author Federico Gambardella * @param {any[]} initArraySelected */ private _initDropdown; /** * Build label for multi select if optionValue is defined. * * @author Federico Gambardella * @param {any} values * @param {NumberObject} indexIterator * @param {number} valuesLength */ private _buildLabelMultiByOptionValue; /** * Set label multi. * * @author Federico Gambardella * @param {number} index * @param {NumberObject} indexIterator * @param {number} valuesLength */ private _setLabelMulti; /** * Animate icon. * * @author Federico Gambardella */ private _flipIcon; /** * listen when context menu is closed. * * @author Federico Gambardella */ private _listenForCloseMenu; /** * Listen to toggle menu. * * @author Federico Gambardella * @return {void} */ private _listenToggleMenu; /** * Write value in the form. * * @author Federico Gambardella * @param {SafeAny} value */ writeValue(value: SafeAny, option?: SafeAny): void; /** * Emit option selected only if option value is changed. * * @author Federico Gambardella * @param {SafeAny} prevValue * @param {SafeAny} option */ emitOnChangeEvent(prevValue: SafeAny, option: SafeAny): void; /** * Emit option selected only if option value is changed. * * @author Federico Gambardella * @param {SafeAny} prevValue * @param {SafeAny} option */ private emitOnChangeFromSecondEvent; /** * Get otpion label if value in input is not an object. * * @author Federico Gambardella * @param {number} index * @param {any} value */ private _getOptionLabelNotObject; /** * Get otpion label if value in input is an object. * * @author Federico Gambardella * @param {number} index * @param {SafeAny} value */ private _getOptionLabelObject; /** * Set input state. * * @author Federico Gambardella * @return {void} */ private _setInputState; /** * Mark control as touched and set error state. * * @author Federico Gambardella * @param {SafeAny} value */ private _setTouchedAndState; /** * Set css radio class by status. * * @author Federico Gambardella * @param {string} status */ private _setInputCssClassByStatus; /** * Set status value. * * @author Federico Gambardella * @param {string} value */ private _setStatus; /** * Set focus on button. * * @author Federico Gambardella */ private _setFocusOnButton; /** * Set context menu width on resize. * * @author Federico Gambardella */ private _setContextMenuWidthOnResize; /** * Set label * * @author Federico Gambardella * @param value */ _setLabel(value: any): void; registerOnChange(fn: (item: any) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; /** * Check validation if triggered by event. * * @author Federico Gambardella * @param {boolean} isTriggered * @returns */ checkIfTriggerByEvent(isTriggered: SafeBoolean): boolean; /** * Check sumbit. * * @author Federico Gambardella * @return {void} */ protected _checkSumbit(): void; /** * Check validation on event. * * @author Federico Gambardella */ protected _chekValidationOnEvent(): void; /** * Check validation. * * @author Federico Gambardella */ protected _checkValidation(): void; /** * Set is error state color. * * @author Federico Gambardella * @return {void} */ protected _setIsErrorStateColor(isTriggered?: boolean): void; /** * Set required css class. * * @author Federico Gambardella */ protected _setRequiredCssClass(): void; ngOnDestroy(): void; }