@molecule/app-ui-angular 1.2.1 → 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 +2744 -912
- 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 +30 -4
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +80 -13
- 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
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Component, effect, ElementRef, inject, Renderer2, ViewChild, } from '@angular/core';
|
|
7
7
|
import { useAuth, useRouter, useTranslation } from '@molecule/app-angular';
|
|
8
|
+
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
8
9
|
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
10
|
+
import { MolTemplateOutlet } from './template-outlet.directive.js';
|
|
9
11
|
import * as i0 from "@angular/core";
|
|
10
12
|
const _c0 = ["defaultLoading"];
|
|
11
|
-
const _c1 = ["
|
|
12
|
-
const _c2 = ["
|
|
13
|
-
const _c3 = [
|
|
14
|
-
const _c4 = ["
|
|
13
|
+
const _c1 = ["dataFallback"];
|
|
14
|
+
const _c2 = ["fallbackWrap"];
|
|
15
|
+
const _c3 = ["childrenWrap"];
|
|
16
|
+
const _c4 = [[["", "slot", "loadingfallback"]], "*"];
|
|
17
|
+
const _c5 = ["[slot=loadingFallback]", "*"];
|
|
15
18
|
/**
|
|
16
19
|
* The pathname part of a login path (`/login?next=x` → `/login`).
|
|
17
20
|
*
|
|
@@ -22,8 +25,9 @@ const loginPathname = (loginPath) => loginPath.split(/[?#]/)[0] || '/';
|
|
|
22
25
|
/**
|
|
23
26
|
* Route-element guard for authenticated sections of a routing tree.
|
|
24
27
|
*
|
|
25
|
-
* While the auth status is `'loading'` it renders the `loadingFallback`
|
|
26
|
-
* (or
|
|
28
|
+
* While the auth status is `'loading'` it renders the `loadingFallback` input
|
|
29
|
+
* (or its `[slot=loadingFallback]` projection, or the default
|
|
30
|
+
* `data-mol-id="auth-guard-loading"` tag); while
|
|
27
31
|
* `'unauthenticated'` off the login path it renders nothing and redirects to
|
|
28
32
|
* `loginPath` (state `from` carries the attempted location); otherwise it
|
|
29
33
|
* renders the projected children. The host is unwrapped by the DOM normalizer
|
|
@@ -38,9 +42,14 @@ const loginPathname = (loginPath) => loginPath.split(/[?#]/)[0] || '/';
|
|
|
38
42
|
* nothing at all while redirecting.
|
|
39
43
|
*/
|
|
40
44
|
export class AuthGuard {
|
|
45
|
+
/**
|
|
46
|
+
* Element rendered while the auth status is `loading` (a node value, or the
|
|
47
|
+
* projected `[slot=loadingFallback]`). Overrides the default loading tag.
|
|
48
|
+
*/
|
|
49
|
+
loadingFallback;
|
|
41
50
|
/**
|
|
42
51
|
* i18n key for the default loading-tag text (default `common.loading`).
|
|
43
|
-
* Ignored when a `loadingFallback`
|
|
52
|
+
* Ignored when a `loadingFallback` is given.
|
|
44
53
|
*/
|
|
45
54
|
loadingKey;
|
|
46
55
|
/** Fallback text if the i18n key is missing (default `Loading...`). */
|
|
@@ -49,8 +58,14 @@ export class AuthGuard {
|
|
|
49
58
|
loginPath;
|
|
50
59
|
/** Fired when `isAuthenticated` becomes true (also when true at mount). */
|
|
51
60
|
onAuthenticated;
|
|
61
|
+
/** Template helpers (templates see only class members). */
|
|
62
|
+
asTemplate = asTemplate;
|
|
63
|
+
/** Renders a plain-string/number node value. */
|
|
64
|
+
nodeText = nodeText;
|
|
52
65
|
/** The default loading tag. */
|
|
53
66
|
defaultLoading;
|
|
67
|
+
/** The node-valued fallback (shown when the input is given). */
|
|
68
|
+
dataFallback;
|
|
54
69
|
/** The `loadingFallback` slot capture (always mounted). */
|
|
55
70
|
fallbackWrap;
|
|
56
71
|
/** The children capture; its nodes are moved bare into the host to render. */
|
|
@@ -148,8 +163,11 @@ export class AuthGuard {
|
|
|
148
163
|
// The capture span itself never renders (React's children are bare).
|
|
149
164
|
this.sync.sync(this.childrenWrap?.nativeElement, false);
|
|
150
165
|
}
|
|
151
|
-
|
|
152
|
-
|
|
166
|
+
const loading = branch === 'loading';
|
|
167
|
+
const hasNode = isGiven(this.loadingFallback);
|
|
168
|
+
this.sync.sync(this.defaultLoading?.nativeElement, loading && !hasNode && !this.hasFallback);
|
|
169
|
+
this.sync.sync(this.fallbackWrap?.nativeElement, loading && !hasNode && this.hasFallback);
|
|
170
|
+
this.sync.sync(this.dataFallback?.nativeElement, loading && hasNode);
|
|
153
171
|
}
|
|
154
172
|
/**
|
|
155
173
|
* The localized default loading text.
|
|
@@ -162,45 +180,62 @@ export class AuthGuard {
|
|
|
162
180
|
}
|
|
163
181
|
static ɵfac = function AuthGuard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AuthGuard)(); };
|
|
164
182
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthGuard, selectors: [["mol-auth-guard"]], viewQuery: function AuthGuard_Query(rf, ctx) { if (rf & 1) {
|
|
165
|
-
i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5);
|
|
183
|
+
i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5)(_c3, 5);
|
|
166
184
|
} if (rf & 2) {
|
|
167
185
|
let _t;
|
|
168
186
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.defaultLoading = _t.first);
|
|
187
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dataFallback = _t.first);
|
|
169
188
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fallbackWrap = _t.first);
|
|
170
189
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.childrenWrap = _t.first);
|
|
171
|
-
} }, hostAttrs: ["data-parity-unwrap", "", 2, "display", "contents"], inputs: { loadingKey: "loadingKey", loadingDefault: "loadingDefault", loginPath: "loginPath", onAuthenticated: "onAuthenticated" }, ngContentSelectors:
|
|
172
|
-
i0.ɵɵprojectionDef(
|
|
173
|
-
i0.ɵɵ
|
|
190
|
+
} }, hostAttrs: ["data-parity-unwrap", "", 2, "display", "contents"], inputs: { loadingFallback: "loadingFallback", loadingKey: "loadingKey", loadingDefault: "loadingDefault", loginPath: "loginPath", onAuthenticated: "onAuthenticated" }, ngContentSelectors: _c5, decls: 13, vars: 3, consts: [["defaultLoading", ""], ["dataFallback", ""], ["fallbackWrap", ""], ["childrenWrap", ""], ["data-mol-id", "auth-guard-loading"], [3, "molTemplateOutlet"]], template: function AuthGuard_Template(rf, ctx) { if (rf & 1) {
|
|
191
|
+
i0.ɵɵprojectionDef(_c4);
|
|
192
|
+
i0.ɵɵelementStart(0, "div", 4, 0);
|
|
174
193
|
i0.ɵɵtext(2);
|
|
175
|
-
i0.ɵɵ
|
|
176
|
-
i0.ɵɵ
|
|
177
|
-
i0.ɵɵ
|
|
178
|
-
i0.ɵɵ
|
|
179
|
-
i0.ɵɵ
|
|
180
|
-
i0.ɵɵ
|
|
181
|
-
i0.ɵɵ
|
|
194
|
+
i0.ɵɵelementEnd();
|
|
195
|
+
i0.ɵɵelementStart(3, "span", null, 1);
|
|
196
|
+
i0.ɵɵelementContainer(5, 5);
|
|
197
|
+
i0.ɵɵtext(6);
|
|
198
|
+
i0.ɵɵelementEnd();
|
|
199
|
+
i0.ɵɵelementStart(7, "span", null, 2);
|
|
200
|
+
i0.ɵɵprojection(9);
|
|
201
|
+
i0.ɵɵelementEnd();
|
|
202
|
+
i0.ɵɵelementStart(10, "span", null, 3);
|
|
203
|
+
i0.ɵɵprojection(12, 1);
|
|
204
|
+
i0.ɵɵelementEnd();
|
|
182
205
|
} if (rf & 2) {
|
|
183
206
|
i0.ɵɵadvance(2);
|
|
184
207
|
i0.ɵɵtextInterpolate(ctx.loadingText());
|
|
185
|
-
|
|
208
|
+
i0.ɵɵadvance(3);
|
|
209
|
+
i0.ɵɵproperty("molTemplateOutlet", ctx.asTemplate(ctx.loadingFallback));
|
|
210
|
+
i0.ɵɵadvance();
|
|
211
|
+
i0.ɵɵtextInterpolate(ctx.nodeText(ctx.loadingFallback));
|
|
212
|
+
} }, dependencies: [MolTemplateOutlet], encapsulation: 2 });
|
|
186
213
|
}
|
|
187
214
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthGuard, [{
|
|
188
215
|
type: Component,
|
|
189
216
|
args: [{
|
|
190
217
|
selector: 'mol-auth-guard',
|
|
191
218
|
standalone: true,
|
|
192
|
-
|
|
219
|
+
imports: [MolTemplateOutlet],
|
|
220
|
+
inputs: ['loadingFallback', 'loadingKey', 'loadingDefault', 'loginPath', 'onAuthenticated'],
|
|
193
221
|
host: {
|
|
194
222
|
'data-parity-unwrap': '',
|
|
195
223
|
style: 'display: contents',
|
|
196
224
|
},
|
|
197
225
|
template: `<div data-mol-id="auth-guard-loading" #defaultLoading>{{ loadingText() }}</div>
|
|
226
|
+
<span #dataFallback
|
|
227
|
+
><ng-container [molTemplateOutlet]="asTemplate(loadingFallback)"></ng-container
|
|
228
|
+
>{{ nodeText(loadingFallback) }}</span
|
|
229
|
+
>
|
|
198
230
|
<span #fallbackWrap><ng-content select="[slot=loadingFallback]"></ng-content></span>
|
|
199
231
|
<span #childrenWrap><ng-content></ng-content></span>`,
|
|
200
232
|
}]
|
|
201
233
|
}], null, { defaultLoading: [{
|
|
202
234
|
type: ViewChild,
|
|
203
235
|
args: ['defaultLoading']
|
|
236
|
+
}], dataFallback: [{
|
|
237
|
+
type: ViewChild,
|
|
238
|
+
args: ['dataFallback']
|
|
204
239
|
}], fallbackWrap: [{
|
|
205
240
|
type: ViewChild,
|
|
206
241
|
args: ['fallbackWrap']
|
|
@@ -208,5 +243,5 @@ export class AuthGuard {
|
|
|
208
243
|
type: ViewChild,
|
|
209
244
|
args: ['childrenWrap']
|
|
210
245
|
}] }); })();
|
|
211
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AuthGuard, { className: "AuthGuard", filePath: "components/auth-guard.component.ts", lineNumber:
|
|
246
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AuthGuard, { className: "AuthGuard", filePath: "components/auth-guard.component.ts", lineNumber: 88 }); })();
|
|
212
247
|
//# sourceMappingURL=auth-guard.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-guard.component.js","sourceRoot":"","sources":["../../src/components/auth-guard.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EACT,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,
|
|
1
|
+
{"version":3,"file":"auth-guard.component.js","sourceRoot":"","sources":["../../src/components/auth-guard.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EACT,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EAET,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE1E,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;;;;;;;;AAsBlE;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAU,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAA;AAEtF;;;;;;;;;;;;;;;;;;GAkBG;AAkBH,MAAM,OAAO,SAAS;IACpB;;;OAGG;IACH,eAAe,CAAoC;IACnD;;;OAGG;IACH,UAAU,CAA+B;IACzC,uEAAuE;IACvE,cAAc,CAAmC;IACjD,mEAAmE;IACnE,SAAS,CAA8B;IACvC,2EAA2E;IAC3E,eAAe,CAAoC;IAEnD,2DAA2D;IAClD,UAAU,GAAG,UAAU,CAAA;IAChC,gDAAgD;IACvC,QAAQ,GAAG,QAAQ,CAAA;IAE5B,+BAA+B;IACF,cAAc,CAA6B;IACxE,gEAAgE;IACrC,YAAY,CAA8B;IACrE,2DAA2D;IAChC,YAAY,CAA8B;IACrE,8EAA8E;IACnD,YAAY,CAA8B;IAErE,6DAA6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O;YACpF,sCAAoB;YAAA,sBAAyB;YAAA,iBAAO;;YANW,eAAmB;YAAnB,uCAAmB;YAEjE,eAAiD;YAAjD,uEAAiD;YAC/D,cAA+B;YAA/B,uDAA+B;4BAT1B,iBAAiB;;iFAchB,SAAS;cAjBrB,SAAS;eAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,iBAAiB,CAAC;gBAC5B,MAAM,EAAE,CAAC,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,CAAC;gBAC3F,IAAI,EAAE;oBACJ,oBAAoB,EAAE,EAAE;oBACxB,KAAK,EAAE,mBAAmB;iBAC3B;gBACD,QAAQ,EAAE;;;;;;yDAM6C;aACxD;;kBAyBE,SAAS;mBAAC,gBAAgB;;kBAE1B,SAAS;mBAAC,cAAc;;kBAExB,SAAS;mBAAC,cAAc;;kBAExB,SAAS;mBAAC,cAAc;;kFA9Bd,SAAS"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type AfterViewChecked, ElementRef } from '@angular/core';
|
|
7
7
|
import type { 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
|
/**
|
|
@@ -17,7 +18,7 @@ import * as i0 from "@angular/core";
|
|
|
17
18
|
* detached from the DOM per React's ternary, since projected-content presence
|
|
18
19
|
* is only knowable at view init ({@link SlotWrapper}).
|
|
19
20
|
*/
|
|
20
|
-
export declare class Avatar implements AfterViewChecked {
|
|
21
|
+
export declare class Avatar implements AfterViewChecked, HasElement<HTMLDivElement> {
|
|
21
22
|
/** Image source. */
|
|
22
23
|
src?: string;
|
|
23
24
|
/** Image alt text. */
|
|
@@ -34,6 +35,10 @@ export declare class Avatar implements AfterViewChecked {
|
|
|
34
35
|
style?: Record<string, unknown>;
|
|
35
36
|
/** `data-testid`. */
|
|
36
37
|
testId?: string;
|
|
38
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
39
|
+
automationId?: string;
|
|
40
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
41
|
+
dataMolId?: string;
|
|
37
42
|
/** Set when the image fails to load. */
|
|
38
43
|
readonly imageError: import("@angular/core").WritableSignal<boolean>;
|
|
39
44
|
/** The fallback container (React renders it only on the fallback branch). */
|
|
@@ -49,6 +54,9 @@ export declare class Avatar implements AfterViewChecked {
|
|
|
49
54
|
*/
|
|
50
55
|
private readonly i18n;
|
|
51
56
|
private readonly sync;
|
|
57
|
+
private readonly host;
|
|
58
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
59
|
+
readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
|
|
52
60
|
/**
|
|
53
61
|
* The current class map.
|
|
54
62
|
* @returns The UIClassMap.
|
|
@@ -79,6 +87,11 @@ export declare class Avatar implements AfterViewChecked {
|
|
|
79
87
|
* @returns The class string.
|
|
80
88
|
*/
|
|
81
89
|
classes(): string;
|
|
90
|
+
/**
|
|
91
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
92
|
+
* @returns The attribute value.
|
|
93
|
+
*/
|
|
94
|
+
molId(): string | undefined;
|
|
82
95
|
/**
|
|
83
96
|
* Serializes the merged inline style (an exact pixel size inline).
|
|
84
97
|
* @returns The style attribute text.
|
|
@@ -92,6 +105,6 @@ export declare class Avatar implements AfterViewChecked {
|
|
|
92
105
|
*/
|
|
93
106
|
ngAfterViewChecked(): void;
|
|
94
107
|
static ɵfac: i0.ɵɵFactoryDeclaration<Avatar, never>;
|
|
95
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Avatar, "div[mol-avatar]", never, { "src": { "alias": "src"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["[slot=fallback]"], true, never>;
|
|
108
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Avatar, "div[mol-avatar]", never, { "src": { "alias": "src"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "rounded": { "alias": "rounded"; "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; }; }, {}, never, ["[slot=fallback]"], true, never>;
|
|
96
109
|
}
|
|
97
110
|
//# sourceMappingURL=avatar.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.component.d.ts","sourceRoot":"","sources":["../../src/components/avatar.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EAErB,UAAU,EAKX,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"avatar.component.d.ts","sourceRoot":"","sources":["../../src/components/avatar.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EAErB,UAAU,EAKX,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAA;AAEtE,OAAO,EAAc,KAAK,YAAY,EAAe,MAAM,6BAA6B,CAAA;;AAIxF;;;;;;;;;GASG;AACH,qBAqCa,MAAO,YAAW,gBAAgB,EAAE,UAAU,CAAC,cAAc,CAAC;IACzE,oBA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H,OAAO,IAAI,MAAM;IASjB;;;OAGG;IACH,KAAK,IAAI,MAAM,GAAG,SAAS;IAS3B;;;OAGG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAM1B;;;;;OAKG;IACH,kBAAkB,IAAI,IAAI;yCAhIf,MAAM;2CAAN,MAAM;CA4IlB"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Component, ElementRef, inject, Renderer2, signal, 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 { getInitials } from '../utilities/initials.js';
|
|
10
11
|
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
11
12
|
import { styleText } from '../utilities/style.js';
|
|
@@ -73,6 +74,10 @@ export class Avatar {
|
|
|
73
74
|
style;
|
|
74
75
|
/** `data-testid`. */
|
|
75
76
|
testId;
|
|
77
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
78
|
+
automationId;
|
|
79
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
80
|
+
dataMolId;
|
|
76
81
|
/** Set when the image fails to load. */
|
|
77
82
|
imageError = signal(false, /* @ts-ignore */
|
|
78
83
|
...(ngDevMode ? [{ debugName: "imageError" }] : /* istanbul ignore next */ []));
|
|
@@ -89,6 +94,9 @@ export class Avatar {
|
|
|
89
94
|
*/
|
|
90
95
|
i18n = useTranslation();
|
|
91
96
|
sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
|
|
97
|
+
host = inject(ElementRef);
|
|
98
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
99
|
+
element = hostElement(this.host);
|
|
92
100
|
/**
|
|
93
101
|
* The current class map.
|
|
94
102
|
* @returns The UIClassMap.
|
|
@@ -132,6 +140,16 @@ export class Avatar {
|
|
|
132
140
|
const avatarSize = typeof this.size === 'number' ? undefined : this.size;
|
|
133
141
|
return this.cm().cn(this.cm().avatar({ size: avatarSize }), !this.rounded && this.cm().avatarSquare, this.className);
|
|
134
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
145
|
+
* @returns The attribute value.
|
|
146
|
+
*/
|
|
147
|
+
molId() {
|
|
148
|
+
return (this.automationId ??
|
|
149
|
+
this.dataMolId ??
|
|
150
|
+
this.host.nativeElement.getAttribute('data-mol-id') ??
|
|
151
|
+
undefined);
|
|
152
|
+
}
|
|
135
153
|
/**
|
|
136
154
|
* Serializes the merged inline style (an exact pixel size inline).
|
|
137
155
|
* @returns The style attribute text.
|
|
@@ -164,11 +182,11 @@ export class Avatar {
|
|
|
164
182
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fallbackEl = _t.first);
|
|
165
183
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.initialsEl = _t.first);
|
|
166
184
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.userGlyph = _t.first);
|
|
167
|
-
} }, hostVars:
|
|
168
|
-
i0.ɵɵattribute("data-testid", ctx.testId);
|
|
185
|
+
} }, hostVars: 6, hostBindings: function Avatar_HostBindings(rf, ctx) { if (rf & 2) {
|
|
186
|
+
i0.ɵɵattribute("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
169
187
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
170
188
|
i0.ɵɵclassMap(ctx.classes());
|
|
171
|
-
} }, inputs: { src: "src", alt: "alt", name: "name", size: "size", rounded: "rounded", className: "className", style: "style", testId: "testId" }, ngContentSelectors: _c4, decls: 2, vars: 1, consts: [["fallbackEl", ""], ["initialsEl", ""], ["userGlyph", ""], [3, "src", "class"], [3, "class"], [3, "error", "src"], ["mol-icon", "", 3, "data"]], template: function Avatar_Template(rf, ctx) { if (rf & 1) {
|
|
189
|
+
} }, inputs: { src: "src", alt: "alt", name: "name", size: "size", rounded: "rounded", className: "className", style: "style", testId: "testId", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"] }, ngContentSelectors: _c4, decls: 2, vars: 1, consts: [["fallbackEl", ""], ["initialsEl", ""], ["userGlyph", ""], [3, "src", "class"], [3, "class"], [3, "error", "src"], ["mol-icon", "", 3, "data"]], template: function Avatar_Template(rf, ctx) { if (rf & 1) {
|
|
172
190
|
i0.ɵɵprojectionDef(_c3);
|
|
173
191
|
i0.ɵɵconditionalCreate(0, Avatar_Conditional_0_Template, 1, 4, "img", 3)(1, Avatar_Conditional_1_Template, 8, 6, "div", 4);
|
|
174
192
|
} if (rf & 2) {
|
|
@@ -181,11 +199,23 @@ export class Avatar {
|
|
|
181
199
|
selector: 'div[mol-avatar]',
|
|
182
200
|
standalone: true,
|
|
183
201
|
imports: [MolIconSvg],
|
|
184
|
-
inputs: [
|
|
202
|
+
inputs: [
|
|
203
|
+
'src',
|
|
204
|
+
'alt',
|
|
205
|
+
'name',
|
|
206
|
+
'size',
|
|
207
|
+
'rounded',
|
|
208
|
+
'className',
|
|
209
|
+
'style',
|
|
210
|
+
'testId',
|
|
211
|
+
'automationId',
|
|
212
|
+
'dataMolId: data-mol-id',
|
|
213
|
+
],
|
|
185
214
|
host: {
|
|
186
215
|
'[class]': 'classes()',
|
|
187
216
|
'[style]': 'hostStyle()',
|
|
188
217
|
'[attr.data-testid]': 'testId',
|
|
218
|
+
'[attr.data-mol-id]': 'molId()',
|
|
189
219
|
},
|
|
190
220
|
template: `@if (!showFallback()) {
|
|
191
221
|
<img
|
|
@@ -212,5 +242,5 @@ export class Avatar {
|
|
|
212
242
|
type: ViewChild,
|
|
213
243
|
args: ['userGlyph', { read: ElementRef }]
|
|
214
244
|
}] }); })();
|
|
215
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Avatar, { className: "Avatar", filePath: "components/avatar.component.ts", lineNumber:
|
|
245
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Avatar, { className: "Avatar", filePath: "components/avatar.component.ts", lineNumber: 74 }); })();
|
|
216
246
|
//# sourceMappingURL=avatar.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.component.js","sourceRoot":"","sources":["../../src/components/avatar.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EACT,UAAU,EACV,MAAM,EACN,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,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,UAAU,EAAqB,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"avatar.component.js","sourceRoot":"","sources":["../../src/components/avatar.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EACT,UAAU,EACV,MAAM,EACN,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,EAAmB,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,UAAU,EAAqB,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,WAAW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,SAAS;eAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,UAAU,CAAC;gBACrB,MAAM,EAAE;oBACN,KAAK;oBACL,KAAK;oBACL,MAAM;oBACN,MAAM;oBACN,SAAS;oBACT,WAAW;oBACX,OAAO;oBACP,QAAQ;oBACR,cAAc;oBACd,wBAAwB;iBACzB;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;oBACtB,SAAS,EAAE,aAAa;oBACxB,oBAAoB,EAAE,QAAQ;oBAC9B,oBAAoB,EAAE,SAAS;iBAChC;gBACD,QAAQ,EAAE;;;;;;;;;;;;;MAaN;aACL;;kBA2BE,SAAS;mBAAC,YAAY;;kBAEtB,SAAS;mBAAC,YAAY;;kBAEtB,SAAS;mBAAC,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;;kFA9BjC,MAAM"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ColorVariant, Size, UIClassMap } from '@molecule/app-ui';
|
|
2
|
+
import { type HasElement } from '../utilities/element.js';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
/**
|
|
4
5
|
* Badge component.
|
|
@@ -6,7 +7,10 @@ import * as i0 from "@angular/core";
|
|
|
6
7
|
* The host element is the `<span>` React renders (`span[mol-badge]`); the
|
|
7
8
|
* color variant maps to `badge({ variant })` exactly as React's `Badge`.
|
|
8
9
|
*/
|
|
9
|
-
export declare class Badge {
|
|
10
|
+
export declare class Badge implements HasElement<HTMLSpanElement> {
|
|
11
|
+
private readonly host;
|
|
12
|
+
/** The element a caller's ref receives: the host `<span>`. */
|
|
13
|
+
readonly element: import("@angular/core").Signal<HTMLSpanElement | null>;
|
|
10
14
|
/** Named color variant (`primary`, `success`, …). */
|
|
11
15
|
color: ColorVariant;
|
|
12
16
|
/** Visual style (kept for React prop parity; the class map keys off `color`). */
|
|
@@ -21,6 +25,10 @@ export declare class Badge {
|
|
|
21
25
|
style?: Record<string, unknown>;
|
|
22
26
|
/** `data-testid` for the badge. */
|
|
23
27
|
testId?: string;
|
|
28
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
29
|
+
automationId?: string;
|
|
30
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
31
|
+
dataMolId?: string;
|
|
24
32
|
/**
|
|
25
33
|
* The current class map.
|
|
26
34
|
* @returns The UIClassMap.
|
|
@@ -31,12 +39,17 @@ export declare class Badge {
|
|
|
31
39
|
* @returns The class string.
|
|
32
40
|
*/
|
|
33
41
|
classes(): string;
|
|
42
|
+
/**
|
|
43
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
44
|
+
* @returns The attribute value.
|
|
45
|
+
*/
|
|
46
|
+
molId(): string | undefined;
|
|
34
47
|
/**
|
|
35
48
|
* Serializes the inline style.
|
|
36
49
|
* @returns The style attribute text.
|
|
37
50
|
*/
|
|
38
51
|
hostStyle(): string | null;
|
|
39
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<Badge, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Badge, "span[mol-badge]", never, { "color": { "alias": "color"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Badge, "span[mol-badge]", never, { "color": { "alias": "color"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "rounded": { "alias": "rounded"; "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; }; }, {}, never, ["*"], true, never>;
|
|
41
54
|
}
|
|
42
55
|
//# sourceMappingURL=badge.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.component.d.ts","sourceRoot":"","sources":["../../src/components/badge.component.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;
|
|
1
|
+
{"version":3,"file":"badge.component.d.ts","sourceRoot":"","sources":["../../src/components/badge.component.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGtE,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAA;;AAGtE;;;;;GAKG;AACH,qBAsBa,KAAM,YAAW,UAAU,CAAC,eAAe,CAAC;IACvD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkD;IACvE,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,yDAAyB;IAEzC,qDAAqD;IACrD,KAAK,EAAE,YAAY,CAAY;IAC/B,iFAAiF;IACjF,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAU;IACjD,kBAAkB;IAClB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,8DAA8D;IAC9D,OAAO,UAAO;IACd,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAQjB;;;OAGG;IACH,KAAK,IAAI,MAAM,GAAG,SAAS;IAS3B;;;OAGG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;yCA7Df,KAAK;2CAAL,KAAK;CAgEjB"}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { Component } from '@angular/core';
|
|
6
|
+
import { Component, ElementRef, inject } from '@angular/core';
|
|
7
7
|
import { getClassMap } from '@molecule/app-ui';
|
|
8
|
+
import { hostElement } from '../utilities/element.js';
|
|
8
9
|
import { styleText } from '../utilities/style.js';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
const _c0 = ["*"];
|
|
@@ -15,6 +16,9 @@ const _c0 = ["*"];
|
|
|
15
16
|
* color variant maps to `badge({ variant })` exactly as React's `Badge`.
|
|
16
17
|
*/
|
|
17
18
|
export class Badge {
|
|
19
|
+
host = inject(ElementRef);
|
|
20
|
+
/** The element a caller's ref receives: the host `<span>`. */
|
|
21
|
+
element = hostElement(this.host);
|
|
18
22
|
/** Named color variant (`primary`, `success`, …). */
|
|
19
23
|
color = 'primary';
|
|
20
24
|
/** Visual style (kept for React prop parity; the class map keys off `color`). */
|
|
@@ -29,6 +33,10 @@ export class Badge {
|
|
|
29
33
|
style;
|
|
30
34
|
/** `data-testid` for the badge. */
|
|
31
35
|
testId;
|
|
36
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
37
|
+
automationId;
|
|
38
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
39
|
+
dataMolId;
|
|
32
40
|
/**
|
|
33
41
|
* The current class map.
|
|
34
42
|
* @returns The UIClassMap.
|
|
@@ -43,6 +51,16 @@ export class Badge {
|
|
|
43
51
|
classes() {
|
|
44
52
|
return this.cm().cn(this.cm().badge({ variant: this.color, size: this.size }), !this.rounded && this.cm().badgeSquare, this.className);
|
|
45
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
56
|
+
* @returns The attribute value.
|
|
57
|
+
*/
|
|
58
|
+
molId() {
|
|
59
|
+
return (this.automationId ??
|
|
60
|
+
this.dataMolId ??
|
|
61
|
+
this.host.nativeElement.getAttribute('data-mol-id') ??
|
|
62
|
+
undefined);
|
|
63
|
+
}
|
|
46
64
|
/**
|
|
47
65
|
* Serializes the inline style.
|
|
48
66
|
* @returns The style attribute text.
|
|
@@ -51,11 +69,11 @@ export class Badge {
|
|
|
51
69
|
return styleText(this.style);
|
|
52
70
|
}
|
|
53
71
|
static ɵfac = function Badge_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Badge)(); };
|
|
54
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Badge, selectors: [["span", "mol-badge", ""]], hostVars:
|
|
55
|
-
i0.ɵɵattribute("data-testid", ctx.testId);
|
|
72
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Badge, selectors: [["span", "mol-badge", ""]], hostVars: 6, hostBindings: function Badge_HostBindings(rf, ctx) { if (rf & 2) {
|
|
73
|
+
i0.ɵɵattribute("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
56
74
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
57
75
|
i0.ɵɵclassMap(ctx.classes());
|
|
58
|
-
} }, inputs: { color: "color", variant: "variant", size: "size", rounded: "rounded", className: "className", style: "style", testId: "testId" }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function Badge_Template(rf, ctx) { if (rf & 1) {
|
|
76
|
+
} }, inputs: { color: "color", variant: "variant", size: "size", rounded: "rounded", className: "className", style: "style", testId: "testId", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"] }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function Badge_Template(rf, ctx) { if (rf & 1) {
|
|
59
77
|
i0.ɵɵprojectionDef();
|
|
60
78
|
i0.ɵɵprojection(0);
|
|
61
79
|
} }, encapsulation: 2 });
|
|
@@ -65,14 +83,25 @@ export class Badge {
|
|
|
65
83
|
args: [{
|
|
66
84
|
selector: 'span[mol-badge]',
|
|
67
85
|
standalone: true,
|
|
68
|
-
inputs: [
|
|
86
|
+
inputs: [
|
|
87
|
+
'color',
|
|
88
|
+
'variant',
|
|
89
|
+
'size',
|
|
90
|
+
'rounded',
|
|
91
|
+
'className',
|
|
92
|
+
'style',
|
|
93
|
+
'testId',
|
|
94
|
+
'automationId',
|
|
95
|
+
'dataMolId: data-mol-id',
|
|
96
|
+
],
|
|
69
97
|
host: {
|
|
70
98
|
'[class]': 'classes()',
|
|
71
99
|
'[style]': 'hostStyle()',
|
|
72
100
|
'[attr.data-testid]': 'testId',
|
|
101
|
+
'[attr.data-mol-id]': 'molId()',
|
|
73
102
|
},
|
|
74
103
|
template: `<ng-content></ng-content>`,
|
|
75
104
|
}]
|
|
76
105
|
}], null, null); })();
|
|
77
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Badge, { className: "Badge", filePath: "components/badge.component.ts", lineNumber:
|
|
106
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Badge, { className: "Badge", filePath: "components/badge.component.ts", lineNumber: 43 }); })();
|
|
78
107
|
//# sourceMappingURL=badge.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.component.js","sourceRoot":"","sources":["../../src/components/badge.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"badge.component.js","sourceRoot":"","sources":["../../src/components/badge.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAmB,WAAW,EAAE,MAAM,yBA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KAAK;6DAAL,KAAK;qEAAL,WAAO;YAAP,cAAA,eAAW,CAAN;YAAL,cAAA,aAAS,CAAJ;;;YAFL,kBAAyB;;;iFAEzB,KAAK;cAtBjB,SAAS;eAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE;oBACN,OAAO;oBACP,SAAS;oBACT,MAAM;oBACN,SAAS;oBACT,WAAW;oBACX,OAAO;oBACP,QAAQ;oBACR,cAAc;oBACd,wBAAwB;iBACzB;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;oBACtB,SAAS,EAAE,aAAa;oBACxB,oBAAoB,EAAE,QAAQ;oBAC9B,oBAAoB,EAAE,SAAS;iBAChC;gBACD,QAAQ,EAAE,2BAA2B;aACtC;;kFACY,KAAK"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type AfterViewInit, type DoCheck, ElementRef, Renderer2 } from '@angular/core';
|
|
7
7
|
import type { ButtonVariant, ColorVariant, Size, UIClassMap } from '@molecule/app-ui';
|
|
8
|
+
import { type HasElement } from '../utilities/element.js';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* Whether an ng-content wrapper captured any element or text node.
|
|
@@ -55,7 +56,7 @@ export declare class SlotWrapper {
|
|
|
55
56
|
* wrapper from the DOM (the projected nodes must have an always-mounted
|
|
56
57
|
* capture point, so the wrapper lives in the template unconditionally).
|
|
57
58
|
*/
|
|
58
|
-
export declare class Button implements AfterViewInit, DoCheck {
|
|
59
|
+
export declare class Button implements AfterViewInit, DoCheck, HasElement<HTMLButtonElement> {
|
|
59
60
|
/** Button variant. */
|
|
60
61
|
variant: ButtonVariant;
|
|
61
62
|
/** Button color. */
|
|
@@ -74,6 +75,13 @@ export declare class Button implements AfterViewInit, DoCheck {
|
|
|
74
75
|
style?: Record<string, unknown>;
|
|
75
76
|
/** `data-testid` for the button. */
|
|
76
77
|
testId?: string;
|
|
78
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
79
|
+
automationId?: string;
|
|
80
|
+
/**
|
|
81
|
+
* A `data-mol-id` passed as a plain rest attribute (React spreads it onto
|
|
82
|
+
* the root); `automationId` wins when both are given.
|
|
83
|
+
*/
|
|
84
|
+
dataMolId?: string;
|
|
77
85
|
/** Disables the button. */
|
|
78
86
|
disabled: boolean;
|
|
79
87
|
/** The button's `type` attribute. */
|
|
@@ -83,11 +91,21 @@ export declare class Button implements AfterViewInit, DoCheck {
|
|
|
83
91
|
/** The right icon wrapper. */
|
|
84
92
|
rightSlot?: ElementRef<HTMLSpanElement>;
|
|
85
93
|
private readonly sync;
|
|
94
|
+
private readonly host;
|
|
95
|
+
/** The element a caller's ref receives: the host `<button>`. */
|
|
96
|
+
readonly element: import("@angular/core").Signal<HTMLButtonElement | null>;
|
|
86
97
|
/**
|
|
87
98
|
* The current class map.
|
|
88
99
|
* @returns The UIClassMap.
|
|
89
100
|
*/
|
|
90
101
|
cm(): UIClassMap;
|
|
102
|
+
/**
|
|
103
|
+
* The `data-mol-id` value: `automationId` when given, else a caller's own
|
|
104
|
+
* `data-mol-id` (the `dataMolId` prop or a `[attr.data-mol-id]` binding on
|
|
105
|
+
* the element), matching React's `rootProps` precedence.
|
|
106
|
+
* @returns The attribute value, or undefined.
|
|
107
|
+
*/
|
|
108
|
+
molId(): string | undefined;
|
|
91
109
|
/**
|
|
92
110
|
* Computes the button class list.
|
|
93
111
|
* @returns The class string.
|
|
@@ -115,6 +133,6 @@ export declare class Button implements AfterViewInit, DoCheck {
|
|
|
115
133
|
*/
|
|
116
134
|
private syncWrappers;
|
|
117
135
|
static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
|
|
118
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "button[mol-button]", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["[slot=leftIcon]", "*", "[slot=rightIcon]"], true, never>;
|
|
136
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "button[mol-button]", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "type": { "alias": "type"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; }, {}, never, ["[slot=leftIcon]", "*", "[slot=rightIcon]"], true, never>;
|
|
119
137
|
}
|
|
120
138
|
//# sourceMappingURL=button.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../src/components/button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,UAAU,EAEV,SAAS,EAEV,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;
|
|
1
|
+
{"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../src/components/button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,UAAU,EAEV,SAAS,EAEV,MAAM,eAAe,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