@molecule/app-status-summary-angular 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -26
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/status-summary.component.d.ts +15 -9
- package/dist/status-summary.component.d.ts.map +1 -1
- package/dist/status-summary.component.js +47 -39
- package/dist/status-summary.component.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-21T12:47:27.141Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-status-summary-angular
|
|
@@ -156,7 +156,7 @@ rendered through `NgTemplateOutlet`; text fields render as text.
|
|
|
156
156
|
'[class]': 'classes()',
|
|
157
157
|
},
|
|
158
158
|
// prettier-ignore
|
|
159
|
-
template: `<div [class]="bannerClasses()" [style]="bannerStyle()"><span [class]="labelClasses()">{{ overallLabel() }}</span><ng-content select="[slot=header]"></ng-content></div>@for (group of groups; track group.id) {<section [class]="sectionClasses()"><h3 [class]="groupNameClasses()">@if (isNode(group.name)) {<ng-container [ngTemplateOutlet]="group.name" />}@else {<ng-container>{{ textOf(group.name) }}</ng-container>}</h3><ul [class]="listClasses()">@for (component of group.components; track component.id) {<li [class]="rowClasses()"><div><span [class]="componentNameClasses()">@if (isNode(component.name)) {<ng-container [ngTemplateOutlet]="component.name" />}@else {<ng-container>{{ textOf(component.name) }}</ng-container>}</span>@if (component.subtitle) {<span [class]="subtitleClasses()">@if (isNode(component.subtitle)) {<ng-container [ngTemplateOutlet]="component.subtitle" />}@else {<ng-container>{{ textOf(component.subtitle) }}</ng-container>}</span>}</div><span [class]="badgeClasses()" [style]="badgeStyle(
|
|
159
|
+
template: `<div [class]="bannerClasses()" [style]="bannerStyle()"><span [class]="labelClasses()">{{ overallLabel() }}</span><ng-content select="[slot=header]"></ng-content></div>@for (group of groups; track group.id) {<section [class]="sectionClasses()"><h3 [class]="groupNameClasses()">@if (isNode(group.name)) {<ng-container [ngTemplateOutlet]="group.name" />}@else {<ng-container>{{ textOf(group.name) }}</ng-container>}</h3><ul [class]="listClasses()">@for (component of group.components; track component.id) {<li [class]="rowClasses()"><div><span [class]="componentNameClasses()">@if (isNode(component.name)) {<ng-container [ngTemplateOutlet]="component.name" />}@else {<ng-container>{{ textOf(component.name) }}</ng-container>}</span>@if (component.subtitle) {<span [class]="subtitleClasses()">@if (isNode(component.subtitle)) {<ng-container [ngTemplateOutlet]="component.subtitle" />}@else {<ng-container>{{ textOf(component.subtitle) }}</ng-container>}</span>}</div><span [class]="badgeClasses(component.status)" [style]="badgeStyle()">{{ statusLabel(component.status) }}</span></li>}</ul></section>}<ng-content select="[slot=footer]"></ng-content>`,
|
|
160
160
|
})
|
|
161
161
|
export class StatusSummary {
|
|
162
162
|
/** Grouped components. */
|
|
@@ -190,12 +190,18 @@ export class StatusSummary {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* The banner's class list (flex row + padding
|
|
193
|
+
* The banner's class list (flex row + padding + the overall status's tone
|
|
194
|
+
* fill with the theme's inverse text on it).
|
|
194
195
|
* @returns The class string.
|
|
195
196
|
*/
|
|
196
197
|
bannerClasses(): string {
|
|
197
198
|
const cm = this.cm()
|
|
198
|
-
return cm.cn(
|
|
199
|
+
return cm.cn(
|
|
200
|
+
cm.flex({ align: 'center', justify: 'between', gap: 'md' }),
|
|
201
|
+
cm.sp('p', 3),
|
|
202
|
+
cm.bgTone(STATUS_TONE[this.overall()]),
|
|
203
|
+
cm.textOnTone,
|
|
204
|
+
)
|
|
199
205
|
}
|
|
200
206
|
|
|
201
207
|
/** The banner label's class list. */
|
|
@@ -238,10 +244,21 @@ export class StatusSummary {
|
|
|
238
244
|
return cm.cn(cm.sp('ml', 2), cm.textSize('xs'))
|
|
239
245
|
}
|
|
240
246
|
|
|
241
|
-
/**
|
|
242
|
-
|
|
247
|
+
/**
|
|
248
|
+
* One status badge's class list (its status's tone fill with the theme's
|
|
249
|
+
* inverse text on it).
|
|
250
|
+
* @param status - The component's status.
|
|
251
|
+
* @returns The class string.
|
|
252
|
+
*/
|
|
253
|
+
badgeClasses(status: ComponentStatus): string {
|
|
243
254
|
const cm = this.cm()
|
|
244
|
-
return cm.cn(
|
|
255
|
+
return cm.cn(
|
|
256
|
+
cm.sp('px', 2),
|
|
257
|
+
cm.textSize('xs'),
|
|
258
|
+
cm.fontWeight('semibold'),
|
|
259
|
+
cm.bgTone(STATUS_TONE[status]),
|
|
260
|
+
cm.textOnTone,
|
|
261
|
+
)
|
|
245
262
|
}
|
|
246
263
|
|
|
247
264
|
/**
|
|
@@ -266,42 +283,48 @@ export class StatusSummary {
|
|
|
266
283
|
}
|
|
267
284
|
|
|
268
285
|
/**
|
|
269
|
-
* The banner label, translated through the status
|
|
286
|
+
* The banner label, translated through the status's literal key.
|
|
270
287
|
* @returns The label text.
|
|
271
288
|
*/
|
|
272
289
|
overallLabel(): string {
|
|
273
|
-
|
|
274
|
-
return this.i18n.t(`status.${status}`, {}, { defaultValue: STATUS_LABEL[status] })
|
|
290
|
+
return this.statusLabel(this.overall())
|
|
275
291
|
}
|
|
276
292
|
|
|
277
293
|
/**
|
|
278
|
-
*
|
|
294
|
+
* The label for one status, through its literal i18n key with the English
|
|
295
|
+
* fallback (the same text the `common` locale bond's en.ts ships).
|
|
279
296
|
* @param status - The component's status.
|
|
280
297
|
* @returns The label text.
|
|
281
298
|
*/
|
|
282
299
|
statusLabel(status: ComponentStatus): string {
|
|
283
|
-
|
|
300
|
+
switch (status) {
|
|
301
|
+
case 'operational':
|
|
302
|
+
return this.i18n.t('status.operational', {}, { defaultValue: 'Operational' })
|
|
303
|
+
case 'degraded':
|
|
304
|
+
return this.i18n.t('status.degraded', {}, { defaultValue: 'Degraded performance' })
|
|
305
|
+
case 'partial-outage':
|
|
306
|
+
return this.i18n.t('status.partial-outage', {}, { defaultValue: 'Partial outage' })
|
|
307
|
+
case 'major-outage':
|
|
308
|
+
return this.i18n.t('status.major-outage', {}, { defaultValue: 'Major outage' })
|
|
309
|
+
case 'maintenance':
|
|
310
|
+
return this.i18n.t('status.maintenance', {}, { defaultValue: 'Under maintenance' })
|
|
311
|
+
}
|
|
284
312
|
}
|
|
285
313
|
|
|
286
314
|
/**
|
|
287
|
-
* The banner's
|
|
315
|
+
* The banner's rounded corners, in React's declaration order.
|
|
288
316
|
* @returns The style declarations.
|
|
289
317
|
*/
|
|
290
318
|
bannerStyle(): Record<string, string> {
|
|
291
|
-
return {
|
|
292
|
-
background: STATUS_COLOR[this.overall()],
|
|
293
|
-
color: '#fff',
|
|
294
|
-
borderRadius: '8px',
|
|
295
|
-
}
|
|
319
|
+
return { borderRadius: '8px' }
|
|
296
320
|
}
|
|
297
321
|
|
|
298
322
|
/**
|
|
299
|
-
* One badge's
|
|
300
|
-
* @param status - The component's status.
|
|
323
|
+
* One badge's rounded corners, in React's declaration order.
|
|
301
324
|
* @returns The style declarations.
|
|
302
325
|
*/
|
|
303
|
-
badgeStyle(
|
|
304
|
-
return { borderRadius: '4px'
|
|
326
|
+
badgeStyle(): Record<string, string> {
|
|
327
|
+
return { borderRadius: '4px' }
|
|
305
328
|
}
|
|
306
329
|
|
|
307
330
|
/**
|
|
@@ -334,7 +357,7 @@ Peer dependencies:
|
|
|
334
357
|
- `@angular/core` ^22.0.0
|
|
335
358
|
- `@angular/platform-browser` ^22.0.0
|
|
336
359
|
- `@molecule/app-angular` ^3.5.0
|
|
337
|
-
- `@molecule/app-ui` ^1.0
|
|
360
|
+
- `@molecule/app-ui` ^1.4.0
|
|
338
361
|
- `@molecule/app-ui-angular` ^1.1.0
|
|
339
362
|
|
|
340
363
|
### Runtime Dependencies
|
|
@@ -355,9 +378,9 @@ Peer dependencies:
|
|
|
355
378
|
(green/yellow/orange/red/blue with white text) — they ignore the
|
|
356
379
|
app theme and cannot be restyled via ClassMap; acceptable for
|
|
357
380
|
status pages, but know they will not follow a rebrand.
|
|
358
|
-
- Status labels use `status.operational` … `status.maintenance` i18n
|
|
359
|
-
keys
|
|
360
|
-
|
|
381
|
+
- Status labels use the `status.operational` … `status.maintenance` i18n
|
|
382
|
+
keys, which the `common` locale bond ships in every language; the
|
|
383
|
+
English fallbacks in code match its en.ts.
|
|
361
384
|
- Node props are projected content: `header` and `footer` are selected
|
|
362
385
|
by `[slot=header]` / `[slot=footer]`. Group and component names may be
|
|
363
386
|
`ng-template` references or plain text.
|
package/dist/index.d.ts
CHANGED
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
* (green/yellow/orange/red/blue with white text) — they ignore the
|
|
49
49
|
* app theme and cannot be restyled via ClassMap; acceptable for
|
|
50
50
|
* status pages, but know they will not follow a rebrand.
|
|
51
|
-
* - Status labels use `status.operational` … `status.maintenance` i18n
|
|
52
|
-
* keys
|
|
53
|
-
*
|
|
51
|
+
* - Status labels use the `status.operational` … `status.maintenance` i18n
|
|
52
|
+
* keys, which the `common` locale bond ships in every language; the
|
|
53
|
+
* English fallbacks in code match its en.ts.
|
|
54
54
|
* - Node props are projected content: `header` and `footer` are selected
|
|
55
55
|
* by `[slot=header]` / `[slot=footer]`. Group and component names may be
|
|
56
56
|
* `ng-template` references or plain text.
|
package/dist/index.js
CHANGED
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
* (green/yellow/orange/red/blue with white text) — they ignore the
|
|
49
49
|
* app theme and cannot be restyled via ClassMap; acceptable for
|
|
50
50
|
* status pages, but know they will not follow a rebrand.
|
|
51
|
-
* - Status labels use `status.operational` … `status.maintenance` i18n
|
|
52
|
-
* keys
|
|
53
|
-
*
|
|
51
|
+
* - Status labels use the `status.operational` … `status.maintenance` i18n
|
|
52
|
+
* keys, which the `common` locale bond ships in every language; the
|
|
53
|
+
* English fallbacks in code match its en.ts.
|
|
54
54
|
* - Node props are projected content: `header` and `footer` are selected
|
|
55
55
|
* by `[slot=header]` / `[slot=footer]`. Group and component names may be
|
|
56
56
|
* `ng-template` references or plain text.
|
|
@@ -36,7 +36,8 @@ export declare class StatusSummary {
|
|
|
36
36
|
*/
|
|
37
37
|
classes(): string;
|
|
38
38
|
/**
|
|
39
|
-
* The banner's class list (flex row + padding
|
|
39
|
+
* The banner's class list (flex row + padding + the overall status's tone
|
|
40
|
+
* fill with the theme's inverse text on it).
|
|
40
41
|
* @returns The class string.
|
|
41
42
|
*/
|
|
42
43
|
bannerClasses(): string;
|
|
@@ -54,8 +55,13 @@ export declare class StatusSummary {
|
|
|
54
55
|
componentNameClasses(): string;
|
|
55
56
|
/** One component subtitle's class list. */
|
|
56
57
|
subtitleClasses(): string;
|
|
57
|
-
/**
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* One status badge's class list (its status's tone fill with the theme's
|
|
60
|
+
* inverse text on it).
|
|
61
|
+
* @param status - The component's status.
|
|
62
|
+
* @returns The class string.
|
|
63
|
+
*/
|
|
64
|
+
badgeClasses(status: ComponentStatus): string;
|
|
59
65
|
/**
|
|
60
66
|
* Every component status in the summary, in render order.
|
|
61
67
|
* @returns The statuses.
|
|
@@ -67,27 +73,27 @@ export declare class StatusSummary {
|
|
|
67
73
|
*/
|
|
68
74
|
overall(): ComponentStatus;
|
|
69
75
|
/**
|
|
70
|
-
* The banner label, translated through the status
|
|
76
|
+
* The banner label, translated through the status's literal key.
|
|
71
77
|
* @returns The label text.
|
|
72
78
|
*/
|
|
73
79
|
overallLabel(): string;
|
|
74
80
|
/**
|
|
75
|
-
*
|
|
81
|
+
* The label for one status, through its literal i18n key with the English
|
|
82
|
+
* fallback (the same text the `common` locale bond's en.ts ships).
|
|
76
83
|
* @param status - The component's status.
|
|
77
84
|
* @returns The label text.
|
|
78
85
|
*/
|
|
79
86
|
statusLabel(status: ComponentStatus): string;
|
|
80
87
|
/**
|
|
81
|
-
* The banner's
|
|
88
|
+
* The banner's rounded corners, in React's declaration order.
|
|
82
89
|
* @returns The style declarations.
|
|
83
90
|
*/
|
|
84
91
|
bannerStyle(): Record<string, string>;
|
|
85
92
|
/**
|
|
86
|
-
* One badge's
|
|
87
|
-
* @param status - The component's status.
|
|
93
|
+
* One badge's rounded corners, in React's declaration order.
|
|
88
94
|
* @returns The style declarations.
|
|
89
95
|
*/
|
|
90
|
-
badgeStyle(
|
|
96
|
+
badgeStyle(): Record<string, string>;
|
|
91
97
|
/**
|
|
92
98
|
* Whether a field holds a node (an `ng-template` reference) rather than text.
|
|
93
99
|
* @param value - The group or component field.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-summary.component.d.ts","sourceRoot":"","sources":["../src/status-summary.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AAGtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"status-summary.component.d.ts","sourceRoot":"","sources":["../src/status-summary.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AAGtD,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;;AAwB9D;;;;;;;;;;GAUG;AACH,qBAWa,aAAa;IACxB,0BAA0B;IAC1B,MAAM,EAAE,WAAW,EAAE,CAAK;IAC1B,sEAAsE;IACtE,aAAa,CAAC,EAAE,eAAe,CAAA;IAC/B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAKjB;;;;OAIG;IACH,aAAa,IAAI,MAAM;IAUvB,qCAAqC;IACrC,YAAY,IAAI,MAAM;IAKtB,sDAAsD;IACtD,cAAc,IAAI,MAAM;IAIxB,sCAAsC;IACtC,gBAAgB,IAAI,MAAM;IAK1B,uDAAuD;IACvD,WAAW,IAAI,MAAM;IAIrB,gEAAgE;IAChE,UAAU,IAAI,MAAM;IAKpB,uCAAuC;IACvC,oBAAoB,IAAI,MAAM;IAK9B,2CAA2C;IAC3C,eAAe,IAAI,MAAM;IAKzB;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM;IAW7C;;;OAGG;IACH,WAAW,IAAI,eAAe,EAAE;IAIhC;;;OAGG;IACH,OAAO,IAAI,eAAe;IAS1B;;;OAGG;IACH,YAAY,IAAI,MAAM;IAItB;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM;IAe5C;;;OAGG;IACH,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC;;;OAGG;IACH,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIpC;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAIrD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;yCAvLnB,aAAa;2CAAb,aAAa;CA0LzB"}
|
|
@@ -90,8 +90,8 @@ function StatusSummary_For_5_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
90
90
|
i0.ɵɵadvance(2);
|
|
91
91
|
i0.ɵɵconditional(component_r3.subtitle ? 5 : -1);
|
|
92
92
|
i0.ɵɵadvance();
|
|
93
|
-
i0.ɵɵstyleMap(ctx_r1.badgeStyle(
|
|
94
|
-
i0.ɵɵclassMap(ctx_r1.badgeClasses());
|
|
93
|
+
i0.ɵɵstyleMap(ctx_r1.badgeStyle());
|
|
94
|
+
i0.ɵɵclassMap(ctx_r1.badgeClasses(component_r3.status));
|
|
95
95
|
i0.ɵɵadvance();
|
|
96
96
|
i0.ɵɵtextInterpolate(ctx_r1.statusLabel(component_r3.status));
|
|
97
97
|
} }
|
|
@@ -115,21 +115,17 @@ function StatusSummary_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
115
115
|
i0.ɵɵadvance();
|
|
116
116
|
i0.ɵɵrepeater(group_r1.components);
|
|
117
117
|
} }
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
degraded: '#eab308',
|
|
130
|
-
'partial-outage': '#f97316',
|
|
131
|
-
'major-outage': '#ef4444',
|
|
132
|
-
maintenance: '#60a5fa',
|
|
118
|
+
/**
|
|
119
|
+
* The semantic tone colouring each status: the theme's success green for
|
|
120
|
+
* operational, its warning amber for degraded and partial outage, its error
|
|
121
|
+
* red for a major outage and its info blue for maintenance.
|
|
122
|
+
*/
|
|
123
|
+
const STATUS_TONE = {
|
|
124
|
+
operational: 'success',
|
|
125
|
+
degraded: 'warning',
|
|
126
|
+
'partial-outage': 'warning',
|
|
127
|
+
'major-outage': 'error',
|
|
128
|
+
maintenance: 'info',
|
|
133
129
|
};
|
|
134
130
|
/** The statuses from most to least severe (React's `worst` order). */
|
|
135
131
|
const SEVERITY_ORDER = [
|
|
@@ -178,12 +174,13 @@ export class StatusSummary {
|
|
|
178
174
|
return cm.cn(cm.stack(4), this.className);
|
|
179
175
|
}
|
|
180
176
|
/**
|
|
181
|
-
* The banner's class list (flex row + padding
|
|
177
|
+
* The banner's class list (flex row + padding + the overall status's tone
|
|
178
|
+
* fill with the theme's inverse text on it).
|
|
182
179
|
* @returns The class string.
|
|
183
180
|
*/
|
|
184
181
|
bannerClasses() {
|
|
185
182
|
const cm = this.cm();
|
|
186
|
-
return cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'md' }), cm.sp('p', 3));
|
|
183
|
+
return cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'md' }), cm.sp('p', 3), cm.bgTone(STATUS_TONE[this.overall()]), cm.textOnTone);
|
|
187
184
|
}
|
|
188
185
|
/** The banner label's class list. */
|
|
189
186
|
labelClasses() {
|
|
@@ -218,10 +215,15 @@ export class StatusSummary {
|
|
|
218
215
|
const cm = this.cm();
|
|
219
216
|
return cm.cn(cm.sp('ml', 2), cm.textSize('xs'));
|
|
220
217
|
}
|
|
221
|
-
/**
|
|
222
|
-
|
|
218
|
+
/**
|
|
219
|
+
* One status badge's class list (its status's tone fill with the theme's
|
|
220
|
+
* inverse text on it).
|
|
221
|
+
* @param status - The component's status.
|
|
222
|
+
* @returns The class string.
|
|
223
|
+
*/
|
|
224
|
+
badgeClasses(status) {
|
|
223
225
|
const cm = this.cm();
|
|
224
|
-
return cm.cn(cm.sp('px', 2), cm.textSize('xs'), cm.fontWeight('semibold'));
|
|
226
|
+
return cm.cn(cm.sp('px', 2), cm.textSize('xs'), cm.fontWeight('semibold'), cm.bgTone(STATUS_TONE[status]), cm.textOnTone);
|
|
225
227
|
}
|
|
226
228
|
/**
|
|
227
229
|
* Every component status in the summary, in render order.
|
|
@@ -245,39 +247,45 @@ export class StatusSummary {
|
|
|
245
247
|
return 'operational';
|
|
246
248
|
}
|
|
247
249
|
/**
|
|
248
|
-
* The banner label, translated through the status
|
|
250
|
+
* The banner label, translated through the status's literal key.
|
|
249
251
|
* @returns The label text.
|
|
250
252
|
*/
|
|
251
253
|
overallLabel() {
|
|
252
|
-
|
|
253
|
-
return this.i18n.t(`status.${status}`, {}, { defaultValue: STATUS_LABEL[status] });
|
|
254
|
+
return this.statusLabel(this.overall());
|
|
254
255
|
}
|
|
255
256
|
/**
|
|
256
|
-
*
|
|
257
|
+
* The label for one status, through its literal i18n key with the English
|
|
258
|
+
* fallback (the same text the `common` locale bond's en.ts ships).
|
|
257
259
|
* @param status - The component's status.
|
|
258
260
|
* @returns The label text.
|
|
259
261
|
*/
|
|
260
262
|
statusLabel(status) {
|
|
261
|
-
|
|
263
|
+
switch (status) {
|
|
264
|
+
case 'operational':
|
|
265
|
+
return this.i18n.t('status.operational', {}, { defaultValue: 'Operational' });
|
|
266
|
+
case 'degraded':
|
|
267
|
+
return this.i18n.t('status.degraded', {}, { defaultValue: 'Degraded performance' });
|
|
268
|
+
case 'partial-outage':
|
|
269
|
+
return this.i18n.t('status.partial-outage', {}, { defaultValue: 'Partial outage' });
|
|
270
|
+
case 'major-outage':
|
|
271
|
+
return this.i18n.t('status.major-outage', {}, { defaultValue: 'Major outage' });
|
|
272
|
+
case 'maintenance':
|
|
273
|
+
return this.i18n.t('status.maintenance', {}, { defaultValue: 'Under maintenance' });
|
|
274
|
+
}
|
|
262
275
|
}
|
|
263
276
|
/**
|
|
264
|
-
* The banner's
|
|
277
|
+
* The banner's rounded corners, in React's declaration order.
|
|
265
278
|
* @returns The style declarations.
|
|
266
279
|
*/
|
|
267
280
|
bannerStyle() {
|
|
268
|
-
return {
|
|
269
|
-
background: STATUS_COLOR[this.overall()],
|
|
270
|
-
color: '#fff',
|
|
271
|
-
borderRadius: '8px',
|
|
272
|
-
};
|
|
281
|
+
return { borderRadius: '8px' };
|
|
273
282
|
}
|
|
274
283
|
/**
|
|
275
|
-
* One badge's
|
|
276
|
-
* @param status - The component's status.
|
|
284
|
+
* One badge's rounded corners, in React's declaration order.
|
|
277
285
|
* @returns The style declarations.
|
|
278
286
|
*/
|
|
279
|
-
badgeStyle(
|
|
280
|
-
return { borderRadius: '4px'
|
|
287
|
+
badgeStyle() {
|
|
288
|
+
return { borderRadius: '4px' };
|
|
281
289
|
}
|
|
282
290
|
/**
|
|
283
291
|
* Whether a field holds a node (an `ng-template` reference) rather than text.
|
|
@@ -329,8 +337,8 @@ export class StatusSummary {
|
|
|
329
337
|
'[class]': 'classes()',
|
|
330
338
|
},
|
|
331
339
|
// prettier-ignore
|
|
332
|
-
template: `<div [class]="bannerClasses()" [style]="bannerStyle()"><span [class]="labelClasses()">{{ overallLabel() }}</span><ng-content select="[slot=header]"></ng-content></div>@for (group of groups; track group.id) {<section [class]="sectionClasses()"><h3 [class]="groupNameClasses()">@if (isNode(group.name)) {<ng-container [ngTemplateOutlet]="group.name" />}@else {<ng-container>{{ textOf(group.name) }}</ng-container>}</h3><ul [class]="listClasses()">@for (component of group.components; track component.id) {<li [class]="rowClasses()"><div><span [class]="componentNameClasses()">@if (isNode(component.name)) {<ng-container [ngTemplateOutlet]="component.name" />}@else {<ng-container>{{ textOf(component.name) }}</ng-container>}</span>@if (component.subtitle) {<span [class]="subtitleClasses()">@if (isNode(component.subtitle)) {<ng-container [ngTemplateOutlet]="component.subtitle" />}@else {<ng-container>{{ textOf(component.subtitle) }}</ng-container>}</span>}</div><span [class]="badgeClasses()" [style]="badgeStyle(
|
|
340
|
+
template: `<div [class]="bannerClasses()" [style]="bannerStyle()"><span [class]="labelClasses()">{{ overallLabel() }}</span><ng-content select="[slot=header]"></ng-content></div>@for (group of groups; track group.id) {<section [class]="sectionClasses()"><h3 [class]="groupNameClasses()">@if (isNode(group.name)) {<ng-container [ngTemplateOutlet]="group.name" />}@else {<ng-container>{{ textOf(group.name) }}</ng-container>}</h3><ul [class]="listClasses()">@for (component of group.components; track component.id) {<li [class]="rowClasses()"><div><span [class]="componentNameClasses()">@if (isNode(component.name)) {<ng-container [ngTemplateOutlet]="component.name" />}@else {<ng-container>{{ textOf(component.name) }}</ng-container>}</span>@if (component.subtitle) {<span [class]="subtitleClasses()">@if (isNode(component.subtitle)) {<ng-container [ngTemplateOutlet]="component.subtitle" />}@else {<ng-container>{{ textOf(component.subtitle) }}</ng-container>}</span>}</div><span [class]="badgeClasses(component.status)" [style]="badgeStyle()">{{ statusLabel(component.status) }}</span></li>}</ul></section>}<ng-content select="[slot=footer]"></ng-content>`,
|
|
333
341
|
}]
|
|
334
342
|
}], null, null); })();
|
|
335
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StatusSummary, { className: "StatusSummary", filePath: "status-summary.component.ts", lineNumber:
|
|
343
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StatusSummary, { className: "StatusSummary", filePath: "status-summary.component.ts", lineNumber: 60 }); })();
|
|
336
344
|
//# sourceMappingURL=status-summary.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-summary.component.js","sourceRoot":"","sources":["../src/status-summary.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"status-summary.component.js","sourceRoot":"","sources":["../src/status-summary.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;;;;;;IA8C6Q,2BAAgD;;;IAAlC,gDAA+B;;;IAAW,6BAAc;IAAA,YAAwB;;;;;IAAxB,cAAwB;IAAxB,kDAAwB;;;IAAgN,2BAAoD;;;IAAtC,oDAAmC;;;IAAW,6BAAc;IAAA,YAA4B;;;;;IAA5B,cAA4B;IAA5B,sDAA4B;;;IAAqH,2BAAwD;;;IAA1C,wDAAuC;;;IAAW,6BAAc;IAAA,YAAgC;;;;;IAAhC,cAAgC;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
|
{
|
|
2
2
|
"name": "@molecule/app-status-summary-angular",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Status-page summary: component grid with operational/degraded/outage badges + incident list",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-status-summary-angular",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@angular/core": "^22.0.0",
|
|
47
47
|
"@angular/platform-browser": "^22.0.0",
|
|
48
48
|
"@molecule/app-angular": "^3.5.0",
|
|
49
|
-
"@molecule/app-ui": "^1.0
|
|
49
|
+
"@molecule/app-ui": "^1.4.0",
|
|
50
50
|
"@molecule/app-ui-angular": "^1.1.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"@angular/compiler-cli": "22.2.3",
|
|
56
56
|
"@angular/core": "22.2.3",
|
|
57
57
|
"@angular/platform-browser": "22.2.3",
|
|
58
|
-
"@molecule/app-angular": "3.
|
|
58
|
+
"@molecule/app-angular": "3.9.0",
|
|
59
59
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
60
60
|
"@molecule/app-i18n": "1.2.2",
|
|
61
61
|
"@molecule/app-icons": "1.0.4",
|
|
62
|
-
"@molecule/app-ui": "1.
|
|
63
|
-
"@molecule/app-ui-angular": "1.
|
|
62
|
+
"@molecule/app-ui": "1.5.0",
|
|
63
|
+
"@molecule/app-ui-angular": "1.3.1",
|
|
64
64
|
"@types/node": "26.6.5",
|
|
65
65
|
"jsdom": "30.1.3",
|
|
66
66
|
"rxjs": "7.8.2",
|