@testgorilla/tgo-ui 12.2.0 → 12.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +19 -4
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +11 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +6 -0
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +6 -0
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +250 -50
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +4 -0
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +89 -7
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/mcp/catalog.json +1 -1
- package/package.json +1 -1
- package/types/testgorilla-tgo-ui-components-button.d.ts +32 -0
- package/types/testgorilla-tgo-ui-components-core.d.ts +1 -0
- package/types/testgorilla-tgo-ui-components-popover.d.ts +51 -5
- package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +59 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, ElementRef, HostListener, Injectable, Injector, NgZone, inject, input, signal } from "@angular/core";
|
|
1
3
|
import { Overlay } from "@angular/cdk/overlay";
|
|
2
4
|
import { ComponentPortal } from "@angular/cdk/portal";
|
|
3
|
-
import
|
|
4
|
-
import { ChangeDetectionStrategy, Component, Directive, ElementRef, HostListener, Injector, NgZone, inject, input, signal } from "@angular/core";
|
|
5
|
-
import { Subscription } from "rxjs";
|
|
5
|
+
import { Subject, Subscription } from "rxjs";
|
|
6
6
|
import { CdkTrapFocus } from "@angular/cdk/a11y";
|
|
7
7
|
import { NgTemplateOutlet } from "@angular/common";
|
|
8
8
|
import * as i1 from "@testgorilla/tgo-ui/components/card";
|
|
@@ -14,8 +14,12 @@ var PopoverComponent = class PopoverComponent {
|
|
|
14
14
|
this.popoverCard = input(true, ...ngDevMode ? [{ debugName: "popoverCard" }] : /* istanbul ignore next */ []);
|
|
15
15
|
this.popoverCardSize = input("medium", ...ngDevMode ? [{ debugName: "popoverCardSize" }] : /* istanbul ignore next */ []);
|
|
16
16
|
this.trapFocus = input(false, ...ngDevMode ? [{ debugName: "trapFocus" }] : /* istanbul ignore next */ []);
|
|
17
|
+
this.restoreFocusTo = input(null, ...ngDevMode ? [{ debugName: "restoreFocusTo" }] : /* istanbul ignore next */ []);
|
|
17
18
|
this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
18
19
|
}
|
|
20
|
+
ngOnInit() {
|
|
21
|
+
this.restoreFocusTo()?.focus({ preventScroll: true });
|
|
22
|
+
}
|
|
19
23
|
static {
|
|
20
24
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
21
25
|
minVersion: "12.0.0",
|
|
@@ -69,6 +73,13 @@ var PopoverComponent = class PopoverComponent {
|
|
|
69
73
|
isRequired: false,
|
|
70
74
|
transformFunction: null
|
|
71
75
|
},
|
|
76
|
+
restoreFocusTo: {
|
|
77
|
+
classPropertyName: "restoreFocusTo",
|
|
78
|
+
publicName: "restoreFocusTo",
|
|
79
|
+
isSignal: true,
|
|
80
|
+
isRequired: false,
|
|
81
|
+
transformFunction: null
|
|
82
|
+
},
|
|
72
83
|
ariaLabel: {
|
|
73
84
|
classPropertyName: "ariaLabel",
|
|
74
85
|
publicName: "ariaLabel",
|
|
@@ -186,6 +197,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
186
197
|
required: false
|
|
187
198
|
}]
|
|
188
199
|
}],
|
|
200
|
+
restoreFocusTo: [{
|
|
201
|
+
type: i0.Input,
|
|
202
|
+
args: [{
|
|
203
|
+
isSignal: true,
|
|
204
|
+
alias: "restoreFocusTo",
|
|
205
|
+
required: false
|
|
206
|
+
}]
|
|
207
|
+
}],
|
|
189
208
|
ariaLabel: [{
|
|
190
209
|
type: i0.Input,
|
|
191
210
|
args: [{
|
|
@@ -196,20 +215,119 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
196
215
|
}]
|
|
197
216
|
}
|
|
198
217
|
});
|
|
218
|
+
const END_PLACEMENT_VIEWPORT_MARGIN = 16;
|
|
219
|
+
const popoverPositions = ({ placement, align, offset }) => placement === "end" ? [{
|
|
220
|
+
originX: "end",
|
|
221
|
+
originY: "top",
|
|
222
|
+
overlayX: "start",
|
|
223
|
+
overlayY: "top",
|
|
224
|
+
offsetX: offset
|
|
225
|
+
}, {
|
|
226
|
+
originX: "start",
|
|
227
|
+
originY: "top",
|
|
228
|
+
overlayX: "end",
|
|
229
|
+
overlayY: "top",
|
|
230
|
+
offsetX: -offset
|
|
231
|
+
}] : [{
|
|
232
|
+
originX: align,
|
|
233
|
+
originY: "bottom",
|
|
234
|
+
overlayX: align,
|
|
235
|
+
overlayY: "top",
|
|
236
|
+
offsetY: offset
|
|
237
|
+
}, {
|
|
238
|
+
originX: align,
|
|
239
|
+
originY: "top",
|
|
240
|
+
overlayX: align,
|
|
241
|
+
overlayY: "bottom",
|
|
242
|
+
offsetY: -offset
|
|
243
|
+
}];
|
|
244
|
+
var PopoverOverlayService = class PopoverOverlayService {
|
|
245
|
+
constructor() {
|
|
246
|
+
this.overlay = inject(Overlay);
|
|
247
|
+
}
|
|
248
|
+
create(anchor, config) {
|
|
249
|
+
const positionStrategy = this.overlay.position().flexibleConnectedTo(anchor).withPositions(popoverPositions(config)).withViewportMargin(config.placement === "end" ? END_PLACEMENT_VIEWPORT_MARGIN : 0);
|
|
250
|
+
return this.overlay.create({
|
|
251
|
+
positionStrategy,
|
|
252
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
253
|
+
hasBackdrop: false
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
attach(overlayRef, injector, template, close, options) {
|
|
257
|
+
const ref = overlayRef.attach(new ComponentPortal(PopoverComponent, null, injector));
|
|
258
|
+
ref.setInput("templateRef", template);
|
|
259
|
+
ref.setInput("ctx", { close });
|
|
260
|
+
ref.setInput("popoverCard", options.isCard);
|
|
261
|
+
ref.setInput("popoverCardSize", options.cardSize);
|
|
262
|
+
ref.setInput("trapFocus", options.trapFocus);
|
|
263
|
+
ref.setInput("restoreFocusTo", options.restoreFocusTo ?? null);
|
|
264
|
+
ref.setInput("ariaLabel", options.ariaLabel);
|
|
265
|
+
return ref;
|
|
266
|
+
}
|
|
267
|
+
dismissOnOutsideOrEscape(overlayRef, anchor, close) {
|
|
268
|
+
const subscriptions = new Subscription();
|
|
269
|
+
subscriptions.add(overlayRef.outsidePointerEvents().subscribe((event) => {
|
|
270
|
+
if (!anchor.contains(event.target)) close();
|
|
271
|
+
}));
|
|
272
|
+
subscriptions.add(overlayRef.keydownEvents().subscribe((event) => {
|
|
273
|
+
if (event.key !== "Escape") return;
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
close();
|
|
276
|
+
}));
|
|
277
|
+
return subscriptions;
|
|
278
|
+
}
|
|
279
|
+
static {
|
|
280
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
281
|
+
minVersion: "12.0.0",
|
|
282
|
+
version: "22.2.4",
|
|
283
|
+
ngImport: i0,
|
|
284
|
+
type: PopoverOverlayService,
|
|
285
|
+
deps: [],
|
|
286
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
static {
|
|
290
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
291
|
+
minVersion: "12.0.0",
|
|
292
|
+
version: "22.2.4",
|
|
293
|
+
ngImport: i0,
|
|
294
|
+
type: PopoverOverlayService,
|
|
295
|
+
providedIn: "root"
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
300
|
+
minVersion: "12.0.0",
|
|
301
|
+
version: "22.2.4",
|
|
302
|
+
ngImport: i0,
|
|
303
|
+
type: PopoverOverlayService,
|
|
304
|
+
decorators: [{
|
|
305
|
+
type: Injectable,
|
|
306
|
+
args: [{ providedIn: "root" }]
|
|
307
|
+
}]
|
|
308
|
+
});
|
|
309
|
+
const POPOVER_DEFAULTS = {
|
|
310
|
+
placement: "below",
|
|
311
|
+
align: "center",
|
|
312
|
+
offset: 4,
|
|
313
|
+
isCard: true,
|
|
314
|
+
cardSize: "medium"
|
|
315
|
+
};
|
|
199
316
|
var PopoverDirective = class PopoverDirective {
|
|
200
317
|
constructor() {
|
|
201
318
|
this.uiPopover = input.required(...ngDevMode ? [{ debugName: "uiPopover" }] : /* istanbul ignore next */ []);
|
|
202
|
-
this.popoverOffset = input(
|
|
203
|
-
this.popoverAlign = input(
|
|
319
|
+
this.popoverOffset = input(POPOVER_DEFAULTS.offset, ...ngDevMode ? [{ debugName: "popoverOffset" }] : /* istanbul ignore next */ []);
|
|
320
|
+
this.popoverAlign = input(POPOVER_DEFAULTS.align, ...ngDevMode ? [{ debugName: "popoverAlign" }] : /* istanbul ignore next */ []);
|
|
321
|
+
this.popoverPlacement = input(POPOVER_DEFAULTS.placement, ...ngDevMode ? [{ debugName: "popoverPlacement" }] : /* istanbul ignore next */ []);
|
|
204
322
|
this.popoverOpen = input(false, ...ngDevMode ? [{ debugName: "popoverOpen" }] : /* istanbul ignore next */ []);
|
|
205
|
-
this.popoverCard = input(
|
|
206
|
-
this.popoverCardSize = input(
|
|
323
|
+
this.popoverCard = input(POPOVER_DEFAULTS.isCard, ...ngDevMode ? [{ debugName: "popoverCard" }] : /* istanbul ignore next */ []);
|
|
324
|
+
this.popoverCardSize = input(POPOVER_DEFAULTS.cardSize, ...ngDevMode ? [{ debugName: "popoverCardSize" }] : /* istanbul ignore next */ []);
|
|
207
325
|
this.popoverTrigger = input("hover", ...ngDevMode ? [{ debugName: "popoverTrigger" }] : /* istanbul ignore next */ []);
|
|
208
326
|
this.popoverAriaLabel = input("", ...ngDevMode ? [{ debugName: "popoverAriaLabel" }] : /* istanbul ignore next */ []);
|
|
209
327
|
this.uiPopoverDisabled = input(false, ...ngDevMode ? [{ debugName: "uiPopoverDisabled" }] : /* istanbul ignore next */ []);
|
|
210
328
|
this.openState = signal(false, ...ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []);
|
|
211
329
|
this.isOpen = this.openState.asReadonly();
|
|
212
|
-
this.
|
|
330
|
+
this.popoverOverlay = inject(PopoverOverlayService);
|
|
213
331
|
this.elementRef = inject(ElementRef);
|
|
214
332
|
this.injector = inject(Injector);
|
|
215
333
|
this.ngZone = inject(NgZone);
|
|
@@ -238,14 +356,10 @@ var PopoverDirective = class PopoverDirective {
|
|
|
238
356
|
if (!this.overlayRef) this.createOverlay();
|
|
239
357
|
const overlayRef = this.overlayRef;
|
|
240
358
|
if (!overlayRef || overlayRef.hasAttached()) return;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
ref.setInput("popoverCard", this.popoverCard());
|
|
246
|
-
ref.setInput("popoverCardSize", this.popoverCardSize());
|
|
247
|
-
ref.setInput("trapFocus", this.popoverTrigger() === "click");
|
|
248
|
-
ref.setInput("ariaLabel", this.popoverAriaLabel());
|
|
359
|
+
this.popoverOverlay.attach(overlayRef, this.injector, this.uiPopover(), () => this.close(), {
|
|
360
|
+
...this.config(),
|
|
361
|
+
trapFocus: this.popoverTrigger() === "click"
|
|
362
|
+
});
|
|
249
363
|
if (this.popoverTrigger() === "hover") {
|
|
250
364
|
const el = overlayRef.overlayElement;
|
|
251
365
|
const enter = () => this.ngZone.run(() => this.cancelClose());
|
|
@@ -274,40 +388,19 @@ var PopoverDirective = class PopoverDirective {
|
|
|
274
388
|
if (this.isOpen()) this.close();
|
|
275
389
|
else this.open();
|
|
276
390
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
originX: align,
|
|
287
|
-
originY: "top",
|
|
288
|
-
overlayX: align,
|
|
289
|
-
overlayY: "bottom",
|
|
290
|
-
offsetY: -this.popoverOffset()
|
|
291
|
-
}]);
|
|
292
|
-
this.overlayRef = this.overlay.create({
|
|
293
|
-
positionStrategy,
|
|
294
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
295
|
-
hasBackdrop: false
|
|
296
|
-
});
|
|
297
|
-
if (this.popoverTrigger() === "click") this.listenForDismiss(this.overlayRef);
|
|
391
|
+
config() {
|
|
392
|
+
return {
|
|
393
|
+
placement: this.popoverPlacement(),
|
|
394
|
+
align: this.popoverAlign(),
|
|
395
|
+
offset: this.popoverOffset(),
|
|
396
|
+
isCard: this.popoverCard(),
|
|
397
|
+
cardSize: this.popoverCardSize(),
|
|
398
|
+
ariaLabel: this.popoverAriaLabel()
|
|
399
|
+
};
|
|
298
400
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (this.elementRef.nativeElement.contains(event.target)) return;
|
|
303
|
-
this.close();
|
|
304
|
-
}));
|
|
305
|
-
subscriptions.add(overlayRef.keydownEvents().subscribe((event) => {
|
|
306
|
-
if (event.key !== "Escape") return;
|
|
307
|
-
event.preventDefault();
|
|
308
|
-
this.close();
|
|
309
|
-
}));
|
|
310
|
-
this.dismissSubscriptions = subscriptions;
|
|
401
|
+
createOverlay() {
|
|
402
|
+
this.overlayRef = this.popoverOverlay.create(this.elementRef, this.config());
|
|
403
|
+
if (this.popoverTrigger() === "click") this.dismissSubscriptions = this.popoverOverlay.dismissOnOutsideOrEscape(this.overlayRef, this.elementRef.nativeElement, () => this.close());
|
|
311
404
|
}
|
|
312
405
|
scheduleOpen() {
|
|
313
406
|
this.openTimeout = setTimeout(() => this.open(), 100);
|
|
@@ -376,6 +469,13 @@ var PopoverDirective = class PopoverDirective {
|
|
|
376
469
|
isRequired: false,
|
|
377
470
|
transformFunction: null
|
|
378
471
|
},
|
|
472
|
+
popoverPlacement: {
|
|
473
|
+
classPropertyName: "popoverPlacement",
|
|
474
|
+
publicName: "popoverPlacement",
|
|
475
|
+
isSignal: true,
|
|
476
|
+
isRequired: false,
|
|
477
|
+
transformFunction: null
|
|
478
|
+
},
|
|
379
479
|
popoverOpen: {
|
|
380
480
|
classPropertyName: "popoverOpen",
|
|
381
481
|
publicName: "popoverOpen",
|
|
@@ -467,6 +567,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
467
567
|
required: false
|
|
468
568
|
}]
|
|
469
569
|
}],
|
|
570
|
+
popoverPlacement: [{
|
|
571
|
+
type: i0.Input,
|
|
572
|
+
args: [{
|
|
573
|
+
isSignal: true,
|
|
574
|
+
alias: "popoverPlacement",
|
|
575
|
+
required: false
|
|
576
|
+
}]
|
|
577
|
+
}],
|
|
470
578
|
popoverOpen: [{
|
|
471
579
|
type: i0.Input,
|
|
472
580
|
args: [{
|
|
@@ -529,6 +637,98 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
529
637
|
}]
|
|
530
638
|
}
|
|
531
639
|
});
|
|
532
|
-
|
|
640
|
+
var PopoverRef = class {
|
|
641
|
+
constructor(anchor, overlayRef, destroyRef) {
|
|
642
|
+
this.anchor = anchor;
|
|
643
|
+
this.overlayRef = overlayRef;
|
|
644
|
+
this.openState = signal(true, ...ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []);
|
|
645
|
+
this.closedSubject$ = new Subject();
|
|
646
|
+
this.isOpen = this.openState.asReadonly();
|
|
647
|
+
this.closed$ = this.closedSubject$.asObservable();
|
|
648
|
+
this.stopClosingOnDestroy = destroyRef?.onDestroy(() => {
|
|
649
|
+
this.stopClosingOnDestroy = void 0;
|
|
650
|
+
this.close();
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
close() {
|
|
654
|
+
if (!this.openState()) return;
|
|
655
|
+
this.openState.set(false);
|
|
656
|
+
this.stopClosingOnDestroy?.();
|
|
657
|
+
this.overlayRef.dispose();
|
|
658
|
+
this.closedSubject$.next();
|
|
659
|
+
this.closedSubject$.complete();
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
var PopoverService = class PopoverService {
|
|
663
|
+
constructor() {
|
|
664
|
+
this.popoverOverlay = inject(PopoverOverlayService);
|
|
665
|
+
this.injector = inject(Injector);
|
|
666
|
+
this.active = null;
|
|
667
|
+
}
|
|
668
|
+
open(anchor, template, config = {}) {
|
|
669
|
+
const current = this.openRefFor(anchor);
|
|
670
|
+
if (current) return current;
|
|
671
|
+
this.active?.close();
|
|
672
|
+
const { destroyRef, ...popoverConfig } = config;
|
|
673
|
+
const resolved = {
|
|
674
|
+
...POPOVER_DEFAULTS,
|
|
675
|
+
ariaLabel: "",
|
|
676
|
+
...popoverConfig
|
|
677
|
+
};
|
|
678
|
+
const overlayRef = this.popoverOverlay.create(anchor, resolved);
|
|
679
|
+
const ref = new PopoverRef(anchor, overlayRef, destroyRef);
|
|
680
|
+
const close = () => ref.close();
|
|
681
|
+
this.popoverOverlay.attach(overlayRef, this.injector, template, close, {
|
|
682
|
+
...resolved,
|
|
683
|
+
trapFocus: true,
|
|
684
|
+
restoreFocusTo: anchor
|
|
685
|
+
});
|
|
686
|
+
this.popoverOverlay.dismissOnOutsideOrEscape(overlayRef, anchor, close);
|
|
687
|
+
this.active = ref;
|
|
688
|
+
return ref;
|
|
689
|
+
}
|
|
690
|
+
toggle(anchor, template, config = {}) {
|
|
691
|
+
const current = this.openRefFor(anchor);
|
|
692
|
+
if (current) {
|
|
693
|
+
current.close();
|
|
694
|
+
return null;
|
|
695
|
+
}
|
|
696
|
+
return this.open(anchor, template, config);
|
|
697
|
+
}
|
|
698
|
+
openRefFor(anchor) {
|
|
699
|
+
const active = this.active;
|
|
700
|
+
return active?.anchor === anchor && active.isOpen() ? active : null;
|
|
701
|
+
}
|
|
702
|
+
static {
|
|
703
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
704
|
+
minVersion: "12.0.0",
|
|
705
|
+
version: "22.2.4",
|
|
706
|
+
ngImport: i0,
|
|
707
|
+
type: PopoverService,
|
|
708
|
+
deps: [],
|
|
709
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
static {
|
|
713
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
714
|
+
minVersion: "12.0.0",
|
|
715
|
+
version: "22.2.4",
|
|
716
|
+
ngImport: i0,
|
|
717
|
+
type: PopoverService,
|
|
718
|
+
providedIn: "root"
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
723
|
+
minVersion: "12.0.0",
|
|
724
|
+
version: "22.2.4",
|
|
725
|
+
ngImport: i0,
|
|
726
|
+
type: PopoverService,
|
|
727
|
+
decorators: [{
|
|
728
|
+
type: Injectable,
|
|
729
|
+
args: [{ providedIn: "root" }]
|
|
730
|
+
}]
|
|
731
|
+
});
|
|
732
|
+
export { PopoverDirective, PopoverRef, PopoverService };
|
|
533
733
|
|
|
534
734
|
//# sourceMappingURL=testgorilla-tgo-ui-components-popover.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-popover.mjs","names":[],"sources":["../../../components/popover/popover.component.ts","../../../components/popover/popover.component.html","../../../components/popover/popover.directive.ts"],"sourcesContent":["import { CdkTrapFocus } from '@angular/cdk/a11y';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, TemplateRef } from '@angular/core';\n\nimport { CardComponentModule, CardSize } from '@testgorilla/tgo-ui/components/card';\n\n@Component({\n selector: 'ui-popover',\n standalone: true,\n imports: [NgTemplateOutlet, CardComponentModule, CdkTrapFocus],\n templateUrl: './popover.component.html',\n styleUrls: ['./popover.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PopoverComponent {\n templateRef = input<TemplateRef<unknown> | null>(null);\n ctx = input<Record<string, unknown>>({});\n popoverCard = input(true);\n popoverCardSize = input<CardSize>('medium');\n trapFocus = input(false);\n ariaLabel = input('');\n}\n","@if (templateRef()) {\n <div class=\"popover-focus-scope\" [cdkTrapFocus]=\"trapFocus()\" [cdkTrapFocusAutoCapture]=\"trapFocus()\">\n <div\n class=\"popover-surface\"\n [attr.role]=\"trapFocus() ? 'dialog' : null\"\n [attr.aria-label]=\"trapFocus() && ariaLabel() ? ariaLabel() : null\"\n [attr.tabindex]=\"trapFocus() ? '-1' : null\"\n [attr.cdkFocusInitial]=\"trapFocus() ? '' : null\"\n >\n @if (popoverCard()) {\n <ui-card [size]=\"popoverCardSize()\">\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n </ui-card>\n } @else {\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n }\n </div>\n </div>\n}\n","import { HorizontalConnectionPos, Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n Directive,\n ElementRef,\n HostListener,\n inject,\n Injector,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { CardSize } from '@testgorilla/tgo-ui/components/card';\n\nimport { PopoverComponent } from './popover.component';\nimport { PopoverTrigger } from './popover.model';\n\n@Directive({\n selector: '[uiPopover]',\n exportAs: 'uiPopover',\n standalone: true,\n})\nexport class PopoverDirective implements OnInit, OnDestroy {\n uiPopover = input.required<TemplateRef<unknown>>();\n popoverOffset = input(4);\n popoverAlign = input<HorizontalConnectionPos>('center');\n popoverOpen = input(false);\n popoverCard = input(true);\n popoverCardSize = input<CardSize>('medium');\n popoverTrigger = input<PopoverTrigger>('hover');\n popoverAriaLabel = input('');\n uiPopoverDisabled = input(false);\n\n private readonly openState = signal(false);\n\n /** Whether the popover is currently showing. Read it via `#ref=\"uiPopover\"` or `viewChild(PopoverDirective)`. */\n readonly isOpen = this.openState.asReadonly();\n\n private readonly overlay = inject(Overlay);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly ngZone = inject(NgZone);\n\n private overlayRef: OverlayRef | null = null;\n private openTimeout: ReturnType<typeof setTimeout> | null = null;\n private closeTimeout: ReturnType<typeof setTimeout> | null = null;\n private overlayListeners: { enter: () => void; leave: () => void } | null = null;\n private dismissSubscriptions: Subscription | null = null;\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n if (this.popoverTrigger() !== 'hover' || this.uiPopoverDisabled()) {\n return;\n }\n this.cancelClose();\n this.scheduleOpen();\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n if (this.popoverTrigger() !== 'hover') {\n return;\n }\n this.cancelOpen();\n this.scheduleClose();\n }\n\n @HostListener('click')\n onClick(): void {\n if (this.popoverTrigger() !== 'click') {\n return;\n }\n this.toggle();\n }\n\n /** Opens the popover. No-op while `uiPopoverDisabled` is `true` or it is already open. */\n open(): void {\n if (this.uiPopoverDisabled()) {\n return;\n }\n\n if (!this.overlayRef) {\n this.createOverlay();\n }\n\n const overlayRef = this.overlayRef;\n if (!overlayRef || overlayRef.hasAttached()) {\n return;\n }\n\n const portal = new ComponentPortal(PopoverComponent, null, this.injector);\n const ref = overlayRef.attach(portal);\n ref.setInput('templateRef', this.uiPopover());\n ref.setInput('ctx', { close: () => this.close() });\n ref.setInput('popoverCard', this.popoverCard());\n ref.setInput('popoverCardSize', this.popoverCardSize());\n ref.setInput('trapFocus', this.popoverTrigger() === 'click');\n ref.setInput('ariaLabel', this.popoverAriaLabel());\n\n if (this.popoverTrigger() === 'hover') {\n const el = overlayRef.overlayElement;\n const enter = (): void => this.ngZone.run(() => this.cancelClose());\n const leave = (): void => this.ngZone.run(() => this.scheduleClose());\n el.addEventListener('mouseenter', enter);\n el.addEventListener('mouseleave', leave);\n this.overlayListeners = { enter, leave };\n }\n\n this.openState.set(true);\n }\n\n /** Closes the popover. Safe to call when it is already closed. */\n close(): void {\n if (!this.overlayRef) {\n return;\n }\n\n if (this.overlayListeners) {\n const el = this.overlayRef.overlayElement;\n el.removeEventListener('mouseenter', this.overlayListeners.enter);\n el.removeEventListener('mouseleave', this.overlayListeners.leave);\n this.overlayListeners = null;\n }\n\n this.overlayRef.detach();\n this.openState.set(false);\n }\n\n /** Opens the popover when closed, closes it when open. */\n toggle(): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private createOverlay(): void {\n const align = this.popoverAlign();\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions([\n { originX: align, originY: 'bottom', overlayX: align, overlayY: 'top', offsetY: this.popoverOffset() },\n { originX: align, originY: 'top', overlayX: align, overlayY: 'bottom', offsetY: -this.popoverOffset() },\n ]);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n hasBackdrop: false,\n });\n\n if (this.popoverTrigger() === 'click') {\n this.listenForDismiss(this.overlayRef);\n }\n }\n\n /** Click-triggered popovers dismiss on an outside pointer event or on Escape. */\n private listenForDismiss(overlayRef: OverlayRef): void {\n const subscriptions = new Subscription();\n\n subscriptions.add(\n overlayRef.outsidePointerEvents().subscribe(event => {\n // The anchor's own click handler toggles, so ignore it here to avoid closing and reopening.\n if (this.elementRef.nativeElement.contains(event.target as Node)) {\n return;\n }\n this.close();\n })\n );\n\n subscriptions.add(\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n // cdkTrapFocusAutoCapture restores focus to whatever was focused before the popover opened,\n // so closing is all this has to do.\n this.close();\n })\n );\n\n this.dismissSubscriptions = subscriptions;\n }\n\n private scheduleOpen(): void {\n this.openTimeout = setTimeout(() => this.open(), 100);\n }\n\n private cancelOpen(): void {\n if (this.openTimeout) {\n clearTimeout(this.openTimeout);\n this.openTimeout = null;\n }\n }\n\n private scheduleClose(): void {\n this.closeTimeout = setTimeout(() => this.close(), 150);\n }\n\n private cancelClose(): void {\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n this.closeTimeout = null;\n }\n }\n\n ngOnInit(): void {\n if (this.popoverOpen()) {\n this.open();\n }\n }\n\n ngOnDestroy(): void {\n this.cancelOpen();\n this.cancelClose();\n this.close();\n this.dismissSubscriptions?.unsubscribe();\n this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AAA,SAAA;GAAA,EAAA;GAAA,UAAA,CAAA,WAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAhB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAL5B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,YAAY;EACb,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BE,MAAA;GAAa,MAAA,CAAA,YAAY;;;GASzB,MAAA;GAAa,MAAA,CAAA,YAAY;;;GASzB,MAAA;GAAa,MAAA,CAAA,OAAO"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-popover.mjs","names":[],"sources":["../../../components/popover/popover.component.ts","../../../components/popover/popover.component.html","../../../components/popover/popover-overlay.service.ts","../../../components/popover/popover.constants.ts","../../../components/popover/popover.directive.ts","../../../components/popover/popover.service.ts"],"sourcesContent":["import { CdkTrapFocus } from '@angular/cdk/a11y';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, OnInit, TemplateRef } from '@angular/core';\n\nimport { CardComponentModule, CardSize } from '@testgorilla/tgo-ui/components/card';\n\n@Component({\n selector: 'ui-popover',\n standalone: true,\n imports: [NgTemplateOutlet, CardComponentModule, CdkTrapFocus],\n templateUrl: './popover.component.html',\n styleUrls: ['./popover.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PopoverComponent implements OnInit {\n templateRef = input<TemplateRef<unknown> | null>(null);\n ctx = input<Record<string, unknown>>({});\n popoverCard = input(true);\n popoverCardSize = input<CardSize>('medium');\n trapFocus = input(false);\n restoreFocusTo = input<HTMLElement | null>(null);\n ariaLabel = input('');\n\n ngOnInit(): void {\n // Runs before the focus trap captures the element to restore on close: Safari does not focus a button on click.\n this.restoreFocusTo()?.focus({ preventScroll: true });\n }\n}\n","@if (templateRef()) {\n <div class=\"popover-focus-scope\" [cdkTrapFocus]=\"trapFocus()\" [cdkTrapFocusAutoCapture]=\"trapFocus()\">\n <div\n class=\"popover-surface\"\n [attr.role]=\"trapFocus() ? 'dialog' : null\"\n [attr.aria-label]=\"trapFocus() && ariaLabel() ? ariaLabel() : null\"\n [attr.tabindex]=\"trapFocus() ? '-1' : null\"\n [attr.cdkFocusInitial]=\"trapFocus() ? '' : null\"\n >\n @if (popoverCard()) {\n <ui-card [size]=\"popoverCardSize()\">\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n </ui-card>\n } @else {\n <ng-container *ngTemplateOutlet=\"templateRef(); context: ctx()\"></ng-container>\n }\n </div>\n </div>\n}\n","import { ConnectedPosition, Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { ComponentRef, ElementRef, inject, Injectable, Injector, TemplateRef } from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { PopoverComponent } from './popover.component';\nimport { PopoverConfig } from './popover.model';\n\nexport interface PopoverAttachOptions extends Required<PopoverConfig> {\n trapFocus: boolean;\n restoreFocusTo?: HTMLElement;\n}\n\nconst END_PLACEMENT_VIEWPORT_MARGIN = 16;\n\nconst popoverPositions = ({ placement, align, offset }: Required<PopoverConfig>): ConnectedPosition[] =>\n placement === 'end'\n ? [\n { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: offset },\n { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -offset },\n ]\n : [\n { originX: align, originY: 'bottom', overlayX: align, overlayY: 'top', offsetY: offset },\n { originX: align, originY: 'top', overlayX: align, overlayY: 'bottom', offsetY: -offset },\n ];\n\n@Injectable({ providedIn: 'root' })\nexport class PopoverOverlayService {\n private readonly overlay = inject(Overlay);\n\n create(anchor: HTMLElement | ElementRef<HTMLElement>, config: Required<PopoverConfig>): OverlayRef {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(anchor)\n .withPositions(popoverPositions(config))\n .withViewportMargin(config.placement === 'end' ? END_PLACEMENT_VIEWPORT_MARGIN : 0);\n\n return this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n hasBackdrop: false,\n });\n }\n\n attach(\n overlayRef: OverlayRef,\n injector: Injector,\n template: TemplateRef<unknown>,\n close: () => void,\n options: PopoverAttachOptions\n ): ComponentRef<PopoverComponent> {\n const ref = overlayRef.attach(new ComponentPortal(PopoverComponent, null, injector));\n ref.setInput('templateRef', template);\n ref.setInput('ctx', { close });\n ref.setInput('popoverCard', options.isCard);\n ref.setInput('popoverCardSize', options.cardSize);\n ref.setInput('trapFocus', options.trapFocus);\n ref.setInput('restoreFocusTo', options.restoreFocusTo ?? null);\n ref.setInput('ariaLabel', options.ariaLabel);\n return ref;\n }\n\n dismissOnOutsideOrEscape(overlayRef: OverlayRef, anchor: HTMLElement, close: () => void): Subscription {\n const subscriptions = new Subscription();\n\n subscriptions.add(\n overlayRef.outsidePointerEvents().subscribe(event => {\n // The anchor's own click handler toggles, so ignore it here to avoid closing and reopening.\n if (!anchor.contains(event.target as Node)) {\n close();\n }\n })\n );\n\n subscriptions.add(\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n // cdkTrapFocusAutoCapture restores focus to whatever was focused before the popover opened,\n // so closing is all this has to do.\n close();\n })\n );\n\n return subscriptions;\n }\n}\n","import { PopoverConfig } from './popover.model';\n\nexport const POPOVER_DEFAULTS: Required<Omit<PopoverConfig, 'ariaLabel'>> = {\n placement: 'below',\n align: 'center',\n offset: 4,\n isCard: true,\n cardSize: 'medium',\n};\n","import { HorizontalConnectionPos, OverlayRef } from '@angular/cdk/overlay';\nimport {\n Directive,\n ElementRef,\n HostListener,\n inject,\n Injector,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { CardSize } from '@testgorilla/tgo-ui/components/card';\n\nimport { PopoverOverlayService } from './popover-overlay.service';\nimport { POPOVER_DEFAULTS } from './popover.constants';\nimport { PopoverConfig, PopoverPlacement, PopoverTrigger } from './popover.model';\n\n@Directive({\n selector: '[uiPopover]',\n exportAs: 'uiPopover',\n standalone: true,\n})\nexport class PopoverDirective implements OnInit, OnDestroy {\n uiPopover = input.required<TemplateRef<unknown>>();\n popoverOffset = input(POPOVER_DEFAULTS.offset);\n popoverAlign = input<HorizontalConnectionPos>(POPOVER_DEFAULTS.align);\n popoverPlacement = input<PopoverPlacement>(POPOVER_DEFAULTS.placement);\n popoverOpen = input(false);\n popoverCard = input(POPOVER_DEFAULTS.isCard);\n popoverCardSize = input<CardSize>(POPOVER_DEFAULTS.cardSize);\n popoverTrigger = input<PopoverTrigger>('hover');\n popoverAriaLabel = input('');\n uiPopoverDisabled = input(false);\n\n private readonly openState = signal(false);\n\n /** Whether the popover is currently showing. Read it via `#ref=\"uiPopover\"` or `viewChild(PopoverDirective)`. */\n readonly isOpen = this.openState.asReadonly();\n\n private readonly popoverOverlay = inject(PopoverOverlayService);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly ngZone = inject(NgZone);\n\n private overlayRef: OverlayRef | null = null;\n private openTimeout: ReturnType<typeof setTimeout> | null = null;\n private closeTimeout: ReturnType<typeof setTimeout> | null = null;\n private overlayListeners: { enter: () => void; leave: () => void } | null = null;\n private dismissSubscriptions: Subscription | null = null;\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n if (this.popoverTrigger() !== 'hover' || this.uiPopoverDisabled()) {\n return;\n }\n this.cancelClose();\n this.scheduleOpen();\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n if (this.popoverTrigger() !== 'hover') {\n return;\n }\n this.cancelOpen();\n this.scheduleClose();\n }\n\n @HostListener('click')\n onClick(): void {\n if (this.popoverTrigger() !== 'click') {\n return;\n }\n this.toggle();\n }\n\n /** Opens the popover. No-op while `uiPopoverDisabled` is `true` or it is already open. */\n open(): void {\n if (this.uiPopoverDisabled()) {\n return;\n }\n\n if (!this.overlayRef) {\n this.createOverlay();\n }\n\n const overlayRef = this.overlayRef;\n if (!overlayRef || overlayRef.hasAttached()) {\n return;\n }\n\n this.popoverOverlay.attach(overlayRef, this.injector, this.uiPopover(), () => this.close(), {\n ...this.config(),\n trapFocus: this.popoverTrigger() === 'click',\n });\n\n if (this.popoverTrigger() === 'hover') {\n const el = overlayRef.overlayElement;\n const enter = (): void => this.ngZone.run(() => this.cancelClose());\n const leave = (): void => this.ngZone.run(() => this.scheduleClose());\n el.addEventListener('mouseenter', enter);\n el.addEventListener('mouseleave', leave);\n this.overlayListeners = { enter, leave };\n }\n\n this.openState.set(true);\n }\n\n /** Closes the popover. Safe to call when it is already closed. */\n close(): void {\n if (!this.overlayRef) {\n return;\n }\n\n if (this.overlayListeners) {\n const el = this.overlayRef.overlayElement;\n el.removeEventListener('mouseenter', this.overlayListeners.enter);\n el.removeEventListener('mouseleave', this.overlayListeners.leave);\n this.overlayListeners = null;\n }\n\n this.overlayRef.detach();\n this.openState.set(false);\n }\n\n /** Opens the popover when closed, closes it when open. */\n toggle(): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private config(): Required<PopoverConfig> {\n return {\n placement: this.popoverPlacement(),\n align: this.popoverAlign(),\n offset: this.popoverOffset(),\n isCard: this.popoverCard(),\n cardSize: this.popoverCardSize(),\n ariaLabel: this.popoverAriaLabel(),\n };\n }\n\n private createOverlay(): void {\n this.overlayRef = this.popoverOverlay.create(this.elementRef, this.config());\n\n if (this.popoverTrigger() === 'click') {\n this.dismissSubscriptions = this.popoverOverlay.dismissOnOutsideOrEscape(\n this.overlayRef,\n this.elementRef.nativeElement,\n () => this.close()\n );\n }\n }\n\n private scheduleOpen(): void {\n this.openTimeout = setTimeout(() => this.open(), 100);\n }\n\n private cancelOpen(): void {\n if (this.openTimeout) {\n clearTimeout(this.openTimeout);\n this.openTimeout = null;\n }\n }\n\n private scheduleClose(): void {\n this.closeTimeout = setTimeout(() => this.close(), 150);\n }\n\n private cancelClose(): void {\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n this.closeTimeout = null;\n }\n }\n\n ngOnInit(): void {\n if (this.popoverOpen()) {\n this.open();\n }\n }\n\n ngOnDestroy(): void {\n this.cancelOpen();\n this.cancelClose();\n this.close();\n this.dismissSubscriptions?.unsubscribe();\n this.overlayRef?.dispose();\n }\n}\n","import { OverlayRef } from '@angular/cdk/overlay';\nimport { DestroyRef, inject, Injectable, Injector, signal, TemplateRef } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { PopoverOverlayService } from './popover-overlay.service';\nimport { POPOVER_DEFAULTS } from './popover.constants';\nimport { PopoverConfig, PopoverOpenConfig } from './popover.model';\n\nexport class PopoverRef {\n private readonly openState = signal(true);\n private readonly closedSubject$ = new Subject<void>();\n\n readonly isOpen = this.openState.asReadonly();\n /** Emits once, however the popover closed. */\n readonly closed$: Observable<void> = this.closedSubject$.asObservable();\n\n private stopClosingOnDestroy?: () => void;\n\n constructor(\n readonly anchor: HTMLElement,\n private readonly overlayRef: OverlayRef,\n destroyRef?: DestroyRef\n ) {\n this.stopClosingOnDestroy = destroyRef?.onDestroy(() => {\n this.stopClosingOnDestroy = undefined;\n this.close();\n });\n }\n\n close(): void {\n if (!this.openState()) {\n return;\n }\n this.openState.set(false);\n this.stopClosingOnDestroy?.();\n this.overlayRef.dispose();\n this.closedSubject$.next();\n this.closedSubject$.complete();\n }\n}\n\n/** Opens a popover against an anchor you do not own, with the same semantics as `popoverTrigger=\"click\"`. */\n@Injectable({ providedIn: 'root' })\nexport class PopoverService {\n private readonly popoverOverlay = inject(PopoverOverlayService);\n private readonly injector = inject(Injector);\n\n private active: PopoverRef | null = null;\n\n /** Returns the open popover when `anchor` already has one; any other popover opened here closes first. */\n open(anchor: HTMLElement, template: TemplateRef<unknown>, config: PopoverOpenConfig = {}): PopoverRef {\n const current = this.openRefFor(anchor);\n if (current) {\n return current;\n }\n this.active?.close();\n\n const { destroyRef, ...popoverConfig } = config;\n const resolved: Required<PopoverConfig> = { ...POPOVER_DEFAULTS, ariaLabel: '', ...popoverConfig };\n const overlayRef = this.popoverOverlay.create(anchor, resolved);\n const ref = new PopoverRef(anchor, overlayRef, destroyRef);\n const close = (): void => ref.close();\n\n this.popoverOverlay.attach(overlayRef, this.injector, template, close, {\n ...resolved,\n trapFocus: true,\n restoreFocusTo: anchor,\n });\n this.popoverOverlay.dismissOnOutsideOrEscape(overlayRef, anchor, close);\n\n this.active = ref;\n return ref;\n }\n\n /** Closes the popover when `anchor` has one open (returning `null`), opens it otherwise. */\n toggle(anchor: HTMLElement, template: TemplateRef<unknown>, config: PopoverOpenConfig = {}): PopoverRef | null {\n const current = this.openRefFor(anchor);\n if (current) {\n current.close();\n return null;\n }\n return this.open(anchor, template, config);\n }\n\n private openRefFor(anchor: HTMLElement): PopoverRef | null {\n const active = this.active;\n return active?.anchor === anchor && active.isOpen() ? active : null;\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,mBAAb,MAAa,iBAAgB;CAR7B,cAAA;EASE,KAAA,cAAc,MAAmC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACtD,KAAA,MAAM,MAA+B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;EACxC,KAAA,cAAc,MAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACzB,KAAA,kBAAkB,MAAgB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;EAC3C,KAAA,YAAY,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EACxB,KAAA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752
752
|
"ariaExpanded",
|
|
753
753
|
"ariaControls",
|
|
754
754
|
"ariaPressed",
|
|
755
|
+
"ariaHasPopup",
|
|
755
756
|
"ariaRequired",
|
|
756
757
|
"ariaLabelledby",
|
|
757
758
|
"ariaDescribedby",
|
|
758
759
|
"preventDefault",
|
|
759
760
|
"hasBackground",
|
|
760
761
|
"circular",
|
|
762
|
+
"isSingleLineLabel",
|
|
763
|
+
"iconButtonShape",
|
|
761
764
|
"tooltipPosition",
|
|
762
765
|
"role",
|
|
763
766
|
"iconFilled",
|
|
@@ -879,6 +882,7 @@ var PromptComponent = class PromptComponent {
|
|
|
879
882
|
"uiPopover",
|
|
880
883
|
"popoverOffset",
|
|
881
884
|
"popoverAlign",
|
|
885
|
+
"popoverPlacement",
|
|
882
886
|
"popoverOpen",
|
|
883
887
|
"popoverCard",
|
|
884
888
|
"popoverCardSize",
|