@oicl/openbridge-webcomponents 2.0.0-next.152 → 2.0.0-next.154
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/bundle/openbridge-webcomponents.bundle.js +5026 -4717
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +701 -107
- package/dist/alert-severity.d.ts +19 -1
- package/dist/alert-severity.d.ts.map +1 -1
- package/dist/alert-severity.js +48 -2
- package/dist/alert-severity.js.map +1 -1
- package/dist/components/alert-button/alert-button.css.js +7 -1513
- package/dist/components/alert-button/alert-button.css.js.map +1 -1
- package/dist/components/alert-button/alert-button.d.ts +50 -86
- package/dist/components/alert-button/alert-button.d.ts.map +1 -1
- package/dist/components/alert-button/alert-button.js +40 -107
- package/dist/components/alert-button/alert-button.js.map +1 -1
- package/dist/components/alert-button-item/alert-button-item.css.js +1570 -0
- package/dist/components/alert-button-item/alert-button-item.css.js.map +1 -0
- package/dist/components/alert-button-item/alert-button-item.d.ts +162 -0
- package/dist/components/alert-button-item/alert-button-item.d.ts.map +1 -0
- package/dist/components/alert-button-item/alert-button-item.js +210 -0
- package/dist/components/alert-button-item/alert-button-item.js.map +1 -0
- package/dist/components/alert-counter-item/alert-counter-item.css.js +25 -0
- package/dist/components/alert-counter-item/alert-counter-item.css.js.map +1 -0
- package/dist/components/alert-counter-item/alert-counter-item.d.ts +77 -0
- package/dist/components/alert-counter-item/alert-counter-item.d.ts.map +1 -0
- package/dist/components/alert-counter-item/alert-counter-item.js +87 -0
- package/dist/components/alert-counter-item/alert-counter-item.js.map +1 -0
- package/dist/components/alert-frame/alert-frame.css.js +23 -27
- package/dist/components/alert-frame/alert-frame.css.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.d.ts +7 -6
- package/dist/components/alert-frame/alert-frame.d.ts.map +1 -1
- package/dist/components/alert-frame/alert-frame.js +6 -9
- package/dist/components/alert-frame/alert-frame.js.map +1 -1
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js +3 -7
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map +1 -1
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts +133 -14
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map +1 -1
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js +330 -233
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js.map +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +10 -2
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tree-navigation-item/tree-navigation-item.d.ts +7 -34
- package/dist/components/tree-navigation-item/tree-navigation-item.d.ts.map +1 -1
- package/dist/components/tree-navigation-item/tree-navigation-item.js +3 -32
- package/dist/components/tree-navigation-item/tree-navigation-item.js.map +1 -1
- package/dist/generated/locales/es-419.d.ts +11 -3
- package/dist/generated/locales/es-419.d.ts.map +1 -1
- package/dist/generated/locales/es-419.js +11 -3
- package/dist/generated/locales/es-419.js.map +1 -1
- package/dist/generated/locales/fi-FI.d.ts +8 -0
- package/dist/generated/locales/fi-FI.d.ts.map +1 -1
- package/dist/generated/locales/fi-FI.js +8 -0
- package/dist/generated/locales/fi-FI.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.css.js +4 -29
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +1 -9
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +5 -34
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js +1 -9
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/dist/palettes/blinking.d.ts +6 -2
- package/dist/palettes/blinking.d.ts.map +1 -1
- package/dist/palettes/blinking.js +6 -2
- package/dist/palettes/blinking.js.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -29,12 +29,12 @@ const compentStyle = css`* {
|
|
|
29
29
|
position: relative;
|
|
30
30
|
width: 100%;
|
|
31
31
|
height: 100%;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
32
|
+
/* The stroke's centreline follows this radius, like a Figma centre stroke. */
|
|
33
|
+
border-radius: var(--ui-components-button-border-radius);
|
|
35
34
|
outline: var(--thickness) solid var(--bg-color);
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
/* Centre stroke: frames on touching components share one edge. */
|
|
36
|
+
outline-offset: calc(-1 * var(--thickness) / 2);
|
|
37
|
+
/* +2 px while on, 1 px each side, both thicknesses (Figma Flash=yes: 2 → 4 px). */
|
|
38
38
|
--blink-width: 2px;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -72,7 +72,9 @@ const compentStyle = css`* {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.wrapper.flash-effect-outline-eased {
|
|
75
|
-
transition:
|
|
75
|
+
transition:
|
|
76
|
+
outline-width var(--flash-transition),
|
|
77
|
+
outline-offset var(--flash-transition);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
.wrapper.flash-effect-outline-eased .flap {
|
|
@@ -100,14 +102,10 @@ const compentStyle = css`* {
|
|
|
100
102
|
|
|
101
103
|
.wrapper.unacked-active,.wrapper.unacked-rectified {
|
|
102
104
|
outline-width: calc(var(--thickness) + var(--blink-width-dynamic));
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.wrapper.unacked-rectified {
|
|
110
|
-
/* The dashed stroke is centred, so it moves out by half its growth. */
|
|
105
|
+
outline-offset: calc(
|
|
106
|
+
-1 * (var(--thickness) + var(--blink-width-dynamic)) / 2
|
|
107
|
+
);
|
|
108
|
+
/* The stroke grows on both sides, so its outer edge moves by half. */
|
|
111
109
|
--flap-grow: calc(var(--blink-width-dynamic) / 2);
|
|
112
110
|
}
|
|
113
111
|
|
|
@@ -169,9 +167,9 @@ const compentStyle = css`* {
|
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
.flap.small {
|
|
172
|
-
top: calc(-1 * var(--thickness));
|
|
170
|
+
top: calc(-1 * var(--thickness) / 2);
|
|
173
171
|
right: calc(
|
|
174
|
-
-1 * var(--app-components-alert-frame-icon-size) -
|
|
172
|
+
-1 * var(--app-components-alert-frame-icon-size) -
|
|
175
173
|
var(--ui-components-badge-padding) * 2
|
|
176
174
|
);
|
|
177
175
|
}
|
|
@@ -281,10 +279,10 @@ const compentStyle = css`* {
|
|
|
281
279
|
|
|
282
280
|
.flap.large {
|
|
283
281
|
flex-direction: column;
|
|
284
|
-
top: calc(-1 * var(--thickness));
|
|
285
|
-
bottom: calc(-1 * var(--thickness));
|
|
282
|
+
top: calc(-1 * var(--thickness) / 2);
|
|
283
|
+
bottom: calc(-1 * var(--thickness) / 2);
|
|
286
284
|
right: calc(
|
|
287
|
-
-1 * var(--app-components-alert-frame-icon-size) + var(--thickness)
|
|
285
|
+
-1 * var(--app-components-alert-frame-icon-size) + var(--thickness) -
|
|
288
286
|
var(--ui-components-badge-padding) * 2
|
|
289
287
|
);
|
|
290
288
|
border-radius: 0px
|
|
@@ -293,13 +291,12 @@ const compentStyle = css`* {
|
|
|
293
291
|
}
|
|
294
292
|
|
|
295
293
|
.flap.bottom,.flap.top {
|
|
296
|
-
left: calc(-1 * var(--thickness));
|
|
297
|
-
right: calc(-1 * var(--thickness));
|
|
294
|
+
left: calc(-1 * var(--thickness) / 2);
|
|
295
|
+
right: calc(-1 * var(--thickness) / 2);
|
|
298
296
|
padding: var(--app-components-alert-frame-large-flip-padding-vertical)
|
|
299
297
|
var(--app-components-alert-frame-large-flip-4px-padding-horizontal);
|
|
300
298
|
bottom: calc(
|
|
301
|
-
-1 * var(--
|
|
302
|
-
var(--global-typography-ui-label-line-height) -
|
|
299
|
+
-1 * var(--global-typography-ui-label-line-height) -
|
|
303
300
|
var(--app-components-alert-frame-large-flip-padding-vertical) * 2
|
|
304
301
|
);
|
|
305
302
|
border-radius: 0px 0px var(--button-border-radius-bottom-right)
|
|
@@ -335,7 +332,7 @@ const compentStyle = css`* {
|
|
|
335
332
|
"clig" off,
|
|
336
333
|
"ss04" on;
|
|
337
334
|
bottom: calc(
|
|
338
|
-
var(--thickness)
|
|
335
|
+
var(--thickness) - var(--global-typography-ui-body-line-height) -
|
|
339
336
|
var(--app-components-alert-frame-large-flip-padding-vertical) * 2
|
|
340
337
|
);
|
|
341
338
|
}
|
|
@@ -354,8 +351,7 @@ const compentStyle = css`* {
|
|
|
354
351
|
.flap.top {
|
|
355
352
|
bottom: unset !important;
|
|
356
353
|
top: calc(
|
|
357
|
-
-1 * var(--
|
|
358
|
-
var(--global-typography-ui-label-line-height) -
|
|
354
|
+
-1 * var(--global-typography-ui-label-line-height) -
|
|
359
355
|
var(--app-components-alert-frame-large-flip-padding-vertical) * 2
|
|
360
356
|
);
|
|
361
357
|
border-radius: var(--button-border-radius-bottom-right)
|
|
@@ -364,7 +360,7 @@ const compentStyle = css`* {
|
|
|
364
360
|
|
|
365
361
|
.text-size-large .flap.top {
|
|
366
362
|
top: calc(
|
|
367
|
-
var(--thickness)
|
|
363
|
+
var(--thickness) - var(--global-typography-ui-body-line-height) -
|
|
368
364
|
var(--app-components-alert-frame-large-flip-padding-vertical) * 2
|
|
369
365
|
);
|
|
370
366
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-frame.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert-frame.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -37,10 +37,10 @@ export declare enum ObcAlertFrameMode {
|
|
|
37
37
|
unackedRectified = "unacked-rectified"
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* How the frame renders the on phase of a flash: `outline` grows the
|
|
41
|
-
*
|
|
42
|
-
* way over a 50 ms transition. The eased variant exists for
|
|
43
|
-
* and may be removed (#1224).
|
|
40
|
+
* How the frame renders the on phase of a flash: `outline` grows the centred
|
|
41
|
+
* stroke by 2 px, 1 px on each side, in one step (the design); `outline-eased`
|
|
42
|
+
* grows it the same way over a 50 ms transition. The eased variant exists for
|
|
43
|
+
* design evaluation and may be removed (#1224).
|
|
44
44
|
*/
|
|
45
45
|
export declare enum ObcAlertFrameFlashEffect {
|
|
46
46
|
Outline = "outline",
|
|
@@ -77,6 +77,7 @@ export interface AlertFrameConfig {
|
|
|
77
77
|
* - `large-side-flip`: Adds a larger, vertical side flap with a status icon and optional custom icon.
|
|
78
78
|
* - `bottom-flip`: Adds a bottom flap with a status icon, label, and timer slots.
|
|
79
79
|
* - **Thickness options:** Choose between `small` (thin border) and `large` (thick border) for visual emphasis.
|
|
80
|
+
* - **Centred stroke:** The stroke straddles the frame edge, half over the content and half outside, so frames on touching components share one edge. While flashing it grows by 1 px on each side.
|
|
80
81
|
* - **Status indication:** Displays different color schemes and icons for the legacy statuses (`alarm`, `warning`, `caution`) and the level statuses (`level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`).
|
|
81
82
|
* - **Acknowledgement mode:** The `mode` property reflects the alert lifecycle state — `acked-active` (default, steady), `unacked-active` (flashes) and `unacked-rectified` (dashed, flashes) — and `flashingSpeed` picks the tempo.
|
|
82
83
|
* - **Content wrapping:** When `wrapContent` is true, the frame wraps and sizes itself to its slotted content rather than overlaying a fixed region.
|
|
@@ -149,7 +150,7 @@ export interface AlertFrameConfig {
|
|
|
149
150
|
* (critical/alarm/high fast, warning/medium slow, low very slow, every rectified alert very
|
|
150
151
|
* slow, caution and diagnostic fixed), `fast`, `slow`, `very-slow` force a tempo, `fixed`
|
|
151
152
|
* never flashes. Acknowledged frames are always steady.
|
|
152
|
-
* @property flashEffect - `outline` (default) grows the outline by 2 px while on in one step;
|
|
153
|
+
* @property flashEffect - `outline` (default) grows the outline by 2 px, 1 px each side, while on in one step;
|
|
153
154
|
* `outline-eased` grows it over a 50 ms transition, a design-evaluation option.
|
|
154
155
|
* @slot - Default slot for main alert content.
|
|
155
156
|
* @slot icon - Custom icon for the flap (large-side-flip, bottom-flip).
|
|
@@ -191,7 +192,7 @@ export declare class ObcAlertFrame extends LitElement {
|
|
|
191
192
|
mode: ObcAlertFrameMode;
|
|
192
193
|
/** Flash tempo: `default` resolves from the alert type and mode (critical/alarm/high fast, warning/medium slow, low very slow, every rectified alert very slow, caution and diagnostic fixed), `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes. Acknowledged frames are always steady. */
|
|
193
194
|
flashingSpeed: FlashingSpeed;
|
|
194
|
-
/** `outline` (default) grows the outline by 2 px while on in one step; `outline-eased` grows it over a 50 ms transition, a design-evaluation option. */
|
|
195
|
+
/** `outline` (default) grows the outline by 2 px, 1 px each side, while on in one step; `outline-eased` grows it over a 50 ms transition, a design-evaluation option. */
|
|
195
196
|
flashEffect: ObcAlertFrameFlashEffect;
|
|
196
197
|
protected readonly flashing: FlashingController;
|
|
197
198
|
private dashBox?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-frame.d.ts","sourceRoot":"","sources":["../../../src/components/alert-frame/alert-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,cAAc,EACd,kBAAkB,EACnB,MAAM,KAAK,CAAC;AAIb,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAOzE,OAAO,EAAC,SAAS,IAAI,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAEhE;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,aAAa,oBAAoB;IACjC,aAAa,oBAAoB;IACjC,UAAU,gBAAgB;IAC1B,OAAO,aAAa;CACrB;AAED;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,iBAAiB;IAC3B,WAAW,iBAAiB;IAC5B,aAAa,mBAAmB;IAChC,gBAAgB,sBAAsB;CACvC;AAED;;;;;GAKG;AACH,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,YAAY,kBAAkB;CAC/B;AAED;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAuBD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED
|
|
1
|
+
{"version":3,"file":"alert-frame.d.ts","sourceRoot":"","sources":["../../../src/components/alert-frame/alert-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,cAAc,EACd,kBAAkB,EACnB,MAAM,KAAK,CAAC;AAIb,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAOzE,OAAO,EAAC,SAAS,IAAI,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAEhE;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,aAAa,oBAAoB;IACjC,aAAa,oBAAoB;IACjC,UAAU,gBAAgB;IAC1B,OAAO,aAAa;CACrB;AAED;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,iBAAiB;IAC3B,WAAW,iBAAiB;IAC5B,aAAa,mBAAmB;IAChC,gBAAgB,sBAAsB;CACvC;AAED;;;;;GAKG;AACH,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,YAAY,kBAAkB;CAC/B;AAED;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAuBD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;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AEF,QAAQ,EAAE,OAAO,CAAS;IACR,qBAAqB,EAAE,OAAO,CACpE;IAEE,MAAM;IA0Bf,OAAO,CAAC,IAAI;IAmEZ,OAAO,CAAC,eAAe;IAmBvB,OAAgB,MAAM,0BAA2B;CAClD;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,OAAO,GAAG,SAAS,EAC/C,OAAO,EAAE,kBAAkB,EAC3B,SAAS,GAAE,OAAe,GACzB,kBAAkB,CAgBpB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -131,16 +131,13 @@ let ObcAlertFrame = class extends LitElement {
|
|
|
131
131
|
if (this.mode !== "unacked-rectified" || !box) {
|
|
132
132
|
return nothing;
|
|
133
133
|
}
|
|
134
|
-
const pad = box.thickness + DASH_FLASH_GROWTH_PX;
|
|
134
|
+
const pad = (box.thickness + DASH_FLASH_GROWTH_PX) / 2;
|
|
135
135
|
const centreline = {
|
|
136
|
-
x: pad
|
|
137
|
-
y: pad
|
|
138
|
-
width: box.width
|
|
139
|
-
height: box.height
|
|
140
|
-
|
|
141
|
-
radii: box.radii.map(
|
|
142
|
-
(r) => r > 0 ? r + box.thickness / 2 : 0
|
|
143
|
-
)
|
|
136
|
+
x: pad,
|
|
137
|
+
y: pad,
|
|
138
|
+
width: box.width,
|
|
139
|
+
height: box.height,
|
|
140
|
+
radii: box.radii
|
|
144
141
|
};
|
|
145
142
|
const width = box.width + 2 * pad;
|
|
146
143
|
const height = box.height + 2 * pad;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-frame.js","sources":["../../../src/components/alert-frame/alert-frame.ts"],"sourcesContent":["import {\n LitElement,\n html,\n unsafeCSS,\n nothing,\n TemplateResult,\n HTMLTemplateResult,\n} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport compentStyle from './alert-frame.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport '../../icons/icon-alarm-badge.js';\nimport '../../icons/icon-warning-badge.js';\nimport '../../icons/icon-caution-badge.js';\nimport '../../icons/icon-critical-badge.js';\nimport './diagnostic-badge.js';\nimport {customElement} from '../../decorator.js';\nimport {\n AlertType,\n FlashingSpeed,\n type ResolvedFlashingSpeed,\n} from '../../types.js';\nimport {\n getAlertBadgeComponent,\n AlertBadgeComponent,\n} from '../../alert-severity.js';\nimport {FlashingController} from '../../palettes/flashing-controller.js';\nimport {\n roundedRectPath,\n type RoundedRect,\n} from '../../svghelpers/rounded-rect.js';\nimport {AlertFlashPhase, resolveFlashingSpeed} from '../../alert-severity.js';\n\nexport {AlertType as ObcAlertFrameStatus} from '../../types.js';\n\n/**\n * Enum representing the available frame styles for an alert component.\n *\n * - Regular (\"regular\"): Standard alert frame layout.\n * - SmallSideFlip (\"small-side-flip\"): Flipped frame with a small side edge.\n * - LargeSideFlip (\"large-side-flip\"): Flipped frame with a large side edge.\n * - BottomFlip (\"bottom-flip\"): Frame flipped to the bottom position.\n */\nexport enum ObcAlertFrameType {\n Regular = 'regular',\n SmallSideFlip = 'small-side-flip',\n LargeSideFlip = 'large-side-flip',\n BottomFlip = 'bottom-flip',\n TopFlip = 'top-flip',\n}\n\n/**\n * Thickness options for the alert frame border.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\nexport enum ObcAlertFrameThickness {\n Small = 'small',\n Large = 'large',\n}\n\nexport enum ObcAlertFrameMode {\n ackedActive = 'acked-active',\n unackedActive = 'unacked-active',\n unackedRectified = 'unacked-rectified',\n}\n\n/**\n * How the frame renders the on phase of a flash: `outline` grows the outline\n * outward by 2 px in one step (the design); `outline-eased` grows it the same\n * way over a 50 ms transition. The eased variant exists for design evaluation\n * and may be removed (#1224).\n */\nexport enum ObcAlertFrameFlashEffect {\n Outline = 'outline',\n OutlineEased = 'outline-eased',\n}\n\n/**\n * Text size options for flip-flap typography.\n * - `regular`: Standard text size (default).\n * - `large`: Larger text for increased visibility.\n */\nexport enum AlertFrameTextSize {\n Regular = 'regular',\n Large = 'large',\n}\n\n/** Wrapper geometry the dashed overlay is drawn from; measured, never derived from props. */\ninterface DashBox {\n width: number;\n height: number;\n thickness: number;\n radii: RoundedRect['radii'];\n}\n\n/** Room the svg leaves around the box for the stroke's on-phase growth. */\nconst DASH_FLASH_GROWTH_PX = 2;\n\nfunction sameDashBox(a: DashBox, b: DashBox | undefined): boolean {\n return (\n b !== undefined &&\n a.width === b.width &&\n a.height === b.height &&\n a.thickness === b.thickness &&\n a.radii.every((r, i) => r === b.radii[i])\n );\n}\n\nexport interface AlertFrameConfig {\n type?: ObcAlertFrameType;\n thickness?: ObcAlertFrameThickness;\n status?: AlertType;\n mode?: ObcAlertFrameMode;\n flashingSpeed?: FlashingSpeed;\n textSize?: AlertFrameTextSize;\n showIcon?: boolean;\n showAlertCategoryIcon?: boolean;\n}\n\n/**\n * `<obc-alert-frame>` – A bordered frame component for visually emphasizing alert or status messages.\n *\n * The alert frame provides a prominent outline and optional \"flap\" with status icon to draw attention to critical information or UI regions. It supports multiple visual variants and thicknesses, and can be configured to indicate different alert statuses (alarm, warning, caution). The component is designed to wrap content and visually distinguish it from the surrounding UI.\n *\n * ### Features\n * - **Variants (type):**\n * - `regular`: Standard outlined frame with no flap or icon.\n * - `small-side-flip`: Adds a small side flap with a status icon at the top right.\n * - `large-side-flip`: Adds a larger, vertical side flap with a status icon and optional custom icon.\n * - `bottom-flip`: Adds a bottom flap with a status icon, label, and timer slots.\n * - **Thickness options:** Choose between `small` (thin border) and `large` (thick border) for visual emphasis.\n * - **Status indication:** Displays different color schemes and icons for the legacy statuses (`alarm`, `warning`, `caution`) and the level statuses (`level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`).\n * - **Acknowledgement mode:** The `mode` property reflects the alert lifecycle state — `acked-active` (default, steady), `unacked-active` (flashes) and `unacked-rectified` (dashed, flashes) — and `flashingSpeed` picks the tempo.\n * - **Content wrapping:** When `wrapContent` is true, the frame wraps and sizes itself to its slotted content rather than overlaying a fixed region.\n * - **Customizable corners:** Each corner can be set to a sharp (non-rounded) edge for integration with other UI elements.\n * - **Slot-based content:** Supports custom icons, labels, and timers in flap variants via named slots.\n *\n * ### Usage Guidelines\n * Use `obc-alert-frame` to highlight important content, such as alerts, warnings, or status panels. The flap variants are ideal for drawing extra attention to urgent or time-sensitive information, while the regular type provides a subtle but clear border. Choose the status to match the severity of the message (alarm, warning, caution). Adjust thickness for visual hierarchy—use large for high-priority alerts and small for less critical notices.\n *\n * **TODO(designer):** Provide guidance on when to use each flap type (small-side-flip, large-side-flip, bottom-flip) and recommended scenarios for sharp edge usage.\n *\n * ### Features/Variants\n * - **Type (Visual Variant):**\n * - `regular`: Simple outlined frame, no flap or icon.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n * - **Thickness:** `small` (default) or `large` for border width.\n * - **Status:** `alarm`, `warning`, `caution`, or the level severities (`level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`)—affects color and icon.\n * - **Mode:** `acked-active` (default), `unacked-active`, or `unacked-rectified`—affects blinking/animation.\n * - **Corner Customization:** Each corner can be made sharp (not rounded) via boolean properties.\n *\n * ### Slots and Content Structure\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|-----------------|---------|\n * | (default) | Always | Main content inside the alert frame. |\n * | icon | `large-side-flip` or `bottom-flip` | Custom icon displayed in the flap (in addition to status icon). |\n * | label | `bottom-flip` only | Label text shown in the bottom flap. |\n * | timer | `bottom-flip` only | Timer or time label in the bottom flap. |\n *\n * ### Properties and Attributes\n * - `type`: Selects the visual variant/flap style. Default is `small-side-flip`.\n * - `thickness`: Controls border thickness (`small` or `large`). Default is `small`.\n * - `status`: Sets the alert status and color/icon (`alarm`, `warning`, `caution`, or the `level-*` severities). Default is `alarm`.\n * - `mode`: Acknowledgement lifecycle state (`acked-active`, `unacked-active`, `unacked-rectified`) controlling blinking/animation. Default is `acked-active`.\n * - `wrapContent`: When true, the frame wraps and sizes to its slotted content instead of overlaying a fixed region. Default is `false`.\n * - `sharpEdgeTopLeft`, `sharpEdgeTopRight`, `sharpEdgeBottomLeft`, `sharpEdgeBottomRight`: Boolean flags to make each corner sharp instead of rounded.\n *\n * ### Best Practices and Constraints\n * - Use the status property to match the severity of the alert.\n * - Only use the bottom-flip variant when both label and timer are relevant.\n * - For visual consistency, align sharp edge settings with adjacent UI elements.\n * - The default slot is for the main content; use named slots for icons, labels, and timers as needed.\n *\n * ### Example:\n * ```\n * <obc-alert-frame\n * type=\"bottom-flip\"\n * thickness=\"large\"\n * status=\"warning\"\n * sharpEdgeTopLeft\n * >\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * <div slot=\"label\">Low Battery</div>\n * <div slot=\"timer\">00:15</div>\n * <div>Critical system message goes here.</div>\n * </obc-alert-frame>\n * ```\n *\n * @property wrapContent - When true, the frame wraps and sizes itself to its slotted content instead\n * of overlaying a fixed region. Reflected to an attribute for CSS styling.\n * @property fullWidth - When true, the frame stretches to fill the full width of its container\n * instead of hugging its content. Reflected to an attribute for CSS styling.\n * @property sharpEdgeTopLeft - If true, the top-left corner will be sharp (not rounded).\n * @property sharpEdgeTopRight - If true, the top-right corner will be sharp (not rounded).\n * @property sharpEdgeBottomLeft - If true, the bottom-left corner will be sharp (not rounded).\n * @property sharpEdgeBottomRight - If true, the bottom-right corner will be sharp (not rounded).\n * @property flashingSpeed - Flash tempo: `default` resolves from the alert type and mode\n * (critical/alarm/high fast, warning/medium slow, low very slow, every rectified alert very\n * slow, caution and diagnostic fixed), `fast`, `slow`, `very-slow` force a tempo, `fixed`\n * never flashes. Acknowledged frames are always steady.\n * @property flashEffect - `outline` (default) grows the outline by 2 px while on in one step;\n * `outline-eased` grows it over a 50 ms transition, a design-evaluation option.\n * @slot - Default slot for main alert content.\n * @slot icon - Custom icon for the flap (large-side-flip, bottom-flip).\n * @slot label - Label text for the bottom flap (bottom-flip only).\n * @slot timer - Timer or time label for the bottom flap (bottom-flip only).\n * @beta\n */\n@customElement('obc-alert-frame')\nexport class ObcAlertFrame extends LitElement {\n /**\n * Visual variant of the alert frame.\n * - `regular`: Outlined frame only.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n *\n * Default: `small-side-flip`\n */\n @property({type: String}) type: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n\n /**\n * Border thickness of the alert frame.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\n @property({type: String}) thickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n\n /**\n * Status of the alert, controlling color scheme and icon.\n * - `alarm`: Highest severity (default).\n * - `warning`: Medium severity.\n * - `caution`: Lower severity.\n * - `level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`: level severity levels, styled to match their legacy equivalents.\n */\n @property({type: String}) status: AlertType = AlertType.Alarm;\n\n /**\n * Acknowledgement lifecycle state, controlling the frame's blinking/animation.\n * - `acked-active`: Active and acknowledged (default); no blinking.\n * - `unacked-active`: Active and not yet acknowledged; blinks.\n * - `unacked-rectified`: Condition cleared but not yet acknowledged.\n */\n @property({type: String}) mode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n\n @property({type: String}) flashEffect: ObcAlertFrameFlashEffect =\n ObcAlertFrameFlashEffect.Outline;\n\n protected readonly flashing = new FlashingController(\n this,\n () => this.resolvedFlashingSpeed\n );\n\n @state() private dashBox?: DashBox;\n\n @query('.wrapper') private wrapper?: HTMLElement;\n\n private dashObserver?: ResizeObserver;\n\n private measureDash = (): void => {\n const wrapper = this.wrapper;\n if (!wrapper) {\n return;\n }\n const style = getComputedStyle(wrapper);\n const px = (value: string) => parseFloat(value) || 0;\n const box: DashBox = {\n width: wrapper.offsetWidth,\n height: wrapper.offsetHeight,\n thickness: px(style.getPropertyValue('--thickness')),\n radii: [\n px(style.borderTopLeftRadius),\n px(style.borderTopRightRadius),\n px(style.borderBottomRightRadius),\n px(style.borderBottomLeftRadius),\n ],\n };\n // Setting state from updated() re-renders; only do it for a real change.\n if (!sameDashBox(box, this.dashBox)) {\n this.dashBox = box;\n }\n };\n\n override connectedCallback() {\n super.connectedCallback();\n if (this.hasUpdated) {\n this.requestUpdate();\n }\n }\n\n override updated() {\n const wantsDash =\n this.mode === ObcAlertFrameMode.unackedRectified && this.isConnected;\n if (wantsDash && !this.dashObserver && this.wrapper) {\n this.dashObserver = new ResizeObserver(this.measureDash);\n this.dashObserver.observe(this.wrapper);\n }\n if (wantsDash) {\n // thickness and sharpEdge* change the radii without a resize.\n this.measureDash();\n }\n if (!wantsDash && this.dashObserver) {\n this.dashObserver.disconnect();\n this.dashObserver = undefined;\n this.dashBox = undefined;\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.dashObserver?.disconnect();\n this.dashObserver = undefined;\n }\n\n private renderDash(): TemplateResult | typeof nothing {\n const box = this.dashBox;\n if (this.mode !== ObcAlertFrameMode.unackedRectified || !box) {\n return nothing;\n }\n const pad = box.thickness + DASH_FLASH_GROWTH_PX;\n // A second, wider path for the on phase would have longer corner arcs\n // and its dashes would drift around the frame.\n const centreline: RoundedRect = {\n x: pad - box.thickness / 2,\n y: pad - box.thickness / 2,\n width: box.width + box.thickness,\n height: box.height + box.thickness,\n // A radius of 0 is a sharp edge and must stay square.\n radii: box.radii.map((r) =>\n r > 0 ? r + box.thickness / 2 : 0\n ) as RoundedRect['radii'],\n };\n const width = box.width + 2 * pad;\n const height = box.height + 2 * pad;\n return html`<svg\n class=\"dash\"\n aria-hidden=\"true\"\n width=${width}\n height=${height}\n viewBox=\"0 0 ${width} ${height}\"\n style=\"--dash-pad: ${pad}px\"\n >\n <path d=${roundedRectPath(centreline)}></path>\n </svg>`;\n }\n\n get resolvedFlashingSpeed(): ResolvedFlashingSpeed {\n switch (this.mode) {\n case ObcAlertFrameMode.unackedActive:\n return resolveFlashingSpeed(\n this.flashingSpeed,\n this.status,\n AlertFlashPhase.Active\n );\n case ObcAlertFrameMode.unackedRectified:\n return resolveFlashingSpeed(\n this.flashingSpeed,\n this.status,\n AlertFlashPhase.Rectified\n );\n default:\n return FlashingSpeed.Fixed;\n }\n }\n\n @property({type: Boolean, reflect: true}) wrapContent: boolean = false;\n\n @property({type: Boolean, reflect: true}) fullWidth: boolean = false;\n\n @property({type: Boolean}) sharpEdgeTopLeft: boolean = false;\n\n @property({type: Boolean}) sharpEdgeTopRight: boolean = false;\n\n @property({type: Boolean}) sharpEdgeBottomLeft: boolean = false;\n\n @property({type: Boolean}) sharpEdgeBottomRight: boolean = false;\n\n @property({type: String}) textSize: AlertFrameTextSize =\n AlertFrameTextSize.Regular;\n\n @property({type: Boolean}) showIcon: boolean = false;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n 'wrap-content': this.wrapContent,\n 'full-width': this.fullWidth,\n ['thickness-' + this.thickness]: true,\n [this.type]: true,\n [this.status]: true,\n ['text-size-' + this.textSize]: true,\n 'sharp-edge-top-left': this.sharpEdgeTopLeft,\n 'sharp-edge-top-right': this.sharpEdgeTopRight,\n 'sharp-edge-bottom-left': this.sharpEdgeBottomLeft,\n 'sharp-edge-bottom-right': this.sharpEdgeBottomRight,\n [this.mode]: true,\n ['flash-' + this.resolvedFlashingSpeed]: true,\n ['flash-effect-' + this.flashEffect]: true,\n })}\n >\n <slot></slot>\n ${this.renderDash()} ${this.flap()}\n </div>\n `;\n }\n\n private flap() {\n if (this.type === ObcAlertFrameType.Regular) {\n return nothing;\n }\n\n if (\n this.type === ObcAlertFrameType.SmallSideFlip &&\n !this.showAlertCategoryIcon\n ) {\n return nothing;\n }\n\n if (\n this.type === ObcAlertFrameType.LargeSideFlip &&\n !this.showIcon &&\n !this.showAlertCategoryIcon\n ) {\n return nothing;\n }\n\n let icon: TemplateResult | typeof nothing;\n if (!this.showAlertCategoryIcon) {\n icon = nothing;\n } else {\n icon = this.renderBadgeIcon();\n }\n\n if (this.type === ObcAlertFrameType.SmallSideFlip) {\n return html`<div class=\"flap small\">\n ${icon}\n <div class=\"mask up\"></div>\n </div>`;\n }\n if (this.type === ObcAlertFrameType.LargeSideFlip) {\n return html`<div class=\"flap large\">\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"mask up\"></div>\n <div class=\"mask down\"></div>\n </div>`;\n }\n if (\n this.type === ObcAlertFrameType.BottomFlip ||\n this.type === ObcAlertFrameType.TopFlip\n ) {\n return html`<div\n class=\"flap ${this.type === ObcAlertFrameType.BottomFlip\n ? 'bottom'\n : 'top'}\"\n >\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"label\"><slot name=\"label\"></slot></div>\n <div class=\"spacer\"></div>\n <div class=\"timer\"><slot name=\"timer\"></slot></div>\n <div class=\"mask right\"></div>\n <div class=\"mask left\"></div>\n </div>`;\n }\n console.error('Unknown type of alert frame:', this.type);\n return nothing;\n }\n\n private renderBadgeIcon(): TemplateResult {\n switch (getAlertBadgeComponent(this.status)) {\n case AlertBadgeComponent.Critical:\n return html`<obi-critical-badge\n class=\"icon badge\"\n ></obi-critical-badge>`;\n case AlertBadgeComponent.Warning:\n return html`<obi-warning-badge class=\"icon badge\"></obi-warning-badge>`;\n case AlertBadgeComponent.Caution:\n return html`<obi-caution-badge class=\"icon badge\"></obi-caution-badge>`;\n case AlertBadgeComponent.Diagnostic:\n return html`<obi-diagnostic-badge\n class=\"icon badge\"\n ></obi-diagnostic-badge>`;\n default:\n return html`<obi-alarm-badge class=\"icon badge\"></obi-alarm-badge>`;\n }\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\nexport function wrapWithAlertFrame(\n options: AlertFrameConfig | boolean | undefined,\n content: HTMLTemplateResult,\n fullWidth: boolean = false\n): HTMLTemplateResult {\n if (typeof options !== 'object' || options === null) {\n return content;\n }\n return html`<obc-alert-frame\n .type=${options.type ?? ObcAlertFrameType.SmallSideFlip}\n .thickness=${options.thickness ?? ObcAlertFrameThickness.Small}\n .status=${options.status ?? AlertType.Alarm}\n .mode=${options.mode ?? ObcAlertFrameMode.ackedActive}\n .flashingSpeed=${options.flashingSpeed ?? FlashingSpeed.Default}\n .showIcon=${options.showIcon ?? false}\n .showAlertCategoryIcon=${options.showAlertCategoryIcon ?? true}\n .wrapContent=${true}\n .fullWidth=${fullWidth}\n >${content}</obc-alert-frame\n >`;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-frame': ObcAlertFrame;\n }\n}\n"],"names":["ObcAlertFrameType","ObcAlertFrameThickness","ObcAlertFrameMode","ObcAlertFrameFlashEffect","AlertFrameTextSize"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,SAAA,IAAU;AACVA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,YAAA,IAAa;AACbA,qBAAA,SAAA,IAAU;AALA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAaL,IAAK,2CAAAC,4BAAL;AACLA,0BAAA,OAAA,IAAQ;AACRA,0BAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AAKL,IAAK,sCAAAC,uBAAL;AACLA,qBAAA,aAAA,IAAc;AACdA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,kBAAA,IAAmB;AAHT,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAYL,IAAK,6CAAAC,8BAAL;AACLA,4BAAA,SAAA,IAAU;AACVA,4BAAA,cAAA,IA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B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAjLd,cAiLgB,WAAA,YAAA,CAAA;AACkB,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAlLhC,cAkLkC,WAAA,yBAAA,CAAA;AAlLlC,gBAAN,gBAAA;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB,aAAA;AAwSN,SAAS,mBACd,SACA,SACA,YAAqB,OACD;AACpB,MAAI,OAAO,YAAY,YAAY,YAAY,MAAM;AACnD,WAAO;AAAA,EACT;AACA,SAAO;AAAA,YACG,QAAQ,QAAQ,iBAAA;AAAA,iBACX,QAAQ,aAAa,OAAA;AAAA,cACxB,QAAQ,UAAU,UAAU,KAAK;AAAA,YACnC,QAAQ,QAAQ,cAAA;AAAA,qBACP,QAAQ,iBAAiB,cAAc,OAAO;AAAA,gBACnD,QAAQ,YAAY,KAAK;AAAA,6BACZ,QAAQ,yBAAyB,IAAI;AAAA,mBAC/C,IAAI;AAAA,iBACN,SAAS;AAAA,OACnB,OAAO;AAAA;AAEd;"}
|
|
1
|
+
{"version":3,"file":"alert-frame.js","sources":["../../../src/components/alert-frame/alert-frame.ts"],"sourcesContent":["import {\n LitElement,\n html,\n unsafeCSS,\n nothing,\n TemplateResult,\n HTMLTemplateResult,\n} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport compentStyle from './alert-frame.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport '../../icons/icon-alarm-badge.js';\nimport '../../icons/icon-warning-badge.js';\nimport '../../icons/icon-caution-badge.js';\nimport '../../icons/icon-critical-badge.js';\nimport './diagnostic-badge.js';\nimport {customElement} from '../../decorator.js';\nimport {\n AlertType,\n FlashingSpeed,\n type ResolvedFlashingSpeed,\n} from '../../types.js';\nimport {\n getAlertBadgeComponent,\n AlertBadgeComponent,\n} from '../../alert-severity.js';\nimport {FlashingController} from '../../palettes/flashing-controller.js';\nimport {\n roundedRectPath,\n type RoundedRect,\n} from '../../svghelpers/rounded-rect.js';\nimport {AlertFlashPhase, resolveFlashingSpeed} from '../../alert-severity.js';\n\nexport {AlertType as ObcAlertFrameStatus} from '../../types.js';\n\n/**\n * Enum representing the available frame styles for an alert component.\n *\n * - Regular (\"regular\"): Standard alert frame layout.\n * - SmallSideFlip (\"small-side-flip\"): Flipped frame with a small side edge.\n * - LargeSideFlip (\"large-side-flip\"): Flipped frame with a large side edge.\n * - BottomFlip (\"bottom-flip\"): Frame flipped to the bottom position.\n */\nexport enum ObcAlertFrameType {\n Regular = 'regular',\n SmallSideFlip = 'small-side-flip',\n LargeSideFlip = 'large-side-flip',\n BottomFlip = 'bottom-flip',\n TopFlip = 'top-flip',\n}\n\n/**\n * Thickness options for the alert frame border.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\nexport enum ObcAlertFrameThickness {\n Small = 'small',\n Large = 'large',\n}\n\nexport enum ObcAlertFrameMode {\n ackedActive = 'acked-active',\n unackedActive = 'unacked-active',\n unackedRectified = 'unacked-rectified',\n}\n\n/**\n * How the frame renders the on phase of a flash: `outline` grows the centred\n * stroke by 2 px, 1 px on each side, in one step (the design); `outline-eased`\n * grows it the same way over a 50 ms transition. The eased variant exists for\n * design evaluation and may be removed (#1224).\n */\nexport enum ObcAlertFrameFlashEffect {\n Outline = 'outline',\n OutlineEased = 'outline-eased',\n}\n\n/**\n * Text size options for flip-flap typography.\n * - `regular`: Standard text size (default).\n * - `large`: Larger text for increased visibility.\n */\nexport enum AlertFrameTextSize {\n Regular = 'regular',\n Large = 'large',\n}\n\n/** Wrapper geometry the dashed overlay is drawn from; measured, never derived from props. */\ninterface DashBox {\n width: number;\n height: number;\n thickness: number;\n radii: RoundedRect['radii'];\n}\n\n/** On-phase stroke growth; the svg leaves half of stroke plus growth around the box. */\nconst DASH_FLASH_GROWTH_PX = 2;\n\nfunction sameDashBox(a: DashBox, b: DashBox | undefined): boolean {\n return (\n b !== undefined &&\n a.width === b.width &&\n a.height === b.height &&\n a.thickness === b.thickness &&\n a.radii.every((r, i) => r === b.radii[i])\n );\n}\n\nexport interface AlertFrameConfig {\n type?: ObcAlertFrameType;\n thickness?: ObcAlertFrameThickness;\n status?: AlertType;\n mode?: ObcAlertFrameMode;\n flashingSpeed?: FlashingSpeed;\n textSize?: AlertFrameTextSize;\n showIcon?: boolean;\n showAlertCategoryIcon?: boolean;\n}\n\n/**\n * `<obc-alert-frame>` – A bordered frame component for visually emphasizing alert or status messages.\n *\n * The alert frame provides a prominent outline and optional \"flap\" with status icon to draw attention to critical information or UI regions. It supports multiple visual variants and thicknesses, and can be configured to indicate different alert statuses (alarm, warning, caution). The component is designed to wrap content and visually distinguish it from the surrounding UI.\n *\n * ### Features\n * - **Variants (type):**\n * - `regular`: Standard outlined frame with no flap or icon.\n * - `small-side-flip`: Adds a small side flap with a status icon at the top right.\n * - `large-side-flip`: Adds a larger, vertical side flap with a status icon and optional custom icon.\n * - `bottom-flip`: Adds a bottom flap with a status icon, label, and timer slots.\n * - **Thickness options:** Choose between `small` (thin border) and `large` (thick border) for visual emphasis.\n * - **Centred stroke:** The stroke straddles the frame edge, half over the content and half outside, so frames on touching components share one edge. While flashing it grows by 1 px on each side.\n * - **Status indication:** Displays different color schemes and icons for the legacy statuses (`alarm`, `warning`, `caution`) and the level statuses (`level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`).\n * - **Acknowledgement mode:** The `mode` property reflects the alert lifecycle state — `acked-active` (default, steady), `unacked-active` (flashes) and `unacked-rectified` (dashed, flashes) — and `flashingSpeed` picks the tempo.\n * - **Content wrapping:** When `wrapContent` is true, the frame wraps and sizes itself to its slotted content rather than overlaying a fixed region.\n * - **Customizable corners:** Each corner can be set to a sharp (non-rounded) edge for integration with other UI elements.\n * - **Slot-based content:** Supports custom icons, labels, and timers in flap variants via named slots.\n *\n * ### Usage Guidelines\n * Use `obc-alert-frame` to highlight important content, such as alerts, warnings, or status panels. The flap variants are ideal for drawing extra attention to urgent or time-sensitive information, while the regular type provides a subtle but clear border. Choose the status to match the severity of the message (alarm, warning, caution). Adjust thickness for visual hierarchy—use large for high-priority alerts and small for less critical notices.\n *\n * **TODO(designer):** Provide guidance on when to use each flap type (small-side-flip, large-side-flip, bottom-flip) and recommended scenarios for sharp edge usage.\n *\n * ### Features/Variants\n * - **Type (Visual Variant):**\n * - `regular`: Simple outlined frame, no flap or icon.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n * - **Thickness:** `small` (default) or `large` for border width.\n * - **Status:** `alarm`, `warning`, `caution`, or the level severities (`level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`)—affects color and icon.\n * - **Mode:** `acked-active` (default), `unacked-active`, or `unacked-rectified`—affects blinking/animation.\n * - **Corner Customization:** Each corner can be made sharp (not rounded) via boolean properties.\n *\n * ### Slots and Content Structure\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|-----------------|---------|\n * | (default) | Always | Main content inside the alert frame. |\n * | icon | `large-side-flip` or `bottom-flip` | Custom icon displayed in the flap (in addition to status icon). |\n * | label | `bottom-flip` only | Label text shown in the bottom flap. |\n * | timer | `bottom-flip` only | Timer or time label in the bottom flap. |\n *\n * ### Properties and Attributes\n * - `type`: Selects the visual variant/flap style. Default is `small-side-flip`.\n * - `thickness`: Controls border thickness (`small` or `large`). Default is `small`.\n * - `status`: Sets the alert status and color/icon (`alarm`, `warning`, `caution`, or the `level-*` severities). Default is `alarm`.\n * - `mode`: Acknowledgement lifecycle state (`acked-active`, `unacked-active`, `unacked-rectified`) controlling blinking/animation. Default is `acked-active`.\n * - `wrapContent`: When true, the frame wraps and sizes to its slotted content instead of overlaying a fixed region. Default is `false`.\n * - `sharpEdgeTopLeft`, `sharpEdgeTopRight`, `sharpEdgeBottomLeft`, `sharpEdgeBottomRight`: Boolean flags to make each corner sharp instead of rounded.\n *\n * ### Best Practices and Constraints\n * - Use the status property to match the severity of the alert.\n * - Only use the bottom-flip variant when both label and timer are relevant.\n * - For visual consistency, align sharp edge settings with adjacent UI elements.\n * - The default slot is for the main content; use named slots for icons, labels, and timers as needed.\n *\n * ### Example:\n * ```\n * <obc-alert-frame\n * type=\"bottom-flip\"\n * thickness=\"large\"\n * status=\"warning\"\n * sharpEdgeTopLeft\n * >\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * <div slot=\"label\">Low Battery</div>\n * <div slot=\"timer\">00:15</div>\n * <div>Critical system message goes here.</div>\n * </obc-alert-frame>\n * ```\n *\n * @property wrapContent - When true, the frame wraps and sizes itself to its slotted content instead\n * of overlaying a fixed region. Reflected to an attribute for CSS styling.\n * @property fullWidth - When true, the frame stretches to fill the full width of its container\n * instead of hugging its content. Reflected to an attribute for CSS styling.\n * @property sharpEdgeTopLeft - If true, the top-left corner will be sharp (not rounded).\n * @property sharpEdgeTopRight - If true, the top-right corner will be sharp (not rounded).\n * @property sharpEdgeBottomLeft - If true, the bottom-left corner will be sharp (not rounded).\n * @property sharpEdgeBottomRight - If true, the bottom-right corner will be sharp (not rounded).\n * @property flashingSpeed - Flash tempo: `default` resolves from the alert type and mode\n * (critical/alarm/high fast, warning/medium slow, low very slow, every rectified alert very\n * slow, caution and diagnostic fixed), `fast`, `slow`, `very-slow` force a tempo, `fixed`\n * never flashes. Acknowledged frames are always steady.\n * @property flashEffect - `outline` (default) grows the outline by 2 px, 1 px each side, while on in one step;\n * `outline-eased` grows it over a 50 ms transition, a design-evaluation option.\n * @slot - Default slot for main alert content.\n * @slot icon - Custom icon for the flap (large-side-flip, bottom-flip).\n * @slot label - Label text for the bottom flap (bottom-flip only).\n * @slot timer - Timer or time label for the bottom flap (bottom-flip only).\n * @beta\n */\n@customElement('obc-alert-frame')\nexport class ObcAlertFrame extends LitElement {\n /**\n * Visual variant of the alert frame.\n * - `regular`: Outlined frame only.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n *\n * Default: `small-side-flip`\n */\n @property({type: String}) type: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n\n /**\n * Border thickness of the alert frame.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\n @property({type: String}) thickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n\n /**\n * Status of the alert, controlling color scheme and icon.\n * - `alarm`: Highest severity (default).\n * - `warning`: Medium severity.\n * - `caution`: Lower severity.\n * - `level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`: level severity levels, styled to match their legacy equivalents.\n */\n @property({type: String}) status: AlertType = AlertType.Alarm;\n\n /**\n * Acknowledgement lifecycle state, controlling the frame's blinking/animation.\n * - `acked-active`: Active and acknowledged (default); no blinking.\n * - `unacked-active`: Active and not yet acknowledged; blinks.\n * - `unacked-rectified`: Condition cleared but not yet acknowledged.\n */\n @property({type: String}) mode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n\n @property({type: String}) flashEffect: ObcAlertFrameFlashEffect =\n ObcAlertFrameFlashEffect.Outline;\n\n protected readonly flashing = new FlashingController(\n this,\n () => this.resolvedFlashingSpeed\n );\n\n @state() private dashBox?: DashBox;\n\n @query('.wrapper') private wrapper?: HTMLElement;\n\n private dashObserver?: ResizeObserver;\n\n private measureDash = (): void => {\n const wrapper = this.wrapper;\n if (!wrapper) {\n return;\n }\n const style = getComputedStyle(wrapper);\n const px = (value: string) => parseFloat(value) || 0;\n const box: DashBox = {\n width: wrapper.offsetWidth,\n height: wrapper.offsetHeight,\n thickness: px(style.getPropertyValue('--thickness')),\n radii: [\n px(style.borderTopLeftRadius),\n px(style.borderTopRightRadius),\n px(style.borderBottomRightRadius),\n px(style.borderBottomLeftRadius),\n ],\n };\n // Setting state from updated() re-renders; only do it for a real change.\n if (!sameDashBox(box, this.dashBox)) {\n this.dashBox = box;\n }\n };\n\n override connectedCallback() {\n super.connectedCallback();\n if (this.hasUpdated) {\n this.requestUpdate();\n }\n }\n\n override updated() {\n const wantsDash =\n this.mode === ObcAlertFrameMode.unackedRectified && this.isConnected;\n if (wantsDash && !this.dashObserver && this.wrapper) {\n this.dashObserver = new ResizeObserver(this.measureDash);\n this.dashObserver.observe(this.wrapper);\n }\n if (wantsDash) {\n // thickness and sharpEdge* change the radii without a resize.\n this.measureDash();\n }\n if (!wantsDash && this.dashObserver) {\n this.dashObserver.disconnect();\n this.dashObserver = undefined;\n this.dashBox = undefined;\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.dashObserver?.disconnect();\n this.dashObserver = undefined;\n }\n\n private renderDash(): TemplateResult | typeof nothing {\n const box = this.dashBox;\n if (this.mode !== ObcAlertFrameMode.unackedRectified || !box) {\n return nothing;\n }\n const pad = (box.thickness + DASH_FLASH_GROWTH_PX) / 2;\n // The centreline is the wrapper edge, as for the solid outline. A second,\n // wider path for the on phase would have longer corner arcs and its\n // dashes would drift around the frame.\n const centreline: RoundedRect = {\n x: pad,\n y: pad,\n width: box.width,\n height: box.height,\n radii: box.radii,\n };\n const width = box.width + 2 * pad;\n const height = box.height + 2 * pad;\n return html`<svg\n class=\"dash\"\n aria-hidden=\"true\"\n width=${width}\n height=${height}\n viewBox=\"0 0 ${width} ${height}\"\n style=\"--dash-pad: ${pad}px\"\n >\n <path d=${roundedRectPath(centreline)}></path>\n </svg>`;\n }\n\n get resolvedFlashingSpeed(): ResolvedFlashingSpeed {\n switch (this.mode) {\n case ObcAlertFrameMode.unackedActive:\n return resolveFlashingSpeed(\n this.flashingSpeed,\n this.status,\n AlertFlashPhase.Active\n );\n case ObcAlertFrameMode.unackedRectified:\n return resolveFlashingSpeed(\n this.flashingSpeed,\n this.status,\n AlertFlashPhase.Rectified\n );\n default:\n return FlashingSpeed.Fixed;\n }\n }\n\n @property({type: Boolean, reflect: true}) wrapContent: boolean = false;\n\n @property({type: Boolean, reflect: true}) fullWidth: boolean = false;\n\n @property({type: Boolean}) sharpEdgeTopLeft: boolean = false;\n\n @property({type: Boolean}) sharpEdgeTopRight: boolean = false;\n\n @property({type: Boolean}) sharpEdgeBottomLeft: boolean = false;\n\n @property({type: Boolean}) sharpEdgeBottomRight: boolean = false;\n\n @property({type: String}) textSize: AlertFrameTextSize =\n AlertFrameTextSize.Regular;\n\n @property({type: Boolean}) showIcon: boolean = false;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n 'wrap-content': this.wrapContent,\n 'full-width': this.fullWidth,\n ['thickness-' + this.thickness]: true,\n [this.type]: true,\n [this.status]: true,\n ['text-size-' + this.textSize]: true,\n 'sharp-edge-top-left': this.sharpEdgeTopLeft,\n 'sharp-edge-top-right': this.sharpEdgeTopRight,\n 'sharp-edge-bottom-left': this.sharpEdgeBottomLeft,\n 'sharp-edge-bottom-right': this.sharpEdgeBottomRight,\n [this.mode]: true,\n ['flash-' + this.resolvedFlashingSpeed]: true,\n ['flash-effect-' + this.flashEffect]: true,\n })}\n >\n <slot></slot>\n ${this.renderDash()} ${this.flap()}\n </div>\n `;\n }\n\n private flap() {\n if (this.type === ObcAlertFrameType.Regular) {\n return nothing;\n }\n\n if (\n this.type === ObcAlertFrameType.SmallSideFlip &&\n !this.showAlertCategoryIcon\n ) {\n return nothing;\n }\n\n if (\n this.type === ObcAlertFrameType.LargeSideFlip &&\n !this.showIcon &&\n !this.showAlertCategoryIcon\n ) {\n return nothing;\n }\n\n let icon: TemplateResult | typeof nothing;\n if (!this.showAlertCategoryIcon) {\n icon = nothing;\n } else {\n icon = this.renderBadgeIcon();\n }\n\n if (this.type === ObcAlertFrameType.SmallSideFlip) {\n return html`<div class=\"flap small\">\n ${icon}\n <div class=\"mask up\"></div>\n </div>`;\n }\n if (this.type === ObcAlertFrameType.LargeSideFlip) {\n return html`<div class=\"flap large\">\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"mask up\"></div>\n <div class=\"mask down\"></div>\n </div>`;\n }\n if (\n this.type === ObcAlertFrameType.BottomFlip ||\n this.type === ObcAlertFrameType.TopFlip\n ) {\n return html`<div\n class=\"flap ${this.type === ObcAlertFrameType.BottomFlip\n ? 'bottom'\n : 'top'}\"\n >\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"label\"><slot name=\"label\"></slot></div>\n <div class=\"spacer\"></div>\n <div class=\"timer\"><slot name=\"timer\"></slot></div>\n <div class=\"mask right\"></div>\n <div class=\"mask left\"></div>\n </div>`;\n }\n console.error('Unknown type of alert frame:', this.type);\n return nothing;\n }\n\n private renderBadgeIcon(): TemplateResult {\n switch (getAlertBadgeComponent(this.status)) {\n case AlertBadgeComponent.Critical:\n return html`<obi-critical-badge\n class=\"icon badge\"\n ></obi-critical-badge>`;\n case AlertBadgeComponent.Warning:\n return html`<obi-warning-badge class=\"icon badge\"></obi-warning-badge>`;\n case AlertBadgeComponent.Caution:\n return html`<obi-caution-badge class=\"icon badge\"></obi-caution-badge>`;\n case AlertBadgeComponent.Diagnostic:\n return html`<obi-diagnostic-badge\n class=\"icon badge\"\n ></obi-diagnostic-badge>`;\n default:\n return html`<obi-alarm-badge class=\"icon badge\"></obi-alarm-badge>`;\n }\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\nexport function wrapWithAlertFrame(\n options: AlertFrameConfig | boolean | undefined,\n content: HTMLTemplateResult,\n fullWidth: boolean = false\n): HTMLTemplateResult {\n if (typeof options !== 'object' || options === null) {\n return content;\n }\n return html`<obc-alert-frame\n .type=${options.type ?? ObcAlertFrameType.SmallSideFlip}\n .thickness=${options.thickness ?? ObcAlertFrameThickness.Small}\n .status=${options.status ?? AlertType.Alarm}\n .mode=${options.mode ?? ObcAlertFrameMode.ackedActive}\n .flashingSpeed=${options.flashingSpeed ?? FlashingSpeed.Default}\n .showIcon=${options.showIcon ?? false}\n .showAlertCategoryIcon=${options.showAlertCategoryIcon ?? true}\n .wrapContent=${true}\n .fullWidth=${fullWidth}\n >${content}</obc-alert-frame\n >`;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-frame': ObcAlertFrame;\n }\n}\n"],"names":["ObcAlertFrameType","ObcAlertFrameThickness","ObcAlertFrameMode","ObcAlertFrameFlashEffect","AlertFrameTextSize"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,SAAA,IAAU;AACVA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,YAAA,IAAa;AACbA,qBAAA,SAAA,IAAU;AALA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAaL,IAAK,2CAAAC,4BAAL;AACLA,0BAAA,OAAA,IAAQ;AACRA,0BAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AAKL,IAAK,sCAAAC,uBAAL;AACLA,qBAAA,aAAA,IAAc;AACdA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,kBAAA,IAAmB;AAHT,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAYL,IAAK,6CAAAC,8BAAL;AACLA,4BAAA,SAAA,IAAU;AACVA,4BAAA,cAAA,IAAe;AAFL,SAAAA;AAAA,GAAA,4BAAA,CAAA,CAAA;AAUL,IAAK,uCAAAC,wBAAL;AACLA,sBAAA,SAAA,IAAU;AACVA,sBAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AAcZ,MAAM,uBAAuB;AAE7B,SAAS,YAAY,GAAY,GAAiC;AAChE,SACE,MAAM,UACN,EAAE,UAAU,EAAE,SACd,EAAE,WAAW,EAAE,UACf,EAAE,cAAc,EAAE,aAClB,EAAE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A,YACnC,QAAQ,QAAQ,cAAA;AAAA,qBACP,QAAQ,iBAAiB,cAAc,OAAO;AAAA,gBACnD,QAAQ,YAAY,KAAK;AAAA,6BACZ,QAAQ,yBAAyB,IAAI;AAAA,mBAC/C,IAAI;AAAA,iBACN,SAAS;AAAA,OACnB,OAAO;AAAA;AAEd;"}
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js
CHANGED
|
@@ -14,6 +14,7 @@ const compentStyle = css`* {
|
|
|
14
14
|
.alert-list {
|
|
15
15
|
min-height: 0;
|
|
16
16
|
flex-grow: 0;
|
|
17
|
+
--alert-list-grid-columns: 1fr;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
.spacer {
|
|
@@ -38,13 +39,8 @@ const compentStyle = css`* {
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
obc-table::part(grid) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.wrapper.small obc-table::part(grid) {
|
|
45
|
-
grid-template-columns: 1fr min-content var(
|
|
46
|
-
--app-components-alert-table-row-ack-container-width-small
|
|
47
|
-
);
|
|
42
|
+
/* set from columns[].width */
|
|
43
|
+
grid-template-columns: var(--alert-list-grid-columns);
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
.empty-list {
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-list-details-experimental.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert-list-details-experimental.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { Alert } from '../../types.js';
|
|
3
|
+
import { ObcTableCellData } from '../table/table.js';
|
|
3
4
|
import '../icon-button/icon-button.js';
|
|
4
5
|
import '../button/button.js';
|
|
5
6
|
import '../../icons/icon-silence-iec.js';
|
|
@@ -12,56 +13,174 @@ import '../../icons/icon-alarm-noack-iec.js';
|
|
|
12
13
|
import '../../icons/icon-warning-noack-iec.js';
|
|
13
14
|
import '../alert-icon/alert-icon.js';
|
|
14
15
|
import '../scrollbar/scrollbar.js';
|
|
15
|
-
export declare enum
|
|
16
|
+
export declare enum FilterModes {
|
|
16
17
|
UNACKED = "unacked",
|
|
17
18
|
ALL = "all",
|
|
18
19
|
SHELVED = "shelved",
|
|
19
20
|
BLOCKED = "blocked",
|
|
20
21
|
RECTIFIED = "rectified"
|
|
21
22
|
}
|
|
22
|
-
export type
|
|
23
|
+
export type ObcAlertListCellClickEvent = CustomEvent<{
|
|
23
24
|
alert: Alert;
|
|
25
|
+
columnKey: string;
|
|
26
|
+
rowId: string;
|
|
24
27
|
}>;
|
|
25
28
|
export type ObcRowClickEvent = CustomEvent<{
|
|
26
29
|
alert: Alert;
|
|
30
|
+
rowId: string;
|
|
27
31
|
}>;
|
|
28
|
-
export
|
|
29
|
-
name
|
|
32
|
+
export interface AlertListColumnBase {
|
|
33
|
+
/** Unique within the list; part of the cell slot name. */
|
|
34
|
+
key: string;
|
|
35
|
+
label: string;
|
|
36
|
+
/** CSS grid track size. Defaults to `1fr` for the first column, `min-content` for the rest. */
|
|
37
|
+
width?: string;
|
|
38
|
+
dividerRight?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** A column whose cells the list renders from `cell(alert)`. */
|
|
41
|
+
export interface AlertListDataColumn extends AlertListColumnBase {
|
|
42
|
+
cell: (alert: Alert) => ObcTableCellData | undefined;
|
|
43
|
+
/** Makes the column sortable. */
|
|
44
|
+
compare?: (a: Alert, b: Alert) => number;
|
|
45
|
+
sortDirection?: 'asc' | 'desc';
|
|
46
|
+
}
|
|
47
|
+
/** A column whose cells the consumer supplies through `cell-<key>:<rowId>` slots. */
|
|
48
|
+
export interface AlertListSlotColumn extends AlertListColumnBase {
|
|
49
|
+
slot: true;
|
|
50
|
+
}
|
|
51
|
+
export type AlertListColumn = AlertListDataColumn | AlertListSlotColumn;
|
|
52
|
+
export type AlertListColumnOptions = Partial<AlertListColumnBase>;
|
|
53
|
+
/** One cell of a slot column, for every row including rows in collapsed groups. */
|
|
54
|
+
export interface AlertListCellSlot {
|
|
55
|
+
name: string;
|
|
56
|
+
alert: Alert;
|
|
57
|
+
rowId: string;
|
|
58
|
+
columnKey: string;
|
|
59
|
+
}
|
|
60
|
+
export type ObcAlertListCellSlotsChangeEvent = CustomEvent<AlertListCellSlot[]>;
|
|
61
|
+
export interface AlertListRow {
|
|
62
|
+
rowId: string;
|
|
63
|
+
parentRowId?: string;
|
|
64
|
+
alert: Alert;
|
|
65
|
+
level: number;
|
|
66
|
+
expandable: boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare function getFilterModeData(filterMode: FilterModes): {
|
|
69
|
+
name: FilterModes;
|
|
30
70
|
title: string;
|
|
31
71
|
emptyTitle: string;
|
|
32
72
|
emptyIcon: import('lit-html').TemplateResult<1>;
|
|
33
73
|
filter: (alert: Alert) => boolean;
|
|
34
74
|
};
|
|
35
75
|
export declare function canAckFilter(filter: (alert: Alert) => boolean): (alert: Alert) => boolean;
|
|
76
|
+
/** Name of the slot that fills the cell of a slot column in one row. */
|
|
77
|
+
export declare function alertListCellSlotName(columnKey: string, rowId: string): string;
|
|
78
|
+
/** Alert icon, text and source; sorted by priority. */
|
|
79
|
+
export declare function statusColumn(options?: AlertListColumnOptions): AlertListDataColumn;
|
|
80
|
+
/** ACK button, or the no-ack icon, for alerts that await acknowledgement. The button fires `cell-click`. */
|
|
81
|
+
export declare function ackColumn(options?: AlertListColumnOptions): AlertListDataColumn;
|
|
82
|
+
/** Activation time; sorted by time. */
|
|
83
|
+
export declare function timeColumn({ formatter, ...options }?: AlertListColumnOptions & {
|
|
84
|
+
formatter?: (time: Date) => string;
|
|
85
|
+
}): AlertListDataColumn;
|
|
86
|
+
/** Tag ID prefixed with `#`; sorted alphabetically. */
|
|
87
|
+
export declare function tagIdColumn(options?: AlertListColumnOptions): AlertListDataColumn;
|
|
88
|
+
/**
|
|
89
|
+
* Every row `obc-alert-list-details-experimental` can show for these alerts
|
|
90
|
+
* and filter mode, rows inside collapsed groups included. An alert that is a member
|
|
91
|
+
* of several groups gets one row, and one `rowId`, under each.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getAlertRows(alerts: Alert[], filterMode: FilterModes): AlertListRow[];
|
|
36
94
|
/**
|
|
37
|
-
*
|
|
95
|
+
* `<obc-alert-list-details-experimental>` lists alerts in a table with
|
|
96
|
+
* consumer-defined columns, grouping alerts through `memberOf`.
|
|
97
|
+
*
|
|
98
|
+
* ## Features
|
|
99
|
+
* - **Columns:** `columns` sets which columns show and in what order. A data
|
|
100
|
+
* column renders each cell from `cell(alert)`; a slot column renders
|
|
101
|
+
* whatever the consumer places in the cell's slot.
|
|
102
|
+
* - **Column factories:** `statusColumn()`, `ackColumn()`, `timeColumn()` and
|
|
103
|
+
* `tagIdColumn()` build the standard data columns; each takes overrides
|
|
104
|
+
* such as `label`, `width` or `dividerRight`.
|
|
105
|
+
* - **Filter modes:** `filterMode` lists unacknowledged, all, shelved,
|
|
106
|
+
* blocked or rectified alerts, with an empty state per filter mode.
|
|
107
|
+
* - **Grouping:** an alert listing group ids in `memberOf` renders under each
|
|
108
|
+
* of those groups; groups nest and can be collapsed.
|
|
109
|
+
* - **Selection:** `selectedRowId` highlights one row. When a collapsed group
|
|
110
|
+
* hides it, the nearest visible group row is highlighted instead.
|
|
111
|
+
*
|
|
112
|
+
* ## Usage Guidelines
|
|
113
|
+
* - Use a slot column when the cell content must be owned by the consumer,
|
|
114
|
+
* for example a button the application disables or removes later. Slotted
|
|
115
|
+
* content stays in the light DOM, so it can be looked up by id.
|
|
116
|
+
* - Slot names are `cell-<key>:<rowId>`. `cellSlots` lists every one, with its
|
|
117
|
+
* alert, row id and column key, and `cell-slots-change` fires when the list
|
|
118
|
+
* changes. The Svelte wrapper renders its `cell` snippet once per entry. An
|
|
119
|
+
* alert in two groups has two rows, so it gets two entries.
|
|
120
|
+
* - Without a wrapper, build the names from `getAlertRows(alerts, filterMode)`
|
|
121
|
+
* and `alertListCellSlotName(key, rowId)`, or read `cellSlots`.
|
|
122
|
+
* - Clicks on buttons, links and inputs in a cell do not fire `row-click`.
|
|
123
|
+
* - The consumer owns the selection: set `selectedRowId` from `row-click`, and
|
|
124
|
+
* set it to `undefined` on a second click to unselect. The list never changes
|
|
125
|
+
* it; clear it when the row is no longer in `getAlertRows(alerts, filterMode)`.
|
|
126
|
+
*
|
|
127
|
+
* ## Example
|
|
128
|
+
* ```html
|
|
129
|
+
* <obc-alert-list-details-experimental>
|
|
130
|
+
* <obc-button slot="cell-ack:radar" id="ack-radar">ACK</obc-button>
|
|
131
|
+
* </obc-alert-list-details-experimental>
|
|
132
|
+
* ```
|
|
133
|
+
* with `columns` set to `[statusColumn(), {key: 'ack', label: 'ACK-status', slot: true}]`.
|
|
134
|
+
*
|
|
135
|
+
* @property filterMode - Which alerts to list.
|
|
136
|
+
* @property alerts - Alerts to list.
|
|
137
|
+
* @property columns - Columns in display order.
|
|
138
|
+
* @property showHeader - Whether to show the column header row.
|
|
38
139
|
* @property defaultExpanded - Whether groups start expanded. Set false to open the list collapsed.
|
|
39
|
-
* @
|
|
140
|
+
* @property selectedRowId - Row id to highlight, as given by `row-click` or `getAlertRows()`. Nothing is highlighted when no row has this id.
|
|
141
|
+
* @slot cell-<key>:<rowId> - Content of the cell in slot column `<key>` for row `<rowId>`.
|
|
142
|
+
* @fires {ObcAlertListCellClickEvent} cell-click - Fired when the user clicks a button rendered by a data column, such as the one from `ackColumn()`.
|
|
40
143
|
* @fires {ObcRowClickEvent} row-click - Fired when the user clicks a row.
|
|
144
|
+
* @fires {ObcAlertListCellSlotsChangeEvent} cell-slots-change - Fired when `cellSlots` changes; the detail is the new list.
|
|
41
145
|
* @experimental
|
|
42
146
|
*/
|
|
43
147
|
export declare class ObcAlertListDetailsExperimental extends LitElement {
|
|
44
|
-
|
|
148
|
+
/** Which alerts to list. */
|
|
149
|
+
filterMode: FilterModes;
|
|
150
|
+
/** Alerts to list. */
|
|
45
151
|
alerts: Alert[];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
152
|
+
/** Columns in display order. */
|
|
153
|
+
columns: AlertListColumn[];
|
|
154
|
+
/** Whether to show the column header row. */
|
|
155
|
+
showHeader: boolean;
|
|
50
156
|
/** Whether groups start expanded. Set false to open the list collapsed. */
|
|
51
157
|
defaultExpanded: boolean;
|
|
158
|
+
/** Row id to highlight, as given by `row-click` or `getAlertRows()`. Nothing is highlighted when no row has this id. */
|
|
159
|
+
selectedRowId?: string;
|
|
52
160
|
private alertList;
|
|
53
161
|
private expansionOverrides;
|
|
54
162
|
private alertByRowId;
|
|
163
|
+
private allRowIds;
|
|
164
|
+
private _cellSlots;
|
|
165
|
+
private cellSlotsChanged;
|
|
166
|
+
/** Slot of every cell in a slot column, rows in collapsed groups included. */
|
|
167
|
+
get cellSlots(): AlertListCellSlot[];
|
|
168
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
169
|
+
updated(): void;
|
|
55
170
|
getVisibleAlerts(): Alert[];
|
|
56
171
|
private onRowClick;
|
|
57
172
|
private onCellButtonClick;
|
|
58
173
|
private onExpandToggle;
|
|
59
174
|
private isExpanded;
|
|
60
|
-
private
|
|
175
|
+
private compareRows;
|
|
176
|
+
private get tableColumns();
|
|
177
|
+
private get gridColumns();
|
|
61
178
|
private get metadata();
|
|
62
|
-
private get filteredAlerts();
|
|
63
179
|
private buildVisibleRows;
|
|
180
|
+
/** The selected row, or the nearest visible group row when a collapsed group hides it. */
|
|
181
|
+
private highlightedRowId;
|
|
64
182
|
private buildRowCells;
|
|
183
|
+
private slotNames;
|
|
65
184
|
render(): import('lit-html').TemplateResult<1>;
|
|
66
185
|
static styles: import('lit').CSSResult;
|
|
67
186
|
}
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-list-details-experimental.d.ts","sourceRoot":"","sources":["../../../src/components/alert-list-details-experimental/alert-list-details-experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"alert-list-details-experimental.d.ts","sourceRoot":"","sources":["../../../src/components/alert-list-details-experimental/alert-list-details-experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAkB,MAAM,KAAK,CAAC;AAMhE,OAAO,+BAA+B,CAAC;AACvC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,yCAAyC,CAAC;AACjD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,EAMN,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAGL,gBAAgB,EAMjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AAEnC,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC;IACnD,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MA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