@molecule/app-ui-angular 1.2.0 → 1.3.0
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 +2796 -800
- package/dist/components/accordion.component.d.ts +17 -2
- package/dist/components/accordion.component.d.ts.map +1 -1
- package/dist/components/accordion.component.js +31 -7
- package/dist/components/accordion.component.js.map +1 -1
- package/dist/components/alert.component.d.ts +15 -2
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +25 -4
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +41 -9
- package/dist/components/auth-guard.component.d.ts.map +1 -1
- package/dist/components/auth-guard.component.js +58 -23
- package/dist/components/auth-guard.component.js.map +1 -1
- package/dist/components/avatar.component.d.ts +15 -2
- package/dist/components/avatar.component.d.ts.map +1 -1
- package/dist/components/avatar.component.js +35 -5
- package/dist/components/avatar.component.js.map +1 -1
- package/dist/components/badge.component.d.ts +15 -2
- package/dist/components/badge.component.d.ts.map +1 -1
- package/dist/components/badge.component.js +35 -6
- package/dist/components/badge.component.js.map +1 -1
- package/dist/components/button.component.d.ts +20 -2
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +30 -4
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/card.component.d.ts +67 -9
- package/dist/components/card.component.d.ts.map +1 -1
- package/dist/components/card.component.js +99 -17
- package/dist/components/card.component.js.map +1 -1
- package/dist/components/checkbox.component.d.ts +35 -5
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +59 -9
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +85 -17
- package/dist/components/confirm-button.component.d.ts.map +1 -1
- package/dist/components/confirm-button.component.js +112 -25
- package/dist/components/confirm-button.component.js.map +1 -1
- package/dist/components/confirm-dialog.component.d.ts +50 -13
- package/dist/components/confirm-dialog.component.d.ts.map +1 -1
- package/dist/components/confirm-dialog.component.js +118 -31
- package/dist/components/confirm-dialog.component.js.map +1 -1
- package/dist/components/dropdown.component.d.ts +32 -5
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +86 -17
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/empty-state.component.d.ts +5 -1
- package/dist/components/empty-state.component.d.ts.map +1 -1
- package/dist/components/empty-state.component.js +5 -1
- package/dist/components/empty-state.component.js.map +1 -1
- package/dist/components/floating-input.component.d.ts +18 -4
- package/dist/components/floating-input.component.d.ts.map +1 -1
- package/dist/components/floating-input.component.js +38 -8
- package/dist/components/floating-input.component.js.map +1 -1
- package/dist/components/form-field.component.d.ts +14 -2
- package/dist/components/form-field.component.d.ts.map +1 -1
- package/dist/components/form-field.component.js +34 -5
- package/dist/components/form-field.component.js.map +1 -1
- package/dist/components/form.component.d.ts +61 -15
- package/dist/components/form.component.d.ts.map +1 -1
- package/dist/components/form.component.js +65 -14
- package/dist/components/form.component.js.map +1 -1
- package/dist/components/icon.component.d.ts +22 -4
- package/dist/components/icon.component.d.ts.map +1 -1
- package/dist/components/icon.component.js +1 -1
- package/dist/components/icon.component.js.map +1 -1
- package/dist/components/input.component.d.ts +34 -4
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +66 -11
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/label.component.d.ts +5 -1
- package/dist/components/label.component.d.ts.map +1 -1
- package/dist/components/label.component.js +6 -2
- package/dist/components/label.component.js.map +1 -1
- package/dist/components/language-picker.component.d.ts +44 -8
- package/dist/components/language-picker.component.d.ts.map +1 -1
- package/dist/components/language-picker.component.js +29 -17
- package/dist/components/language-picker.component.js.map +1 -1
- package/dist/components/layout.component.d.ts +57 -8
- package/dist/components/layout.component.d.ts.map +1 -1
- package/dist/components/layout.component.js +134 -21
- package/dist/components/layout.component.js.map +1 -1
- package/dist/components/load-error-banner.component.d.ts +39 -7
- package/dist/components/load-error-banner.component.d.ts.map +1 -1
- package/dist/components/load-error-banner.component.js +68 -21
- package/dist/components/load-error-banner.component.js.map +1 -1
- package/dist/components/modal.component.d.ts +20 -3
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +40 -6
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/optimistic-toggle-button.component.d.ts +80 -19
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -1
- package/dist/components/optimistic-toggle-button.component.js +86 -25
- package/dist/components/optimistic-toggle-button.component.js.map +1 -1
- package/dist/components/page-header.component.d.ts +5 -1
- package/dist/components/page-header.component.d.ts.map +1 -1
- package/dist/components/page-header.component.js +5 -1
- package/dist/components/page-header.component.js.map +1 -1
- package/dist/components/page-shell.component.d.ts +5 -1
- package/dist/components/page-shell.component.d.ts.map +1 -1
- package/dist/components/page-shell.component.js +5 -1
- package/dist/components/page-shell.component.js.map +1 -1
- package/dist/components/pagination.component.d.ts +15 -2
- package/dist/components/pagination.component.d.ts.map +1 -1
- package/dist/components/pagination.component.js +26 -5
- package/dist/components/pagination.component.js.map +1 -1
- package/dist/components/panel-close.component.d.ts +10 -1
- package/dist/components/panel-close.component.d.ts.map +1 -1
- package/dist/components/panel-close.component.js +1 -1
- package/dist/components/panel-close.component.js.map +1 -1
- package/dist/components/progress.component.d.ts +51 -8
- package/dist/components/progress.component.d.ts.map +1 -1
- package/dist/components/progress.component.js +26 -5
- package/dist/components/progress.component.js.map +1 -1
- package/dist/components/prompt-dialog.component.d.ts +59 -16
- package/dist/components/prompt-dialog.component.d.ts.map +1 -1
- package/dist/components/prompt-dialog.component.js +129 -41
- package/dist/components/prompt-dialog.component.js.map +1 -1
- package/dist/components/radio-group.component.d.ts +16 -2
- package/dist/components/radio-group.component.d.ts.map +1 -1
- package/dist/components/radio-group.component.js +28 -5
- package/dist/components/radio-group.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +155 -31
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +163 -54
- package/dist/components/responsive-app-shell.component.js.map +1 -1
- package/dist/components/select.component.d.ts +29 -4
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +55 -9
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/separator.component.d.ts +37 -7
- package/dist/components/separator.component.d.ts.map +1 -1
- package/dist/components/separator.component.js +33 -6
- package/dist/components/separator.component.js.map +1 -1
- package/dist/components/sidebar-user-card.component.d.ts +28 -7
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
- package/dist/components/sidebar-user-card.component.js +1 -1
- package/dist/components/sidebar-user-card.component.js.map +1 -1
- package/dist/components/skeleton.component.d.ts +23 -4
- package/dist/components/skeleton.component.d.ts.map +1 -1
- package/dist/components/skeleton.component.js +34 -7
- package/dist/components/skeleton.component.js.map +1 -1
- package/dist/components/spinner.component.d.ts +15 -2
- package/dist/components/spinner.component.d.ts.map +1 -1
- package/dist/components/spinner.component.js +34 -6
- package/dist/components/spinner.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +30 -7
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +56 -11
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +29 -3
- package/dist/components/table.component.d.ts.map +1 -1
- package/dist/components/table.component.js +63 -8
- package/dist/components/table.component.js.map +1 -1
- package/dist/components/tabs.component.d.ts +18 -3
- package/dist/components/tabs.component.d.ts.map +1 -1
- package/dist/components/tabs.component.js +74 -39
- package/dist/components/tabs.component.js.map +1 -1
- package/dist/components/textarea.component.d.ts +29 -4
- package/dist/components/textarea.component.d.ts.map +1 -1
- package/dist/components/textarea.component.js +55 -9
- package/dist/components/textarea.component.js.map +1 -1
- package/dist/components/theme-toggle.component.d.ts +25 -6
- package/dist/components/theme-toggle.component.d.ts.map +1 -1
- package/dist/components/theme-toggle.component.js +1 -1
- package/dist/components/theme-toggle.component.js.map +1 -1
- package/dist/components/toast.component.d.ts +27 -6
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +48 -14
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +57 -5
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +103 -11
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +68 -14
- package/dist/components/user-menu-popover.component.d.ts.map +1 -1
- package/dist/components/user-menu-popover.component.js +4 -4
- package/dist/components/user-menu-popover.component.js.map +1 -1
- package/dist/components/user-menu.component.d.ts +33 -9
- package/dist/components/user-menu.component.d.ts.map +1 -1
- package/dist/components/user-menu.component.js +1 -1
- package/dist/components/user-menu.component.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- 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/element-props.d.ts +78 -0
- package/dist/utilities/element-props.d.ts.map +1 -0
- package/dist/utilities/element-props.js +166 -0
- package/dist/utilities/element-props.js.map +1 -0
- package/dist/utilities/element.d.ts +34 -0
- package/dist/utilities/element.d.ts.map +1 -0
- package/dist/utilities/element.js +24 -0
- package/dist/utilities/element.js.map +1 -0
- package/dist/utilities/index.d.ts +2 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +2 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/node-value.d.ts +1 -1
- package/dist/utilities/node-value.d.ts.map +1 -1
- package/dist/utilities/node-value.js +6 -2
- package/dist/utilities/node-value.js.map +1 -1
- package/dist/utilities/render-icon.d.ts +3 -2
- package/dist/utilities/render-icon.d.ts.map +1 -1
- package/dist/utilities/render-icon.js +6 -3
- package/dist/utilities/render-icon.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +26 -2
- package/dist/utilities/rest-attrs.d.ts.map +1 -1
- package/dist/utilities/rest-attrs.js +37 -0
- package/dist/utilities/rest-attrs.js.map +1 -1
- package/package.json +4 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
3
|
+
import { type HasElement } from '../utilities/element.js';
|
|
3
4
|
import { asTemplate, nodeText } from '../utilities/node-value.js';
|
|
4
5
|
import { type ResolvedIcon } from '../utilities/render-icon.js';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
@@ -23,7 +24,7 @@ export interface AccordionItemData {
|
|
|
23
24
|
* uncontrolled pair), and ids are generated per item value so replacing the
|
|
24
25
|
* `items` array keeps them stable (React's `useId` per item component).
|
|
25
26
|
*/
|
|
26
|
-
export declare class Accordion {
|
|
27
|
+
export declare class Accordion implements HasElement<HTMLDivElement> {
|
|
27
28
|
/** The items to render. */
|
|
28
29
|
items?: AccordionItemData[];
|
|
29
30
|
/** Controlled expanded value(s). */
|
|
@@ -40,6 +41,12 @@ export declare class Accordion {
|
|
|
40
41
|
style?: Record<string, unknown>;
|
|
41
42
|
/** `data-testid` for the root. */
|
|
42
43
|
testId?: string;
|
|
44
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
45
|
+
automationId?: string;
|
|
46
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
47
|
+
dataMolId?: string;
|
|
48
|
+
/** Disables every header, whatever an item says (React's `disabled`). */
|
|
49
|
+
disabled?: boolean;
|
|
43
50
|
/** Template helpers (templates see only class members). */
|
|
44
51
|
readonly asTemplate: typeof asTemplate;
|
|
45
52
|
/** Renders a plain-string node value. */
|
|
@@ -47,6 +54,9 @@ export declare class Accordion {
|
|
|
47
54
|
/** Fires the new expansion state (single value, or array in multiple mode). */
|
|
48
55
|
readonly change: EventEmitter<string | string[]>;
|
|
49
56
|
private internalExpanded;
|
|
57
|
+
private readonly host;
|
|
58
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
59
|
+
readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
|
|
50
60
|
private readonly idMap;
|
|
51
61
|
private idCount;
|
|
52
62
|
/**
|
|
@@ -59,6 +69,11 @@ export declare class Accordion {
|
|
|
59
69
|
* @returns The class string.
|
|
60
70
|
*/
|
|
61
71
|
classes(): string;
|
|
72
|
+
/**
|
|
73
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
74
|
+
* @returns The attribute value.
|
|
75
|
+
*/
|
|
76
|
+
molId(): string | undefined;
|
|
62
77
|
/**
|
|
63
78
|
* Serializes the inline style.
|
|
64
79
|
* @returns The style attribute text.
|
|
@@ -109,6 +124,6 @@ export declare class Accordion {
|
|
|
109
124
|
*/
|
|
110
125
|
toggle(itemValue: string): void;
|
|
111
126
|
static ɵfac: i0.ɵɵFactoryDeclaration<Accordion, never>;
|
|
112
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Accordion, "div[mol-accordion]", never, { "items": { "alias": "items"; "required": false; }; "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "collapsible": { "alias": "collapsible"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
|
|
127
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Accordion, "div[mol-accordion]", never, { "items": { "alias": "items"; "required": false; }; "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "collapsible": { "alias": "collapsible"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
|
|
113
128
|
}
|
|
114
129
|
//# sourceMappingURL=accordion.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.component.d.ts","sourceRoot":"","sources":["../../src/components/accordion.component.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"accordion.component.d.ts","sourceRoot":"","sources":["../../src/components/accordion.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyB,YAAY,EAAkB,MAAM,eAAe,CAAA;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAc,KAAK,YAAY,EAAe,MAAM,6BAA6B,CAAA;;AAGxF,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;GAQG;AACH,qBA6Da,SAAU,YAAW,UAAU,CAAC,cAAc,CAAC;IAC1D,2BAA2B;IAC3B,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC3B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
-
import { Component, EventEmitter, Output } from '@angular/core';
|
|
7
|
+
import { Component, ElementRef, EventEmitter, inject, Output } from '@angular/core';
|
|
8
8
|
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
+
import { hostElement } from '../utilities/element.js';
|
|
9
10
|
import { asTemplate, nodeText } from '../utilities/node-value.js';
|
|
10
11
|
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
11
12
|
import { styleText } from '../utilities/style.js';
|
|
@@ -58,7 +59,7 @@ function Accordion_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
58
59
|
i0.ɵɵattribute("data-state", ctx_r2.isOpen(item_r2.value) ? "open" : "closed");
|
|
59
60
|
i0.ɵɵadvance();
|
|
60
61
|
i0.ɵɵclassMap(ctx_r2.cm().cn(ctx_r2.cm().accordion(i0.ɵɵpureFunction0(22, _c1)), ctx_r2.cm().accordionTriggerBase));
|
|
61
|
-
i0.ɵɵproperty("disabled", item_r2.disabled);
|
|
62
|
+
i0.ɵɵproperty("disabled", item_r2.disabled || ctx_r2.disabled);
|
|
62
63
|
i0.ɵɵattribute("id", ctx_r2.ids(item_r2.value).trigger)("aria-expanded", ctx_r2.isOpen(item_r2.value) ? "true" : "false")("aria-controls", ctx_r2.ids(item_r2.value).content)("data-state", ctx_r2.isOpen(item_r2.value) ? "open" : "closed");
|
|
63
64
|
i0.ɵɵadvance();
|
|
64
65
|
i0.ɵɵconditional((tmp_18_0 = ctx_r2.asTemplate(item_r2.header)) ? 2 : 3, tmp_18_0);
|
|
@@ -99,6 +100,12 @@ export class Accordion {
|
|
|
99
100
|
style;
|
|
100
101
|
/** `data-testid` for the root. */
|
|
101
102
|
testId;
|
|
103
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
104
|
+
automationId;
|
|
105
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
106
|
+
dataMolId;
|
|
107
|
+
/** Disables every header, whatever an item says (React's `disabled`). */
|
|
108
|
+
disabled;
|
|
102
109
|
/** Template helpers (templates see only class members). */
|
|
103
110
|
asTemplate = asTemplate;
|
|
104
111
|
/** Renders a plain-string node value. */
|
|
@@ -106,6 +113,9 @@ export class Accordion {
|
|
|
106
113
|
/** Fires the new expansion state (single value, or array in multiple mode). */
|
|
107
114
|
change = new EventEmitter();
|
|
108
115
|
internalExpanded = null;
|
|
116
|
+
host = inject(ElementRef);
|
|
117
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
118
|
+
element = hostElement(this.host);
|
|
109
119
|
idMap = new Map();
|
|
110
120
|
idCount = 0;
|
|
111
121
|
/**
|
|
@@ -122,6 +132,16 @@ export class Accordion {
|
|
|
122
132
|
classes() {
|
|
123
133
|
return this.cm().cn(this.cm().accordionRoot, this.className);
|
|
124
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
137
|
+
* @returns The attribute value.
|
|
138
|
+
*/
|
|
139
|
+
molId() {
|
|
140
|
+
return (this.automationId ??
|
|
141
|
+
this.dataMolId ??
|
|
142
|
+
this.host.nativeElement.getAttribute('data-mol-id') ??
|
|
143
|
+
undefined);
|
|
144
|
+
}
|
|
125
145
|
/**
|
|
126
146
|
* Serializes the inline style.
|
|
127
147
|
* @returns The style attribute text.
|
|
@@ -210,11 +230,11 @@ export class Accordion {
|
|
|
210
230
|
this.change.emit(next[0] ?? '');
|
|
211
231
|
}
|
|
212
232
|
static ɵfac = function Accordion_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Accordion)(); };
|
|
213
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Accordion, selectors: [["div", "mol-accordion", ""]], hostVars:
|
|
214
|
-
i0.ɵɵattribute("data-testid", ctx.testId);
|
|
233
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Accordion, selectors: [["div", "mol-accordion", ""]], hostVars: 6, hostBindings: function Accordion_HostBindings(rf, ctx) { if (rf & 2) {
|
|
234
|
+
i0.ɵɵattribute("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
215
235
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
216
236
|
i0.ɵɵclassMap(ctx.classes());
|
|
217
|
-
} }, inputs: { items: "items", value: "value", defaultValue: "defaultValue", multiple: "multiple", collapsible: "collapsible", className: "className", style: "style", testId: "testId" }, outputs: { change: "change" }, decls: 2, vars: 1, consts: [[3, "class"], ["type", "button", 3, "click", "disabled"], [3, "ngTemplateOutlet"], ["mol-icon", "", 3, "data"], ["role", "region"]], template: function Accordion_Template(rf, ctx) { if (rf & 1) {
|
|
237
|
+
} }, inputs: { items: "items", value: "value", defaultValue: "defaultValue", multiple: "multiple", collapsible: "collapsible", className: "className", style: "style", testId: "testId", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], disabled: "disabled" }, outputs: { change: "change" }, decls: 2, vars: 1, consts: [[3, "class"], ["type", "button", 3, "click", "disabled"], [3, "ngTemplateOutlet"], ["mol-icon", "", 3, "data"], ["role", "region"]], template: function Accordion_Template(rf, ctx) { if (rf & 1) {
|
|
218
238
|
i0.ɵɵrepeaterCreate(0, Accordion_For_1_Template, 9, 23, "div", 0, _forTrack0);
|
|
219
239
|
} if (rf & 2) {
|
|
220
240
|
i0.ɵɵrepeater(ctx.items ?? i0.ɵɵpureFunction0(0, _c0));
|
|
@@ -235,11 +255,15 @@ export class Accordion {
|
|
|
235
255
|
'className',
|
|
236
256
|
'style',
|
|
237
257
|
'testId',
|
|
258
|
+
'automationId',
|
|
259
|
+
'dataMolId: data-mol-id',
|
|
260
|
+
'disabled',
|
|
238
261
|
],
|
|
239
262
|
host: {
|
|
240
263
|
'[class]': 'classes()',
|
|
241
264
|
'[style]': 'hostStyle()',
|
|
242
265
|
'[attr.data-testid]': 'testId',
|
|
266
|
+
'[attr.data-mol-id]': 'molId()',
|
|
243
267
|
},
|
|
244
268
|
template: `@for (item of items ?? []; track item.value) {
|
|
245
269
|
<div [class]="cm().accordionItem" [attr.data-state]="isOpen(item.value) ? 'open' : 'closed'">
|
|
@@ -251,7 +275,7 @@ export class Accordion {
|
|
|
251
275
|
[attr.aria-expanded]="isOpen(item.value) ? 'true' : 'false'"
|
|
252
276
|
[attr.aria-controls]="ids(item.value).content"
|
|
253
277
|
[attr.data-state]="isOpen(item.value) ? 'open' : 'closed'"
|
|
254
|
-
[disabled]="item.disabled"
|
|
278
|
+
[disabled]="item.disabled || disabled"
|
|
255
279
|
>
|
|
256
280
|
@if (asTemplate(item.header); as tpl) {
|
|
257
281
|
<ng-container [ngTemplateOutlet]="tpl" />
|
|
@@ -282,5 +306,5 @@ export class Accordion {
|
|
|
282
306
|
}], null, { change: [{
|
|
283
307
|
type: Output
|
|
284
308
|
}] }); })();
|
|
285
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Accordion, { className: "Accordion", filePath: "components/accordion.component.ts", lineNumber:
|
|
309
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Accordion, { className: "Accordion", filePath: "components/accordion.component.ts", lineNumber: 100 }); })();
|
|
286
310
|
//# sourceMappingURL=accordion.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.component.js","sourceRoot":"","sources":["../../src/components/accordion.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"accordion.component.js","sourceRoot":"","sources":["../../src/components/accordion.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MA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AS"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type AfterViewInit, type DoCheck, ElementRef, EventEmitter } from '@angular/core';
|
|
7
7
|
import type { ColorVariant, UIClassMap } from '@molecule/app-ui';
|
|
8
|
+
import { type HasElement } from '../utilities/element.js';
|
|
8
9
|
import type { ResolvedIcon } from '../utilities/render-icon.js';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
/**
|
|
@@ -21,7 +22,7 @@ import * as i0 from "@angular/core";
|
|
|
21
22
|
* React would not render them ({@link SlotWrapper}); the decision is made at
|
|
22
23
|
* view init, when view queries resolve.
|
|
23
24
|
*/
|
|
24
|
-
export declare class Alert implements AfterViewInit, DoCheck {
|
|
25
|
+
export declare class Alert implements AfterViewInit, DoCheck, HasElement<HTMLDivElement> {
|
|
25
26
|
/** Alert title. */
|
|
26
27
|
title?: string;
|
|
27
28
|
/** Status color. */
|
|
@@ -40,6 +41,10 @@ export declare class Alert implements AfterViewInit, DoCheck {
|
|
|
40
41
|
style?: Record<string, unknown>;
|
|
41
42
|
/** `data-testid`. */
|
|
42
43
|
testId?: string;
|
|
44
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
45
|
+
automationId?: string;
|
|
46
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
47
|
+
dataMolId?: string;
|
|
43
48
|
/** Fires the raw click event when the dismiss button is pressed. */
|
|
44
49
|
readonly dismiss: EventEmitter<MouseEvent>;
|
|
45
50
|
/** The icon wrapper span (projection capture point). */
|
|
@@ -54,6 +59,9 @@ export declare class Alert implements AfterViewInit, DoCheck {
|
|
|
54
59
|
*/
|
|
55
60
|
private readonly i18n;
|
|
56
61
|
private readonly sync;
|
|
62
|
+
private readonly host;
|
|
63
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
64
|
+
readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
|
|
57
65
|
/**
|
|
58
66
|
* The current class map.
|
|
59
67
|
* @returns The UIClassMap.
|
|
@@ -96,6 +104,11 @@ export declare class Alert implements AfterViewInit, DoCheck {
|
|
|
96
104
|
* @returns The style attribute text.
|
|
97
105
|
*/
|
|
98
106
|
hostStyle(): string | null;
|
|
107
|
+
/**
|
|
108
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
109
|
+
* @returns The attribute value.
|
|
110
|
+
*/
|
|
111
|
+
molId(): string | undefined;
|
|
99
112
|
/**
|
|
100
113
|
* Decides icon presence at view init (view queries resolve only then) and
|
|
101
114
|
* applies React's conditions.
|
|
@@ -110,6 +123,6 @@ export declare class Alert implements AfterViewInit, DoCheck {
|
|
|
110
123
|
*/
|
|
111
124
|
private syncIcon;
|
|
112
125
|
static ɵfac: i0.ɵɵFactoryDeclaration<Alert, never>;
|
|
113
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Alert, "div[mol-alert]", never, { "title": { "alias": "title"; "required": false; }; "status": { "alias": "status"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "live": { "alias": "live"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; "dismissLabel": { "alias": "dismissLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, { "dismiss": "dismiss"; }, never, ["[slot=icon]", "*"], true, never>;
|
|
126
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Alert, "div[mol-alert]", never, { "title": { "alias": "title"; "required": false; }; "status": { "alias": "status"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "live": { "alias": "live"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; "dismissLabel": { "alias": "dismissLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; }, { "dismiss": "dismiss"; }, never, ["[slot=icon]", "*"], true, never>;
|
|
114
127
|
}
|
|
115
128
|
//# sourceMappingURL=alert.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.component.d.ts","sourceRoot":"","sources":["../../src/components/alert.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,UAAU,EACV,YAAY,EAKb,MAAM,eAAe,CAAA;AAItB,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;;AAuB/D;;;;;;;;;;;;;GAaG;AACH,
|
|
1
|
+
{"version":3,"file":"alert.component.d.ts","sourceRoot":"","sources":["../../src/components/alert.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,UAAU,EACV,YAAY,EAKb,MAAM,eAAe,CAAA;AAItB,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGhE,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;;AAuB/D;;;;;;;;;;;;;GAaG;AACH,qBA8Ca,KAAM,YAAW,aAAa,EAAE,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC;IAC9E,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAS;IAC7B,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAA;IACxD,8DAA8D;IAC9D,IAAI,UAAO;IACX,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,M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AI,IAAI;IAIjB;;OAEG;IACH,OAAO,CAAC,QAAQ;yCAjKL,KAAK;2CAAL,KAAK;CA0KjB"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Component, ElementRef, EventEmitter, inject, Output, Renderer2, ViewChild, } from '@angular/core';
|
|
7
7
|
import { useTranslation } from '@molecule/app-angular';
|
|
8
8
|
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
+
import { hostElement } from '../utilities/element.js';
|
|
9
10
|
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
10
11
|
import { styleText } from '../utilities/style.js';
|
|
11
12
|
import { SlotWrapper } from './button.component.js';
|
|
@@ -87,6 +88,10 @@ export class Alert {
|
|
|
87
88
|
style;
|
|
88
89
|
/** `data-testid`. */
|
|
89
90
|
testId;
|
|
91
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
92
|
+
automationId;
|
|
93
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
94
|
+
dataMolId;
|
|
90
95
|
/** Fires the raw click event when the dismiss button is pressed. */
|
|
91
96
|
dismiss = new EventEmitter();
|
|
92
97
|
/** The icon wrapper span (projection capture point). */
|
|
@@ -101,6 +106,9 @@ export class Alert {
|
|
|
101
106
|
*/
|
|
102
107
|
i18n = useTranslation();
|
|
103
108
|
sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
|
|
109
|
+
host = inject(ElementRef);
|
|
110
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
111
|
+
element = hostElement(this.host);
|
|
104
112
|
/**
|
|
105
113
|
* The current class map.
|
|
106
114
|
* @returns The UIClassMap.
|
|
@@ -165,6 +173,16 @@ export class Alert {
|
|
|
165
173
|
hostStyle() {
|
|
166
174
|
return styleText(this.style);
|
|
167
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
178
|
+
* @returns The attribute value.
|
|
179
|
+
*/
|
|
180
|
+
molId() {
|
|
181
|
+
return (this.automationId ??
|
|
182
|
+
this.dataMolId ??
|
|
183
|
+
this.host.nativeElement.getAttribute('data-mol-id') ??
|
|
184
|
+
undefined);
|
|
185
|
+
}
|
|
168
186
|
/**
|
|
169
187
|
* Decides icon presence at view init (view queries resolve only then) and
|
|
170
188
|
* applies React's conditions.
|
|
@@ -197,11 +215,11 @@ export class Alert {
|
|
|
197
215
|
let _t;
|
|
198
216
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.iconSlot = _t.first);
|
|
199
217
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.defaultGlyph = _t.first);
|
|
200
|
-
} }, hostVars:
|
|
201
|
-
i0.ɵɵattribute("role", ctx.live ? "alert" : "status")("data-testid", ctx.testId);
|
|
218
|
+
} }, hostVars: 7, hostBindings: function Alert_HostBindings(rf, ctx) { if (rf & 2) {
|
|
219
|
+
i0.ɵɵattribute("role", ctx.live ? "alert" : "status")("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
202
220
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
203
221
|
i0.ɵɵclassMap(ctx.classes());
|
|
204
|
-
} }, inputs: { title: "title", status: "status", variant: "variant", live: "live", dismissible: "dismissible", dismissLabel: "dismissLabel", className: "className", style: "style", testId: "testId" }, outputs: { dismiss: "dismiss" }, ngContentSelectors: _c3, decls: 10, vars: 9, consts: [["iconSlot", ""], ["defaultGlyph", ""], ["mol-icon", "", 3, "data"], [3, "class"], ["type", "button", 3, "class"], ["type", "button", 3, "click"]], template: function Alert_Template(rf, ctx) { if (rf & 1) {
|
|
222
|
+
} }, inputs: { title: "title", status: "status", variant: "variant", live: "live", dismissible: "dismissible", dismissLabel: "dismissLabel", className: "className", style: "style", testId: "testId", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"] }, outputs: { dismiss: "dismiss" }, ngContentSelectors: _c3, decls: 10, vars: 9, consts: [["iconSlot", ""], ["defaultGlyph", ""], ["mol-icon", "", 3, "data"], [3, "class"], ["type", "button", 3, "class"], ["type", "button", 3, "click"]], template: function Alert_Template(rf, ctx) { if (rf & 1) {
|
|
205
223
|
i0.ɵɵprojectionDef(_c2);
|
|
206
224
|
i0.ɵɵelementStart(0, "span", null, 0);
|
|
207
225
|
i0.ɵɵnamespaceSVG();
|
|
@@ -245,6 +263,8 @@ export class Alert {
|
|
|
245
263
|
'className',
|
|
246
264
|
'style',
|
|
247
265
|
'testId',
|
|
266
|
+
'automationId',
|
|
267
|
+
'dataMolId: data-mol-id',
|
|
248
268
|
],
|
|
249
269
|
outputs: ['dismiss'],
|
|
250
270
|
host: {
|
|
@@ -252,6 +272,7 @@ export class Alert {
|
|
|
252
272
|
'[class]': 'classes()',
|
|
253
273
|
'[style]': 'hostStyle()',
|
|
254
274
|
'[attr.data-testid]': 'testId',
|
|
275
|
+
'[attr.data-mol-id]': 'molId()',
|
|
255
276
|
},
|
|
256
277
|
template: `<span [class]="cm().alertIconWrapper" #iconSlot>
|
|
257
278
|
<svg mol-icon [data]="resolvedDefaultIcon()" #defaultGlyph />
|
|
@@ -283,7 +304,7 @@ export class Alert {
|
|
|
283
304
|
type: ViewChild,
|
|
284
305
|
args: ['defaultGlyph', { read: ElementRef }]
|
|
285
306
|
}] }); })();
|
|
286
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Alert, { className: "Alert", filePath: "components/alert.component.ts", lineNumber:
|
|
307
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Alert, { className: "Alert", filePath: "components/alert.component.ts", lineNumber: 108 }); })();
|
|
287
308
|
/**
|
|
288
309
|
* Whether an element captured any element or text node other than one
|
|
289
310
|
* excluded element (the always-mounted default glyph).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.component.js","sourceRoot":"","sources":["../../src/components/alert.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EAET,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"alert.component.js","sourceRoot":"","sources":["../../src/components/alert.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EAET,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAmB,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEtE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;;;;;;IAiE3C,0BAA8B;IAAA,YAAW;IAAA,iBAAK;;;IAA1C,qCAAyB;IAAC,cAAW;IAAX,kCAAW;;;;IAK3C,iCAKC;IADC,+KAAS,2BAAoB,KAAC;;IAE9B,yBAAqC;IACvC,iBAAS;;;IALP,uCAA2B;;IAIb,cAAoB;IAApB,yCAAoB;;AA1E1C,wCAAwC;AACxC,MAAM,cAAc,GAAyE;IAC3F,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACb,CAAA;AAED,iEAAiE;AACjE,MAAM,WAAW,GAA6B;IAC5C,IAAI,EAAE,aAAa;IACnB,OA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3,13 +3,34 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { type AfterViewInit, ElementRef } from '@angular/core';
|
|
6
|
+
import { type AfterViewInit, ElementRef, type TemplateRef } from '@angular/core';
|
|
7
|
+
import { asTemplate, nodeText } from '../utilities/node-value.js';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Props for {@link AuthGuard} (React's `AuthGuardProps`, in Angular's form).
|
|
11
|
+
*
|
|
12
|
+
* The fallback UI is a `string | number | TemplateRef<unknown>` input or a
|
|
13
|
+
* projected `[slot=loadingFallback]`; the authenticated children are projected
|
|
14
|
+
* content, so they have no member.
|
|
15
|
+
*/
|
|
16
|
+
export interface AuthGuardProps {
|
|
17
|
+
/** Element rendered while the auth status is `loading`. */
|
|
18
|
+
loadingFallback?: string | number | TemplateRef<unknown>;
|
|
19
|
+
/** i18n key for the default loading-tag text (default `common.loading`). */
|
|
20
|
+
loadingKey?: string;
|
|
21
|
+
/** Fallback text if the i18n key is missing (default `Loading...`). */
|
|
22
|
+
loadingDefault?: string;
|
|
23
|
+
/** Path to redirect to when unauthenticated (default `/login`). */
|
|
24
|
+
loginPath?: string;
|
|
25
|
+
/** Fired when `isAuthenticated` becomes true (also when true at mount). */
|
|
26
|
+
onAuthenticated?: () => void;
|
|
27
|
+
}
|
|
8
28
|
/**
|
|
9
29
|
* Route-element guard for authenticated sections of a routing tree.
|
|
10
30
|
*
|
|
11
|
-
* While the auth status is `'loading'` it renders the `loadingFallback`
|
|
12
|
-
* (or
|
|
31
|
+
* While the auth status is `'loading'` it renders the `loadingFallback` input
|
|
32
|
+
* (or its `[slot=loadingFallback]` projection, or the default
|
|
33
|
+
* `data-mol-id="auth-guard-loading"` tag); while
|
|
13
34
|
* `'unauthenticated'` off the login path it renders nothing and redirects to
|
|
14
35
|
* `loginPath` (state `from` carries the attempted location); otherwise it
|
|
15
36
|
* renders the projected children. The host is unwrapped by the DOM normalizer
|
|
@@ -24,19 +45,30 @@ import * as i0 from "@angular/core";
|
|
|
24
45
|
* nothing at all while redirecting.
|
|
25
46
|
*/
|
|
26
47
|
export declare class AuthGuard implements AfterViewInit {
|
|
48
|
+
/**
|
|
49
|
+
* Element rendered while the auth status is `loading` (a node value, or the
|
|
50
|
+
* projected `[slot=loadingFallback]`). Overrides the default loading tag.
|
|
51
|
+
*/
|
|
52
|
+
loadingFallback?: AuthGuardProps['loadingFallback'];
|
|
27
53
|
/**
|
|
28
54
|
* i18n key for the default loading-tag text (default `common.loading`).
|
|
29
|
-
* Ignored when a `loadingFallback`
|
|
55
|
+
* Ignored when a `loadingFallback` is given.
|
|
30
56
|
*/
|
|
31
|
-
loadingKey?:
|
|
57
|
+
loadingKey?: AuthGuardProps['loadingKey'];
|
|
32
58
|
/** Fallback text if the i18n key is missing (default `Loading...`). */
|
|
33
|
-
loadingDefault?:
|
|
59
|
+
loadingDefault?: AuthGuardProps['loadingDefault'];
|
|
34
60
|
/** Path to redirect to when unauthenticated (default `/login`). */
|
|
35
|
-
loginPath?:
|
|
61
|
+
loginPath?: AuthGuardProps['loginPath'];
|
|
36
62
|
/** Fired when `isAuthenticated` becomes true (also when true at mount). */
|
|
37
|
-
onAuthenticated?:
|
|
63
|
+
onAuthenticated?: AuthGuardProps['onAuthenticated'];
|
|
64
|
+
/** Template helpers (templates see only class members). */
|
|
65
|
+
readonly asTemplate: typeof asTemplate;
|
|
66
|
+
/** Renders a plain-string/number node value. */
|
|
67
|
+
readonly nodeText: typeof nodeText;
|
|
38
68
|
/** The default loading tag. */
|
|
39
69
|
defaultLoading?: ElementRef<HTMLDivElement>;
|
|
70
|
+
/** The node-valued fallback (shown when the input is given). */
|
|
71
|
+
dataFallback?: ElementRef<HTMLSpanElement>;
|
|
40
72
|
/** The `loadingFallback` slot capture (always mounted). */
|
|
41
73
|
fallbackWrap?: ElementRef<HTMLSpanElement>;
|
|
42
74
|
/** The children capture; its nodes are moved bare into the host to render. */
|
|
@@ -89,6 +121,6 @@ export declare class AuthGuard implements AfterViewInit {
|
|
|
89
121
|
*/
|
|
90
122
|
loadingText(): string;
|
|
91
123
|
static ɵfac: i0.ɵɵFactoryDeclaration<AuthGuard, never>;
|
|
92
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AuthGuard, "mol-auth-guard", never, { "loadingKey": { "alias": "loadingKey"; "required": false; }; "loadingDefault": { "alias": "loadingDefault"; "required": false; }; "loginPath": { "alias": "loginPath"; "required": false; }; "onAuthenticated": { "alias": "onAuthenticated"; "required": false; }; }, {}, never, ["[slot=loadingFallback]", "*"], true, never>;
|
|
124
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AuthGuard, "mol-auth-guard", never, { "loadingFallback": { "alias": "loadingFallback"; "required": false; }; "loadingKey": { "alias": "loadingKey"; "required": false; }; "loadingDefault": { "alias": "loadingDefault"; "required": false; }; "loginPath": { "alias": "loginPath"; "required": false; }; "onAuthenticated": { "alias": "onAuthenticated"; "required": false; }; }, {}, never, ["[slot=loadingFallback]", "*"], true, never>;
|
|
93
125
|
}
|
|
94
126
|
//# sourceMappingURL=auth-guard.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-guard.component.d.ts","sourceRoot":"","sources":["../../src/components/auth-guard.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAGlB,UAAU,
|
|
1
|
+
{"version":3,"file":"auth-guard.component.d.ts","sourceRoot":"","sources":["../../src/components/auth-guard.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAGlB,UAAU,EAGV,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAItB,OAAO,EAAE,UAAU,EAAW,QAAQ,EAAE,MAAM,4BAA4B,CAAA;;AAI1E;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,GAAG,M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