ng-primitives 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/combobox/combobox-state.d.ts +3 -2
- package/combobox/combobox/combobox.d.ts +9 -3
- package/combobox/combobox-button/combobox-button.d.ts +3 -2
- package/combobox/combobox-dropdown/combobox-dropdown.d.ts +52 -2
- package/combobox/combobox-input/combobox-input.d.ts +3 -2
- package/combobox/combobox-option/combobox-option.d.ts +3 -2
- package/combobox/combobox-portal/combobox-portal.d.ts +8 -21
- package/example-theme/index.css +1 -0
- package/fesm2022/ng-primitives-combobox.mjs +63 -87
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +9 -1
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +1 -1
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +372 -63
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +62 -332
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +359 -2
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +51 -176
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/focus-trap/focus-trap/focus-trap-state.d.ts +1 -0
- package/focus-trap/focus-trap/focus-trap.d.ts +5 -0
- package/menu/config/menu-config.d.ts +42 -0
- package/menu/index.d.ts +5 -1
- package/menu/menu/menu.d.ts +6 -2
- package/menu/menu-trigger/menu-trigger-state.d.ts +37 -0
- package/menu/menu-trigger/menu-trigger.d.ts +87 -13
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +56 -0
- package/menu/submenu-trigger/submenu-trigger.d.ts +62 -10
- package/package.json +1 -1
- package/popover/index.d.ts +1 -2
- package/popover/popover/popover.d.ts +2 -43
- package/popover/popover-trigger/popover-trigger.d.ts +13 -107
- package/portal/index.d.ts +2 -0
- package/portal/overlay-token.d.ts +12 -0
- package/portal/overlay.d.ts +170 -0
- package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +31 -0
- package/tooltip/index.d.ts +1 -1
- package/tooltip/tooltip/tooltip.d.ts +3 -25
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +12 -63
- package/popover/popover/popover-token.d.ts +0 -10
- package/popover/utils/transform-origin.d.ts +0 -2
- package/tooltip/tooltip/tooltip-token.d.ts +0 -10
|
@@ -1,18 +1,92 @@
|
|
|
1
|
+
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
|
+
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
3
|
+
import { OnDestroy } from '@angular/core';
|
|
4
|
+
import { Placement } from '@floating-ui/dom';
|
|
5
|
+
import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
|
|
1
6
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "ng-primitives/popover";
|
|
3
7
|
/**
|
|
4
8
|
* The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.
|
|
5
9
|
*/
|
|
6
|
-
export declare class NgpMenuTrigger {
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private readonly
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export declare class NgpMenuTrigger<T = unknown> implements OnDestroy {
|
|
11
|
+
/**
|
|
12
|
+
* Access the trigger element
|
|
13
|
+
*/
|
|
14
|
+
private readonly trigger;
|
|
15
|
+
/**
|
|
16
|
+
* Access the injector.
|
|
17
|
+
*/
|
|
18
|
+
private readonly injector;
|
|
19
|
+
/**
|
|
20
|
+
* Access the global menu configuration.
|
|
21
|
+
*/
|
|
22
|
+
private readonly config;
|
|
23
|
+
/**
|
|
24
|
+
* Access the menu template ref.
|
|
25
|
+
*/
|
|
26
|
+
readonly menu: import("@angular/core").InputSignal<NgpOverlayContent<T> | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Define if the trigger should be disabled.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
32
|
+
/**
|
|
33
|
+
* Define the placement of the menu relative to the trigger.
|
|
34
|
+
* @default 'bottom-start'
|
|
35
|
+
*/
|
|
36
|
+
readonly placement: import("@angular/core").InputSignal<Placement>;
|
|
37
|
+
/**
|
|
38
|
+
* Define the offset of the menu relative to the trigger.
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
readonly offset: import("@angular/core").InputSignalWithTransform<number, NumberInput>;
|
|
42
|
+
/**
|
|
43
|
+
* Define whether the menu should flip when there is not enough space for the menu.
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
47
|
+
/**
|
|
48
|
+
* Define the container in which the menu should be attached.
|
|
49
|
+
* @default document.body
|
|
50
|
+
*/
|
|
51
|
+
readonly container: import("@angular/core").InputSignal<HTMLElement | null>;
|
|
52
|
+
/**
|
|
53
|
+
* Defines how the menu behaves when the window is scrolled.
|
|
54
|
+
* @default 'block'
|
|
55
|
+
*/
|
|
56
|
+
readonly scrollBehavior: import("@angular/core").InputSignal<"reposition" | "block">;
|
|
57
|
+
/**
|
|
58
|
+
* Provide context to the menu. This can be used to pass data to the menu content.
|
|
59
|
+
*/
|
|
60
|
+
readonly context: import("@angular/core").InputSignal<T | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* The overlay that manages the menu
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<T> | null>;
|
|
66
|
+
/**
|
|
67
|
+
* The open state of the menu.
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* The menu trigger state.
|
|
73
|
+
*/
|
|
74
|
+
readonly state: import("ng-primitives/state").CreatedState<NgpMenuTrigger<T>>;
|
|
75
|
+
ngOnDestroy(): void;
|
|
76
|
+
protected toggle(event: MouseEvent): void;
|
|
77
|
+
/**
|
|
78
|
+
* Show the menu.
|
|
79
|
+
*/
|
|
80
|
+
show(): void;
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
* Hide the menu.
|
|
84
|
+
*/
|
|
85
|
+
hide(origin?: FocusOrigin): void;
|
|
86
|
+
/**
|
|
87
|
+
* Create the overlay that will contain the menu
|
|
88
|
+
*/
|
|
89
|
+
private createOverlay;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgpMenuTrigger<any>, never>;
|
|
91
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMenuTrigger<any>, "[ngpMenuTrigger]", ["ngpMenuTrigger"], { "menu": { "alias": "ngpMenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpMenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpMenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpMenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpMenuTriggerFlip"; "required": false; "isSignal": true; }; "container": { "alias": "ngpMenuTriggerContainer"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpMenuTriggerScrollBehavior"; "required": false; "isSignal": true; }; "context": { "alias": "ngpMenuTriggerContext"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
92
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { NgpSubmenuTrigger } from './submenu-trigger';
|
|
2
|
+
/**
|
|
3
|
+
* The state token for the SubmenuTrigger primitive.
|
|
4
|
+
*/
|
|
5
|
+
export declare const NgpSubmenuTriggerStateToken: import("@angular/core").InjectionToken<NgpSubmenuTrigger<unknown>>;
|
|
6
|
+
/**
|
|
7
|
+
* Provides the SubmenuTrigger state.
|
|
8
|
+
*/
|
|
9
|
+
export declare const provideSubmenuTriggerState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
|
+
/**
|
|
11
|
+
* Injects the SubmenuTrigger state.
|
|
12
|
+
*/
|
|
13
|
+
export declare const injectSubmenuTriggerState: <U = {
|
|
14
|
+
readonly trigger: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
|
+
readonly injector: import("@angular/core").Injector;
|
|
16
|
+
readonly menuTrigger: import("@angular/core").Signal<import("ng-primitives/state").State<{
|
|
17
|
+
readonly trigger: /*elided*/ any;
|
|
18
|
+
readonly injector: /*elided*/ any;
|
|
19
|
+
readonly config: /*elided*/ any;
|
|
20
|
+
readonly menu: /*elided*/ any;
|
|
21
|
+
readonly disabled: /*elided*/ any;
|
|
22
|
+
readonly placement: /*elided*/ any;
|
|
23
|
+
readonly offset: /*elided*/ any;
|
|
24
|
+
readonly flip: /*elided*/ any;
|
|
25
|
+
readonly container: /*elided*/ any;
|
|
26
|
+
readonly scrollBehavior: /*elided*/ any;
|
|
27
|
+
readonly context: /*elided*/ any;
|
|
28
|
+
readonly overlay: /*elided*/ any;
|
|
29
|
+
readonly open: /*elided*/ any;
|
|
30
|
+
readonly state: /*elided*/ any;
|
|
31
|
+
ngOnDestroy: /*elided*/ any;
|
|
32
|
+
toggle: /*elided*/ any;
|
|
33
|
+
show: /*elided*/ any;
|
|
34
|
+
hide: /*elided*/ any;
|
|
35
|
+
createOverlay: /*elided*/ any;
|
|
36
|
+
}>>;
|
|
37
|
+
readonly parentMenu: import("ng-primitives/menu").NgpMenu | null;
|
|
38
|
+
readonly menu: import("@angular/core").InputSignal<import("ng-primitives/portal").NgpOverlayContent<unknown> | undefined>;
|
|
39
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
40
|
+
readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
|
|
41
|
+
readonly offset: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
42
|
+
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
43
|
+
readonly overlay: import("@angular/core").WritableSignal<import("ng-primitives/portal").NgpOverlay<unknown> | null>;
|
|
44
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
45
|
+
readonly state: import("ng-primitives/state").CreatedState<NgpSubmenuTrigger<unknown>>;
|
|
46
|
+
toggle: (event: MouseEvent) => void;
|
|
47
|
+
show: () => void;
|
|
48
|
+
hide: (origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
49
|
+
createOverlay: () => void;
|
|
50
|
+
showSubmenuOnArrow: (event: KeyboardEvent) => void;
|
|
51
|
+
showSubmenuOnHover: () => void;
|
|
52
|
+
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
53
|
+
/**
|
|
54
|
+
* The SubmenuTrigger state registration function.
|
|
55
|
+
*/
|
|
56
|
+
export declare const submenuTriggerState: <U>(state: U) => import("ng-primitives/state").CreatedState<U>;
|
|
@@ -1,22 +1,74 @@
|
|
|
1
1
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
|
+
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
3
|
+
import { Placement } from '@floating-ui/dom';
|
|
4
|
+
import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
|
|
2
5
|
import * as i0 from "@angular/core";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
export declare class NgpSubmenuTrigger<T = unknown> {
|
|
7
|
+
/**
|
|
8
|
+
* Access the menu trigger element.
|
|
9
|
+
*/
|
|
6
10
|
private readonly trigger;
|
|
7
|
-
/**
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Access the injector.
|
|
13
|
+
*/
|
|
14
|
+
private readonly injector;
|
|
15
|
+
/** Access the menu trigger state */
|
|
16
|
+
private readonly menuTrigger;
|
|
9
17
|
/** Access the parent menu */
|
|
10
18
|
private readonly parentMenu;
|
|
11
|
-
constructor();
|
|
12
19
|
/**
|
|
20
|
+
* Access the submenu template ref.
|
|
21
|
+
*/
|
|
22
|
+
readonly menu: import("@angular/core").InputSignal<NgpOverlayContent<T> | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Define if the trigger should be disabled.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
28
|
+
/**
|
|
29
|
+
* Define the placement of the menu relative to the trigger.
|
|
30
|
+
* @default 'right-start'
|
|
31
|
+
*/
|
|
32
|
+
readonly placement: import("@angular/core").InputSignal<Placement>;
|
|
33
|
+
/**
|
|
34
|
+
* Define the offset of the menu relative to the trigger.
|
|
35
|
+
* @default 0
|
|
36
|
+
*/
|
|
37
|
+
readonly offset: import("@angular/core").InputSignalWithTransform<number, NumberInput>;
|
|
38
|
+
/**
|
|
39
|
+
* Define whether the menu should flip when there is not enough space for the menu.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
43
|
+
/**
|
|
44
|
+
* The overlay that manages the menu
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<T> | null>;
|
|
48
|
+
/**
|
|
49
|
+
* The open state of the menu.
|
|
13
50
|
* @internal
|
|
14
51
|
*/
|
|
15
|
-
|
|
52
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Access the menu trigger state.
|
|
55
|
+
*/
|
|
56
|
+
readonly state: import("ng-primitives/state").CreatedState<NgpSubmenuTrigger<T>>;
|
|
57
|
+
constructor();
|
|
58
|
+
protected toggle(event: MouseEvent): void;
|
|
59
|
+
/**
|
|
60
|
+
* Show the menu.
|
|
61
|
+
*/
|
|
62
|
+
show(): void;
|
|
16
63
|
/**
|
|
17
64
|
* @internal
|
|
65
|
+
* Hide the menu.
|
|
66
|
+
*/
|
|
67
|
+
hide(origin?: FocusOrigin): void;
|
|
68
|
+
/**
|
|
69
|
+
* Create the overlay that will contain the menu
|
|
18
70
|
*/
|
|
19
|
-
|
|
71
|
+
private createOverlay;
|
|
20
72
|
/**
|
|
21
73
|
* If the user presses the right arrow key, we want to open the submenu
|
|
22
74
|
* and focus the first item in the submenu.
|
|
@@ -28,6 +80,6 @@ export declare class NgpSubmenuTrigger {
|
|
|
28
80
|
* If the user hovers over the trigger, we want to open the submenu
|
|
29
81
|
*/
|
|
30
82
|
protected showSubmenuOnHover(): void;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSubmenuTrigger
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSubmenuTrigger<any>, never>;
|
|
84
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger<any>, "[ngpSubmenuTrigger]", ["ngpSubmenuTrigger"], { "menu": { "alias": "ngpSubmenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpMenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpMenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpMenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpMenuTriggerFlip"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
33
85
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ng-primitives",
|
|
3
3
|
"description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.45.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
package/popover/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
export { injectOverlayContext as injectPopoverContext } from 'ng-primitives/portal';
|
|
1
2
|
export { NgpPopoverConfig, providePopoverConfig } from './config/popover-config';
|
|
2
3
|
export { NgpPopoverTrigger } from './popover-trigger/popover-trigger';
|
|
3
4
|
export { injectPopoverTriggerState, providePopoverTriggerState, } from './popover-trigger/popover-trigger-state';
|
|
4
5
|
export { NgpPopover } from './popover/popover';
|
|
5
|
-
export { injectPopoverContext, NgpPopoverContextToken } from './popover/popover-token';
|
|
6
|
-
export { getTransformOrigin } from './utils/transform-origin';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
import * as i1 from "ng-primitives/focus-trap";
|
|
4
3
|
import * as i2 from "ng-primitives/internal";
|
|
@@ -7,49 +6,9 @@ import * as i2 from "ng-primitives/internal";
|
|
|
7
6
|
*/
|
|
8
7
|
export declare class NgpPopover {
|
|
9
8
|
/**
|
|
10
|
-
* Access the
|
|
9
|
+
* Access the overlay.
|
|
11
10
|
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Access the focus trap.
|
|
15
|
-
*/
|
|
16
|
-
private readonly focusTrap;
|
|
17
|
-
/**
|
|
18
|
-
* Access the interactivity checker.
|
|
19
|
-
*/
|
|
20
|
-
private readonly interactivity;
|
|
21
|
-
/**
|
|
22
|
-
* Access the focus monitor.
|
|
23
|
-
*/
|
|
24
|
-
private readonly focusMonitor;
|
|
25
|
-
/**
|
|
26
|
-
* Access the trigger instance.
|
|
27
|
-
*/
|
|
28
|
-
protected readonly trigger: import("@angular/core").Signal<import("ng-primitives/state").State<import("ng-primitives/popover").NgpPopoverTrigger<unknown>>>;
|
|
29
|
-
/**
|
|
30
|
-
* Compute the x position of the popover.
|
|
31
|
-
*/
|
|
32
|
-
protected readonly x: import("@angular/core").Signal<number>;
|
|
33
|
-
/**
|
|
34
|
-
* Compute the y position of the popover.
|
|
35
|
-
*/
|
|
36
|
-
protected readonly y: import("@angular/core").Signal<number>;
|
|
37
|
-
/**
|
|
38
|
-
* Derive the transform origin of the popover.
|
|
39
|
-
*/
|
|
40
|
-
protected readonly transformOrigin: import("@angular/core").Signal<string>;
|
|
41
|
-
constructor();
|
|
42
|
-
/**
|
|
43
|
-
* Focus the first tabbable element inside the popover.
|
|
44
|
-
* If no tabbable element is found, focus the popover itself.
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
setInitialFocus(origin: FocusOrigin): void;
|
|
48
|
-
/**
|
|
49
|
-
* Disable the focus trap.
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
disableFocusTrap(): void;
|
|
11
|
+
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
53
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopover, never>;
|
|
54
13
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopover, "[ngpPopover]", ["ngpPopover"], {}, {}, never, never, true, [{ directive: typeof i1.NgpFocusTrap; inputs: {}; outputs: {}; }, { directive: typeof i2.NgpExitAnimation; inputs: {}; outputs: {}; }]>;
|
|
55
14
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
2
|
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
3
|
-
import { OnDestroy
|
|
3
|
+
import { OnDestroy } from '@angular/core';
|
|
4
4
|
import { Placement } from '@floating-ui/dom';
|
|
5
|
-
import {
|
|
6
|
-
import type { NgpPopover } from '../popover/popover';
|
|
5
|
+
import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Apply the `ngpPopoverTrigger` directive to an element that triggers the popover to show.
|
|
@@ -13,26 +12,6 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
13
12
|
* Access the trigger element
|
|
14
13
|
*/
|
|
15
14
|
private readonly trigger;
|
|
16
|
-
/**
|
|
17
|
-
* Access the exit animation state.
|
|
18
|
-
*/
|
|
19
|
-
private readonly exitAnimationState;
|
|
20
|
-
/**
|
|
21
|
-
* Inject the parent popover trigger if available.
|
|
22
|
-
*/
|
|
23
|
-
private readonly parentTrigger;
|
|
24
|
-
/**
|
|
25
|
-
* Access the view container ref.
|
|
26
|
-
*/
|
|
27
|
-
private readonly viewContainerRef;
|
|
28
|
-
/**
|
|
29
|
-
* Access the document.
|
|
30
|
-
*/
|
|
31
|
-
private readonly document;
|
|
32
|
-
/**
|
|
33
|
-
* Access the viewport ruler.
|
|
34
|
-
*/
|
|
35
|
-
private readonly viewportRuler;
|
|
36
15
|
/**
|
|
37
16
|
* Access the injector.
|
|
38
17
|
*/
|
|
@@ -41,18 +20,10 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
41
20
|
* Access the global popover configuration.
|
|
42
21
|
*/
|
|
43
22
|
private readonly config;
|
|
44
|
-
/**
|
|
45
|
-
* Access the disposable utilities
|
|
46
|
-
*/
|
|
47
|
-
private readonly disposables;
|
|
48
|
-
/**
|
|
49
|
-
* Access the focus monitor.
|
|
50
|
-
*/
|
|
51
|
-
private readonly focusMonitor;
|
|
52
23
|
/**
|
|
53
24
|
* Access the popover template ref.
|
|
54
25
|
*/
|
|
55
|
-
readonly popover: import("@angular/core").InputSignal<
|
|
26
|
+
readonly popover: import("@angular/core").InputSignal<NgpOverlayContent<T> | undefined>;
|
|
56
27
|
/**
|
|
57
28
|
* Define if the trigger should be disabled.
|
|
58
29
|
* @default false
|
|
@@ -104,103 +75,38 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
104
75
|
*/
|
|
105
76
|
readonly scrollBehavior: import("@angular/core").InputSignal<"reposition" | "block">;
|
|
106
77
|
/**
|
|
107
|
-
* Provide context to the popover.
|
|
108
|
-
* @default null
|
|
109
|
-
*/
|
|
110
|
-
readonly context: import("@angular/core").InputSignal<T | null>;
|
|
111
|
-
/**
|
|
112
|
-
* Store the popover view ref.
|
|
113
|
-
*/
|
|
114
|
-
protected readonly viewRef: import("@angular/core").WritableSignal<NgpPortal | undefined>;
|
|
115
|
-
/**
|
|
116
|
-
* Determines if the popover is open.
|
|
117
|
-
*/
|
|
118
|
-
readonly open: import("@angular/core").Signal<boolean>;
|
|
119
|
-
/**
|
|
120
|
-
* Derive the popover middleware from the provided configuration.
|
|
121
|
-
*/
|
|
122
|
-
private readonly middleware;
|
|
123
|
-
/**
|
|
124
|
-
* Store the computed position of the popover.
|
|
125
|
-
* @internal
|
|
126
|
-
*/
|
|
127
|
-
readonly position: import("@angular/core").WritableSignal<{
|
|
128
|
-
x: number;
|
|
129
|
-
y: number;
|
|
130
|
-
}>;
|
|
131
|
-
/**
|
|
132
|
-
* @internal
|
|
133
|
-
* Store the trigger width.
|
|
134
|
-
*/
|
|
135
|
-
readonly width: import("@angular/core").WritableSignal<number | null>;
|
|
136
|
-
/**
|
|
137
|
-
* The dispose function to stop computing the position of the popover.
|
|
138
|
-
*/
|
|
139
|
-
private dispose?;
|
|
140
|
-
/**
|
|
141
|
-
* A document-wide click listener that checks if the click
|
|
142
|
-
* occurred outside of the popover and trigger elements.
|
|
143
|
-
*/
|
|
144
|
-
private documentClickListener?;
|
|
145
|
-
/**
|
|
146
|
-
* Store the popover instance.
|
|
147
|
-
* @internal
|
|
148
|
-
*/
|
|
149
|
-
private popoverInstance;
|
|
150
|
-
/**
|
|
151
|
-
* Get the scroll strategy based on the configuration.
|
|
152
|
-
*/
|
|
153
|
-
private readonly scrollStrategy;
|
|
154
|
-
/**
|
|
155
|
-
* @internal
|
|
156
|
-
* Register any child popover to the stack.
|
|
78
|
+
* Provide context to the popover. This can be used to pass data to the popover content.
|
|
157
79
|
*/
|
|
158
|
-
readonly
|
|
80
|
+
readonly context: import("@angular/core").InputSignal<T | undefined>;
|
|
159
81
|
/**
|
|
82
|
+
* The overlay that manages the popover
|
|
160
83
|
* @internal
|
|
161
|
-
* The timeout to open the popover.
|
|
162
84
|
*/
|
|
163
|
-
|
|
85
|
+
readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<T> | null>;
|
|
164
86
|
/**
|
|
87
|
+
* The open state of the popover.
|
|
165
88
|
* @internal
|
|
166
|
-
* The timeout to close the popover.
|
|
167
89
|
*/
|
|
168
|
-
|
|
90
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
169
91
|
/**
|
|
170
92
|
* The popover trigger state.
|
|
171
93
|
*/
|
|
172
94
|
readonly state: import("ng-primitives/state").CreatedState<NgpPopoverTrigger<T>>;
|
|
173
|
-
constructor();
|
|
174
95
|
ngOnDestroy(): void;
|
|
175
|
-
protected
|
|
96
|
+
protected toggle(event: MouseEvent): void;
|
|
176
97
|
/**
|
|
177
98
|
* Show the popover.
|
|
178
99
|
*/
|
|
179
|
-
show(
|
|
100
|
+
show(): void;
|
|
180
101
|
/**
|
|
181
102
|
* @internal
|
|
182
103
|
* Hide the popover.
|
|
183
104
|
*/
|
|
184
105
|
hide(origin?: FocusOrigin): void;
|
|
185
|
-
private onDocumentClick;
|
|
186
|
-
private createPopover;
|
|
187
|
-
private destroyPopover;
|
|
188
106
|
/**
|
|
189
|
-
*
|
|
190
|
-
* Handle escape key press to close the popover.
|
|
191
|
-
*/
|
|
192
|
-
protected handleEscapeKey(): void;
|
|
193
|
-
private focusTrigger;
|
|
194
|
-
/**
|
|
195
|
-
* Set the popover instance.
|
|
196
|
-
* @internal
|
|
107
|
+
* Create the overlay that will contain the popover
|
|
197
108
|
*/
|
|
198
|
-
|
|
109
|
+
private createOverlay;
|
|
199
110
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopoverTrigger<any>, never>;
|
|
200
111
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopoverTrigger<any>, "[ngpPopoverTrigger]", ["ngpPopoverTrigger"], { "popover": { "alias": "ngpPopoverTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpPopoverTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpPopoverTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpPopoverTriggerOffset"; "required": false; "isSignal": true; }; "showDelay": { "alias": "ngpPopoverTriggerShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "ngpPopoverTriggerHideDelay"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpPopoverTriggerFlip"; "required": false; "isSignal": true; }; "container": { "alias": "ngpPopoverTriggerContainer"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "ngpPopoverTriggerCloseOnOutsideClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "ngpPopoverTriggerCloseOnEscape"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpPopoverTriggerScrollBehavior"; "required": false; "isSignal": true; }; "context": { "alias": "ngpPopoverTriggerContext"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
201
112
|
}
|
|
202
|
-
type NgpPopoverTemplateContext<T> = {
|
|
203
|
-
$implicit: T;
|
|
204
|
-
};
|
|
205
|
-
type NgpPopoverContent<T> = TemplateRef<NgpPopoverTemplateContext<T>> | Type<unknown>;
|
|
206
|
-
export {};
|
package/portal/index.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
+
export { createOverlay, injectOverlay, NgpOverlay, NgpOverlayConfig, NgpOverlayContent, NgpOverlayTemplateContext, } from './overlay';
|
|
2
|
+
export { injectOverlayContext, provideOverlayContext } from './overlay-token';
|
|
1
3
|
export { createPortal, NgpComponentPortal, NgpPortal, NgpTemplatePortal } from './portal';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValueProvider } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Injects the context for the overlay.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function injectOverlayContext<T>(): T;
|
|
7
|
+
/**
|
|
8
|
+
* Provides the context for the overlay.
|
|
9
|
+
* @param value The value to provide as the context.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function provideOverlayContext<T>(value: T): ValueProvider;
|