@ckui/core 0.1.0-next.2 → 0.1.0-next.3
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/README.md +215 -0
- package/fesm2022/ckui-core-chip.mjs +300 -0
- package/fesm2022/ckui-core-chip.mjs.map +1 -0
- package/fesm2022/ckui-core-dialog.mjs +18 -287
- package/fesm2022/ckui-core-dialog.mjs.map +1 -1
- package/fesm2022/ckui-core-drawer.mjs +342 -0
- package/fesm2022/ckui-core-drawer.mjs.map +1 -0
- package/fesm2022/ckui-core-internal-dialog.mjs +296 -0
- package/fesm2022/ckui-core-internal-dialog.mjs.map +1 -0
- package/fesm2022/ckui-core-internal-overlay.mjs +19 -8
- package/fesm2022/ckui-core-internal-overlay.mjs.map +1 -1
- package/fesm2022/ckui-core-switch.mjs +327 -0
- package/fesm2022/ckui-core-switch.mjs.map +1 -0
- package/fesm2022/ckui-core-tabs.mjs +678 -0
- package/fesm2022/ckui-core-tabs.mjs.map +1 -0
- package/package.json +21 -1
- package/types/ckui-core-chip.d.ts +62 -0
- package/types/ckui-core-dialog.d.ts +5 -40
- package/types/ckui-core-drawer.d.ts +153 -0
- package/types/ckui-core-internal-dialog.d.ts +102 -0
- package/types/ckui-core-internal-overlay.d.ts +12 -5
- package/types/ckui-core-switch.d.ts +90 -0
- package/types/ckui-core-tabs.d.ts +212 -0
|
@@ -1,294 +1,26 @@
|
|
|
1
1
|
import { isPlatformBrowser } from "@angular/common";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CdkPortalOutlet, ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
|
|
7
|
-
import { CK_LABELS } from "@ckui/core";
|
|
8
|
-
import { CkButton } from "@ckui/core/button";
|
|
9
|
-
import { CkIcon, createCkId } from "@ckui/core/internal";
|
|
10
|
-
const CK_DIALOG_DATA = new InjectionToken("CK_DIALOG_DATA");
|
|
11
|
-
var CkDialogIds = class {
|
|
12
|
-
entries = signal([], ...ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []);
|
|
13
|
-
current = computed(() => this.entries().at(-1)?.() ?? null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
14
|
-
add(id) {
|
|
15
|
-
this.entries.update((entries) => [...entries, id]);
|
|
16
|
-
return () => this.entries.update((entries) => entries.filter((entry) => entry !== id));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
var CkDialogContext = class {
|
|
20
|
-
titles = new CkDialogIds();
|
|
21
|
-
descriptions = new CkDialogIds();
|
|
22
|
-
titleId = this.titles.current;
|
|
23
|
-
descriptionId = this.descriptions.current;
|
|
24
|
-
mode = signal("modal", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
|
|
25
|
-
};
|
|
26
|
-
const CK_DIALOG_CONTEXT = new InjectionToken("CK_DIALOG_CONTEXT");
|
|
27
|
-
var CkDialogRef = class {
|
|
28
|
-
closed;
|
|
29
|
-
closing;
|
|
30
|
-
controls;
|
|
31
|
-
constructor(controls) {
|
|
32
|
-
this.controls = controls;
|
|
33
|
-
this.closed = controls.closed;
|
|
34
|
-
this.closing = controls.closing;
|
|
35
|
-
}
|
|
36
|
-
close(result) {
|
|
37
|
-
this.controls.close(result);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const CK_DIALOG_SETUP = new InjectionToken("CK_DIALOG_SETUP");
|
|
41
|
-
var CkDialogContainer = class CkDialogContainer {
|
|
42
|
-
context = inject(CK_DIALOG_CONTEXT);
|
|
43
|
-
setup = inject(CK_DIALOG_SETUP);
|
|
44
|
-
labels = inject(CK_LABELS);
|
|
45
|
-
ref = inject(CkDialogRef);
|
|
46
|
-
portal;
|
|
47
|
-
constructor() {
|
|
48
|
-
const injector = inject(Injector);
|
|
49
|
-
this.portal = this.setup.content instanceof TemplateRef ? new TemplatePortal(this.setup.content, inject(ViewContainerRef), void 0, injector) : new ComponentPortal(this.setup.content, null, injector);
|
|
50
|
-
}
|
|
51
|
-
onAttached(attached) {
|
|
52
|
-
if (attached && "location" in attached) attached.location.nativeElement.classList.add("ck-dialog__component");
|
|
53
|
-
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
55
|
-
minVersion: "12.0.0",
|
|
56
|
-
version: "22.2.4",
|
|
57
|
-
ngImport: i0,
|
|
58
|
-
type: CkDialogContainer,
|
|
59
|
-
deps: [],
|
|
60
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
61
|
-
});
|
|
62
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
63
|
-
minVersion: "17.0.0",
|
|
64
|
-
version: "22.2.4",
|
|
65
|
-
type: CkDialogContainer,
|
|
66
|
-
isStandalone: true,
|
|
67
|
-
selector: "ck-dialog-container",
|
|
68
|
-
host: {
|
|
69
|
-
properties: {
|
|
70
|
-
"class.ck-dialog--sheet": "context.mode() === \"sheet\"",
|
|
71
|
-
"class.ck-dialog--grab": "context.mode() === \"sheet\" && setup.dismissible",
|
|
72
|
-
"class.ck-dialog--has-close": "setup.closeButton",
|
|
73
|
-
"class.ck-dialog--no-title": "context.titleId() === null"
|
|
74
|
-
},
|
|
75
|
-
classAttribute: "ck-dialog"
|
|
76
|
-
},
|
|
77
|
-
ngImport: i0,
|
|
78
|
-
template: `
|
|
79
|
-
<div class="ck-dialog__content">
|
|
80
|
-
<ng-template [cdkPortalOutlet]="portal" (attached)="onAttached($event)" />
|
|
81
|
-
</div>
|
|
82
|
-
@if (setup.closeButton) {
|
|
83
|
-
<button
|
|
84
|
-
ckButton
|
|
85
|
-
type="button"
|
|
86
|
-
variant="ghost"
|
|
87
|
-
size="md"
|
|
88
|
-
iconOnly
|
|
89
|
-
class="ck-dialog__close"
|
|
90
|
-
[attr.aria-label]="labels().close"
|
|
91
|
-
(click)="ref.close()"
|
|
92
|
-
>
|
|
93
|
-
<ck-icon name="close" />
|
|
94
|
-
</button>
|
|
95
|
-
}
|
|
96
|
-
`,
|
|
97
|
-
isInline: true,
|
|
98
|
-
styles: ["@layer ckui{.ck-dialog-panel{box-sizing:border-box;inline-size:min(var(--ck-dialog-max-width, var(--_ck-dialog-width, 32rem)),100%);border-radius:var(--ck-dialog-radius, var(--ck-radius-xl));background:var(--ck-dialog-bg, var(--ck-color-surface-raised));color:var(--ck-color-fg);color-scheme:var(--ck-color-scheme);box-shadow:var(--ck-dialog-shadow, var(--ck-shadow-lg));font-family:var(--ck-font-sans);font-size:var(--ck-font-size-md);line-height:var(--ck-line-height-normal);outline:none}.ck-dialog-panel:focus-visible{outline:var(--ck-focus-ring);outline-offset:calc(-1 * var(--ck-focus-ring-width, 2px))}.ck-dialog-panel--sm{--_ck-dialog-width: 24rem}.ck-dialog-panel--md{--_ck-dialog-width: 32rem}.ck-dialog-panel--lg{--_ck-dialog-width: 48rem}.ck-dialog-panel.ck-overlay--sheet{border-end-start-radius:0;border-end-end-radius:0}.ck-dialog-panel .ck-overlay-grab{border-start-start-radius:var(--ck-dialog-radius, var(--ck-radius-xl));border-start-end-radius:var(--ck-dialog-radius, var(--ck-radius-xl));background:var(--ck-dialog-bg, var(--ck-color-surface-raised))}.ck-dialog{--_ck-dialog-padding: var(--ck-dialog-padding, var(--ck-space-6));--_ck-dialog-padding-top: var(--_ck-dialog-padding);position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-block-size:0;padding:var(--_ck-dialog-padding);padding-block-start:var(--_ck-dialog-padding-top)}.ck-dialog--sheet{--_ck-dialog-padding: var(--ck-dialog-padding, var(--ck-space-4));padding-block-end:calc(var(--_ck-dialog-padding) + env(safe-area-inset-bottom,0px))}.ck-dialog--grab{--_ck-dialog-padding-top: 0px}.ck-dialog__content,.ck-dialog__component{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--ck-space-4);min-block-size:0;min-inline-size:0}.ck-dialog--has-close.ck-dialog--no-title .ck-dialog__content{padding-block-start:var(--ck-control-height-md)}.ck-dialog>.ck-dialog__close{position:absolute;inset-block-start:var(--_ck-dialog-padding-top);inset-inline-end:var(--_ck-dialog-padding)}.ck-dialog__title{margin:0;font-size:var(--ck-font-size-xl);font-weight:var(--ck-font-weight-semibold);line-height:var(--ck-line-height-tight);overflow-wrap:break-word}.ck-dialog--has-close .ck-dialog__title{display:block;align-content:center;min-block-size:var(--ck-control-height-md);padding-inline-end:calc(var(--ck-control-height-md) + var(--ck-space-2))}.ck-dialog__description{margin:0;color:var(--ck-color-fg-muted);overflow-wrap:break-word}.ck-dialog-body{display:block;flex:1 1 auto;min-block-size:0;overflow-y:auto;overscroll-behavior:contain;margin:calc(-1 * var(--ck-space-2));padding:var(--ck-space-2)}.ck-dialog-body__inner{display:flow-root;overflow-wrap:break-word}.ck-dialog-body:focus-visible{outline:var(--ck-focus-ring);outline-offset:calc(-1 * var(--ck-focus-ring-width, 2px))}.ck-dialog-actions{display:flex;flex:none;flex-wrap:wrap;justify-content:flex-end;margin-block-start:auto;gap:var(--ck-space-2)}.ck-dialog--sheet .ck-dialog-actions{flex-direction:column;flex-wrap:nowrap;align-items:stretch}}\n"],
|
|
99
|
-
dependencies: [
|
|
100
|
-
{
|
|
101
|
-
kind: "directive",
|
|
102
|
-
type: CdkPortalOutlet,
|
|
103
|
-
selector: "[cdkPortalOutlet]",
|
|
104
|
-
inputs: ["cdkPortalOutlet"],
|
|
105
|
-
outputs: ["attached"],
|
|
106
|
-
exportAs: ["cdkPortalOutlet"]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
kind: "component",
|
|
110
|
-
type: CkButton,
|
|
111
|
-
selector: "button[ckButton], a[ckButton]",
|
|
112
|
-
inputs: [
|
|
113
|
-
"variant",
|
|
114
|
-
"size",
|
|
115
|
-
"iconOnly",
|
|
116
|
-
"loading",
|
|
117
|
-
"disabled"
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
kind: "component",
|
|
122
|
-
type: CkIcon,
|
|
123
|
-
selector: "ck-icon",
|
|
124
|
-
inputs: ["name"]
|
|
125
|
-
}
|
|
126
|
-
],
|
|
127
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
128
|
-
encapsulation: i0.ViewEncapsulation.None
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
132
|
-
minVersion: "12.0.0",
|
|
133
|
-
version: "22.2.4",
|
|
134
|
-
ngImport: i0,
|
|
135
|
-
type: CkDialogContainer,
|
|
136
|
-
decorators: [{
|
|
137
|
-
type: Component,
|
|
138
|
-
args: [{
|
|
139
|
-
selector: "ck-dialog-container",
|
|
140
|
-
imports: [
|
|
141
|
-
CdkPortalOutlet,
|
|
142
|
-
CkButton,
|
|
143
|
-
CkIcon
|
|
144
|
-
],
|
|
145
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
146
|
-
encapsulation: ViewEncapsulation.None,
|
|
147
|
-
host: {
|
|
148
|
-
class: "ck-dialog",
|
|
149
|
-
"[class.ck-dialog--sheet]": "context.mode() === \"sheet\"",
|
|
150
|
-
"[class.ck-dialog--grab]": "context.mode() === \"sheet\" && setup.dismissible",
|
|
151
|
-
"[class.ck-dialog--has-close]": "setup.closeButton",
|
|
152
|
-
"[class.ck-dialog--no-title]": "context.titleId() === null"
|
|
153
|
-
},
|
|
154
|
-
template: `
|
|
155
|
-
<div class="ck-dialog__content">
|
|
156
|
-
<ng-template [cdkPortalOutlet]="portal" (attached)="onAttached($event)" />
|
|
157
|
-
</div>
|
|
158
|
-
@if (setup.closeButton) {
|
|
159
|
-
<button
|
|
160
|
-
ckButton
|
|
161
|
-
type="button"
|
|
162
|
-
variant="ghost"
|
|
163
|
-
size="md"
|
|
164
|
-
iconOnly
|
|
165
|
-
class="ck-dialog__close"
|
|
166
|
-
[attr.aria-label]="labels().close"
|
|
167
|
-
(click)="ref.close()"
|
|
168
|
-
>
|
|
169
|
-
<ck-icon name="close" />
|
|
170
|
-
</button>
|
|
171
|
-
}
|
|
172
|
-
`,
|
|
173
|
-
styles: ["@layer ckui{.ck-dialog-panel{box-sizing:border-box;inline-size:min(var(--ck-dialog-max-width, var(--_ck-dialog-width, 32rem)),100%);border-radius:var(--ck-dialog-radius, var(--ck-radius-xl));background:var(--ck-dialog-bg, var(--ck-color-surface-raised));color:var(--ck-color-fg);color-scheme:var(--ck-color-scheme);box-shadow:var(--ck-dialog-shadow, var(--ck-shadow-lg));font-family:var(--ck-font-sans);font-size:var(--ck-font-size-md);line-height:var(--ck-line-height-normal);outline:none}.ck-dialog-panel:focus-visible{outline:var(--ck-focus-ring);outline-offset:calc(-1 * var(--ck-focus-ring-width, 2px))}.ck-dialog-panel--sm{--_ck-dialog-width: 24rem}.ck-dialog-panel--md{--_ck-dialog-width: 32rem}.ck-dialog-panel--lg{--_ck-dialog-width: 48rem}.ck-dialog-panel.ck-overlay--sheet{border-end-start-radius:0;border-end-end-radius:0}.ck-dialog-panel .ck-overlay-grab{border-start-start-radius:var(--ck-dialog-radius, var(--ck-radius-xl));border-start-end-radius:var(--ck-dialog-radius, var(--ck-radius-xl));background:var(--ck-dialog-bg, var(--ck-color-surface-raised))}.ck-dialog{--_ck-dialog-padding: var(--ck-dialog-padding, var(--ck-space-6));--_ck-dialog-padding-top: var(--_ck-dialog-padding);position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-block-size:0;padding:var(--_ck-dialog-padding);padding-block-start:var(--_ck-dialog-padding-top)}.ck-dialog--sheet{--_ck-dialog-padding: var(--ck-dialog-padding, var(--ck-space-4));padding-block-end:calc(var(--_ck-dialog-padding) + env(safe-area-inset-bottom,0px))}.ck-dialog--grab{--_ck-dialog-padding-top: 0px}.ck-dialog__content,.ck-dialog__component{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--ck-space-4);min-block-size:0;min-inline-size:0}.ck-dialog--has-close.ck-dialog--no-title .ck-dialog__content{padding-block-start:var(--ck-control-height-md)}.ck-dialog>.ck-dialog__close{position:absolute;inset-block-start:var(--_ck-dialog-padding-top);inset-inline-end:var(--_ck-dialog-padding)}.ck-dialog__title{margin:0;font-size:var(--ck-font-size-xl);font-weight:var(--ck-font-weight-semibold);line-height:var(--ck-line-height-tight);overflow-wrap:break-word}.ck-dialog--has-close .ck-dialog__title{display:block;align-content:center;min-block-size:var(--ck-control-height-md);padding-inline-end:calc(var(--ck-control-height-md) + var(--ck-space-2))}.ck-dialog__description{margin:0;color:var(--ck-color-fg-muted);overflow-wrap:break-word}.ck-dialog-body{display:block;flex:1 1 auto;min-block-size:0;overflow-y:auto;overscroll-behavior:contain;margin:calc(-1 * var(--ck-space-2));padding:var(--ck-space-2)}.ck-dialog-body__inner{display:flow-root;overflow-wrap:break-word}.ck-dialog-body:focus-visible{outline:var(--ck-focus-ring);outline-offset:calc(-1 * var(--ck-focus-ring-width, 2px))}.ck-dialog-actions{display:flex;flex:none;flex-wrap:wrap;justify-content:flex-end;margin-block-start:auto;gap:var(--ck-space-2)}.ck-dialog--sheet .ck-dialog-actions{flex-direction:column;flex-wrap:nowrap;align-items:stretch}}\n"]
|
|
174
|
-
}]
|
|
175
|
-
}],
|
|
176
|
-
ctorParameters: () => []
|
|
177
|
-
});
|
|
178
|
-
const TABBABLE_CANDIDATES = "a[href], button, input, select, textarea, summary, [tabindex], [contenteditable], audio[controls], video[controls]";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, PLATFORM_ID, Renderer2, TemplateRef, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, contentChild, inject, input, model, output, untracked } from "@angular/core";
|
|
4
|
+
import { CK_DIALOG_CONTEXT, CK_DIALOG_DATA, CkDialogOpener, CkDialogRef, CkDialogRef as CkDialogRef$1 } from "@ckui/core/internal/dialog";
|
|
5
|
+
import { createCkId } from "@ckui/core/internal";
|
|
179
6
|
var CkDialog = class CkDialog {
|
|
180
|
-
|
|
181
|
-
checker = inject(InteractivityChecker);
|
|
182
|
-
injector = inject(Injector);
|
|
183
|
-
active = /* @__PURE__ */ new Set();
|
|
184
|
-
constructor() {
|
|
185
|
-
inject(DestroyRef).onDestroy(() => {
|
|
186
|
-
for (const dialog of [...this.active]) dialog.destroy();
|
|
187
|
-
this.active.clear();
|
|
188
|
-
});
|
|
189
|
-
}
|
|
7
|
+
opener = new CkDialogOpener();
|
|
190
8
|
open(content, config = {}) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
let labelling = null;
|
|
203
|
-
const dialog = {
|
|
204
|
-
close: () => ref.close(),
|
|
205
|
-
destroy: () => settle()
|
|
206
|
-
};
|
|
207
|
-
const settle = () => {
|
|
208
|
-
if (settled) return;
|
|
209
|
-
settled = true;
|
|
210
|
-
resolveClosing();
|
|
211
|
-
labelling?.destroy();
|
|
212
|
-
this.active.delete(dialog);
|
|
213
|
-
resolveClosed(result);
|
|
214
|
-
};
|
|
215
|
-
const ref = new CkDialogRef({
|
|
216
|
-
closed,
|
|
217
|
-
closing,
|
|
218
|
-
close: (value) => {
|
|
219
|
-
if (requested) return;
|
|
220
|
-
requested = true;
|
|
221
|
-
result = value;
|
|
222
|
-
resolveClosing();
|
|
223
|
-
handle?.close();
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
this.active.add(dialog);
|
|
227
|
-
const dialogInjector = Injector.create({
|
|
228
|
-
parent: config.injector ?? this.injector,
|
|
229
|
-
providers: [
|
|
230
|
-
{
|
|
231
|
-
provide: CK_DIALOG_CONTEXT,
|
|
232
|
-
useValue: context
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
provide: CkDialogRef,
|
|
236
|
-
useValue: ref
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
provide: CK_DIALOG_DATA,
|
|
240
|
-
useValue: config.data
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
provide: CK_DIALOG_SETUP,
|
|
244
|
-
useValue: {
|
|
245
|
-
content,
|
|
246
|
-
closeButton,
|
|
247
|
-
dismissible
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
]
|
|
9
|
+
return this.opener.open(content, {
|
|
10
|
+
kind: "CkDialog",
|
|
11
|
+
mode: config.mode ?? "auto",
|
|
12
|
+
data: config.data,
|
|
13
|
+
role: config.role ?? "dialog",
|
|
14
|
+
dismissible: config.dismissible ?? true,
|
|
15
|
+
closeButton: config.closeButton ?? true,
|
|
16
|
+
fullHeight: config.fullHeight ?? false,
|
|
17
|
+
injector: config.injector,
|
|
18
|
+
ariaLabel: config.ariaLabel,
|
|
19
|
+
panelClass: ["ck-dialog-panel", `ck-dialog-panel--${config.width ?? "md"}`]
|
|
251
20
|
});
|
|
252
|
-
try {
|
|
253
|
-
handle = this.overlay.open(CkDialogContainer, {
|
|
254
|
-
mode: config.mode ?? "auto",
|
|
255
|
-
dismissible,
|
|
256
|
-
fullHeight: config.fullHeight ?? false,
|
|
257
|
-
role: config.role ?? "dialog",
|
|
258
|
-
ariaLabel: config.ariaLabel,
|
|
259
|
-
panelClass: ["ck-dialog-panel", `ck-dialog-panel--${config.width ?? "md"}`],
|
|
260
|
-
onDismissRequest: () => ref.close(),
|
|
261
|
-
initialFocus: () => handle ? this.initialFocus(handle.panel) : null
|
|
262
|
-
}, dialogInjector);
|
|
263
|
-
} catch (error) {
|
|
264
|
-
settle();
|
|
265
|
-
throw error;
|
|
266
|
-
}
|
|
267
|
-
const opened = handle;
|
|
268
|
-
context.mode.set(opened.mode);
|
|
269
|
-
labelling = effect(() => {
|
|
270
|
-
this.setAttribute(opened.panel, "aria-labelledby", context.titleId());
|
|
271
|
-
this.setAttribute(opened.panel, "aria-describedby", context.descriptionId());
|
|
272
|
-
}, { injector: this.injector });
|
|
273
|
-
opened.closed.then(settle);
|
|
274
|
-
if (requested) opened.close();
|
|
275
|
-
if (typeof ngDevMode !== "undefined" && ngDevMode) opened.opened.then(() => {
|
|
276
|
-
if (!settled && context.titleId() === null && !config.ariaLabel) console.warn("CkDialog: the dialog has no accessible name. Add [ckDialogTitle] to a heading in its content or set `ariaLabel` in the config.");
|
|
277
|
-
});
|
|
278
|
-
return ref;
|
|
279
21
|
}
|
|
280
22
|
closeAll() {
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
setAttribute(element, name, value) {
|
|
284
|
-
if (value === null) element.removeAttribute(name);
|
|
285
|
-
else element.setAttribute(name, value);
|
|
286
|
-
}
|
|
287
|
-
initialFocus(panel) {
|
|
288
|
-
const marked = Array.from(panel.querySelectorAll("[data-ck-dialog-initial-focus]")).find((candidate) => this.checker.isFocusable(candidate));
|
|
289
|
-
if (marked) return marked;
|
|
290
|
-
const content = panel.querySelector(".ck-dialog__content");
|
|
291
|
-
return Array.from(content?.querySelectorAll(TABBABLE_CANDIDATES) ?? []).find((candidate) => !candidate.classList.contains("ck-dialog-body") && this.checker.isTabbable(candidate)) ?? panel;
|
|
23
|
+
this.opener.closeAll();
|
|
292
24
|
}
|
|
293
25
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
294
26
|
minVersion: "12.0.0",
|
|
@@ -314,8 +46,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
314
46
|
decorators: [{
|
|
315
47
|
type: Injectable,
|
|
316
48
|
args: [{ providedIn: "root" }]
|
|
317
|
-
}]
|
|
318
|
-
ctorParameters: () => []
|
|
49
|
+
}]
|
|
319
50
|
});
|
|
320
51
|
var CkDialogComponent = class CkDialogComponent {
|
|
321
52
|
open = model(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
@@ -806,7 +537,7 @@ var CkDialogClose = class CkDialogClose {
|
|
|
806
537
|
...ngDevMode ? { debugName: "result" } : /* istanbul ignore next */ {},
|
|
807
538
|
alias: "ckDialogClose"
|
|
808
539
|
});
|
|
809
|
-
ref = inject(CkDialogRef, { optional: true });
|
|
540
|
+
ref = inject(CkDialogRef$1, { optional: true });
|
|
810
541
|
constructor() {
|
|
811
542
|
const element = inject(ElementRef).nativeElement;
|
|
812
543
|
if (element.tagName === "BUTTON" && !element.hasAttribute("type")) inject(Renderer2).setAttribute(element, "type", "button");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ckui-core-dialog.mjs","names":[],"sources":["../../../../projects/core/dialog/config.ts","../../../../projects/core/dialog/dialog-context.ts","../../../../projects/core/dialog/dialog-ref.ts","../../../../projects/core/dialog/dialog-container.ts","../../../../projects/core/dialog/dialog.service.ts","../../../../projects/core/dialog/dialog.component.ts","../../../../projects/core/dialog/dialog-parts.ts","../../../../projects/core/dialog/index.ts"],"sourcesContent":["import { InjectionToken, Injector } from '@angular/core';\n\nexport type CkDialogRole = 'dialog' | 'alertdialog';\n/** Largest inline size of a modal dialog: 24, 32 or 48rem. */\nexport type CkDialogWidth = 'sm' | 'md' | 'lg';\n/** `auto` opens a sheet on a narrow screen with a coarse pointer, a centred modal otherwise. */\nexport type CkDialogMode = 'auto' | 'modal' | 'sheet';\n\nexport interface CkDialogConfig<D = unknown> {\n /** What the content gets from `inject(CK_DIALOG_DATA)`. */\n data?: D;\n /** `alertdialog` for a message the user has to answer. Default `dialog`. */\n role?: CkDialogRole;\n /** Default `md`. Under a sheet the dialog is as wide as the screen. */\n width?: CkDialogWidth;\n /** Escape, a click on the backdrop and a swipe down close the dialog. Default `true`. */\n dismissible?: boolean;\n /** Shows the close button next to the title. Default `true`. */\n closeButton?: boolean;\n /** Default `auto`, decided at the moment the dialog opens. */\n mode?: CkDialogMode;\n /** A sheet as tall as the screen allows instead of as tall as its content. Default `false`. */\n fullHeight?: boolean;\n /**\n * The parent injector of a component's content, for providers the app root doesn't have (route\n * level, or the opener's own): pass `inject(Injector)` from the opener. `CK_DIALOG_DATA` and\n * `CkDialogRef` are provided on top. Template content keeps the injector of its template.\n */\n injector?: Injector;\n /** The accessible name when the content has no `ckDialogTitle`. */\n ariaLabel?: string;\n}\n\n/** The `data` of the config, for a dialog opened with a component. */\nexport const CK_DIALOG_DATA = new InjectionToken<unknown>('CK_DIALOG_DATA');\n","import { InjectionToken, Signal, computed, signal } from '@angular/core';\nimport { CkDialogMode } from './config';\n\n/** The ids of every title (or description) in the dialog; the newest one names it. */\nexport class CkDialogIds {\n private readonly entries = signal<readonly Signal<string>[]>([]);\n readonly current = computed(() => this.entries().at(-1)?.() ?? null);\n\n /** Returns the function that takes the entry out again; it leaves the others alone. */\n add(id: Signal<string>): () => void {\n this.entries.update((entries) => [...entries, id]);\n return () => this.entries.update((entries) => entries.filter((entry) => entry !== id));\n }\n}\n\n/** What the building blocks inside a dialog tell the dialog: the ids that name it. */\nexport class CkDialogContext {\n readonly titles = new CkDialogIds();\n readonly descriptions = new CkDialogIds();\n readonly titleId = this.titles.current;\n readonly descriptionId = this.descriptions.current;\n /** Resolved when the dialog opens. */\n readonly mode = signal<Exclude<CkDialogMode, 'auto'>>('modal');\n}\n\nexport const CK_DIALOG_CONTEXT = new InjectionToken<CkDialogContext>('CK_DIALOG_CONTEXT');\n","/** What a `CkDialogRef` calls into; supplied by `CkDialog`, not by consumers. */\nexport interface CkDialogRefControls<R> {\n readonly closing: Promise<void>;\n readonly closed: Promise<R | undefined>;\n close(result: R | undefined): void;\n}\n\n/** Controls one open dialog. Returned by `CkDialog.open`, injected by its content; never constructed directly. */\nexport class CkDialogRef<R = unknown> {\n /**\n * Resolves once, after the dialog has left the screen, with the result of the first `close()`.\n * Escape, a click on the backdrop and a swipe resolve it with `undefined`, and so does destroying\n * the app.\n */\n readonly closed: Promise<R | undefined>;\n /**\n * Resolves once, the moment the dialog starts to close (before the leave animation), whatever\n * the cause. `closed` follows when it has left the screen.\n */\n readonly closing: Promise<void>;\n private readonly controls: CkDialogRefControls<R>;\n\n constructor(controls: CkDialogRefControls<R>) {\n this.controls = controls;\n this.closed = controls.closed;\n this.closing = controls.closing;\n }\n\n /** Closes the dialog. Only the first call counts; later ones, with another result too, do nothing. */\n close(result?: R): void {\n this.controls.close(result);\n }\n}\n","import { CdkPortalOutlet, ComponentPortal, Portal, TemplatePortal } from '@angular/cdk/portal';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n EmbeddedViewRef,\n InjectionToken,\n Injector,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { CK_LABELS } from '@ckui/core';\nimport { CkButton } from '@ckui/core/button';\nimport { CkIcon } from '@ckui/core/internal';\nimport { CK_DIALOG_CONTEXT } from './dialog-context';\nimport { CkDialogRef } from './dialog-ref';\n\n/** What the service hands the container: the consumer's content and the parts of the config it shows. */\nexport interface CkDialogContainerSetup {\n readonly content: ComponentType<unknown> | TemplateRef<unknown>;\n readonly closeButton: boolean;\n readonly dismissible: boolean;\n}\n\nexport const CK_DIALOG_SETUP = new InjectionToken<CkDialogContainerSetup>('CK_DIALOG_SETUP');\n\n/** The dialog's own element inside the overlay: the padding, the close button and the consumer's content. */\n@Component({\n selector: 'ck-dialog-container',\n imports: [CdkPortalOutlet, CkButton, CkIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'ck-dialog',\n '[class.ck-dialog--sheet]': 'context.mode() === \"sheet\"',\n '[class.ck-dialog--grab]': 'context.mode() === \"sheet\" && setup.dismissible',\n '[class.ck-dialog--has-close]': 'setup.closeButton',\n '[class.ck-dialog--no-title]': 'context.titleId() === null',\n },\n template: `\n <div class=\"ck-dialog__content\">\n <ng-template [cdkPortalOutlet]=\"portal\" (attached)=\"onAttached($event)\" />\n </div>\n @if (setup.closeButton) {\n <button\n ckButton\n type=\"button\"\n variant=\"ghost\"\n size=\"md\"\n iconOnly\n class=\"ck-dialog__close\"\n [attr.aria-label]=\"labels().close\"\n (click)=\"ref.close()\"\n >\n <ck-icon name=\"close\" />\n </button>\n }\n `,\n styleUrl: './dialog.css',\n})\nexport class CkDialogContainer {\n protected readonly context = inject(CK_DIALOG_CONTEXT);\n protected readonly setup = inject(CK_DIALOG_SETUP);\n protected readonly labels = inject(CK_LABELS);\n protected readonly ref = inject(CkDialogRef);\n\n protected readonly portal: Portal<unknown>;\n\n constructor() {\n const injector = inject(Injector);\n this.portal =\n this.setup.content instanceof TemplateRef\n ? new TemplatePortal(this.setup.content, inject(ViewContainerRef), undefined, injector)\n : new ComponentPortal(this.setup.content, null, injector);\n }\n\n /** A component's host element has to be a flex column too, or its body could not scroll. */\n protected onAttached(attached: ComponentRef<unknown> | EmbeddedViewRef<unknown> | null): void {\n if (attached && 'location' in attached) {\n (attached.location.nativeElement as HTMLElement).classList.add('ck-dialog__component');\n }\n }\n}\n","import { ComponentType } from '@angular/cdk/portal';\nimport { InteractivityChecker } from '@angular/cdk/a11y';\nimport {\n DestroyRef,\n EffectRef,\n Injectable,\n Injector,\n TemplateRef,\n effect,\n inject,\n} from '@angular/core';\nimport { CkOverlayHandle, CkOverlayHost } from '@ckui/core/internal/overlay';\nimport { CK_DIALOG_DATA, CkDialogConfig } from './config';\nimport { CK_DIALOG_CONTEXT, CkDialogContext } from './dialog-context';\nimport { CK_DIALOG_SETUP, CkDialogContainer } from './dialog-container';\nimport { CkDialogRef } from './dialog-ref';\n\ndeclare const ngDevMode: unknown;\n\nconst TABBABLE_CANDIDATES =\n 'a[href], button, input, select, textarea, summary, [tabindex], [contenteditable], audio[controls], video[controls]';\n\ninterface ActiveDialog {\n close(): void;\n /** Settles the result promise and stops everything that outlives the overlay. */\n destroy(): void;\n}\n\n/**\n * Opens modal dialogs, which become bottom sheets on a phone. Takes a component or a template as\n * content and returns a `CkDialogRef` that closes it and delivers the result.\n */\n@Injectable({ providedIn: 'root' })\nexport class CkDialog {\n private readonly overlay = inject(CkOverlayHost);\n private readonly checker = inject(InteractivityChecker);\n private readonly injector = inject(Injector);\n private readonly active = new Set<ActiveDialog>();\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n for (const dialog of [...this.active]) {\n dialog.destroy();\n }\n this.active.clear();\n });\n }\n\n /**\n * Opens a dialog. The content injects `CK_DIALOG_DATA` and `CkDialogRef`; a component sees the\n * app's providers, plus those of `config.injector` when given. On the server nothing is shown and\n * `closed` resolves with `undefined` at once.\n */\n open<C, D = unknown, R = unknown>(\n content: ComponentType<C> | TemplateRef<unknown>,\n config: CkDialogConfig<D> = {},\n ): CkDialogRef<R> {\n const dismissible = config.dismissible ?? true;\n const closeButton = config.closeButton ?? true;\n const context = new CkDialogContext();\n\n let resolveClosed: (result: R | undefined) => void = () => undefined;\n const closed = new Promise<R | undefined>((resolve) => (resolveClosed = resolve));\n let resolveClosing: () => void = () => undefined;\n const closing = new Promise<void>((resolve) => (resolveClosing = resolve));\n let handle: CkOverlayHandle | null = null;\n let requested = false;\n let result: R | undefined;\n let settled = false;\n let labelling: EffectRef | null = null;\n const dialog: ActiveDialog = { close: () => ref.close(), destroy: () => settle() };\n\n const settle = (): void => {\n if (settled) {\n return;\n }\n settled = true;\n resolveClosing();\n labelling?.destroy();\n this.active.delete(dialog);\n resolveClosed(result);\n };\n\n const ref = new CkDialogRef<R>({\n closed,\n closing,\n close: (value) => {\n if (requested) {\n return;\n }\n requested = true;\n result = value;\n resolveClosing();\n // Closed from the content's constructor, before the overlay exists: it closes right after opening.\n void handle?.close();\n },\n });\n\n this.active.add(dialog);\n\n const dialogInjector = Injector.create({\n parent: config.injector ?? this.injector,\n providers: [\n { provide: CK_DIALOG_CONTEXT, useValue: context },\n { provide: CkDialogRef, useValue: ref },\n { provide: CK_DIALOG_DATA, useValue: config.data },\n {\n provide: CK_DIALOG_SETUP,\n useValue: { content, closeButton, dismissible },\n },\n ],\n });\n\n try {\n handle = this.overlay.open(\n CkDialogContainer,\n {\n mode: config.mode ?? 'auto',\n dismissible,\n fullHeight: config.fullHeight ?? false,\n role: config.role ?? 'dialog',\n ariaLabel: config.ariaLabel,\n panelClass: ['ck-dialog-panel', `ck-dialog-panel--${config.width ?? 'md'}`],\n onDismissRequest: () => ref.close(),\n initialFocus: () => (handle ? this.initialFocus(handle.panel) : null),\n },\n dialogInjector,\n );\n } catch (error) {\n settle();\n throw error;\n }\n\n const opened = handle;\n context.mode.set(opened.mode);\n labelling = effect(\n () => {\n this.setAttribute(opened.panel, 'aria-labelledby', context.titleId());\n this.setAttribute(opened.panel, 'aria-describedby', context.descriptionId());\n },\n { injector: this.injector },\n );\n void opened.closed.then(settle);\n if (requested) {\n void opened.close();\n }\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n void opened.opened.then(() => {\n if (!settled && context.titleId() === null && !config.ariaLabel) {\n console.warn(\n 'CkDialog: the dialog has no accessible name. Add [ckDialogTitle] to a heading in its content or set `ariaLabel` in the config.',\n );\n }\n });\n }\n return ref;\n }\n\n /** Closes every open dialog as if each one's `close()` had been called without a result. */\n closeAll(): void {\n for (const dialog of [...this.active]) {\n dialog.close();\n }\n }\n\n private setAttribute(element: HTMLElement, name: string, value: string | null): void {\n if (value === null) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value);\n }\n }\n\n /**\n * The marked element, else the first tabbable one of the content (the close button comes last in\n * the DOM, and the scrolling body itself is skipped), else the panel.\n */\n private initialFocus(panel: HTMLElement): HTMLElement {\n const marked = Array.from(\n panel.querySelectorAll<HTMLElement>('[data-ck-dialog-initial-focus]'),\n ).find((candidate) => this.checker.isFocusable(candidate));\n if (marked) {\n return marked;\n }\n const content = panel.querySelector<HTMLElement>('.ck-dialog__content');\n const first = Array.from(\n content?.querySelectorAll<HTMLElement>(TABBABLE_CANDIDATES) ?? [],\n ).find(\n (candidate) =>\n !candidate.classList.contains('ck-dialog-body') && this.checker.isTabbable(candidate),\n );\n return first ?? panel;\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n contentChild,\n inject,\n input,\n model,\n output,\n untracked,\n} from '@angular/core';\nimport { CkDialogMode, CkDialogRole, CkDialogWidth } from './config';\nimport { CkDialogRef } from './dialog-ref';\nimport { CkDialog } from './dialog.service';\n\ndeclare const ngDevMode: unknown;\n\n/**\n * A dialog declared in a template. Its content is one `<ng-template>` that is only rendered while\n * `open` is true, so nothing in it exists while the dialog is closed. `[(open)]` follows the dialog:\n * Escape, the backdrop, the close button and `[ckDialogClose]` set it back to `false`.\n */\n@Component({\n selector: 'ck-dialog',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display: none' },\n template: ``,\n})\nexport class CkDialogComponent {\n readonly open = model(false);\n readonly role = input<CkDialogRole>('dialog');\n readonly width = input<CkDialogWidth>('md');\n readonly dismissible = input(true, { transform: booleanAttribute });\n readonly closeButton = input(true, { transform: booleanAttribute });\n readonly mode = input<CkDialogMode>('auto');\n readonly fullHeight = input(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n /** Emits when the dialog has left the screen, with the result of `[ckDialogClose]`, else `undefined`. */\n readonly closed = output<unknown>();\n\n private readonly template = contentChild(TemplateRef);\n private readonly dialog = inject(CkDialog);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private ref: CkDialogRef | null = null;\n private destroyed = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.ref?.close();\n this.ref = null;\n });\n // After render: never on the server, and never while a template is being checked.\n afterRenderEffect(() => {\n const wanted = this.open();\n if (!this.isBrowser) {\n return;\n }\n untracked(() => this.sync(wanted));\n });\n }\n\n private sync(wanted: boolean): void {\n if (wanted && !this.ref) {\n this.show();\n } else if (!wanted && this.ref) {\n const ref = this.ref;\n this.ref = null;\n ref.close();\n }\n }\n\n private show(): void {\n const template = this.template();\n if (!template) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n console.warn('ck-dialog: put the content in an <ng-template> inside the element.');\n }\n this.open.set(false);\n return;\n }\n const ref = this.dialog.open(template, {\n role: this.role(),\n width: this.width(),\n dismissible: this.dismissible(),\n closeButton: this.closeButton(),\n mode: this.mode(),\n fullHeight: this.fullHeight(),\n ariaLabel: this.ariaLabel(),\n });\n this.ref = ref;\n // `open` follows the moment the close starts, so the opener can reopen during the leave animation.\n void ref.closing.then(() => {\n if (!this.destroyed && this.ref === ref) {\n this.ref = null;\n this.open.set(false);\n }\n });\n void ref.closed.then((result) => {\n if (!this.destroyed) {\n this.closed.emit(result);\n }\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n ElementRef,\n PLATFORM_ID,\n Renderer2,\n ViewEncapsulation,\n afterNextRender,\n inject,\n input,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { createCkId } from '@ckui/core/internal';\nimport { CK_DIALOG_CONTEXT } from './dialog-context';\nimport { CkDialogRef } from './dialog-ref';\n\n/** Marks a heading as the title of the dialog: it names the dialog (`aria-labelledby`). */\n@Directive({\n selector: '[ckDialogTitle]',\n host: { class: 'ck-dialog__title', '[attr.id]': 'id()' },\n})\nexport class CkDialogTitle {\n /** Default: a generated id. */\n readonly id = input(createCkId('ck-dialog-title'));\n\n constructor() {\n const context = inject(CK_DIALOG_CONTEXT, { optional: true });\n if (context) {\n const remove = untracked(() => context.titles.add(this.id));\n inject(DestroyRef).onDestroy(() => untracked(remove));\n }\n }\n}\n\n/** Marks the text that explains the dialog: it describes it (`aria-describedby`). */\n@Directive({\n selector: '[ckDialogDescription]',\n host: { class: 'ck-dialog__description', '[attr.id]': 'id()' },\n})\nexport class CkDialogDescription {\n /** Default: a generated id. */\n readonly id = input(createCkId('ck-dialog-description'));\n\n constructor() {\n const context = inject(CK_DIALOG_CONTEXT, { optional: true });\n if (context) {\n const remove = untracked(() => context.descriptions.add(this.id));\n inject(DestroyRef).onDestroy(() => untracked(remove));\n }\n }\n}\n\n/** The part of a dialog that scrolls when the content is taller than the screen. */\n@Component({\n selector: 'ck-dialog-body',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'ck-dialog-body' },\n template: `<div class=\"ck-dialog-body__inner\"><ng-content /></div>`,\n})\nexport class CkDialogBody {\n constructor() {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const renderer = inject(Renderer2);\n const destroyRef = inject(DestroyRef);\n let ownTabindex = false;\n\n // A region that scrolls must be reachable by keyboard, but only while it actually scrolls.\n const update = (): void => {\n const scrolls = element.scrollHeight > element.clientHeight + 1;\n if (scrolls && !element.hasAttribute('tabindex')) {\n renderer.setAttribute(element, 'tabindex', '0');\n ownTabindex = true;\n } else if (!scrolls && ownTabindex) {\n renderer.removeAttribute(element, 'tabindex');\n ownTabindex = false;\n }\n };\n\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n afterNextRender(() => {\n const Observer = element.ownerDocument.defaultView?.ResizeObserver;\n if (!Observer || destroyRef.destroyed) {\n return;\n }\n const observer = new Observer(update);\n observer.observe(element);\n observer.observe(element.firstElementChild!);\n destroyRef.onDestroy(() => observer.disconnect());\n update();\n });\n }\n }\n}\n\n/** The row of buttons at the bottom of a dialog. On a sheet they stack and fill the width. */\n@Component({\n selector: 'ck-dialog-actions',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'ck-dialog-actions' },\n template: `<ng-content />`,\n})\nexport class CkDialogActions {}\n\n/** Closes the dialog with the bound value as its result when the element is clicked. */\n@Directive({\n selector: '[ckDialogClose]',\n host: { '(click)': 'close()' },\n})\nexport class CkDialogClose<R = unknown> {\n /** The result of the dialog; empty means `undefined`. */\n readonly result = input<R | '' | undefined>(undefined, { alias: 'ckDialogClose' });\n\n private readonly ref = inject<CkDialogRef<R>>(CkDialogRef, { optional: true });\n\n constructor() {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n // A native button in a form would submit it.\n if (element.tagName === 'BUTTON' && !element.hasAttribute('type')) {\n inject(Renderer2).setAttribute(element, 'type', 'button');\n }\n }\n\n protected close(): void {\n const result = this.result();\n this.ref?.close(result === '' ? undefined : result);\n }\n}\n\n/** Takes focus when the dialog opens, e.g. the least destructive action of an `alertdialog`. */\n@Directive({\n selector: '[ckDialogInitialFocus]',\n host: { 'data-ck-dialog-initial-focus': '' },\n})\nexport class CkDialogInitialFocus {}\n","import { CkDialogComponent } from './dialog.component';\nimport {\n CkDialogActions,\n CkDialogBody,\n CkDialogClose,\n CkDialogDescription,\n CkDialogInitialFocus,\n CkDialogTitle,\n} from './dialog-parts';\n\nexport type { CkDialogConfig, CkDialogMode, CkDialogRole, CkDialogWidth } from './config';\nexport { CK_DIALOG_DATA } from './config';\nexport { CkDialogRef } from './dialog-ref';\nexport { CkDialog } from './dialog.service';\nexport { CkDialogComponent } from './dialog.component';\nexport {\n CkDialogActions,\n CkDialogBody,\n CkDialogClose,\n CkDialogDescription,\n CkDialogInitialFocus,\n CkDialogTitle,\n} from './dialog-parts';\n\n/** Everything a template needs for a dialog: `imports: [CK_DIALOG_IMPORTS]`. */\nexport const CK_DIALOG_IMPORTS = [\n CkDialogComponent,\n CkDialogTitle,\n CkDialogDescription,\n CkDialogBody,\n CkDialogActions,\n CkDialogClose,\n CkDialogInitialFocus,\n] as const;\n"],"mappings":";;;;;;;;;AAkCA,MAAa,iBAAiB,IAAI,eAAwB,gBAAgB;AC9B1E,IAAa,cAAb,MAAwB;CACL,UAAU,OAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvD,UAAU,eAAe,KAAK,QAAO,CAAE,CAAC,GAAG,EAAE,CAAC,GAAE,KAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAGpE,IAAI,IAAkB;EACpB,KAAK,QAAQ,QAAQ,YAAY,CAAC,GAAG,SAAS,EAAE,CAAC;EACjD,aA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ACT,UAAU;GACV,MAAM,EAAE,WAAW,UAAS;EAC7B,CAAA;;;;;;;;;;;;AA0BD,IAAa,uBAAb,MAAa,qBAAoB;CAApB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAoB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAApB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAoB,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,YAAA,EAAA,gCAAA,GAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAApB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EAJhC,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,gCAAgC,GAAE;EAC3C,CAAA;;;AChHD,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;AACQ"}
|
|
1
|
+
{"version":3,"file":"ckui-core-dialog.mjs","names":["CkDialogRef"],"sources":["../../../../projects/core/dialog/dialog.service.ts","../../../../projects/core/dialog/dialog.component.ts","../../../../projects/core/dialog/dialog-parts.ts","../../../../projects/core/dialog/index.ts"],"sourcesContent":["import { ComponentType } from '@angular/cdk/portal';\nimport { Injectable, TemplateRef } from '@angular/core';\nimport { CkDialogOpener, CkDialogRef } from '@ckui/core/internal/dialog';\nimport { CkDialogConfig } from './config';\n\n/**\n * Opens modal dialogs, which become bottom sheets on a phone. Takes a component or a template as\n * content and returns a `CkDialogRef` that closes it and delivers the result.\n */\n@Injectable({ providedIn: 'root' })\nexport class CkDialog {\n private readonly opener = new CkDialogOpener();\n\n /**\n * Opens a dialog. The content injects `CK_DIALOG_DATA` and `CkDialogRef`; a component sees the\n * app's providers, plus those of `config.injector` when given. On the server nothing is shown and\n * `closed` resolves with `undefined` at once.\n */\n open<C, D = unknown, R = unknown>(\n content: ComponentType<C> | TemplateRef<unknown>,\n config: CkDialogConfig<D> = {},\n ): CkDialogRef<R> {\n return this.opener.open<C, D, R>(content, {\n kind: 'CkDialog',\n mode: config.mode ?? 'auto',\n data: config.data,\n role: config.role ?? 'dialog',\n dismissible: config.dismissible ?? true,\n closeButton: config.closeButton ?? true,\n fullHeight: config.fullHeight ?? false,\n injector: config.injector,\n ariaLabel: config.ariaLabel,\n panelClass: ['ck-dialog-panel', `ck-dialog-panel--${config.width ?? 'md'}`],\n });\n }\n\n /** Closes every open dialog as if each one's `close()` had been called without a result. */\n closeAll(): void {\n this.opener.closeAll();\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n contentChild,\n inject,\n input,\n model,\n output,\n untracked,\n} from '@angular/core';\nimport { CkDialogRef } from '@ckui/core/internal/dialog';\nimport { CkDialogMode, CkDialogRole, CkDialogWidth } from './config';\nimport { CkDialog } from './dialog.service';\n\ndeclare const ngDevMode: unknown;\n\n/**\n * A dialog declared in a template. Its content is one `<ng-template>` that is only rendered while\n * `open` is true, so nothing in it exists while the dialog is closed. `[(open)]` follows the dialog:\n * Escape, the backdrop, the close button and `[ckDialogClose]` set it back to `false`.\n */\n@Component({\n selector: 'ck-dialog',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display: none' },\n template: ``,\n})\nexport class CkDialogComponent {\n readonly open = model(false);\n readonly role = input<CkDialogRole>('dialog');\n readonly width = input<CkDialogWidth>('md');\n readonly dismissible = input(true, { transform: booleanAttribute });\n readonly closeButton = input(true, { transform: booleanAttribute });\n readonly mode = input<CkDialogMode>('auto');\n readonly fullHeight = input(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n /** Emits when the dialog has left the screen, with the result of `[ckDialogClose]`, else `undefined`. */\n readonly closed = output<unknown>();\n\n private readonly template = contentChild(TemplateRef);\n private readonly dialog = inject(CkDialog);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private ref: CkDialogRef | null = null;\n private destroyed = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.ref?.close();\n this.ref = null;\n });\n // After render: never on the server, and never while a template is being checked.\n afterRenderEffect(() => {\n const wanted = this.open();\n if (!this.isBrowser) {\n return;\n }\n untracked(() => this.sync(wanted));\n });\n }\n\n private sync(wanted: boolean): void {\n if (wanted && !this.ref) {\n this.show();\n } else if (!wanted && this.ref) {\n const ref = this.ref;\n this.ref = null;\n ref.close();\n }\n }\n\n private show(): void {\n const template = this.template();\n if (!template) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n console.warn('ck-dialog: put the content in an <ng-template> inside the element.');\n }\n this.open.set(false);\n return;\n }\n const ref = this.dialog.open(template, {\n role: this.role(),\n width: this.width(),\n dismissible: this.dismissible(),\n closeButton: this.closeButton(),\n mode: this.mode(),\n fullHeight: this.fullHeight(),\n ariaLabel: this.ariaLabel(),\n });\n this.ref = ref;\n // `open` follows the moment the close starts, so the opener can reopen during the leave animation.\n void ref.closing.then(() => {\n if (!this.destroyed && this.ref === ref) {\n this.ref = null;\n this.open.set(false);\n }\n });\n void ref.closed.then((result) => {\n if (!this.destroyed) {\n this.closed.emit(result);\n }\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n ElementRef,\n PLATFORM_ID,\n Renderer2,\n ViewEncapsulation,\n afterNextRender,\n inject,\n input,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { createCkId } from '@ckui/core/internal';\nimport { CK_DIALOG_CONTEXT, CkDialogRef } from '@ckui/core/internal/dialog';\n\n/** Marks a heading as the title of the dialog: it names the dialog (`aria-labelledby`). */\n@Directive({\n selector: '[ckDialogTitle]',\n host: { class: 'ck-dialog__title', '[attr.id]': 'id()' },\n})\nexport class CkDialogTitle {\n /** Default: a generated id. */\n readonly id = input(createCkId('ck-dialog-title'));\n\n constructor() {\n const context = inject(CK_DIALOG_CONTEXT, { optional: true });\n if (context) {\n const remove = untracked(() => context.titles.add(this.id));\n inject(DestroyRef).onDestroy(() => untracked(remove));\n }\n }\n}\n\n/** Marks the text that explains the dialog: it describes it (`aria-describedby`). */\n@Directive({\n selector: '[ckDialogDescription]',\n host: { class: 'ck-dialog__description', '[attr.id]': 'id()' },\n})\nexport class CkDialogDescription {\n /** Default: a generated id. */\n readonly id = input(createCkId('ck-dialog-description'));\n\n constructor() {\n const context = inject(CK_DIALOG_CONTEXT, { optional: true });\n if (context) {\n const remove = untracked(() => context.descriptions.add(this.id));\n inject(DestroyRef).onDestroy(() => untracked(remove));\n }\n }\n}\n\n/** The part of a dialog that scrolls when the content is taller than the screen. */\n@Component({\n selector: 'ck-dialog-body',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'ck-dialog-body' },\n template: `<div class=\"ck-dialog-body__inner\"><ng-content /></div>`,\n})\nexport class CkDialogBody {\n constructor() {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const renderer = inject(Renderer2);\n const destroyRef = inject(DestroyRef);\n let ownTabindex = false;\n\n // A region that scrolls must be reachable by keyboard, but only while it actually scrolls.\n const update = (): void => {\n const scrolls = element.scrollHeight > element.clientHeight + 1;\n if (scrolls && !element.hasAttribute('tabindex')) {\n renderer.setAttribute(element, 'tabindex', '0');\n ownTabindex = true;\n } else if (!scrolls && ownTabindex) {\n renderer.removeAttribute(element, 'tabindex');\n ownTabindex = false;\n }\n };\n\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n afterNextRender(() => {\n const Observer = element.ownerDocument.defaultView?.ResizeObserver;\n if (!Observer || destroyRef.destroyed) {\n return;\n }\n const observer = new Observer(update);\n observer.observe(element);\n observer.observe(element.firstElementChild!);\n destroyRef.onDestroy(() => observer.disconnect());\n update();\n });\n }\n }\n}\n\n/** The row of buttons at the bottom of a dialog. On a sheet they stack and fill the width. */\n@Component({\n selector: 'ck-dialog-actions',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'ck-dialog-actions' },\n template: `<ng-content />`,\n})\nexport class CkDialogActions {}\n\n/** Closes the dialog with the bound value as its result when the element is clicked. */\n@Directive({\n selector: '[ckDialogClose]',\n host: { '(click)': 'close()' },\n})\nexport class CkDialogClose<R = unknown> {\n /** The result of the dialog; empty means `undefined`. */\n readonly result = input<R | '' | undefined>(undefined, { alias: 'ckDialogClose' });\n\n private readonly ref = inject<CkDialogRef<R>>(CkDialogRef, { optional: true });\n\n constructor() {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n // A native button in a form would submit it.\n if (element.tagName === 'BUTTON' && !element.hasAttribute('type')) {\n inject(Renderer2).setAttribute(element, 'type', 'button');\n }\n }\n\n protected close(): void {\n const result = this.result();\n this.ref?.close(result === '' ? undefined : result);\n }\n}\n\n/** Takes focus when the dialog opens, e.g. the least destructive action of an `alertdialog`. */\n@Directive({\n selector: '[ckDialogInitialFocus]',\n host: { 'data-ck-dialog-initial-focus': '' },\n})\nexport class CkDialogInitialFocus {}\n","import { CkDialogComponent } from './dialog.component';\nimport {\n CkDialogActions,\n CkDialogBody,\n CkDialogClose,\n CkDialogDescription,\n CkDialogInitialFocus,\n CkDialogTitle,\n} from './dialog-parts';\n\nexport type { CkDialogConfig, CkDialogMode, CkDialogRole, CkDialogWidth } from './config';\nexport { CK_DIALOG_DATA, CkDialogRef } from '@ckui/core/internal/dialog';\nexport { CkDialog } from './dialog.service';\nexport { CkDialogComponent } from './dialog.component';\nexport {\n CkDialogActions,\n CkDialogBody,\n CkDialogClose,\n CkDialogDescription,\n CkDialogInitialFocus,\n CkDialogTitle,\n} from './dialog-parts';\n\n/** Everything a template needs for a dialog: `imports: [CK_DIALOG_IMPORTS]`. */\nexport const CK_DIALOG_IMPORTS = [\n CkDialogComponent,\n CkDialogTitle,\n CkDialogDescription,\n CkDialogBody,\n CkDialogActions,\n CkDialogClose,\n CkDialogInitialFocus,\n] as const;\n"],"mappings":";;;;;AAUA,IAAa,WAAb,MAAa,SAAQ;CACF,SAAS,IAAI,eAAc;CAO5C,KACE,SACA,SAA4B,CAAA,GAAE;EAE9B,OAAO,KAAK,OAAO,KAAc,SAAS;GACxC,MAAM;GACN,MAAM,OAAO,QAAQ;GACrB,MAAM,OAAO;GACb,MAAM,OAAO,QAAQ;GACrB,aAAa,OAAO,eAAe;GACnC,aAAa,OAAO,eAAe;GACnC,YAAY,OAAO,cAAc;GACjC,UAAU,OAAO;GACjB,WAAW,OAAO;GAClB,YAAY,CAAC,mBAAmB,oBAAoB,OAAO,SAAS,MAAM;EAC3E,CAAA;CACH;CAGA,WAAQ;EACN,KAAK,OAAO,SAAQ;CACtB;CA7BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,YADK;CAAM,CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EADpB,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;AC0BlC,IAAa,oBAAb,MAAa,kBAAiB;CACnB,OAAO,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACnB,OAAO,MAAoB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,QAAQ,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CA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