@oicl/openbridge-webcomponents 2.0.0-next.110 → 2.0.0-next.111
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 +2297 -1506
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +562 -0
- package/dist/automation/indicator-battery/indicator-battery.css.js +52 -0
- package/dist/automation/indicator-battery/indicator-battery.css.js.map +1 -0
- package/dist/automation/indicator-battery/indicator-battery.d.ts +65 -0
- package/dist/automation/indicator-battery/indicator-battery.d.ts.map +1 -0
- package/dist/automation/indicator-battery/indicator-battery.js +119 -0
- package/dist/automation/indicator-battery/indicator-battery.js.map +1 -0
- package/dist/automation/indicator-engine/indicator-engine.css.js +45 -0
- package/dist/automation/indicator-engine/indicator-engine.css.js.map +1 -0
- package/dist/automation/indicator-engine/indicator-engine.d.ts +34 -0
- package/dist/automation/indicator-engine/indicator-engine.d.ts.map +1 -0
- package/dist/automation/indicator-engine/indicator-engine.js +73 -0
- package/dist/automation/indicator-engine/indicator-engine.js.map +1 -0
- package/dist/automation/indicator-generator/indicator-generator-geometry.d.ts +30 -0
- package/dist/automation/indicator-generator/indicator-generator-geometry.d.ts.map +1 -0
- package/dist/automation/indicator-generator/indicator-generator-geometry.js +61 -0
- package/dist/automation/indicator-generator/indicator-generator-geometry.js.map +1 -0
- package/dist/automation/indicator-generator/indicator-generator.css.js +121 -0
- package/dist/automation/indicator-generator/indicator-generator.css.js.map +1 -0
- package/dist/automation/indicator-generator/indicator-generator.d.ts +57 -0
- package/dist/automation/indicator-generator/indicator-generator.d.ts.map +1 -0
- package/dist/automation/indicator-generator/indicator-generator.js +136 -0
- package/dist/automation/indicator-generator/indicator-generator.js.map +1 -0
- package/dist/automation/indicator-shared/linear-indicator.d.ts +46 -0
- package/dist/automation/indicator-shared/linear-indicator.d.ts.map +1 -0
- package/dist/automation/indicator-shared/linear-indicator.js +175 -0
- package/dist/automation/indicator-shared/linear-indicator.js.map +1 -0
- package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.css.js +48 -0
- package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.css.js.map +1 -0
- package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.d.ts +65 -0
- package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.d.ts.map +1 -0
- package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.js +105 -0
- package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indicator-tank-atmospheric.js","sources":["../../../src/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './indicator-tank-atmospheric.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../icons/icon-tank.js';\nimport {\n IndicatorDirection,\n LinearIndicatorScheme,\n Rect,\n renderLinearBar,\n renderTrendGraph,\n} from '../indicator-shared/linear-indicator.js';\n\nexport enum IndicatorTankAtmosphericVariant {\n bar = 'bar',\n trend = 'trend',\n}\n\nexport enum IndicatorTankAtmosphericValue {\n regular = 'regular',\n enhanced = 'enhanced',\n medium = 'medium',\n}\n\nconst HORIZONTAL_BAR: Rect = {x: 8, y: 11, width: 32, height: 26};\nconst VERTICAL_BAR: Rect = {x: 11, y: 8, width: 26, height: 32};\nconst HORIZONTAL_TREND: Rect = {x: 8, y: 10, width: 32, height: 28};\nconst VERTICAL_TREND: Rect = {x: 10, y: 8, width: 28, height: 32};\n\nconst FRAME_PATH =\n 'M20.5 32.5L4.21259 32.5C3.70663 32.5 3.45364 32.5 3.09178 32.3531C2.84817 32.2542 2.44102 31.9492 2.27758 31.7433C2.0348 31.4373 1.98325 31.2615 1.88017 30.9098C1.29286 28.906 0.5 24.6852 0.5 16.5C0.5 8.31487 1.29286 4.09402 1.88016 2.09025C1.98325 1.73854 2.0348 1.56268 2.27758 1.25676C2.44102 1.0508 2.84817 0.745859 3.09178 0.646944C3.45364 0.500011 3.70662 0.500011 4.21259 0.500011L20.5 0.50001L36.7874 0.500011C37.2934 0.500011 37.5464 0.500011 37.9082 0.646943C38.1518 0.745859 38.559 1.0508 38.7224 1.25675C38.9652 1.56268 39.0167 1.73854 39.1198 2.09025C39.7071 4.09402 40.5 8.31487 40.5 16.5C40.5 24.6851 39.7071 28.906 39.1198 30.9098C39.0167 31.2615 38.9652 31.4373 38.7224 31.7433C38.559 31.9492 38.1518 32.2542 37.9082 32.3531C37.5464 32.5 37.2934 32.5 36.7874 32.5H20.5Z';\n\n/**\n * Compact 48×48 atmospheric tank level indicator.\n *\n * ## Features / Variants\n * - `variant`: `bar` (bottom-up percentage fill) or `trend` (history graph\n * with a current-value micro-bar)\n * - `direction`: `vertical` or `horizontal` tank outline\n * - `value`: color scheme — `regular`, `enhanced` or `medium`\n * - `level`: current tank level 0–100 (%), drives the fill and micro-bar\n * - `data`: history samples 0–100 (%) drawn as the trend graph\n * - `hasIcon`: centered icon overlay (bar variant only)\n *\n * ## Usage Guidelines\n * Use as an at-a-glance level indicator in dashboards and lists. For a\n * full-featured tank cell with readouts, badges and setpoints, use\n * `obc-automation-tank` instead.\n *\n * ## Best Practices / Constraints\n * - `level` and `data` values are clamped to 0–100; values outside that\n * range are pinned to the nearest bound.\n * - The `trend` variant needs at least two `data` samples to draw a line;\n * with fewer it shows only the current-value micro-bar.\n * - The `icon` slot renders only in the `bar` variant; it is ignored in\n * `trend`.\n * - Display-only: the root SVG is `aria-hidden`; convey tank level to\n * assistive tech through adjacent text if it is not otherwise available.\n *\n * ## Slots\n * | Slot | Condition | Purpose |\n * | ------ | ----------------------------- | ------------------------------ |\n * | `icon` | `hasIcon` and `variant='bar'` | Icon overlay (`obi-*` element) |\n *\n * @slot icon - Centered icon overlay, defaults to `obi-tank`\n */\n@customElement('obc-indicator-tank-atmospheric')\nexport class ObcIndicatorTankAtmospheric extends LitElement {\n @property({type: String, reflect: true}) direction: IndicatorDirection =\n IndicatorDirection.vertical;\n @property({type: String, reflect: true})\n variant: IndicatorTankAtmosphericVariant =\n IndicatorTankAtmosphericVariant.bar;\n @property({type: String, reflect: true})\n value: IndicatorTankAtmosphericValue = IndicatorTankAtmosphericValue.regular;\n /** Current level, 0-100 (%) */\n @property({type: Number}) level = 0;\n /** History samples, 0-100 (%) each, oldest first */\n @property({type: Array}) data: number[] = [];\n @property({type: Boolean}) hasIcon = false;\n\n private get scheme(): LinearIndicatorScheme {\n switch (this.value) {\n case IndicatorTankAtmosphericValue.enhanced:\n return LinearIndicatorScheme.enhanced;\n case IndicatorTankAtmosphericValue.medium:\n return LinearIndicatorScheme.categorical;\n default:\n return LinearIndicatorScheme.regular;\n }\n }\n\n override render() {\n const horizontal = this.direction === IndicatorDirection.horizontal;\n const trend = this.variant === IndicatorTankAtmosphericVariant.trend;\n const barRect = horizontal\n ? trend\n ? HORIZONTAL_TREND\n : HORIZONTAL_BAR\n : trend\n ? VERTICAL_TREND\n : VERTICAL_BAR;\n const frameTransform = horizontal\n ? 'translate(3.5 7.5)'\n : 'rotate(90 24 24) translate(3.5 7.5)';\n const showIcon =\n this.hasIcon && this.variant === IndicatorTankAtmosphericVariant.bar;\n return html`\n <svg viewBox=\"0 0 48 48\" aria-hidden=\"true\">\n <g transform=${frameTransform}>\n <path class=\"frame\" d=${FRAME_PATH} />\n </g>\n ${this.variant === IndicatorTankAtmosphericVariant.trend\n ? renderTrendGraph(\n barRect,\n this.data,\n this.level,\n this.scheme,\n 'tank'\n )\n : renderLinearBar(barRect, this.level, this.scheme, 'tank')}\n </svg>\n ${showIcon\n ? html`<div class=\"icon-wrapper\">\n <slot name=\"icon\"><obi-tank usecsscolor></obi-tank></slot>\n </div>`\n : nothing}\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameM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