ng-primitives 0.117.0 → 0.117.2
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/dialog/index.d.ts +30 -10
- package/fesm2022/ng-primitives-dialog.mjs +75 -20
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +27 -56
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +7 -7
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +16 -1
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +12 -6
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/package.json +1 -1
- package/popover/index.d.ts +9 -9
- package/portal/index.d.ts +181 -171
package/dialog/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ViewContainerRef, Injector, Provider, OnDestroy, TemplateRef, Type } from '@angular/core';
|
|
3
|
-
import { ScrollStrategy, NgpOverlayRef } from 'ng-primitives/portal';
|
|
3
|
+
import { NgpDismissGuard, ScrollStrategy, NgpOverlayRef, NgpDismissGuardInput } from 'ng-primitives/portal';
|
|
4
4
|
import * as i1 from 'ng-primitives/internal';
|
|
5
5
|
import { Subject, Observable } from 'rxjs';
|
|
6
6
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
@@ -26,9 +26,16 @@ interface NgpDialogConfig<T = any> {
|
|
|
26
26
|
* navigation (back/forward) and programmatic route changes (e.g. router.navigate()).
|
|
27
27
|
*/
|
|
28
28
|
closeOnNavigation?: boolean;
|
|
29
|
-
/** Whether the dialog should close when the user presses the escape key. */
|
|
30
|
-
closeOnEscape?:
|
|
31
|
-
/**
|
|
29
|
+
/** Whether the dialog should close when the user presses the escape key, or a guard function. */
|
|
30
|
+
closeOnEscape?: NgpDismissGuard<KeyboardEvent>;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the dialog should close when clicking outside (on the overlay), or a guard function.
|
|
33
|
+
*/
|
|
34
|
+
closeOnOutsideClick?: NgpDismissGuard<Element>;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the dialog should close when the user clicks the overlay.
|
|
37
|
+
* @deprecated Use `closeOnOutsideClick` instead.
|
|
38
|
+
*/
|
|
32
39
|
closeOnClick?: boolean;
|
|
33
40
|
/** Scroll strategy to be used for the dialog. */
|
|
34
41
|
scrollStrategy?: ScrollStrategy;
|
|
@@ -62,6 +69,7 @@ declare class NgpDialogOverlay {
|
|
|
62
69
|
readonly closeOnClick: _angular_core.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
63
70
|
protected onPointerDown(event: Event): void;
|
|
64
71
|
protected onClick(event: Event): void;
|
|
72
|
+
private evaluateGuard;
|
|
65
73
|
protected resetPointerOrigin(): void;
|
|
66
74
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpDialogOverlay, never>;
|
|
67
75
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpDialogOverlay, "[ngpDialogOverlay]", ["ngpDialogOverlay"], { "closeOnClick": { "alias": "ngpDialogOverlayCloseOnClick"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpExitAnimation; inputs: {}; outputs: {}; }]>;
|
|
@@ -91,15 +99,22 @@ declare class NgpDialogRef<T = unknown, R = unknown> implements NgpOverlayRef {
|
|
|
91
99
|
private readonly document;
|
|
92
100
|
/** Whether the user is allowed to close the dialog. */
|
|
93
101
|
disableClose: boolean | undefined;
|
|
94
|
-
/** Whether the escape key is allowed to close the dialog. */
|
|
95
|
-
closeOnEscape:
|
|
102
|
+
/** Whether the escape key is allowed to close the dialog, or a guard function. */
|
|
103
|
+
closeOnEscape: NgpDismissGuard<KeyboardEvent> | undefined;
|
|
104
|
+
/** Whether clicking outside (on the overlay) is allowed to close the dialog, or a guard function. */
|
|
105
|
+
closeOnOutsideClick: NgpDismissGuard<Element> | undefined;
|
|
96
106
|
/** Emits when the dialog has been closed. */
|
|
97
107
|
readonly closed: Subject<{
|
|
98
108
|
focusOrigin?: FocusOrigin;
|
|
99
109
|
result?: R;
|
|
100
110
|
}>;
|
|
111
|
+
/** @internal */
|
|
112
|
+
readonly afterClosed$: Subject<{
|
|
113
|
+
focusOrigin?: FocusOrigin;
|
|
114
|
+
result?: R;
|
|
115
|
+
}>;
|
|
101
116
|
/**
|
|
102
|
-
* Observable that emits the dialog result
|
|
117
|
+
* Observable that emits the dialog result after exit animations have completed.
|
|
103
118
|
*/
|
|
104
119
|
readonly afterClosed: Observable<R | undefined>;
|
|
105
120
|
/** Data passed from the dialog opener. */
|
|
@@ -268,10 +283,15 @@ declare class NgpDialogTrigger<T = unknown> {
|
|
|
268
283
|
/** Emits whenever the dialog is closed with the given result. */
|
|
269
284
|
readonly closed: _angular_core.OutputEmitterRef<T>;
|
|
270
285
|
/**
|
|
271
|
-
* Whether the dialog should close on escape.
|
|
286
|
+
* Whether the dialog should close on escape, or a guard function.
|
|
287
|
+
* @default `true`
|
|
288
|
+
*/
|
|
289
|
+
readonly closeOnEscape: _angular_core.InputSignalWithTransform<NgpDismissGuard<KeyboardEvent>, NgpDismissGuardInput<KeyboardEvent>>;
|
|
290
|
+
/**
|
|
291
|
+
* Whether the dialog should close on outside click, or a guard function.
|
|
272
292
|
* @default `true`
|
|
273
293
|
*/
|
|
274
|
-
readonly
|
|
294
|
+
readonly closeOnOutsideClick: _angular_core.InputSignalWithTransform<NgpDismissGuard<Element>, NgpDismissGuardInput<Element>>;
|
|
275
295
|
/**
|
|
276
296
|
* Store the dialog ref.
|
|
277
297
|
* @internal
|
|
@@ -279,7 +299,7 @@ declare class NgpDialogTrigger<T = unknown> {
|
|
|
279
299
|
private dialogRef;
|
|
280
300
|
protected launch(): void;
|
|
281
301
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpDialogTrigger<any>, never>;
|
|
282
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpDialogTrigger<any>, "[ngpDialogTrigger]", ["ngpDialogTrigger"], { "template": { "alias": "ngpDialogTrigger"; "required": true; "isSignal": true; }; "closeOnEscape": { "alias": "ngpDialogTriggerCloseOnEscape"; "required": false; "isSignal": true; }; }, { "closed": "ngpDialogTriggerClosed"; }, never, never, true, never>;
|
|
302
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpDialogTrigger<any>, "[ngpDialogTrigger]", ["ngpDialogTrigger"], { "template": { "alias": "ngpDialogTrigger"; "required": true; "isSignal": true; }; "closeOnEscape": { "alias": "ngpDialogTriggerCloseOnEscape"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "ngpDialogTriggerCloseOnOutsideClick"; "required": false; "isSignal": true; }; }, { "closed": "ngpDialogTriggerClosed"; }, never, never, true, never>;
|
|
283
303
|
}
|
|
284
304
|
|
|
285
305
|
declare class NgpDialog<T = unknown, R = unknown> implements OnDestroy {
|
|
@@ -6,11 +6,11 @@ import * as i1 from 'ng-primitives/internal';
|
|
|
6
6
|
import { NgpExitAnimationManager, NgpExitAnimation } from 'ng-primitives/internal';
|
|
7
7
|
import { Subject, defer, EMPTY, fromEvent } from 'rxjs';
|
|
8
8
|
import { map, filter, takeUntil, startWith } from 'rxjs/operators';
|
|
9
|
+
import { NgpOverlayRegistry, createPortal, BlockScrollStrategy, dismissGuardAttribute } from 'ng-primitives/portal';
|
|
9
10
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
10
11
|
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
11
12
|
import { DOCUMENT } from '@angular/common';
|
|
12
13
|
import { Router, NavigationStart } from '@angular/router';
|
|
13
|
-
import { NgpOverlayRegistry, createPortal, BlockScrollStrategy } from 'ng-primitives/portal';
|
|
14
14
|
import * as i1$1 from 'ng-primitives/focus-trap';
|
|
15
15
|
import { NgpFocusTrap } from 'ng-primitives/focus-trap';
|
|
16
16
|
|
|
@@ -101,10 +101,12 @@ class NgpDialogRef {
|
|
|
101
101
|
this.document = document;
|
|
102
102
|
/** Emits when the dialog has been closed. */
|
|
103
103
|
this.closed = new Subject();
|
|
104
|
+
/** @internal */
|
|
105
|
+
this.afterClosed$ = new Subject();
|
|
104
106
|
/**
|
|
105
|
-
* Observable that emits the dialog result
|
|
107
|
+
* Observable that emits the dialog result after exit animations have completed.
|
|
106
108
|
*/
|
|
107
|
-
this.afterClosed = this.
|
|
109
|
+
this.afterClosed = this.afterClosed$.pipe(map(event => event.result));
|
|
108
110
|
/** Whether the dialog is closing. */
|
|
109
111
|
this.closing = false;
|
|
110
112
|
/** @internal Portal reference for element access and detach. */
|
|
@@ -120,6 +122,7 @@ class NgpDialogRef {
|
|
|
120
122
|
this.data = config.data;
|
|
121
123
|
this.id = config.id; // By the time the dialog is created we are guaranteed to have an ID.
|
|
122
124
|
this.closeOnEscape = config.closeOnEscape ?? true;
|
|
125
|
+
this.closeOnOutsideClick = config.closeOnOutsideClick;
|
|
123
126
|
// Use defer() so the observable is created on subscribe — by then the portal will be set.
|
|
124
127
|
this.keydownEvents = defer(() => {
|
|
125
128
|
const elements = this.getElements();
|
|
@@ -152,13 +155,15 @@ class NgpDialogRef {
|
|
|
152
155
|
return;
|
|
153
156
|
}
|
|
154
157
|
this.closing = true;
|
|
158
|
+
this.closed.next({});
|
|
159
|
+
this.closed.complete();
|
|
155
160
|
// Detach the portal immediately — no exit animation
|
|
156
161
|
if (this.portal) {
|
|
157
162
|
await this.portal.detach(true);
|
|
158
163
|
this.portal = null;
|
|
159
164
|
}
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
165
|
+
this.afterClosed$.next({});
|
|
166
|
+
this.afterClosed$.complete();
|
|
162
167
|
}
|
|
163
168
|
/**
|
|
164
169
|
* Close the dialog.
|
|
@@ -171,6 +176,9 @@ class NgpDialogRef {
|
|
|
171
176
|
return;
|
|
172
177
|
}
|
|
173
178
|
this.closing = true;
|
|
179
|
+
// Emit immediately so consumers can react before exit animations run.
|
|
180
|
+
this.closed.next({ focusOrigin, result });
|
|
181
|
+
this.closed.complete();
|
|
174
182
|
const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {
|
|
175
183
|
optional: true,
|
|
176
184
|
});
|
|
@@ -182,8 +190,8 @@ class NgpDialogRef {
|
|
|
182
190
|
await this.portal.detach(true);
|
|
183
191
|
this.portal = null;
|
|
184
192
|
}
|
|
185
|
-
this.
|
|
186
|
-
this.
|
|
193
|
+
this.afterClosed$.next({ focusOrigin, result });
|
|
194
|
+
this.afterClosed$.complete();
|
|
187
195
|
}
|
|
188
196
|
/**
|
|
189
197
|
* @deprecated Access dialog methods directly instead (keydownEvents, outsidePointerEvents,
|
|
@@ -229,13 +237,46 @@ class NgpDialogOverlay {
|
|
|
229
237
|
this.startedPointerDownOnOverlay = event.target === event.currentTarget;
|
|
230
238
|
}
|
|
231
239
|
onClick(event) {
|
|
232
|
-
const
|
|
233
|
-
event.target === event.currentTarget &&
|
|
234
|
-
this.closeOnClick() &&
|
|
235
|
-
!this.dialogRef.disableClose;
|
|
240
|
+
const isOverlayClick = this.startedPointerDownOnOverlay && event.target === event.currentTarget;
|
|
236
241
|
this.resetPointerOrigin();
|
|
237
|
-
if (
|
|
242
|
+
if (!isOverlayClick || this.dialogRef.disableClose) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const guard = this.dialogRef.closeOnOutsideClick ?? this.closeOnClick() ?? true;
|
|
246
|
+
this.evaluateGuard(guard, event.target);
|
|
247
|
+
}
|
|
248
|
+
evaluateGuard(guard, target) {
|
|
249
|
+
if (guard === true) {
|
|
238
250
|
this.dialogRef.close(undefined, 'mouse');
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (guard === false) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
// Function guard — evaluate sync or async
|
|
257
|
+
let result;
|
|
258
|
+
try {
|
|
259
|
+
result = guard(target);
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
console.error('NgpDialogOverlay: dismiss guard threw', error);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (typeof result === 'boolean') {
|
|
266
|
+
if (result) {
|
|
267
|
+
this.dialogRef.close(undefined, 'mouse');
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
result
|
|
272
|
+
.then(shouldClose => {
|
|
273
|
+
if (shouldClose) {
|
|
274
|
+
this.dialogRef.close(undefined, 'mouse');
|
|
275
|
+
}
|
|
276
|
+
})
|
|
277
|
+
.catch(error => {
|
|
278
|
+
console.error('NgpDialogOverlay: dismiss guard rejected', error);
|
|
279
|
+
});
|
|
239
280
|
}
|
|
240
281
|
}
|
|
241
282
|
resetPointerOrigin() {
|
|
@@ -398,15 +439,17 @@ class NgpDialogManager {
|
|
|
398
439
|
this.openDialogs.push(dialogRef);
|
|
399
440
|
this.afterOpened.next(dialogRef);
|
|
400
441
|
this.subscribeToRouterEvents();
|
|
401
|
-
dialogRef.closed.subscribe(
|
|
402
|
-
// Deregister from the overlay registry
|
|
442
|
+
dialogRef.closed.subscribe(() => {
|
|
443
|
+
// Deregister from the overlay registry immediately so stacking order is updated.
|
|
403
444
|
this.registry.deregister(dialogRef.id);
|
|
404
445
|
this.removeOpenDialog(dialogRef, true);
|
|
405
|
-
|
|
446
|
+
});
|
|
447
|
+
dialogRef.afterClosed$.subscribe(({ focusOrigin }) => {
|
|
448
|
+
// Focus the trigger element after exit animations complete.
|
|
406
449
|
if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {
|
|
407
450
|
// Its not great that we are relying on an internal API here, but we need to in order to
|
|
408
451
|
// try and best determine the focus origin when it is programmatically closed by the user.
|
|
409
|
-
this.focusMonitor.focusVia(activeElement,
|
|
452
|
+
this.focusMonitor.focusVia(activeElement, focusOrigin ?? this.focusMonitor._lastFocusOrigin);
|
|
410
453
|
}
|
|
411
454
|
});
|
|
412
455
|
return dialogRef;
|
|
@@ -577,11 +620,22 @@ class NgpDialogTrigger {
|
|
|
577
620
|
/** Emits whenever the dialog is closed with the given result. */
|
|
578
621
|
this.closed = output({ alias: 'ngpDialogTriggerClosed' });
|
|
579
622
|
/**
|
|
580
|
-
* Whether the dialog should close on escape.
|
|
623
|
+
* Whether the dialog should close on escape, or a guard function.
|
|
581
624
|
* @default `true`
|
|
582
625
|
*/
|
|
583
|
-
this.closeOnEscape = input(this.config.closeOnEscape, ...(ngDevMode ? [{ debugName: "closeOnEscape", alias: 'ngpDialogTriggerCloseOnEscape'
|
|
626
|
+
this.closeOnEscape = input(this.config.closeOnEscape ?? true, ...(ngDevMode ? [{ debugName: "closeOnEscape", alias: 'ngpDialogTriggerCloseOnEscape',
|
|
627
|
+
transform: dismissGuardAttribute }] : [{
|
|
584
628
|
alias: 'ngpDialogTriggerCloseOnEscape',
|
|
629
|
+
transform: dismissGuardAttribute,
|
|
630
|
+
}]));
|
|
631
|
+
/**
|
|
632
|
+
* Whether the dialog should close on outside click, or a guard function.
|
|
633
|
+
* @default `true`
|
|
634
|
+
*/
|
|
635
|
+
this.closeOnOutsideClick = input(this.config.closeOnOutsideClick ?? true, ...(ngDevMode ? [{ debugName: "closeOnOutsideClick", alias: 'ngpDialogTriggerCloseOnOutsideClick',
|
|
636
|
+
transform: dismissGuardAttribute }] : [{
|
|
637
|
+
alias: 'ngpDialogTriggerCloseOnOutsideClick',
|
|
638
|
+
transform: dismissGuardAttribute,
|
|
585
639
|
}]));
|
|
586
640
|
/**
|
|
587
641
|
* Store the dialog ref.
|
|
@@ -592,6 +646,7 @@ class NgpDialogTrigger {
|
|
|
592
646
|
launch() {
|
|
593
647
|
this.dialogRef = this.dialogManager.open(this.template(), {
|
|
594
648
|
closeOnEscape: this.closeOnEscape(),
|
|
649
|
+
closeOnOutsideClick: this.closeOnOutsideClick(),
|
|
595
650
|
});
|
|
596
651
|
this.dialogRef.closed.subscribe(({ result }) => {
|
|
597
652
|
this.closed.emit(result);
|
|
@@ -599,7 +654,7 @@ class NgpDialogTrigger {
|
|
|
599
654
|
});
|
|
600
655
|
}
|
|
601
656
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpDialogTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
602
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpDialogTrigger, isStandalone: true, selector: "[ngpDialogTrigger]", inputs: { template: { classPropertyName: "template", publicName: "ngpDialogTrigger", isSignal: true, isRequired: true, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpDialogTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "ngpDialogTriggerClosed" }, host: { listeners: { "click": "launch()" } }, exportAs: ["ngpDialogTrigger"], ngImport: i0 }); }
|
|
657
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpDialogTrigger, isStandalone: true, selector: "[ngpDialogTrigger]", inputs: { template: { classPropertyName: "template", publicName: "ngpDialogTrigger", isSignal: true, isRequired: true, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpDialogTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "ngpDialogTriggerCloseOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "ngpDialogTriggerClosed" }, host: { listeners: { "click": "launch()" } }, exportAs: ["ngpDialogTrigger"], ngImport: i0 }); }
|
|
603
658
|
}
|
|
604
659
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpDialogTrigger, decorators: [{
|
|
605
660
|
type: Directive,
|
|
@@ -607,7 +662,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
607
662
|
selector: '[ngpDialogTrigger]',
|
|
608
663
|
exportAs: 'ngpDialogTrigger',
|
|
609
664
|
}]
|
|
610
|
-
}], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpDialogTrigger", required: true }] }], closed: [{ type: i0.Output, args: ["ngpDialogTriggerClosed"] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpDialogTriggerCloseOnEscape", required: false }] }], launch: [{
|
|
665
|
+
}], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpDialogTrigger", required: true }] }], closed: [{ type: i0.Output, args: ["ngpDialogTriggerClosed"] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpDialogTriggerCloseOnEscape", required: false }] }], closeOnOutsideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpDialogTriggerCloseOnOutsideClick", required: false }] }], launch: [{
|
|
611
666
|
type: HostListener,
|
|
612
667
|
args: ['click']
|
|
613
668
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-dialog.mjs","sources":["../../../../packages/ng-primitives/dialog/src/config/dialog-config.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-state.ts","../../../../packages/ng-primitives/dialog/src/dialog-description/dialog-description.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-ref.ts","../../../../packages/ng-primitives/dialog/src/dialog-overlay/dialog-overlay.ts","../../../../packages/ng-primitives/dialog/src/dialog-title/dialog-title.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.service.ts","../../../../packages/ng-primitives/dialog/src/dialog-trigger/dialog-trigger.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.ts","../../../../packages/ng-primitives/dialog/src/ng-primitives-dialog.ts"],"sourcesContent":["import { InjectionToken, Injector, Provider, ViewContainerRef, inject } from '@angular/core';\nimport { ScrollStrategy } from 'ng-primitives/portal';\n\n/** Valid ARIA roles for a dialog. */\nexport type NgpDialogRole = 'dialog' | 'alertdialog';\n\nexport interface NgpDialogConfig<T = any> {\n /** The view container to attach the dialog to. */\n viewContainerRef?: ViewContainerRef;\n\n /** The injector to use for the dialog. Defaults to the view container's injector.*/\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The role of the dialog. */\n role?: NgpDialogRole;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n modal?: boolean;\n\n /**\n * Whether the dialog should close when the user navigates. This includes both browser history\n * navigation (back/forward) and programmatic route changes (e.g. router.navigate()).\n */\n closeOnNavigation?: boolean;\n\n /** Whether the dialog should close when the user presses the escape key. */\n closeOnEscape?: boolean;\n\n /** Whether the dialog should close when the user clicks the overlay. */\n closeOnClick?: boolean;\n\n /** Scroll strategy to be used for the dialog. */\n scrollStrategy?: ScrollStrategy;\n\n data?: T;\n}\n\nexport const defaultDialogConfig: NgpDialogConfig = {\n role: 'dialog',\n modal: true,\n closeOnNavigation: true,\n closeOnEscape: true,\n closeOnClick: true,\n};\n\nexport const NgpDialogConfigToken = new InjectionToken<NgpDialogConfig>('NgpDialogConfigToken');\n\n/**\n * Provide the default Dialog configuration\n * @param config The Dialog configuration\n * @returns The provider\n */\nexport function provideDialogConfig(config: Partial<NgpDialogConfig>): Provider[] {\n return [\n {\n provide: NgpDialogConfigToken,\n useValue: { ...defaultDialogConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Dialog configuration\n * @returns The global Dialog configuration\n */\nexport function injectDialogConfig(): NgpDialogConfig {\n return inject(NgpDialogConfigToken, { optional: true }) ?? defaultDialogConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpDialog } from './dialog';\n\n/**\n * The state token for the Dialog primitive.\n */\nexport const NgpDialogStateToken = createStateToken<NgpDialog<any, any>>('Dialog');\n\n/**\n * Provides the Dialog state.\n */\nexport const provideDialogState = createStateProvider(NgpDialogStateToken);\n\n/**\n * Injects the Dialog state.\n */\nexport const injectDialogState = createStateInjector<NgpDialog>(NgpDialogStateToken);\n\n/**\n * The Dialog state registration function.\n */\nexport const dialogState = createState(NgpDialogStateToken);\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogDescription]',\n exportAs: 'ngpDialogDescription',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogDescription implements OnDestroy {\n /** Access the dialog */\n private readonly dialog = injectDialogState();\n\n /** The id of the descriptions. */\n readonly id = input<string>(uniqueId('ngp-dialog-description'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeDescribedBy(prevId);\n }\n\n if (id) {\n this.dialog().setDescribedBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeDescribedBy(this.id());\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { inject, Injector } from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { NgpOverlayRef } from 'ng-primitives/portal';\nimport { defer, EMPTY, fromEvent, Observable, Subject } from 'rxjs';\nimport { filter, map, takeUntil } from 'rxjs/operators';\nimport { NgpDialogConfig } from '../config/dialog-config';\n\n/** Minimal portal interface needed by the dialog ref. */\nexport interface NgpDialogPortalRef {\n getElements(): HTMLElement[];\n detach(immediate?: boolean): Promise<void>;\n}\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class NgpDialogRef<T = unknown, R = unknown> implements NgpOverlayRef {\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Whether the escape key is allowed to close the dialog. */\n closeOnEscape: boolean | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /**\n * Observable that emits the dialog result when closed.\n */\n readonly afterClosed: Observable<R | undefined> = this.closed.pipe(map(event => event.result));\n\n /** Data passed from the dialog opener. */\n readonly data: T;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** @internal Store the injector */\n injector: Injector | undefined;\n\n /** Whether the dialog is closing. */\n private closing = false;\n\n /** @internal Portal reference for element access and detach. */\n portal: NgpDialogPortalRef | null = null;\n\n /** Emits on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /**\n * Emits pointer events (click, auxclick, contextmenu) that happen outside of the dialog.\n * Fed by the NgpOverlayRegistry with CDK-compatible stacking awareness.\n * @internal\n */\n readonly outsidePointerEvents$ = new Subject<MouseEvent>();\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent> = this.outsidePointerEvents$.asObservable();\n\n constructor(\n readonly config: NgpDialogConfig<T>,\n private readonly document: Document,\n ) {\n this.data = config.data as T;\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n this.closeOnEscape = config.closeOnEscape ?? true;\n\n // Use defer() so the observable is created on subscribe — by then the portal will be set.\n this.keydownEvents = defer(() => {\n const elements = this.getElements();\n if (!elements.length) return EMPTY;\n return fromEvent<KeyboardEvent>(this.document, 'keydown').pipe(\n filter(event => elements.some(el => el.contains(event.target as Node))),\n takeUntil(this.closed),\n );\n });\n }\n\n /**\n * Updates the position of the dialog. No-op since dialogs are CSS-centered.\n */\n updatePosition(): this {\n return this;\n }\n\n /**\n * NgpOverlayRef implementation — called by the registry for escape-key dismiss.\n */\n hide(options?: { immediate?: boolean; origin?: FocusOrigin }): void {\n if (this.disableClose) {\n return;\n }\n this.close(undefined, options?.origin);\n }\n\n /**\n * NgpOverlayRef implementation — called by the registry for descendant cascade.\n * Skips exit animations and tears down immediately.\n */\n async hideImmediate(): Promise<void> {\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n // Detach the portal immediately — no exit animation\n if (this.portal) {\n await this.portal.detach(true);\n this.portal = null;\n }\n\n this.closed.next({});\n this.closed.complete();\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param focusOrigin The origin of the focus event that triggered the close.\n */\n async close(result?: R, focusOrigin?: FocusOrigin): Promise<void> {\n // If the dialog is already closed, do nothing.\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {\n optional: true,\n });\n if (exitAnimationManager) {\n await exitAnimationManager.exit();\n }\n\n // Detach the portal (immediate since exit animation already ran)\n if (this.portal) {\n await this.portal.detach(true);\n this.portal = null;\n }\n\n this.closed.next({ focusOrigin, result });\n this.closed.complete();\n }\n\n /**\n * @deprecated Access dialog methods directly instead (keydownEvents, outsidePointerEvents,\n * updatePosition, close). This shim will be removed in the next major version.\n */\n get overlayRef(): {\n keydownEvents: () => Observable<KeyboardEvent>;\n outsidePointerEvents: () => Observable<MouseEvent>;\n updatePosition: () => NgpDialogRef<T, R>;\n dispose: () => Promise<void>;\n detachments: () => Observable<{ focusOrigin?: FocusOrigin; result?: R }>;\n overlayElement: HTMLElement | undefined;\n } {\n return {\n keydownEvents: () => this.keydownEvents,\n outsidePointerEvents: () => this.outsidePointerEvents,\n updatePosition: () => this.updatePosition(),\n dispose: () => this.close(),\n detachments: () => this.closed.asObservable(),\n overlayElement: this.getElements()[0] as HTMLElement | undefined,\n };\n }\n\n /**\n * Get the portal elements.\n * @internal\n */\n getElements(): HTMLElement[] {\n return this.portal?.getElements() ?? [];\n }\n}\n\nexport function injectDialogRef<T = unknown, R = unknown>(): NgpDialogRef<T, R> {\n return inject<NgpDialogRef<T, R>>(NgpDialogRef);\n}\n","import { booleanAttribute, Directive, input } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { injectDialogRef } from '../dialog/dialog-ref';\n\n@Directive({\n selector: '[ngpDialogOverlay]',\n exportAs: 'ngpDialogOverlay',\n hostDirectives: [NgpExitAnimation],\n host: {\n '(pointerdown)': 'onPointerDown($event)',\n '(click)': 'onClick($event)',\n '(pointercancel)': 'resetPointerOrigin()',\n },\n})\nexport class NgpDialogOverlay {\n private readonly dialogRef = injectDialogRef();\n private startedPointerDownOnOverlay = false;\n\n /**\n * Whether the dialog should close on backdrop click.\n * @default `true`\n */\n readonly closeOnClick = input(this.dialogRef.config.closeOnClick, {\n alias: 'ngpDialogOverlayCloseOnClick',\n transform: booleanAttribute,\n });\n\n protected onPointerDown(event: Event): void {\n this.startedPointerDownOnOverlay = event.target === event.currentTarget;\n }\n\n protected onClick(event: Event): void {\n const shouldClose =\n this.startedPointerDownOnOverlay &&\n event.target === event.currentTarget &&\n this.closeOnClick() &&\n !this.dialogRef.disableClose;\n\n this.resetPointerOrigin();\n\n if (shouldClose) {\n this.dialogRef.close(undefined, 'mouse');\n }\n }\n\n protected resetPointerOrigin(): void {\n this.startedPointerDownOnOverlay = false;\n }\n}\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogTitle]',\n exportAs: 'ngpDialogTitle',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogTitle implements OnDestroy {\n /** Access the dialog. */\n private readonly dialog = injectDialogState();\n\n /** The id of the title. */\n readonly id = input<string>(uniqueId('ngp-dialog-title'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeLabelledBy(prevId);\n }\n\n if (id) {\n this.dialog().setLabelledBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeLabelledBy(this.id());\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n OnDestroy,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NavigationStart, Router } from '@angular/router';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport {\n BlockScrollStrategy,\n NgpOverlayRegistry,\n ScrollStrategy,\n createPortal,\n} from 'ng-primitives/portal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable, Subject, Subscription, defer } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { NgpDialogConfig, injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from './dialog-ref';\n\n/**\n * Originally based on Angular CDK Dialog service.\n * Re-implemented to use ng-primitives/portal instead of @angular/cdk/overlay.\n */\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpDialogManager implements OnDestroy {\n private readonly applicationRef = inject(ApplicationRef);\n private readonly injector = inject(Injector);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly viewportRuler = inject(ViewportRuler);\n private readonly registry = inject(NgpOverlayRegistry);\n private readonly defaultOptions = injectDialogConfig();\n private readonly parentDialogManager = inject(NgpDialogManager, {\n optional: true,\n skipSelf: true,\n });\n private readonly router = inject(Router, { optional: true });\n\n private openDialogsAtThisLevel: NgpDialogRef[] = [];\n private readonly afterAllClosedAtThisLevel = new Subject<void>();\n private readonly afterOpenedAtThisLevel = new Subject<NgpDialogRef>();\n private ariaHiddenElements = new Map<Element, string | null>();\n private routerSubscription: Subscription | undefined;\n\n /** Scroll blocking strategy — shared across all dialogs. */\n private scrollStrategy: ScrollStrategy | null = null;\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly NgpDialogRef[] {\n return this.parentDialogManager\n ? this.parentDialogManager.openDialogs\n : this.openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<NgpDialogRef> {\n return this.parentDialogManager\n ? this.parentDialogManager.afterOpened\n : this.afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this.getAfterAllClosed()\n : this.getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n /**\n * Opens a modal dialog containing the given template or component.\n */\n open(\n templateRefOrComponentType: TemplateRef<NgpDialogContext> | Type<unknown>,\n config?: NgpDialogConfig,\n ): NgpDialogRef;\n\n /**\n * Opens a modal dialog containing the given template or component with typed data.\n */\n open<T, R = unknown>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config: NgpDialogConfig<T> & { data: T },\n ): NgpDialogRef<T, R>;\n\n /**\n * Opens a modal dialog with typed result but no data (explicit void for data type).\n */\n open<T extends void, R>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config?: NgpDialogConfig,\n ): NgpDialogRef<T, R>;\n\n open(\n templateRefOrComponentType: TemplateRef<any> | Type<unknown>,\n config?: NgpDialogConfig<any>,\n ): NgpDialogRef<any, any> {\n // store the current active element so we can focus it after the dialog is closed\n const activeElement = this.document.activeElement;\n\n // this is not ideal, but there is a case where a dialog trigger is within an overlay (e.g. menu),\n // which may be removed before the dialog is closed. This is not desired, so we need to access a view container ref\n // that is not within the overlay. To solve this we use the view container ref of the root component.\n // Could this have any unintended side effects? For example, the dialog would not be closed during route changes?\n const viewContainerRef =\n this.applicationRef.components[0]?.injector.get(ViewContainerRef) ??\n config?.viewContainerRef ??\n config?.injector?.get(ViewContainerRef);\n\n const defaults = this.defaultOptions;\n config = { ...defaults, viewContainerRef, ...config };\n config.id = config.id ?? uniqueId('ngp-dialog');\n\n if (config.id && this.getDialogById(config.id) && isDevMode()) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const dialogRef = new NgpDialogRef(config, this.document);\n const injector = this.createInjector(config, dialogRef);\n\n // store the injector in the dialog ref - this is so we can access the exit animation manager\n dialogRef.injector = injector;\n\n const context: NgpDialogContext = {\n $implicit: dialogRef,\n close: dialogRef.close.bind(dialogRef),\n };\n\n // Create the portal using our portal system\n const portal = createPortal(\n templateRefOrComponentType,\n config.viewContainerRef!,\n injector,\n context,\n );\n\n // Attach the portal to document.body\n portal.attach(this.document.body);\n\n // Store the portal reference on the dialog ref for element access and cleanup\n dialogRef.portal = portal;\n\n // If this is the first dialog that we're opening, hide all the non-overlay content\n // and enable scroll blocking.\n if (!this.openDialogs.length) {\n this.hideNonDialogContentFromAssistiveTechnology(portal.getElements());\n this.enableScrollBlocking(config);\n }\n\n // Auto-detect parent overlay: if the trigger element lives inside an existing overlay\n // (e.g. a dialog opened from a popover), register as its child so that clicks inside\n // the dialog don't dismiss the parent overlay.\n // Only inherit parentId from other dialogs — non-dialog overlays (menus, popovers)\n // may close after triggering the dialog open, which would cascade-close the dialog.\n let parentId =\n activeElement instanceof HTMLElement\n ? this.registry.findContainingOverlay(activeElement)\n : null;\n\n if (parentId !== null && !this.openDialogs.some(d => d.id === parentId)) {\n parentId = null;\n }\n\n // Register with the overlay registry for centralized escape-key routing.\n // outsidePress is false because the NgpDialogOverlay directive handles its own backdrop clicks.\n this.registry.register({\n id: dialogRef.id,\n parentId,\n overlay: dialogRef,\n getElements: () => dialogRef.getElements(),\n triggerElement: (activeElement as HTMLElement) ?? this.document.body,\n dismissPolicy: {\n outsidePress: false,\n escapeKey: config.closeOnEscape ?? true,\n },\n outsidePointerEvents$: dialogRef.outsidePointerEvents$,\n });\n\n (this.openDialogs as NgpDialogRef[]).push(dialogRef as NgpDialogRef<any, any>);\n this.afterOpened.next(dialogRef as NgpDialogRef<any, any>);\n this.subscribeToRouterEvents();\n\n dialogRef.closed.subscribe(closeResult => {\n // Deregister from the overlay registry\n this.registry.deregister(dialogRef.id);\n this.removeOpenDialog(dialogRef as NgpDialogRef<any, any>, true);\n // Focus the trigger element after the dialog closes.\n if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n this.focusMonitor.focusVia(\n activeElement,\n closeResult.focusOrigin ?? (this.focusMonitor as any)._lastFocusOrigin,\n );\n }\n });\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById(id: string): NgpDialogRef | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n /**\n * Subscribe to router navigation events so that dialogs with `closeOnNavigation`\n * are closed when the user navigates. This handles both browser popstate events\n * and programmatic route changes (e.g. router.navigate()).\n */\n private subscribeToRouterEvents(): void {\n if (this.routerSubscription || !this.router) {\n return;\n }\n\n this.routerSubscription = this.router.events.subscribe(event => {\n if (event instanceof NavigationStart && this.openDialogs.length) {\n // Close dialogs that have closeOnNavigation enabled (iterate in reverse as closing modifies the array)\n let i = this.openDialogs.length;\n while (i--) {\n const dialog = this.openDialogs[i];\n if (dialog.config.closeOnNavigation !== false) {\n dialog.close();\n }\n }\n }\n });\n }\n\n ngOnDestroy(): void {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this.openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n this.removeOpenDialog(dialog, false);\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this.openDialogsAtThisLevel, dialog => dialog.close());\n\n this.afterAllClosedAtThisLevel.complete();\n this.afterOpenedAtThisLevel.complete();\n this.openDialogsAtThisLevel = [];\n this.routerSubscription?.unsubscribe();\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n */\n private createInjector<T, R>(\n config: NgpDialogConfig<T>,\n dialogRef: NgpDialogRef<T, R>,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n { provide: NgpDialogRef, useValue: dialogRef },\n { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager },\n ];\n\n // Fall back to the service's own injector (root injector) to ensure\n // ApplicationRef and other platform providers are available.\n return Injector.create({ parent: userInjector || this.injector, providers });\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n */\n private removeOpenDialog(dialogRef: NgpDialogRef, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as NgpDialogRef[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this.ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this.ariaHiddenElements.clear();\n this.disableScrollBlocking();\n\n if (emitEvent) {\n this.getAfterAllClosed().next();\n }\n }\n }\n }\n\n /**\n * Enable scroll blocking when the first dialog opens.\n */\n private enableScrollBlocking(config?: NgpDialogConfig): void {\n if (!this.scrollStrategy) {\n this.scrollStrategy =\n config?.scrollStrategy ?? new BlockScrollStrategy(this.viewportRuler, this.document);\n }\n this.scrollStrategy.enable();\n }\n\n /**\n * Disable scroll blocking when the last dialog closes.\n */\n private disableScrollBlocking(): void {\n this.scrollStrategy?.disable();\n this.scrollStrategy = null;\n }\n\n /**\n * Hides all of the content that isn't a dialog portal from assistive technology.\n */\n private hideNonDialogContentFromAssistiveTechnology(portalElements: HTMLElement[]) {\n const body = this.document.body;\n const bodyChildren = body.children;\n\n for (let i = bodyChildren.length - 1; i > -1; i--) {\n const sibling = bodyChildren[i];\n\n if (\n !portalElements.includes(sibling as HTMLElement) &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this.ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n private getAfterAllClosed(): Subject<void> {\n const parent = this.parentDialogManager;\n return parent ? parent.getAfterAllClosed() : this.afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n\nexport interface NgpDialogContext<T = unknown, R = unknown> {\n $implicit: NgpDialogRef<T, R>;\n close: (result?: R) => void;\n}\n\nexport function injectDialogManager(): NgpDialogManager {\n return inject(NgpDialogManager);\n}\n","import { Directive, HostListener, inject, input, output, TemplateRef } from '@angular/core';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from '../dialog/dialog-ref';\nimport { NgpDialogContext, NgpDialogManager } from '../dialog/dialog.service';\n\n@Directive({\n selector: '[ngpDialogTrigger]',\n exportAs: 'ngpDialogTrigger',\n})\nexport class NgpDialogTrigger<T = unknown> {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog manager. */\n private readonly dialogManager = inject(NgpDialogManager);\n\n /** The template to launch. */\n readonly template = input.required<TemplateRef<NgpDialogContext>>({\n alias: 'ngpDialogTrigger',\n });\n\n /** Emits whenever the dialog is closed with the given result. */\n readonly closed = output<T>({ alias: 'ngpDialogTriggerClosed' });\n\n /**\n * Whether the dialog should close on escape.\n * @default `true`\n */\n readonly closeOnEscape = input(this.config.closeOnEscape, {\n alias: 'ngpDialogTriggerCloseOnEscape',\n });\n\n /**\n * Store the dialog ref.\n * @internal\n */\n private dialogRef: NgpDialogRef | null = null;\n\n @HostListener('click')\n protected launch(): void {\n this.dialogRef = this.dialogManager.open(this.template(), {\n closeOnEscape: this.closeOnEscape(),\n });\n this.dialogRef.closed.subscribe(({ result }) => {\n this.closed.emit(result as T);\n return (this.dialogRef = null);\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, OnDestroy, signal } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from './dialog-ref';\nimport { dialogState, provideDialogState } from './dialog-state';\n\n@Directive({\n selector: '[ngpDialog]',\n exportAs: 'ngpDialog',\n providers: [provideDialogState()],\n hostDirectives: [NgpFocusTrap, NgpExitAnimation],\n host: {\n tabindex: '-1',\n '[id]': 'state.id()',\n '[attr.role]': 'state.role()',\n '[attr.aria-modal]': 'state.modal()',\n '[attr.aria-labelledby]': 'labelledBy().join(\" \")',\n '[attr.aria-describedby]': 'describedBy().join(\" \")',\n },\n})\nexport class NgpDialog<T = unknown, R = unknown> implements OnDestroy {\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref */\n private readonly dialogRef = injectDialogRef<T, R>();\n\n /** The id of the dialog */\n readonly id = input<string>(uniqueId('ngp-dialog'));\n\n /** The dialog role. */\n readonly role = input(this.config.role, {\n alias: 'ngpDialogRole',\n });\n\n /** Whether the dialog is a modal. */\n readonly modal = input<boolean, BooleanInput>(this.config.modal ?? false, {\n alias: 'ngpDialogModal',\n transform: booleanAttribute,\n });\n\n /** The labelledby ids */\n protected readonly labelledBy = signal<string[]>([]);\n\n /** The describedby ids */\n protected readonly describedBy = signal<string[]>([]);\n\n /** The dialog state */\n protected readonly state = dialogState<NgpDialog<T, R>>(this);\n\n ngOnDestroy(): void {\n this.close();\n }\n\n /** Close the dialog. */\n close(result?: R): void {\n this.dialogRef.close(result);\n }\n\n /** Stop click events from propagating to the overlay */\n @HostListener('click', ['$event'])\n protected onClick(event: Event): void {\n event.stopPropagation();\n }\n\n /** @internal register a labelledby id */\n setLabelledBy(id: string): void {\n this.labelledBy.update(ids => [...ids, id]);\n }\n\n /** @internal register a describedby id */\n setDescribedBy(id: string): void {\n this.describedBy.update(ids => [...ids, id]);\n }\n\n /** @internal remove a labelledby id */\n removeLabelledBy(id: string): void {\n this.labelledBy.update(ids => ids.filter(i => i !== id));\n }\n\n /** @internal remove a describedby id */\n removeDescribedBy(id: string): void {\n this.describedBy.update(ids => ids.filter(i => i !== id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAwCO,MAAM,mBAAmB,GAAoB;AAClD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,YAAY,EAAE,IAAI;CACnB;AAEM,MAAM,oBAAoB,GAAG,IAAI,cAAc,CAAkB,sBAAsB,CAAC;AAE/F;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAAgC,EAAA;IAClE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,QAAQ,EAAE,EAAE,GAAG,mBAAmB,EAAE,GAAG,MAAM,EAAE;AAChD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,kBAAkB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,mBAAmB;AAChF;;AC9DA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAsB,QAAQ,CAAC;AAElF;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAY,mBAAmB;AAEnF;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;MCf9C,oBAAoB,CAAA;AAO/B,IAAA,WAAA,G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BAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACF,iBAAA;;sBAwCE,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC9DnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-dialog.mjs","sources":["../../../../packages/ng-primitives/dialog/src/config/dialog-config.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-state.ts","../../../../packages/ng-primitives/dialog/src/dialog-description/dialog-description.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-ref.ts","../../../../packages/ng-primitives/dialog/src/dialog-overlay/dialog-overlay.ts","../../../../packages/ng-primitives/dialog/src/dialog-title/dialog-title.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.service.ts","../../../../packages/ng-primitives/dialog/src/dialog-trigger/dialog-trigger.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.ts","../../../../packages/ng-primitives/dialog/src/ng-primitives-dialog.ts"],"sourcesContent":["import { InjectionToken, Injector, Provider, ViewContainerRef, inject } from '@angular/core';\nimport { NgpDismissGuard, ScrollStrategy } from 'ng-primitives/portal';\n\n/** Valid ARIA roles for a dialog. */\nexport type NgpDialogRole = 'dialog' | 'alertdialog';\n\nexport interface NgpDialogConfig<T = any> {\n /** The view container to attach the dialog to. */\n viewContainerRef?: ViewContainerRef;\n\n /** The injector to use for the dialog. Defaults to the view container's injector.*/\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The role of the dialog. */\n role?: NgpDialogRole;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n modal?: boolean;\n\n /**\n * Whether the dialog should close when the user navigates. This includes both browser history\n * navigation (back/forward) and programmatic route changes (e.g. router.navigate()).\n */\n closeOnNavigation?: boolean;\n\n /** Whether the dialog should close when the user presses the escape key, or a guard function. */\n closeOnEscape?: NgpDismissGuard<KeyboardEvent>;\n\n /**\n * Whether the dialog should close when clicking outside (on the overlay), or a guard function.\n */\n closeOnOutsideClick?: NgpDismissGuard<Element>;\n\n /**\n * Whether the dialog should close when the user clicks the overlay.\n * @deprecated Use `closeOnOutsideClick` instead.\n */\n closeOnClick?: boolean;\n\n /** Scroll strategy to be used for the dialog. */\n scrollStrategy?: ScrollStrategy;\n\n data?: T;\n}\n\nexport const defaultDialogConfig: NgpDialogConfig = {\n role: 'dialog',\n modal: true,\n closeOnNavigation: true,\n closeOnEscape: true,\n closeOnClick: true,\n};\n\nexport const NgpDialogConfigToken = new InjectionToken<NgpDialogConfig>('NgpDialogConfigToken');\n\n/**\n * Provide the default Dialog configuration\n * @param config The Dialog configuration\n * @returns The provider\n */\nexport function provideDialogConfig(config: Partial<NgpDialogConfig>): Provider[] {\n return [\n {\n provide: NgpDialogConfigToken,\n useValue: { ...defaultDialogConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Dialog configuration\n * @returns The global Dialog configuration\n */\nexport function injectDialogConfig(): NgpDialogConfig {\n return inject(NgpDialogConfigToken, { optional: true }) ?? defaultDialogConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpDialog } from './dialog';\n\n/**\n * The state token for the Dialog primitive.\n */\nexport const NgpDialogStateToken = createStateToken<NgpDialog<any, any>>('Dialog');\n\n/**\n * Provides the Dialog state.\n */\nexport const provideDialogState = createStateProvider(NgpDialogStateToken);\n\n/**\n * Injects the Dialog state.\n */\nexport const injectDialogState = createStateInjector<NgpDialog>(NgpDialogStateToken);\n\n/**\n * The Dialog state registration function.\n */\nexport const dialogState = createState(NgpDialogStateToken);\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogDescription]',\n exportAs: 'ngpDialogDescription',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogDescription implements OnDestroy {\n /** Access the dialog */\n private readonly dialog = injectDialogState();\n\n /** The id of the descriptions. */\n readonly id = input<string>(uniqueId('ngp-dialog-description'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeDescribedBy(prevId);\n }\n\n if (id) {\n this.dialog().setDescribedBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeDescribedBy(this.id());\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { inject, Injector } from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { NgpDismissGuard, NgpOverlayRef } from 'ng-primitives/portal';\nimport { defer, EMPTY, fromEvent, Observable, Subject } from 'rxjs';\nimport { filter, map, takeUntil } from 'rxjs/operators';\nimport { NgpDialogConfig } from '../config/dialog-config';\n\n/** Minimal portal interface needed by the dialog ref. */\nexport interface NgpDialogPortalRef {\n getElements(): HTMLElement[];\n detach(immediate?: boolean): Promise<void>;\n}\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class NgpDialogRef<T = unknown, R = unknown> implements NgpOverlayRef {\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Whether the escape key is allowed to close the dialog, or a guard function. */\n closeOnEscape: NgpDismissGuard<KeyboardEvent> | undefined;\n\n /** Whether clicking outside (on the overlay) is allowed to close the dialog, or a guard function. */\n closeOnOutsideClick: NgpDismissGuard<Element> | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /** @internal */\n readonly afterClosed$ = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /**\n * Observable that emits the dialog result after exit animations have completed.\n */\n readonly afterClosed: Observable<R | undefined> = this.afterClosed$.pipe(\n map(event => event.result),\n );\n\n /** Data passed from the dialog opener. */\n readonly data: T;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** @internal Store the injector */\n injector: Injector | undefined;\n\n /** Whether the dialog is closing. */\n private closing = false;\n\n /** @internal Portal reference for element access and detach. */\n portal: NgpDialogPortalRef | null = null;\n\n /** Emits on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /**\n * Emits pointer events (click, auxclick, contextmenu) that happen outside of the dialog.\n * Fed by the NgpOverlayRegistry with CDK-compatible stacking awareness.\n * @internal\n */\n readonly outsidePointerEvents$ = new Subject<MouseEvent>();\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent> = this.outsidePointerEvents$.asObservable();\n\n constructor(\n readonly config: NgpDialogConfig<T>,\n private readonly document: Document,\n ) {\n this.data = config.data as T;\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n this.closeOnEscape = config.closeOnEscape ?? true;\n this.closeOnOutsideClick = config.closeOnOutsideClick;\n\n // Use defer() so the observable is created on subscribe — by then the portal will be set.\n this.keydownEvents = defer(() => {\n const elements = this.getElements();\n if (!elements.length) return EMPTY;\n return fromEvent<KeyboardEvent>(this.document, 'keydown').pipe(\n filter(event => elements.some(el => el.contains(event.target as Node))),\n takeUntil(this.closed),\n );\n });\n }\n\n /**\n * Updates the position of the dialog. No-op since dialogs are CSS-centered.\n */\n updatePosition(): this {\n return this;\n }\n\n /**\n * NgpOverlayRef implementation — called by the registry for escape-key dismiss.\n */\n hide(options?: { immediate?: boolean; origin?: FocusOrigin }): void {\n if (this.disableClose) {\n return;\n }\n this.close(undefined, options?.origin);\n }\n\n /**\n * NgpOverlayRef implementation — called by the registry for descendant cascade.\n * Skips exit animations and tears down immediately.\n */\n async hideImmediate(): Promise<void> {\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n this.closed.next({});\n this.closed.complete();\n\n // Detach the portal immediately — no exit animation\n if (this.portal) {\n await this.portal.detach(true);\n this.portal = null;\n }\n\n this.afterClosed$.next({});\n this.afterClosed$.complete();\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param focusOrigin The origin of the focus event that triggered the close.\n */\n async close(result?: R, focusOrigin?: FocusOrigin): Promise<void> {\n // If the dialog is already closed, do nothing.\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n // Emit immediately so consumers can react before exit animations run.\n this.closed.next({ focusOrigin, result });\n this.closed.complete();\n\n const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {\n optional: true,\n });\n if (exitAnimationManager) {\n await exitAnimationManager.exit();\n }\n\n // Detach the portal (immediate since exit animation already ran)\n if (this.portal) {\n await this.portal.detach(true);\n this.portal = null;\n }\n\n this.afterClosed$.next({ focusOrigin, result });\n this.afterClosed$.complete();\n }\n\n /**\n * @deprecated Access dialog methods directly instead (keydownEvents, outsidePointerEvents,\n * updatePosition, close). This shim will be removed in the next major version.\n */\n get overlayRef(): {\n keydownEvents: () => Observable<KeyboardEvent>;\n outsidePointerEvents: () => Observable<MouseEvent>;\n updatePosition: () => NgpDialogRef<T, R>;\n dispose: () => Promise<void>;\n detachments: () => Observable<{ focusOrigin?: FocusOrigin; result?: R }>;\n overlayElement: HTMLElement | undefined;\n } {\n return {\n keydownEvents: () => this.keydownEvents,\n outsidePointerEvents: () => this.outsidePointerEvents,\n updatePosition: () => this.updatePosition(),\n dispose: () => this.close(),\n detachments: () => this.closed.asObservable(),\n overlayElement: this.getElements()[0] as HTMLElement | undefined,\n };\n }\n\n /**\n * Get the portal elements.\n * @internal\n */\n getElements(): HTMLElement[] {\n return this.portal?.getElements() ?? [];\n }\n}\n\nexport function injectDialogRef<T = unknown, R = unknown>(): NgpDialogRef<T, R> {\n return inject<NgpDialogRef<T, R>>(NgpDialogRef);\n}\n","import { booleanAttribute, Directive, input } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { NgpDismissGuard } from 'ng-primitives/portal';\nimport { injectDialogRef } from '../dialog/dialog-ref';\n\n@Directive({\n selector: '[ngpDialogOverlay]',\n exportAs: 'ngpDialogOverlay',\n hostDirectives: [NgpExitAnimation],\n host: {\n '(pointerdown)': 'onPointerDown($event)',\n '(click)': 'onClick($event)',\n '(pointercancel)': 'resetPointerOrigin()',\n },\n})\nexport class NgpDialogOverlay {\n private readonly dialogRef = injectDialogRef();\n private startedPointerDownOnOverlay = false;\n\n /**\n * Whether the dialog should close on backdrop click.\n * @default `true`\n */\n readonly closeOnClick = input(this.dialogRef.config.closeOnClick, {\n alias: 'ngpDialogOverlayCloseOnClick',\n transform: booleanAttribute,\n });\n\n protected onPointerDown(event: Event): void {\n this.startedPointerDownOnOverlay = event.target === event.currentTarget;\n }\n\n protected onClick(event: Event): void {\n const isOverlayClick = this.startedPointerDownOnOverlay && event.target === event.currentTarget;\n\n this.resetPointerOrigin();\n\n if (!isOverlayClick || this.dialogRef.disableClose) {\n return;\n }\n\n const guard: NgpDismissGuard<Element> =\n this.dialogRef.closeOnOutsideClick ?? this.closeOnClick() ?? true;\n this.evaluateGuard(guard, event.target as Element);\n }\n\n private evaluateGuard(guard: NgpDismissGuard<Element>, target: Element): void {\n if (guard === true) {\n this.dialogRef.close(undefined, 'mouse');\n return;\n }\n\n if (guard === false) {\n return;\n }\n\n // Function guard — evaluate sync or async\n let result: boolean | Promise<boolean>;\n try {\n result = guard(target);\n } catch (error) {\n console.error('NgpDialogOverlay: dismiss guard threw', error);\n return;\n }\n\n if (typeof result === 'boolean') {\n if (result) {\n this.dialogRef.close(undefined, 'mouse');\n }\n } else {\n result\n .then(shouldClose => {\n if (shouldClose) {\n this.dialogRef.close(undefined, 'mouse');\n }\n })\n .catch(error => {\n console.error('NgpDialogOverlay: dismiss guard rejected', error);\n });\n }\n }\n\n protected resetPointerOrigin(): void {\n this.startedPointerDownOnOverlay = false;\n }\n}\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogTitle]',\n exportAs: 'ngpDialogTitle',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogTitle implements OnDestroy {\n /** Access the dialog. */\n private readonly dialog = injectDialogState();\n\n /** The id of the title. */\n readonly id = input<string>(uniqueId('ngp-dialog-title'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeLabelledBy(prevId);\n }\n\n if (id) {\n this.dialog().setLabelledBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeLabelledBy(this.id());\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n OnDestroy,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NavigationStart, Router } from '@angular/router';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport {\n BlockScrollStrategy,\n NgpOverlayRegistry,\n ScrollStrategy,\n createPortal,\n} from 'ng-primitives/portal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable, Subject, Subscription, defer } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { NgpDialogConfig, injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from './dialog-ref';\n\n/**\n * Originally based on Angular CDK Dialog service.\n * Re-implemented to use ng-primitives/portal instead of @angular/cdk/overlay.\n */\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpDialogManager implements OnDestroy {\n private readonly applicationRef = inject(ApplicationRef);\n private readonly injector = inject(Injector);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly viewportRuler = inject(ViewportRuler);\n private readonly registry = inject(NgpOverlayRegistry);\n private readonly defaultOptions = injectDialogConfig();\n private readonly parentDialogManager = inject(NgpDialogManager, {\n optional: true,\n skipSelf: true,\n });\n private readonly router = inject(Router, { optional: true });\n\n private openDialogsAtThisLevel: NgpDialogRef[] = [];\n private readonly afterAllClosedAtThisLevel = new Subject<void>();\n private readonly afterOpenedAtThisLevel = new Subject<NgpDialogRef>();\n private ariaHiddenElements = new Map<Element, string | null>();\n private routerSubscription: Subscription | undefined;\n\n /** Scroll blocking strategy — shared across all dialogs. */\n private scrollStrategy: ScrollStrategy | null = null;\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly NgpDialogRef[] {\n return this.parentDialogManager\n ? this.parentDialogManager.openDialogs\n : this.openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<NgpDialogRef> {\n return this.parentDialogManager\n ? this.parentDialogManager.afterOpened\n : this.afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this.getAfterAllClosed()\n : this.getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n /**\n * Opens a modal dialog containing the given template or component.\n */\n open(\n templateRefOrComponentType: TemplateRef<NgpDialogContext> | Type<unknown>,\n config?: NgpDialogConfig,\n ): NgpDialogRef;\n\n /**\n * Opens a modal dialog containing the given template or component with typed data.\n */\n open<T, R = unknown>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config: NgpDialogConfig<T> & { data: T },\n ): NgpDialogRef<T, R>;\n\n /**\n * Opens a modal dialog with typed result but no data (explicit void for data type).\n */\n open<T extends void, R>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config?: NgpDialogConfig,\n ): NgpDialogRef<T, R>;\n\n open(\n templateRefOrComponentType: TemplateRef<any> | Type<unknown>,\n config?: NgpDialogConfig<any>,\n ): NgpDialogRef<any, any> {\n // store the current active element so we can focus it after the dialog is closed\n const activeElement = this.document.activeElement;\n\n // this is not ideal, but there is a case where a dialog trigger is within an overlay (e.g. menu),\n // which may be removed before the dialog is closed. This is not desired, so we need to access a view container ref\n // that is not within the overlay. To solve this we use the view container ref of the root component.\n // Could this have any unintended side effects? For example, the dialog would not be closed during route changes?\n const viewContainerRef =\n this.applicationRef.components[0]?.injector.get(ViewContainerRef) ??\n config?.viewContainerRef ??\n config?.injector?.get(ViewContainerRef);\n\n const defaults = this.defaultOptions;\n config = { ...defaults, viewContainerRef, ...config };\n config.id = config.id ?? uniqueId('ngp-dialog');\n\n if (config.id && this.getDialogById(config.id) && isDevMode()) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const dialogRef = new NgpDialogRef(config, this.document);\n const injector = this.createInjector(config, dialogRef);\n\n // store the injector in the dialog ref - this is so we can access the exit animation manager\n dialogRef.injector = injector;\n\n const context: NgpDialogContext = {\n $implicit: dialogRef,\n close: dialogRef.close.bind(dialogRef),\n };\n\n // Create the portal using our portal system\n const portal = createPortal(\n templateRefOrComponentType,\n config.viewContainerRef!,\n injector,\n context,\n );\n\n // Attach the portal to document.body\n portal.attach(this.document.body);\n\n // Store the portal reference on the dialog ref for element access and cleanup\n dialogRef.portal = portal;\n\n // If this is the first dialog that we're opening, hide all the non-overlay content\n // and enable scroll blocking.\n if (!this.openDialogs.length) {\n this.hideNonDialogContentFromAssistiveTechnology(portal.getElements());\n this.enableScrollBlocking(config);\n }\n\n // Auto-detect parent overlay: if the trigger element lives inside an existing overlay\n // (e.g. a dialog opened from a popover), register as its child so that clicks inside\n // the dialog don't dismiss the parent overlay.\n // Only inherit parentId from other dialogs — non-dialog overlays (menus, popovers)\n // may close after triggering the dialog open, which would cascade-close the dialog.\n let parentId =\n activeElement instanceof HTMLElement\n ? this.registry.findContainingOverlay(activeElement)\n : null;\n\n if (parentId !== null && !this.openDialogs.some(d => d.id === parentId)) {\n parentId = null;\n }\n\n // Register with the overlay registry for centralized escape-key routing.\n // outsidePress is false because the NgpDialogOverlay directive handles its own backdrop clicks.\n this.registry.register({\n id: dialogRef.id,\n parentId,\n overlay: dialogRef,\n getElements: () => dialogRef.getElements(),\n triggerElement: (activeElement as HTMLElement) ?? this.document.body,\n dismissPolicy: {\n outsidePress: false,\n escapeKey: config.closeOnEscape ?? true,\n },\n outsidePointerEvents$: dialogRef.outsidePointerEvents$,\n });\n\n (this.openDialogs as NgpDialogRef[]).push(dialogRef as NgpDialogRef<any, any>);\n this.afterOpened.next(dialogRef as NgpDialogRef<any, any>);\n this.subscribeToRouterEvents();\n\n dialogRef.closed.subscribe(() => {\n // Deregister from the overlay registry immediately so stacking order is updated.\n this.registry.deregister(dialogRef.id);\n this.removeOpenDialog(dialogRef as NgpDialogRef<any, any>, true);\n });\n\n dialogRef.afterClosed$.subscribe(({ focusOrigin }) => {\n // Focus the trigger element after exit animations complete.\n if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n this.focusMonitor.focusVia(\n activeElement,\n focusOrigin ?? (this.focusMonitor as any)._lastFocusOrigin,\n );\n }\n });\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById(id: string): NgpDialogRef | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n /**\n * Subscribe to router navigation events so that dialogs with `closeOnNavigation`\n * are closed when the user navigates. This handles both browser popstate events\n * and programmatic route changes (e.g. router.navigate()).\n */\n private subscribeToRouterEvents(): void {\n if (this.routerSubscription || !this.router) {\n return;\n }\n\n this.routerSubscription = this.router.events.subscribe(event => {\n if (event instanceof NavigationStart && this.openDialogs.length) {\n // Close dialogs that have closeOnNavigation enabled (iterate in reverse as closing modifies the array)\n let i = this.openDialogs.length;\n while (i--) {\n const dialog = this.openDialogs[i];\n if (dialog.config.closeOnNavigation !== false) {\n dialog.close();\n }\n }\n }\n });\n }\n\n ngOnDestroy(): void {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this.openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n this.removeOpenDialog(dialog, false);\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this.openDialogsAtThisLevel, dialog => dialog.close());\n\n this.afterAllClosedAtThisLevel.complete();\n this.afterOpenedAtThisLevel.complete();\n this.openDialogsAtThisLevel = [];\n this.routerSubscription?.unsubscribe();\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n */\n private createInjector<T, R>(\n config: NgpDialogConfig<T>,\n dialogRef: NgpDialogRef<T, R>,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n { provide: NgpDialogRef, useValue: dialogRef },\n { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager },\n ];\n\n // Fall back to the service's own injector (root injector) to ensure\n // ApplicationRef and other platform providers are available.\n return Injector.create({ parent: userInjector || this.injector, providers });\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n */\n private removeOpenDialog(dialogRef: NgpDialogRef, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as NgpDialogRef[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this.ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this.ariaHiddenElements.clear();\n this.disableScrollBlocking();\n\n if (emitEvent) {\n this.getAfterAllClosed().next();\n }\n }\n }\n }\n\n /**\n * Enable scroll blocking when the first dialog opens.\n */\n private enableScrollBlocking(config?: NgpDialogConfig): void {\n if (!this.scrollStrategy) {\n this.scrollStrategy =\n config?.scrollStrategy ?? new BlockScrollStrategy(this.viewportRuler, this.document);\n }\n this.scrollStrategy.enable();\n }\n\n /**\n * Disable scroll blocking when the last dialog closes.\n */\n private disableScrollBlocking(): void {\n this.scrollStrategy?.disable();\n this.scrollStrategy = null;\n }\n\n /**\n * Hides all of the content that isn't a dialog portal from assistive technology.\n */\n private hideNonDialogContentFromAssistiveTechnology(portalElements: HTMLElement[]) {\n const body = this.document.body;\n const bodyChildren = body.children;\n\n for (let i = bodyChildren.length - 1; i > -1; i--) {\n const sibling = bodyChildren[i];\n\n if (\n !portalElements.includes(sibling as HTMLElement) &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this.ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n private getAfterAllClosed(): Subject<void> {\n const parent = this.parentDialogManager;\n return parent ? parent.getAfterAllClosed() : this.afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n\nexport interface NgpDialogContext<T = unknown, R = unknown> {\n $implicit: NgpDialogRef<T, R>;\n close: (result?: R) => void;\n}\n\nexport function injectDialogManager(): NgpDialogManager {\n return inject(NgpDialogManager);\n}\n","import { Directive, HostListener, inject, input, output, TemplateRef } from '@angular/core';\nimport { dismissGuardAttribute, NgpDismissGuard, NgpDismissGuardInput } from 'ng-primitives/portal';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from '../dialog/dialog-ref';\nimport { NgpDialogContext, NgpDialogManager } from '../dialog/dialog.service';\n\n@Directive({\n selector: '[ngpDialogTrigger]',\n exportAs: 'ngpDialogTrigger',\n})\nexport class NgpDialogTrigger<T = unknown> {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog manager. */\n private readonly dialogManager = inject(NgpDialogManager);\n\n /** The template to launch. */\n readonly template = input.required<TemplateRef<NgpDialogContext>>({\n alias: 'ngpDialogTrigger',\n });\n\n /** Emits whenever the dialog is closed with the given result. */\n readonly closed = output<T>({ alias: 'ngpDialogTriggerClosed' });\n\n /**\n * Whether the dialog should close on escape, or a guard function.\n * @default `true`\n */\n readonly closeOnEscape = input<\n NgpDismissGuard<KeyboardEvent>,\n NgpDismissGuardInput<KeyboardEvent>\n >(this.config.closeOnEscape ?? true, {\n alias: 'ngpDialogTriggerCloseOnEscape',\n transform: dismissGuardAttribute,\n });\n\n /**\n * Whether the dialog should close on outside click, or a guard function.\n * @default `true`\n */\n readonly closeOnOutsideClick = input<NgpDismissGuard<Element>, NgpDismissGuardInput<Element>>(\n this.config.closeOnOutsideClick ?? true,\n {\n alias: 'ngpDialogTriggerCloseOnOutsideClick',\n transform: dismissGuardAttribute,\n },\n );\n\n /**\n * Store the dialog ref.\n * @internal\n */\n private dialogRef: NgpDialogRef | null = null;\n\n @HostListener('click')\n protected launch(): void {\n this.dialogRef = this.dialogManager.open(this.template(), {\n closeOnEscape: this.closeOnEscape(),\n closeOnOutsideClick: this.closeOnOutsideClick(),\n });\n this.dialogRef.closed.subscribe(({ result }) => {\n this.closed.emit(result as T);\n return (this.dialogRef = null);\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, OnDestroy, signal } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from './dialog-ref';\nimport { dialogState, provideDialogState } from './dialog-state';\n\n@Directive({\n selector: '[ngpDialog]',\n exportAs: 'ngpDialog',\n providers: [provideDialogState()],\n hostDirectives: [NgpFocusTrap, NgpExitAnimation],\n host: {\n tabindex: '-1',\n '[id]': 'state.id()',\n '[attr.role]': 'state.role()',\n '[attr.aria-modal]': 'state.modal()',\n '[attr.aria-labelledby]': 'labelledBy().join(\" \")',\n '[attr.aria-describedby]': 'describedBy().join(\" \")',\n },\n})\nexport class NgpDialog<T = unknown, R = unknown> implements OnDestroy {\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref */\n private readonly dialogRef = injectDialogRef<T, R>();\n\n /** The id of the dialog */\n readonly id = input<string>(uniqueId('ngp-dialog'));\n\n /** The dialog role. */\n readonly role = input(this.config.role, {\n alias: 'ngpDialogRole',\n });\n\n /** Whether the dialog is a modal. */\n readonly modal = input<boolean, BooleanInput>(this.config.modal ?? false, {\n alias: 'ngpDialogModal',\n transform: booleanAttribute,\n });\n\n /** The labelledby ids */\n protected readonly labelledBy = signal<string[]>([]);\n\n /** The describedby ids */\n protected readonly describedBy = signal<string[]>([]);\n\n /** The dialog state */\n protected readonly state = dialogState<NgpDialog<T, R>>(this);\n\n ngOnDestroy(): void {\n this.close();\n }\n\n /** Close the dialog. */\n close(result?: R): void {\n this.dialogRef.close(result);\n }\n\n /** Stop click events from propagating to the overlay */\n @HostListener('click', ['$event'])\n protected onClick(event: Event): void {\n event.stopPropagation();\n }\n\n /** @internal register a labelledby id */\n setLabelledBy(id: string): void {\n this.labelledBy.update(ids => [...ids, id]);\n }\n\n /** @internal register a describedby id */\n setDescribedBy(id: string): void {\n this.describedBy.update(ids => [...ids, id]);\n }\n\n /** @internal remove a labelledby id */\n removeLabelledBy(id: string): void {\n this.labelledBy.update(ids => ids.filter(i => i !== id));\n }\n\n /** @internal remove a describedby id */\n removeDescribedBy(id: string): void {\n this.describedBy.update(ids => ids.filter(i => i !== id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","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