UNPKG

gentics-ui-core

Version:

This is the common core framework for the Gentics CMS and Mesh UI, and other Angular applications.

68 lines (67 loc) 2.48 kB
import { TemplateRef, ElementRef, ChangeDetectorRef, EventEmitter, OnDestroy, AfterViewInit } from '@angular/core'; import { DropdownAlignment, DropdownWidth } from './dropdown.model'; import { Config } from '../../module.config'; import * as i0 from "@angular/core"; export declare class DropdownContentWrapper implements AfterViewInit, OnDestroy { private elementRef; private cd; private config; pageMargin: Config['dropDownPageMargin']; dropDownMaxHeight: Config['dropDownMaxHeight']; content: TemplateRef<any>; contentStyles: any; options: { alignment: DropdownAlignment; width: DropdownWidth; belowTrigger: boolean; }; trigger: HTMLElement; id: string; clicked: EventEmitter<any>; escapeKeyPressed: EventEmitter<any>; private widthHasBeenAdjusted; constructor(elementRef: ElementRef, cd: ChangeDetectorRef, config: Config); ngAfterViewInit(): void; /** * Positions and resizes the dropdown contents container. */ setPositionAndSize(initialOpening?: boolean): void; clickHandler(e: KeyboardEvent): void; ngOnDestroy(): void; /** * Calculates the position of the dropdown based on the height, width. alignment and screen boundaries. */ calculatePositionStyles(): { top: string; left: string; maxHeight: string; flowUpwards: boolean; }; onContentClick(): void; /** * Calculates the optimal alignment of the dropdown contents to avoid clipping over the edge of the window. */ private calculateAlignment; /** * Given a true height of an element, returns a new height which is limited by both * the height of the window and the value of this.dropDownMaxHeight. */ private limitHeight; private getDropdownContent; /** * Returns the width of the container according to the `width` input passed into the component. */ private calculateContainerWidth; private calculateWidthContents; private calculateWidthTrigger; private calculateWidthExpand; private calculateWidthNumber; /** * Returns the offset of the element relative to the document. */ private offset; private innerWidth; private innerHeight; static ɵfac: i0.ɵɵFactoryDeclaration<DropdownContentWrapper, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DropdownContentWrapper, "gtx-dropdown-content-wrapper", never, {}, {}, never, never>; }