@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.129 → 2.0.0-next.131
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 +39 -7
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +35 -3
- package/dist/building-blocks/readout-block/readout-block.d.ts +9 -2
- package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.js +17 -6
- package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
- package/dist/components/modal-window/modal-window.css.js +5 -0
- package/dist/components/modal-window/modal-window.css.js.map +1 -1
- package/dist/components/modal-window/modal-window.d.ts +8 -0
- package/dist/components/modal-window/modal-window.d.ts.map +1 -1
- package/dist/components/modal-window/modal-window.js.map +1 -1
- package/dist/components/progress-bar/progress-bar.css.js +8 -0
- package/dist/components/progress-bar/progress-bar.css.js.map +1 -1
- package/dist/components/progress-bar/progress-bar.d.ts +11 -0
- package/dist/components/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/progress-bar/progress-bar.js +12 -1
- package/dist/components/progress-bar/progress-bar.js.map +1 -1
- package/package.json +1 -1
- package/src/building-blocks/readout-block/readout-block.ts +17 -6
- package/src/components/modal-window/modal-window-sizing.stories.ts +155 -0
- package/src/components/modal-window/modal-window.css +5 -0
- package/src/components/modal-window/modal-window.ts +8 -0
- package/src/components/progress-bar/progress-bar.css +8 -0
- package/src/components/progress-bar/progress-bar.stories.ts +23 -0
- package/src/components/progress-bar/progress-bar.ts +18 -1
package/custom-elements.json
CHANGED
|
@@ -41443,7 +41443,7 @@
|
|
|
41443
41443
|
"text": "TemplateResult"
|
|
41444
41444
|
}
|
|
41445
41445
|
},
|
|
41446
|
-
"description": "The advice marker for the current category / triggered state. Resting\ncategories carry a neutral outline glyph (tinted via `currentColor`);\ntriggered alert categories swap to the filled IEC status icon,
|
|
41446
|
+
"description": "The advice marker for the current category / triggered state. Resting\ncategories carry a neutral outline glyph (tinted via `currentColor`);\ntriggered alert categories swap to the filled IEC status icon rendered\nwith `useCssColor`, which selects the icon's token-coloured variant\n(alert fill + on-alert glyph, e.g. `--alert-caution-color` +\n`--on-caution-active-color`) — without it the same icon is a\nsingle-colour `currentColor` silhouette. This mirrors `obc-alert-icon`.\nThe resting icons and the advice diamond deliberately stay on\n`currentColor`: their css-colour variants hard-code\n`--element-active-color`, which would defeat the neutral tint and the\noptimal / eco triggered tint applied from CSS."
|
|
41447
41447
|
},
|
|
41448
41448
|
{
|
|
41449
41449
|
"kind": "method",
|
|
@@ -54878,8 +54878,15 @@
|
|
|
54878
54878
|
"declarations": [
|
|
54879
54879
|
{
|
|
54880
54880
|
"kind": "class",
|
|
54881
|
-
"description": "`<obc-modal-window>` – A modular dialog component for displaying content and capturing user actions.\n\nThe `obc-modal-window` provides a structured layout with a header (title and leading icon), a content area, and a footer with action buttons (Cancel, Done, and an optional custom action).\n\n### Features\n- **Flexible Sizing:** Supports `small`, `medium`, and `large` sizes to accommodate different content amounts.\n- **Header Customization:** Includes a title slot and an optional leading icon slot.\n- **Action Management:** Built-in \"Cancel\" and \"Done\" buttons, plus an optional additional action button.\n- **Responsive Actions:** Action buttons automatically switch between horizontal and vertical layouts based on the modal size.\n\n### Slots\n| Slot Name | Renders When... | Purpose |\n|---------------|----------------------------|----------------------------------------------------|\n| leading-icon | `hasLeadingIcon` is true | Icon displayed before the title |\n| title | Always | Main heading text for the modal |\n| content | Always | Primary content area of the modal |\n| option-label | `hasOptionalAction` is true | Label for the optional action button |\n| cancel-label | `hasCancelAction` is true | Label for the cancel button |\n| done-label | Always | Label for the primary (done) button |\n\n### Properties\n- `size` (ObcModalWindowSize): Controls the width and layout of the modal. Default is `large`.\n- `hasOptionalAction` (boolean): Shows an additional action button when true.\n- `hasLeadingIcon` (boolean): Shows the leading icon slot when true.\n- `hasCancelAction` (boolean): Shows the footer cancel button when true. Default is `true`.\n- `hasCloseAction` (boolean): Shows the header close (X) button when true. Default is `true`.\n\n### Events\n- `close-click`: Fired when the close (X) button in the header is clicked.\n- `cancel-click`: Fired when the cancel button is clicked.\n- `done-click`: Fired when the done button is clicked.\n- `option-click`: Fired when the optional action button is clicked.\n\n### Example:\n```html\n<obc-modal-window size=\"medium\" hasLeadingIcon>\n <span slot=\"leading-icon\"><obi-info></obi-info></span>\n <span slot=\"title\">Settings</span>\n <div slot=\"content\">\n <p>Adjust your preferences here.</p>\n </div>\n <span slot=\"cancel-label\">Discard</span>\n <span slot=\"done-label\">Save</span>\n</obc-modal-window>\n```",
|
|
54881
|
+
"description": "`<obc-modal-window>` – A modular dialog component for displaying content and capturing user actions.\n\nThe `obc-modal-window` provides a structured layout with a header (title and leading icon), a content area, and a footer with action buttons (Cancel, Done, and an optional custom action).\n\n### Features\n- **Flexible Sizing:** Supports `small`, `medium`, and `large` sizes to accommodate different content amounts.\n- **Header Customization:** Includes a title slot and an optional leading icon slot.\n- **Action Management:** Built-in \"Cancel\" and \"Done\" buttons, plus an optional additional action button.\n- **Responsive Actions:** Action buttons automatically switch between horizontal and vertical layouts based on the modal size.\n\n### Slots\n| Slot Name | Renders When... | Purpose |\n|---------------|----------------------------|----------------------------------------------------|\n| leading-icon | `hasLeadingIcon` is true | Icon displayed before the title |\n| title | Always | Main heading text for the modal |\n| content | Always | Primary content area of the modal |\n| option-label | `hasOptionalAction` is true | Label for the optional action button |\n| cancel-label | `hasCancelAction` is true | Label for the cancel button |\n| done-label | Always | Label for the primary (done) button |\n\n### Properties\n- `size` (ObcModalWindowSize): Controls the width and layout of the modal. Default is `large`.\n- `hasOptionalAction` (boolean): Shows an additional action button when true.\n- `hasLeadingIcon` (boolean): Shows the leading icon slot when true.\n- `hasCancelAction` (boolean): Shows the footer cancel button when true. Default is `true`.\n- `hasCloseAction` (boolean): Shows the header close (X) button when true. Default is `true`.\n\n### Events\n- `close-click`: Fired when the close (X) button in the header is clicked.\n- `cancel-click`: Fired when the cancel button is clicked.\n- `done-click`: Fired when the done button is clicked.\n- `option-click`: Fired when the optional action button is clicked.\n\n### Sizing\nBy default the modal is as tall as its content, capped at `90vh`. To give it\nan explicit height, set the `--obc-modal-window-height` custom property on\nthe element — either a fixed value (`--obc-modal-window-height: 360px`) or\n`100%` to fill a host element that is sized by its container. The `90vh` cap\nalways applies, and the content area scrolls when the content does not fit.\n\n### Example:\n```html\n<obc-modal-window size=\"medium\" hasLeadingIcon>\n <span slot=\"leading-icon\"><obi-info></obi-info></span>\n <span slot=\"title\">Settings</span>\n <div slot=\"content\">\n <p>Adjust your preferences here.</p>\n </div>\n <span slot=\"cancel-label\">Discard</span>\n <span slot=\"done-label\">Save</span>\n</obc-modal-window>\n```",
|
|
54882
54882
|
"name": "ObcModalWindow",
|
|
54883
|
+
"cssProperties": [
|
|
54884
|
+
{
|
|
54885
|
+
"description": "Height of the modal window. Defaults to content height (capped at 90vh); set a fixed value or `100%` to size the modal externally.",
|
|
54886
|
+
"name": "--obc-modal-window-height",
|
|
54887
|
+
"default": "auto"
|
|
54888
|
+
}
|
|
54889
|
+
],
|
|
54883
54890
|
"slots": [
|
|
54884
54891
|
{
|
|
54885
54892
|
"description": "Slot for an icon to appear before the title (shown when `hasLeadingIcon` is true)",
|
|
@@ -58608,7 +58615,7 @@
|
|
|
58608
58615
|
"declarations": [
|
|
58609
58616
|
{
|
|
58610
58617
|
"kind": "class",
|
|
58611
|
-
"description": "`<obc-progress-bar>` – A status-only progress indicator (progress meter / spinner /\nloading indicator) for visualizing how far a task has advanced.\n\nDisplays the progress of an ongoing operation either as a horizontal bar or as a circular\nring. Unlike `<obc-progress-button>`, this is a passive, non-interactive display element:\nit shows status only and emits no events. Use it to communicate determinate progress\n(a known percentage) or an open-ended \"working\" state.\n\n## Features / Variants\n\n**Layout types (`type`)**\n- **Linear** (default): A horizontal bar with an optional value label above and an optional\n description below. Best inline within content where horizontal space is available.\n- **Circular**: A ring with centered content. Best for compact, icon-led, or centered status.\n\n**Linear modes (`mode`)**\n- **Determinate** (default): Fills proportionally to `value` (0–100); the label shows the\n rounded percentage.\n- **Indeterminate**: Animated, looping fill for work of unknown duration; the label shows\n \"Loading\".\n\n**Circular states (`circularState`)**\n- **Determinate**: Ring fills to `value`, with the rounded number (and optional `%` unit) centered.\n- **Indeterminate**: Animated ring with the `icon` slot centered.\n- **Icon**: A full ring acting as a frame around the centered `icon` slot (defaults to a placeholder).\n\n**Circular progressive indeterminate (`progressiveIndeterminate`)**\n- A spinning arc that also grows with `value`, blending an indeterminate animation with a\n numeric readout. Takes precedence over `circularState` when enabled.\n\n## Usage Guidelines\n\nUse a progress bar to report the status of a task the user is waiting on. Choose\n**determinate** when the completion percentage is known and **indeterminate** when it is not.\nPick the **linear** type for inline, full-width contexts and the **circular** type for compact\nor centered placements. Because this component is display-only, pair it with a separate\ncontrol (such as `<obc-progress-button>`) when the user also needs to trigger or cancel the action.\n\n## Slots\n\n| Slot | Renders When... | Purpose |\n| ------ | ----------------------------------------------------------- | ----------------------------------------- |\n| `icon` | `type=\"circular\"` && `circularState` is `indeterminate` or `icon` | Centered icon inside the circular ring. |",
|
|
58618
|
+
"description": "`<obc-progress-bar>` – A status-only progress indicator (progress meter / spinner /\nloading indicator) for visualizing how far a task has advanced.\n\nDisplays the progress of an ongoing operation either as a horizontal bar or as a circular\nring. Unlike `<obc-progress-button>`, this is a passive, non-interactive display element:\nit shows status only and emits no events. Use it to communicate determinate progress\n(a known percentage) or an open-ended \"working\" state.\n\n## Features / Variants\n\n**Layout types (`type`)**\n- **Linear** (default): A horizontal bar with an optional value label above and an optional\n description below. Best inline within content where horizontal space is available.\n- **Circular**: A ring with centered content. Best for compact, icon-led, or centered status.\n\n**Linear modes (`mode`)**\n- **Determinate** (default): Fills proportionally to `value` (0–100); the label shows the\n rounded percentage.\n- **Indeterminate**: Animated, looping fill for work of unknown duration; the label shows\n \"Loading\".\n\n**Color priority (`priority`)**\n- **Enhanced** (default): Blue fill, for a bar that reads as the primary value.\n- **Regular**: Neutral gray fill, for a bar that should recede as ancillary status.\n\n**Circular states (`circularState`)**\n- **Determinate**: Ring fills to `value`, with the rounded number (and optional `%` unit) centered.\n- **Indeterminate**: Animated ring with the `icon` slot centered.\n- **Icon**: A full ring acting as a frame around the centered `icon` slot (defaults to a placeholder).\n\n**Circular progressive indeterminate (`progressiveIndeterminate`)**\n- A spinning arc that also grows with `value`, blending an indeterminate animation with a\n numeric readout. Takes precedence over `circularState` when enabled.\n\n## Usage Guidelines\n\nUse a progress bar to report the status of a task the user is waiting on. Choose\n**determinate** when the completion percentage is known and **indeterminate** when it is not.\nPick the **linear** type for inline, full-width contexts and the **circular** type for compact\nor centered placements. Because this component is display-only, pair it with a separate\ncontrol (such as `<obc-progress-button>`) when the user also needs to trigger or cancel the action.\n\n## Slots\n\n| Slot | Renders When... | Purpose |\n| ------ | ----------------------------------------------------------- | ----------------------------------------- |\n| `icon` | `type=\"circular\"` && `circularState` is `indeterminate` or `icon` | Centered icon inside the circular ring. |",
|
|
58612
58619
|
"name": "ObcProgressBar",
|
|
58613
58620
|
"slots": [
|
|
58614
58621
|
{
|
|
@@ -58644,6 +58651,15 @@
|
|
|
58644
58651
|
"description": "Circular display state: `determinate` (numeric ring), `indeterminate` (animated ring with\nicon), or `icon` (ring framing the icon slot).",
|
|
58645
58652
|
"attribute": "circularState"
|
|
58646
58653
|
},
|
|
58654
|
+
{
|
|
58655
|
+
"kind": "field",
|
|
58656
|
+
"name": "priority",
|
|
58657
|
+
"type": {
|
|
58658
|
+
"text": "Priority"
|
|
58659
|
+
},
|
|
58660
|
+
"description": "Color emphasis of the bar fill: `regular` (gray) or `enhanced` (blue).",
|
|
58661
|
+
"attribute": "priority"
|
|
58662
|
+
},
|
|
58647
58663
|
{
|
|
58648
58664
|
"kind": "field",
|
|
58649
58665
|
"name": "value",
|
|
@@ -58780,6 +58796,14 @@
|
|
|
58780
58796
|
"description": "Circular display state: `determinate` (numeric ring), `indeterminate` (animated ring with\nicon), or `icon` (ring framing the icon slot).",
|
|
58781
58797
|
"fieldName": "circularState"
|
|
58782
58798
|
},
|
|
58799
|
+
{
|
|
58800
|
+
"name": "priority",
|
|
58801
|
+
"type": {
|
|
58802
|
+
"text": "Priority"
|
|
58803
|
+
},
|
|
58804
|
+
"description": "Color emphasis of the bar fill: `regular` (gray) or `enhanced` (blue).",
|
|
58805
|
+
"fieldName": "priority"
|
|
58806
|
+
},
|
|
58783
58807
|
{
|
|
58784
58808
|
"name": "value",
|
|
58785
58809
|
"type": {
|
|
@@ -58862,6 +58886,14 @@
|
|
|
58862
58886
|
}
|
|
58863
58887
|
],
|
|
58864
58888
|
"exports": [
|
|
58889
|
+
{
|
|
58890
|
+
"kind": "js",
|
|
58891
|
+
"name": "Priority",
|
|
58892
|
+
"declaration": {
|
|
58893
|
+
"name": "Priority",
|
|
58894
|
+
"module": "src/components/progress-bar/progress-bar.ts"
|
|
58895
|
+
}
|
|
58896
|
+
},
|
|
58865
58897
|
{
|
|
58866
58898
|
"kind": "js",
|
|
58867
58899
|
"name": "ObcProgressBar",
|
|
@@ -230,8 +230,15 @@ export declare class ObcReadoutBlock extends LitElement {
|
|
|
230
230
|
/**
|
|
231
231
|
* The advice marker for the current category / triggered state. Resting
|
|
232
232
|
* categories carry a neutral outline glyph (tinted via `currentColor`);
|
|
233
|
-
* triggered alert categories swap to the filled IEC status icon
|
|
234
|
-
*
|
|
233
|
+
* triggered alert categories swap to the filled IEC status icon rendered
|
|
234
|
+
* with `useCssColor`, which selects the icon's token-coloured variant
|
|
235
|
+
* (alert fill + on-alert glyph, e.g. `--alert-caution-color` +
|
|
236
|
+
* `--on-caution-active-color`) — without it the same icon is a
|
|
237
|
+
* single-colour `currentColor` silhouette. This mirrors `obc-alert-icon`.
|
|
238
|
+
* The resting icons and the advice diamond deliberately stay on
|
|
239
|
+
* `currentColor`: their css-colour variants hard-code
|
|
240
|
+
* `--element-active-color`, which would defeat the neutral tint and the
|
|
241
|
+
* optimal / eco triggered tint applied from CSS.
|
|
235
242
|
*/
|
|
236
243
|
private adviceFallbackIcon;
|
|
237
244
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readout-block.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/readout-block/readout-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgD,MAAM,KAAK,CAAC;AAK9E,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,iCAAiC,CAAC;AACzC,OAAO,yCAAyC,CAAC;AACjD,OAAO,gDAAgD,CAAC;AACxD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,qDAAqD,CAAC;AAC7D,OAAO,gDAAgD,CAAC;AACxD,OAAO,2BAA2B,CAAC;AACnC,OAAO,8CAA8C,CAAC;AACtD,OAAO,6BAA6B,CAAC;AACrC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAUL,gBAAgB,EAEjB,MAAM,4DAA4D,CAAC;AACpE,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,4DAA4D,CAAC;AAE5F;;;;;;GAMG;AACH,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,oBAAY,uBAAuB;IACjC,YAAY,kBAAkB;IAC9B,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,OAAO,YAAY;I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AS,EAAE,qBAAqB,CAC7B;IAEpB,OAAO,CAAC,eAAe,CAAS;IAEzC,OAAO,KAAK,iBAAiB,GAY5B;IAED;;;;OAIG;IACH,OAAO,KAAK,iBAAiB,GAE5B;IAED;;;;;;;;OAQG;IACH,OAAO,KAAK,kBAAkB,GAK7B;IAED,OAAO,KAAK,oBAAoB,GAc/B;IAED,2EAA2E;IAC3E,OAAO,KAAK,YAAY,GASvB;IAED;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,gBAAgB,CAMtB;IAEF,OAAO,CAAC,UAAU;IAsBlB
|
|
1
|
+
{"version":3,"file":"readout-block.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/readout-block/readout-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgD,MAAM,KAAK,CAAC;AAK9E,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,iCAAiC,CAAC;AACzC,OAAO,yCAAyC,CAAC;AACjD,OAAO,gDAAgD,CAAC;AACxD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,qDAAqD,CAAC;AAC7D,OAAO,gDAAgD,CAAC;AACxD,OAAO,2BAA2B,CAAC;AACnC,OAAO,8CAA8C,CAAC;AACtD,OAAO,6BAA6B,CAAC;AACrC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAUL,gBAAgB,EAEjB,MAAM,4DAA4D,CAAC;AACpE,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,4DAA4D,CAAC;AAE5F;;;;;;GAMG;AACH,oBAAY,mBAAm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ACX,OAAO,SAAS;IAE1C,8DAA8D;IACpC,SAAS,EAAE,mBAAmB,CAC5B;IAE5B;;;;OAIG;IACuB,QAAQ,EAAE,qBAAqB,CACzB;IAEhC;;;;;;OAMG;IACwB,MAAM,UAAS;IAE1C,oDAAoD;IAC1B,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAKhE,kEAAkE;IACxC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAS;IAEpE,4EAA4E;IACjD,QAAQ,UAAS;IAE5C,0EAA0E;IAChD,SAAS,EAAE,qBAAqB,CAC7B;IAEpB,OAAO,CAAC,eAAe,CAAS;IAEzC,OAAO,KAAK,iBAAiB,GAY5B;IAED;;;;OAIG;IACH,OAAO,KAAK,iBAAiB,GAE5B;IAED;;;;;;;;OAQG;IACH,OAAO,KAAK,kBAAkB,GAK7B;IAED,OAAO,KAAK,oBAAoB,GAc/B;IAED,2EAA2E;IAC3E,OAAO,KAAK,YAAY,GASvB;IAED;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,gBAAgB,CAMtB;IAEF,OAAO,CAAC,UAAU;IAsBlB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,kBAAkB;IAgC1B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;cAiBN,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAazD,MAAM;IA8Ff,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|
|
@@ -183,20 +183,31 @@ let ObcReadoutBlock = class extends LitElement {
|
|
|
183
183
|
/**
|
|
184
184
|
* The advice marker for the current category / triggered state. Resting
|
|
185
185
|
* categories carry a neutral outline glyph (tinted via `currentColor`);
|
|
186
|
-
* triggered alert categories swap to the filled IEC status icon
|
|
187
|
-
*
|
|
186
|
+
* triggered alert categories swap to the filled IEC status icon rendered
|
|
187
|
+
* with `useCssColor`, which selects the icon's token-coloured variant
|
|
188
|
+
* (alert fill + on-alert glyph, e.g. `--alert-caution-color` +
|
|
189
|
+
* `--on-caution-active-color`) — without it the same icon is a
|
|
190
|
+
* single-colour `currentColor` silhouette. This mirrors `obc-alert-icon`.
|
|
191
|
+
* The resting icons and the advice diamond deliberately stay on
|
|
192
|
+
* `currentColor`: their css-colour variants hard-code
|
|
193
|
+
* `--element-active-color`, which would defeat the neutral tint and the
|
|
194
|
+
* optimal / eco triggered tint applied from CSS.
|
|
188
195
|
*/
|
|
189
196
|
adviceFallbackIcon() {
|
|
190
197
|
const active = this.active;
|
|
191
198
|
switch (this.category) {
|
|
192
199
|
case "caution":
|
|
193
|
-
return active ? html`<obi-caution-color-iec></obi-caution-color-iec>` : html`<obi-caution-google></obi-caution-google>`;
|
|
200
|
+
return active ? html`<obi-caution-color-iec useCssColor></obi-caution-color-iec>` : html`<obi-caution-google></obi-caution-google>`;
|
|
194
201
|
case "warning":
|
|
195
|
-
return active ? html`<obi-warning-unacknowledged-iec
|
|
202
|
+
return active ? html`<obi-warning-unacknowledged-iec
|
|
203
|
+
useCssColor
|
|
204
|
+
></obi-warning-unacknowledged-iec>` : html`<obi-warning-unacknowledged-outlined></obi-warning-unacknowledged-outlined>`;
|
|
196
205
|
case "alarm":
|
|
197
|
-
return active ? html`<obi-alarm-unacknowledged-iec
|
|
206
|
+
return active ? html`<obi-alarm-unacknowledged-iec
|
|
207
|
+
useCssColor
|
|
208
|
+
></obi-alarm-unacknowledged-iec>` : html`<obi-alarm></obi-alarm>`;
|
|
198
209
|
case "running":
|
|
199
|
-
return active ? html`<obi-running-color-iec></obi-running-color-iec>` : html`<obi-running></obi-running>`;
|
|
210
|
+
return active ? html`<obi-running-color-iec useCssColor></obi-running-color-iec>` : html`<obi-running></obi-running>`;
|
|
200
211
|
default:
|
|
201
212
|
return active ? html`<obi-notification-advice-active></obi-notification-advice-active>` : html`<obi-notification-advice></obi-notification-advice>`;
|
|
202
213
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readout-block.js","sources":["../../../src/building-blocks/readout-block/readout-block.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS, type TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './readout-block.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../components/textbox/textbox.js';\nimport {\n ObcTextboxSize,\n ObcTextboxFontWeight,\n ObcTextboxAlignment,\n} from '../../components/textbox/textbox.js';\nimport '../../icons/icon-input-right.js';\nimport '../../icons/icon-notification-advice.js';\nimport '../../icons/icon-notification-advice-active.js';\nimport '../../icons/icon-caution-google.js';\nimport '../../icons/icon-caution-color-iec.js';\nimport '../../icons/icon-warning-unacknowledged-outlined.js';\nimport '../../icons/icon-warning-unacknowledged-iec.js';\nimport '../../icons/icon-alarm.js';\nimport '../../icons/icon-alarm-unacknowledged-iec.js';\nimport '../../icons/icon-running.js';\nimport '../../icons/icon-running-color-iec.js';\nimport {\n formatNumericValue,\n readoutFormattedInteger,\n assertReadoutValueType,\n assertReadoutFractionDigits,\n isReadoutDigitCountMissing,\n resolveReadoutDigitCount,\n resolveReadoutNumericValue,\n resolveReadoutTextValue,\n READOUT_UNAVAILABLE_DASH,\n ReadoutValueType,\n type ReadoutNumericFormatOptions,\n} from '../../navigation-instruments/readout/readout-formatters.js';\nimport {\n type AlertFrameConfig,\n wrapWithAlertFrame,\n} from '../../components/alert-frame/alert-frame.js';\n\n// Re-exported so consumers can configure typography without a second import path.\nexport {\n ObcTextboxSize,\n ObcTextboxFontWeight,\n ObcTextboxAlignment,\n} from '../../components/textbox/textbox.js';\nexport {ReadoutValueType} from '../../navigation-instruments/readout/readout-formatters.js';\n\n/**\n * Semantic variant of the block. Drives the default marker icon and the\n * colour token; the layout is identical across variants.\n * - `value`: the primary reading (no default marker icon).\n * - `setpoint`: a setpoint reference (default `input-right` marker).\n * - `advice`: an advisory reference (default `notification-advice` marker).\n */\nexport enum ReadoutBlockVariant {\n value = 'value',\n setpoint = 'setpoint',\n advice = 'advice',\n}\n\n/**\n * Density tier of the block — drives icon size, the icon↔number gap, and the\n * degree-column width tier. The number typography size is controlled\n * independently via {@link ObcReadoutBlock.valueSize} so a parent can de-emphasise\n * one block relative to another within the same tier.\n */\nexport enum ReadoutBlockSize {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\n\n/**\n * Per-block measurement quality, rendered as a non-shifting outline chip.\n * - `low-integrity`: the value is suspect.\n * - `invalid`: the value is invalid.\n */\nexport enum ReadoutBlockDataQuality {\n lowIntegrity = 'low-integrity',\n invalid = 'invalid',\n}\n\n/**\n * Semantic category of an advice block (Figma 6.1 \"Readout-block-advice\"\n * Value axis). Drives the default marker icon and — while {@link\n * ObcReadoutBlock.active} — the triggered styling:\n * - `regular` / `optimal` / `eco`: the advice diamond; triggered renders the\n * filled diamond (tinted enhanced-blue / mint for optimal / eco) and a\n * SemiBold number.\n * - `caution` / `warning` / `alarm` / `running`: the matching neutral outline\n * icon; triggered swaps in the filled IEC status icon and the active text\n * colour.\n *\n * TODO(designer): the optimal / eco triggered tint covers the whole diamond\n * glyph — the Figma icon tints only the inner plus, which needs a two-tone\n * icon asset; and the advice \"Enhanced\" state (indent background chip) is not\n * implemented yet. Both flagged as \"may change\" in the 6.1 review.\n */\nexport enum ReadoutAdviceCategory {\n regular = 'regular',\n optimal = 'optimal',\n eco = 'eco',\n caution = 'caution',\n warning = 'warning',\n alarm = 'alarm',\n running = 'running',\n}\n\n/**\n * Pop-up fade phase for a setpoint block. Driven by the parent's setpoint\n * interaction state machine; only meaningful for `role=\"setpoint\"`.\n */\nexport enum ReadoutBlockHidePhase {\n none = 'none',\n hiding = 'hiding',\n hidden = 'hidden',\n}\n\n/**\n * `<obc-readout-block>` – the most atomic readout primitive: a single\n * cap-height-aligned, width-reservable numeric segment (value / setpoint /\n * advice).\n *\n * It renders one `obc-textbox` number with optional hinted leading zeros, a\n * reservable width, an optional leading marker icon (via the `icon` slot or the\n * role default), an optional trailing degree glyph, an `off`/unavailable text\n * state, per-block data-quality and an optional per-block alert frame.\n *\n * Setting `valueType` to `text` renders `value` verbatim (e.g.\n * `\"Auto\"`) instead of a formatted number.\n *\n * This is a building block used inside `obc-readout-list-item` (and, in a future\n * refactor, inside `obc-readout`); it is not normally used on its own. Colour is\n * inherited from the host context (the parent sets the role colour), so the\n * block stays neutral until placed.\n *\n * @experimental Pilot for the new primitives + per-block options Readout API; the\n * API may change in a future release.\n *\n * @slot icon - Replaces the role's default marker icon.\n *\n * @csspart block - The block container (carries role / tone / data-quality).\n * @csspart block-content - The number + degree group.\n * @csspart block-text - The `obc-textbox` rendering the number.\n * @csspart block-icon - The leading marker-icon container.\n * @csspart degree - The trailing degree-glyph column.\n */\n@customElement('obc-readout-block')\nexport class ObcReadoutBlock extends LitElement {\n /** Semantic variant (value / setpoint / advice). */\n @property({type: String}) variant: ReadoutBlockVariant =\n ReadoutBlockVariant.value;\n\n /**\n * The value; `null`/`undefined` renders a dash. A number by default, or text\n * when {@link valueType} is `text`.\n */\n @property({type: String}) value: number | string | null = null;\n\n /**\n * How {@link value} is interpreted. `number` (default) formats it via\n * `fractionDigits`; `text` renders it verbatim and ignores the numeric\n * format options. Passing text while this is `number` throws.\n */\n @property({type: String}) valueType: ReadoutValueType =\n ReadoutValueType.number;\n\n /** Density tier — icon size, gap, degree tier. */\n @property({type: String}) size: ReadoutBlockSize = ReadoutBlockSize.small;\n\n /**\n * Resolved number-typography size. When unset it is derived from `size`\n * (small→s, medium→m, large→l), so a parent that de-emphasises a block (e.g.\n * a secondary setpoint) can pass a smaller size without changing the tier.\n */\n @property({type: String}) valueSize?: ObcTextboxSize;\n\n /** Accent (in-command) colour tone. */\n @property({type: Boolean}) enhanced = false;\n\n /** Number font weight (regular / semibold / bold); colour is independent. */\n @property({type: String}) weight: ObcTextboxFontWeight =\n ObcTextboxFontWeight.regular;\n\n /** Render the trailing cap-height degree glyph (`°`). */\n @property({type: Boolean}) hasDegree = false;\n\n /** Show the leading marker-icon container (always on for setpoint/advice). */\n @property({type: Boolean}) hasIcon = false;\n\n /**\n * Number of fraction digits. Must be between 0 and 100 — the range\n * `Number.prototype.toFixed` accepts; outside it throws a `RangeError`.\n * A fractional count truncates (`2.7` → `2`). A count that never arrived\n * (`NaN`, `null` or unset) renders the reading as the unavailable dash —\n * formatting with a precision the author never chose would let a critical\n * `0.4` pass for a healthy `0`.\n * @availableWhen valueType==number\n */\n @property({type: Number}) fractionDigits = 0;\n\n /**\n * Integer digits to reserve / hint (independent of `fractionDigits`).\n * Bounded before use: a fractional count\n * truncates (`2.7` → `2`), anything above 100 — including `Infinity` —\n * caps at 100, and a negative count reserves nothing. A count that never\n * arrived (`NaN`, `null` or unset) renders the reading as the unavailable\n * dash, consistent with `fractionDigits`.\n * @availableWhen valueType==number\n */\n @property({type: Number}) maxDigits = 0;\n\n /**\n * Render muted leading zeros filling the integer part to `maxDigits`.\n * @availableWhen valueType==number\n */\n @property({type: Boolean}) hintedZeros = false;\n\n /** Explicit longest string to reserve width for (e.g. `\"0000.0\"`). */\n @property({type: String}) spaceReserver?: string;\n\n /** Render `offText` instead of a number (e.g. equipment powered down). */\n @property({type: Boolean}) off = false;\n\n /** Text shown when `off` is true. */\n @property({type: String}) offText = 'OFF';\n\n /** Text alignment of the number within its reserved width. */\n @property({type: String}) alignment: ObcTextboxAlignment =\n ObcTextboxAlignment.Right;\n\n /**\n * Semantic category of an advice block — picks the default marker icon and\n * the {@link active} styling. Only meaningful for `variant=\"advice\"`.\n * @availableWhen variant==advice\n */\n @property({type: String}) category: ReadoutAdviceCategory =\n ReadoutAdviceCategory.regular;\n\n /**\n * The advice is triggered: the marker swaps to its filled/status icon and\n * the number takes the category's triggered styling (SemiBold for\n * regular/optimal/eco, active text colour for the alert categories). Only\n * meaningful for `variant=\"advice\"`.\n * @availableWhen variant==advice\n */\n @property({type: Boolean}) active = false;\n\n /** Per-block measurement quality (outline chip). */\n @property({type: String}) dataQuality?: ReadoutBlockDataQuality;\n\n // `boolean | …` (not `false | …`): the generated Angular wrapper widens a\n // literal-`false` union to `boolean`. `wrapWithAlertFrame` treats any\n // non-object as \"no frame\", so accepting `boolean` is harmless.\n /** Per-block alert frame; nests inside any parent alert frame. */\n @property({type: Object}) alert: boolean | AlertFrameConfig = false;\n\n /** Setpoint focus (touch) state — only meaningful for `role=\"setpoint\"`. */\n @property({type: Boolean}) touching = false;\n\n /** Setpoint pop-up fade phase — only meaningful for `role=\"setpoint\"`. */\n @property({type: String}) hidePhase: ReadoutBlockHidePhase =\n ReadoutBlockHidePhase.none;\n\n @state() private hasAssignedIcon = false;\n\n private get resolvedValueSize(): ObcTextboxSize {\n if (this.valueSize) {\n return this.valueSize;\n }\n switch (this.size) {\n case ReadoutBlockSize.large:\n return ObcTextboxSize.l;\n case ReadoutBlockSize.medium:\n return ObcTextboxSize.m;\n default:\n return ObcTextboxSize.s;\n }\n }\n\n /**\n * `maxDigits` bounded to a usable count. Every width calculation below goes\n * through this rather than the raw property, so an `Infinity` (or absurdly\n * large) value cannot reach `String.prototype.repeat`.\n */\n private get resolvedMaxDigits(): number {\n return resolveReadoutDigitCount(this.maxDigits);\n }\n\n /**\n * Whether a digit knob failed to arrive (`NaN` / `null` / `undefined`).\n * The reading then renders as the unavailable dash rather than silently\n * formatting with a default the author never chose — a critical `0.4`\n * formatted with a failed `fractionDigits` would otherwise print as a\n * plausible-looking `0`. A missing `maxDigits` dashes too, for consistency:\n * either knob arriving broken means the row's configuration cannot be\n * trusted.\n */\n private get digitCountsMissing(): boolean {\n return (\n isReadoutDigitCountMissing(this.fractionDigits) ||\n isReadoutDigitCountMissing(this.maxDigits)\n );\n }\n\n private get numericFormatOptions(): ReadoutNumericFormatOptions {\n return {\n // The unavailable placeholder stays short (`\\u2012.\\u2012\\u2012`) rather than\n // spelling out every reserved digit position — `maxDigits` already\n // reserves the width, so it simply sits at the right edge of it.\n showZeroPadding: false,\n minValueLength: this.resolvedMaxDigits,\n // A missing precision shapes the placeholder as zero fraction digits (a\n // single dash) — and keeps a runtime `undefined`/`null` out of the\n // options object, which is typed `number` throughout the formatters.\n fractionDigits: isReadoutDigitCountMissing(this.fractionDigits)\n ? 0\n : this.fractionDigits,\n };\n }\n\n /** Widest possible value string for width reservation (e.g. `\"000.0\"`). */\n private get reserverText(): string {\n const maxDigits = this.resolvedMaxDigits;\n if (maxDigits <= 0) {\n return '';\n }\n const integer = '0'.repeat(maxDigits);\n return this.fractionDigits > 0\n ? `${integer}.${'0'.repeat(this.fractionDigits)}`\n : integer;\n }\n\n /**\n * Effective width reserver: the wider of the explicit `spaceReserver` and the\n * `maxDigits`/`fractionDigits`-derived reserve, so an explicit reserver can\n * never reserve *less* than the formatted value needs. Under tabular-nums the\n * rendered width is proportional to character count, so \"wider\" compares length.\n */\n private widerReserver(explicit: string | undefined, derived: string): string {\n if (!explicit) {\n return derived;\n }\n if (!derived) {\n return explicit;\n }\n return explicit.length >= derived.length ? explicit : derived;\n }\n\n private dataQualityClasses(): Record<string, boolean> {\n return {\n 'data-low-integrity':\n this.dataQuality === ReadoutBlockDataQuality.lowIntegrity,\n 'data-invalid': this.dataQuality === ReadoutBlockDataQuality.invalid,\n };\n }\n\n private onIconSlotChange = (event: Event): void => {\n // `slotchange` fires after the first render once content is (re)assigned,\n // so it covers the initial state without a firstUpdated re-render.\n this.hasAssignedIcon =\n (event.target as HTMLSlotElement).assignedElements({flatten: true})\n .length > 0;\n };\n\n private renderIcon(): TemplateResult | typeof nothing {\n // Value blocks only show an icon when asked; setpoint/advice always reserve\n // their marker. The role default is rendered as a direct child (so it sizes\n // via `.block-icon obi-*`) and hidden once an icon is assigned to the slot —\n // `{flatten: true}` sees through a forwarded-but-empty parent slot, so the\n // default still shows when the consumer overrides nothing.\n const showIcon = this.variant !== ReadoutBlockVariant.value || this.hasIcon;\n if (!showIcon) {\n return nothing;\n }\n let fallback: TemplateResult | typeof nothing = nothing;\n if (this.variant === ReadoutBlockVariant.setpoint) {\n fallback = html`<obi-input-right></obi-input-right>`;\n } else if (this.variant === ReadoutBlockVariant.advice) {\n fallback = this.adviceFallbackIcon();\n }\n return html`<span class=\"block-icon\" part=\"block-icon\" aria-hidden=\"true\">\n <slot name=\"icon\" @slotchange=${this.onIconSlotChange}></slot>\n ${this.hasAssignedIcon ? nothing : fallback}\n </span>`;\n }\n\n /**\n * The advice marker for the current category / triggered state. Resting\n * categories carry a neutral outline glyph (tinted via `currentColor`);\n * triggered alert categories swap to the filled IEC status icon, whose\n * colours are fixed fills and ignore `currentColor` by design.\n */\n private adviceFallbackIcon(): TemplateResult {\n const active = this.active;\n switch (this.category) {\n case ReadoutAdviceCategory.caution:\n return active\n ? html`<obi-caution-color-iec></obi-caution-color-iec>`\n : html`<obi-caution-google></obi-caution-google>`;\n case ReadoutAdviceCategory.warning:\n return active\n ? html`<obi-warning-unacknowledged-iec></obi-warning-unacknowledged-iec>`\n : html`<obi-warning-unacknowledged-outlined></obi-warning-unacknowledged-outlined>`;\n case ReadoutAdviceCategory.alarm:\n return active\n ? html`<obi-alarm-unacknowledged-iec></obi-alarm-unacknowledged-iec>`\n : html`<obi-alarm></obi-alarm>`;\n case ReadoutAdviceCategory.running:\n return active\n ? html`<obi-running-color-iec></obi-running-color-iec>`\n : html`<obi-running></obi-running>`;\n default:\n // regular / optimal / eco share the advice diamond; the triggered tint\n // is applied via CSS on `.block-icon` (see `advice-*` classes).\n return active\n ? html`<obi-notification-advice-active></obi-notification-advice-active>`\n : html`<obi-notification-advice></obi-notification-advice>`;\n }\n }\n\n /**\n * A cap-height `°` column whose width scales with the number size. Inherits the\n * block's colour.\n */\n private renderDegreeGlyph(size: ObcTextboxSize): TemplateResult {\n return html`\n <span\n class=${classMap({\n 'degree-column': true,\n [`degree-${size}`]: true,\n 'degree-inherit': true,\n })}\n part=\"degree\"\n >\n <obc-textbox class=\"degree-glyph\" .size=${size} alignment=\"center\"\n >°</obc-textbox\n >\n </span>\n `;\n }\n\n protected override willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate(changed);\n // Validated on EVERY update, deliberately NOT gated on `value`/`valueType`\n // appearing in `changed`. When this assertion throws, Lit's `performUpdate`\n // catch calls `__markUpdated()`, which clears the changed-properties map. A\n // later update driven by any OTHER property — inside `obc-readout-list`,\n // `align()` writing the shared reservers — would then see no `value` in\n // `changed`, skip the check, and render the invalid value as a plain dash:\n // exactly the silent failure this assertion exists to prevent.\n assertReadoutValueType('obc-readout-block', this.value, this.valueType);\n assertReadoutFractionDigits('obc-readout-block', this.fractionDigits);\n }\n\n override render() {\n const valueSize = this.resolvedValueSize;\n const isAdvice = this.variant === ReadoutBlockVariant.advice;\n // Triggered regular/optimal/eco advice renders SemiBold (Figma 6.1); the\n // alert categories keep the caller's weight and change colour instead.\n const adviceSemibold =\n isAdvice &&\n this.active &&\n (this.category === ReadoutAdviceCategory.regular ||\n this.category === ReadoutAdviceCategory.optimal ||\n this.category === ReadoutAdviceCategory.eco);\n const weight = adviceSemibold ? ObcTextboxFontWeight.semibold : this.weight;\n const formatOptions = this.numericFormatOptions;\n const isTextMode = this.valueType === ReadoutValueType.text;\n // A missing digit knob makes the reading untrustworthy, so it resolves to\n // \"no reading\" and renders the dash (see `digitCountsMissing`). Text mode\n // is unaffected — it ignores the numeric knobs entirely.\n const valueForFormat = this.digitCountsMissing\n ? undefined\n : resolveReadoutNumericValue(this.value, this.valueType);\n const textValue = resolveReadoutTextValue(this.value, this.valueType);\n // Text mode renders verbatim and ignores the numeric format options; a\n // blank / missing text value still falls back to the unavailable dash.\n const text = this.off\n ? this.offText\n : isTextMode\n ? (textValue ?? READOUT_UNAVAILABLE_DASH)\n : formatNumericValue(valueForFormat, formatOptions);\n // Hinted zeros pad the INTEGER part up to `maxDigits`, independent of\n // `fractionDigits` (the decimal point and fraction digits never count toward\n // `maxDigits`). Negative / dashed values are not padded. Example: value 1.2,\n // maxDigits 3, fractionDigits 1 → \"001.2\".\n const hintCount =\n this.off ||\n isTextMode ||\n !this.hintedZeros ||\n valueForFormat === undefined ||\n valueForFormat < 0\n ? 0\n : Math.max(this.resolvedMaxDigits - readoutFormattedInteger(text), 0);\n const hinted = hintCount > 0 ? '0'.repeat(hintCount) : '';\n // Hinted zeros own the width — they already fill to `maxDigits` — so when\n // `hintedZeros` is enabled an explicit `spaceReserver` is ignored (it has\n // higher priority). Otherwise the wider of the explicit reserver and the\n // `maxDigits`-derived reserve wins.\n // Text mode ignores the `maxDigits`-derived numeric reserve — only an\n // explicit `spaceReserver` still applies.\n const reserver = isTextMode\n ? (this.spaceReserver ?? '')\n : this.hintedZeros\n ? this.reserverText\n : this.widerReserver(this.spaceReserver, this.reserverText);\n\n const block = html`\n <div\n class=${classMap({\n block: true,\n [`block-${this.variant}`]: true,\n [`size-${this.size}`]: true,\n [`value-size-${valueSize}`]: true,\n [`advice-${this.category}`]: isAdvice,\n 'advice-active': isAdvice && this.active,\n 'tone-enhanced': this.enhanced,\n touching: this.touching,\n 'is-hiding': this.hidePhase === ReadoutBlockHidePhase.hiding,\n 'is-hidden': this.hidePhase === ReadoutBlockHidePhase.hidden,\n ...this.dataQualityClasses(),\n })}\n part=\"block block-${this.variant}\"\n >\n ${this.renderIcon()}\n <span class=\"block-content\" part=\"block-content\">\n <obc-textbox\n class=\"block-text\"\n part=\"block-text\"\n .size=${valueSize}\n .fontWeight=${weight}\n .alignment=${this.alignment}\n .tabularNums=${true}\n >\n ${hinted\n ? html`<span class=\"hinted-zero\" aria-hidden=\"true\"\n >${hinted}</span\n >`\n : nothing}${text}\n ${reserver ? html`<span slot=\"length\">${reserver}</span>` : nothing}\n </obc-textbox>\n ${this.hasDegree ? this.renderDegreeGlyph(valueSize) : nothing}\n </span>\n </div>\n `;\n return wrapWithAlertFrame(this.alert ?? false, block);\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-readout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AA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GArGb,gBAqGe,WAAA,eAAA,CAAA;AAMA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA3Gb,gBA2Ge,WAAA,SAAA,CAAA;AAGC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA9Gd,gBA8GgB,WAAA,YAAA,CAAA;AAGD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAjHb,gBAiHe,WAAA,aAAA,CAAA;AAGT,gBAAA;AAAA,EAAhB,MAAA;AAAM,GApHI,gBAoHM,WAAA,mBAAA,CAAA;AApHN,kBAAN,gBAAA;AAAA,EADN,cAAc,mBAAmB;AAAA,GACrB,eAAA;"}
|
|
1
|
+
{"version":3,"file":"readout-block.js","sources":["../../../src/building-blocks/readout-block/readout-block.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS, type TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './readout-block.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../components/textbox/textbox.js';\nimport {\n ObcTextboxSize,\n ObcTextboxFontWeight,\n ObcTextboxAlignment,\n} from '../../components/textbox/textbox.js';\nimport '../../icons/icon-input-right.js';\nimport '../../icons/icon-notification-advice.js';\nimport '../../icons/icon-notification-advice-active.js';\nimport '../../icons/icon-caution-google.js';\nimport '../../icons/icon-caution-color-iec.js';\nimport '../../icons/icon-warning-unacknowledged-outlined.js';\nimport '../../icons/icon-warning-unacknowledged-iec.js';\nimport '../../icons/icon-alarm.js';\nimport '../../icons/icon-alarm-unacknowledged-iec.js';\nimport '../../icons/icon-running.js';\nimport '../../icons/icon-running-color-iec.js';\nimport {\n formatNumericValue,\n readoutFormattedInteger,\n assertReadoutValueType,\n assertReadoutFractionDigits,\n isReadoutDigitCountMissing,\n resolveReadoutDigitCount,\n resolveReadoutNumericValue,\n resolveReadoutTextValue,\n READOUT_UNAVAILABLE_DASH,\n ReadoutValueType,\n type ReadoutNumericFormatOptions,\n} from '../../navigation-instruments/readout/readout-formatters.js';\nimport {\n type AlertFrameConfig,\n wrapWithAlertFrame,\n} from '../../components/alert-frame/alert-frame.js';\n\n// Re-exported so consumers can configure typography without a second import path.\nexport {\n ObcTextboxSize,\n ObcTextboxFontWeight,\n ObcTextboxAlignment,\n} from '../../components/textbox/textbox.js';\nexport {ReadoutValueType} from '../../navigation-instruments/readout/readout-formatters.js';\n\n/**\n * Semantic variant of the block. Drives the default marker icon and the\n * colour token; the layout is identical across variants.\n * - `value`: the primary reading (no default marker icon).\n * - `setpoint`: a setpoint reference (default `input-right` marker).\n * - `advice`: an advisory reference (default `notification-advice` marker).\n */\nexport enum ReadoutBlockVariant {\n value = 'value',\n setpoint = 'setpoint',\n advice = 'advice',\n}\n\n/**\n * Density tier of the block — drives icon size, the icon↔number gap, and the\n * degree-column width tier. The number typography size is controlled\n * independently via {@link ObcReadoutBlock.valueSize} so a parent can de-emphasise\n * one block relative to another within the same tier.\n */\nexport enum ReadoutBlockSize {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\n\n/**\n * Per-block measurement quality, rendered as a non-shifting outline chip.\n * - `low-integrity`: the value is suspect.\n * - `invalid`: the value is invalid.\n */\nexport enum ReadoutBlockDataQuality {\n lowIntegrity = 'low-integrity',\n invalid = 'invalid',\n}\n\n/**\n * Semantic category of an advice block (Figma 6.1 \"Readout-block-advice\"\n * Value axis). Drives the default marker icon and — while {@link\n * ObcReadoutBlock.active} — the triggered styling:\n * - `regular` / `optimal` / `eco`: the advice diamond; triggered renders the\n * filled diamond (tinted enhanced-blue / mint for optimal / eco) and a\n * SemiBold number.\n * - `caution` / `warning` / `alarm` / `running`: the matching neutral outline\n * icon; triggered swaps in the filled IEC status icon and the active text\n * colour.\n *\n * TODO(designer): the optimal / eco triggered tint covers the whole diamond\n * glyph — the Figma icon tints only the inner plus, which needs a two-tone\n * icon asset; and the advice \"Enhanced\" state (indent background chip) is not\n * implemented yet. Both flagged as \"may change\" in the 6.1 review.\n */\nexport enum ReadoutAdviceCategory {\n regular = 'regular',\n optimal = 'optimal',\n eco = 'eco',\n caution = 'caution',\n warning = 'warning',\n alarm = 'alarm',\n running = 'running',\n}\n\n/**\n * Pop-up fade phase for a setpoint block. Driven by the parent's setpoint\n * interaction state machine; only meaningful for `role=\"setpoint\"`.\n */\nexport enum ReadoutBlockHidePhase {\n none = 'none',\n hiding = 'hiding',\n hidden = 'hidden',\n}\n\n/**\n * `<obc-readout-block>` – the most atomic readout primitive: a single\n * cap-height-aligned, width-reservable numeric segment (value / setpoint /\n * advice).\n *\n * It renders one `obc-textbox` number with optional hinted leading zeros, a\n * reservable width, an optional leading marker icon (via the `icon` slot or the\n * role default), an optional trailing degree glyph, an `off`/unavailable text\n * state, per-block data-quality and an optional per-block alert frame.\n *\n * Setting `valueType` to `text` renders `value` verbatim (e.g.\n * `\"Auto\"`) instead of a formatted number.\n *\n * This is a building block used inside `obc-readout-list-item` (and, in a future\n * refactor, inside `obc-readout`); it is not normally used on its own. Colour is\n * inherited from the host context (the parent sets the role colour), so the\n * block stays neutral until placed.\n *\n * @experimental Pilot for the new primitives + per-block options Readout API; the\n * API may change in a future release.\n *\n * @slot icon - Replaces the role's default marker icon.\n *\n * @csspart block - The block container (carries role / tone / data-quality).\n * @csspart block-content - The number + degree group.\n * @csspart block-text - The `obc-textbox` rendering the number.\n * @csspart block-icon - The leading marker-icon container.\n * @csspart degree - The trailing degree-glyph column.\n */\n@customElement('obc-readout-block')\nexport class ObcReadoutBlock extends LitElement {\n /** Semantic variant (value / setpoint / advice). */\n @property({type: String}) variant: ReadoutBlockVariant =\n ReadoutBlockVariant.value;\n\n /**\n * The value; `null`/`undefined` renders a dash. A number by default, or text\n * when {@link valueType} is `text`.\n */\n @property({type: String}) value: number | string | null = null;\n\n /**\n * How {@link value} is interpreted. `number` (default) formats it via\n * `fractionDigits`; `text` renders it verbatim and ignores the numeric\n * format options. Passing text while this is `number` throws.\n */\n @property({type: String}) valueType: ReadoutValueType =\n ReadoutValueType.number;\n\n /** Density tier — icon size, gap, degree tier. */\n @property({type: String}) size: ReadoutBlockSize = ReadoutBlockSize.small;\n\n /**\n * Resolved number-typography size. When unset it is derived from `size`\n * (small→s, medium→m, large→l), so a parent that de-emphasises a block (e.g.\n * a secondary setpoint) can pass a smaller size without changing the tier.\n */\n @property({type: String}) valueSize?: ObcTextboxSize;\n\n /** Accent (in-command) colour tone. */\n @property({type: Boolean}) enhanced = false;\n\n /** Number font weight (regular / semibold / bold); colour is independent. */\n @property({type: String}) weight: ObcTextboxFontWeight =\n ObcTextboxFontWeight.regular;\n\n /** Render the trailing cap-height degree glyph (`°`). */\n @property({type: Boolean}) hasDegree = false;\n\n /** Show the leading marker-icon container (always on for setpoint/advice). */\n @property({type: Boolean}) hasIcon = false;\n\n /**\n * Number of fraction digits. Must be between 0 and 100 — the range\n * `Number.prototype.toFixed` accepts; outside it throws a `RangeError`.\n * A fractional count truncates (`2.7` → `2`). A count that never arrived\n * (`NaN`, `null` or unset) renders the reading as the unavailable dash —\n * formatting with a precision the author never chose would let a critical\n * `0.4` pass for a healthy `0`.\n * @availableWhen valueType==number\n */\n @property({type: Number}) fractionDigits = 0;\n\n /**\n * Integer digits to reserve / hint (independent of `fractionDigits`).\n * Bounded before use: a fractional count\n * truncates (`2.7` → `2`), anything above 100 — including `Infinity` —\n * caps at 100, and a negative count reserves nothing. A count that never\n * arrived (`NaN`, `null` or unset) renders the reading as the unavailable\n * dash, consistent with `fractionDigits`.\n * @availableWhen valueType==number\n */\n @property({type: Number}) maxDigits = 0;\n\n /**\n * Render muted leading zeros filling the integer part to `maxDigits`.\n * @availableWhen valueType==number\n */\n @property({type: Boolean}) hintedZeros = false;\n\n /** Explicit longest string to reserve width for (e.g. `\"0000.0\"`). */\n @property({type: String}) spaceReserver?: string;\n\n /** Render `offText` instead of a number (e.g. equipment powered down). */\n @property({type: Boolean}) off = false;\n\n /** Text shown when `off` is true. */\n @property({type: String}) offText = 'OFF';\n\n /** Text alignment of the number within its reserved width. */\n @property({type: String}) alignment: ObcTextboxAlignment =\n ObcTextboxAlignment.Right;\n\n /**\n * Semantic category of an advice block — picks the default marker icon and\n * the {@link active} styling. Only meaningful for `variant=\"advice\"`.\n * @availableWhen variant==advice\n */\n @property({type: String}) category: ReadoutAdviceCategory =\n ReadoutAdviceCategory.regular;\n\n /**\n * The advice is triggered: the marker swaps to its filled/status icon and\n * the number takes the category's triggered styling (SemiBold for\n * regular/optimal/eco, active text colour for the alert categories). Only\n * meaningful for `variant=\"advice\"`.\n * @availableWhen variant==advice\n */\n @property({type: Boolean}) active = false;\n\n /** Per-block measurement quality (outline chip). */\n @property({type: String}) dataQuality?: ReadoutBlockDataQuality;\n\n // `boolean | …` (not `false | …`): the generated Angular wrapper widens a\n // literal-`false` union to `boolean`. `wrapWithAlertFrame` treats any\n // non-object as \"no frame\", so accepting `boolean` is harmless.\n /** Per-block alert frame; nests inside any parent alert frame. */\n @property({type: Object}) alert: boolean | AlertFrameConfig = false;\n\n /** Setpoint focus (touch) state — only meaningful for `role=\"setpoint\"`. */\n @property({type: Boolean}) touching = false;\n\n /** Setpoint pop-up fade phase — only meaningful for `role=\"setpoint\"`. */\n @property({type: String}) hidePhase: ReadoutBlockHidePhase =\n ReadoutBlockHidePhase.none;\n\n @state() private hasAssignedIcon = false;\n\n private get resolvedValueSize(): ObcTextboxSize {\n if (this.valueSize) {\n return this.valueSize;\n }\n switch (this.size) {\n case ReadoutBlockSize.large:\n return ObcTextboxSize.l;\n case ReadoutBlockSize.medium:\n return ObcTextboxSize.m;\n default:\n return ObcTextboxSize.s;\n }\n }\n\n /**\n * `maxDigits` bounded to a usable count. Every width calculation below goes\n * through this rather than the raw property, so an `Infinity` (or absurdly\n * large) value cannot reach `String.prototype.repeat`.\n */\n private get resolvedMaxDigits(): number {\n return resolveReadoutDigitCount(this.maxDigits);\n }\n\n /**\n * Whether a digit knob failed to arrive (`NaN` / `null` / `undefined`).\n * The reading then renders as the unavailable dash rather than silently\n * formatting with a default the author never chose — a critical `0.4`\n * formatted with a failed `fractionDigits` would otherwise print as a\n * plausible-looking `0`. A missing `maxDigits` dashes too, for consistency:\n * either knob arriving broken means the row's configuration cannot be\n * trusted.\n */\n private get digitCountsMissing(): boolean {\n return (\n isReadoutDigitCountMissing(this.fractionDigits) ||\n isReadoutDigitCountMissing(this.maxDigits)\n );\n }\n\n private get numericFormatOptions(): ReadoutNumericFormatOptions {\n return {\n // The unavailable placeholder stays short (`\\u2012.\\u2012\\u2012`) rather than\n // spelling out every reserved digit position — `maxDigits` already\n // reserves the width, so it simply sits at the right edge of it.\n showZeroPadding: false,\n minValueLength: this.resolvedMaxDigits,\n // A missing precision shapes the placeholder as zero fraction digits (a\n // single dash) — and keeps a runtime `undefined`/`null` out of the\n // options object, which is typed `number` throughout the formatters.\n fractionDigits: isReadoutDigitCountMissing(this.fractionDigits)\n ? 0\n : this.fractionDigits,\n };\n }\n\n /** Widest possible value string for width reservation (e.g. `\"000.0\"`). */\n private get reserverText(): string {\n const maxDigits = this.resolvedMaxDigits;\n if (maxDigits <= 0) {\n return '';\n }\n const integer = '0'.repeat(maxDigits);\n return this.fractionDigits > 0\n ? `${integer}.${'0'.repeat(this.fractionDigits)}`\n : integer;\n }\n\n /**\n * Effective width reserver: the wider of the explicit `spaceReserver` and the\n * `maxDigits`/`fractionDigits`-derived reserve, so an explicit reserver can\n * never reserve *less* than the formatted value needs. Under tabular-nums the\n * rendered width is proportional to character count, so \"wider\" compares length.\n */\n private widerReserver(explicit: string | undefined, derived: string): string {\n if (!explicit) {\n return derived;\n }\n if (!derived) {\n return explicit;\n }\n return explicit.length >= derived.length ? explicit : derived;\n }\n\n private dataQualityClasses(): Record<string, boolean> {\n return {\n 'data-low-integrity':\n this.dataQuality === ReadoutBlockDataQuality.lowIntegrity,\n 'data-invalid': this.dataQuality === ReadoutBlockDataQuality.invalid,\n };\n }\n\n private onIconSlotChange = (event: Event): void => {\n // `slotchange` fires after the first render once content is (re)assigned,\n // so it covers the initial state without a firstUpdated re-render.\n this.hasAssignedIcon =\n (event.target as HTMLSlotElement).assignedElements({flatten: true})\n .length > 0;\n };\n\n private renderIcon(): TemplateResult | typeof nothing {\n // Value blocks only show an icon when asked; setpoint/advice always reserve\n // their marker. The role default is rendered as a direct child (so it sizes\n // via `.block-icon obi-*`) and hidden once an icon is assigned to the slot —\n // `{flatten: true}` sees through a forwarded-but-empty parent slot, so the\n // default still shows when the consumer overrides nothing.\n const showIcon = this.variant !== ReadoutBlockVariant.value || this.hasIcon;\n if (!showIcon) {\n return nothing;\n }\n let fallback: TemplateResult | typeof nothing = nothing;\n if (this.variant === ReadoutBlockVariant.setpoint) {\n fallback = html`<obi-input-right></obi-input-right>`;\n } else if (this.variant === ReadoutBlockVariant.advice) {\n fallback = this.adviceFallbackIcon();\n }\n return html`<span class=\"block-icon\" part=\"block-icon\" aria-hidden=\"true\">\n <slot name=\"icon\" @slotchange=${this.onIconSlotChange}></slot>\n ${this.hasAssignedIcon ? nothing : fallback}\n </span>`;\n }\n\n /**\n * The advice marker for the current category / triggered state. Resting\n * categories carry a neutral outline glyph (tinted via `currentColor`);\n * triggered alert categories swap to the filled IEC status icon rendered\n * with `useCssColor`, which selects the icon's token-coloured variant\n * (alert fill + on-alert glyph, e.g. `--alert-caution-color` +\n * `--on-caution-active-color`) — without it the same icon is a\n * single-colour `currentColor` silhouette. This mirrors `obc-alert-icon`.\n * The resting icons and the advice diamond deliberately stay on\n * `currentColor`: their css-colour variants hard-code\n * `--element-active-color`, which would defeat the neutral tint and the\n * optimal / eco triggered tint applied from CSS.\n */\n private adviceFallbackIcon(): TemplateResult {\n const active = this.active;\n switch (this.category) {\n case ReadoutAdviceCategory.caution:\n return active\n ? html`<obi-caution-color-iec useCssColor></obi-caution-color-iec>`\n : html`<obi-caution-google></obi-caution-google>`;\n case ReadoutAdviceCategory.warning:\n return active\n ? html`<obi-warning-unacknowledged-iec\n useCssColor\n ></obi-warning-unacknowledged-iec>`\n : html`<obi-warning-unacknowledged-outlined></obi-warning-unacknowledged-outlined>`;\n case ReadoutAdviceCategory.alarm:\n return active\n ? html`<obi-alarm-unacknowledged-iec\n useCssColor\n ></obi-alarm-unacknowledged-iec>`\n : html`<obi-alarm></obi-alarm>`;\n case ReadoutAdviceCategory.running:\n return active\n ? html`<obi-running-color-iec useCssColor></obi-running-color-iec>`\n : html`<obi-running></obi-running>`;\n default:\n // regular / optimal / eco share the advice diamond; the triggered tint\n // is applied via CSS on `.block-icon` (see `advice-*` classes).\n return active\n ? html`<obi-notification-advice-active></obi-notification-advice-active>`\n : html`<obi-notification-advice></obi-notification-advice>`;\n }\n }\n\n /**\n * A cap-height `°` column whose width scales with the number size. Inherits the\n * block's colour.\n */\n private renderDegreeGlyph(size: ObcTextboxSize): TemplateResult {\n return html`\n <span\n class=${classMap({\n 'degree-column': true,\n [`degree-${size}`]: true,\n 'degree-inherit': true,\n })}\n part=\"degree\"\n >\n <obc-textbox class=\"degree-glyph\" .size=${size} alignment=\"center\"\n >°</obc-textbox\n >\n </span>\n `;\n }\n\n protected override willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate(changed);\n // Validated on EVERY update, deliberately NOT gated on `value`/`valueType`\n // appearing in `changed`. When this assertion throws, Lit's `performUpdate`\n // catch calls `__markUpdated()`, which clears the changed-properties map. A\n // later update driven by any OTHER property — inside `obc-readout-list`,\n // `align()` writing the shared reservers — would then see no `value` in\n // `changed`, skip the check, and render the invalid value as a plain dash:\n // exactly the silent failure this assertion exists to prevent.\n assertReadoutValueType('obc-readout-block', this.value, this.valueType);\n assertReadoutFractionDigits('obc-readout-block', this.fractionDigits);\n }\n\n override render() {\n const valueSize = this.resolvedValueSize;\n const isAdvice = this.variant === ReadoutBlockVariant.advice;\n // Triggered regular/optimal/eco advice renders SemiBold (Figma 6.1); the\n // alert categories keep the caller's weight and change colour instead.\n const adviceSemibold =\n isAdvice &&\n this.active &&\n (this.category === ReadoutAdviceCategory.regular ||\n this.category === ReadoutAdviceCategory.optimal ||\n this.category === ReadoutAdviceCategory.eco);\n const weight = adviceSemibold ? ObcTextboxFontWeight.semibold : this.weight;\n const formatOptions = this.numericFormatOptions;\n const isTextMode = this.valueType === ReadoutValueType.text;\n // A missing digit knob makes the reading untrustworthy, so it resolves to\n // \"no reading\" and renders the dash (see `digitCountsMissing`). Text mode\n // is unaffected — it ignores the numeric knobs entirely.\n const valueForFormat = this.digitCountsMissing\n ? undefined\n : resolveReadoutNumericValue(this.value, this.valueType);\n const textValue = resolveReadoutTextValue(this.value, this.valueType);\n // Text mode renders verbatim and ignores the numeric format options; a\n // blank / missing text value still falls back to the unavailable dash.\n const text = this.off\n ? this.offText\n : isTextMode\n ? (textValue ?? READOUT_UNAVAILABLE_DASH)\n : formatNumericValue(valueForFormat, formatOptions);\n // Hinted zeros pad the INTEGER part up to `maxDigits`, independent of\n // `fractionDigits` (the decimal point and fraction digits never count toward\n // `maxDigits`). Negative / dashed values are not padded. Example: value 1.2,\n // maxDigits 3, fractionDigits 1 → \"001.2\".\n const hintCount =\n this.off ||\n isTextMode ||\n !this.hintedZeros ||\n valueForFormat === undefined ||\n valueForFormat < 0\n ? 0\n : Math.max(this.resolvedMaxDigits - readoutFormattedInteger(text), 0);\n const hinted = hintCount > 0 ? '0'.repeat(hintCount) : '';\n // Hinted zeros own the width — they already fill to `maxDigits` — so when\n // `hintedZeros` is enabled an explicit `spaceReserver` is ignored (it has\n // higher priority). Otherwise the wider of the explicit reserver and the\n // `maxDigits`-derived reserve wins.\n // Text mode ignores the `maxDigits`-derived numeric reserve — only an\n // explicit `spaceReserver` still applies.\n const reserver = isTextMode\n ? (this.spaceReserver ?? '')\n : this.hintedZeros\n ? this.reserverText\n : this.widerReserver(this.spaceReserver, this.reserverText);\n\n const block = html`\n <div\n class=${classMap({\n block: true,\n [`block-${this.variant}`]: true,\n [`size-${this.size}`]: true,\n [`value-size-${valueSize}`]: true,\n [`advice-${this.category}`]: isAdvice,\n 'advice-active': isAdvice && this.active,\n 'tone-enhanced': this.enhanced,\n touching: this.touching,\n 'is-hiding': this.hidePhase === ReadoutBlockHidePhase.hiding,\n 'is-hidden': this.hidePhase === ReadoutBlockHidePhase.hidden,\n ...this.dataQualityClasses(),\n })}\n part=\"block block-${this.variant}\"\n >\n ${this.renderIcon()}\n <span class=\"block-content\" part=\"block-content\">\n <obc-textbox\n class=\"block-text\"\n part=\"block-text\"\n .size=${valueSize}\n .fontWeight=${weight}\n .alignment=${this.alignment}\n .tabularNums=${true}\n >\n ${hinted\n ? html`<span class=\"hinted-zero\" aria-hidden=\"true\"\n >${hinted}</span\n >`\n : nothing}${text}\n ${reserver ? html`<span slot=\"length\">${reserver}</span>` : nothing}\n </obc-textbox>\n ${this.hasDegree ? this.renderDegreeGlyph(valueSize) : nothing}\n </span>\n </div>\n `;\n return wrapWithAlertFrame(this.alert ?? false, block);\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-readout-block': ObcReadoutBlock;\n }\n}\n"],"names":["ReadoutBlockVariant","ReadoutBlockSize","ReadoutBlockDataQuality","ReadoutAdviceCategory","ReadoutBlockHidePhase"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDO,IAAK,wCAAAA,yBAAL;AACLA,uBAAA,OAAA,IAAQ;AACRA,uBAAA,UAAA,IAAW;AACXA,uBAAA,QAAA,IAAS;AAHC,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAYL,IAAK,qCAAAC,sBAAL;AACLA,oBAAA,OAAA,IAAQ;AACRA,oBAAA,QAAA,IAAS;AACTA,oBAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAWL,IAAK,4CAAAC,6BAAL;AACLA,2BAAA,cAAA,IAAe;AACfA,2BAAA,SAAA,IAAU;AAFA,SAAAA;A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N,cAAc,mBAAmB;AAAA,GACrB,eAAA;"}
|
|
@@ -7,6 +7,10 @@ const componentStyle = css`* {
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
.wrapper {
|
|
11
15
|
box-sizing: border-box;
|
|
12
16
|
background: var(--container-background-color);
|
|
@@ -18,6 +22,7 @@ const componentStyle = css`* {
|
|
|
18
22
|
display: flex;
|
|
19
23
|
flex-direction: column;
|
|
20
24
|
width: 100%;
|
|
25
|
+
height: var(--obc-modal-window-height, auto);
|
|
21
26
|
max-height: 90vh;
|
|
22
27
|
}
|
|
23
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-window.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modal-window.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -47,6 +47,13 @@ export declare enum ObcModalWindowSize {
|
|
|
47
47
|
* - `done-click`: Fired when the done button is clicked.
|
|
48
48
|
* - `option-click`: Fired when the optional action button is clicked.
|
|
49
49
|
*
|
|
50
|
+
* ### Sizing
|
|
51
|
+
* By default the modal is as tall as its content, capped at `90vh`. To give it
|
|
52
|
+
* an explicit height, set the `--obc-modal-window-height` custom property on
|
|
53
|
+
* the element — either a fixed value (`--obc-modal-window-height: 360px`) or
|
|
54
|
+
* `100%` to fill a host element that is sized by its container. The `90vh` cap
|
|
55
|
+
* always applies, and the content area scrolls when the content does not fit.
|
|
56
|
+
*
|
|
50
57
|
* ### Example:
|
|
51
58
|
* ```html
|
|
52
59
|
* <obc-modal-window size="medium" hasLeadingIcon>
|
|
@@ -71,6 +78,7 @@ export declare enum ObcModalWindowSize {
|
|
|
71
78
|
* @slot option-label - Slot for the label of the optional action button (shown when `hasOptionalAction` is true)
|
|
72
79
|
* @slot cancel-label - Slot for the label of the cancel button (shown when `hasCancelAction` is true)
|
|
73
80
|
* @slot done-label - Slot for the label of the done button
|
|
81
|
+
* @cssprop [--obc-modal-window-height=auto] - Height of the modal window. Defaults to content height (capped at 90vh); set a fixed value or `100%` to size the modal externally.
|
|
74
82
|
* @stable
|
|
75
83
|
*/
|
|
76
84
|
export declare class ObcModalWindow extends LitElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-window.d.ts","sourceRoot":"","sources":["../../../src/components/modal-window/modal-window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,kCAAkC,CAAC;AAE1C;;;;;GAKG;AACH,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"modal-window.d.ts","sourceRoot":"","sources":["../../../src/components/modal-window/modal-window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,kCAAkC,CAAC;AAE1C;;;;;GAKG;AACH,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C;;OAEG;IACuB,IAAI,qBAA4B;IAE1D;;OAEG;IACwB,iBAAiB,UAAS;IAErD;;OAEG;IACwB,cAAc,UAAS;IAElD;;OAEG;IAC0C,eAAe,UAAQ;IAEpE;;OAEG;IAC0C,cAAc,UAAQ;IAEnE,OAAO,CAAC,YAAY,CACiC;IAErD,OAAO,CAAC,aAAa,CACiC;IAEtD,OAAO,CAAC,WAAW,CAA2D;IAE9E,OAAO,CAAC,aAAa,CACiC;cAEnC,MAAM;IAiFzB,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-window.js","sources":["../../../src/components/modal-window/modal-window.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './modal-window.css?inline';\n\nimport '../button/button.js';\nimport '../icon-button/icon-button.js';\nimport '../../icons/icon-close-google.js';\n\n/**\n * Enum for modal window sizes.\n * - `small`: Compact size for minimal content.\n * - `medium`: Standard size for most content.\n * - `large`: Expanded size for complex content.\n */\nexport enum ObcModalWindowSize {\n Small = 'small',\n Medium = 'medium',\n Large = 'large',\n}\n\n/**\n * `<obc-modal-window>` – A modular dialog component for displaying content and capturing user actions.\n *\n * The `obc-modal-window` provides a structured layout with a header (title and leading icon), a content area, and a footer with action buttons (Cancel, Done, and an optional custom action).\n *\n * ### Features\n * - **Flexible Sizing:** Supports `small`, `medium`, and `large` sizes to accommodate different content amounts.\n * - **Header Customization:** Includes a title slot and an optional leading icon slot.\n * - **Action Management:** Built-in \"Cancel\" and \"Done\" buttons, plus an optional additional action button.\n * - **Responsive Actions:** Action buttons automatically switch between horizontal and vertical layouts based on the modal size.\n *\n * ### Slots\n * | Slot Name | Renders When... | Purpose |\n * |---------------|----------------------------|----------------------------------------------------|\n * | leading-icon | `hasLeadingIcon` is true | Icon displayed before the title |\n * | title | Always | Main heading text for the modal |\n * | content | Always | Primary content area of the modal |\n * | option-label | `hasOptionalAction` is true | Label for the optional action button |\n * | cancel-label | `hasCancelAction` is true | Label for the cancel button |\n * | done-label | Always | Label for the primary (done) button |\n *\n * ### Properties\n * - `size` (ObcModalWindowSize): Controls the width and layout of the modal. Default is `large`.\n * - `hasOptionalAction` (boolean): Shows an additional action button when true.\n * - `hasLeadingIcon` (boolean): Shows the leading icon slot when true.\n * - `hasCancelAction` (boolean): Shows the footer cancel button when true. Default is `true`.\n * - `hasCloseAction` (boolean): Shows the header close (X) button when true. Default is `true`.\n *\n * ### Events\n * - `close-click`: Fired when the close (X) button in the header is clicked.\n * - `cancel-click`: Fired when the cancel button is clicked.\n * - `done-click`: Fired when the done button is clicked.\n * - `option-click`: Fired when the optional action button is clicked.\n *\n * ### Example:\n * ```html\n * <obc-modal-window size=\"medium\" hasLeadingIcon>\n * <span slot=\"leading-icon\"><obi-info></obi-info></span>\n * <span slot=\"title\">Settings</span>\n * <div slot=\"content\">\n * <p>Adjust your preferences here.</p>\n * </div>\n * <span slot=\"cancel-label\">Discard</span>\n * <span slot=\"done-label\">Save</span>\n * </obc-modal-window>\n * ```\n *\n * @fires {CustomEvent} close-click - Fired when the close button is clicked.\n * @fires {CustomEvent} cancel-click - Fired when the cancel button is clicked.\n * @fires {CustomEvent} done-click - Fired when the done button is clicked.\n * @fires {CustomEvent} option-click - Fired when the optional action button is clicked.\n *\n * @slot leading-icon - Slot for an icon to appear before the title (shown when `hasLeadingIcon` is true)\n * @slot title - Slot for the modal title text\n * @slot content - Slot for the main content area\n * @slot option-label - Slot for the label of the optional action button (shown when `hasOptionalAction` is true)\n * @slot cancel-label - Slot for the label of the cancel button (shown when `hasCancelAction` is true)\n * @slot done-label - Slot for the label of the done button\n * @stable\n */\n@customElement('obc-modal-window')\nexport class ObcModalWindow extends LitElement {\n /**\n * Controls the modal window size and action button layout.\n */\n @property({type: String}) size = ObcModalWindowSize.Large;\n\n /**\n * Whether to show an optional third action button.\n */\n @property({type: Boolean}) hasOptionalAction = false;\n\n /**\n * Whether to show the leading icon slot in the header.\n */\n @property({type: Boolean}) hasLeadingIcon = false;\n\n /**\n * Whether to show the footer cancel button.\n */\n @property({type: Boolean, attribute: false}) hasCancelAction = true;\n\n /**\n * Whether to show the header close (X) button.\n */\n @property({type: Boolean, attribute: false}) hasCloseAction = true;\n\n private onCloseClick = () =>\n this.dispatchEvent(new CustomEvent('close-click'));\n\n private onCancelClick = () =>\n this.dispatchEvent(new CustomEvent('cancel-click'));\n\n private onDoneClick = () => this.dispatchEvent(new CustomEvent('done-click'));\n\n private onOptionClick = () =>\n this.dispatchEvent(new CustomEvent('option-click'));\n\n protected override render() {\n const isLarge = this.size === ObcModalWindowSize.Large;\n const isMedium = this.size === ObcModalWindowSize.Medium;\n const isSmall = this.size === ObcModalWindowSize.Small;\n const stretchFooterActions = (isSmall || isMedium) && this.hasCancelAction;\n\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`size-${this.size}`]: true,\n })}\n >\n <div\n class=${classMap({\n 'title-container': true,\n 'without-close': !this.hasCloseAction,\n })}\n >\n <div class=\"title-content\">\n ${this.hasLeadingIcon\n ? html`<div class=\"leading-icon\">\n <slot name=\"leading-icon\"></slot>\n </div>`\n : nothing}\n <div class=\"label-container\">\n <slot name=\"title\">Title</slot>\n </div>\n </div>\n ${this.hasCloseAction\n ? html`<obc-icon-button variant=\"flat\" @click=${this.onCloseClick}>\n <obi-close-google></obi-close-google>\n </obc-icon-button>`\n : nothing}\n <div class=\"divider\"></div>\n </div>\n\n <div class=\"content-area\">\n <slot name=\"content\"></slot>\n </div>\n\n <div class=\"action-container\">\n <div class=\"divider\"></div>\n ${this.hasOptionalAction\n ? html`<div class=\"optional-action-container\">\n <obc-button @click=${this.onOptionClick} .fullWidth=${true}>\n <slot name=\"option-label\">Option</slot>\n </obc-button>\n </div>`\n : nothing}\n\n <div\n class=${classMap({\n 'primary-action-container': true,\n 'primary-action-horizontal':\n isLarge || isMedium || !this.hasCancelAction,\n 'primary-action-vertical': isSmall && this.hasCancelAction,\n 'without-cancel': !this.hasCancelAction,\n })}\n >\n ${this.hasCancelAction\n ? html`<obc-button\n @click=${this.onCancelClick}\n .fullWidth=${stretchFooterActions}\n >\n <slot name=\"cancel-label\">Cancel</slot>\n </obc-button>`\n : nothing}\n <obc-button\n variant=\"raised\"\n @click=${this.onDoneClick}\n .fullWidth=${stretchFooterActions}\n >\n <slot name=\"done-label\">Done</slot>\n </obc-button>\n </div>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-modal-window': ObcModalWindow;\n }\n}\n"],"names":["ObcModalWindowSize"],"mappings":";;;;;;;;;;;;;;;;;;AAgBO,IAAK,uCAAAA,wBAAL;AACLA,sBAAA,OAAA,IAAQ;AACRA,sBAAA,QAAA,IAAS;AACTA,sBAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AAmEL,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA;AAIqB,SAAA,OAAO;AAKN,SAAA,oBAAoB;AAKpB,SAAA,iBAAiB;AAKC,SAAA,kBAAkB;AAKlB,SAAA,iBAAiB;AAE9D,SAAQ,eAAe,MACrB,KAAK,cAAc,IAAI,YAAY,aAAa,CAAC;AAEnD,SAAQ,gBAAgB,MACtB,KAAK,cAAc,IAAI,YAAY,cAAc,CAAC;AAEpD,SAAQ,cAAc,MAAM,KAAK,cAAc,IAAI,YAAY,YAAY,CAAC;AAE5E,SAAQ,gBAAgB,MACtB,KAAK,cAAc,IAAI,YAAY,cAAc,CAAC;AAAA,EAAA;AAAA,EAEjC,SAAS;AAC1B,UAAM,UAAU,KAAK,SAAS;AAC9B,UAAM,WAAW,KAAK,SAA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A,qBAAA,CAAA;AAKA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAdd,eAcgB,WAAA,kBAAA,CAAA;AAKkB,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAnBhC,eAmBkC,WAAA,mBAAA,CAAA;AAKA,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAxBhC,eAwBkC,WAAA,kBAAA,CAAA;AAxBlC,iBAAN,gBAAA;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB,cAAA;"}
|
|
1
|
+
{"version":3,"file":"modal-window.js","sources":["../../../src/components/modal-window/modal-window.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './modal-window.css?inline';\n\nimport '../button/button.js';\nimport '../icon-button/icon-button.js';\nimport '../../icons/icon-close-google.js';\n\n/**\n * Enum for modal window sizes.\n * - `small`: Compact size for minimal content.\n * - `medium`: Standard size for most content.\n * - `large`: Expanded size for complex content.\n */\nexport enum ObcModalWindowSize {\n Small = 'small',\n Medium = 'medium',\n Large = 'large',\n}\n\n/**\n * `<obc-modal-window>` – A modular dialog component for displaying content and capturing user actions.\n *\n * The `obc-modal-window` provides a structured layout with a header (title and leading icon), a content area, and a footer with action buttons (Cancel, Done, and an optional custom action).\n *\n * ### Features\n * - **Flexible Sizing:** Supports `small`, `medium`, and `large` sizes to accommodate different content amounts.\n * - **Header Customization:** Includes a title slot and an optional leading icon slot.\n * - **Action Management:** Built-in \"Cancel\" and \"Done\" buttons, plus an optional additional action button.\n * - **Responsive Actions:** Action buttons automatically switch between horizontal and vertical layouts based on the modal size.\n *\n * ### Slots\n * | Slot Name | Renders When... | Purpose |\n * |---------------|----------------------------|----------------------------------------------------|\n * | leading-icon | `hasLeadingIcon` is true | Icon displayed before the title |\n * | title | Always | Main heading text for the modal |\n * | content | Always | Primary content area of the modal |\n * | option-label | `hasOptionalAction` is true | Label for the optional action button |\n * | cancel-label | `hasCancelAction` is true | Label for the cancel button |\n * | done-label | Always | Label for the primary (done) button |\n *\n * ### Properties\n * - `size` (ObcModalWindowSize): Controls the width and layout of the modal. Default is `large`.\n * - `hasOptionalAction` (boolean): Shows an additional action button when true.\n * - `hasLeadingIcon` (boolean): Shows the leading icon slot when true.\n * - `hasCancelAction` (boolean): Shows the footer cancel button when true. Default is `true`.\n * - `hasCloseAction` (boolean): Shows the header close (X) button when true. Default is `true`.\n *\n * ### Events\n * - `close-click`: Fired when the close (X) button in the header is clicked.\n * - `cancel-click`: Fired when the cancel button is clicked.\n * - `done-click`: Fired when the done button is clicked.\n * - `option-click`: Fired when the optional action button is clicked.\n *\n * ### Sizing\n * By default the modal is as tall as its content, capped at `90vh`. To give it\n * an explicit height, set the `--obc-modal-window-height` custom property on\n * the element — either a fixed value (`--obc-modal-window-height: 360px`) or\n * `100%` to fill a host element that is sized by its container. The `90vh` cap\n * always applies, and the content area scrolls when the content does not fit.\n *\n * ### Example:\n * ```html\n * <obc-modal-window size=\"medium\" hasLeadingIcon>\n * <span slot=\"leading-icon\"><obi-info></obi-info></span>\n * <span slot=\"title\">Settings</span>\n * <div slot=\"content\">\n * <p>Adjust your preferences here.</p>\n * </div>\n * <span slot=\"cancel-label\">Discard</span>\n * <span slot=\"done-label\">Save</span>\n * </obc-modal-window>\n * ```\n *\n * @fires {CustomEvent} close-click - Fired when the close button is clicked.\n * @fires {CustomEvent} cancel-click - Fired when the cancel button is clicked.\n * @fires {CustomEvent} done-click - Fired when the done button is clicked.\n * @fires {CustomEvent} option-click - Fired when the optional action button is clicked.\n *\n * @slot leading-icon - Slot for an icon to appear before the title (shown when `hasLeadingIcon` is true)\n * @slot title - Slot for the modal title text\n * @slot content - Slot for the main content area\n * @slot option-label - Slot for the label of the optional action button (shown when `hasOptionalAction` is true)\n * @slot cancel-label - Slot for the label of the cancel button (shown when `hasCancelAction` is true)\n * @slot done-label - Slot for the label of the done button\n * @cssprop [--obc-modal-window-height=auto] - Height of the modal window. Defaults to content height (capped at 90vh); set a fixed value or `100%` to size the modal externally.\n * @stable\n */\n@customElement('obc-modal-window')\nexport class ObcModalWindow extends LitElement {\n /**\n * Controls the modal window size and action button layout.\n */\n @property({type: String}) size = ObcModalWindowSize.Large;\n\n /**\n * Whether to show an optional third action button.\n */\n @property({type: Boolean}) hasOptionalAction = false;\n\n /**\n * Whether to show the leading icon slot in the header.\n */\n @property({type: Boolean}) hasLeadingIcon = false;\n\n /**\n * Whether to show the footer cancel button.\n */\n @property({type: Boolean, attribute: false}) hasCancelAction = true;\n\n /**\n * Whether to show the header close (X) button.\n */\n @property({type: Boolean, attribute: false}) hasCloseAction = true;\n\n private onCloseClick = () =>\n this.dispatchEvent(new CustomEvent('close-click'));\n\n private onCancelClick = () =>\n this.dispatchEvent(new CustomEvent('cancel-click'));\n\n private onDoneClick = () => this.dispatchEvent(new CustomEvent('done-click'));\n\n private onOptionClick = () =>\n this.dispatchEvent(new CustomEvent('option-click'));\n\n protected override render() {\n const isLarge = this.size === ObcModalWindowSize.Large;\n const isMedium = this.size === ObcModalWindowSize.Medium;\n const isSmall = this.size === ObcModalWindowSize.Small;\n const stretchFooterActions = (isSmall || isMedium) && this.hasCancelAction;\n\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`size-${this.size}`]: true,\n })}\n >\n <div\n class=${classMap({\n 'title-container': true,\n 'without-close': !this.hasCloseAction,\n })}\n >\n <div class=\"title-content\">\n ${this.hasLeadingIcon\n ? html`<div class=\"leading-icon\">\n <slot name=\"leading-icon\"></slot>\n </div>`\n : nothing}\n <div class=\"label-container\">\n <slot name=\"title\">Title</slot>\n </div>\n </div>\n ${this.hasCloseAction\n ? html`<obc-icon-button variant=\"flat\" @click=${this.onCloseClick}>\n <obi-close-google></obi-close-google>\n </obc-icon-button>`\n : nothing}\n <div class=\"divider\"></div>\n </div>\n\n <div class=\"content-area\">\n <slot name=\"content\"></slot>\n </div>\n\n <div class=\"action-container\">\n <div class=\"divider\"></div>\n ${this.hasOptionalAction\n ? html`<div class=\"optional-action-container\">\n <obc-button @click=${this.onOptionClick} .fullWidth=${true}>\n <slot name=\"option-label\">Option</slot>\n </obc-button>\n </div>`\n : nothing}\n\n <div\n class=${classMap({\n 'primary-action-container': true,\n 'primary-action-horizontal':\n isLarge || isMedium || !this.hasCancelAction,\n 'primary-action-vertical': isSmall && this.hasCancelAction,\n 'without-cancel': !this.hasCancelAction,\n })}\n >\n ${this.hasCancelAction\n ? html`<obc-button\n @click=${this.onCancelClick}\n .fullWidth=${stretchFooterActions}\n >\n <slot name=\"cancel-label\">Cancel</slot>\n </obc-button>`\n : nothing}\n <obc-button\n variant=\"raised\"\n @click=${this.onDoneClick}\n .fullWidth=${stretchFooterActions}\n >\n <slot name=\"done-label\">Done</slot>\n </obc-button>\n </div>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-modal-window': ObcModalWindow;\n }\n}\n"],"names":["ObcModalWindowSize"],"mappings":";;;;;;;;;;;;;;;;;;AAgBO,IAAK,uCAAAA,wBAAL;AACLA,sBAAA,OAAA,IAAQ;AACRA,sBAAA,QAAA,IAAS;AACTA,sBAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AA2EL,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA;AAIqB,SAAA,OAAO;AAKN,SAAA,oBAAoB;AAKpB,SAAA,iBAAiB;AAKC,SAAA,kBAAkB;AAKlB,SAAA,iBAAiB;AAE9D,SAAQ,eAAe,MACrB,KAAK,cAAc,IAAI,YAAY,aAAa,CAAC;AAEnD,SAAQ,gBAAgB,MACtB,KAAK,cAAc,IAAI,YAAY,cAAc,CAAC;AA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7C;AAGF;AAvHa,eAsHK,SAAS,UAAU,cAAc;AAlHvB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAJb,eAIe,WAAA,QAAA,CAAA;AAKC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GATd,eASgB,WAAA,qBAAA,CAAA;AAKA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAdd,eAcgB,WAAA,kBAAA,CAAA;AAKkB,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAnBhC,eAmBkC,WAAA,mBAAA,CAAA;AAKA,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAxBhC,eAwBkC,WAAA,kBAAA,CAAA;AAxBlC,iBAAN,gBAAA;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB,cAAA;"}
|
|
@@ -106,6 +106,10 @@ const componentStyle = css`* {
|
|
|
106
106
|
transition: width 0.3s ease-in-out;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
.bar.priority-regular .loaded {
|
|
110
|
+
background-color: var(--instrument-regular-secondary-color);
|
|
111
|
+
}
|
|
112
|
+
|
|
109
113
|
.indeterminate-track {
|
|
110
114
|
position: absolute;
|
|
111
115
|
top: 0;
|
|
@@ -117,6 +121,10 @@ const componentStyle = css`* {
|
|
|
117
121
|
animation: indeterminate-slide 1.5s ease-in-out infinite;
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
.bar.priority-regular .indeterminate-track {
|
|
125
|
+
background-color: var(--instrument-regular-secondary-color);
|
|
126
|
+
}
|
|
127
|
+
|
|
120
128
|
@keyframes indeterminate-slide {
|
|
121
129
|
0% {
|
|
122
130
|
transform: translateX(-100%);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"progress-bar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import { Priority } from '../../navigation-instruments/types.js';
|
|
2
3
|
import '../../icons/icon-placeholder.js';
|
|
4
|
+
export { Priority };
|
|
3
5
|
export declare enum ProgressBarType {
|
|
4
6
|
linear = "linear",
|
|
5
7
|
circular = "circular"
|
|
@@ -35,6 +37,10 @@ export declare enum CircularProgressState {
|
|
|
35
37
|
* - **Indeterminate**: Animated, looping fill for work of unknown duration; the label shows
|
|
36
38
|
* "Loading".
|
|
37
39
|
*
|
|
40
|
+
* **Color priority (`priority`)**
|
|
41
|
+
* - **Enhanced** (default): Blue fill, for a bar that reads as the primary value.
|
|
42
|
+
* - **Regular**: Neutral gray fill, for a bar that should recede as ancillary status.
|
|
43
|
+
*
|
|
38
44
|
* **Circular states (`circularState`)**
|
|
39
45
|
* - **Determinate**: Ring fills to `value`, with the rounded number (and optional `%` unit) centered.
|
|
40
46
|
* - **Indeterminate**: Animated ring with the `icon` slot centered.
|
|
@@ -87,6 +93,11 @@ export declare class ObcProgressBar extends LitElement {
|
|
|
87
93
|
* @availableWhen type==circular
|
|
88
94
|
*/
|
|
89
95
|
circularState: CircularProgressState;
|
|
96
|
+
/**
|
|
97
|
+
* Color emphasis of the bar fill: `regular` (gray) or `enhanced` (blue).
|
|
98
|
+
* @availableWhen type==linear
|
|
99
|
+
*/
|
|
100
|
+
priority: Priority;
|
|
90
101
|
/** Progress percentage (0–100); clamped when rendered. */
|
|
91
102
|
value: number;
|
|
92
103
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/components/progress-bar/progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/components/progress-bar/progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAC,QAAQ,EAAC,MAAM,uCAAuC,CAAC;AAE/D,OAAO,EAAC,QAAQ,EAAC,CAAC;AAElB,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,oBAAY,eAAe;IACzB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;CAChC;AAED,oBAAY,qBAAqB;IAC/B,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,mEAAmE;IACzC,IAAI,EAAE,eAAe,CAA0B;IACzE;;;OAGG;IACuB,IAAI,EAAE,eAAe,CAA+B;IAC9E;;;;OAIG;IACuB,aAAa,EAAE,qBAAqB,CAC1B;IACpC;;;OAGG;IACuB,QAAQ,EAAE,QAAQ,CAAqB;IACjE,0DAA0D;IAChC,KAAK,SAAK;IACpC;;;OAGG;IACwB,SAAS,UAAS;IAC7C;;;OAGG;IACwB,QAAQ,UAAS;IAC5C;;;OAGG;IACwB,cAAc,UAAS;IAClD;;;OAGG;IACuB,WAAW,SAAsB;IAC3D;;;;;;OAMG;IACwB,SAAS,UAAS;IAC7C;;;OAGG;IACuB,UAAU,SAAU;IAC9C;;;;OAIG;IACwB,wBAAwB,UAAS;IAEnD,MAAM;IAQf,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,qBAAqB;IAwC7B,OAAO,CAAC,oBAAoB;IAkC5B,OAAO,CAAC,WAAW;IAsBnB,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { unsafeCSS, LitElement, html, nothing } from "lit";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
3
4
|
import { styleMap } from "lit/directives/style-map.js";
|
|
4
5
|
import componentStyle from "./progress-bar.css.js";
|
|
5
6
|
import { customElement } from "../../decorator.js";
|
|
6
7
|
import "../../icons/icon-placeholder.js";
|
|
7
8
|
import { CircularProgressMode } from "../../building-blocks/circular-progress/circular-progress.js";
|
|
9
|
+
import { Priority } from "../../navigation-instruments/types.js";
|
|
8
10
|
var __defProp = Object.defineProperty;
|
|
9
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
12
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -37,6 +39,7 @@ let ObcProgressBar = class extends LitElement {
|
|
|
37
39
|
this.type = "linear";
|
|
38
40
|
this.mode = "determinate";
|
|
39
41
|
this.circularState = "determinate";
|
|
42
|
+
this.priority = Priority.enhanced;
|
|
40
43
|
this.value = 0;
|
|
41
44
|
this.showValue = false;
|
|
42
45
|
this.showUnit = false;
|
|
@@ -116,11 +119,15 @@ let ObcProgressBar = class extends LitElement {
|
|
|
116
119
|
renderLinearProgress() {
|
|
117
120
|
const clampedValue = Math.max(0, Math.min(100, this.value));
|
|
118
121
|
const progressWidth = `${clampedValue}%`;
|
|
122
|
+
const barClasses = {
|
|
123
|
+
bar: true,
|
|
124
|
+
"priority-regular": this.priority === Priority.regular
|
|
125
|
+
};
|
|
119
126
|
return html`
|
|
120
127
|
<div class="wrapper">
|
|
121
128
|
${this.showValue ? this.renderLabel() : ""}
|
|
122
129
|
|
|
123
|
-
<div class
|
|
130
|
+
<div class=${classMap(barClasses)}>
|
|
124
131
|
${this.mode === "determinate" ? html`
|
|
125
132
|
<div
|
|
126
133
|
class="loaded"
|
|
@@ -167,6 +174,9 @@ __decorateClass([
|
|
|
167
174
|
__decorateClass([
|
|
168
175
|
property({ type: String })
|
|
169
176
|
], ObcProgressBar.prototype, "circularState", 2);
|
|
177
|
+
__decorateClass([
|
|
178
|
+
property({ type: String })
|
|
179
|
+
], ObcProgressBar.prototype, "priority", 2);
|
|
170
180
|
__decorateClass([
|
|
171
181
|
property({ type: Number })
|
|
172
182
|
], ObcProgressBar.prototype, "value", 2);
|
|
@@ -197,6 +207,7 @@ ObcProgressBar = __decorateClass([
|
|
|
197
207
|
export {
|
|
198
208
|
CircularProgressState,
|
|
199
209
|
ObcProgressBar,
|
|
210
|
+
Priority,
|
|
200
211
|
ProgressBarMode,
|
|
201
212
|
ProgressBarType
|
|
202
213
|
};
|