UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

1,489 lines (1,467 loc) 163 kB
import * as i0 from '@angular/core'; import { InjectionToken, EventEmitter, OnDestroy, ElementRef, Type, ViewContainerRef, ComponentRef, Injector, NgZone, ChangeDetectorRef, QueryList, TemplateRef } from '@angular/core'; import * as rxjs from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs'; import { AnimationReferenceMetadata, AnimationPlayer as AnimationPlayer$1 } from '@angular/animations'; import { ValidationErrors } from '@angular/forms'; /** * Common interface for Components with show and collapse functionality */ interface IToggleView { element: any; open(...args: any[]): any; close(...args: any[]): any; toggle(...args: any[]): any; } /** * Common service to be injected between components where those implementing common * ToggleView interface can register and toggle directives can call their methods. * TODO: Track currently active? Events? */ declare class IgxNavigationService { private navs; constructor(); add(id: string, navItem: IToggleView): void; remove(id: string): void; get(id: string): IToggleView; toggle(id: string, ...args: any[]): any; open(id: string, ...args: any[]): any; close(id: string, ...args: any[]): any; static ɵfac: i0.ɵɵFactoryDeclaration<IgxNavigationService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<IgxNavigationService>; } /** * Directive that can toggle targets through provided NavigationService. * * Usage: * ``` * <button type="button" igxNavToggle="ID">Toggle</button> * ``` * Where the `ID` matches the ID of compatible `IToggleView` component. */ declare class IgxNavigationToggleDirective { private target; state: IgxNavigationService; constructor(); toggleNavigationDrawer(): void; static ɵfac: i0.ɵɵFactoryDeclaration<IgxNavigationToggleDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<IgxNavigationToggleDirective, "[igxNavToggle]", never, { "target": { "alias": "igxNavToggle"; "required": false; }; }, {}, never, never, true, never>; } /** * Directive that can close targets through provided NavigationService. * * Usage: * ``` * <button type="button" igxNavClose="ID">Close</button> * ``` * Where the `ID` matches the ID of compatible `IToggleView` component. */ declare class IgxNavigationCloseDirective { private target; state: IgxNavigationService; constructor(); closeNavigationDrawer(): void; static ɵfac: i0.ɵɵFactoryDeclaration<IgxNavigationCloseDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<IgxNavigationCloseDirective, "[igxNavClose]", never, { "target": { "alias": "igxNavClose"; "required": false; }; }, {}, never, never, true, never>; } interface DateRangeDescriptor { type: DateRangeType; dateRange?: Date[]; } declare enum DateRangeType { After = 0, Before = 1, Between = 2, Specific = 3, Weekdays = 4, Weekends = 5 } /** * @hidden @internal * * Enumeration representing the possible predefined size options of the grid. * - Small: This is the smallest size with 32px row height. Left and Right paddings are 12px. Minimal column width is 56px. * - Medium: This is the middle size with 40px row height. Left and Right paddings are 16px. Minimal column width is 64px. * - Large: this is the default Grid size with the lowest intense and row height equal to 50px. Left and Right paddings are 24px. Minimal column width is 80px. */ declare const Size$1: { readonly Small: "1"; readonly Medium: "2"; readonly Large: "3"; }; type Size$1 = (typeof Size$1)[keyof typeof Size$1]; /** * Enumeration representing the days of the week. */ declare enum WEEKDAYS { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6 } declare class ThemeToken { private t?; private document; subject: BehaviorSubject<IgxTheme>; constructor(t?: IgxTheme); onChange(callback: (theme: IgxTheme) => void): rxjs.Subscription; set(theme: IgxTheme): void; get theme(): IgxTheme; get preferToken(): boolean; } declare const THEME_TOKEN: InjectionToken<ThemeToken>; declare const Theme: { readonly Material: "material"; readonly Fluent: "fluent"; readonly Bootstrap: "bootstrap"; readonly IndigoDesign: "indigo"; }; /** * Determines the component theme. */ type IgxTheme = (typeof Theme)[keyof typeof Theme]; /** @hidden @internal */ declare const ELEMENTS_TOKEN: InjectionToken<boolean>; /** * @hidden */ declare const showMessage: (message: string, isMessageShown: boolean) => boolean; /** * * @hidden @internal */ declare const getResizeObserver: () => { new (callback: ResizeObserverCallback): ResizeObserver; prototype: ResizeObserver; }; /** * @hidden */ declare function cloneArray<T>(array: T[], deep?: boolean): T[]; /** * @hidden */ declare function areEqualArrays<T>(arr1: T[], arr2: T[]): boolean; /** * Doesn't clone leaf items * * @hidden */ declare const cloneHierarchicalArray: (array: any[], childDataKey: any) => any[]; /** * Creates an object with prototype from provided source and copies * all properties descriptors from provided source * @param obj Source to copy prototype and descriptors from * @returns New object with cloned prototype and property descriptors */ declare const copyDescriptors: (obj: any) => any; /** * Deep clones all first level keys of Obj2 and merges them to Obj1 * * @param obj1 Object to merge into * @param obj2 Object to merge from * @returns Obj1 with merged cloned keys from Obj2 * @hidden */ declare const mergeObjects: (obj1: any, obj2: any) => any; /** * Creates deep clone of provided value. * Supports primitive values, dates and objects. * If passed value is array returns shallow copy of the array. * * @param value value to clone * @returns Deep copy of provided value * @hidden */ declare const cloneValue: (value: any) => any; /** * Creates deep clone of provided value. * Supports primitive values, dates and objects. * If passed value is array returns shallow copy of the array. * For Objects property values and references are cached and reused. * This allows for circular references to same objects. * * @param value value to clone * @param cache map of cached values already parsed * @returns Deep copy of provided value * @hidden */ declare const cloneValueCached: (value: any, cache: Map<any, any>) => any; /** * Parse provided input to Date. * * @param value input to parse * @returns Date if parse succeed or null * @hidden */ declare const parseDate: (value: any) => Date | null; /** * Returns an array with unique dates only. * * @param columnValues collection of date values (might be numbers or ISO 8601 strings) * @returns collection of unique dates. * @hidden */ declare const uniqueDates: (columnValues: any[]) => any; /** * Checks if provided variable is Object * * @param value Value to check * @returns true if provided variable is Object * @hidden */ declare const isObject: (value: any) => boolean; /** * Checks if provided variable is Date * * @param value Value to check * @returns true if provided variable is Date * @hidden */ declare const isDate: (value: any) => value is Date; /** * Checks if the two passed arguments are equal * Currently supports date objects * * @param obj1 * @param obj2 * @returns: `boolean` * @hidden */ declare const isEqual: (obj1: any, obj2: any) => boolean; /** * Limits a number to a range between a minimum and a maximum value. * * @param number * @param min * @param max * @returns: `number` * @hidden */ declare const clamp: (number: number, min: number, max: number) => number; /** * Utility service taking care of various utility functions such as * detecting browser features, general cross browser DOM manipulation, etc. * * @hidden @internal */ declare class PlatformUtil { private platformId; isBrowser: boolean; isIOS: boolean; isSafari: boolean; isFirefox: boolean; isEdge: boolean; isChromium: boolean; browserVersion: number; /** @hidden @internal */ isElements: boolean; KEYMAP: { readonly ENTER: "Enter"; readonly SPACE: " "; readonly ESCAPE: "Escape"; readonly ARROW_DOWN: "ArrowDown"; readonly ARROW_UP: "ArrowUp"; readonly ARROW_LEFT: "ArrowLeft"; readonly ARROW_RIGHT: "ArrowRight"; readonly END: "End"; readonly HOME: "Home"; readonly PAGE_DOWN: "PageDown"; readonly PAGE_UP: "PageUp"; readonly F2: "F2"; readonly TAB: "Tab"; readonly SEMICOLON: ";"; readonly DELETE: "Delete"; readonly BACKSPACE: "Backspace"; readonly CONTROL: "Control"; readonly X: "x"; readonly Y: "y"; readonly Z: "z"; }; /** * @hidden @internal * Returns the actual size of the node content, using Range * ```typescript * let range = document.createRange(); * let column = this.grid.columnList.filter(c => c.field === 'ID')[0]; * * let size = getNodeSizeViaRange(range, column.cells[0].nativeElement); * * @remarks * The last parameter is useful when the size of the element to measure is modified by a * parent element that has explicit size. In such cases the calculated size is never lower * and the function may instead remove the parent size while measuring to get the correct value. * ``` */ getNodeSizeViaRange(range: Range, node: HTMLElement, sizeHoldingNode?: HTMLElement): number; /** * Returns true if the current keyboard event is an activation key (Enter/Space bar) * * @hidden * @internal * * @memberof PlatformUtil */ isActivationKey(event: KeyboardEvent): boolean; /** * Returns true if the current keyboard event is a combination that closes the filtering UI of the grid. (Escape/Ctrl+Shift+L) * * @hidden * @internal * @param event * @memberof PlatformUtil */ isFilteringKeyCombo(event: KeyboardEvent): boolean; /** * @hidden @internal */ isLeftClick(event: PointerEvent | MouseEvent): boolean; /** * @hidden @internal */ isNavigationKey(key: string): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<PlatformUtil, never>; static ɵprov: i0.ɵɵInjectableDeclaration<PlatformUtil>; } /** * @hidden */ declare const flatten: (arr: any[]) => any[]; interface CancelableEventArgs { /** * Provides the ability to cancel the event. */ cancel: boolean; } interface IBaseEventArgs { /** * Provides reference to the owner component. */ owner?: any; } interface CancelableBrowserEventArgs extends CancelableEventArgs { /** Browser event */ event?: Event; } interface IBaseCancelableBrowserEventArgs extends CancelableBrowserEventArgs, IBaseEventArgs { } interface IBaseCancelableEventArgs extends CancelableEventArgs, IBaseEventArgs { } declare const HORIZONTAL_NAV_KEYS: Set<string>; declare const NAVIGATION_KEYS: Set<string>; declare const ACCORDION_NAVIGATION_KEYS: Set<string>; declare const ROW_EXPAND_KEYS: Set<string>; declare const ROW_COLLAPSE_KEYS: Set<string>; declare const ROW_ADD_KEYS: Set<string>; declare const SUPPORTED_KEYS: Set<string>; declare const HEADER_KEYS: Set<string>; /** * @hidden * @internal * * Creates a new ResizeObserver on `target` and returns it as an Observable. * Run the resizeObservable outside angular zone, because it patches the MutationObserver which causes an infinite loop. * Related issue: https://github.com/angular/angular/issues/31712 */ declare const resizeObservable: (target: HTMLElement) => Observable<ResizeObserverEntry[]>; /** * @hidden * @internal * * Compares two maps. */ declare const compareMaps: (map1: Map<any, any>, map2: Map<any, any>) => boolean; declare function columnFieldPath(path?: string): string[]; /** * Given a property access path in the format `x.y.z` resolves and returns * the value of the `z` property in the passed object. * * @hidden * @internal */ declare function resolveNestedPath<T extends object, U>(obj: unknown, pathParts: string[], defaultValue?: U): T | U | undefined; /** * * Given a property access path in the format `x.y.z` and a value * this functions builds and returns an object following the access path. * * @example * ```typescript * console.log('x.y.z.', 42); * >> { x: { y: { z: 42 } } } * ``` * * @hidden * @internal */ declare const reverseMapper: (path: string, value: any) => {}; declare const yieldingLoop: (count: number, chunkSize: number, callback: (index: number) => void, done: () => void) => void; declare const isConstructor: (ref: any) => boolean; /** * Similar to Angular's formatDate. However it will not throw on `undefined | null | ''` instead * coalescing to an empty string. */ declare const formatDate: (value: string | number | Date, format: string, locale: string, timezone?: string) => string; declare const formatCurrency: { (value: number | string, currencyCode?: string, display?: "code" | "symbol" | "symbol-narrow" | string | boolean, digitsInfo?: string, locale?: string): string | null; (value: null | undefined, currencyCode?: string, display?: "code" | "symbol" | "symbol-narrow" | string | boolean, digitsInfo?: string, locale?: string): null; (value: number | string | null | undefined, currencyCode?: string, display?: "code" | "symbol" | "symbol-narrow" | string | boolean, digitsInfo?: string, locale?: string): string | null; }; /** Converts pixel values to their rem counterparts for a base value */ declare const rem: (value: number | string) => number; /** Get the size of the component as derived from the CSS size variable */ declare function getComponentSize(el: Element): string; /** Get the first item in an array */ declare function first<T>(arr: T[]): T; /** Get the last item in an array */ declare function last<T>(arr: T[]): T; /** Calculates the modulo of two numbers, ensuring a non-negative result. */ declare function modulo(n: number, d: number): number; /** * Splits an array into chunks of length `size` and returns a generator * yielding each chunk. * The last chunk may contain less than `size` elements. * * @example * ```typescript * const arr = [0,1,2,3,4,5,6,7,8,9]; * * Array.from(chunk(arr, 2)) // [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]] * Array.from(chunk(arr, 3)) // [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]] * Array.from(chunk([], 3)) // [] * Array.from(chunk(arr, -3)) // Error * ``` */ declare function intoChunks<T>(arr: T[], size: number): Generator<T[], void, unknown>; /** * @param size * @returns string that represents the --component-size default value */ declare function getComponentCssSizeVar(size: string): "var(--ig-size, var(--ig-size-small))" | "var(--ig-size, var(--ig-size-medium))" | "var(--ig-size, var(--ig-size-large))"; /** * @param path - The URI path to be normalized. * @returns string encoded using the encodeURI function. */ declare function normalizeURI(path: string): string; declare function getComponentTheme(el: Element): IgxTheme; /** * Collection re-created w/ the built in track by identity will always log * warning even for valid cases of recalculating all collection items. * See https://github.com/angular/angular/blob/55581b4181639568fb496e91055142a1b489e988/packages/core/src/render3/instructions/control_flow.ts#L393-L409 * Current solution explicit track function doing the same as suggested in: * https://github.com/angular/angular/issues/56471#issuecomment-2180315803 * This should be used with moderation and when necessary. * @internal */ declare function trackByIdentity<T>(item: T): T; type KeyOfOrString<T, K = keyof T> = K extends keyof T ? K : string; /** @hidden */ declare class IgxSelectionAPIService { /** * If primaryKey is defined, then multiple selection is based on the primaryKey, and it is array of numbers, strings, etc. * If the primaryKey is omitted, then selection is based on the item data */ protected selection: Map<string, Set<any>>; /** * Get current component selection. * * @param componentID ID of the component. */ get(componentID: string): Set<any>; /** * Set new component selection. * * @param componentID ID of the component. * @param newSelection The new component selection to be set. */ set(componentID: string, newSelection: Set<any>): void; /** * Clears selection for component. * * @param componentID ID of the component. */ clear(componentID: string): void; /** * Removes selection for a component. * @param componentID */ delete(componentID: string): void; /** * Get current component selection length. * * @param componentID ID of the component. */ size(componentID: string): number; /** * Creates new selection that consist of the new item added to the current component selection. * The returned collection is new Set, * therefore if you want to update component selection you need to call in addition the set_selection() method * or instead use the select_item() one. * * @param componentID ID of the component, which we add new item to. * @param itemID ID of the item to add to component selection. * @param sel Used internally only by the selection (add_items method) to accumulate selection for multiple items. * * @returns Selection after the new item is added. */ add_item(componentID: string, itemID: any, sel?: Set<any>): Set<any>; /** * Creates new selection that consist of the new items added to the current component selection. * The returned collection is new Set, * therefore if you want to update component selection you need to call in addition the set_selection() method * or instead use the select_items() one. * * @param componentID ID of the component, which we add new items to. * @param itemIDs Array of IDs of the items to add to component selection. * @param clearSelection If true it will clear previous selection. * * @returns Selection after the new items are added. */ add_items(componentID: string, itemIDs: any[], clearSelection?: boolean): Set<any>; /** * Add item to the current component selection. * * @param componentID ID of the component, which we add new item to. * @param itemID ID of the item to add to component selection. * @param sel Used internally only by the selection (select_items method) to accumulate selection for multiple items. */ select_item(componentID: string, itemID: any, sel?: Set<any>): void; /** * Add items to the current component selection. * * @param componentID ID of the component, which we add new items to. * @param itemIDs Array of IDs of the items to add to component selection. * @param clearSelection If true it will clear previous selection. */ select_items(componentID: string, itemID: any[], clearSelection?: boolean): void; /** * Creates new selection that consist of the new items excluded from the current component selection. * The returned collection is new Set, * therefore if you want to update component selection you need to call in addition the set_selection() method * or instead use the deselect_item() one. * * @param componentID ID of the component, which we remove items from. * @param itemID ID of the item to remove from component selection. * @param sel Used internally only by the selection (delete_items method) to accumulate deselected items. * * @returns Selection after the item is removed. */ delete_item(componentID: string, itemID: any, sel?: Set<any>): Set<any>; /** * Creates new selection that consist of the new items removed to the current component selection. * The returned collection is new Set, * therefore if you want to update component selection you need to call in addition the set_selection() method * or instead use the deselect_items() one. * * @param componentID ID of the component, which we remove items from. * @param itemID ID of the items to remove from component selection. * * @returns Selection after the items are removed. */ delete_items(componentID: string, itemIDs: any[]): Set<any>; /** * Remove item from the current component selection. * * @param componentID ID of the component, which we remove item from. * @param itemID ID of the item to remove from component selection. * @param sel Used internally only by the selection (deselect_items method) to accumulate selection for multiple items. */ deselect_item(componentID: string, itemID: any, sel?: Set<any>): void; /** * Remove items to the current component selection. * * @param componentID ID of the component, which we add new items to. * @param itemIDs Array of IDs of the items to add to component selection. */ deselect_items(componentID: string, itemID: any[], _clearSelection?: boolean): void; /** * Check if the item is selected in the component selection. * * @param componentID ID of the component. * @param itemID ID of the item to search. * * @returns If item is selected. */ is_item_selected(componentID: string, itemID: any): boolean; /** * Get first element in the selection. * This is correct when we have only one item in the collection (for single selection purposes) * and the method returns that item. * * @param componentID ID of the component. * * @returns First element in the set. */ first_item(componentID: string): any; /** * Returns whether all items are selected. * * @param componentID ID of the component. * @param dataCount: number Number of items in the data. * * @returns If all items are selected. */ are_all_selected(componentID: string, dataCount: number): boolean; /** * Returns whether any of the items is selected. * * @param componentID ID of the component. * @param data Entire data array. * * @returns If there is any item selected. */ are_none_selected(componentID: string): boolean; /** * Get all primary key values from a data array. If there isn't a primary key defined that the entire data is returned instead. * * @param data Entire data array. * @param primaryKey Data primary key. * * @returns Array of identifiers, either primary key values or the entire data array. */ get_all_ids(data: any, primaryKey?: any): any; /** * Returns empty selection collection. * * @returns empty set. */ get_empty(): Set<unknown>; static ɵfac: i0.ɵɵFactoryDeclaration<IgxSelectionAPIService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<IgxSelectionAPIService>; } /** * Used for editor control components * * @hidden */ interface EditorProvider { /** Return the focusable native element */ getEditElement(): HTMLElement; } /** * Injection token is used to inject the EditorProvider token into components * * @hidden @internal */ declare const EDITOR_PROVIDER: InjectionToken<EditorProvider>; /** * Stripped-down HammerJS annotations. */ /** * @hidden * @internal */ interface HammerInput { preventDefault: () => void; deltaX: number; deltaY: number; center: { x: number; y: number; }; pointerType: string; distance: number; } /** * @hidden * @internal */ interface HammerStatic { new (element: HTMLElement | SVGElement, options?: any): HammerManager; Pan: Recognizer; Swipe: Recognizer; Tap: Recognizer; TouchInput: HammerInput; DIRECTION_HORIZONTAL: number; DIRECTION_VERTICAL: number; } /** * @hidden * @internal */ interface Recognizer { } /** * @hidden * @internal */ interface HammerManager { set(options: any): HammerManager; off(events: string, handler?: (event: HammerInput) => void): void; on(events: string, handler: (event: HammerInput) => void): void; destroy(): void; get(event: string): HammerManager; } /** * @hidden * @internal */ interface HammerOptions { cssProps?: { [key: string]: string; }; recognizers?: any[]; inputClass?: HammerInput; } /** * Touch gestures manager based on Hammer.js * Use with caution, this will track references for single manager per element. Very TBD. Much TODO. * * @hidden */ declare class HammerGesturesManager { private _zone; private doc; private platformUtil; static Hammer: HammerStatic; /** * Event option defaults for each recognizer, see http://hammerjs.github.io/api/ for API listing. */ protected hammerOptions: HammerOptions; private platformBrowser; private _hammerManagers; constructor(); supports(eventName: string): boolean; /** * Add listener extended with options for Hammer.js. Will use defaults if none are provided. * Modeling after other event plugins for easy future modifications. */ addEventListener(element: HTMLElement, eventName: string, eventHandler: (eventObj: any) => void, options?: HammerOptions): () => void; /** * Add listener extended with options for Hammer.js. Will use defaults if none are provided. * Modeling after other event plugins for easy future modifications. * * @param target Can be one of either window, body or document(fallback default). */ addGlobalEventListener(target: string, eventName: string, eventHandler: (eventObj: any) => void): () => void; /** * Exposes [Dom]Adapter.getGlobalEventTarget to get global event targets. * Supported: window, document, body. Defaults to document for invalid args. * * @param target Target name */ getGlobalEventTarget(target: string): EventTarget; /** * Set HammerManager options. * * @param element The DOM element used to create the manager on. * * ### Example * * ```ts * manager.setManagerOption(myElem, "pan", { pointers: 1 }); * ``` */ setManagerOption(element: EventTarget, event: string, options: any): void; /** * Add an element and manager map to the internal collection. * * @param element The DOM element used to create the manager on. */ addManagerForElement(element: EventTarget, manager: HammerManager): void; /** * Get HammerManager for the element or null * * @param element The DOM element used to create the manager on. */ getManagerForElement(element: EventTarget): HammerManager; /** * Destroys the HammerManager for the element, removing event listeners in the process. * * @param element The DOM element used to create the manager on. */ removeManagerForElement(element: HTMLElement): void; /** Destroys all internally tracked HammerManagers, removing event listeners in the process. */ destroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<HammerGesturesManager, never>; static ɵprov: i0.ɵɵInjectableDeclaration<HammerGesturesManager>; } interface AnimationService { /** * Creates an `AnimationPlayer` instance * @param animation A set of options describing the animation * @param element The DOM element on which animation will be applied * @returns AnimationPlayer */ buildAnimation: (animationMetaData: AnimationReferenceMetadata, element: HTMLElement) => AnimationPlayer; } interface AnimationPlayer { /** * Emits when the animation starts */ animationStart: EventEmitter<IBaseEventArgs>; /** * Emits when the animation ends */ animationEnd: EventEmitter<IBaseEventArgs>; /** * Current position of the animation. */ position: number; /** * Initialize the animation */ init(): void; /** * Runs the animation */ play(): void; /** * Ends the animation */ finish(): void; /** * Resets the animation to its initial state */ reset(): void; /** * Destroys the animation. */ destroy(): void; /** * Reports whether the animation has started. */ hasStarted(): boolean; } /** * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay-position) * Position strategies determine where to display the component in the provided IgxOverlayService. */ interface IPositionStrategy { /** * PositionSettings to use when position the component in the overlay */ settings: PositionSettings; /** * Position the element based on the PositionStrategy implementing this interface. * * @param contentElement The HTML element to be positioned * @param size Size of the element * @param document reference to the Document object * @param initialCall should be true if this is the initial call to the method * @param target attaching target for the component to show * ```typescript * settings.positionStrategy.position(content, size, document, true); * ``` */ position(contentElement: HTMLElement, size?: Size, document?: Document, initialCall?: boolean, target?: Point | HTMLElement): void; /** * Clone the strategy instance. * ```typescript * settings.positionStrategy.clone(); * ``` */ clone(): IPositionStrategy; } /** * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay-main) * The overlay service allows users to show components on overlay div above all other elements in the page. */ declare class IgxOverlayService implements OnDestroy { private _appRef; private document; private _zone; protected platformUtil: PlatformUtil; private animationService; /** * Emitted just before the overlay content starts to open. * ```typescript * opening(event: OverlayCancelableEventArgs){ * const opening = event; * } * ``` */ opening: EventEmitter<OverlayCancelableEventArgs>; /** * Emitted after the overlay content is opened and all animations are finished. * ```typescript * opened(event: OverlayEventArgs){ * const opened = event; * } * ``` */ opened: EventEmitter<OverlayEventArgs>; /** * Emitted just before the overlay content starts to close. * ```typescript * closing(event: OverlayCancelableEventArgs){ * const closing = event; * } * ``` */ closing: EventEmitter<OverlayClosingEventArgs>; /** * Emitted after the overlay content is closed and all animations are finished. * ```typescript * closed(event: OverlayEventArgs){ * const closed = event; * } * ``` */ closed: EventEmitter<OverlayEventArgs>; /** * Emitted before the content is appended to the overlay. * ```typescript * contentAppending(event: OverlayEventArgs){ * const contentAppending = event; * } * ``` */ contentAppending: EventEmitter<OverlayEventArgs>; /** * Emitted after the content is appended to the overlay, and before animations are started. * ```typescript * contentAppended(event: OverlayEventArgs){ * const contentAppended = event; * } * ``` */ contentAppended: EventEmitter<OverlayEventArgs>; /** * Emitted just before the overlay animation start. * ```typescript * animationStarting(event: OverlayAnimationEventArgs){ * const animationStarting = event; * } * ``` */ animationStarting: EventEmitter<OverlayAnimationEventArgs>; private _componentId; private _overlayInfos; private _overlayElement; private _document; private _keyPressEventListener; private destroy$; private _cursorStyleIsSet; private _cursorOriginalValue; private _defaultSettings; constructor(); /** * Creates overlay settings with global or container position strategy and preset position settings * * @param position Preset position settings. Default position is 'center' * @param outlet The outlet container to attach the overlay to * @returns Non-modal overlay settings based on Global or Container position strategy and the provided position. */ static createAbsoluteOverlaySettings(position?: AbsolutePosition, outlet?: IgxOverlayOutletDirective | ElementRef): OverlaySettings; /** * Creates overlay settings with auto, connected or elastic position strategy and preset position settings * * @param target Attaching target for the component to show * @param strategy The relative position strategy to be applied to the overlay settings. Default is Auto positioning strategy. * @param position Preset position settings. By default the element is positioned below the target, left aligned. * @returns Non-modal overlay settings based on the provided target, strategy and position. */ static createRelativeOverlaySettings(target: Point | HTMLElement, position?: RelativePosition, strategy?: RelativePositionStrategy): OverlaySettings; private static createAbsolutePositionSettings; private static createRelativePositionSettings; private static createPositionStrategy; /** * Generates Id. Provide this Id when call `show(id)` method * * @param component ElementRef to show in overlay * @param settings (optional): Display settings for the overlay, such as positioning and scroll/close behavior. * @returns Id of the created overlay. Valid until `detach` is called. */ attach(element: ElementRef, settings?: OverlaySettings): string; /** * Generates Id. Provide this Id when call `show(id)` method * * Note created instance is in root scope, prefer the `viewContainerRef` overload when local injection context is needed. * * @param component Component Type to show in overlay * @param settings (optional): Create settings for the overlay, such as positioning and scroll/close behavior. * Includes also an optional `Injector` to add to the created dynamic component's injectors. * @returns Id of the created overlay. Valid until `detach` is called. */ attach(component: Type<any>, settings?: OverlayCreateSettings): string; /** * Generates an Id. Provide this Id when calling the `show(id)` method * * @param component Component Type to show in overlay * @param viewContainerRef Reference to the container where created component's host view will be inserted * @param settings (optional): Display settings for the overlay, such as positioning and scroll/close behavior. */ attach(component: Type<any>, viewContainerRef: ViewContainerRef, settings?: OverlaySettings): string; /** * Remove overlay with the provided id. * * @param id Id of the overlay to remove * ```typescript * this.overlay.detach(id); * ``` */ detach(id: string): void; /** * Remove all the overlays. * ```typescript * this.overlay.detachAll(); * ``` */ detachAll(): void; /** * Shows the overlay for provided id. * * @param id Id to show overlay for * @param settings Display settings for the overlay, such as positioning and scroll/close behavior. */ show(id: string, settings?: OverlaySettings): void; /** * Hides the component with the ID provided as a parameter. * ```typescript * this.overlay.hide(id); * ``` */ hide(id: string, event?: Event): void; /** * Hides all the components and the overlay. * ```typescript * this.overlay.hideAll(); * ``` */ hideAll(): void; /** * Repositions the component with ID provided as a parameter. * * @param id Id to reposition overlay for * ```typescript * this.overlay.reposition(id); * ``` */ reposition(id: string): void; /** * Offsets the content along the corresponding axis by the provided amount with optional offsetMode that determines whether to add (by default) or set the offset values * * @param id Id to offset overlay for * @param deltaX Amount of offset in horizontal direction * @param deltaY Amount of offset in vertical direction * @param offsetMode Determines whether to add (by default) or set the offset values with OffsetMode.Add and OffsetMode.Set * ```typescript * this.overlay.setOffset(id, deltaX, deltaY, offsetMode); * ``` */ setOffset(id: string, deltaX: number, deltaY: number, offsetMode?: OffsetMode): void; /** @hidden */ repositionAll: () => void; /** @hidden */ ngOnDestroy(): void; /** @hidden @internal */ getOverlayById(id: string): OverlayInfo; private _hide; /** * Creates overlayInfo. Sets the info's `elementRef`, `componentRef`and `settings`. Also * initialize info's `ngZone`, `transformX` and `transformY`. * @param component ElementRef or Type. If type is provided dynamic component will be created * @param viewContainerRefOrSettings (optional): If ElementRef is provided for `component` this * parameter is OverlaySettings. Otherwise it could be ViewContainerRef or OverlayCreateSettings and will be * used when dynamic component is created. * @param settings (optional): OverlaySettings when `ViewContainerRef` is provided. * @returns OverlayInfo */ private getOverlayInfo; private placeElementHook; private moveElementToOverlay; private getWrapperElement; private getContentElement; private getOverlayElement; private updateSize; private closeDone; private cleanUp; private playOpenAnimation; private playCloseAnimation; private applyAnimationParams; private documentClicked; private addOutsideClickListener; private removeOutsideClickListener; private addResizeHandler; private removeResizeHandler; private addCloseOnEscapeListener; private removeCloseOnEscapeListener; private addModalClasses; private removeModalClasses; private buildAnimationPlayers; private openAnimationDone; private closeAnimationDone; private finishAnimations; private getComponentSize; static ɵfac: i0.ɵɵFactoryDeclaration<IgxOverlayService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<IgxOverlayService>; } /** * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay-scroll). * Scroll strategies determines how the scrolling will be handled in the provided IgxOverlayService. */ interface IScrollStrategy { /** * Initializes the strategy. Should be called once * * @param document reference to Document object. * @param overlayService IgxOverlay service to use in this strategy. * @param id Unique id for this strategy. * ```typescript * settings.scrollStrategy.initialize(document, overlay, id); * ``` */ initialize(document: Document, overlayService: IgxOverlayService, id: string): any; /** * Attaches the strategy * ```typescript * settings.scrollStrategy.attach(); * ``` */ attach(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ detach(): void; } declare abstract class ScrollStrategy implements IScrollStrategy { /** * Initializes the strategy. Should be called once * * @param document reference to Document object. * @param overlayService IgxOverlay service to use in this strategy. * @param id Unique id for this strategy. * ```typescript * settings.scrollStrategy.initialize(document, overlay, id); * ``` */ abstract initialize(document: Document, overlayService: IgxOverlayService, id: string): any; /** * Attaches the strategy * ```typescript * settings.scrollStrategy.attach(); * ``` */ abstract attach(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ abstract detach(): void; } /** * On scroll reposition the overlay content. */ declare class AbsoluteScrollStrategy extends ScrollStrategy { private _initialized; private _document; private _overlayService; private _id; private _scrollContainer; private _zone; constructor(scrollContainer?: HTMLElement); /** * Initializes the strategy. Should be called once * * @param document reference to Document object. * @param overlayService IgxOverlay service to use in this strategy. * @param id Unique id for this strategy. * ```typescript * settings.scrollStrategy.initialize(document, overlay, id); * ``` */ initialize(document: Document, overlayService: IgxOverlayService, id: string): void; /** * Attaches the strategy * ```typescript * settings.scrollStrategy.attach(); * ``` */ attach(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ detach(): void; private addScrollEventListener; private onScroll; } /** * Prevents scrolling while the overlay content is shown. */ declare class BlockScrollStrategy extends ScrollStrategy { private _initialized; private _document; private _initialScrollTop; private _initialScrollLeft; private _sourceElement; constructor(); /** * Initializes the strategy. Should be called once * */ initialize(document: Document): void; /** * Attaches the strategy * ```typescript * settings.scrollStrategy.attach(); * ``` */ attach(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ detach(): void; private onScroll; } /** * Uses a tolerance and closes the shown component upon scrolling if the tolerance is exceeded */ declare class CloseScrollStrategy extends ScrollStrategy { private _document; private _overlayService; private _id; private initialScrollTop; private initialScrollLeft; private _threshold; private _initialized; private _sourceElement; private _scrollContainer; private _overlayInfo; constructor(scrollContainer?: HTMLElement); /** * Initializes the strategy. Should be called once * * @param document reference to Document object. * @param overlayService IgxOverlay service to use in this strategy. * @param id Unique id for this strategy. * ```typescript * settings.scrollStrategy.initialize(document, overlay, id); * ``` */ initialize(document: Document, overlayService: IgxOverlayService, id: string): void; /** * Attaches the strategy * ```typescript * settings.scrollStrategy.attach(); * ``` */ attach(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ detach(): void; private onScroll; } /** * Empty scroll strategy. Does nothing. */ declare class NoOpScrollStrategy extends ScrollStrategy { constructor(); /** * Initializes the strategy. Should be called once */ initialize(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ attach(): void; /** * Detaches the strategy * ```typescript * settings.scrollStrategy.detach(); * ``` */ detach(): void; } /** * Mark an element as an igxOverlay outlet container. * Directive instance is exported as `overlay-outlet` to be assigned to templates variables: * ```html * <div igxOverlayOutlet #outlet="overlay-outlet"></div> * ``` */ declare class IgxOverlayOutletDirective { element: ElementRef<HTMLElement>; /** @hidden */ get nativeElement(): HTMLElement; static ɵfac: i0.ɵɵFactoryDeclaration<IgxOverlayOutletDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<IgxOverlayOutletDirective, "[igxOverlayOutlet]", ["overlay-outlet"], {}, {}, never, never, true, never>; } declare enum HorizontalAlignment { Left = -1, Center = -0.5, Right = 0 } declare enum VerticalAlignment { Top = -1, Middle = -0.5, Bottom = 0 } /** * Defines the possible values of the overlays' position strategy. */ declare enum RelativePositionStrategy { Connected = "connected", Auto = "auto", Elastic = "elastic" } /** * Defines the possible positions for the relative overlay settings presets. */ declare enum RelativePosition { Above = "above", Below = "below", Before = "before", After = "after", Default = "default" } /** * Defines the possible positions for the absolute overlay settings presets. */ declare enum AbsolutePosition { Bottom = "bottom", Top = "top", Center = "center" } /** * Determines whether to add or set the offset values. */ declare enum OffsetMode { Add = 0, Set = 1 } declare class Point { x: number; y: number; constructor(x: number, y: number); } /** @hidden */ interface OutOfViewPort { /** Out of view port at Top or Left */ back: number; /** Out of view port at Bottom or Right */ forward: number; } interface PositionSettings { /** Direction in which the component should show */ horizontalDirection?: HorizontalAlignment; /** Direction in which the component should show */ verticalDirection?: VerticalAlignment; /** Target's starting point */ horizontalStartPoint?: HorizontalAlignment; /** Target's starting point */ verticalStartPoint?: VerticalAlignment; /** Animation applied while overlay opens */ openAnimation?: AnimationReferenceMetadata; /** Animation applied while overlay closes */ closeAnimation?: AnimationReferenceMetadata; /** The size up to which element may shrink when shown in elastic position strategy */ minSize?: Size; /** The offset of the element from the target in pixels */ offset?: number; } interface OverlaySettings { /** Attaching target for the component to show */ target?: Point | HTMLElement; /** Position strategy to use with these settings */ positionStrategy?: IPositionStrategy; /** Scroll strategy to use with these settings */ scrollStrategy?: IScrollStrategy; /** Set if the overlay should be in modal mode */ modal?: boolean; /** Set if the overlay should close on outside click */ closeOnOutsideClick?: boolean; /** Set if the overlay should close when `Esc` key is pressed */ closeOnEscape?: boolean; /** Set the outlet container to attach the overlay to */ outlet?: IgxOverlayOutletDirective | ElementRef; /** * @hidden @internal * Elements to be excluded for closeOnOutsideClick. * Clicking on the elements in this collection will not close the overlay when closeOnOutsideClick = true. */ excludeFromOutsideClick?: HTMLElement[]; } interface OverlayEventArgs extends IBaseEventArgs { /** Id of the overlay generated with `attach()` method */ id: string; /** Available when `Type<T>` is provided to the `attach()` method and allows access to the created Component instance */ componentRef?: ComponentRef<any>; /** Will provide the elementRef of the markup that will be displayed in the overlay */ elementRef?: ElementRef<any>; /** Will provide the overlay settings which will be used when the component is attached */ settings?: OverlaySettings; /** Will provide the original keyboard event if closed from ESC or click */ event?: Event; } interface OverlayCancelableEventArgs extends OverlayEventArgs, CancelableEventArgs { } interface OverlayClosingEventArgs extends OverlayEventArgs, CancelableBrowserEventArgs { } interface OverlayAnimationEventArgs extends IBaseEventArgs { /** Id of the overlay generated with `attach()` method */ id: string; /** Animation player that will play the animation */ animationPlayer: AnimationPlayer; /** Type of animation to be played. It should be either 'open' or 'close' */ animationType: 'open' | 'close'; } interface Size { /** Gets or sets the horizontal component of Size */ width: number; /** Gets or sets the vertical component of Size */ height: number; } /** @hidden */ interface OverlayInfo { id?: string; visible?: boolean; detached?: boolean; elementRef?: ElementRef; componentRef?: ComponentRef<any>; settings?: OverlaySettings; initialSize?: Size; hook?: HTMLElement; openAnimationPlayer?: AnimationPlayer; openAnimationDetaching?: boolean; closeAnimationPlayer?: AnimationPlayer; closeAnimationDetaching?: boolean; ngZone: NgZone; transformX?: number; transformY?: number; event?: Event; wrapperElement?: HTMLElement; size?: string; } /** @hidden */ interface ConnectedFit { contentElementRect?: Partial<DOMRect>; targetRect?: Partial<DOMRect>; viewPortRect?: Partial<DOMRect>; fitHorizontal?: OutOfViewPort; fitVertical?: OutOfViewPort; left?: number; right?: number; top?: number; bottom?: number; horizontalOffset?: number; verticalOffset?: number; } interface OverlayCreateSettings extends OverlaySettings { /** * An `Injector` instance to add in the created component ref's injectors tree. */ injector?: Injector; } /** @hidden