@raqm/ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/NOTICE.md +28 -0
- package/README.md +126 -3
- package/combobox/README.md +17 -0
- package/fesm2022/raqm-ui-accordion.mjs +414 -0
- package/fesm2022/raqm-ui-accordion.mjs.map +1 -0
- package/fesm2022/raqm-ui-alert-dialog.mjs +457 -0
- package/fesm2022/raqm-ui-alert-dialog.mjs.map +1 -0
- package/fesm2022/raqm-ui-alert.mjs +195 -0
- package/fesm2022/raqm-ui-alert.mjs.map +1 -0
- package/fesm2022/raqm-ui-aspect-ratio.mjs +66 -0
- package/fesm2022/raqm-ui-aspect-ratio.mjs.map +1 -0
- package/fesm2022/raqm-ui-attachment.mjs +435 -0
- package/fesm2022/raqm-ui-attachment.mjs.map +1 -0
- package/fesm2022/raqm-ui-avatar.mjs +337 -0
- package/fesm2022/raqm-ui-avatar.mjs.map +1 -0
- package/fesm2022/raqm-ui-badge.mjs +68 -0
- package/fesm2022/raqm-ui-badge.mjs.map +1 -0
- package/fesm2022/raqm-ui-breadcrumb.mjs +309 -0
- package/fesm2022/raqm-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/raqm-ui-button-group.mjs +138 -0
- package/fesm2022/raqm-ui-button-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-button.mjs +295 -0
- package/fesm2022/raqm-ui-button.mjs.map +1 -0
- package/fesm2022/raqm-ui-calendar.mjs +1394 -0
- package/fesm2022/raqm-ui-calendar.mjs.map +1 -0
- package/fesm2022/raqm-ui-card.mjs +331 -0
- package/fesm2022/raqm-ui-card.mjs.map +1 -0
- package/fesm2022/raqm-ui-carousel.mjs +410 -0
- package/fesm2022/raqm-ui-carousel.mjs.map +1 -0
- package/fesm2022/raqm-ui-checkbox.mjs +86 -0
- package/fesm2022/raqm-ui-checkbox.mjs.map +1 -0
- package/fesm2022/raqm-ui-collapsible.mjs +266 -0
- package/fesm2022/raqm-ui-collapsible.mjs.map +1 -0
- package/fesm2022/raqm-ui-combobox.mjs +1584 -0
- package/fesm2022/raqm-ui-combobox.mjs.map +1 -0
- package/fesm2022/raqm-ui-command.mjs +1210 -0
- package/fesm2022/raqm-ui-command.mjs.map +1 -0
- package/fesm2022/raqm-ui-context-menu.mjs +723 -0
- package/fesm2022/raqm-ui-context-menu.mjs.map +1 -0
- package/fesm2022/raqm-ui-dialog.mjs +1214 -0
- package/fesm2022/raqm-ui-dialog.mjs.map +1 -0
- package/fesm2022/raqm-ui-drawer.mjs +687 -0
- package/fesm2022/raqm-ui-drawer.mjs.map +1 -0
- package/fesm2022/raqm-ui-dropdown-menu.mjs +1168 -0
- package/fesm2022/raqm-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/raqm-ui-empty.mjs +272 -0
- package/fesm2022/raqm-ui-empty.mjs.map +1 -0
- package/fesm2022/raqm-ui-field.mjs +517 -0
- package/fesm2022/raqm-ui-field.mjs.map +1 -0
- package/fesm2022/raqm-ui-hover-card.mjs +828 -0
- package/fesm2022/raqm-ui-hover-card.mjs.map +1 -0
- package/fesm2022/raqm-ui-input-group.mjs +270 -0
- package/fesm2022/raqm-ui-input-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-input-otp.mjs +788 -0
- package/fesm2022/raqm-ui-input-otp.mjs.map +1 -0
- package/fesm2022/raqm-ui-input.mjs +73 -0
- package/fesm2022/raqm-ui-input.mjs.map +1 -0
- package/fesm2022/raqm-ui-item.mjs +495 -0
- package/fesm2022/raqm-ui-item.mjs.map +1 -0
- package/fesm2022/raqm-ui-kbd.mjs +80 -0
- package/fesm2022/raqm-ui-kbd.mjs.map +1 -0
- package/fesm2022/raqm-ui-label.mjs +44 -0
- package/fesm2022/raqm-ui-label.mjs.map +1 -0
- package/fesm2022/raqm-ui-menubar.mjs +536 -0
- package/fesm2022/raqm-ui-menubar.mjs.map +1 -0
- package/fesm2022/raqm-ui-native-select.mjs +131 -0
- package/fesm2022/raqm-ui-native-select.mjs.map +1 -0
- package/fesm2022/raqm-ui-navigation-menu.mjs +1399 -0
- package/fesm2022/raqm-ui-navigation-menu.mjs.map +1 -0
- package/fesm2022/raqm-ui-overlay-internal.mjs +185 -0
- package/fesm2022/raqm-ui-overlay-internal.mjs.map +1 -0
- package/fesm2022/raqm-ui-pagination.mjs +440 -0
- package/fesm2022/raqm-ui-pagination.mjs.map +1 -0
- package/fesm2022/raqm-ui-popover.mjs +1495 -0
- package/fesm2022/raqm-ui-popover.mjs.map +1 -0
- package/fesm2022/raqm-ui-progress.mjs +369 -0
- package/fesm2022/raqm-ui-progress.mjs.map +1 -0
- package/fesm2022/raqm-ui-questionnaire.mjs +1005 -0
- package/fesm2022/raqm-ui-questionnaire.mjs.map +1 -0
- package/fesm2022/raqm-ui-radio-group.mjs +151 -0
- package/fesm2022/raqm-ui-radio-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-resizable.mjs +439 -0
- package/fesm2022/raqm-ui-resizable.mjs.map +1 -0
- package/fesm2022/raqm-ui-scroll-area.mjs +510 -0
- package/fesm2022/raqm-ui-scroll-area.mjs.map +1 -0
- package/fesm2022/raqm-ui-select.mjs +1073 -0
- package/fesm2022/raqm-ui-select.mjs.map +1 -0
- package/fesm2022/raqm-ui-separator.mjs +103 -0
- package/fesm2022/raqm-ui-separator.mjs.map +1 -0
- package/fesm2022/raqm-ui-sheet.mjs +411 -0
- package/fesm2022/raqm-ui-sheet.mjs.map +1 -0
- package/fesm2022/raqm-ui-sidebar.mjs +1784 -0
- package/fesm2022/raqm-ui-sidebar.mjs.map +1 -0
- package/fesm2022/raqm-ui-skeleton.mjs +50 -0
- package/fesm2022/raqm-ui-skeleton.mjs.map +1 -0
- package/fesm2022/raqm-ui-slider.mjs +609 -0
- package/fesm2022/raqm-ui-slider.mjs.map +1 -0
- package/fesm2022/raqm-ui-spinner.mjs +137 -0
- package/fesm2022/raqm-ui-spinner.mjs.map +1 -0
- package/fesm2022/raqm-ui-switch.mjs +109 -0
- package/fesm2022/raqm-ui-switch.mjs.map +1 -0
- package/fesm2022/raqm-ui-table.mjs +271 -0
- package/fesm2022/raqm-ui-table.mjs.map +1 -0
- package/fesm2022/raqm-ui-tabs.mjs +536 -0
- package/fesm2022/raqm-ui-tabs.mjs.map +1 -0
- package/fesm2022/raqm-ui-textarea.mjs +37 -0
- package/fesm2022/raqm-ui-textarea.mjs.map +1 -0
- package/fesm2022/raqm-ui-toast.mjs +918 -0
- package/fesm2022/raqm-ui-toast.mjs.map +1 -0
- package/fesm2022/raqm-ui-toggle-group.mjs +462 -0
- package/fesm2022/raqm-ui-toggle-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-toggle.mjs +158 -0
- package/fesm2022/raqm-ui-toggle.mjs.map +1 -0
- package/fesm2022/raqm-ui-tooltip.mjs +1226 -0
- package/fesm2022/raqm-ui-tooltip.mjs.map +1 -0
- package/fesm2022/raqm-ui.mjs +50 -0
- package/input-otp/README.md +12 -0
- package/package.json +275 -3
- package/styles/theme.css +4324 -0
- package/types/raqm-ui-accordion.d.ts +124 -0
- package/types/raqm-ui-alert-dialog.d.ts +81 -0
- package/types/raqm-ui-alert.d.ts +29 -0
- package/types/raqm-ui-aspect-ratio.d.ts +13 -0
- package/types/raqm-ui-attachment.d.ts +72 -0
- package/types/raqm-ui-avatar.d.ts +67 -0
- package/types/raqm-ui-badge.d.ts +20 -0
- package/types/raqm-ui-breadcrumb.d.ts +35 -0
- package/types/raqm-ui-button-group.d.ts +27 -0
- package/types/raqm-ui-button.d.ts +80 -0
- package/types/raqm-ui-calendar.d.ts +359 -0
- package/types/raqm-ui-card.d.ts +34 -0
- package/types/raqm-ui-carousel.d.ts +81 -0
- package/types/raqm-ui-checkbox.d.ts +24 -0
- package/types/raqm-ui-collapsible.d.ts +72 -0
- package/types/raqm-ui-combobox.d.ts +405 -0
- package/types/raqm-ui-command.d.ts +256 -0
- package/types/raqm-ui-context-menu.d.ts +196 -0
- package/types/raqm-ui-dialog.d.ts +232 -0
- package/types/raqm-ui-drawer.d.ts +121 -0
- package/types/raqm-ui-dropdown-menu.d.ts +319 -0
- package/types/raqm-ui-empty.d.ts +35 -0
- package/types/raqm-ui-field.d.ts +88 -0
- package/types/raqm-ui-hover-card.d.ts +139 -0
- package/types/raqm-ui-input-group.d.ts +45 -0
- package/types/raqm-ui-input-otp.d.ts +197 -0
- package/types/raqm-ui-input.d.ts +16 -0
- package/types/raqm-ui-item.d.ts +71 -0
- package/types/raqm-ui-kbd.d.ts +12 -0
- package/types/raqm-ui-label.d.ts +6 -0
- package/types/raqm-ui-menubar.d.ts +159 -0
- package/types/raqm-ui-native-select.d.ts +23 -0
- package/types/raqm-ui-navigation-menu.d.ts +230 -0
- package/types/raqm-ui-overlay-internal.d.ts +5 -0
- package/types/raqm-ui-pagination.d.ts +84 -0
- package/types/raqm-ui-popover.d.ts +235 -0
- package/types/raqm-ui-progress.d.ts +79 -0
- package/types/raqm-ui-questionnaire.d.ts +217 -0
- package/types/raqm-ui-radio-group.d.ts +48 -0
- package/types/raqm-ui-resizable.d.ts +98 -0
- package/types/raqm-ui-scroll-area.d.ts +132 -0
- package/types/raqm-ui-select.d.ts +205 -0
- package/types/raqm-ui-separator.d.ts +21 -0
- package/types/raqm-ui-sheet.d.ts +79 -0
- package/types/raqm-ui-sidebar.d.ts +285 -0
- package/types/raqm-ui-skeleton.d.ts +6 -0
- package/types/raqm-ui-slider.d.ts +129 -0
- package/types/raqm-ui-spinner.d.ts +32 -0
- package/types/raqm-ui-switch.d.ts +32 -0
- package/types/raqm-ui-table.d.ts +36 -0
- package/types/raqm-ui-tabs.d.ts +154 -0
- package/types/raqm-ui-textarea.d.ts +6 -0
- package/types/raqm-ui-toast.d.ts +190 -0
- package/types/raqm-ui-toggle-group.d.ts +167 -0
- package/types/raqm-ui-toggle.d.ts +42 -0
- package/types/raqm-ui-tooltip.d.ts +207 -0
- package/types/raqm-ui.d.ts +50 -0
|
@@ -0,0 +1,1214 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, InjectionToken, Injector, Renderer2, TemplateRef, afterNextRender, booleanAttribute, computed, effect, inject, input, isDevMode, model, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import { FocusMonitor, InteractivityChecker } from "@angular/cdk/a11y";
|
|
5
|
+
import { Directionality } from "@angular/cdk/bidi";
|
|
6
|
+
import { Dialog } from "@angular/cdk/dialog";
|
|
7
|
+
import { RaqmButton } from "@raqm/ui/button";
|
|
8
|
+
import { ScrollStrategyOptions } from "@angular/cdk/overlay";
|
|
9
|
+
import { hasModifierKey } from "@angular/cdk/keycodes";
|
|
10
|
+
import { registerOverlayOwnership } from "@raqm/ui/overlay-internal";
|
|
11
|
+
const RAQM_DIALOG = new InjectionToken("RaqmDialog");
|
|
12
|
+
const RAQM_DIALOG_POLICY = new InjectionToken("RaqmDialogPolicy");
|
|
13
|
+
var RaqmDialogScrollLock = class {
|
|
14
|
+
strategy;
|
|
15
|
+
active = 0;
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.strategy = options.block();
|
|
18
|
+
}
|
|
19
|
+
acquire() {
|
|
20
|
+
this.active += 1;
|
|
21
|
+
this.strategy.enable();
|
|
22
|
+
}
|
|
23
|
+
release() {
|
|
24
|
+
if (this.active === 0) return;
|
|
25
|
+
this.active -= 1;
|
|
26
|
+
if (this.active === 0) this.strategy.disable();
|
|
27
|
+
}
|
|
28
|
+
createLease() {
|
|
29
|
+
return new RaqmDialogScrollLease(this);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var RaqmDialogScrollLease = class {
|
|
33
|
+
held = false;
|
|
34
|
+
lock;
|
|
35
|
+
constructor(lock) {
|
|
36
|
+
this.lock = lock;
|
|
37
|
+
}
|
|
38
|
+
attach(_overlayRef) {}
|
|
39
|
+
enable() {
|
|
40
|
+
if (this.held) return;
|
|
41
|
+
this.held = true;
|
|
42
|
+
this.lock.acquire();
|
|
43
|
+
}
|
|
44
|
+
disable() {
|
|
45
|
+
if (!this.held) return;
|
|
46
|
+
this.held = false;
|
|
47
|
+
this.lock.release();
|
|
48
|
+
}
|
|
49
|
+
detach() {
|
|
50
|
+
this.disable();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const RAQM_DIALOG_SCROLL_LOCK = new InjectionToken("RaqmDialogScrollLock", {
|
|
54
|
+
providedIn: "root",
|
|
55
|
+
factory: () => new RaqmDialogScrollLock(inject(ScrollStrategyOptions))
|
|
56
|
+
});
|
|
57
|
+
function connectDialogEffects(host) {
|
|
58
|
+
effect(() => {
|
|
59
|
+
const next = host.openValue() && !host.disabled() && host.canOpen();
|
|
60
|
+
untracked(() => host.syncOpen(next));
|
|
61
|
+
});
|
|
62
|
+
effect(() => {
|
|
63
|
+
const panelClass = host.panelClass();
|
|
64
|
+
untracked(() => host.applyPanelClass(panelClass));
|
|
65
|
+
});
|
|
66
|
+
effect(() => {
|
|
67
|
+
host.label();
|
|
68
|
+
untracked(() => host.syncContainerAria());
|
|
69
|
+
});
|
|
70
|
+
effect(() => {
|
|
71
|
+
host.dir();
|
|
72
|
+
untracked(() => host.applyDirection());
|
|
73
|
+
});
|
|
74
|
+
effect(() => {
|
|
75
|
+
if (isDevMode() && host.closeButtonVisible() && !host.closeLabelText()) console.error("[raqm-dialog-family] The close control has no accessible name. Provide `closeLabel`.");
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const PANE_CLASS = "raqm-dialog-overlay-pane";
|
|
79
|
+
const CONTAINER_CLASS = "cdk-dialog-container";
|
|
80
|
+
const FOCUSABLE_SELECTOR = "a[href], button, input, select, textarea, [tabindex], [contenteditable=\"true\"]";
|
|
81
|
+
function prefersReducedMotion() {
|
|
82
|
+
return typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
83
|
+
}
|
|
84
|
+
function toDir(value) {
|
|
85
|
+
return value === "ltr" || value === "rtl" ? value : void 0;
|
|
86
|
+
}
|
|
87
|
+
function resolveDialogDirection(dir, element, directionality) {
|
|
88
|
+
const explicit = dir;
|
|
89
|
+
if (explicit === "ltr" || explicit === "rtl") return explicit;
|
|
90
|
+
const computedStyle = getComputedStyle(element).direction;
|
|
91
|
+
if (computedStyle === "rtl") return "rtl";
|
|
92
|
+
if (computedStyle === "ltr") return "ltr";
|
|
93
|
+
return directionality?.value ?? "ltr";
|
|
94
|
+
}
|
|
95
|
+
var RaqmDialogFocus = class {
|
|
96
|
+
dialogService;
|
|
97
|
+
focusMonitor;
|
|
98
|
+
checker;
|
|
99
|
+
state;
|
|
100
|
+
host;
|
|
101
|
+
constructor(dialogService, focusMonitor, checker, state, host) {
|
|
102
|
+
this.dialogService = dialogService;
|
|
103
|
+
this.focusMonitor = focusMonitor;
|
|
104
|
+
this.checker = checker;
|
|
105
|
+
this.state = state;
|
|
106
|
+
this.host = host;
|
|
107
|
+
}
|
|
108
|
+
maybeRestoreOriginFocus() {
|
|
109
|
+
if (this.state.destroyed || this.state.suppressFocusRestore) return;
|
|
110
|
+
const trigger = this.host.trigger()?.element;
|
|
111
|
+
const origin = trigger ?? this.state.triggerlessOrigin;
|
|
112
|
+
if (!origin || !origin.isConnected) return;
|
|
113
|
+
if (!trigger && (origin.closest("[inert]") || !this.checker.isFocusable(origin))) return;
|
|
114
|
+
const active = origin.ownerDocument.activeElement;
|
|
115
|
+
const remaining = this.dialogService.openDialogs;
|
|
116
|
+
if (remaining.length > 0) {
|
|
117
|
+
const topSurface = remaining[remaining.length - 1].overlayRef.overlayElement;
|
|
118
|
+
if (!topSurface.contains(origin)) return;
|
|
119
|
+
if (active !== null && topSurface.contains(active)) return;
|
|
120
|
+
} else if (active !== null && active !== origin.ownerDocument.body) return;
|
|
121
|
+
this.focusMonitor.focusVia(origin, this.state.lastCloseOrigin ?? "program");
|
|
122
|
+
}
|
|
123
|
+
focusInitial() {
|
|
124
|
+
const overlayElement = this.host.pane();
|
|
125
|
+
if (!overlayElement) return;
|
|
126
|
+
const container = overlayElement.querySelector(`.cdk-dialog-container`) ?? overlayElement;
|
|
127
|
+
((this.host.touchOpening() ? container : this.firstTabbable(container)) ?? container).focus();
|
|
128
|
+
}
|
|
129
|
+
validateAccessibleName() {
|
|
130
|
+
if (!isDevMode()) return;
|
|
131
|
+
if (!this.host.hasTitle() && !this.host.label()) console.error("[raqm-dialog] The dialog has no accessible name. Provide a `[raqm-dialog-title]` or an explicit `label`.");
|
|
132
|
+
}
|
|
133
|
+
firstTabbable(root) {
|
|
134
|
+
const candidates = root.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
135
|
+
for (const candidate of Array.from(candidates)) if (this.checker.isTabbable(candidate)) return candidate;
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var RaqmDialogOverlay = class {
|
|
140
|
+
dialogService;
|
|
141
|
+
scrollLock;
|
|
142
|
+
injector;
|
|
143
|
+
state;
|
|
144
|
+
policy;
|
|
145
|
+
host;
|
|
146
|
+
dialogRef;
|
|
147
|
+
pendingDialogRef;
|
|
148
|
+
exitTimer;
|
|
149
|
+
pendingCloseOrigin;
|
|
150
|
+
finalizing = false;
|
|
151
|
+
backdropSubscription;
|
|
152
|
+
keydownSubscription;
|
|
153
|
+
closedSubscription;
|
|
154
|
+
appliedPaneClasses = [];
|
|
155
|
+
constructor(dialogService, scrollLock, injector, state, policy, host) {
|
|
156
|
+
this.dialogService = dialogService;
|
|
157
|
+
this.scrollLock = scrollLock;
|
|
158
|
+
this.injector = injector;
|
|
159
|
+
this.state = state;
|
|
160
|
+
this.policy = policy;
|
|
161
|
+
this.host = host;
|
|
162
|
+
}
|
|
163
|
+
get element() {
|
|
164
|
+
return this.dialogRef?.overlayRef.overlayElement;
|
|
165
|
+
}
|
|
166
|
+
syncOpen(next) {
|
|
167
|
+
if (next === this.state.currentOpen) return;
|
|
168
|
+
if (next) {
|
|
169
|
+
this.state.currentOpen = true;
|
|
170
|
+
this.beginOpen();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
this.state.currentOpen = false;
|
|
174
|
+
this.beginClose();
|
|
175
|
+
}
|
|
176
|
+
beginOpen() {
|
|
177
|
+
const trigger = this.host.trigger();
|
|
178
|
+
const template = this.host.contentTemplate();
|
|
179
|
+
const panelTemplate = this.host.panelTemplate();
|
|
180
|
+
if (!trigger && !this.policy?.allowWithoutTrigger || !template || !panelTemplate) {
|
|
181
|
+
this.state.currentOpen = false;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
this.flushPendingDispose();
|
|
185
|
+
this.releaseSubscriptions();
|
|
186
|
+
const generation = ++this.state.openGeneration;
|
|
187
|
+
this.state.closing.set(false);
|
|
188
|
+
this.state.entering.set(true);
|
|
189
|
+
this.state.attached.set(false);
|
|
190
|
+
this.state.dialogId.set(this.host.dialogRootId);
|
|
191
|
+
this.pendingCloseOrigin = void 0;
|
|
192
|
+
this.state.suppressFocusRestore = false;
|
|
193
|
+
const dir = this.host.direction();
|
|
194
|
+
this.state.panelDir.set(dir);
|
|
195
|
+
const config = {
|
|
196
|
+
id: this.host.dialogRootId,
|
|
197
|
+
role: this.policy?.role ?? "dialog",
|
|
198
|
+
ariaModal: true,
|
|
199
|
+
hasBackdrop: true,
|
|
200
|
+
backdropClass: this.policy?.backdropClass ?? "raqm-dialog-overlay-backdrop",
|
|
201
|
+
panelClass: this.paneClasses(this.host.panelClass()),
|
|
202
|
+
width: this.policy?.side ? "100%" : void 0,
|
|
203
|
+
height: this.policy?.side ? "100%" : void 0,
|
|
204
|
+
disableClose: true,
|
|
205
|
+
closeOnNavigation: true,
|
|
206
|
+
direction: dir,
|
|
207
|
+
scrollStrategy: this.scrollLock.createLease(),
|
|
208
|
+
restoreFocus: false,
|
|
209
|
+
autoFocus: false
|
|
210
|
+
};
|
|
211
|
+
const focused = this.host.root.ownerDocument.activeElement;
|
|
212
|
+
this.state.triggerlessOrigin = !trigger && this.policy?.allowWithoutTrigger && focused instanceof HTMLElement ? focused : null;
|
|
213
|
+
const dialogRef = this.dialogService.open(panelTemplate, config);
|
|
214
|
+
const origin = trigger?.element ?? this.host.root;
|
|
215
|
+
registerOverlayOwnership(origin, dialogRef.overlayRef, true);
|
|
216
|
+
this.dialogRef = dialogRef;
|
|
217
|
+
this.appliedPaneClasses = this.paneClasses(this.host.panelClass());
|
|
218
|
+
this.backdropSubscription = dialogRef.backdropClick.subscribe(() => {
|
|
219
|
+
if (this.policy?.dismissOnBackdrop !== false) this.requestClose("mouse");
|
|
220
|
+
});
|
|
221
|
+
this.keydownSubscription = dialogRef.keydownEvents.subscribe((event) => {
|
|
222
|
+
if (event.key === "Escape" && !hasModifierKey(event)) {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
event.stopPropagation();
|
|
225
|
+
this.requestClose("keyboard");
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
this.closedSubscription = dialogRef.closed.subscribe(() => {
|
|
229
|
+
this.onDialogClosed(dialogRef);
|
|
230
|
+
});
|
|
231
|
+
this.state.attached.set(true);
|
|
232
|
+
this.host.syncContainerAria();
|
|
233
|
+
afterNextRender(() => {
|
|
234
|
+
if (generation !== this.state.openGeneration || this.dialogRef !== dialogRef || !this.state.attached()) return;
|
|
235
|
+
this.host.focusInitial();
|
|
236
|
+
this.host.validateAccessibleName();
|
|
237
|
+
}, { injector: this.injector });
|
|
238
|
+
}
|
|
239
|
+
beginClose() {
|
|
240
|
+
this.state.dialogId.set(null);
|
|
241
|
+
this.state.closing.set(false);
|
|
242
|
+
this.state.entering.set(false);
|
|
243
|
+
this.state.attached.set(false);
|
|
244
|
+
const dialogRef = this.dialogRef;
|
|
245
|
+
this.dialogRef = void 0;
|
|
246
|
+
this.releaseInputSubscriptions();
|
|
247
|
+
this.appliedPaneClasses = [];
|
|
248
|
+
if (!dialogRef) return;
|
|
249
|
+
const pane = dialogRef.overlayRef.overlayElement;
|
|
250
|
+
pane.setAttribute("inert", "");
|
|
251
|
+
pane.setAttribute("aria-hidden", "true");
|
|
252
|
+
dialogRef.overlayRef.backdropElement?.classList.remove("cdk-overlay-backdrop-showing");
|
|
253
|
+
const content = pane.querySelector(".raqm-dialog-content");
|
|
254
|
+
content?.classList.remove("raqm-dialog-content--entering");
|
|
255
|
+
content?.classList.add("raqm-dialog-content--closing");
|
|
256
|
+
this.state.closing.set(true);
|
|
257
|
+
this.pendingDialogRef = dialogRef;
|
|
258
|
+
if (prefersReducedMotion()) {
|
|
259
|
+
this.finalizeClose(dialogRef, true);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
this.exitTimer = setTimeout(() => {
|
|
263
|
+
this.exitTimer = void 0;
|
|
264
|
+
this.state.closing.set(false);
|
|
265
|
+
this.finalizeClose(dialogRef, true);
|
|
266
|
+
}, this.policy?.exitAnimationMs ?? 100);
|
|
267
|
+
}
|
|
268
|
+
finalizeClose(dialogRef, restore) {
|
|
269
|
+
const origin = this.pendingCloseOrigin;
|
|
270
|
+
this.pendingCloseOrigin = void 0;
|
|
271
|
+
this.state.lastCloseOrigin = origin;
|
|
272
|
+
if (this.exitTimer !== void 0) {
|
|
273
|
+
clearTimeout(this.exitTimer);
|
|
274
|
+
this.exitTimer = void 0;
|
|
275
|
+
}
|
|
276
|
+
const options = origin ? { focusOrigin: origin } : void 0;
|
|
277
|
+
this.state.closing.set(false);
|
|
278
|
+
this.finalizing = true;
|
|
279
|
+
dialogRef.close(void 0, options);
|
|
280
|
+
this.finalizing = false;
|
|
281
|
+
if (this.pendingDialogRef === dialogRef) this.pendingDialogRef = void 0;
|
|
282
|
+
if (restore) this.host.maybeRestoreOriginFocus();
|
|
283
|
+
}
|
|
284
|
+
requestClose(origin) {
|
|
285
|
+
this.pendingCloseOrigin = origin;
|
|
286
|
+
if (this.host.openValue()) this.host.setOpenValue(false);
|
|
287
|
+
}
|
|
288
|
+
flushPendingDispose() {
|
|
289
|
+
if (this.exitTimer !== void 0) {
|
|
290
|
+
clearTimeout(this.exitTimer);
|
|
291
|
+
this.exitTimer = void 0;
|
|
292
|
+
}
|
|
293
|
+
this.state.closing.set(false);
|
|
294
|
+
const pending = this.pendingDialogRef;
|
|
295
|
+
if (!pending) return;
|
|
296
|
+
this.pendingDialogRef = void 0;
|
|
297
|
+
this.state.suppressFocusRestore = true;
|
|
298
|
+
pending.close();
|
|
299
|
+
}
|
|
300
|
+
onDialogClosed(dialogRef) {
|
|
301
|
+
const isLive = this.dialogRef === dialogRef;
|
|
302
|
+
const isPending = this.pendingDialogRef === dialogRef;
|
|
303
|
+
if (!isLive && !isPending) return;
|
|
304
|
+
if (isPending && this.exitTimer !== void 0) {
|
|
305
|
+
clearTimeout(this.exitTimer);
|
|
306
|
+
this.exitTimer = void 0;
|
|
307
|
+
}
|
|
308
|
+
if (isPending) this.pendingDialogRef = void 0;
|
|
309
|
+
if (isLive) this.dialogRef = void 0;
|
|
310
|
+
this.releaseInputSubscriptions();
|
|
311
|
+
this.releaseClosedSubscription();
|
|
312
|
+
this.appliedPaneClasses = [];
|
|
313
|
+
this.state.attached.set(false);
|
|
314
|
+
this.state.entering.set(false);
|
|
315
|
+
this.state.closing.set(false);
|
|
316
|
+
this.state.dialogId.set(null);
|
|
317
|
+
this.state.currentOpen = false;
|
|
318
|
+
if (!this.finalizing) this.state.suppressFocusRestore = true;
|
|
319
|
+
this.setClosed();
|
|
320
|
+
}
|
|
321
|
+
setClosed() {
|
|
322
|
+
if (this.host.openValue()) this.host.setOpenValue(false);
|
|
323
|
+
}
|
|
324
|
+
destroy() {
|
|
325
|
+
this.state.openGeneration += 1;
|
|
326
|
+
this.state.destroyed = true;
|
|
327
|
+
this.state.triggerlessOrigin = null;
|
|
328
|
+
this.state.suppressFocusRestore = true;
|
|
329
|
+
this.releaseSubscriptions();
|
|
330
|
+
if (this.exitTimer !== void 0) {
|
|
331
|
+
clearTimeout(this.exitTimer);
|
|
332
|
+
this.exitTimer = void 0;
|
|
333
|
+
}
|
|
334
|
+
const dialogRef = this.dialogRef;
|
|
335
|
+
this.dialogRef = void 0;
|
|
336
|
+
const pending = this.pendingDialogRef;
|
|
337
|
+
this.pendingDialogRef = void 0;
|
|
338
|
+
this.appliedPaneClasses = [];
|
|
339
|
+
this.state.attached.set(false);
|
|
340
|
+
dialogRef?.close();
|
|
341
|
+
pending?.close();
|
|
342
|
+
}
|
|
343
|
+
paneClasses(panelClass) {
|
|
344
|
+
const extra = (panelClass ?? "").split(/\s+/).filter(Boolean);
|
|
345
|
+
return [
|
|
346
|
+
PANE_CLASS,
|
|
347
|
+
...this.policy?.paneClass ? [this.policy.paneClass] : [],
|
|
348
|
+
...extra
|
|
349
|
+
];
|
|
350
|
+
}
|
|
351
|
+
applyPanelClass(panelClass) {
|
|
352
|
+
const dialogRef = this.dialogRef;
|
|
353
|
+
if (!dialogRef) return;
|
|
354
|
+
const next = this.paneClasses(panelClass);
|
|
355
|
+
if (next.length === this.appliedPaneClasses.length && next.every((value, index) => value === this.appliedPaneClasses[index])) return;
|
|
356
|
+
this.removePaneClasses(this.appliedPaneClasses);
|
|
357
|
+
dialogRef.addPanelClass(next);
|
|
358
|
+
this.appliedPaneClasses = next;
|
|
359
|
+
}
|
|
360
|
+
removePaneClasses(classes) {
|
|
361
|
+
const dialogRef = this.dialogRef;
|
|
362
|
+
if (!dialogRef) return;
|
|
363
|
+
dialogRef.removePanelClass(classes);
|
|
364
|
+
}
|
|
365
|
+
applyDirection() {
|
|
366
|
+
const dir = this.host.direction();
|
|
367
|
+
this.state.panelDir.set(dir);
|
|
368
|
+
this.dialogRef?.overlayRef.setDirection(dir);
|
|
369
|
+
}
|
|
370
|
+
releaseInputSubscriptions() {
|
|
371
|
+
this.backdropSubscription?.unsubscribe();
|
|
372
|
+
this.backdropSubscription = void 0;
|
|
373
|
+
this.keydownSubscription?.unsubscribe();
|
|
374
|
+
this.keydownSubscription = void 0;
|
|
375
|
+
}
|
|
376
|
+
releaseClosedSubscription() {
|
|
377
|
+
this.closedSubscription?.unsubscribe();
|
|
378
|
+
this.closedSubscription = void 0;
|
|
379
|
+
}
|
|
380
|
+
releaseSubscriptions() {
|
|
381
|
+
this.releaseInputSubscriptions();
|
|
382
|
+
this.releaseClosedSubscription();
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
let nextDialogId = 0;
|
|
386
|
+
var RaqmDialogRegistration = class {
|
|
387
|
+
renderer;
|
|
388
|
+
host;
|
|
389
|
+
triggerRef = signal(null, ...ngDevMode ? [{ debugName: "triggerRef" }] : /* istanbul ignore next */ []);
|
|
390
|
+
contentTemplate = signal(null, ...ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []);
|
|
391
|
+
titleElement = signal(null, ...ngDevMode ? [{ debugName: "titleElement" }] : /* istanbul ignore next */ []);
|
|
392
|
+
descriptionElement = signal(null, ...ngDevMode ? [{ debugName: "descriptionElement" }] : /* istanbul ignore next */ []);
|
|
393
|
+
rootId = ++nextDialogId;
|
|
394
|
+
dialogRootId = `raqm-dialog-${this.rootId}`;
|
|
395
|
+
titleRootId = `raqm-dialog-title-${this.rootId}`;
|
|
396
|
+
descriptionRootId = `raqm-dialog-description-${this.rootId}`;
|
|
397
|
+
constructor(renderer, host) {
|
|
398
|
+
this.renderer = renderer;
|
|
399
|
+
this.host = host;
|
|
400
|
+
}
|
|
401
|
+
get hasTitle() {
|
|
402
|
+
return this.titleElement() !== null;
|
|
403
|
+
}
|
|
404
|
+
registerTrigger(ref) {
|
|
405
|
+
const current = this.triggerRef();
|
|
406
|
+
if (current !== null && current !== ref) {
|
|
407
|
+
if (isDevMode()) console.error("[raqm-dialog] Only one `button[raqm-dialog-trigger]` is supported per <raqm-dialog>; the extra trigger is ignored.");
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
this.triggerRef.set(ref);
|
|
411
|
+
}
|
|
412
|
+
unregisterTrigger(ref) {
|
|
413
|
+
if (this.triggerRef() === ref) this.triggerRef.set(null);
|
|
414
|
+
}
|
|
415
|
+
registerContent(template) {
|
|
416
|
+
const current = this.contentTemplate();
|
|
417
|
+
if (current !== null && current !== template) {
|
|
418
|
+
if (isDevMode()) console.error("[raqm-dialog] Only one `ng-template[raqm-dialog-content]` is supported per <raqm-dialog>; the extra template is ignored.");
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
this.contentTemplate.set(template);
|
|
422
|
+
}
|
|
423
|
+
unregisterContent(template) {
|
|
424
|
+
if (this.contentTemplate() === template) this.contentTemplate.set(null);
|
|
425
|
+
}
|
|
426
|
+
registerTitle(element) {
|
|
427
|
+
if (isDevMode() && this.titleElement() !== null && this.titleElement() !== element) console.error("[raqm-dialog] Only one `[raqm-dialog-title]` is expected per <raqm-dialog>; the latest registration wins.");
|
|
428
|
+
if (!element.id) element.id = this.titleRootId;
|
|
429
|
+
this.titleElement.set(element);
|
|
430
|
+
this.syncContainerAria();
|
|
431
|
+
}
|
|
432
|
+
unregisterTitle(element) {
|
|
433
|
+
if (this.titleElement() === element) {
|
|
434
|
+
this.titleElement.set(null);
|
|
435
|
+
this.syncContainerAria();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
registerDescription(element) {
|
|
439
|
+
if (isDevMode() && this.descriptionElement() !== null && this.descriptionElement() !== element) console.error("[raqm-dialog] Only one `[raqm-dialog-description]` is expected per <raqm-dialog>; the latest registration wins.");
|
|
440
|
+
if (!element.id) element.id = this.descriptionRootId;
|
|
441
|
+
this.descriptionElement.set(element);
|
|
442
|
+
this.syncContainerAria();
|
|
443
|
+
}
|
|
444
|
+
unregisterDescription(element) {
|
|
445
|
+
if (this.descriptionElement() === element) {
|
|
446
|
+
this.descriptionElement.set(null);
|
|
447
|
+
this.syncContainerAria();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
syncContainerAria() {
|
|
451
|
+
const pane = this.host.pane();
|
|
452
|
+
if (!pane) return;
|
|
453
|
+
const container = pane.querySelector(`.${CONTAINER_CLASS}`);
|
|
454
|
+
if (!container) return;
|
|
455
|
+
const title = this.titleElement();
|
|
456
|
+
const label = this.host.label();
|
|
457
|
+
if (title) {
|
|
458
|
+
this.renderer.setAttribute(container, "aria-labelledby", title.id);
|
|
459
|
+
this.renderer.removeAttribute(container, "aria-label");
|
|
460
|
+
} else {
|
|
461
|
+
this.renderer.removeAttribute(container, "aria-labelledby");
|
|
462
|
+
if (label) this.renderer.setAttribute(container, "aria-label", label);
|
|
463
|
+
else this.renderer.removeAttribute(container, "aria-label");
|
|
464
|
+
}
|
|
465
|
+
const description = this.descriptionElement();
|
|
466
|
+
if (description) this.renderer.setAttribute(container, "aria-describedby", description.id);
|
|
467
|
+
else this.renderer.removeAttribute(container, "aria-describedby");
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
var RaqmDialogState = class {
|
|
471
|
+
attached = signal(false, ...ngDevMode ? [{ debugName: "attached" }] : /* istanbul ignore next */ []);
|
|
472
|
+
dialogId = signal(null, ...ngDevMode ? [{ debugName: "dialogId" }] : /* istanbul ignore next */ []);
|
|
473
|
+
entering = signal(false, ...ngDevMode ? [{ debugName: "entering" }] : /* istanbul ignore next */ []);
|
|
474
|
+
closing = signal(false, ...ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []);
|
|
475
|
+
panelDir = signal("ltr", ...ngDevMode ? [{ debugName: "panelDir" }] : /* istanbul ignore next */ []);
|
|
476
|
+
triggerlessOrigin = null;
|
|
477
|
+
currentOpen = false;
|
|
478
|
+
openGeneration = 0;
|
|
479
|
+
destroyed = false;
|
|
480
|
+
suppressFocusRestore = false;
|
|
481
|
+
lastCloseOrigin;
|
|
482
|
+
};
|
|
483
|
+
var RaqmDialogBaseComponent = class RaqmDialogBaseComponent {
|
|
484
|
+
policy = inject(RAQM_DIALOG_POLICY, {
|
|
485
|
+
optional: true,
|
|
486
|
+
self: true
|
|
487
|
+
});
|
|
488
|
+
host = inject(ElementRef);
|
|
489
|
+
dialogService = inject(Dialog);
|
|
490
|
+
directionality = inject(Directionality, { optional: true });
|
|
491
|
+
renderer = inject(Renderer2);
|
|
492
|
+
focusMonitor = inject(FocusMonitor);
|
|
493
|
+
checker = inject(InteractivityChecker);
|
|
494
|
+
injector = inject(Injector);
|
|
495
|
+
scrollLock = inject(RAQM_DIALOG_SCROLL_LOCK);
|
|
496
|
+
panelTemplate = viewChild("panel", {
|
|
497
|
+
...ngDevMode ? { debugName: "panelTemplate" } : /* istanbul ignore next */ {},
|
|
498
|
+
read: TemplateRef
|
|
499
|
+
});
|
|
500
|
+
openValue = model(false, {
|
|
501
|
+
...ngDevMode ? { debugName: "openValue" } : /* istanbul ignore next */ {},
|
|
502
|
+
alias: "open"
|
|
503
|
+
});
|
|
504
|
+
disabled = input(false, {
|
|
505
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
506
|
+
transform: booleanAttribute
|
|
507
|
+
});
|
|
508
|
+
dir = input(void 0, {
|
|
509
|
+
...ngDevMode ? { debugName: "dir" } : /* istanbul ignore next */ {},
|
|
510
|
+
transform: toDir
|
|
511
|
+
});
|
|
512
|
+
panelClass = input(void 0, ...ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []);
|
|
513
|
+
label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
514
|
+
state = new RaqmDialogState();
|
|
515
|
+
registration = new RaqmDialogRegistration(this.renderer, {
|
|
516
|
+
label: () => this.label(),
|
|
517
|
+
pane: () => this.overlay.element
|
|
518
|
+
});
|
|
519
|
+
canOpen = computed(() => (this.registration.triggerRef() !== null || this.policy?.allowWithoutTrigger === true) && this.registration.contentTemplate() !== null && this.panelTemplate() !== void 0, ...ngDevMode ? [{ debugName: "canOpen" }] : /* istanbul ignore next */ []);
|
|
520
|
+
open = computed(() => this.openValue() && !this.disabled() && this.state.attached(), ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
521
|
+
dialogId = this.state.dialogId;
|
|
522
|
+
entering = this.state.entering;
|
|
523
|
+
closing = this.state.closing;
|
|
524
|
+
panelDir = this.state.panelDir;
|
|
525
|
+
contentTemplate = this.registration.contentTemplate;
|
|
526
|
+
overlay = new RaqmDialogOverlay(this.dialogService, this.scrollLock, this.injector, this.state, this.policy, {
|
|
527
|
+
root: this.host.nativeElement,
|
|
528
|
+
dialogRootId: this.registration.dialogRootId,
|
|
529
|
+
trigger: () => this.registration.triggerRef(),
|
|
530
|
+
contentTemplate: () => this.registration.contentTemplate(),
|
|
531
|
+
panelTemplate: () => this.panelTemplate(),
|
|
532
|
+
panelClass: () => this.panelClass(),
|
|
533
|
+
openValue: () => this.openValue(),
|
|
534
|
+
setOpenValue: (value) => this.openValue.set(value),
|
|
535
|
+
direction: () => this.readResolvedDir(),
|
|
536
|
+
syncContainerAria: () => this.registration.syncContainerAria(),
|
|
537
|
+
focusInitial: () => this.focus.focusInitial(),
|
|
538
|
+
validateAccessibleName: () => this.focus.validateAccessibleName(),
|
|
539
|
+
maybeRestoreOriginFocus: () => this.focus.maybeRestoreOriginFocus()
|
|
540
|
+
});
|
|
541
|
+
focus = new RaqmDialogFocus(this.dialogService, this.focusMonitor, this.checker, this.state, {
|
|
542
|
+
pane: () => this.overlay.element,
|
|
543
|
+
trigger: () => this.registration.triggerRef(),
|
|
544
|
+
hasTitle: () => this.registration.hasTitle,
|
|
545
|
+
label: () => this.label(),
|
|
546
|
+
touchOpening: () => this.policy?.touchOpening()
|
|
547
|
+
});
|
|
548
|
+
constructor() {
|
|
549
|
+
connectDialogEffects({
|
|
550
|
+
openValue: () => this.openValue(),
|
|
551
|
+
disabled: () => this.disabled(),
|
|
552
|
+
canOpen: () => this.canOpen(),
|
|
553
|
+
panelClass: () => this.panelClass(),
|
|
554
|
+
label: () => this.label(),
|
|
555
|
+
dir: () => this.dir(),
|
|
556
|
+
closeButtonVisible: () => this.closeButtonVisible(),
|
|
557
|
+
closeLabelText: () => this.closeLabelText(),
|
|
558
|
+
syncOpen: (next) => this.overlay.syncOpen(next),
|
|
559
|
+
applyPanelClass: (panelClass) => this.overlay.applyPanelClass(panelClass),
|
|
560
|
+
syncContainerAria: () => this.registration.syncContainerAria(),
|
|
561
|
+
applyDirection: () => this.overlay.applyDirection()
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
ngOnDestroy() {
|
|
565
|
+
this.overlay.destroy();
|
|
566
|
+
}
|
|
567
|
+
registerTrigger(ref) {
|
|
568
|
+
this.registration.registerTrigger(ref);
|
|
569
|
+
}
|
|
570
|
+
unregisterTrigger(ref) {
|
|
571
|
+
this.registration.unregisterTrigger(ref);
|
|
572
|
+
}
|
|
573
|
+
registerContent(template) {
|
|
574
|
+
this.registration.registerContent(template);
|
|
575
|
+
}
|
|
576
|
+
unregisterContent(template) {
|
|
577
|
+
this.registration.unregisterContent(template);
|
|
578
|
+
}
|
|
579
|
+
registerTitle(element) {
|
|
580
|
+
this.registration.registerTitle(element);
|
|
581
|
+
}
|
|
582
|
+
unregisterTitle(element) {
|
|
583
|
+
this.registration.unregisterTitle(element);
|
|
584
|
+
}
|
|
585
|
+
registerDescription(element) {
|
|
586
|
+
this.registration.registerDescription(element);
|
|
587
|
+
}
|
|
588
|
+
unregisterDescription(element) {
|
|
589
|
+
this.registration.unregisterDescription(element);
|
|
590
|
+
}
|
|
591
|
+
toggleFromTrigger(ref) {
|
|
592
|
+
if (ref !== this.registration.triggerRef() || this.disabled() || ref.disabled) return;
|
|
593
|
+
if (this.open()) {
|
|
594
|
+
this.closeFromUser();
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
this.openValue.set(true);
|
|
598
|
+
}
|
|
599
|
+
closeFromUser() {
|
|
600
|
+
this.overlay.requestClose();
|
|
601
|
+
}
|
|
602
|
+
onCloseButtonClick() {
|
|
603
|
+
this.overlay.requestClose("mouse");
|
|
604
|
+
}
|
|
605
|
+
readResolvedDir() {
|
|
606
|
+
return resolveDialogDirection(this.dir(), this.host.nativeElement, this.directionality);
|
|
607
|
+
}
|
|
608
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
609
|
+
minVersion: "12.0.0",
|
|
610
|
+
version: "22.2.2",
|
|
611
|
+
ngImport: i0,
|
|
612
|
+
type: RaqmDialogBaseComponent,
|
|
613
|
+
deps: [],
|
|
614
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
615
|
+
});
|
|
616
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
617
|
+
minVersion: "17.0.0",
|
|
618
|
+
version: "22.2.2",
|
|
619
|
+
type: RaqmDialogBaseComponent,
|
|
620
|
+
isStandalone: true,
|
|
621
|
+
selector: "raqm-dialog-base",
|
|
622
|
+
inputs: {
|
|
623
|
+
openValue: {
|
|
624
|
+
classPropertyName: "openValue",
|
|
625
|
+
publicName: "open",
|
|
626
|
+
isSignal: true,
|
|
627
|
+
isRequired: false,
|
|
628
|
+
transformFunction: null
|
|
629
|
+
},
|
|
630
|
+
disabled: {
|
|
631
|
+
classPropertyName: "disabled",
|
|
632
|
+
publicName: "disabled",
|
|
633
|
+
isSignal: true,
|
|
634
|
+
isRequired: false,
|
|
635
|
+
transformFunction: null
|
|
636
|
+
},
|
|
637
|
+
dir: {
|
|
638
|
+
classPropertyName: "dir",
|
|
639
|
+
publicName: "dir",
|
|
640
|
+
isSignal: true,
|
|
641
|
+
isRequired: false,
|
|
642
|
+
transformFunction: null
|
|
643
|
+
},
|
|
644
|
+
panelClass: {
|
|
645
|
+
classPropertyName: "panelClass",
|
|
646
|
+
publicName: "panelClass",
|
|
647
|
+
isSignal: true,
|
|
648
|
+
isRequired: false,
|
|
649
|
+
transformFunction: null
|
|
650
|
+
},
|
|
651
|
+
label: {
|
|
652
|
+
classPropertyName: "label",
|
|
653
|
+
publicName: "label",
|
|
654
|
+
isSignal: true,
|
|
655
|
+
isRequired: false,
|
|
656
|
+
transformFunction: null
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
outputs: { openValue: "openChange" },
|
|
660
|
+
viewQueries: [{
|
|
661
|
+
propertyName: "panelTemplate",
|
|
662
|
+
first: true,
|
|
663
|
+
predicate: ["panel"],
|
|
664
|
+
descendants: true,
|
|
665
|
+
read: TemplateRef,
|
|
666
|
+
isSignal: true
|
|
667
|
+
}],
|
|
668
|
+
ngImport: i0,
|
|
669
|
+
template: "<ng-content />\r\n\r\n<!-- The CDK container, not this wrapper, is the role=dialog element. -->\r\n<ng-template #panel>\r\n <div\r\n class=\"raqm-dialog-content\"\r\n [class]=\"policy?.contentClass ?? ''\"\r\n [attr.data-raqm-small]=\"policy?.small?.() ? '' : null\"\r\n [attr.data-raqm-side]=\"policy?.side?.() ?? null\"\r\n [attr.dir]=\"panelDir()\"\r\n [class.raqm-dialog-content--entering]=\"entering()\"\r\n [class.raqm-dialog-content--closing]=\"closing()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\" />\r\n\r\n <!-- showCloseButton=false hides only this control; Escape and backdrop dismissal still close. -->\r\n @if (closeButtonVisible()) {\r\n <button\r\n raqm-button=\"ghost\"\r\n icon-small\r\n class=\"raqm-dialog-close\"\r\n [attr.aria-label]=\"closeLabelText()\"\r\n (click)=\"onCloseButtonClick()\"\r\n >\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"M18 6 6 18\" />\r\n <path d=\"m6 6 12 12\" />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n</ng-template>\r\n",
|
|
670
|
+
styles: [":host{display:contents}.raqm-dialog-content{position:relative;display:grid;gap:calc(var(--raqm-spacing) * 6);box-sizing:border-box;inline-size:calc(100vw - 2rem);inline-size:calc(100dvw - 2rem);max-inline-size:100%;max-block-size:calc(100vh - 2rem);max-block-size:calc(100dvh - 2rem);overflow:auto;padding:calc(var(--raqm-spacing) * 6);border-radius:var(--raqm-radius-xl);background-color:var(--raqm-popover);color:var(--raqm-popover-foreground);font-size:var(--raqm-font-size-sm);line-height:1.25rem;box-shadow:0 0 0 1px color-mix(in oklch,var(--raqm-foreground) 10%,transparent);outline:none}@media(min-width:40rem){.raqm-dialog-content{inline-size:24rem}}.raqm-dialog-content--entering{animation:raqm-dialog-in var(--raqm-duration-fast) var(--raqm-ease-out)}@keyframes raqm-dialog-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}.raqm-dialog-content--closing{opacity:0;transform:scale(.95);transition:opacity var(--raqm-duration-fast) var(--raqm-ease-out),transform var(--raqm-duration-fast) var(--raqm-ease-out)}@media(prefers-reduced-motion:reduce){.raqm-dialog-content,.raqm-dialog-content--closing{animation:none;transition:none}}.raqm-dialog-close{position:absolute;inset-block-start:calc(var(--raqm-spacing) * 4.5);inset-inline-end:calc(var(--raqm-spacing) * 4.5)}@media(forced-colors:active){.raqm-dialog-close{border-color:ButtonText}.raqm-dialog-content{border:1px solid CanvasText}}\n"],
|
|
671
|
+
dependencies: [{
|
|
672
|
+
kind: "directive",
|
|
673
|
+
type: NgTemplateOutlet,
|
|
674
|
+
selector: "[ngTemplateOutlet]",
|
|
675
|
+
inputs: [
|
|
676
|
+
"ngTemplateOutletContext",
|
|
677
|
+
"ngTemplateOutlet",
|
|
678
|
+
"ngTemplateOutletInjector"
|
|
679
|
+
]
|
|
680
|
+
}, {
|
|
681
|
+
kind: "component",
|
|
682
|
+
type: RaqmButton,
|
|
683
|
+
selector: "button[raqm-button], a[raqm-button]",
|
|
684
|
+
inputs: [
|
|
685
|
+
"raqm-button",
|
|
686
|
+
"extra-small",
|
|
687
|
+
"small",
|
|
688
|
+
"large",
|
|
689
|
+
"icon",
|
|
690
|
+
"icon-extra-small",
|
|
691
|
+
"icon-small",
|
|
692
|
+
"icon-large",
|
|
693
|
+
"disabled",
|
|
694
|
+
"tabindex"
|
|
695
|
+
]
|
|
696
|
+
}],
|
|
697
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
701
|
+
minVersion: "12.0.0",
|
|
702
|
+
version: "22.2.2",
|
|
703
|
+
ngImport: i0,
|
|
704
|
+
type: RaqmDialogBaseComponent,
|
|
705
|
+
decorators: [{
|
|
706
|
+
type: Component,
|
|
707
|
+
args: [{
|
|
708
|
+
selector: "raqm-dialog-base",
|
|
709
|
+
imports: [NgTemplateOutlet, RaqmButton],
|
|
710
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
711
|
+
template: "<ng-content />\r\n\r\n<!-- The CDK container, not this wrapper, is the role=dialog element. -->\r\n<ng-template #panel>\r\n <div\r\n class=\"raqm-dialog-content\"\r\n [class]=\"policy?.contentClass ?? ''\"\r\n [attr.data-raqm-small]=\"policy?.small?.() ? '' : null\"\r\n [attr.data-raqm-side]=\"policy?.side?.() ?? null\"\r\n [attr.dir]=\"panelDir()\"\r\n [class.raqm-dialog-content--entering]=\"entering()\"\r\n [class.raqm-dialog-content--closing]=\"closing()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\" />\r\n\r\n <!-- showCloseButton=false hides only this control; Escape and backdrop dismissal still close. -->\r\n @if (closeButtonVisible()) {\r\n <button\r\n raqm-button=\"ghost\"\r\n icon-small\r\n class=\"raqm-dialog-close\"\r\n [attr.aria-label]=\"closeLabelText()\"\r\n (click)=\"onCloseButtonClick()\"\r\n >\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"M18 6 6 18\" />\r\n <path d=\"m6 6 12 12\" />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n</ng-template>\r\n",
|
|
712
|
+
styles: [":host{display:contents}.raqm-dialog-content{position:relative;display:grid;gap:calc(var(--raqm-spacing) * 6);box-sizing:border-box;inline-size:calc(100vw - 2rem);inline-size:calc(100dvw - 2rem);max-inline-size:100%;max-block-size:calc(100vh - 2rem);max-block-size:calc(100dvh - 2rem);overflow:auto;padding:calc(var(--raqm-spacing) * 6);border-radius:var(--raqm-radius-xl);background-color:var(--raqm-popover);color:var(--raqm-popover-foreground);font-size:var(--raqm-font-size-sm);line-height:1.25rem;box-shadow:0 0 0 1px color-mix(in oklch,var(--raqm-foreground) 10%,transparent);outline:none}@media(min-width:40rem){.raqm-dialog-content{inline-size:24rem}}.raqm-dialog-content--entering{animation:raqm-dialog-in var(--raqm-duration-fast) var(--raqm-ease-out)}@keyframes raqm-dialog-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}.raqm-dialog-content--closing{opacity:0;transform:scale(.95);transition:opacity var(--raqm-duration-fast) var(--raqm-ease-out),transform var(--raqm-duration-fast) var(--raqm-ease-out)}@media(prefers-reduced-motion:reduce){.raqm-dialog-content,.raqm-dialog-content--closing{animation:none;transition:none}}.raqm-dialog-close{position:absolute;inset-block-start:calc(var(--raqm-spacing) * 4.5);inset-inline-end:calc(var(--raqm-spacing) * 4.5)}@media(forced-colors:active){.raqm-dialog-close{border-color:ButtonText}.raqm-dialog-content{border:1px solid CanvasText}}\n"]
|
|
713
|
+
}]
|
|
714
|
+
}],
|
|
715
|
+
ctorParameters: () => [],
|
|
716
|
+
propDecorators: {
|
|
717
|
+
panelTemplate: [{
|
|
718
|
+
type: i0.ViewChild,
|
|
719
|
+
args: ["panel", {
|
|
720
|
+
read: TemplateRef,
|
|
721
|
+
isSignal: true
|
|
722
|
+
}]
|
|
723
|
+
}],
|
|
724
|
+
openValue: [{
|
|
725
|
+
type: i0.Input,
|
|
726
|
+
args: [{
|
|
727
|
+
isSignal: true,
|
|
728
|
+
alias: "open",
|
|
729
|
+
required: false
|
|
730
|
+
}]
|
|
731
|
+
}, {
|
|
732
|
+
type: i0.Output,
|
|
733
|
+
args: ["openChange"]
|
|
734
|
+
}],
|
|
735
|
+
disabled: [{
|
|
736
|
+
type: i0.Input,
|
|
737
|
+
args: [{
|
|
738
|
+
isSignal: true,
|
|
739
|
+
alias: "disabled",
|
|
740
|
+
required: false
|
|
741
|
+
}]
|
|
742
|
+
}],
|
|
743
|
+
dir: [{
|
|
744
|
+
type: i0.Input,
|
|
745
|
+
args: [{
|
|
746
|
+
isSignal: true,
|
|
747
|
+
alias: "dir",
|
|
748
|
+
required: false
|
|
749
|
+
}]
|
|
750
|
+
}],
|
|
751
|
+
panelClass: [{
|
|
752
|
+
type: i0.Input,
|
|
753
|
+
args: [{
|
|
754
|
+
isSignal: true,
|
|
755
|
+
alias: "panelClass",
|
|
756
|
+
required: false
|
|
757
|
+
}]
|
|
758
|
+
}],
|
|
759
|
+
label: [{
|
|
760
|
+
type: i0.Input,
|
|
761
|
+
args: [{
|
|
762
|
+
isSignal: true,
|
|
763
|
+
alias: "label",
|
|
764
|
+
required: false
|
|
765
|
+
}]
|
|
766
|
+
}]
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
var RaqmDialogComponent = class RaqmDialogComponent extends RaqmDialogBaseComponent {
|
|
770
|
+
showCloseButton = input(true, {
|
|
771
|
+
...ngDevMode ? { debugName: "showCloseButton" } : /* istanbul ignore next */ {},
|
|
772
|
+
transform: booleanAttribute
|
|
773
|
+
});
|
|
774
|
+
closeLabel = input(void 0, ...ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []);
|
|
775
|
+
closeButtonVisible = this.showCloseButton;
|
|
776
|
+
closeLabelText = this.closeLabel;
|
|
777
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
778
|
+
minVersion: "12.0.0",
|
|
779
|
+
version: "22.2.2",
|
|
780
|
+
ngImport: i0,
|
|
781
|
+
type: RaqmDialogComponent,
|
|
782
|
+
deps: null,
|
|
783
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
784
|
+
});
|
|
785
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
786
|
+
minVersion: "17.0.0",
|
|
787
|
+
version: "22.2.2",
|
|
788
|
+
type: RaqmDialogComponent,
|
|
789
|
+
isStandalone: true,
|
|
790
|
+
selector: "raqm-dialog",
|
|
791
|
+
inputs: {
|
|
792
|
+
showCloseButton: {
|
|
793
|
+
classPropertyName: "showCloseButton",
|
|
794
|
+
publicName: "showCloseButton",
|
|
795
|
+
isSignal: true,
|
|
796
|
+
isRequired: false,
|
|
797
|
+
transformFunction: null
|
|
798
|
+
},
|
|
799
|
+
closeLabel: {
|
|
800
|
+
classPropertyName: "closeLabel",
|
|
801
|
+
publicName: "closeLabel",
|
|
802
|
+
isSignal: true,
|
|
803
|
+
isRequired: false,
|
|
804
|
+
transformFunction: null
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
providers: [{
|
|
808
|
+
provide: RAQM_DIALOG,
|
|
809
|
+
useExisting: RaqmDialogComponent
|
|
810
|
+
}],
|
|
811
|
+
exportAs: ["raqmDialog"],
|
|
812
|
+
usesInheritance: true,
|
|
813
|
+
ngImport: i0,
|
|
814
|
+
template: "<ng-content />\r\n\r\n<!-- The CDK container, not this wrapper, is the role=dialog element. -->\r\n<ng-template #panel>\r\n <div\r\n class=\"raqm-dialog-content\"\r\n [class]=\"policy?.contentClass ?? ''\"\r\n [attr.data-raqm-small]=\"policy?.small?.() ? '' : null\"\r\n [attr.data-raqm-side]=\"policy?.side?.() ?? null\"\r\n [attr.dir]=\"panelDir()\"\r\n [class.raqm-dialog-content--entering]=\"entering()\"\r\n [class.raqm-dialog-content--closing]=\"closing()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\" />\r\n\r\n <!-- showCloseButton=false hides only this control; Escape and backdrop dismissal still close. -->\r\n @if (closeButtonVisible()) {\r\n <button\r\n raqm-button=\"ghost\"\r\n icon-small\r\n class=\"raqm-dialog-close\"\r\n [attr.aria-label]=\"closeLabelText()\"\r\n (click)=\"onCloseButtonClick()\"\r\n >\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"M18 6 6 18\" />\r\n <path d=\"m6 6 12 12\" />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n</ng-template>\r\n",
|
|
815
|
+
styles: [":host{display:contents}.raqm-dialog-content{position:relative;display:grid;gap:calc(var(--raqm-spacing) * 6);box-sizing:border-box;inline-size:calc(100vw - 2rem);inline-size:calc(100dvw - 2rem);max-inline-size:100%;max-block-size:calc(100vh - 2rem);max-block-size:calc(100dvh - 2rem);overflow:auto;padding:calc(var(--raqm-spacing) * 6);border-radius:var(--raqm-radius-xl);background-color:var(--raqm-popover);color:var(--raqm-popover-foreground);font-size:var(--raqm-font-size-sm);line-height:1.25rem;box-shadow:0 0 0 1px color-mix(in oklch,var(--raqm-foreground) 10%,transparent);outline:none}@media(min-width:40rem){.raqm-dialog-content{inline-size:24rem}}.raqm-dialog-content--entering{animation:raqm-dialog-in var(--raqm-duration-fast) var(--raqm-ease-out)}@keyframes raqm-dialog-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}.raqm-dialog-content--closing{opacity:0;transform:scale(.95);transition:opacity var(--raqm-duration-fast) var(--raqm-ease-out),transform var(--raqm-duration-fast) var(--raqm-ease-out)}@media(prefers-reduced-motion:reduce){.raqm-dialog-content,.raqm-dialog-content--closing{animation:none;transition:none}}.raqm-dialog-close{position:absolute;inset-block-start:calc(var(--raqm-spacing) * 4.5);inset-inline-end:calc(var(--raqm-spacing) * 4.5)}@media(forced-colors:active){.raqm-dialog-close{border-color:ButtonText}.raqm-dialog-content{border:1px solid CanvasText}}\n"],
|
|
816
|
+
dependencies: [{
|
|
817
|
+
kind: "directive",
|
|
818
|
+
type: NgTemplateOutlet,
|
|
819
|
+
selector: "[ngTemplateOutlet]",
|
|
820
|
+
inputs: [
|
|
821
|
+
"ngTemplateOutletContext",
|
|
822
|
+
"ngTemplateOutlet",
|
|
823
|
+
"ngTemplateOutletInjector"
|
|
824
|
+
]
|
|
825
|
+
}, {
|
|
826
|
+
kind: "component",
|
|
827
|
+
type: RaqmButton,
|
|
828
|
+
selector: "button[raqm-button], a[raqm-button]",
|
|
829
|
+
inputs: [
|
|
830
|
+
"raqm-button",
|
|
831
|
+
"extra-small",
|
|
832
|
+
"small",
|
|
833
|
+
"large",
|
|
834
|
+
"icon",
|
|
835
|
+
"icon-extra-small",
|
|
836
|
+
"icon-small",
|
|
837
|
+
"icon-large",
|
|
838
|
+
"disabled",
|
|
839
|
+
"tabindex"
|
|
840
|
+
]
|
|
841
|
+
}],
|
|
842
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
843
|
+
});
|
|
844
|
+
};
|
|
845
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
846
|
+
minVersion: "12.0.0",
|
|
847
|
+
version: "22.2.2",
|
|
848
|
+
ngImport: i0,
|
|
849
|
+
type: RaqmDialogComponent,
|
|
850
|
+
decorators: [{
|
|
851
|
+
type: Component,
|
|
852
|
+
args: [{
|
|
853
|
+
selector: "raqm-dialog",
|
|
854
|
+
imports: [NgTemplateOutlet, RaqmButton],
|
|
855
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
856
|
+
exportAs: "raqmDialog",
|
|
857
|
+
providers: [{
|
|
858
|
+
provide: RAQM_DIALOG,
|
|
859
|
+
useExisting: RaqmDialogComponent
|
|
860
|
+
}],
|
|
861
|
+
template: "<ng-content />\r\n\r\n<!-- The CDK container, not this wrapper, is the role=dialog element. -->\r\n<ng-template #panel>\r\n <div\r\n class=\"raqm-dialog-content\"\r\n [class]=\"policy?.contentClass ?? ''\"\r\n [attr.data-raqm-small]=\"policy?.small?.() ? '' : null\"\r\n [attr.data-raqm-side]=\"policy?.side?.() ?? null\"\r\n [attr.dir]=\"panelDir()\"\r\n [class.raqm-dialog-content--entering]=\"entering()\"\r\n [class.raqm-dialog-content--closing]=\"closing()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\" />\r\n\r\n <!-- showCloseButton=false hides only this control; Escape and backdrop dismissal still close. -->\r\n @if (closeButtonVisible()) {\r\n <button\r\n raqm-button=\"ghost\"\r\n icon-small\r\n class=\"raqm-dialog-close\"\r\n [attr.aria-label]=\"closeLabelText()\"\r\n (click)=\"onCloseButtonClick()\"\r\n >\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"M18 6 6 18\" />\r\n <path d=\"m6 6 12 12\" />\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n</ng-template>\r\n",
|
|
862
|
+
styles: [":host{display:contents}.raqm-dialog-content{position:relative;display:grid;gap:calc(var(--raqm-spacing) * 6);box-sizing:border-box;inline-size:calc(100vw - 2rem);inline-size:calc(100dvw - 2rem);max-inline-size:100%;max-block-size:calc(100vh - 2rem);max-block-size:calc(100dvh - 2rem);overflow:auto;padding:calc(var(--raqm-spacing) * 6);border-radius:var(--raqm-radius-xl);background-color:var(--raqm-popover);color:var(--raqm-popover-foreground);font-size:var(--raqm-font-size-sm);line-height:1.25rem;box-shadow:0 0 0 1px color-mix(in oklch,var(--raqm-foreground) 10%,transparent);outline:none}@media(min-width:40rem){.raqm-dialog-content{inline-size:24rem}}.raqm-dialog-content--entering{animation:raqm-dialog-in var(--raqm-duration-fast) var(--raqm-ease-out)}@keyframes raqm-dialog-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}.raqm-dialog-content--closing{opacity:0;transform:scale(.95);transition:opacity var(--raqm-duration-fast) var(--raqm-ease-out),transform var(--raqm-duration-fast) var(--raqm-ease-out)}@media(prefers-reduced-motion:reduce){.raqm-dialog-content,.raqm-dialog-content--closing{animation:none;transition:none}}.raqm-dialog-close{position:absolute;inset-block-start:calc(var(--raqm-spacing) * 4.5);inset-inline-end:calc(var(--raqm-spacing) * 4.5)}@media(forced-colors:active){.raqm-dialog-close{border-color:ButtonText}.raqm-dialog-content{border:1px solid CanvasText}}\n"]
|
|
863
|
+
}]
|
|
864
|
+
}],
|
|
865
|
+
propDecorators: {
|
|
866
|
+
showCloseButton: [{
|
|
867
|
+
type: i0.Input,
|
|
868
|
+
args: [{
|
|
869
|
+
isSignal: true,
|
|
870
|
+
alias: "showCloseButton",
|
|
871
|
+
required: false
|
|
872
|
+
}]
|
|
873
|
+
}],
|
|
874
|
+
closeLabel: [{
|
|
875
|
+
type: i0.Input,
|
|
876
|
+
args: [{
|
|
877
|
+
isSignal: true,
|
|
878
|
+
alias: "closeLabel",
|
|
879
|
+
required: false
|
|
880
|
+
}]
|
|
881
|
+
}]
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
var RaqmDialogTriggerDirective = class RaqmDialogTriggerDirective {
|
|
885
|
+
host = inject(ElementRef);
|
|
886
|
+
dialog = inject(RAQM_DIALOG, { optional: true });
|
|
887
|
+
destroyRef = inject(DestroyRef);
|
|
888
|
+
open = computed(() => this.dialog?.open() ?? false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
889
|
+
dialogId = computed(() => this.dialog?.dialogId() ?? null, ...ngDevMode ? [{ debugName: "dialogId" }] : /* istanbul ignore next */ []);
|
|
890
|
+
ref = (() => {
|
|
891
|
+
const self = this;
|
|
892
|
+
return {
|
|
893
|
+
get element() {
|
|
894
|
+
return self.host.nativeElement;
|
|
895
|
+
},
|
|
896
|
+
get disabled() {
|
|
897
|
+
return self.host.nativeElement.disabled;
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
})();
|
|
901
|
+
constructor() {
|
|
902
|
+
const element = this.host.nativeElement;
|
|
903
|
+
if (!element.hasAttribute("type")) element.setAttribute("type", "button");
|
|
904
|
+
if (isDevMode() && this.dialog === null) console.error("[raqm-dialog-trigger] No parent <raqm-dialog> found; the trigger cannot open a dialog.");
|
|
905
|
+
this.destroyRef.onDestroy(() => this.dialog?.unregisterTrigger(this.ref));
|
|
906
|
+
}
|
|
907
|
+
ngOnInit() {
|
|
908
|
+
this.dialog?.registerTrigger(this.ref);
|
|
909
|
+
}
|
|
910
|
+
onClick() {
|
|
911
|
+
if (this.host.nativeElement.disabled) return;
|
|
912
|
+
this.dialog?.toggleFromTrigger(this.ref);
|
|
913
|
+
}
|
|
914
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
915
|
+
minVersion: "12.0.0",
|
|
916
|
+
version: "22.2.2",
|
|
917
|
+
ngImport: i0,
|
|
918
|
+
type: RaqmDialogTriggerDirective,
|
|
919
|
+
deps: [],
|
|
920
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
921
|
+
});
|
|
922
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
923
|
+
minVersion: "14.0.0",
|
|
924
|
+
version: "22.2.2",
|
|
925
|
+
type: RaqmDialogTriggerDirective,
|
|
926
|
+
isStandalone: true,
|
|
927
|
+
selector: "button[raqm-dialog-trigger]",
|
|
928
|
+
host: {
|
|
929
|
+
listeners: { "click": "onClick()" },
|
|
930
|
+
properties: {
|
|
931
|
+
"attr.aria-haspopup": "\"dialog\"",
|
|
932
|
+
"attr.aria-expanded": "open() ? \"true\" : \"false\"",
|
|
933
|
+
"attr.aria-controls": "open() ? dialogId() : null"
|
|
934
|
+
},
|
|
935
|
+
classAttribute: "raqm-dialog-trigger"
|
|
936
|
+
},
|
|
937
|
+
ngImport: i0
|
|
938
|
+
});
|
|
939
|
+
};
|
|
940
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
941
|
+
minVersion: "12.0.0",
|
|
942
|
+
version: "22.2.2",
|
|
943
|
+
ngImport: i0,
|
|
944
|
+
type: RaqmDialogTriggerDirective,
|
|
945
|
+
decorators: [{
|
|
946
|
+
type: Directive,
|
|
947
|
+
args: [{
|
|
948
|
+
selector: "button[raqm-dialog-trigger]",
|
|
949
|
+
host: {
|
|
950
|
+
class: "raqm-dialog-trigger",
|
|
951
|
+
"[attr.aria-haspopup]": "\"dialog\"",
|
|
952
|
+
"[attr.aria-expanded]": "open() ? \"true\" : \"false\"",
|
|
953
|
+
"[attr.aria-controls]": "open() ? dialogId() : null",
|
|
954
|
+
"(click)": "onClick()"
|
|
955
|
+
}
|
|
956
|
+
}]
|
|
957
|
+
}],
|
|
958
|
+
ctorParameters: () => []
|
|
959
|
+
});
|
|
960
|
+
var RaqmDialogContentDirective = class RaqmDialogContentDirective {
|
|
961
|
+
template = inject(TemplateRef);
|
|
962
|
+
dialog = inject(RAQM_DIALOG, { optional: true });
|
|
963
|
+
destroyRef = inject(DestroyRef);
|
|
964
|
+
constructor() {
|
|
965
|
+
if (isDevMode() && this.dialog === null) console.error("[raqm-dialog-content] No parent <raqm-dialog> found; the template is never rendered.");
|
|
966
|
+
this.destroyRef.onDestroy(() => this.dialog?.unregisterContent(this.template));
|
|
967
|
+
}
|
|
968
|
+
ngOnInit() {
|
|
969
|
+
this.dialog?.registerContent(this.template);
|
|
970
|
+
}
|
|
971
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
972
|
+
minVersion: "12.0.0",
|
|
973
|
+
version: "22.2.2",
|
|
974
|
+
ngImport: i0,
|
|
975
|
+
type: RaqmDialogContentDirective,
|
|
976
|
+
deps: [],
|
|
977
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
978
|
+
});
|
|
979
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
980
|
+
minVersion: "14.0.0",
|
|
981
|
+
version: "22.2.2",
|
|
982
|
+
type: RaqmDialogContentDirective,
|
|
983
|
+
isStandalone: true,
|
|
984
|
+
selector: "ng-template[raqm-dialog-content]",
|
|
985
|
+
exportAs: ["raqmDialogContent"],
|
|
986
|
+
ngImport: i0
|
|
987
|
+
});
|
|
988
|
+
};
|
|
989
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
990
|
+
minVersion: "12.0.0",
|
|
991
|
+
version: "22.2.2",
|
|
992
|
+
ngImport: i0,
|
|
993
|
+
type: RaqmDialogContentDirective,
|
|
994
|
+
decorators: [{
|
|
995
|
+
type: Directive,
|
|
996
|
+
args: [{
|
|
997
|
+
selector: "ng-template[raqm-dialog-content]",
|
|
998
|
+
exportAs: "raqmDialogContent"
|
|
999
|
+
}]
|
|
1000
|
+
}],
|
|
1001
|
+
ctorParameters: () => []
|
|
1002
|
+
});
|
|
1003
|
+
var RaqmDialogCloseDirective = class RaqmDialogCloseDirective {
|
|
1004
|
+
host = inject(ElementRef);
|
|
1005
|
+
dialog = inject(RAQM_DIALOG, { optional: true });
|
|
1006
|
+
constructor() {
|
|
1007
|
+
const element = this.host.nativeElement;
|
|
1008
|
+
if (!element.hasAttribute("type")) element.setAttribute("type", "button");
|
|
1009
|
+
if (isDevMode() && this.dialog === null) console.error("[raqm-dialog-close] No parent <raqm-dialog> found; the control cannot close a dialog.");
|
|
1010
|
+
}
|
|
1011
|
+
onClick() {
|
|
1012
|
+
this.dialog?.closeFromUser();
|
|
1013
|
+
}
|
|
1014
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1015
|
+
minVersion: "12.0.0",
|
|
1016
|
+
version: "22.2.2",
|
|
1017
|
+
ngImport: i0,
|
|
1018
|
+
type: RaqmDialogCloseDirective,
|
|
1019
|
+
deps: [],
|
|
1020
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1021
|
+
});
|
|
1022
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1023
|
+
minVersion: "14.0.0",
|
|
1024
|
+
version: "22.2.2",
|
|
1025
|
+
type: RaqmDialogCloseDirective,
|
|
1026
|
+
isStandalone: true,
|
|
1027
|
+
selector: "button[raqm-dialog-close]",
|
|
1028
|
+
host: {
|
|
1029
|
+
listeners: { "click": "onClick()" },
|
|
1030
|
+
classAttribute: "raqm-dialog-close-control"
|
|
1031
|
+
},
|
|
1032
|
+
ngImport: i0
|
|
1033
|
+
});
|
|
1034
|
+
};
|
|
1035
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1036
|
+
minVersion: "12.0.0",
|
|
1037
|
+
version: "22.2.2",
|
|
1038
|
+
ngImport: i0,
|
|
1039
|
+
type: RaqmDialogCloseDirective,
|
|
1040
|
+
decorators: [{
|
|
1041
|
+
type: Directive,
|
|
1042
|
+
args: [{
|
|
1043
|
+
selector: "button[raqm-dialog-close]",
|
|
1044
|
+
host: {
|
|
1045
|
+
class: "raqm-dialog-close-control",
|
|
1046
|
+
"(click)": "onClick()"
|
|
1047
|
+
}
|
|
1048
|
+
}]
|
|
1049
|
+
}],
|
|
1050
|
+
ctorParameters: () => []
|
|
1051
|
+
});
|
|
1052
|
+
var RaqmDialogHeaderDirective = class RaqmDialogHeaderDirective {
|
|
1053
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1054
|
+
minVersion: "12.0.0",
|
|
1055
|
+
version: "22.2.2",
|
|
1056
|
+
ngImport: i0,
|
|
1057
|
+
type: RaqmDialogHeaderDirective,
|
|
1058
|
+
deps: [],
|
|
1059
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1060
|
+
});
|
|
1061
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1062
|
+
minVersion: "14.0.0",
|
|
1063
|
+
version: "22.2.2",
|
|
1064
|
+
type: RaqmDialogHeaderDirective,
|
|
1065
|
+
isStandalone: true,
|
|
1066
|
+
selector: "[raqm-dialog-header]",
|
|
1067
|
+
host: { classAttribute: "raqm-dialog-header" },
|
|
1068
|
+
ngImport: i0
|
|
1069
|
+
});
|
|
1070
|
+
};
|
|
1071
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1072
|
+
minVersion: "12.0.0",
|
|
1073
|
+
version: "22.2.2",
|
|
1074
|
+
ngImport: i0,
|
|
1075
|
+
type: RaqmDialogHeaderDirective,
|
|
1076
|
+
decorators: [{
|
|
1077
|
+
type: Directive,
|
|
1078
|
+
args: [{
|
|
1079
|
+
selector: "[raqm-dialog-header]",
|
|
1080
|
+
host: { class: "raqm-dialog-header" }
|
|
1081
|
+
}]
|
|
1082
|
+
}]
|
|
1083
|
+
});
|
|
1084
|
+
var RaqmDialogFooterDirective = class RaqmDialogFooterDirective {
|
|
1085
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1086
|
+
minVersion: "12.0.0",
|
|
1087
|
+
version: "22.2.2",
|
|
1088
|
+
ngImport: i0,
|
|
1089
|
+
type: RaqmDialogFooterDirective,
|
|
1090
|
+
deps: [],
|
|
1091
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1092
|
+
});
|
|
1093
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1094
|
+
minVersion: "14.0.0",
|
|
1095
|
+
version: "22.2.2",
|
|
1096
|
+
type: RaqmDialogFooterDirective,
|
|
1097
|
+
isStandalone: true,
|
|
1098
|
+
selector: "[raqm-dialog-footer]",
|
|
1099
|
+
host: { classAttribute: "raqm-dialog-footer" },
|
|
1100
|
+
ngImport: i0
|
|
1101
|
+
});
|
|
1102
|
+
};
|
|
1103
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1104
|
+
minVersion: "12.0.0",
|
|
1105
|
+
version: "22.2.2",
|
|
1106
|
+
ngImport: i0,
|
|
1107
|
+
type: RaqmDialogFooterDirective,
|
|
1108
|
+
decorators: [{
|
|
1109
|
+
type: Directive,
|
|
1110
|
+
args: [{
|
|
1111
|
+
selector: "[raqm-dialog-footer]",
|
|
1112
|
+
host: { class: "raqm-dialog-footer" }
|
|
1113
|
+
}]
|
|
1114
|
+
}]
|
|
1115
|
+
});
|
|
1116
|
+
var RaqmDialogTitleDirective = class RaqmDialogTitleDirective {
|
|
1117
|
+
host = inject(ElementRef);
|
|
1118
|
+
dialog = inject(RAQM_DIALOG, { optional: true });
|
|
1119
|
+
destroyRef = inject(DestroyRef);
|
|
1120
|
+
constructor() {
|
|
1121
|
+
if (isDevMode() && this.dialog === null) console.error("[raqm-dialog-title] No parent <raqm-dialog> found; the title cannot be associated with a dialog.");
|
|
1122
|
+
this.destroyRef.onDestroy(() => this.dialog?.unregisterTitle(this.host.nativeElement));
|
|
1123
|
+
}
|
|
1124
|
+
ngOnInit() {
|
|
1125
|
+
this.dialog?.registerTitle(this.host.nativeElement);
|
|
1126
|
+
}
|
|
1127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1128
|
+
minVersion: "12.0.0",
|
|
1129
|
+
version: "22.2.2",
|
|
1130
|
+
ngImport: i0,
|
|
1131
|
+
type: RaqmDialogTitleDirective,
|
|
1132
|
+
deps: [],
|
|
1133
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1134
|
+
});
|
|
1135
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1136
|
+
minVersion: "14.0.0",
|
|
1137
|
+
version: "22.2.2",
|
|
1138
|
+
type: RaqmDialogTitleDirective,
|
|
1139
|
+
isStandalone: true,
|
|
1140
|
+
selector: "[raqm-dialog-title]",
|
|
1141
|
+
host: { classAttribute: "raqm-dialog-title" },
|
|
1142
|
+
ngImport: i0
|
|
1143
|
+
});
|
|
1144
|
+
};
|
|
1145
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1146
|
+
minVersion: "12.0.0",
|
|
1147
|
+
version: "22.2.2",
|
|
1148
|
+
ngImport: i0,
|
|
1149
|
+
type: RaqmDialogTitleDirective,
|
|
1150
|
+
decorators: [{
|
|
1151
|
+
type: Directive,
|
|
1152
|
+
args: [{
|
|
1153
|
+
selector: "[raqm-dialog-title]",
|
|
1154
|
+
host: { class: "raqm-dialog-title" }
|
|
1155
|
+
}]
|
|
1156
|
+
}],
|
|
1157
|
+
ctorParameters: () => []
|
|
1158
|
+
});
|
|
1159
|
+
var RaqmDialogDescriptionDirective = class RaqmDialogDescriptionDirective {
|
|
1160
|
+
host = inject(ElementRef);
|
|
1161
|
+
dialog = inject(RAQM_DIALOG, { optional: true });
|
|
1162
|
+
destroyRef = inject(DestroyRef);
|
|
1163
|
+
constructor() {
|
|
1164
|
+
if (isDevMode() && this.dialog === null) console.error("[raqm-dialog-description] No parent <raqm-dialog> found; the description cannot be associated with a dialog.");
|
|
1165
|
+
this.destroyRef.onDestroy(() => this.dialog?.unregisterDescription(this.host.nativeElement));
|
|
1166
|
+
}
|
|
1167
|
+
ngOnInit() {
|
|
1168
|
+
this.dialog?.registerDescription(this.host.nativeElement);
|
|
1169
|
+
}
|
|
1170
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1171
|
+
minVersion: "12.0.0",
|
|
1172
|
+
version: "22.2.2",
|
|
1173
|
+
ngImport: i0,
|
|
1174
|
+
type: RaqmDialogDescriptionDirective,
|
|
1175
|
+
deps: [],
|
|
1176
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1177
|
+
});
|
|
1178
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1179
|
+
minVersion: "14.0.0",
|
|
1180
|
+
version: "22.2.2",
|
|
1181
|
+
type: RaqmDialogDescriptionDirective,
|
|
1182
|
+
isStandalone: true,
|
|
1183
|
+
selector: "[raqm-dialog-description]",
|
|
1184
|
+
host: { classAttribute: "raqm-dialog-description" },
|
|
1185
|
+
ngImport: i0
|
|
1186
|
+
});
|
|
1187
|
+
};
|
|
1188
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1189
|
+
minVersion: "12.0.0",
|
|
1190
|
+
version: "22.2.2",
|
|
1191
|
+
ngImport: i0,
|
|
1192
|
+
type: RaqmDialogDescriptionDirective,
|
|
1193
|
+
decorators: [{
|
|
1194
|
+
type: Directive,
|
|
1195
|
+
args: [{
|
|
1196
|
+
selector: "[raqm-dialog-description]",
|
|
1197
|
+
host: { class: "raqm-dialog-description" }
|
|
1198
|
+
}]
|
|
1199
|
+
}],
|
|
1200
|
+
ctorParameters: () => []
|
|
1201
|
+
});
|
|
1202
|
+
const RaqmDialog = [
|
|
1203
|
+
RaqmDialogComponent,
|
|
1204
|
+
RaqmDialogTriggerDirective,
|
|
1205
|
+
RaqmDialogContentDirective,
|
|
1206
|
+
RaqmDialogCloseDirective,
|
|
1207
|
+
RaqmDialogHeaderDirective,
|
|
1208
|
+
RaqmDialogFooterDirective,
|
|
1209
|
+
RaqmDialogTitleDirective,
|
|
1210
|
+
RaqmDialogDescriptionDirective
|
|
1211
|
+
];
|
|
1212
|
+
export { RAQM_DIALOG, RAQM_DIALOG_POLICY, RaqmDialog, RaqmDialogBaseComponent, RaqmDialogCloseDirective, RaqmDialogComponent, RaqmDialogContentDirective, RaqmDialogDescriptionDirective, RaqmDialogFooterDirective, RaqmDialogHeaderDirective, RaqmDialogTitleDirective, RaqmDialogTriggerDirective };
|
|
1213
|
+
|
|
1214
|
+
//# sourceMappingURL=raqm-ui-dialog.mjs.map
|