ngx-slice-kit
Version:
[](https://badge.fury.io/js/ngx-slice-kit)
61 lines (60 loc) • 2.31 kB
TypeScript
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { OptionModel } from './dropdown-option.model';
import { DropdownOptions } from './dropdown.model';
import { Subscription } from 'rxjs';
import { OptionsService } from './options.service';
import * as i0 from "@angular/core";
export declare class DropdownComponent implements OnInit, AfterViewInit, OnDestroy {
private document;
private elem;
private renderer;
optionsService: OptionsService;
dropdownElement: ElementRef;
resultEvent: EventEmitter<any>;
config: DropdownOptions;
sub: Subscription;
currentOption: OptionModel;
inverted: boolean;
rects: {
bottom?: any;
top?: any;
left?: any;
width?: any;
};
highlightedIndex: number;
constructor(document: any, elem: ElementRef, renderer: Renderer2, optionsService: OptionsService);
onOptionMouseEnter(o: OptionModel, index: number): void;
onOptionMouseLeave(): void;
select(ev: any, option: OptionModel): void;
onResult(res?: OptionModel): void;
nextOption(direction: 'up' | 'down'): void;
autoScroll(direction: 'up' | 'down'): void;
/**
* click outside subscription if backdrop disabled. also dropdown must be attached during input
*/
initClickOutsideSub(): void;
/**
* detect relative position to prevent dropdown being hidden over `overflow: none`
*/
getDropdownRects(): void;
/**
* - if `fitWidth` config options is true
* there are width declared depending on its parent element
* - if `rects.top` calculated there is enough place to drop it down,
* if it hits `rects.bottom` – show it above the element
*/
setDropdownPosition(): void;
/**
* detect window resize and scroll to prevent failed dropdown position
*/
initClosingSubscriptions(): void;
/**
* keyboard events
*/
initKeydownSubscription(): void;
ngOnInit(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "sdk-dropdown-menu", never, { "config": "config"; }, { "resultEvent": "resultEvent"; }, never, never, false>;
}