@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive-app-shell.component.d.ts","sourceRoot":"","sources":["../../src/components/responsive-app-shell.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,OAAO,EAEZ,UAAU,EAIV,KAAK,SAAS,EACd,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"responsive-app-shell.component.d.ts","sourceRoot":"","sources":["../../src/components/responsive-app-shell.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,OAAO,EAEZ,UAAU,EAIV,KAAK,SAAS,EACd,KAAK,MAAM,EAEX,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAYtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAOlD,OAAO,EAAE,UAAU,EAAW,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;;;AAK/D;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,G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AqC;IACrC,KAAK,CAAC,EAAE,8BAA8B,CAAC,OAAO,CAAC,CAAA;IAC/C,+CAA+C;IAC/C,SAAS,CAAC,EAAE,8BAA8B,CAAC,WAAW,CAAC,CAAkB;IACzE,qBAAqB;IACrB,MAAM,CAAC,EAAE,8BAA8B,CAAC,QAAQ,CAAC,CAAA;IAEjD;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;yCA9Bf,yBAAyB;2CAAzB,yBAAyB;CAiCrC"}
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { afterNextRender, Component, effect, ElementRef, EnvironmentInjector, inject, Injector,
|
|
8
|
-
import { useHostPresence, useRouter, useTranslation } from '@molecule/app-angular';
|
|
7
|
+
import { afterNextRender, Component, effect, ElementRef, EnvironmentInjector, inject, Injector, signal, ViewChild, } from '@angular/core';
|
|
8
|
+
import { MolPlacement, placeElement, setElementPresent, useHostPresence, usePlacement, useRouter, useTranslation, } from '@molecule/app-angular';
|
|
9
9
|
import { getClassMap } from '@molecule/app-ui';
|
|
10
10
|
import { useIsDesktop } from '../hooks/use-is-desktop.js';
|
|
11
|
-
import {
|
|
11
|
+
import { createDomContext } from '../utilities/dom-context.js';
|
|
12
12
|
import { createScrollLock, getFocusableElements } from '../utilities/focus.js';
|
|
13
13
|
import { nextInstanceId } from '../utilities/ids.js';
|
|
14
14
|
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
15
15
|
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
16
16
|
import { styleText } from '../utilities/style.js';
|
|
17
|
-
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
18
17
|
import { MolTemplateOutlet } from './template-outlet.directive.js';
|
|
19
18
|
import * as i0 from "@angular/core";
|
|
19
|
+
import * as i1 from "@molecule/app-angular";
|
|
20
20
|
const _c0 = ["*"];
|
|
21
21
|
const _c1 = ["brandSlot"];
|
|
22
22
|
const _c2 = ["actionsSlot"];
|
|
@@ -125,7 +125,7 @@ export class ResponsiveAppShell {
|
|
|
125
125
|
...(ngDevMode ? [{ debugName: "desktopEffect" }] : /* istanbul ignore next */ []));
|
|
126
126
|
/** Registers the shell context on the host before any projected child resolves it. */
|
|
127
127
|
constructor() {
|
|
128
|
-
|
|
128
|
+
ShellDomContext.provide(this.host.nativeElement, new ShellContextValueImpl(this));
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* The current class map.
|
|
@@ -154,7 +154,7 @@ export class ResponsiveAppShell {
|
|
|
154
154
|
}
|
|
155
155
|
/** Removes the context registration (unmount). */
|
|
156
156
|
ngOnDestroy() {
|
|
157
|
-
|
|
157
|
+
ShellDomContext.remove(this.host.nativeElement);
|
|
158
158
|
}
|
|
159
159
|
static ɵfac = function ResponsiveAppShell_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ResponsiveAppShell)(); };
|
|
160
160
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ResponsiveAppShell, selectors: [["div", "mol-responsive-app-shell", ""]], hostVars: 5, hostBindings: function ResponsiveAppShell_HostBindings(rf, ctx) { if (rf & 2) {
|
|
@@ -180,7 +180,7 @@ export class ResponsiveAppShell {
|
|
|
180
180
|
template: `<ng-content></ng-content>`,
|
|
181
181
|
}]
|
|
182
182
|
}], () => [], null); })();
|
|
183
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShell, { className: "ResponsiveAppShell", filePath: "components/responsive-app-shell.component.ts", lineNumber:
|
|
183
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShell, { className: "ResponsiveAppShell", filePath: "components/responsive-app-shell.component.ts", lineNumber: 200 }); })();
|
|
184
184
|
/** The shell context a `ResponsiveAppShell` root registers. */
|
|
185
185
|
class ShellContextValueImpl {
|
|
186
186
|
root;
|
|
@@ -260,29 +260,35 @@ export class ResponsiveAppShellTopBar {
|
|
|
260
260
|
* does not).
|
|
261
261
|
*/
|
|
262
262
|
i18n = useTranslation();
|
|
263
|
-
renderer = inject(Renderer2);
|
|
264
|
-
sync = new SlotWrapper(this.host, this.renderer);
|
|
265
|
-
brandParent = null;
|
|
266
|
-
actionsParent = null;
|
|
267
263
|
hasBrand = false;
|
|
268
264
|
hasActions = false;
|
|
269
265
|
/** Prepares the header's mount condition (React's `mobileOnly`). */
|
|
270
266
|
constructor() {
|
|
267
|
+
usePlacement((hasContent) => {
|
|
268
|
+
// Resolve the shell context while the host is still in the page: a mobileOnly header
|
|
269
|
+
// leaves it on desktop, and its ancestors are the only way to the shell root.
|
|
270
|
+
void this.shell();
|
|
271
|
+
this.syncWrappers(hasContent);
|
|
272
|
+
});
|
|
271
273
|
// Leaves no element in the page while the bar is hidden on desktop (React renders null).
|
|
272
274
|
useHostPresence(() => !(this.mobileOnly && this.shell().isDesktop));
|
|
273
275
|
}
|
|
274
276
|
/**
|
|
275
277
|
* The nearest shell context.
|
|
276
|
-
* @returns The context (
|
|
278
|
+
* @returns The context (its defaults outside the shell).
|
|
277
279
|
*/
|
|
278
280
|
shell() {
|
|
279
281
|
// Cached: a detached (mobileOnly) header loses its DOM ancestors, so the
|
|
280
282
|
// lookup must not be repeated after the element leaves the tree.
|
|
281
|
-
this.
|
|
282
|
-
|
|
283
|
+
return this.readContext() ?? contextOrDefault(null);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Reads the shell context from the host's place in the rendered tree.
|
|
287
|
+
* @returns The context, or null outside the shell.
|
|
288
|
+
*/
|
|
289
|
+
readContext() {
|
|
290
|
+
return ShellDomContext.find(this.host.nativeElement) ?? null;
|
|
283
291
|
}
|
|
284
|
-
/** The resolved shell context. */
|
|
285
|
-
context = null;
|
|
286
292
|
/**
|
|
287
293
|
* The current class map.
|
|
288
294
|
* @returns The UIClassMap.
|
|
@@ -333,30 +339,14 @@ export class ResponsiveAppShellTopBar {
|
|
|
333
339
|
* Refuses to render outside a shell (React's `useShellContext` throws).
|
|
334
340
|
*/
|
|
335
341
|
ngOnInit() {
|
|
336
|
-
requireShell(this.
|
|
337
|
-
}
|
|
338
|
-
/** Reads slot presence and applies the conditional brand/actions wrappers. */
|
|
339
|
-
ngAfterViewInit() {
|
|
340
|
-
this.brandParent = this.brandSlot?.nativeElement.parentElement ?? null;
|
|
341
|
-
this.actionsParent = this.actionsSlot?.nativeElement.parentElement ?? null;
|
|
342
|
-
this.hasBrand = isGiven(this.brand) || hasNodes(this.brandSlot?.nativeElement);
|
|
343
|
-
this.hasActions = isGiven(this.actions) || hasNodes(this.actionsSlot?.nativeElement);
|
|
344
|
-
this.syncWrappers();
|
|
345
|
-
}
|
|
346
|
-
/** Re-reconciles the wrappers. */
|
|
347
|
-
ngDoCheck() {
|
|
348
|
-
this.hasBrand = isGiven(this.brand) || hasNodes(this.brandSlot?.nativeElement);
|
|
349
|
-
this.hasActions = isGiven(this.actions) || hasNodes(this.actionsSlot?.nativeElement);
|
|
350
|
-
this.syncWrappers();
|
|
342
|
+
requireShell(this.readContext(), 'ResponsiveAppShell.TopBar');
|
|
351
343
|
}
|
|
352
344
|
/** Applies React's conditional brand/actions wrappers. */
|
|
353
|
-
syncWrappers() {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
this.sync.sync(this.brandSlot?.nativeElement, this.hasBrand, this.brandParent ?? undefined);
|
|
359
|
-
this.sync.sync(this.actionsSlot?.nativeElement, this.hasActions, this.actionsParent ?? undefined);
|
|
345
|
+
syncWrappers(hasContent) {
|
|
346
|
+
this.hasBrand = isGiven(this.brand) || hasContent(this.brandSlot?.nativeElement);
|
|
347
|
+
this.hasActions = isGiven(this.actions) || hasContent(this.actionsSlot?.nativeElement);
|
|
348
|
+
setElementPresent(this.brandSlot?.nativeElement, this.hasBrand);
|
|
349
|
+
setElementPresent(this.actionsSlot?.nativeElement, this.hasActions);
|
|
360
350
|
}
|
|
361
351
|
static ɵfac = function ResponsiveAppShellTopBar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ResponsiveAppShellTopBar)(); };
|
|
362
352
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ResponsiveAppShellTopBar, selectors: [["header", "mol-responsive-app-shell-topbar", ""]], viewQuery: function ResponsiveAppShellTopBar_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -369,7 +359,7 @@ export class ResponsiveAppShellTopBar {
|
|
|
369
359
|
i0.ɵɵattribute("data-mol-id", ctx.dataMolId)("data-testid", ctx.testId);
|
|
370
360
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
371
361
|
i0.ɵɵclassMap(ctx.classes());
|
|
372
|
-
} }, inputs: { brand: "brand", actions: "actions", mobileOnly: "mobileOnly", className: "className", dataMolId: "dataMolId", testId: "testId" }, ngContentSelectors: _c4, decls: 12, vars: 15, consts: [["brandSlot", ""], ["actionsSlot", ""], ["type", "button", "data-mol-id", "shell-drawer-open", 3, "class", "style"], [3, "molTemplateOutlet"], ["type", "button", "data-mol-id", "shell-drawer-open", 3, "click"], ["mol-icon", "", 3, "data"]], template: function ResponsiveAppShellTopBar_Template(rf, ctx) { if (rf & 1) {
|
|
362
|
+
} }, inputs: { brand: "brand", actions: "actions", mobileOnly: "mobileOnly", className: "className", dataMolId: "dataMolId", testId: "testId" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c4, decls: 12, vars: 15, consts: [["brandSlot", ""], ["actionsSlot", ""], ["type", "button", "data-mol-id", "shell-drawer-open", 3, "class", "style"], [3, "molTemplateOutlet"], ["type", "button", "data-mol-id", "shell-drawer-open", 3, "click"], ["mol-icon", "", 3, "data"]], template: function ResponsiveAppShellTopBar_Template(rf, ctx) { if (rf & 1) {
|
|
373
363
|
i0.ɵɵprojectionDef(_c3);
|
|
374
364
|
i0.ɵɵelementStart(0, "div");
|
|
375
365
|
i0.ɵɵconditionalCreate(1, ResponsiveAppShellTopBar_Conditional_1_Template, 2, 8, "button", 2);
|
|
@@ -407,6 +397,7 @@ export class ResponsiveAppShellTopBar {
|
|
|
407
397
|
args: [{
|
|
408
398
|
selector: 'header[mol-responsive-app-shell-topbar]',
|
|
409
399
|
standalone: true,
|
|
400
|
+
hostDirectives: [MolPlacement],
|
|
410
401
|
imports: [MolIconSvg, MolTemplateOutlet],
|
|
411
402
|
inputs: ['brand', 'actions', 'mobileOnly', 'className', 'dataMolId', 'testId'],
|
|
412
403
|
host: {
|
|
@@ -451,7 +442,7 @@ export class ResponsiveAppShellTopBar {
|
|
|
451
442
|
type: ViewChild,
|
|
452
443
|
args: ['actionsSlot']
|
|
453
444
|
}] }); })();
|
|
454
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellTopBar, { className: "ResponsiveAppShellTopBar", filePath: "components/responsive-app-shell.component.ts", lineNumber:
|
|
445
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellTopBar, { className: "ResponsiveAppShellTopBar", filePath: "components/responsive-app-shell.component.ts", lineNumber: 376 }); })();
|
|
455
446
|
/**
|
|
456
447
|
* The desktop sidebar (`<aside>` + `<nav>` landmarks); renders nothing below
|
|
457
448
|
* the breakpoint (the Drawer carries the nav there).
|
|
@@ -480,26 +471,33 @@ export class ResponsiveAppShellSidebar {
|
|
|
480
471
|
* does not).
|
|
481
472
|
*/
|
|
482
473
|
i18n = useTranslation();
|
|
483
|
-
renderer = inject(Renderer2);
|
|
484
|
-
sync = new SlotWrapper(this.host, this.renderer);
|
|
485
|
-
footerParent = null;
|
|
486
474
|
hasFooter = false;
|
|
487
475
|
/** Prepares the aside's mount condition (React's breakpoint check). */
|
|
488
476
|
constructor() {
|
|
477
|
+
usePlacement((hasContent) => {
|
|
478
|
+
// Resolve the shell context while the host is still in the page: below the breakpoint
|
|
479
|
+
// it leaves the page, and its ancestors are the only way to the shell root.
|
|
480
|
+
void this.shell();
|
|
481
|
+
this.syncWrapper(hasContent);
|
|
482
|
+
});
|
|
489
483
|
// Leaves no element in the page below the breakpoint (React renders null).
|
|
490
484
|
useHostPresence(() => this.shell().isDesktop);
|
|
491
485
|
}
|
|
492
486
|
/**
|
|
493
487
|
* The nearest shell context.
|
|
494
|
-
* @returns The context (defaults outside the shell).
|
|
488
|
+
* @returns The context (its defaults outside the shell).
|
|
495
489
|
*/
|
|
496
490
|
shell() {
|
|
497
491
|
// Cached: a detached (mobile) sidebar loses its DOM ancestors.
|
|
498
|
-
this.
|
|
499
|
-
|
|
492
|
+
return this.readContext() ?? contextOrDefault(null);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Reads the shell context from the host's place in the rendered tree.
|
|
496
|
+
* @returns The context, or null outside the shell.
|
|
497
|
+
*/
|
|
498
|
+
readContext() {
|
|
499
|
+
return ShellDomContext.find(this.host.nativeElement) ?? null;
|
|
500
500
|
}
|
|
501
|
-
/** The resolved shell context. */
|
|
502
|
-
context = null;
|
|
503
501
|
/**
|
|
504
502
|
* The current class map.
|
|
505
503
|
* @returns The UIClassMap.
|
|
@@ -533,25 +531,12 @@ export class ResponsiveAppShellSidebar {
|
|
|
533
531
|
* Refuses to render outside a shell (React's `useShellContext` throws).
|
|
534
532
|
*/
|
|
535
533
|
ngOnInit() {
|
|
536
|
-
requireShell(this.
|
|
537
|
-
}
|
|
538
|
-
/** Reads footer presence and applies the conditional footer wrapper. */
|
|
539
|
-
ngAfterViewInit() {
|
|
540
|
-
this.footerParent = this.footerSlot?.nativeElement.parentElement ?? null;
|
|
541
|
-
this.hasFooter = isGiven(this.footer) || hasNodes(this.footerSlot?.nativeElement);
|
|
542
|
-
this.syncWrapper();
|
|
543
|
-
}
|
|
544
|
-
/** Re-reconciles the footer wrapper. */
|
|
545
|
-
ngDoCheck() {
|
|
546
|
-
this.hasFooter = isGiven(this.footer) || hasNodes(this.footerSlot?.nativeElement);
|
|
547
|
-
this.syncWrapper();
|
|
534
|
+
requireShell(this.readContext(), 'ResponsiveAppShell.Sidebar');
|
|
548
535
|
}
|
|
549
536
|
/** Applies React's conditional footer wrapper. */
|
|
550
|
-
syncWrapper() {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
return;
|
|
554
|
-
this.sync.sync(this.footerSlot?.nativeElement, this.hasFooter, this.footerParent ?? undefined);
|
|
537
|
+
syncWrapper(hasContent) {
|
|
538
|
+
this.hasFooter = isGiven(this.footer) || hasContent(this.footerSlot?.nativeElement);
|
|
539
|
+
setElementPresent(this.footerSlot?.nativeElement, this.hasFooter);
|
|
555
540
|
}
|
|
556
541
|
static ɵfac = function ResponsiveAppShellSidebar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ResponsiveAppShellSidebar)(); };
|
|
557
542
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ResponsiveAppShellSidebar, selectors: [["aside", "mol-responsive-app-shell-sidebar", ""]], viewQuery: function ResponsiveAppShellSidebar_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -563,7 +548,7 @@ export class ResponsiveAppShellSidebar {
|
|
|
563
548
|
i0.ɵɵattribute("data-mol-id", ctx.dataMolId)("data-testid", ctx.testId);
|
|
564
549
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
565
550
|
i0.ɵɵclassMap(ctx.classes());
|
|
566
|
-
} }, inputs: { navLabel: "navLabel", footer: "footer", className: "className", dataMolId: "dataMolId", testId: "testId" }, ngContentSelectors: _c8, decls: 7, vars: 8, consts: [["footerSlot", ""], [3, "molTemplateOutlet"]], template: function ResponsiveAppShellSidebar_Template(rf, ctx) { if (rf & 1) {
|
|
551
|
+
} }, inputs: { navLabel: "navLabel", footer: "footer", className: "className", dataMolId: "dataMolId", testId: "testId" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c8, decls: 7, vars: 8, consts: [["footerSlot", ""], [3, "molTemplateOutlet"]], template: function ResponsiveAppShellSidebar_Template(rf, ctx) { if (rf & 1) {
|
|
567
552
|
i0.ɵɵprojectionDef(_c7);
|
|
568
553
|
i0.ɵɵelementStart(0, "nav");
|
|
569
554
|
i0.ɵɵprojection(1);
|
|
@@ -589,6 +574,7 @@ export class ResponsiveAppShellSidebar {
|
|
|
589
574
|
args: [{
|
|
590
575
|
selector: 'aside[mol-responsive-app-shell-sidebar]',
|
|
591
576
|
standalone: true,
|
|
577
|
+
hostDirectives: [MolPlacement],
|
|
592
578
|
imports: [MolTemplateOutlet],
|
|
593
579
|
inputs: ['navLabel', 'footer', 'className', 'dataMolId', 'testId'],
|
|
594
580
|
host: {
|
|
@@ -619,10 +605,22 @@ export class ResponsiveAppShellSidebar {
|
|
|
619
605
|
type: ViewChild,
|
|
620
606
|
args: ['footerSlot']
|
|
621
607
|
}] }); })();
|
|
622
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellSidebar, { className: "ResponsiveAppShellSidebar", filePath: "components/responsive-app-shell.component.ts", lineNumber:
|
|
608
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellSidebar, { className: "ResponsiveAppShellSidebar", filePath: "components/responsive-app-shell.component.ts", lineNumber: 558 }); })();
|
|
623
609
|
/**
|
|
624
610
|
* The mobile nav drawer (<768px): a left-anchored dialog panel over a
|
|
625
611
|
* backdrop, portaled into `document.body`.
|
|
612
|
+
*
|
|
613
|
+
* Projected content is created with the consumer's view, so a closed drawer's content exists while
|
|
614
|
+
* hidden: its components, effects and fetches run. React mounts it only while shown, and again each
|
|
615
|
+
* time it shows. Write content with state as `*molLazy` (`MolLazy` from `@molecule/app-angular`):
|
|
616
|
+
* it is created when it shows and destroyed when it hides, as React's is.
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* ```html
|
|
620
|
+
* <mol-responsive-app-shell-drawer>
|
|
621
|
+
* <nav-tree *molLazy />
|
|
622
|
+
* </mol-responsive-app-shell-drawer>
|
|
623
|
+
* ```
|
|
626
624
|
*/
|
|
627
625
|
export class ResponsiveAppShellDrawer {
|
|
628
626
|
/** Header row content (React's `header` node value). */
|
|
@@ -667,32 +665,43 @@ export class ResponsiveAppShellDrawer {
|
|
|
667
665
|
* does not).
|
|
668
666
|
*/
|
|
669
667
|
i18n = useTranslation();
|
|
670
|
-
renderer = inject(Renderer2);
|
|
671
668
|
/** Schedules the deferred focus moves from the change-detection hooks. */
|
|
672
669
|
injector = inject(Injector);
|
|
673
670
|
/** Schedules the focus restore of a destroyed open drawer (the component's own injector is gone). */
|
|
674
671
|
environmentInjector = inject(EnvironmentInjector);
|
|
675
|
-
sync = new SlotWrapper(this.host, this.renderer);
|
|
676
672
|
scrollLock = createScrollLock();
|
|
677
673
|
hasFooter = false;
|
|
678
|
-
footerParent = null;
|
|
679
|
-
headerParent = null;
|
|
680
|
-
headerRowParent = null;
|
|
681
|
-
attached = false;
|
|
682
674
|
locked = false;
|
|
683
675
|
lastOpen = false;
|
|
684
676
|
previouslyFocused = null;
|
|
685
677
|
listeners = [];
|
|
678
|
+
/** Applies React's conditional header/footer wrappers, and takes the host out of the page. */
|
|
679
|
+
constructor() {
|
|
680
|
+
usePlacement((hasContent) => {
|
|
681
|
+
// Resolve the shell context while the host is still in the page: it leaves the page
|
|
682
|
+
// below, and its ancestors are the only way to the shell root.
|
|
683
|
+
void this.shell();
|
|
684
|
+
this.syncWrappers(hasContent);
|
|
685
|
+
// Read through the placement function so the drawer's portal follows the shell's open
|
|
686
|
+
// state: the state is a signal on the shell root, and only a read here (or in the
|
|
687
|
+
// template) marks this component for a check.
|
|
688
|
+
this.syncOpen();
|
|
689
|
+
});
|
|
690
|
+
}
|
|
686
691
|
/**
|
|
687
692
|
* The nearest shell context.
|
|
688
|
-
* @returns The context (defaults outside the shell).
|
|
693
|
+
* @returns The context (its defaults outside the shell).
|
|
689
694
|
*/
|
|
690
695
|
shell() {
|
|
691
|
-
this.
|
|
692
|
-
|
|
696
|
+
return this.readContext() ?? contextOrDefault(null);
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Reads the shell context from the host's place in the rendered tree.
|
|
700
|
+
* @returns The context, or null outside the shell.
|
|
701
|
+
*/
|
|
702
|
+
readContext() {
|
|
703
|
+
return ShellDomContext.find(this.host.nativeElement) ?? null;
|
|
693
704
|
}
|
|
694
|
-
/** The resolved shell context. */
|
|
695
|
-
context = null;
|
|
696
705
|
/**
|
|
697
706
|
* The current class map.
|
|
698
707
|
* @returns The UIClassMap.
|
|
@@ -766,20 +775,16 @@ export class ResponsiveAppShellDrawer {
|
|
|
766
775
|
this.shell().closeDrawer();
|
|
767
776
|
}
|
|
768
777
|
/**
|
|
769
|
-
* Refuses to render outside a shell (React's `useShellContext` throws).
|
|
778
|
+
* Refuses to render outside a shell (React's `useShellContext` throws). The
|
|
779
|
+
* host may already have left the page (the placement function runs first), so
|
|
780
|
+
* the context resolved there is the one to check.
|
|
770
781
|
*/
|
|
771
782
|
ngOnInit() {
|
|
772
|
-
requireShell(this.
|
|
783
|
+
requireShell(this.readContext(), 'ResponsiveAppShell.Drawer');
|
|
773
784
|
}
|
|
774
785
|
/** Registers the drawer, reads slots and applies the initial open state. */
|
|
775
786
|
ngAfterViewInit() {
|
|
776
787
|
this.shell().registerDrawer(true);
|
|
777
|
-
this.headerParent = this.headerSlot?.nativeElement.parentElement ?? null;
|
|
778
|
-
this.headerRowParent = this.headerRow?.nativeElement.parentElement ?? null;
|
|
779
|
-
this.footerParent = this.footerSlot?.nativeElement.parentElement ?? null;
|
|
780
|
-
this.headerPresent.set(isGiven(this.header) || hasNodes(this.headerSlot?.nativeElement));
|
|
781
|
-
this.hasFooter = isGiven(this.footer) || hasNodes(this.footerSlot?.nativeElement);
|
|
782
|
-
this.syncWrappers();
|
|
783
788
|
const open = this.shell().drawerOpen && !this.shell().isDesktop;
|
|
784
789
|
this.lastOpen = open;
|
|
785
790
|
if (open)
|
|
@@ -787,16 +792,13 @@ export class ResponsiveAppShellDrawer {
|
|
|
787
792
|
else
|
|
788
793
|
this.detachPortal();
|
|
789
794
|
}
|
|
790
|
-
/** Reconciles the open state
|
|
795
|
+
/** Reconciles the open state and the drawer registration. */
|
|
791
796
|
ngDoCheck() {
|
|
792
|
-
this.headerPresent.set(isGiven(this.header) || hasNodes(this.headerSlot?.nativeElement));
|
|
793
|
-
this.hasFooter = isGiven(this.footer) || hasNodes(this.footerSlot?.nativeElement);
|
|
794
|
-
this.syncWrappers();
|
|
795
797
|
this.syncOpen();
|
|
796
798
|
}
|
|
797
799
|
/**
|
|
798
|
-
* Unregisters the drawer, unlocks scroll
|
|
799
|
-
*
|
|
800
|
+
* Unregisters the drawer, unlocks scroll and, when it was open, puts focus back on whatever
|
|
801
|
+
* opened it (React's effect cleanup does on unmount).
|
|
800
802
|
*/
|
|
801
803
|
ngOnDestroy() {
|
|
802
804
|
this.shell().registerDrawer(false);
|
|
@@ -814,26 +816,17 @@ export class ResponsiveAppShellDrawer {
|
|
|
814
816
|
this.scrollLock.unlock();
|
|
815
817
|
this.locked = false;
|
|
816
818
|
}
|
|
817
|
-
const host = this.host.nativeElement;
|
|
818
|
-
if (this.attached) {
|
|
819
|
-
const overlay = this.overlay?.nativeElement;
|
|
820
|
-
const wrapper = this.wrapper?.nativeElement;
|
|
821
|
-
if (overlay?.parentNode === document.body)
|
|
822
|
-
host.appendChild(overlay);
|
|
823
|
-
if (wrapper?.parentNode === document.body)
|
|
824
|
-
host.appendChild(wrapper);
|
|
825
|
-
this.attached = false;
|
|
826
|
-
}
|
|
827
819
|
}
|
|
828
|
-
/** Applies React's conditional header/footer wrappers. */
|
|
829
|
-
syncWrappers() {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
820
|
+
/** Applies React's conditional header/footer wrappers, and takes the host out of the page. */
|
|
821
|
+
syncWrappers(hasContent) {
|
|
822
|
+
this.headerPresent.set(isGiven(this.header) || hasContent(this.headerSlot?.nativeElement));
|
|
823
|
+
this.hasFooter = isGiven(this.footer) || hasContent(this.footerSlot?.nativeElement);
|
|
824
|
+
setElementPresent(this.headerRow?.nativeElement, this.headerPresent() || (this.showCloseButton ?? true));
|
|
825
|
+
setElementPresent(this.headerSlot?.nativeElement, this.headerPresent());
|
|
826
|
+
setElementPresent(this.footerSlot?.nativeElement, this.hasFooter);
|
|
827
|
+
// React renders the drawer's portal in `document.body` while open and nothing while closed:
|
|
828
|
+
// no element at the sub-component's place either way.
|
|
829
|
+
setElementPresent(this.host.nativeElement, false);
|
|
837
830
|
}
|
|
838
831
|
/** Applies the open transition (portal mounting, focus, scroll lock). */
|
|
839
832
|
syncOpen() {
|
|
@@ -865,9 +858,6 @@ export class ResponsiveAppShellDrawer {
|
|
|
865
858
|
openPanel() {
|
|
866
859
|
this.previouslyFocused = document.activeElement ?? null;
|
|
867
860
|
this.attachPortal();
|
|
868
|
-
// The wrappers could not be reconciled while the portal was detached
|
|
869
|
-
// (every node read as disconnected); apply them now that it is mounted.
|
|
870
|
-
this.syncWrappers();
|
|
871
861
|
// After the render, so the panel's `focusin` listeners settle after the
|
|
872
862
|
// view check (a state change made during it is never rendered).
|
|
873
863
|
afterNextRender(() => {
|
|
@@ -881,21 +871,23 @@ export class ResponsiveAppShellDrawer {
|
|
|
881
871
|
this.locked = true;
|
|
882
872
|
this.addListeners();
|
|
883
873
|
}
|
|
884
|
-
/**
|
|
874
|
+
/** Renders the portal nodes in `document.body`. */
|
|
885
875
|
attachPortal() {
|
|
886
876
|
const overlay = this.overlay?.nativeElement;
|
|
887
877
|
const wrapper = this.wrapper?.nativeElement;
|
|
888
878
|
if (!overlay || !wrapper)
|
|
889
879
|
return;
|
|
890
|
-
document.body
|
|
891
|
-
document.body
|
|
892
|
-
this.attached = true;
|
|
880
|
+
placeElement(overlay, document.body);
|
|
881
|
+
placeElement(wrapper, document.body);
|
|
893
882
|
}
|
|
894
883
|
/** Removes the portal nodes (React renders null). */
|
|
895
884
|
detachPortal() {
|
|
896
|
-
this.overlay?.nativeElement
|
|
897
|
-
this.wrapper?.nativeElement
|
|
898
|
-
|
|
885
|
+
const overlay = this.overlay?.nativeElement;
|
|
886
|
+
const wrapper = this.wrapper?.nativeElement;
|
|
887
|
+
placeElement(overlay, null);
|
|
888
|
+
setElementPresent(overlay, false);
|
|
889
|
+
placeElement(wrapper, null);
|
|
890
|
+
setElementPresent(wrapper, false);
|
|
899
891
|
}
|
|
900
892
|
/** Adds Escape and the Tab focus trap while open. */
|
|
901
893
|
addListeners() {
|
|
@@ -956,9 +948,7 @@ export class ResponsiveAppShellDrawer {
|
|
|
956
948
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerRow = _t.first);
|
|
957
949
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerSlot = _t.first);
|
|
958
950
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.footerSlot = _t.first);
|
|
959
|
-
} },
|
|
960
|
-
i0.ɵɵattribute("data-open", ctx.shell().drawerOpen ? "true" : null);
|
|
961
|
-
} }, inputs: { header: "header", navLabel: "navLabel", footer: "footer", showCloseButton: "showCloseButton", className: "className", dataMolId: "dataMolId", closeDataMolId: "closeDataMolId", testId: "testId" }, ngContentSelectors: _c16, decls: 22, vars: 31, consts: [["overlay", ""], ["wrapper", ""], ["panel", ""], ["headerRow", ""], ["headerSlot", ""], ["footerSlot", ""], ["aria-hidden", "true"], ["role", "presentation", 3, "click"], ["role", "dialog", "aria-modal", "true", "tabindex", "-1", 3, "id"], [3, "molTemplateOutlet"], ["type", "button", 3, "class"], ["type", "button", 3, "click"], ["mol-icon", "", 3, "data"]], template: function ResponsiveAppShellDrawer_Template(rf, ctx) { if (rf & 1) {
|
|
951
|
+
} }, inputs: { header: "header", navLabel: "navLabel", footer: "footer", showCloseButton: "showCloseButton", className: "className", dataMolId: "dataMolId", closeDataMolId: "closeDataMolId", testId: "testId" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c16, decls: 22, vars: 31, consts: [["overlay", ""], ["wrapper", ""], ["panel", ""], ["headerRow", ""], ["headerSlot", ""], ["footerSlot", ""], ["aria-hidden", "true"], ["role", "presentation", 3, "click"], ["role", "dialog", "aria-modal", "true", "tabindex", "-1", 3, "id"], [3, "molTemplateOutlet"], ["type", "button", 3, "class"], ["type", "button", 3, "click"], ["mol-icon", "", 3, "data"]], template: function ResponsiveAppShellDrawer_Template(rf, ctx) { if (rf & 1) {
|
|
962
952
|
i0.ɵɵprojectionDef(_c15);
|
|
963
953
|
i0.ɵɵelement(0, "div", 6, 0);
|
|
964
954
|
i0.ɵɵelementStart(2, "div", 7, 1);
|
|
@@ -1017,6 +1007,7 @@ export class ResponsiveAppShellDrawer {
|
|
|
1017
1007
|
args: [{
|
|
1018
1008
|
selector: 'mol-responsive-app-shell-drawer',
|
|
1019
1009
|
standalone: true,
|
|
1010
|
+
hostDirectives: [MolPlacement],
|
|
1020
1011
|
imports: [MolIconSvg, MolTemplateOutlet],
|
|
1021
1012
|
inputs: [
|
|
1022
1013
|
'header',
|
|
@@ -1028,11 +1019,6 @@ export class ResponsiveAppShellDrawer {
|
|
|
1028
1019
|
'closeDataMolId',
|
|
1029
1020
|
'testId',
|
|
1030
1021
|
],
|
|
1031
|
-
host: {
|
|
1032
|
-
'data-parity-unwrap': '',
|
|
1033
|
-
style: 'display: contents',
|
|
1034
|
-
'[attr.data-open]': 'shell().drawerOpen ? "true" : null',
|
|
1035
|
-
},
|
|
1036
1022
|
template: `<div #overlay [class]="cm().overlay" aria-hidden="true"></div>
|
|
1037
1023
|
<div
|
|
1038
1024
|
#wrapper
|
|
@@ -1104,7 +1090,7 @@ export class ResponsiveAppShellDrawer {
|
|
|
1104
1090
|
</div>
|
|
1105
1091
|
</div>`,
|
|
1106
1092
|
}]
|
|
1107
|
-
}],
|
|
1093
|
+
}], () => [], { overlay: [{
|
|
1108
1094
|
type: ViewChild,
|
|
1109
1095
|
args: ['overlay']
|
|
1110
1096
|
}], wrapper: [{
|
|
@@ -1123,7 +1109,7 @@ export class ResponsiveAppShellDrawer {
|
|
|
1123
1109
|
type: ViewChild,
|
|
1124
1110
|
args: ['footerSlot']
|
|
1125
1111
|
}] }); })();
|
|
1126
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellDrawer, { className: "ResponsiveAppShellDrawer", filePath: "components/responsive-app-shell.component.ts", lineNumber:
|
|
1112
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellDrawer, { className: "ResponsiveAppShellDrawer", filePath: "components/responsive-app-shell.component.ts", lineNumber: 777 }); })();
|
|
1127
1113
|
/**
|
|
1128
1114
|
* The shell's `<main>` landmark.
|
|
1129
1115
|
*/
|
|
@@ -1182,38 +1168,43 @@ export class ResponsiveAppShellContent {
|
|
|
1182
1168
|
template: `<ng-content></ng-content>`,
|
|
1183
1169
|
}]
|
|
1184
1170
|
}], null, null); })();
|
|
1185
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellContent, { className: "ResponsiveAppShellContent", filePath: "components/responsive-app-shell.component.ts", lineNumber:
|
|
1171
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResponsiveAppShellContent, { className: "ResponsiveAppShellContent", filePath: "components/responsive-app-shell.component.ts", lineNumber: 1148 }); })();
|
|
1172
|
+
/** The safe default a sub-component reads outside a shell (one object, so a spy sees its methods). */
|
|
1173
|
+
const NO_SHELL_CONTEXT = {
|
|
1174
|
+
isDesktop: false,
|
|
1175
|
+
sidebarWidthPx: SIDEBAR_WIDTH_PX.md,
|
|
1176
|
+
drawerOpen: false,
|
|
1177
|
+
openDrawer: () => undefined,
|
|
1178
|
+
closeDrawer: () => undefined,
|
|
1179
|
+
drawerId: '',
|
|
1180
|
+
hasDrawer: false,
|
|
1181
|
+
registerDrawer: () => undefined,
|
|
1182
|
+
};
|
|
1186
1183
|
/**
|
|
1187
1184
|
* The nearest shell context, or a safe default outside the shell.
|
|
1188
1185
|
*
|
|
1189
|
-
* @param element - The reading element.
|
|
1186
|
+
* @param element - The reading element, or null.
|
|
1190
1187
|
* @returns The context.
|
|
1191
1188
|
*/
|
|
1192
1189
|
function contextOrDefault(element) {
|
|
1193
|
-
return (
|
|
1194
|
-
isDesktop: false,
|
|
1195
|
-
sidebarWidthPx: SIDEBAR_WIDTH_PX.md,
|
|
1196
|
-
drawerOpen: false,
|
|
1197
|
-
openDrawer: () => undefined,
|
|
1198
|
-
closeDrawer: () => undefined,
|
|
1199
|
-
drawerId: '',
|
|
1200
|
-
hasDrawer: false,
|
|
1201
|
-
registerDrawer: () => undefined,
|
|
1202
|
-
});
|
|
1190
|
+
return ShellDomContext.find(element) ?? NO_SHELL_CONTEXT;
|
|
1203
1191
|
}
|
|
1204
1192
|
/**
|
|
1205
1193
|
* Refuses to render a sub-component that has no enclosing shell — React's
|
|
1206
1194
|
* `useShellContext`, which throws `<…> must be rendered inside
|
|
1207
1195
|
* <ResponsiveAppShell>`. Angular has no context consumer to throw from during
|
|
1208
1196
|
* render, so the same refusal happens in the component's `ngOnInit` (its
|
|
1209
|
-
* first render pass)
|
|
1197
|
+
* first render pass), from the context the sub-component read while its host
|
|
1198
|
+
* was still in the page.
|
|
1210
1199
|
*
|
|
1211
|
-
* @param
|
|
1200
|
+
* @param context - The sub-component's shell context, or null outside a shell.
|
|
1212
1201
|
* @param name - The React component name the error names.
|
|
1213
1202
|
*/
|
|
1214
|
-
function requireShell(
|
|
1215
|
-
if (
|
|
1203
|
+
function requireShell(context, name) {
|
|
1204
|
+
if (context === null) {
|
|
1216
1205
|
throw new Error(`<${name}> must be rendered inside <ResponsiveAppShell>`);
|
|
1217
1206
|
}
|
|
1218
1207
|
}
|
|
1208
|
+
/** The context a provider registers and its consumers find. */
|
|
1209
|
+
const ShellDomContext = createDomContext('ShellDomContext');
|
|
1219
1210
|
//# sourceMappingURL=responsive-app-shell.component.js.map
|