@molecule/app-ui-angular 1.0.5 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11742 -1145
- package/dist/components/accordion.component.d.ts +114 -0
- package/dist/components/accordion.component.d.ts.map +1 -0
- package/dist/components/accordion.component.js +286 -0
- package/dist/components/accordion.component.js.map +1 -0
- package/dist/components/alert.component.d.ts +81 -37
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +232 -146
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +94 -0
- package/dist/components/auth-guard.component.d.ts.map +1 -0
- package/dist/components/auth-guard.component.js +212 -0
- package/dist/components/auth-guard.component.js.map +1 -0
- package/dist/components/avatar.component.d.ts +97 -0
- package/dist/components/avatar.component.d.ts.map +1 -0
- package/dist/components/avatar.component.js +216 -0
- package/dist/components/avatar.component.js.map +1 -0
- package/dist/components/badge.component.d.ts +27 -12
- package/dist/components/badge.component.d.ts.map +1 -1
- package/dist/components/badge.component.js +47 -47
- package/dist/components/badge.component.js.map +1 -1
- package/dist/components/button.component.d.ts +96 -14
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +232 -87
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/card.component.d.ts +135 -0
- package/dist/components/card.component.d.ts.map +1 -0
- package/dist/components/card.component.js +291 -0
- package/dist/components/card.component.js.map +1 -0
- package/dist/components/checkbox.component.d.ts +102 -29
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +222 -113
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +130 -0
- package/dist/components/confirm-button.component.d.ts.map +1 -0
- package/dist/components/confirm-button.component.js +322 -0
- package/dist/components/confirm-button.component.js.map +1 -0
- package/dist/components/confirm-dialog.component.d.ts +60 -0
- package/dist/components/confirm-dialog.component.d.ts.map +1 -0
- package/dist/components/confirm-dialog.component.js +152 -0
- package/dist/components/confirm-dialog.component.js.map +1 -0
- package/dist/components/dropdown.component.d.ts +313 -0
- package/dist/components/dropdown.component.d.ts.map +1 -0
- package/dist/components/dropdown.component.js +919 -0
- package/dist/components/dropdown.component.js.map +1 -0
- package/dist/components/empty-state.component.d.ts +73 -0
- package/dist/components/empty-state.component.d.ts.map +1 -0
- package/dist/components/empty-state.component.js +180 -0
- package/dist/components/empty-state.component.js.map +1 -0
- package/dist/components/floating-input.component.d.ts +86 -0
- package/dist/components/floating-input.component.d.ts.map +1 -0
- package/dist/components/floating-input.component.js +167 -0
- package/dist/components/floating-input.component.js.map +1 -0
- package/dist/components/form-field.component.d.ts +111 -0
- package/dist/components/form-field.component.d.ts.map +1 -0
- package/dist/components/form-field.component.js +300 -0
- package/dist/components/form-field.component.js.map +1 -0
- package/dist/components/form.component.d.ts +77 -0
- package/dist/components/form.component.d.ts.map +1 -0
- package/dist/components/form.component.js +222 -0
- package/dist/components/form.component.js.map +1 -0
- package/dist/components/icon.component.d.ts +85 -0
- package/dist/components/icon.component.d.ts.map +1 -0
- package/dist/components/icon.component.js +187 -0
- package/dist/components/icon.component.js.map +1 -0
- package/dist/components/index.d.ts +49 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +49 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input.component.d.ts +157 -54
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +437 -222
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/label.component.d.ts +29 -0
- package/dist/components/label.component.d.ts.map +1 -0
- package/dist/components/label.component.js +60 -0
- package/dist/components/label.component.js.map +1 -0
- package/dist/components/language-picker.component.d.ts +124 -0
- package/dist/components/language-picker.component.d.ts.map +1 -0
- package/dist/components/language-picker.component.js +305 -0
- package/dist/components/language-picker.component.js.map +1 -0
- package/dist/components/layout.component.d.ts +167 -0
- package/dist/components/layout.component.d.ts.map +1 -0
- package/dist/components/layout.component.js +364 -0
- package/dist/components/layout.component.js.map +1 -0
- package/dist/components/load-error-banner.component.d.ts +103 -0
- package/dist/components/load-error-banner.component.d.ts.map +1 -0
- package/dist/components/load-error-banner.component.js +263 -0
- package/dist/components/load-error-banner.component.js.map +1 -0
- package/dist/components/modal.component.d.ts +125 -95
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +458 -271
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/molecule/alert.component.d.ts +77 -0
- package/dist/components/molecule/alert.component.d.ts.map +1 -0
- package/dist/components/molecule/alert.component.js +229 -0
- package/dist/components/molecule/alert.component.js.map +1 -0
- package/dist/components/molecule/badge.component.d.ts +27 -0
- package/dist/components/molecule/badge.component.d.ts.map +1 -0
- package/dist/components/molecule/badge.component.js +79 -0
- package/dist/components/molecule/badge.component.js.map +1 -0
- package/dist/components/molecule/button.component.d.ts +38 -0
- package/dist/components/molecule/button.component.d.ts.map +1 -0
- package/dist/components/molecule/button.component.js +137 -0
- package/dist/components/molecule/button.component.js.map +1 -0
- package/dist/components/molecule/checkbox.component.d.ts +53 -0
- package/dist/components/molecule/checkbox.component.d.ts.map +1 -0
- package/dist/components/molecule/checkbox.component.js +166 -0
- package/dist/components/molecule/checkbox.component.js.map +1 -0
- package/dist/components/molecule/index.d.ts +18 -0
- package/dist/components/molecule/index.d.ts.map +1 -0
- package/dist/components/molecule/index.js +18 -0
- package/dist/components/molecule/index.js.map +1 -0
- package/dist/components/molecule/input.component.d.ts +93 -0
- package/dist/components/molecule/input.component.d.ts.map +1 -0
- package/dist/components/molecule/input.component.js +314 -0
- package/dist/components/molecule/input.component.js.map +1 -0
- package/dist/components/molecule/modal.component.d.ts +148 -0
- package/dist/components/molecule/modal.component.d.ts.map +1 -0
- package/dist/components/molecule/modal.component.js +382 -0
- package/dist/components/molecule/modal.component.js.map +1 -0
- package/dist/components/molecule/radio-group.component.d.ts +63 -0
- package/dist/components/molecule/radio-group.component.d.ts.map +1 -0
- package/dist/components/molecule/radio-group.component.js +208 -0
- package/dist/components/molecule/radio-group.component.js.map +1 -0
- package/dist/components/molecule/select.component.d.ts +72 -0
- package/dist/components/molecule/select.component.d.ts.map +1 -0
- package/dist/components/molecule/select.component.js +274 -0
- package/dist/components/molecule/select.component.js.map +1 -0
- package/dist/components/molecule/spinner.component.d.ts +42 -0
- package/dist/components/molecule/spinner.component.d.ts.map +1 -0
- package/dist/components/molecule/spinner.component.js +122 -0
- package/dist/components/molecule/spinner.component.js.map +1 -0
- package/dist/components/molecule/switch.component.d.ts +54 -0
- package/dist/components/molecule/switch.component.d.ts.map +1 -0
- package/dist/components/molecule/switch.component.js +148 -0
- package/dist/components/molecule/switch.component.js.map +1 -0
- package/dist/components/molecule/toast.component.d.ts +98 -0
- package/dist/components/molecule/toast.component.d.ts.map +1 -0
- package/dist/components/molecule/toast.component.js +305 -0
- package/dist/components/molecule/toast.component.js.map +1 -0
- package/dist/components/molecule/tooltip.component.d.ts +77 -0
- package/dist/components/molecule/tooltip.component.d.ts.map +1 -0
- package/dist/components/molecule/tooltip.component.js +316 -0
- package/dist/components/molecule/tooltip.component.js.map +1 -0
- package/dist/components/optimistic-toggle-button.component.d.ts +125 -0
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -0
- package/dist/components/optimistic-toggle-button.component.js +296 -0
- package/dist/components/optimistic-toggle-button.component.js.map +1 -0
- package/dist/components/page-header.component.d.ts +77 -0
- package/dist/components/page-header.component.d.ts.map +1 -0
- package/dist/components/page-header.component.js +225 -0
- package/dist/components/page-header.component.js.map +1 -0
- package/dist/components/page-shell.component.d.ts +101 -0
- package/dist/components/page-shell.component.d.ts.map +1 -0
- package/dist/components/page-shell.component.js +221 -0
- package/dist/components/page-shell.component.js.map +1 -0
- package/dist/components/pagination.component.d.ts +137 -0
- package/dist/components/pagination.component.d.ts.map +1 -0
- package/dist/components/pagination.component.js +419 -0
- package/dist/components/pagination.component.js.map +1 -0
- package/dist/components/panel-close.component.d.ts +43 -0
- package/dist/components/panel-close.component.d.ts.map +1 -0
- package/dist/components/panel-close.component.js +75 -0
- package/dist/components/panel-close.component.js.map +1 -0
- package/dist/components/progress.component.d.ts +84 -0
- package/dist/components/progress.component.d.ts.map +1 -0
- package/dist/components/progress.component.js +219 -0
- package/dist/components/progress.component.js.map +1 -0
- package/dist/components/prompt-dialog.component.d.ts +121 -0
- package/dist/components/prompt-dialog.component.d.ts.map +1 -0
- package/dist/components/prompt-dialog.component.js +332 -0
- package/dist/components/prompt-dialog.component.js.map +1 -0
- package/dist/components/radio-group.component.d.ts +66 -34
- package/dist/components/radio-group.component.d.ts.map +1 -1
- package/dist/components/radio-group.component.js +146 -125
- package/dist/components/radio-group.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +408 -0
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -0
- package/dist/components/responsive-app-shell.component.js +1144 -0
- package/dist/components/responsive-app-shell.component.js.map +1 -0
- package/dist/components/select.component.d.ts +135 -38
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +373 -181
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/separator.component.d.ts +39 -0
- package/dist/components/separator.component.d.ts.map +1 -0
- package/dist/components/separator.component.js +73 -0
- package/dist/components/separator.component.js.map +1 -0
- package/dist/components/sidebar-user-card.component.d.ts +106 -0
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -0
- package/dist/components/sidebar-user-card.component.js +277 -0
- package/dist/components/sidebar-user-card.component.js.map +1 -0
- package/dist/components/skeleton.component.d.ts +100 -0
- package/dist/components/skeleton.component.d.ts.map +1 -0
- package/dist/components/skeleton.component.js +214 -0
- package/dist/components/skeleton.component.js.map +1 -0
- package/dist/components/spinner.component.d.ts +36 -19
- package/dist/components/spinner.component.d.ts.map +1 -1
- package/dist/components/spinner.component.js +69 -71
- package/dist/components/spinner.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +72 -29
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +163 -91
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +193 -0
- package/dist/components/table.component.d.ts.map +1 -0
- package/dist/components/table.component.js +550 -0
- package/dist/components/table.component.js.map +1 -0
- package/dist/components/tabs.component.d.ts +140 -0
- package/dist/components/tabs.component.d.ts.map +1 -0
- package/dist/components/tabs.component.js +390 -0
- package/dist/components/tabs.component.js.map +1 -0
- package/dist/components/template-outlet.directive.d.ts +50 -0
- package/dist/components/template-outlet.directive.d.ts.map +1 -0
- package/dist/components/template-outlet.directive.js +81 -0
- package/dist/components/template-outlet.directive.js.map +1 -0
- package/dist/components/textarea.component.d.ts +151 -0
- package/dist/components/textarea.component.d.ts.map +1 -0
- package/dist/components/textarea.component.js +340 -0
- package/dist/components/textarea.component.js.map +1 -0
- package/dist/components/theme-toggle.component.d.ts +58 -0
- package/dist/components/theme-toggle.component.d.ts.map +1 -0
- package/dist/components/theme-toggle.component.js +124 -0
- package/dist/components/theme-toggle.component.js.map +1 -0
- package/dist/components/toast.component.d.ts +237 -49
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +636 -201
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +95 -45
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +372 -221
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +283 -0
- package/dist/components/user-menu-popover.component.d.ts.map +1 -0
- package/dist/components/user-menu-popover.component.js +646 -0
- package/dist/components/user-menu-popover.component.js.map +1 -0
- package/dist/components/user-menu.component.d.ts +95 -0
- package/dist/components/user-menu.component.d.ts.map +1 -0
- package/dist/components/user-menu.component.js +218 -0
- package/dist/components/user-menu.component.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-is-desktop.d.ts +22 -0
- package/dist/hooks/use-is-desktop.d.ts.map +1 -0
- package/dist/hooks/use-is-desktop.js +37 -0
- package/dist/hooks/use-is-desktop.js.map +1 -0
- package/dist/index.d.ts +32 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -17
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities/dom-context.d.ts +42 -0
- package/dist/utilities/dom-context.d.ts.map +1 -0
- package/dist/utilities/dom-context.js +66 -0
- package/dist/utilities/dom-context.js.map +1 -0
- package/dist/utilities/focus.d.ts +32 -0
- package/dist/utilities/focus.d.ts.map +1 -0
- package/dist/utilities/focus.js +47 -0
- package/dist/utilities/focus.js.map +1 -0
- package/dist/utilities/form-field-context.d.ts +34 -0
- package/dist/utilities/form-field-context.d.ts.map +1 -0
- package/dist/utilities/form-field-context.js +28 -0
- package/dist/utilities/form-field-context.js.map +1 -0
- package/dist/utilities/form-submit-error.d.ts +17 -0
- package/dist/utilities/form-submit-error.d.ts.map +1 -0
- package/dist/utilities/form-submit-error.js +42 -0
- package/dist/utilities/form-submit-error.js.map +1 -0
- package/dist/utilities/icon-markup.d.ts +17 -0
- package/dist/utilities/icon-markup.d.ts.map +1 -0
- package/dist/utilities/icon-markup.js +46 -0
- package/dist/utilities/icon-markup.js.map +1 -0
- package/dist/utilities/ids.d.ts +15 -0
- package/dist/utilities/ids.d.ts.map +1 -0
- package/dist/utilities/ids.js +19 -0
- package/dist/utilities/ids.js.map +1 -0
- package/dist/utilities/index.d.ts +11 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +11 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/initials.d.ts +13 -0
- package/dist/utilities/initials.d.ts.map +1 -0
- package/dist/utilities/initials.js +23 -0
- package/dist/utilities/initials.js.map +1 -0
- package/dist/utilities/node-value.d.ts +31 -0
- package/dist/utilities/node-value.d.ts.map +1 -0
- package/dist/utilities/node-value.js +37 -0
- package/dist/utilities/node-value.js.map +1 -0
- package/dist/utilities/optimistic-value.d.ts +81 -0
- package/dist/utilities/optimistic-value.d.ts.map +1 -0
- package/dist/utilities/optimistic-value.js +154 -0
- package/dist/utilities/optimistic-value.js.map +1 -0
- package/dist/utilities/render-icon.d.ts +77 -7
- package/dist/utilities/render-icon.d.ts.map +1 -1
- package/dist/utilities/render-icon.js +123 -33
- package/dist/utilities/render-icon.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +21 -0
- package/dist/utilities/rest-attrs.d.ts.map +1 -0
- package/dist/utilities/rest-attrs.js +37 -0
- package/dist/utilities/rest-attrs.js.map +1 -0
- package/dist/utilities/style.d.ts +23 -0
- package/dist/utilities/style.d.ts.map +1 -0
- package/dist/utilities/style.js +86 -0
- package/dist/utilities/style.js.map +1 -0
- package/package.json +10 -5
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoadErrorBanner component (React parity): the shared "load failed" banner
|
|
3
|
+
* with a Retry button that owns its pending state.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { Component, ElementRef, inject, Renderer2, signal, ViewChild, } from '@angular/core';
|
|
8
|
+
import { useTranslation } from '@molecule/app-angular';
|
|
9
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
+
import { Alert } from './alert.component.js';
|
|
11
|
+
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
const _c0 = ["detailSlot"];
|
|
14
|
+
const _c1 = ["retrySlot"];
|
|
15
|
+
const _c2 = ["retryLabelSlot"];
|
|
16
|
+
const _c3 = [[["", "slot", "message"]], [["", "slot", "detail"]], "*", [["", "slot", "retrylabel"]]];
|
|
17
|
+
const _c4 = ["[slot=message]", "[slot=detail]", "*", "[slot=retryLabel]"];
|
|
18
|
+
const _c5 = () => ({ justify: "start" });
|
|
19
|
+
function LoadErrorBanner_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
20
|
+
i0.ɵɵtext(0);
|
|
21
|
+
} if (rf & 2) {
|
|
22
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
23
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.retryText(), " ");
|
|
24
|
+
} }
|
|
25
|
+
/**
|
|
26
|
+
* LoadErrorBanner component.
|
|
27
|
+
*
|
|
28
|
+
* The host is the root `<div>` (`div[mol-load-error-banner]`); rest props
|
|
29
|
+
* (`className`, `data-*`, `aria-*`, `id`) land on it exactly as React spreads
|
|
30
|
+
* them. `message`, `detail` and `retryLabel` are node-valued props, projected
|
|
31
|
+
* as `[slot=message]` / `[slot=detail]` / `[slot=retryLabel]`. The detail
|
|
32
|
+
* paragraph and the retry row render only when React would render them.
|
|
33
|
+
*/
|
|
34
|
+
export class LoadErrorBanner {
|
|
35
|
+
/** The primary error line (node-valued prop). */
|
|
36
|
+
message;
|
|
37
|
+
/** Secondary line under the message (node-valued prop). */
|
|
38
|
+
detail;
|
|
39
|
+
/** Retry-button label (node-valued prop). */
|
|
40
|
+
retryLabel;
|
|
41
|
+
/** `data-mol-id` for the retry button (default `load-error-retry`). */
|
|
42
|
+
retryMolId = 'load-error-retry';
|
|
43
|
+
/** Called when Retry is clicked; a returned promise keeps the button pending. */
|
|
44
|
+
onRetry;
|
|
45
|
+
/** Extra classes for the root (React's rest `className`). */
|
|
46
|
+
className;
|
|
47
|
+
/** Whether a retry is in flight. */
|
|
48
|
+
pending = signal(false, /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
|
|
50
|
+
/** The detail paragraph (always in the template; detached when unused). */
|
|
51
|
+
detailSlot;
|
|
52
|
+
/** The retry row (always in the template; detached when no callback). */
|
|
53
|
+
retrySlot;
|
|
54
|
+
/** The retry label capture point. */
|
|
55
|
+
retryLabelSlot;
|
|
56
|
+
/**
|
|
57
|
+
* Reactive translation, read in the injection context. Its `t` reads the
|
|
58
|
+
* locale, so the view re-renders the text on a locale switch (the static `t`
|
|
59
|
+
* does not).
|
|
60
|
+
*/
|
|
61
|
+
i18n = useTranslation();
|
|
62
|
+
sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
|
|
63
|
+
hasDetail = false;
|
|
64
|
+
/** Whether the projected retry label exists (a signal: it is read after view init). */
|
|
65
|
+
hasRetryLabel = signal(false, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "hasRetryLabel" }] : /* istanbul ignore next */ []));
|
|
67
|
+
detailParent = null;
|
|
68
|
+
retryParent = null;
|
|
69
|
+
/**
|
|
70
|
+
* The current class map.
|
|
71
|
+
* @returns The UIClassMap.
|
|
72
|
+
*/
|
|
73
|
+
cm() {
|
|
74
|
+
return getClassMap();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The detail paragraph classes.
|
|
78
|
+
* @returns The class string.
|
|
79
|
+
*/
|
|
80
|
+
detailClasses() {
|
|
81
|
+
return this.cm().cn(this.cm().textSize('xs'), this.cm().textMuted);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The retry button classes (React renders `Button variant="outline" size="sm"`).
|
|
85
|
+
* @returns The class string.
|
|
86
|
+
*/
|
|
87
|
+
retryClasses() {
|
|
88
|
+
return this.cm().button({ variant: 'outline', color: 'primary', size: 'sm' });
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The retry button's text: the projected label, or the localized default.
|
|
92
|
+
* @returns The default text (empty while a projected label is shown).
|
|
93
|
+
*/
|
|
94
|
+
retryText() {
|
|
95
|
+
return this.pending()
|
|
96
|
+
? this.i18n.t('loadError.retrying', {}, { defaultValue: 'Retrying…' })
|
|
97
|
+
: this.i18n.t('loadError.retry', {}, { defaultValue: 'Retry' });
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Runs the retry callback with React's pending semantics: disabled and
|
|
101
|
+
* "Retrying…" while the promise is unsettled; a rejection is not swallowed
|
|
102
|
+
* — the banner stays for the caller.
|
|
103
|
+
*/
|
|
104
|
+
handleRetry() {
|
|
105
|
+
if (!this.onRetry || this.pending())
|
|
106
|
+
return;
|
|
107
|
+
this.pending.set(true);
|
|
108
|
+
void Promise.resolve(this.onRetry())
|
|
109
|
+
.catch((_error) => undefined)
|
|
110
|
+
.finally(() => this.pending.set(false));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Reads detail/label presence at view init (view queries resolve only then).
|
|
114
|
+
*/
|
|
115
|
+
ngAfterViewInit() {
|
|
116
|
+
this.detailParent = this.detailSlot?.nativeElement.parentElement ?? null;
|
|
117
|
+
this.retryParent = this.retrySlot?.nativeElement.parentElement ?? null;
|
|
118
|
+
this.hasDetail = hasNodes(this.detailSlot?.nativeElement);
|
|
119
|
+
this.hasRetryLabel.set(hasNodes(this.retryLabelSlot?.nativeElement));
|
|
120
|
+
this.sync.sync(this.retryLabelSlot?.nativeElement, false, this.retryLabelSlot?.nativeElement.parentElement ?? undefined);
|
|
121
|
+
this.ngDoCheck();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Re-reconciles the conditional wrappers on later passes.
|
|
125
|
+
*/
|
|
126
|
+
ngDoCheck() {
|
|
127
|
+
this.sync.sync(this.detailSlot?.nativeElement, this.hasDetail, this.detailParent ?? undefined);
|
|
128
|
+
// React renders the retry row exactly when `onRetry` is given.
|
|
129
|
+
this.sync.sync(this.retrySlot?.nativeElement, !!this.onRetry, this.retryParent ?? undefined);
|
|
130
|
+
this.showRetryLabel();
|
|
131
|
+
}
|
|
132
|
+
/** Restores the retry-label capture span on unmount. */
|
|
133
|
+
ngOnDestroy() {
|
|
134
|
+
this.visibleNodes = [];
|
|
135
|
+
this.visibleFrom = null;
|
|
136
|
+
}
|
|
137
|
+
/** Moves the projected retry label onto the retry button (React: no wrapper). */
|
|
138
|
+
showRetryLabel() {
|
|
139
|
+
const host = this.retrySlot?.nativeElement?.querySelector('button');
|
|
140
|
+
const span = this.retryLabelSlot?.nativeElement;
|
|
141
|
+
if (!host || !span)
|
|
142
|
+
return;
|
|
143
|
+
if (!this.hasRetryLabel()) {
|
|
144
|
+
this.showNodes(host, null);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this.showNodes(host, span);
|
|
148
|
+
}
|
|
149
|
+
visibleNodes = [];
|
|
150
|
+
visibleFrom = null;
|
|
151
|
+
/**
|
|
152
|
+
* Shows one capture span's children inside a target element, parking any
|
|
153
|
+
* previously shown nodes back in their span.
|
|
154
|
+
*
|
|
155
|
+
* @param target - The element to show the nodes in.
|
|
156
|
+
* @param span - The capture span (null parks everything).
|
|
157
|
+
*/
|
|
158
|
+
showNodes(target, span) {
|
|
159
|
+
if (span === this.visibleFrom)
|
|
160
|
+
return;
|
|
161
|
+
for (const node of this.visibleNodes) {
|
|
162
|
+
if (node.parentNode === target)
|
|
163
|
+
this.visibleFrom?.appendChild(node);
|
|
164
|
+
}
|
|
165
|
+
this.visibleNodes = [];
|
|
166
|
+
this.visibleFrom = null;
|
|
167
|
+
if (!span)
|
|
168
|
+
return;
|
|
169
|
+
const nodes = Array.from(span.childNodes);
|
|
170
|
+
for (const node of nodes)
|
|
171
|
+
target.appendChild(node);
|
|
172
|
+
this.visibleNodes = nodes;
|
|
173
|
+
this.visibleFrom = span;
|
|
174
|
+
}
|
|
175
|
+
static ɵfac = function LoadErrorBanner_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LoadErrorBanner)(); };
|
|
176
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoadErrorBanner, selectors: [["div", "mol-load-error-banner", ""]], viewQuery: function LoadErrorBanner_Query(rf, ctx) { if (rf & 1) {
|
|
177
|
+
i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5);
|
|
178
|
+
} if (rf & 2) {
|
|
179
|
+
let _t;
|
|
180
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.detailSlot = _t.first);
|
|
181
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.retrySlot = _t.first);
|
|
182
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.retryLabelSlot = _t.first);
|
|
183
|
+
} }, hostVars: 2, hostBindings: function LoadErrorBanner_HostBindings(rf, ctx) { if (rf & 2) {
|
|
184
|
+
i0.ɵɵclassMap(ctx.className);
|
|
185
|
+
} }, inputs: { message: "message", detail: "detail", retryLabel: "retryLabel", retryMolId: "retryMolId", onRetry: "onRetry" }, ngContentSelectors: _c4, decls: 15, vars: 17, consts: [["detailSlot", ""], ["retrySlot", ""], ["retryLabelSlot", ""], ["mol-alert", "", 3, "status", "live"], ["type", "button", 3, "click", "disabled"]], template: function LoadErrorBanner_Template(rf, ctx) { if (rf & 1) {
|
|
186
|
+
i0.ɵɵprojectionDef(_c3);
|
|
187
|
+
i0.ɵɵelementStart(0, "div", 3)(1, "div")(2, "p");
|
|
188
|
+
i0.ɵɵprojection(3);
|
|
189
|
+
i0.ɵɵelementEnd();
|
|
190
|
+
i0.ɵɵelementStart(4, "p", null, 0);
|
|
191
|
+
i0.ɵɵprojection(6, 1);
|
|
192
|
+
i0.ɵɵelementEnd();
|
|
193
|
+
i0.ɵɵprojection(7, 2);
|
|
194
|
+
i0.ɵɵelementStart(8, "div", null, 1)(10, "button", 4);
|
|
195
|
+
i0.ɵɵlistener("click", function LoadErrorBanner_Template_button_click_10_listener() { return ctx.handleRetry(); });
|
|
196
|
+
i0.ɵɵelementStart(11, "span", null, 2);
|
|
197
|
+
i0.ɵɵprojection(13, 3);
|
|
198
|
+
i0.ɵɵelementEnd();
|
|
199
|
+
i0.ɵɵconditionalCreate(14, LoadErrorBanner_Conditional_14_Template, 1, 1);
|
|
200
|
+
i0.ɵɵelementEnd()()()();
|
|
201
|
+
} if (rf & 2) {
|
|
202
|
+
i0.ɵɵproperty("status", "error")("live", false);
|
|
203
|
+
i0.ɵɵadvance();
|
|
204
|
+
i0.ɵɵclassMap(ctx.cm().stack(2));
|
|
205
|
+
i0.ɵɵadvance();
|
|
206
|
+
i0.ɵɵclassMap(ctx.cm().textSize("sm"));
|
|
207
|
+
i0.ɵɵadvance(2);
|
|
208
|
+
i0.ɵɵclassMap(ctx.detailClasses());
|
|
209
|
+
i0.ɵɵadvance(4);
|
|
210
|
+
i0.ɵɵclassMap(ctx.cm().flex(i0.ɵɵpureFunction0(16, _c5)));
|
|
211
|
+
i0.ɵɵadvance(2);
|
|
212
|
+
i0.ɵɵclassMap(ctx.retryClasses());
|
|
213
|
+
i0.ɵɵproperty("disabled", ctx.pending());
|
|
214
|
+
i0.ɵɵattribute("aria-busy", "false")("data-mol-id", ctx.retryMolId);
|
|
215
|
+
i0.ɵɵadvance(4);
|
|
216
|
+
i0.ɵɵconditional(!ctx.hasRetryLabel() ? 14 : -1);
|
|
217
|
+
} }, dependencies: [Alert], encapsulation: 2 });
|
|
218
|
+
}
|
|
219
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadErrorBanner, [{
|
|
220
|
+
type: Component,
|
|
221
|
+
args: [{
|
|
222
|
+
selector: 'div[mol-load-error-banner]',
|
|
223
|
+
standalone: true,
|
|
224
|
+
imports: [Alert],
|
|
225
|
+
inputs: ['message', 'detail', 'retryLabel', 'retryMolId', 'onRetry'],
|
|
226
|
+
host: {
|
|
227
|
+
'[class]': 'className',
|
|
228
|
+
},
|
|
229
|
+
template: `<div mol-alert [status]="'error'" [live]="false">
|
|
230
|
+
<div [class]="cm().stack(2)">
|
|
231
|
+
<p [class]="cm().textSize('sm')"><ng-content select="[slot=message]"></ng-content></p>
|
|
232
|
+
<p #detailSlot [class]="detailClasses()"><ng-content select="[slot=detail]"></ng-content></p>
|
|
233
|
+
<ng-content></ng-content>
|
|
234
|
+
<div #retrySlot [class]="cm().flex({ justify: 'start' })">
|
|
235
|
+
<button
|
|
236
|
+
type="button"
|
|
237
|
+
[class]="retryClasses()"
|
|
238
|
+
[attr.aria-busy]="'false'"
|
|
239
|
+
[disabled]="pending()"
|
|
240
|
+
[attr.data-mol-id]="retryMolId"
|
|
241
|
+
(click)="handleRetry()"
|
|
242
|
+
>
|
|
243
|
+
<span #retryLabelSlot><ng-content select="[slot=retryLabel]"></ng-content></span>
|
|
244
|
+
@if (!hasRetryLabel()) {
|
|
245
|
+
{{ retryText() }}
|
|
246
|
+
}
|
|
247
|
+
</button>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</div>`,
|
|
251
|
+
}]
|
|
252
|
+
}], null, { detailSlot: [{
|
|
253
|
+
type: ViewChild,
|
|
254
|
+
args: ['detailSlot']
|
|
255
|
+
}], retrySlot: [{
|
|
256
|
+
type: ViewChild,
|
|
257
|
+
args: ['retrySlot']
|
|
258
|
+
}], retryLabelSlot: [{
|
|
259
|
+
type: ViewChild,
|
|
260
|
+
args: ['retryLabelSlot']
|
|
261
|
+
}] }); })();
|
|
262
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LoadErrorBanner, { className: "LoadErrorBanner", filePath: "components/load-error-banner.component.ts", lineNumber: 67 }); })();
|
|
263
|
+
//# sourceMappingURL=load-error-banner.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-error-banner.component.js","sourceRoot":"","sources":["../../src/components/load-error-banner.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,SAAS,EAET,UAAU,EACV,MAAM,EAEN,SAAS,EACT,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;IAmCjD,YACF;;;IADE,mDACF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AY,EAAE,SAAS,CAAC;gBACpE,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;iBACvB;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;SAqBH;aACR;;kBAmBE,SAAS;mBAAC,YAAY;;kBAEtB,SAAS;mBAAC,WAAW;;kBAErB,SAAS;mBAAC,gBAAgB;;kFAtBhB,eAAe"}
|
|
@@ -1,142 +1,172 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Modal component (React parity): a `document.body` portal dialog.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { type SafeHtml } from '@angular/platform-browser';
|
|
6
|
+
import { type AfterViewInit, type DoCheck, ElementRef, EventEmitter, type OnDestroy } from '@angular/core';
|
|
8
7
|
import type { ModalSize, UIClassMap } from '@molecule/app-ui';
|
|
8
|
+
import type { ResolvedIcon } from '../utilities/render-icon.js';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* no dedicated ClassMap resolver option (it's a fixed token, not a
|
|
13
|
-
* `{ centered }`-parameterized one), so a top-anchored (non-centered) layout
|
|
14
|
-
* is expressed via the one inline-style exception the workspace styling rule
|
|
15
|
-
* allows for values ClassMap genuinely cannot express.
|
|
11
|
+
* Modal component.
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
13
|
+
* React's root is a FRAGMENT portaled into `document.body` (an overlay
|
|
14
|
+
* `<div>` and a centering wrapper `<div>`), so the host is unwrapped
|
|
15
|
+
* (`data-parity-unwrap`, `display: contents`) and both elements are moved
|
|
16
|
+
* into the body. Implements the WAI-ARIA APG modal dialog pattern (focus
|
|
17
|
+
* into the dialog on open, trapped Tab, focus restored on close, Escape for
|
|
18
|
+
* the topmost dialog only, reference-counted body scroll lock).
|
|
23
19
|
*/
|
|
24
|
-
export declare
|
|
25
|
-
/**
|
|
26
|
-
* Angular Modal UI component with UIClassMap-driven styling.
|
|
27
|
-
*
|
|
28
|
-
* `centered` (default `true`) vertically centers the dialog; `centered:
|
|
29
|
-
* false` top-anchors it instead, via `getModalWrapperStyle()`.
|
|
30
|
-
*/
|
|
31
|
-
export declare class MoleculeModal implements OnInit, OnDestroy, OnChanges {
|
|
20
|
+
export declare class Modal implements AfterViewInit, DoCheck, OnDestroy {
|
|
21
|
+
/** Whether the dialog is open. */
|
|
32
22
|
open: boolean;
|
|
23
|
+
/** The dialog title. */
|
|
33
24
|
title?: string;
|
|
25
|
+
/** Dialog width preset. */
|
|
34
26
|
size: ModalSize;
|
|
27
|
+
/** Whether the header/close button renders. */
|
|
35
28
|
showCloseButton: boolean;
|
|
36
|
-
|
|
29
|
+
/** Whether clicking the overlay closes the dialog. */
|
|
37
30
|
closeOnOverlayClick: boolean;
|
|
31
|
+
/** Whether Escape closes the dialog. */
|
|
38
32
|
closeOnEscape: boolean;
|
|
33
|
+
/** Footer content (node-valued prop). */
|
|
34
|
+
footer?: unknown;
|
|
35
|
+
/** Whether the dialog is vertically centered. */
|
|
39
36
|
centered: boolean;
|
|
37
|
+
/** The close button's accessible label. */
|
|
38
|
+
closeLabel?: string;
|
|
39
|
+
/** Whether body scroll is locked while open. */
|
|
40
40
|
preventScroll: boolean;
|
|
41
|
-
|
|
41
|
+
/** Extra classes for the dialog. */
|
|
42
42
|
className?: string;
|
|
43
|
-
style
|
|
43
|
+
/** Inline style object for the dialog (React camelCase). */
|
|
44
|
+
style?: Record<string, unknown>;
|
|
45
|
+
/** `data-testid` for the dialog. */
|
|
44
46
|
testId?: string;
|
|
45
|
-
close
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
/** Fires when the dialog asks to close (React's `onClose`). */
|
|
48
|
+
readonly close: EventEmitter<MouseEvent | undefined>;
|
|
49
|
+
/** The overlay element (moved to `document.body`). */
|
|
50
|
+
overlay?: ElementRef<HTMLDivElement>;
|
|
51
|
+
/** The centering wrapper (moved to `document.body`). */
|
|
52
|
+
wrapper?: ElementRef<HTMLDivElement>;
|
|
53
|
+
/** The dialog element. */
|
|
54
|
+
dialog?: ElementRef<HTMLDivElement>;
|
|
55
|
+
/** The footer wrapper (detached when unused). */
|
|
56
|
+
footerSlot?: ElementRef<HTMLDivElement>;
|
|
57
|
+
/** The per-instance title id (the normalizer renumbers it). */
|
|
58
|
+
readonly titleId: string;
|
|
59
|
+
/** The instance's stack id. */
|
|
60
|
+
private readonly stackId;
|
|
61
|
+
private readonly host;
|
|
57
62
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
63
|
+
* Reactive translation, read in the injection context. Its `t` reads the
|
|
64
|
+
* locale, so the view re-renders the text on a locale switch (the static `t`
|
|
65
|
+
* does not).
|
|
60
66
|
*/
|
|
61
|
-
|
|
67
|
+
private readonly i18n;
|
|
68
|
+
private readonly sync;
|
|
69
|
+
private lastOpen;
|
|
70
|
+
private lastFooter;
|
|
71
|
+
private footerParent;
|
|
72
|
+
private previouslyFocused;
|
|
73
|
+
private listeners;
|
|
74
|
+
private locked;
|
|
75
|
+
private moved;
|
|
62
76
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @returns
|
|
77
|
+
* The current class map.
|
|
78
|
+
* @returns The UIClassMap.
|
|
65
79
|
*/
|
|
66
|
-
|
|
80
|
+
cm(): UIClassMap;
|
|
67
81
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @returns The
|
|
82
|
+
* The dialog class list.
|
|
83
|
+
* @returns The class string.
|
|
70
84
|
*/
|
|
71
|
-
|
|
85
|
+
dialogClasses(): string;
|
|
72
86
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @returns The
|
|
87
|
+
* Serializes the dialog's inline style.
|
|
88
|
+
* @returns The style attribute text.
|
|
75
89
|
*/
|
|
76
|
-
|
|
90
|
+
dialogStyle(): string | null;
|
|
77
91
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @returns The
|
|
92
|
+
* The wrapper's inline style (top-anchored when not centered).
|
|
93
|
+
* @returns The style attribute text.
|
|
80
94
|
*/
|
|
81
|
-
|
|
95
|
+
wrapperStyle(): string | null;
|
|
82
96
|
/**
|
|
83
|
-
*
|
|
84
|
-
* @returns The
|
|
97
|
+
* The close button's accessible label.
|
|
98
|
+
* @returns The label text.
|
|
85
99
|
*/
|
|
86
|
-
|
|
100
|
+
closeText(): string;
|
|
87
101
|
/**
|
|
88
|
-
*
|
|
89
|
-
* @returns The
|
|
102
|
+
* The close button's X glyph.
|
|
103
|
+
* @returns The resolved icon.
|
|
90
104
|
*/
|
|
91
|
-
|
|
105
|
+
closeIcon(): ResolvedIcon;
|
|
92
106
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
107
|
+
* Stops a click inside the dialog from reaching the overlay handler.
|
|
108
|
+
*
|
|
109
|
+
* @param event - The click event.
|
|
95
110
|
*/
|
|
96
|
-
|
|
97
|
-
private sanitizer;
|
|
111
|
+
stopPropagation(event: MouseEvent): void;
|
|
98
112
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
113
|
+
* Closes when the click is on the wrapper itself (not bubbled content).
|
|
114
|
+
*
|
|
115
|
+
* @param event - The click event.
|
|
101
116
|
*/
|
|
102
|
-
|
|
117
|
+
handleOverlayClick(event: MouseEvent): void;
|
|
118
|
+
/** Emits the close request (React's `onClose`). */
|
|
119
|
+
requestClose(): void;
|
|
103
120
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
121
|
+
* Emits the close request from the close button — React's close button is
|
|
122
|
+
* `onClick={onClose}`, so the click event reaches the callback.
|
|
123
|
+
*
|
|
124
|
+
* @param event - The click event.
|
|
106
125
|
*/
|
|
107
|
-
|
|
126
|
+
requestCloseFromButton(event: MouseEvent): void;
|
|
108
127
|
/**
|
|
109
|
-
*
|
|
128
|
+
* Reads the view queries (they resolve only at view init), moves the portal
|
|
129
|
+
* content into `document.body` and applies the initial open state.
|
|
110
130
|
*/
|
|
111
|
-
|
|
131
|
+
ngAfterViewInit(): void;
|
|
112
132
|
/**
|
|
113
|
-
*
|
|
114
|
-
* @param changes - The changed input properties.
|
|
115
|
-
*/
|
|
116
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
117
|
-
/**
|
|
118
|
-
* Cleans up event listeners and body scroll on component destruction.
|
|
133
|
+
* Reconciles the open state and the footer on later passes.
|
|
119
134
|
*/
|
|
135
|
+
ngDoCheck(): void;
|
|
136
|
+
/** Removes listeners, unlocks scroll and restores the portal nodes (unmount). */
|
|
120
137
|
ngOnDestroy(): void;
|
|
121
138
|
/**
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
private
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
* Whether the footer slot carries nodes (read each pass so a later props
|
|
140
|
+
* step adding it still renders).
|
|
141
|
+
* @returns True when the footer wrapper should render.
|
|
142
|
+
*/
|
|
143
|
+
private hasFooter;
|
|
144
|
+
/** Applies React's `{!!footer && <div className={dialogFooter}>…</div>}`. */
|
|
145
|
+
private syncFooter;
|
|
146
|
+
/**
|
|
147
|
+
* Applies an open/closed transition (React mounts/unmounts the portal and
|
|
148
|
+
* its effects).
|
|
149
|
+
*
|
|
150
|
+
* @param open - The new open state.
|
|
151
|
+
*/
|
|
152
|
+
private transition;
|
|
153
|
+
/** Re-inserts the portal nodes into `document.body` (in React's order). */
|
|
154
|
+
private attachPortal;
|
|
155
|
+
/** Removes the portal nodes from the document (React renders null). */
|
|
156
|
+
private detachPortal;
|
|
157
|
+
/** Locks or unlocks body scroll for React's `open && preventScroll`. */
|
|
158
|
+
private syncScrollLock;
|
|
159
|
+
/** Adds Escape and the Tab focus trap while open (React's effect). */
|
|
160
|
+
private addListeners;
|
|
161
|
+
/** Removes the document listeners. */
|
|
162
|
+
private removeListeners;
|
|
163
|
+
/**
|
|
164
|
+
* Escape closes the topmost dialog; Tab wraps inside it.
|
|
165
|
+
*
|
|
166
|
+
* @param event - The key event.
|
|
167
|
+
*/
|
|
168
|
+
private handleKeyDown;
|
|
169
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Modal, never>;
|
|
170
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Modal, "mol-modal", never, { "open": { "alias": "open"; "required": false; }; "title": { "alias": "title"; "required": false; }; "size": { "alias": "size"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "closeOnOverlayClick": { "alias": "closeOnOverlayClick"; "required": false; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "centered": { "alias": "centered"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "preventScroll": { "alias": "preventScroll"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, { "close": "close"; }, never, ["*", "[slot=footer]"], true, never>;
|
|
141
171
|
}
|
|
142
172
|
//# sourceMappingURL=modal.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.component.d.ts","sourceRoot":"","sources":["../../src/components/modal.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"modal.component.d.ts","sourceRoot":"","sources":["../../src/components/modal.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,UAAU,EACV,YAAY,EAEZ,KAAK,SAAS,EAGf,MAAM,eAAe,CAAA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