1 | import { ComponentRef } from '@angular/core';
|
2 | import { Observable, Subject } from 'rxjs';
|
3 | import * as i0 from "@angular/core";
|
4 | export type NbTriggerValues = 'noop' | 'click' | 'hover' | 'hint' | 'focus';
|
5 | export declare enum NbTrigger {
|
6 | NOOP = "noop",
|
7 | CLICK = "click",
|
8 | HOVER = "hover",
|
9 | HINT = "hint",
|
10 | FOCUS = "focus"
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export interface NbTriggerStrategy {
|
18 | show$: Observable<never | Event>;
|
19 | hide$: Observable<never | Event>;
|
20 | destroy(): any;
|
21 | }
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare abstract class NbTriggerStrategyBase implements NbTriggerStrategy {
|
27 | protected document: Document;
|
28 | protected host: HTMLElement;
|
29 | protected container: () => ComponentRef<any>;
|
30 | destroy(): void;
|
31 | protected destroyed$: Subject<void>;
|
32 | protected isNotOnHostOrContainer(element: Element): boolean;
|
33 | protected isOnHostOrContainer(element: Element): boolean;
|
34 | protected isOnHost(element: Element): boolean;
|
35 | protected isOnContainer(element: Element): boolean;
|
36 | abstract show$: Observable<Event>;
|
37 | abstract hide$: Observable<Event>;
|
38 | constructor(document: Document, host: HTMLElement, container: () => ComponentRef<any>);
|
39 | }
|
40 | /**
|
41 | * Creates show and hide event streams.
|
42 | * Fires toggle event when the click was performed on the host element.
|
43 | * Fires close event when the click was performed on the document but
|
44 | * not on the host or container.
|
45 | * */
|
46 | export declare class NbClickTriggerStrategy extends NbTriggerStrategyBase {
|
47 | protected click$: Observable<[boolean, Event]>;
|
48 | readonly show$: Observable<Event>;
|
49 | readonly hide$: Observable<Event>;
|
50 | }
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export declare class NbHoverTriggerStrategy extends NbTriggerStrategyBase {
|
57 | show$: Observable<Event>;
|
58 | hide$: Observable<Event>;
|
59 | }
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | export declare class NbHintTriggerStrategy extends NbTriggerStrategyBase {
|
66 | show$: Observable<Event>;
|
67 | hide$: Observable<Event>;
|
68 | }
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export declare class NbFocusTriggerStrategy extends NbTriggerStrategyBase {
|
75 | protected focusOut$: Observable<Event>;
|
76 | protected clickIn$: Observable<Event>;
|
77 | protected clickOut$: Observable<Event>;
|
78 | protected tabKeyPress$: Observable<Event>;
|
79 | show$: Observable<Event>;
|
80 | hide$: Observable<Event>;
|
81 | }
|
82 |
|
83 |
|
84 |
|
85 | export declare class NbNoopTriggerStrategy extends NbTriggerStrategyBase {
|
86 | show$: Observable<Event>;
|
87 | hide$: Observable<Event>;
|
88 | }
|
89 | export declare class NbTriggerStrategyBuilderService {
|
90 | protected _document: any;
|
91 | protected _host: HTMLElement;
|
92 | protected _container: () => ComponentRef<any>;
|
93 | protected _trigger: NbTrigger;
|
94 | constructor(_document: any);
|
95 | trigger(trigger: NbTrigger): this;
|
96 | host(host: HTMLElement): this;
|
97 | container(container: () => ComponentRef<any>): this;
|
98 | build(): NbTriggerStrategy;
|
99 | static ɵfac: i0.ɵɵFactoryDeclaration<NbTriggerStrategyBuilderService, never>;
|
100 | static ɵprov: i0.ɵɵInjectableDeclaration<NbTriggerStrategyBuilderService>;
|
101 | }
|