@molecule/app-ui-angular 1.4.2 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +987 -1015
- package/dist/components/alert.component.d.ts +11 -16
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +22 -51
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +36 -28
- package/dist/components/auth-guard.component.d.ts.map +1 -1
- package/dist/components/auth-guard.component.js +59 -67
- package/dist/components/auth-guard.component.js.map +1 -1
- package/dist/components/avatar.component.d.ts +13 -10
- package/dist/components/avatar.component.d.ts.map +1 -1
- package/dist/components/avatar.component.js +27 -25
- package/dist/components/avatar.component.js.map +1 -1
- package/dist/components/button.component.d.ts +26 -30
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +41 -75
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/checkbox.component.d.ts +5 -4
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +14 -9
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +11 -28
- package/dist/components/confirm-button.component.d.ts.map +1 -1
- package/dist/components/confirm-button.component.js +31 -63
- package/dist/components/confirm-button.component.js.map +1 -1
- package/dist/components/confirm-dialog.component.d.ts +28 -17
- package/dist/components/confirm-dialog.component.d.ts.map +1 -1
- package/dist/components/confirm-dialog.component.js +98 -69
- package/dist/components/confirm-dialog.component.js.map +1 -1
- package/dist/components/dropdown.component.d.ts +29 -16
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +143 -105
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/empty-state.component.d.ts +10 -15
- package/dist/components/empty-state.component.d.ts.map +1 -1
- package/dist/components/empty-state.component.js +23 -27
- package/dist/components/empty-state.component.js.map +1 -1
- package/dist/components/form-field.component.d.ts +26 -11
- package/dist/components/form-field.component.d.ts.map +1 -1
- package/dist/components/form-field.component.js +86 -25
- package/dist/components/form-field.component.js.map +1 -1
- package/dist/components/input.component.d.ts +20 -23
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +45 -54
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/language-picker.component.d.ts +15 -18
- package/dist/components/language-picker.component.d.ts.map +1 -1
- package/dist/components/language-picker.component.js +25 -35
- package/dist/components/language-picker.component.js.map +1 -1
- package/dist/components/load-error-banner.component.d.ts +14 -26
- package/dist/components/load-error-banner.component.d.ts.map +1 -1
- package/dist/components/load-error-banner.component.js +28 -62
- package/dist/components/load-error-banner.component.js.map +1 -1
- package/dist/components/modal.component.d.ts +38 -21
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +55 -78
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/molecule/button.component.d.ts +13 -2
- package/dist/components/molecule/button.component.d.ts.map +1 -1
- package/dist/components/molecule/button.component.js +45 -15
- package/dist/components/molecule/button.component.js.map +1 -1
- package/dist/components/molecule/toast.component.d.ts +2 -1
- package/dist/components/molecule/toast.component.d.ts.map +1 -1
- package/dist/components/molecule/toast.component.js +9 -7
- package/dist/components/molecule/toast.component.js.map +1 -1
- package/dist/components/molecule/tooltip.component.d.ts +4 -2
- package/dist/components/molecule/tooltip.component.d.ts.map +1 -1
- package/dist/components/molecule/tooltip.component.js +19 -14
- package/dist/components/molecule/tooltip.component.js.map +1 -1
- package/dist/components/optimistic-toggle-button.component.d.ts +13 -25
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -1
- package/dist/components/optimistic-toggle-button.component.js +33 -63
- package/dist/components/optimistic-toggle-button.component.js.map +1 -1
- package/dist/components/page-header.component.d.ts +8 -13
- package/dist/components/page-header.component.d.ts.map +1 -1
- package/dist/components/page-header.component.js +16 -24
- package/dist/components/page-header.component.js.map +1 -1
- package/dist/components/page-shell.component.d.ts +8 -14
- package/dist/components/page-shell.component.d.ts.map +1 -1
- package/dist/components/page-shell.component.js +18 -28
- package/dist/components/page-shell.component.js.map +1 -1
- package/dist/components/panel-close.component.d.ts +14 -8
- package/dist/components/panel-close.component.d.ts.map +1 -1
- package/dist/components/panel-close.component.js +28 -17
- package/dist/components/panel-close.component.js.map +1 -1
- package/dist/components/prompt-dialog.component.d.ts +32 -10
- package/dist/components/prompt-dialog.component.d.ts.map +1 -1
- package/dist/components/prompt-dialog.component.js +110 -73
- package/dist/components/prompt-dialog.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +46 -41
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +138 -147
- package/dist/components/responsive-app-shell.component.js.map +1 -1
- package/dist/components/sidebar-user-card.component.d.ts +8 -12
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
- package/dist/components/sidebar-user-card.component.js +19 -35
- package/dist/components/sidebar-user-card.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +13 -8
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +29 -20
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +22 -14
- package/dist/components/table.component.d.ts.map +1 -1
- package/dist/components/table.component.js +34 -32
- package/dist/components/table.component.js.map +1 -1
- package/dist/components/toast.component.d.ts +34 -30
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +74 -84
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +27 -11
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +62 -47
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +18 -12
- package/dist/components/user-menu-popover.component.d.ts.map +1 -1
- package/dist/components/user-menu-popover.component.js +52 -77
- package/dist/components/user-menu-popover.component.js.map +1 -1
- package/dist/components/user-menu.component.d.ts +8 -11
- package/dist/components/user-menu.component.d.ts.map +1 -1
- package/dist/components/user-menu.component.js +19 -27
- package/dist/components/user-menu.component.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/utilities/dom-context.d.ts +62 -15
- package/dist/utilities/dom-context.d.ts.map +1 -1
- package/dist/utilities/dom-context.js +79 -34
- package/dist/utilities/dom-context.js.map +1 -1
- package/dist/utilities/form-field-context.d.ts +2 -0
- package/dist/utilities/form-field-context.d.ts.map +1 -1
- package/dist/utilities/form-field-context.js +4 -2
- package/dist/utilities/form-field-context.js.map +1 -1
- package/dist/utilities/node-value.d.ts +8 -0
- package/dist/utilities/node-value.d.ts.map +1 -1
- package/dist/utilities/node-value.js +10 -0
- package/dist/utilities/node-value.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +2 -2
- package/dist/utilities/rest-attrs.js +1 -1
- package/package.json +3 -3
|
@@ -4,22 +4,24 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { afterNextRender, Component, EventEmitter, inject, Injector, Output, signal, ViewChild, } from '@angular/core';
|
|
8
|
-
import { useTranslation } from '@molecule/app-angular';
|
|
7
|
+
import { afterNextRender, Component, ElementRef, EventEmitter, inject, Injector, Output, signal, ViewChild, } from '@angular/core';
|
|
8
|
+
import { MolPlacement, setElementPresent, setHostRoot, usePlacement, useTranslation, } from '@molecule/app-angular';
|
|
9
9
|
import { getClassMap } from '@molecule/app-ui';
|
|
10
10
|
import { nextInstanceId } from '../utilities/ids.js';
|
|
11
|
-
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
11
|
+
import { asTemplate, isGiven, nodeText, rendersNode } from '../utilities/node-value.js';
|
|
12
12
|
import { Button } from './button.component.js';
|
|
13
13
|
import { Input } from './input.component.js';
|
|
14
14
|
import { Modal } from './modal.component.js';
|
|
15
15
|
import { MolTemplateOutlet } from './template-outlet.directive.js';
|
|
16
16
|
import * as i0 from "@angular/core";
|
|
17
|
+
import * as i1 from "@molecule/app-angular";
|
|
17
18
|
const _c0 = ["titleSlot"];
|
|
18
|
-
const _c1 = ["
|
|
19
|
-
const _c2 = ["*", "
|
|
20
|
-
const _c3 =
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const _c1 = ["modal"];
|
|
20
|
+
const _c2 = ["*", [["", "slot", "title"]]];
|
|
21
|
+
const _c3 = ["*", "[slot=title]"];
|
|
22
|
+
const _c4 = () => ({ justify: "end", gap: "sm" });
|
|
23
|
+
function PromptDialog_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelementContainer(0, 9);
|
|
23
25
|
i0.ɵɵtext(1);
|
|
24
26
|
} if (rf & 2) {
|
|
25
27
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -27,12 +29,12 @@ function PromptDialog_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
27
29
|
i0.ɵɵadvance();
|
|
28
30
|
i0.ɵɵtextInterpolate1("", ctx_r0.nodeText(ctx_r0.title), " ");
|
|
29
31
|
} }
|
|
30
|
-
function
|
|
32
|
+
function PromptDialog_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
31
33
|
i0.ɵɵprojection(0, 1);
|
|
32
34
|
} }
|
|
33
|
-
function
|
|
35
|
+
function PromptDialog_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
34
36
|
i0.ɵɵelementStart(0, "p");
|
|
35
|
-
i0.ɵɵelementContainer(1,
|
|
37
|
+
i0.ɵɵelementContainer(1, 9);
|
|
36
38
|
i0.ɵɵelementEnd();
|
|
37
39
|
} if (rf & 2) {
|
|
38
40
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -41,16 +43,16 @@ function PromptDialog_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
41
43
|
i0.ɵɵadvance();
|
|
42
44
|
i0.ɵɵproperty("molTemplateOutlet", ctx);
|
|
43
45
|
} }
|
|
44
|
-
function
|
|
45
|
-
i0.ɵɵelement(0, "p",
|
|
46
|
+
function PromptDialog_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
i0.ɵɵelement(0, "p", 10);
|
|
46
48
|
} if (rf & 2) {
|
|
47
49
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
48
50
|
i0.ɵɵclassMap(ctx_r0.cm().textSize("sm"));
|
|
49
51
|
i0.ɵɵproperty("textContent", ctx_r0.nodeText(ctx_r0.description));
|
|
50
52
|
i0.ɵɵattribute("id", ctx_r0.descriptionId);
|
|
51
53
|
} }
|
|
52
|
-
function
|
|
53
|
-
i0.ɵɵelementContainer(0,
|
|
54
|
+
function PromptDialog_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
55
|
+
i0.ɵɵelementContainer(0, 9);
|
|
54
56
|
i0.ɵɵtext(1);
|
|
55
57
|
} if (rf & 2) {
|
|
56
58
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -58,14 +60,14 @@ function PromptDialog_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
|
58
60
|
i0.ɵɵadvance();
|
|
59
61
|
i0.ɵɵtextInterpolate1("", ctx_r0.nodeText(ctx_r0.cancelLabel), " ");
|
|
60
62
|
} }
|
|
61
|
-
function
|
|
63
|
+
function PromptDialog_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
62
64
|
i0.ɵɵtext(0);
|
|
63
65
|
} if (rf & 2) {
|
|
64
66
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
65
67
|
i0.ɵɵtextInterpolate1(" ", ctx_r0.cancelText(), " ");
|
|
66
68
|
} }
|
|
67
|
-
function
|
|
68
|
-
i0.ɵɵelementContainer(0,
|
|
69
|
+
function PromptDialog_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
70
|
+
i0.ɵɵelementContainer(0, 9);
|
|
69
71
|
i0.ɵɵtext(1);
|
|
70
72
|
} if (rf & 2) {
|
|
71
73
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -73,7 +75,7 @@ function PromptDialog_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
|
73
75
|
i0.ɵɵadvance();
|
|
74
76
|
i0.ɵɵtextInterpolate1("", ctx_r0.nodeText(ctx_r0.confirmLabel), " ");
|
|
75
77
|
} }
|
|
76
|
-
function
|
|
78
|
+
function PromptDialog_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
77
79
|
i0.ɵɵtext(0);
|
|
78
80
|
} if (rf & 2) {
|
|
79
81
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -84,8 +86,9 @@ function PromptDialog_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
|
84
86
|
*
|
|
85
87
|
* Composed from `Modal`, `Input` and `Button` exactly as React composes
|
|
86
88
|
* them. Resolving `onSubmit` closes the dialog and resets it; a rejection
|
|
87
|
-
* keeps it open with the value intact.
|
|
88
|
-
*
|
|
89
|
+
* keeps it open with the value intact. React's root is a `Modal`, which
|
|
90
|
+
* renders a portal while open and nothing while closed, so the host element
|
|
91
|
+
* leaves the page and the portal renders in `document.body`.
|
|
89
92
|
*/
|
|
90
93
|
export class PromptDialog {
|
|
91
94
|
/** Whether the dialog is open. */
|
|
@@ -121,16 +124,20 @@ export class PromptDialog {
|
|
|
121
124
|
nodeText = nodeText;
|
|
122
125
|
/** Whether a node-valued prop was given. */
|
|
123
126
|
isGiven = isGiven;
|
|
127
|
+
/** Whether a node-valued prop renders anything. */
|
|
128
|
+
rendersNode = rendersNode;
|
|
124
129
|
/** Fires when the dialog should close (escape, backdrop, cancel, a fulfilled submit). */
|
|
125
130
|
close = new EventEmitter();
|
|
126
131
|
/** The dialog heading element (its text seeds the input's aria-label). */
|
|
127
132
|
titleSlot;
|
|
128
133
|
/** The composed input (its native element receives React's aria-label). */
|
|
129
134
|
inputComponent;
|
|
135
|
+
/** The composed Modal's element: what the caller binds on this tag lands there, and Modal passes it to its dialog. */
|
|
136
|
+
modalElement;
|
|
130
137
|
/**
|
|
131
138
|
* Per-instance id of the rendered title heading, wired as the dialog's
|
|
132
|
-
* accessible name: the binding on `<mol-modal>`
|
|
133
|
-
*
|
|
139
|
+
* accessible name: the binding on `<mol-modal>` reaches the dialog `<div>`,
|
|
140
|
+
* React's `{...rest}` target (Modal names it with `setHostRoot`) —
|
|
134
141
|
* `aria-labelledby` pointing at the visible `<h2>` (WAI-ARIA dialog
|
|
135
142
|
* pattern; axe `aria-dialog-name`).
|
|
136
143
|
*/
|
|
@@ -141,6 +148,12 @@ export class PromptDialog {
|
|
|
141
148
|
* a reference to nothing fails axe `aria-valid-attr-value`).
|
|
142
149
|
*/
|
|
143
150
|
descriptionId = nextInstanceId();
|
|
151
|
+
/**
|
|
152
|
+
* The title heading's id, which the dialog's `aria-labelledby` points at, or null while the title
|
|
153
|
+
* renders nothing (React's `slot(title)`): a heading with no text names nothing.
|
|
154
|
+
*/
|
|
155
|
+
ariaLabelledBy = signal(null, /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
|
|
144
157
|
/** The current input value. */
|
|
145
158
|
value = signal('', /* @ts-ignore */
|
|
146
159
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
@@ -153,12 +166,25 @@ export class PromptDialog {
|
|
|
153
166
|
* does not).
|
|
154
167
|
*/
|
|
155
168
|
i18n = useTranslation();
|
|
169
|
+
host = inject(ElementRef);
|
|
156
170
|
lastOpen = false;
|
|
157
171
|
lastInitial = '';
|
|
158
172
|
/** Whether an open transition is waiting for the after-view input focus. */
|
|
159
173
|
pendingInputFocus = false;
|
|
160
174
|
/** Schedules the deferred focus from the view hook (outside an injection context). */
|
|
161
175
|
injector = inject(Injector);
|
|
176
|
+
/**
|
|
177
|
+
* Takes the host out of the page (React renders the composed `Modal`'s
|
|
178
|
+
* portal, nothing here); what the caller binds on the tag lands on the Modal.
|
|
179
|
+
*/
|
|
180
|
+
constructor() {
|
|
181
|
+
usePlacement((hasContent) => {
|
|
182
|
+
setElementPresent(this.host.nativeElement, false);
|
|
183
|
+
setHostRoot(this.host.nativeElement, this.modalElement?.nativeElement);
|
|
184
|
+
this.ariaLabelledBy.set(rendersNode(this.title) || hasContent(this.titleSlot?.nativeElement) ? this.titleId : null);
|
|
185
|
+
this.applyInputLabel(hasContent);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
162
188
|
/**
|
|
163
189
|
* The current class map.
|
|
164
190
|
* @returns The UIClassMap.
|
|
@@ -187,16 +213,24 @@ export class PromptDialog {
|
|
|
187
213
|
/**
|
|
188
214
|
* The input's accessible label: React uses the title when it is a plain
|
|
189
215
|
* string, otherwise the placeholder.
|
|
216
|
+
* @param hasContent - Reads the projected title.
|
|
190
217
|
* @returns The label, or null when React would render none.
|
|
191
218
|
*/
|
|
192
|
-
inputLabel() {
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
219
|
+
inputLabel(hasContent) {
|
|
220
|
+
const heading = this.titleSlot?.nativeElement;
|
|
221
|
+
// A given title renders in the heading itself; a projected one is read through the slot
|
|
222
|
+
// reader, which is current in the pass that added or removed it.
|
|
223
|
+
const nodes = isGiven(this.title)
|
|
224
|
+
? Array.from(heading?.childNodes ?? [])
|
|
225
|
+
: hasContent.nodes(heading);
|
|
226
|
+
const hasElement = nodes.some((node) => node.nodeType === Node.ELEMENT_NODE);
|
|
227
|
+
const text = nodes
|
|
228
|
+
.filter((node) => node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.TEXT_NODE)
|
|
229
|
+
.map((node) => node.textContent ?? '')
|
|
230
|
+
.join('')
|
|
231
|
+
.trim();
|
|
232
|
+
if (!hasElement && text)
|
|
233
|
+
return text;
|
|
200
234
|
return this.placeholder ?? null;
|
|
201
235
|
}
|
|
202
236
|
/**
|
|
@@ -205,7 +239,6 @@ export class PromptDialog {
|
|
|
205
239
|
* first) and moved focus into the dialog.
|
|
206
240
|
*/
|
|
207
241
|
ngAfterViewInit() {
|
|
208
|
-
this.applyInputLabel();
|
|
209
242
|
this.lastOpen = !!this.open;
|
|
210
243
|
this.lastInitial = this.initialValue ?? '';
|
|
211
244
|
if (this.open) {
|
|
@@ -236,7 +269,6 @@ export class PromptDialog {
|
|
|
236
269
|
*/
|
|
237
270
|
ngDoCheck() {
|
|
238
271
|
const open = !!this.open;
|
|
239
|
-
this.applyInputLabel();
|
|
240
272
|
if (open !== this.lastOpen || (open && this.initialValue !== this.lastInitial)) {
|
|
241
273
|
this.lastOpen = open;
|
|
242
274
|
this.lastInitial = this.initialValue ?? '';
|
|
@@ -256,14 +288,17 @@ export class PromptDialog {
|
|
|
256
288
|
this.inputComponent?.inputEl?.nativeElement.focus();
|
|
257
289
|
}
|
|
258
290
|
/**
|
|
259
|
-
* Applies React's `aria-label` to the inner input (it is a rest prop there
|
|
260
|
-
*
|
|
291
|
+
* Applies React's `aria-label` to the inner input (it is a rest prop there).
|
|
292
|
+
* Runs in the placement function, so a title slot added or removed is read
|
|
293
|
+
* in the same pass.
|
|
294
|
+
*
|
|
295
|
+
* @param hasContent - Reads the projected title.
|
|
261
296
|
*/
|
|
262
|
-
applyInputLabel() {
|
|
297
|
+
applyInputLabel(hasContent) {
|
|
263
298
|
const input = this.inputComponent?.inputEl?.nativeElement;
|
|
264
299
|
if (!input)
|
|
265
300
|
return;
|
|
266
|
-
const label = this.inputLabel();
|
|
301
|
+
const label = this.inputLabel(hasContent);
|
|
267
302
|
if (label === null)
|
|
268
303
|
input.removeAttribute('aria-label');
|
|
269
304
|
else
|
|
@@ -310,60 +345,61 @@ export class PromptDialog {
|
|
|
310
345
|
}
|
|
311
346
|
static ɵfac = function PromptDialog_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PromptDialog)(); };
|
|
312
347
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PromptDialog, selectors: [["mol-prompt-dialog"]], viewQuery: function PromptDialog_Query(rf, ctx) { if (rf & 1) {
|
|
313
|
-
i0.ɵɵviewQuery(_c0, 5)(Input, 5);
|
|
348
|
+
i0.ɵɵviewQuery(_c0, 5)(Input, 5)(_c1, 5, ElementRef);
|
|
314
349
|
} if (rf & 2) {
|
|
315
350
|
let _t;
|
|
316
351
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.titleSlot = _t.first);
|
|
317
352
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputComponent = _t.first);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
i0.ɵɵ
|
|
353
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.modalElement = _t.first);
|
|
354
|
+
} }, inputs: { open: "open", title: "title", description: "description", placeholder: "placeholder", initialValue: "initialValue", onSubmit: "onSubmit", confirmLabel: "confirmLabel", cancelLabel: "cancelLabel", destructive: "destructive", inputMolId: "inputMolId", confirmMolId: "confirmMolId", cancelMolId: "cancelMolId" }, outputs: { close: "close" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c3, decls: 19, vars: 28, consts: [["modal", ""], ["titleSlot", ""], [3, "close", "open"], [3, "submit"], [3, "class"], [3, "class", "textContent"], ["mol-input", "", 3, "change", "value", "placeholder", "disabled"], ["mol-button", "", 3, "click", "type", "variant", "disabled"], ["mol-button", "", 3, "type", "variant", "color", "disabled"], [3, "molTemplateOutlet"], [3, "textContent"]], template: function PromptDialog_Template(rf, ctx) { if (rf & 1) {
|
|
355
|
+
i0.ɵɵprojectionDef(_c2);
|
|
356
|
+
i0.ɵɵelementStart(0, "mol-modal", 2, 0);
|
|
321
357
|
i0.ɵɵlistener("close", function PromptDialog_Template_mol_modal_close_0_listener() { return ctx.onModalClose(); });
|
|
322
|
-
i0.ɵɵelementStart(
|
|
323
|
-
i0.ɵɵlistener("submit", function
|
|
324
|
-
i0.ɵɵelementStart(
|
|
325
|
-
i0.ɵɵconditionalCreate(
|
|
358
|
+
i0.ɵɵelementStart(2, "form", 3);
|
|
359
|
+
i0.ɵɵlistener("submit", function PromptDialog_Template_form_submit_2_listener($event) { return ctx.handleSubmit($event); });
|
|
360
|
+
i0.ɵɵelementStart(3, "div")(4, "h2", null, 1);
|
|
361
|
+
i0.ɵɵconditionalCreate(6, PromptDialog_Conditional_6_Template, 2, 2)(7, PromptDialog_Conditional_7_Template, 1, 0);
|
|
326
362
|
i0.ɵɵelementEnd();
|
|
327
|
-
i0.ɵɵconditionalCreate(
|
|
328
|
-
i0.ɵɵelementStart(
|
|
329
|
-
i0.ɵɵlistener("change", function
|
|
363
|
+
i0.ɵɵconditionalCreate(8, PromptDialog_Conditional_8_Template, 2, 4, "p", 4)(9, PromptDialog_Conditional_9_Template, 1, 4, "p", 5);
|
|
364
|
+
i0.ɵɵelementStart(10, "div", 6);
|
|
365
|
+
i0.ɵɵlistener("change", function PromptDialog_Template_div_change_10_listener($event) { return ctx.onInput($event); });
|
|
330
366
|
i0.ɵɵelementEnd();
|
|
331
|
-
i0.ɵɵprojection(
|
|
332
|
-
i0.ɵɵelementStart(
|
|
333
|
-
i0.ɵɵlistener("click", function
|
|
334
|
-
i0.ɵɵconditionalCreate(
|
|
367
|
+
i0.ɵɵprojection(11);
|
|
368
|
+
i0.ɵɵelementStart(12, "div")(13, "button", 7);
|
|
369
|
+
i0.ɵɵlistener("click", function PromptDialog_Template_button_click_13_listener($event) { return ctx.close.emit($event); });
|
|
370
|
+
i0.ɵɵconditionalCreate(14, PromptDialog_Conditional_14_Template, 2, 2)(15, PromptDialog_Conditional_15_Template, 1, 1);
|
|
335
371
|
i0.ɵɵelementEnd();
|
|
336
|
-
i0.ɵɵelementStart(
|
|
337
|
-
i0.ɵɵconditionalCreate(
|
|
372
|
+
i0.ɵɵelementStart(16, "button", 8);
|
|
373
|
+
i0.ɵɵconditionalCreate(17, PromptDialog_Conditional_17_Template, 2, 2)(18, PromptDialog_Conditional_18_Template, 1, 1);
|
|
338
374
|
i0.ɵɵelementEnd()()()()();
|
|
339
375
|
} if (rf & 2) {
|
|
340
|
-
let
|
|
376
|
+
let tmp_9_0;
|
|
341
377
|
i0.ɵɵproperty("open", ctx.open);
|
|
342
|
-
i0.ɵɵattribute("aria-labelledby", ctx.
|
|
343
|
-
i0.ɵɵadvance(
|
|
378
|
+
i0.ɵɵattribute("aria-labelledby", ctx.ariaLabelledBy())("aria-describedby", ctx.rendersNode(ctx.description) ? ctx.descriptionId : null);
|
|
379
|
+
i0.ɵɵadvance(3);
|
|
344
380
|
i0.ɵɵclassMap(ctx.cm().stack(3));
|
|
345
381
|
i0.ɵɵadvance();
|
|
346
382
|
i0.ɵɵclassMap(ctx.cm().cn(ctx.cm().textSize("lg"), ctx.cm().fontWeight("bold")));
|
|
347
|
-
i0.ɵɵattribute("id", ctx.
|
|
383
|
+
i0.ɵɵattribute("id", ctx.ariaLabelledBy());
|
|
348
384
|
i0.ɵɵadvance(2);
|
|
349
|
-
i0.ɵɵconditional(ctx.isGiven(ctx.title) ?
|
|
385
|
+
i0.ɵɵconditional(ctx.isGiven(ctx.title) ? 6 : 7);
|
|
350
386
|
i0.ɵɵadvance(2);
|
|
351
|
-
i0.ɵɵconditional((
|
|
387
|
+
i0.ɵɵconditional((tmp_9_0 = ctx.asTemplate(ctx.description)) ? 8 : ctx.rendersNode(ctx.description) ? 9 : -1, tmp_9_0);
|
|
352
388
|
i0.ɵɵadvance(2);
|
|
353
389
|
i0.ɵɵproperty("value", ctx.value())("placeholder", ctx.placeholder)("disabled", ctx.pending());
|
|
354
390
|
i0.ɵɵattribute("data-mol-id", ctx.inputMolId);
|
|
355
391
|
i0.ɵɵadvance(2);
|
|
356
|
-
i0.ɵɵclassMap(ctx.cm().flex(i0.ɵɵpureFunction0(27,
|
|
392
|
+
i0.ɵɵclassMap(ctx.cm().flex(i0.ɵɵpureFunction0(27, _c4)));
|
|
357
393
|
i0.ɵɵadvance();
|
|
358
394
|
i0.ɵɵproperty("type", "button")("variant", "ghost")("disabled", ctx.pending());
|
|
359
395
|
i0.ɵɵattribute("data-mol-id", ctx.cancelMolId);
|
|
360
396
|
i0.ɵɵadvance();
|
|
361
|
-
i0.ɵɵconditional(ctx.isGiven(ctx.cancelLabel) ?
|
|
397
|
+
i0.ɵɵconditional(ctx.isGiven(ctx.cancelLabel) ? 14 : 15);
|
|
362
398
|
i0.ɵɵadvance(2);
|
|
363
399
|
i0.ɵɵproperty("type", "submit")("variant", "solid")("color", ctx.destructive ? "error" : "primary")("disabled", ctx.pending());
|
|
364
400
|
i0.ɵɵattribute("data-mol-id", ctx.confirmMolId);
|
|
365
401
|
i0.ɵɵadvance();
|
|
366
|
-
i0.ɵɵconditional(ctx.isGiven(ctx.confirmLabel) ?
|
|
402
|
+
i0.ɵɵconditional(ctx.isGiven(ctx.confirmLabel) ? 17 : 18);
|
|
367
403
|
} }, dependencies: [Button, Input, Modal, MolTemplateOutlet], encapsulation: 2 });
|
|
368
404
|
}
|
|
369
405
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PromptDialog, [{
|
|
@@ -371,6 +407,7 @@ export class PromptDialog {
|
|
|
371
407
|
args: [{
|
|
372
408
|
selector: 'mol-prompt-dialog',
|
|
373
409
|
standalone: true,
|
|
410
|
+
hostDirectives: [MolPlacement],
|
|
374
411
|
imports: [Button, Input, Modal, MolTemplateOutlet],
|
|
375
412
|
inputs: [
|
|
376
413
|
'open',
|
|
@@ -387,20 +424,17 @@ export class PromptDialog {
|
|
|
387
424
|
'cancelMolId',
|
|
388
425
|
],
|
|
389
426
|
outputs: ['close'],
|
|
390
|
-
host: {
|
|
391
|
-
'data-parity-unwrap': '',
|
|
392
|
-
style: 'display: contents',
|
|
393
|
-
},
|
|
394
427
|
template: `<mol-modal
|
|
428
|
+
#modal
|
|
395
429
|
[open]="open"
|
|
396
430
|
(close)="onModalClose()"
|
|
397
|
-
[attr.aria-labelledby]="
|
|
398
|
-
[attr.aria-describedby]="
|
|
431
|
+
[attr.aria-labelledby]="ariaLabelledBy()"
|
|
432
|
+
[attr.aria-describedby]="rendersNode(description) ? descriptionId : null"
|
|
399
433
|
><form (submit)="handleSubmit($event)">
|
|
400
434
|
<div [class]="cm().stack(3)">
|
|
401
435
|
<h2
|
|
402
436
|
#titleSlot
|
|
403
|
-
[attr.id]="
|
|
437
|
+
[attr.id]="ariaLabelledBy()"
|
|
404
438
|
[class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))"
|
|
405
439
|
>
|
|
406
440
|
@if (isGiven(title)) {
|
|
@@ -414,7 +448,7 @@ export class PromptDialog {
|
|
|
414
448
|
<p [attr.id]="descriptionId" [class]="cm().textSize('sm')">
|
|
415
449
|
<ng-container [molTemplateOutlet]="descriptionTemplate"></ng-container>
|
|
416
450
|
</p>
|
|
417
|
-
} @else if (
|
|
451
|
+
} @else if (rendersNode(description)) {
|
|
418
452
|
<p
|
|
419
453
|
[attr.id]="descriptionId"
|
|
420
454
|
[class]="cm().textSize('sm')"
|
|
@@ -465,7 +499,7 @@ export class PromptDialog {
|
|
|
465
499
|
</form></mol-modal
|
|
466
500
|
>`,
|
|
467
501
|
}]
|
|
468
|
-
}],
|
|
502
|
+
}], () => [], { close: [{
|
|
469
503
|
type: Output
|
|
470
504
|
}], titleSlot: [{
|
|
471
505
|
type: ViewChild,
|
|
@@ -473,6 +507,9 @@ export class PromptDialog {
|
|
|
473
507
|
}], inputComponent: [{
|
|
474
508
|
type: ViewChild,
|
|
475
509
|
args: [Input]
|
|
510
|
+
}], modalElement: [{
|
|
511
|
+
type: ViewChild,
|
|
512
|
+
args: ['modal', { read: ElementRef }]
|
|
476
513
|
}] }); })();
|
|
477
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PromptDialog, { className: "PromptDialog", filePath: "components/prompt-dialog.component.ts", lineNumber:
|
|
514
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PromptDialog, { className: "PromptDialog", filePath: "components/prompt-dialog.component.ts", lineNumber: 183 }); })();
|
|
478
515
|
//# sourceMappingURL=prompt-dialog.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-dialog.component.js","sourceRoot":"","sources":["../../src/components/prompt-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,EAGf,SAAS,
|
|
1
|
+
{"version":3,"file":"prompt-dialog.component.js","sourceRoot":"","sources":["../../src/components/prompt-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,EAGf,SAAS,EAET,UAAU,EACV,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EAEN,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EAEX,YAAY,EACZ,cAAc,GACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;;;;;;;;;IAkFtD,2BACC;IAAA,YACH;;;IAFgB,mEAAuC;IACpD,cACH;IADG,6DACH;;;IACE,qBAA+C;;;IAIjD,yBAA2D;IACzD,2BAAuE;IACzE,iBAAI;;;IAFyB,yCAA6B;;IAC1C,cAAyC;IAAzC,uCAAyC;;;IAGzD,wBAIK;;;IAFH,yCAA6B;IAC7B,iEAAqC;;;;IAsBnC,2BACC;IAAA,YACH;;;IAF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aAAa;oBACb,cAAc;oBACd,UAAU;oBACV,cAAc;oBACd,aAAa;oBACb,aAAa;oBACb,YAAY;oBACZ,cAAc;oBACd,aAAa;iBACd;gBACD,OAAO,EAAE,CAAC,OAAO,CAAC;gBAClB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyER;aACH;;kBAwCE,MAAM;;kBAGN,SAAS;mBAAC,WAAW;;kBAErB,SAAS;mBAAC,KAAK;;kBAEf,SAAS;mBAAC,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;;kFA9C7B,YAAY"}
|
|
@@ -9,6 +9,7 @@ import type { UIClassMap } from '@molecule/app-ui';
|
|
|
9
9
|
import { asTemplate, nodeText } from '../utilities/node-value.js';
|
|
10
10
|
import type { ResolvedIcon } from '../utilities/render-icon.js';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@molecule/app-angular";
|
|
12
13
|
/**
|
|
13
14
|
* Semantic sidebar width — the same stack-agnostic presets React's
|
|
14
15
|
* `ShellSidebarWidth` uses: `sm` → 208px, `md` → 240px (default), `lg` →
|
|
@@ -178,7 +179,7 @@ export declare class ResponsiveAppShell implements DoCheck, OnDestroy {
|
|
|
178
179
|
* The shell's `<header>` landmark: the drawer menu trigger (mobile, when a
|
|
179
180
|
* Drawer is composed), the brand, and trailing actions.
|
|
180
181
|
*/
|
|
181
|
-
export declare class ResponsiveAppShellTopBar implements OnInit
|
|
182
|
+
export declare class ResponsiveAppShellTopBar implements OnInit {
|
|
182
183
|
/** Brand/title node (React's `brand`), rendered after the menu trigger. */
|
|
183
184
|
brand?: ResponsiveAppShellTopBarProps['brand'];
|
|
184
185
|
/** Trailing actions node (React's `actions`). */
|
|
@@ -206,21 +207,20 @@ export declare class ResponsiveAppShellTopBar implements OnInit, AfterViewInit,
|
|
|
206
207
|
* does not).
|
|
207
208
|
*/
|
|
208
209
|
private readonly i18n;
|
|
209
|
-
private readonly renderer;
|
|
210
|
-
private readonly sync;
|
|
211
|
-
private brandParent;
|
|
212
|
-
private actionsParent;
|
|
213
210
|
private hasBrand;
|
|
214
211
|
private hasActions;
|
|
215
212
|
/** Prepares the header's mount condition (React's `mobileOnly`). */
|
|
216
213
|
constructor();
|
|
217
214
|
/**
|
|
218
215
|
* The nearest shell context.
|
|
219
|
-
* @returns The context (
|
|
216
|
+
* @returns The context (its defaults outside the shell).
|
|
220
217
|
*/
|
|
221
218
|
shell(): ShellContextValue;
|
|
222
|
-
/**
|
|
223
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Reads the shell context from the host's place in the rendered tree.
|
|
221
|
+
* @returns The context, or null outside the shell.
|
|
222
|
+
*/
|
|
223
|
+
private readContext;
|
|
224
224
|
/**
|
|
225
225
|
* The current class map.
|
|
226
226
|
* @returns The UIClassMap.
|
|
@@ -257,20 +257,16 @@ export declare class ResponsiveAppShellTopBar implements OnInit, AfterViewInit,
|
|
|
257
257
|
* Refuses to render outside a shell (React's `useShellContext` throws).
|
|
258
258
|
*/
|
|
259
259
|
ngOnInit(): void;
|
|
260
|
-
/** Reads slot presence and applies the conditional brand/actions wrappers. */
|
|
261
|
-
ngAfterViewInit(): void;
|
|
262
|
-
/** Re-reconciles the wrappers. */
|
|
263
|
-
ngDoCheck(): void;
|
|
264
260
|
/** Applies React's conditional brand/actions wrappers. */
|
|
265
261
|
private syncWrappers;
|
|
266
262
|
static ɵfac: i0.ɵɵFactoryDeclaration<ResponsiveAppShellTopBar, never>;
|
|
267
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ResponsiveAppShellTopBar, "header[mol-responsive-app-shell-topbar]", never, { "brand": { "alias": "brand"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "mobileOnly": { "alias": "mobileOnly"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["[slot=brand]", "[slot=actions]"], true,
|
|
263
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ResponsiveAppShellTopBar, "header[mol-responsive-app-shell-topbar]", never, { "brand": { "alias": "brand"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "mobileOnly": { "alias": "mobileOnly"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["[slot=brand]", "[slot=actions]"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
268
264
|
}
|
|
269
265
|
/**
|
|
270
266
|
* The desktop sidebar (`<aside>` + `<nav>` landmarks); renders nothing below
|
|
271
267
|
* the breakpoint (the Drawer carries the nav there).
|
|
272
268
|
*/
|
|
273
|
-
export declare class ResponsiveAppShellSidebar implements OnInit
|
|
269
|
+
export declare class ResponsiveAppShellSidebar implements OnInit {
|
|
274
270
|
/** Accessible name for the `<nav>` landmark. */
|
|
275
271
|
navLabel?: ResponsiveAppShellSidebarProps['navLabel'];
|
|
276
272
|
/** Below-nav content (React's `footer` node value). */
|
|
@@ -294,19 +290,19 @@ export declare class ResponsiveAppShellSidebar implements OnInit, AfterViewInit,
|
|
|
294
290
|
* does not).
|
|
295
291
|
*/
|
|
296
292
|
private readonly i18n;
|
|
297
|
-
private readonly renderer;
|
|
298
|
-
private readonly sync;
|
|
299
|
-
private footerParent;
|
|
300
293
|
private hasFooter;
|
|
301
294
|
/** Prepares the aside's mount condition (React's breakpoint check). */
|
|
302
295
|
constructor();
|
|
303
296
|
/**
|
|
304
297
|
* The nearest shell context.
|
|
305
|
-
* @returns The context (defaults outside the shell).
|
|
298
|
+
* @returns The context (its defaults outside the shell).
|
|
306
299
|
*/
|
|
307
300
|
shell(): ShellContextValue;
|
|
308
|
-
/**
|
|
309
|
-
|
|
301
|
+
/**
|
|
302
|
+
* Reads the shell context from the host's place in the rendered tree.
|
|
303
|
+
* @returns The context, or null outside the shell.
|
|
304
|
+
*/
|
|
305
|
+
private readContext;
|
|
310
306
|
/**
|
|
311
307
|
* The current class map.
|
|
312
308
|
* @returns The UIClassMap.
|
|
@@ -331,18 +327,26 @@ export declare class ResponsiveAppShellSidebar implements OnInit, AfterViewInit,
|
|
|
331
327
|
* Refuses to render outside a shell (React's `useShellContext` throws).
|
|
332
328
|
*/
|
|
333
329
|
ngOnInit(): void;
|
|
334
|
-
/** Reads footer presence and applies the conditional footer wrapper. */
|
|
335
|
-
ngAfterViewInit(): void;
|
|
336
|
-
/** Re-reconciles the footer wrapper. */
|
|
337
|
-
ngDoCheck(): void;
|
|
338
330
|
/** Applies React's conditional footer wrapper. */
|
|
339
331
|
private syncWrapper;
|
|
340
332
|
static ɵfac: i0.ɵɵFactoryDeclaration<ResponsiveAppShellSidebar, never>;
|
|
341
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ResponsiveAppShellSidebar, "aside[mol-responsive-app-shell-sidebar]", never, { "navLabel": { "alias": "navLabel"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["*", "[slot=footer]"], true,
|
|
333
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ResponsiveAppShellSidebar, "aside[mol-responsive-app-shell-sidebar]", never, { "navLabel": { "alias": "navLabel"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["*", "[slot=footer]"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
342
334
|
}
|
|
343
335
|
/**
|
|
344
336
|
* The mobile nav drawer (<768px): a left-anchored dialog panel over a
|
|
345
337
|
* backdrop, portaled into `document.body`.
|
|
338
|
+
*
|
|
339
|
+
* Projected content is created with the consumer's view, so a closed drawer's content exists while
|
|
340
|
+
* hidden: its components, effects and fetches run. React mounts it only while shown, and again each
|
|
341
|
+
* time it shows. Write content with state as `*molLazy` (`MolLazy` from `@molecule/app-angular`):
|
|
342
|
+
* it is created when it shows and destroyed when it hides, as React's is.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```html
|
|
346
|
+
* <mol-responsive-app-shell-drawer>
|
|
347
|
+
* <nav-tree *molLazy />
|
|
348
|
+
* </mol-responsive-app-shell-drawer>
|
|
349
|
+
* ```
|
|
346
350
|
*/
|
|
347
351
|
export declare class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck, OnDestroy {
|
|
348
352
|
/** Header row content (React's `header` node value). */
|
|
@@ -386,29 +390,28 @@ export declare class ResponsiveAppShellDrawer implements OnInit, AfterViewInit,
|
|
|
386
390
|
* does not).
|
|
387
391
|
*/
|
|
388
392
|
private readonly i18n;
|
|
389
|
-
private readonly renderer;
|
|
390
393
|
/** Schedules the deferred focus moves from the change-detection hooks. */
|
|
391
394
|
private readonly injector;
|
|
392
395
|
/** Schedules the focus restore of a destroyed open drawer (the component's own injector is gone). */
|
|
393
396
|
private readonly environmentInjector;
|
|
394
|
-
private readonly sync;
|
|
395
397
|
private readonly scrollLock;
|
|
396
398
|
private hasFooter;
|
|
397
|
-
private footerParent;
|
|
398
|
-
private headerParent;
|
|
399
|
-
private headerRowParent;
|
|
400
|
-
private attached;
|
|
401
399
|
private locked;
|
|
402
400
|
private lastOpen;
|
|
403
401
|
private previouslyFocused;
|
|
404
402
|
private listeners;
|
|
403
|
+
/** Applies React's conditional header/footer wrappers, and takes the host out of the page. */
|
|
404
|
+
constructor();
|
|
405
405
|
/**
|
|
406
406
|
* The nearest shell context.
|
|
407
|
-
* @returns The context (defaults outside the shell).
|
|
407
|
+
* @returns The context (its defaults outside the shell).
|
|
408
408
|
*/
|
|
409
409
|
shell(): ShellContextValue;
|
|
410
|
-
/**
|
|
411
|
-
|
|
410
|
+
/**
|
|
411
|
+
* Reads the shell context from the host's place in the rendered tree.
|
|
412
|
+
* @returns The context, or null outside the shell.
|
|
413
|
+
*/
|
|
414
|
+
private readContext;
|
|
412
415
|
/**
|
|
413
416
|
* The current class map.
|
|
414
417
|
* @returns The UIClassMap.
|
|
@@ -455,25 +458,27 @@ export declare class ResponsiveAppShellDrawer implements OnInit, AfterViewInit,
|
|
|
455
458
|
*/
|
|
456
459
|
handleBackdropClick(event: MouseEvent): void;
|
|
457
460
|
/**
|
|
458
|
-
* Refuses to render outside a shell (React's `useShellContext` throws).
|
|
461
|
+
* Refuses to render outside a shell (React's `useShellContext` throws). The
|
|
462
|
+
* host may already have left the page (the placement function runs first), so
|
|
463
|
+
* the context resolved there is the one to check.
|
|
459
464
|
*/
|
|
460
465
|
ngOnInit(): void;
|
|
461
466
|
/** Registers the drawer, reads slots and applies the initial open state. */
|
|
462
467
|
ngAfterViewInit(): void;
|
|
463
|
-
/** Reconciles the open state
|
|
468
|
+
/** Reconciles the open state and the drawer registration. */
|
|
464
469
|
ngDoCheck(): void;
|
|
465
470
|
/**
|
|
466
|
-
* Unregisters the drawer, unlocks scroll
|
|
467
|
-
*
|
|
471
|
+
* Unregisters the drawer, unlocks scroll and, when it was open, puts focus back on whatever
|
|
472
|
+
* opened it (React's effect cleanup does on unmount).
|
|
468
473
|
*/
|
|
469
474
|
ngOnDestroy(): void;
|
|
470
|
-
/** Applies React's conditional header/footer wrappers. */
|
|
475
|
+
/** Applies React's conditional header/footer wrappers, and takes the host out of the page. */
|
|
471
476
|
private syncWrappers;
|
|
472
477
|
/** Applies the open transition (portal mounting, focus, scroll lock). */
|
|
473
478
|
private syncOpen;
|
|
474
479
|
/** Mounts the open panel: portal, focus into the panel, scroll lock, keys. */
|
|
475
480
|
private openPanel;
|
|
476
|
-
/**
|
|
481
|
+
/** Renders the portal nodes in `document.body`. */
|
|
477
482
|
private attachPortal;
|
|
478
483
|
/** Removes the portal nodes (React renders null). */
|
|
479
484
|
private detachPortal;
|
|
@@ -488,7 +493,7 @@ export declare class ResponsiveAppShellDrawer implements OnInit, AfterViewInit,
|
|
|
488
493
|
*/
|
|
489
494
|
private handleKeyDown;
|
|
490
495
|
static ɵfac: i0.ɵɵFactoryDeclaration<ResponsiveAppShellDrawer, never>;
|
|
491
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ResponsiveAppShellDrawer, "mol-responsive-app-shell-drawer", never, { "header": { "alias": "header"; "required": false; }; "navLabel": { "alias": "navLabel"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "closeDataMolId": { "alias": "closeDataMolId"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["[slot=header]", "*", "[slot=footer]"], true,
|
|
496
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ResponsiveAppShellDrawer, "mol-responsive-app-shell-drawer", never, { "header": { "alias": "header"; "required": false; }; "navLabel": { "alias": "navLabel"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "closeDataMolId": { "alias": "closeDataMolId"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["[slot=header]", "*", "[slot=footer]"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
492
497
|
}
|
|
493
498
|
/**
|
|
494
499
|
* The shell's `<main>` landmark.
|