ng-primitives 0.44.0 → 0.45.1
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 +10 -21
- package/example-theme/index.css +1 -0
- package/fesm2022/ng-primitives-combobox.mjs +66 -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 +382 -63
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +66 -331
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +360 -2
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +56 -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 +38 -0
- package/menu/menu-trigger/menu-trigger.d.ts +91 -13
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +58 -0
- package/menu/submenu-trigger/submenu-trigger.d.ts +66 -10
- package/package.json +12 -12
- package/popover/index.d.ts +1 -2
- package/popover/popover/popover.d.ts +2 -43
- package/popover/popover-trigger/popover-trigger.d.ts +16 -106
- package/portal/index.d.ts +2 -0
- package/portal/overlay-token.d.ts +12 -0
- package/portal/overlay.d.ts +172 -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 +16 -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,96 @@
|
|
|
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 view container reference.
|
|
21
|
+
*/
|
|
22
|
+
private readonly viewContainerRef;
|
|
23
|
+
/**
|
|
24
|
+
* Access the global menu configuration.
|
|
25
|
+
*/
|
|
26
|
+
private readonly config;
|
|
27
|
+
/**
|
|
28
|
+
* Access the menu template ref.
|
|
29
|
+
*/
|
|
30
|
+
readonly menu: import("@angular/core").InputSignal<NgpOverlayContent<T> | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Define if the trigger should be disabled.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
36
|
+
/**
|
|
37
|
+
* Define the placement of the menu relative to the trigger.
|
|
38
|
+
* @default 'bottom-start'
|
|
39
|
+
*/
|
|
40
|
+
readonly placement: import("@angular/core").InputSignal<Placement>;
|
|
41
|
+
/**
|
|
42
|
+
* Define the offset of the menu relative to the trigger.
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
readonly offset: import("@angular/core").InputSignalWithTransform<number, NumberInput>;
|
|
46
|
+
/**
|
|
47
|
+
* Define whether the menu should flip when there is not enough space for the menu.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
51
|
+
/**
|
|
52
|
+
* Define the container in which the menu should be attached.
|
|
53
|
+
* @default document.body
|
|
54
|
+
*/
|
|
55
|
+
readonly container: import("@angular/core").InputSignal<HTMLElement | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Defines how the menu behaves when the window is scrolled.
|
|
58
|
+
* @default 'block'
|
|
59
|
+
*/
|
|
60
|
+
readonly scrollBehavior: import("@angular/core").InputSignal<"reposition" | "block">;
|
|
61
|
+
/**
|
|
62
|
+
* Provide context to the menu. This can be used to pass data to the menu content.
|
|
63
|
+
*/
|
|
64
|
+
readonly context: import("@angular/core").InputSignal<T | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* The overlay that manages the menu
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<T> | null>;
|
|
70
|
+
/**
|
|
71
|
+
* The open state of the menu.
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* The menu trigger state.
|
|
77
|
+
*/
|
|
78
|
+
readonly state: import("ng-primitives/state").CreatedState<NgpMenuTrigger<T>>;
|
|
79
|
+
ngOnDestroy(): void;
|
|
80
|
+
protected toggle(event: MouseEvent): void;
|
|
81
|
+
/**
|
|
82
|
+
* Show the menu.
|
|
83
|
+
*/
|
|
84
|
+
show(): void;
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
* Hide the menu.
|
|
88
|
+
*/
|
|
89
|
+
hide(origin?: FocusOrigin): void;
|
|
90
|
+
/**
|
|
91
|
+
* Create the overlay that will contain the menu
|
|
92
|
+
*/
|
|
93
|
+
private createOverlay;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgpMenuTrigger<any>, never>;
|
|
95
|
+
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
96
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 viewContainerRef: import("@angular/core").ViewContainerRef;
|
|
17
|
+
readonly menuTrigger: import("@angular/core").Signal<import("ng-primitives/state").State<{
|
|
18
|
+
readonly trigger: /*elided*/ any;
|
|
19
|
+
readonly injector: /*elided*/ any;
|
|
20
|
+
readonly viewContainerRef: /*elided*/ any;
|
|
21
|
+
readonly config: /*elided*/ any;
|
|
22
|
+
readonly menu: /*elided*/ any;
|
|
23
|
+
readonly disabled: /*elided*/ any;
|
|
24
|
+
readonly placement: /*elided*/ any;
|
|
25
|
+
readonly offset: /*elided*/ any;
|
|
26
|
+
readonly flip: /*elided*/ any;
|
|
27
|
+
readonly container: /*elided*/ any;
|
|
28
|
+
readonly scrollBehavior: /*elided*/ any;
|
|
29
|
+
readonly context: /*elided*/ any;
|
|
30
|
+
readonly overlay: /*elided*/ any;
|
|
31
|
+
readonly open: /*elided*/ any;
|
|
32
|
+
readonly state: /*elided*/ any;
|
|
33
|
+
ngOnDestroy: /*elided*/ any;
|
|
34
|
+
toggle: /*elided*/ any;
|
|
35
|
+
show: /*elided*/ any;
|
|
36
|
+
hide: /*elided*/ any;
|
|
37
|
+
createOverlay: /*elided*/ any;
|
|
38
|
+
}>>;
|
|
39
|
+
readonly parentMenu: import("ng-primitives/menu").NgpMenu | null;
|
|
40
|
+
readonly menu: import("@angular/core").InputSignal<import("ng-primitives/portal").NgpOverlayContent<unknown> | undefined>;
|
|
41
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
42
|
+
readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
|
|
43
|
+
readonly offset: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
|
|
44
|
+
readonly flip: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
45
|
+
readonly overlay: import("@angular/core").WritableSignal<import("ng-primitives/portal").NgpOverlay<unknown> | null>;
|
|
46
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
47
|
+
readonly state: import("ng-primitives/state").CreatedState<NgpSubmenuTrigger<unknown>>;
|
|
48
|
+
toggle: (event: MouseEvent) => void;
|
|
49
|
+
show: () => void;
|
|
50
|
+
hide: (origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
51
|
+
createOverlay: () => void;
|
|
52
|
+
showSubmenuOnArrow: (event: KeyboardEvent) => void;
|
|
53
|
+
showSubmenuOnHover: () => void;
|
|
54
|
+
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
55
|
+
/**
|
|
56
|
+
* The SubmenuTrigger state registration function.
|
|
57
|
+
*/
|
|
58
|
+
export declare const submenuTriggerState: <U>(state: U) => import("ng-primitives/state").CreatedState<U>;
|
|
@@ -1,22 +1,78 @@
|
|
|
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
|
+
/**
|
|
16
|
+
* Access the view container reference.
|
|
17
|
+
*/
|
|
18
|
+
private readonly viewContainerRef;
|
|
19
|
+
/** Access the menu trigger state */
|
|
20
|
+
private readonly menuTrigger;
|
|
9
21
|
/** Access the parent menu */
|
|
10
22
|
private readonly parentMenu;
|
|
11
|
-
constructor();
|
|
12
23
|
/**
|
|
24
|
+
* Access the submenu 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 'right-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
|
+
* The overlay that manages the menu
|
|
13
49
|
* @internal
|
|
14
50
|
*/
|
|
15
|
-
|
|
51
|
+
readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<T> | null>;
|
|
16
52
|
/**
|
|
53
|
+
* The open state of the menu.
|
|
17
54
|
* @internal
|
|
18
55
|
*/
|
|
19
|
-
|
|
56
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Access the menu trigger state.
|
|
59
|
+
*/
|
|
60
|
+
readonly state: import("ng-primitives/state").CreatedState<NgpSubmenuTrigger<T>>;
|
|
61
|
+
constructor();
|
|
62
|
+
protected toggle(event: MouseEvent): void;
|
|
63
|
+
/**
|
|
64
|
+
* Show the menu.
|
|
65
|
+
*/
|
|
66
|
+
show(): void;
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
* Hide the menu.
|
|
70
|
+
*/
|
|
71
|
+
hide(origin?: FocusOrigin): void;
|
|
72
|
+
/**
|
|
73
|
+
* Create the overlay that will contain the menu
|
|
74
|
+
*/
|
|
75
|
+
private createOverlay;
|
|
20
76
|
/**
|
|
21
77
|
* If the user presses the right arrow key, we want to open the submenu
|
|
22
78
|
* and focus the first item in the submenu.
|
|
@@ -28,6 +84,6 @@ export declare class NgpSubmenuTrigger {
|
|
|
28
84
|
* If the user hovers over the trigger, we want to open the submenu
|
|
29
85
|
*/
|
|
30
86
|
protected showSubmenuOnHover(): void;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSubmenuTrigger
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger
|
|
87
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSubmenuTrigger<any>, never>;
|
|
88
|
+
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
89
|
}
|
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.1",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"types": "./button/index.d.ts",
|
|
84
84
|
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
85
85
|
},
|
|
86
|
-
"./checkbox": {
|
|
87
|
-
"types": "./checkbox/index.d.ts",
|
|
88
|
-
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
89
|
-
},
|
|
90
86
|
"./combobox": {
|
|
91
87
|
"types": "./combobox/index.d.ts",
|
|
92
88
|
"default": "./fesm2022/ng-primitives-combobox.mjs"
|
|
93
89
|
},
|
|
90
|
+
"./checkbox": {
|
|
91
|
+
"types": "./checkbox/index.d.ts",
|
|
92
|
+
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
93
|
+
},
|
|
94
94
|
"./common": {
|
|
95
95
|
"types": "./common/index.d.ts",
|
|
96
96
|
"default": "./fesm2022/ng-primitives-common.mjs"
|
|
@@ -99,18 +99,14 @@
|
|
|
99
99
|
"types": "./date-picker/index.d.ts",
|
|
100
100
|
"default": "./fesm2022/ng-primitives-date-picker.mjs"
|
|
101
101
|
},
|
|
102
|
-
"./
|
|
103
|
-
"types": "./
|
|
104
|
-
"default": "./fesm2022/ng-primitives-
|
|
102
|
+
"./dialog": {
|
|
103
|
+
"types": "./dialog/index.d.ts",
|
|
104
|
+
"default": "./fesm2022/ng-primitives-dialog.mjs"
|
|
105
105
|
},
|
|
106
106
|
"./date-time-luxon": {
|
|
107
107
|
"types": "./date-time-luxon/index.d.ts",
|
|
108
108
|
"default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
|
|
109
109
|
},
|
|
110
|
-
"./dialog": {
|
|
111
|
-
"types": "./dialog/index.d.ts",
|
|
112
|
-
"default": "./fesm2022/ng-primitives-dialog.mjs"
|
|
113
|
-
},
|
|
114
110
|
"./file-upload": {
|
|
115
111
|
"types": "./file-upload/index.d.ts",
|
|
116
112
|
"default": "./fesm2022/ng-primitives-file-upload.mjs"
|
|
@@ -159,6 +155,10 @@
|
|
|
159
155
|
"types": "./portal/index.d.ts",
|
|
160
156
|
"default": "./fesm2022/ng-primitives-portal.mjs"
|
|
161
157
|
},
|
|
158
|
+
"./date-time": {
|
|
159
|
+
"types": "./date-time/index.d.ts",
|
|
160
|
+
"default": "./fesm2022/ng-primitives-date-time.mjs"
|
|
161
|
+
},
|
|
162
162
|
"./progress": {
|
|
163
163
|
"types": "./progress/index.d.ts",
|
|
164
164
|
"default": "./fesm2022/ng-primitives-progress.mjs"
|
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.
|
|
@@ -14,45 +13,21 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
14
13
|
*/
|
|
15
14
|
private readonly trigger;
|
|
16
15
|
/**
|
|
17
|
-
* Access the
|
|
18
|
-
*/
|
|
19
|
-
private readonly exitAnimationState;
|
|
20
|
-
/**
|
|
21
|
-
* Inject the parent popover trigger if available.
|
|
16
|
+
* Access the injector.
|
|
22
17
|
*/
|
|
23
|
-
private readonly
|
|
18
|
+
private readonly injector;
|
|
24
19
|
/**
|
|
25
|
-
* Access the view container
|
|
20
|
+
* Access the view container reference.
|
|
26
21
|
*/
|
|
27
22
|
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
|
-
/**
|
|
37
|
-
* Access the injector.
|
|
38
|
-
*/
|
|
39
|
-
private readonly injector;
|
|
40
23
|
/**
|
|
41
24
|
* Access the global popover configuration.
|
|
42
25
|
*/
|
|
43
26
|
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
27
|
/**
|
|
53
28
|
* Access the popover template ref.
|
|
54
29
|
*/
|
|
55
|
-
readonly popover: import("@angular/core").InputSignal<
|
|
30
|
+
readonly popover: import("@angular/core").InputSignal<NgpOverlayContent<T> | undefined>;
|
|
56
31
|
/**
|
|
57
32
|
* Define if the trigger should be disabled.
|
|
58
33
|
* @default false
|
|
@@ -104,103 +79,38 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
104
79
|
*/
|
|
105
80
|
readonly scrollBehavior: import("@angular/core").InputSignal<"reposition" | "block">;
|
|
106
81
|
/**
|
|
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.
|
|
82
|
+
* Provide context to the popover. This can be used to pass data to the popover content.
|
|
121
83
|
*/
|
|
122
|
-
|
|
84
|
+
readonly context: import("@angular/core").InputSignal<T | undefined>;
|
|
123
85
|
/**
|
|
124
|
-
*
|
|
86
|
+
* The overlay that manages the popover
|
|
125
87
|
* @internal
|
|
126
88
|
*/
|
|
127
|
-
readonly
|
|
128
|
-
x: number;
|
|
129
|
-
y: number;
|
|
130
|
-
}>;
|
|
89
|
+
readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<T> | null>;
|
|
131
90
|
/**
|
|
91
|
+
* The open state of the popover.
|
|
132
92
|
* @internal
|
|
133
|
-
* Store the trigger width.
|
|
134
93
|
*/
|
|
135
|
-
readonly
|
|
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.
|
|
157
|
-
*/
|
|
158
|
-
readonly stack: NgpPopoverTrigger<any>[];
|
|
159
|
-
/**
|
|
160
|
-
* @internal
|
|
161
|
-
* The timeout to open the popover.
|
|
162
|
-
*/
|
|
163
|
-
private openTimeout?;
|
|
164
|
-
/**
|
|
165
|
-
* @internal
|
|
166
|
-
* The timeout to close the popover.
|
|
167
|
-
*/
|
|
168
|
-
private closeTimeout?;
|
|
94
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
|
169
95
|
/**
|
|
170
96
|
* The popover trigger state.
|
|
171
97
|
*/
|
|
172
98
|
readonly state: import("ng-primitives/state").CreatedState<NgpPopoverTrigger<T>>;
|
|
173
|
-
constructor();
|
|
174
99
|
ngOnDestroy(): void;
|
|
175
|
-
protected
|
|
100
|
+
protected toggle(event: MouseEvent): void;
|
|
176
101
|
/**
|
|
177
102
|
* Show the popover.
|
|
178
103
|
*/
|
|
179
|
-
show(
|
|
104
|
+
show(): void;
|
|
180
105
|
/**
|
|
181
106
|
* @internal
|
|
182
107
|
* Hide the popover.
|
|
183
108
|
*/
|
|
184
109
|
hide(origin?: FocusOrigin): void;
|
|
185
|
-
private onDocumentClick;
|
|
186
|
-
private createPopover;
|
|
187
|
-
private destroyPopover;
|
|
188
110
|
/**
|
|
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
|
|
111
|
+
* Create the overlay that will contain the popover
|
|
197
112
|
*/
|
|
198
|
-
|
|
113
|
+
private createOverlay;
|
|
199
114
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopoverTrigger<any>, never>;
|
|
200
115
|
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
116
|
}
|
|
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;
|