UNPKG

3.59 kBTypeScriptView Raw
1import { ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core';
2import { PopoverConfig } from './popover.config';
3import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';
4import { PositioningService, AvailbleBSPositions } from 'ngx-bootstrap/positioning';
5import * as i0 from "@angular/core";
6/**
7 * A lightweight, extensible directive for fancy popover creation.
8 */
9export declare class PopoverDirective implements OnInit, OnDestroy {
10 private _elementRef;
11 private _renderer;
12 private _positionService;
13 /** unique id popover - use for aria-describedby */
14 popoverId: number;
15 /** sets disable adaptive position */
16 adaptivePosition: boolean;
17 boundariesElement?: ('viewport' | 'scrollParent' | 'window');
18 /**
19 * Content to be displayed as popover.
20 */
21 popover?: string | TemplateRef<any>;
22 /**
23 * Context to be used if popover is a template.
24 */
25 popoverContext: any;
26 /**
27 * Title of a popover.
28 */
29 popoverTitle?: string;
30 /**
31 * Placement of a popover. Accepts: "top", "bottom", "left", "right"
32 */
33 placement: AvailbleBSPositions;
34 /**
35 * Close popover on outside click
36 */
37 outsideClick: boolean;
38 /**
39 * Specifies events that should trigger. Supports a space separated list of
40 * event names.
41 */
42 triggers: string;
43 /**
44 * A selector specifying the element the popover should be appended to.
45 */
46 container?: string;
47 /**
48 * Css class for popover container
49 */
50 containerClass: string;
51 /**
52 * Returns whether or not the popover is currently being shown
53 */
54 get isOpen(): boolean;
55 set isOpen(value: boolean);
56 /**
57 * Delay before showing the tooltip
58 */
59 delay: number;
60 /**
61 * Emits an event when the popover is shown
62 */
63 onShown: EventEmitter<unknown>;
64 /**
65 * Emits an event when the popover is hidden
66 */
67 onHidden: EventEmitter<unknown>;
68 protected _popoverCancelShowFn?: () => void;
69 protected _delayTimeoutId?: number;
70 private _popover;
71 private _isInited;
72 private _ariaDescribedby?;
73 constructor(_config: PopoverConfig, _elementRef: ElementRef, _renderer: Renderer2, _viewContainerRef: ViewContainerRef, cis: ComponentLoaderFactory, _positionService: PositioningService);
74 /**
75 * Set attribute aria-describedBy for element directive and
76 * set id for the popover
77 */
78 setAriaDescribedBy(): void;
79 /**
80 * Opens an element’s popover. This is considered a “manual” triggering of
81 * the popover.
82 */
83 show(): void;
84 /**
85 * Closes an element’s popover. This is considered a “manual” triggering of
86 * the popover.
87 */
88 hide(): void;
89 /**
90 * Toggles an element’s popover. This is considered a “manual” triggering of
91 * the popover.
92 */
93 toggle(): void;
94 ngOnInit(): void;
95 ngOnDestroy(): void;
96 static ɵfac: i0.ɵɵFactoryDeclaration<PopoverDirective, never>;
97 static ɵdir: i0.ɵɵDirectiveDeclaration<PopoverDirective, "[popover]", ["bs-popover"], { "adaptivePosition": "adaptivePosition"; "boundariesElement": "boundariesElement"; "popover": "popover"; "popoverContext": "popoverContext"; "popoverTitle": "popoverTitle"; "placement": "placement"; "outsideClick": "outsideClick"; "triggers": "triggers"; "container": "container"; "containerClass": "containerClass"; "isOpen": "isOpen"; "delay": "delay"; }, { "onShown": "onShown"; "onHidden": "onHidden"; }, never, never, false>;
98}