ednl-liftstatus-web-components
Version:
The EDNL LiftStatus web components
60 lines (55 loc) • 2.02 kB
JavaScript
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { g as getStore } from './store.js';
import { d as defineCustomElement$2 } from './ls-status-item2.js';
const lsStatusCss = ":host{display:block;font-family:var(--ls-font-family)}ls-status-item{margin:1rem 0}ls-status-item:first-of-type{margin-top:0}ls-status-item:last-of-type{margin-bottom:0}";
const LsStatus$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.__attachShadow();
this.handleBackdoor = (hasBackDoor) => {
if (hasBackDoor)
return;
this.sensorIdsArray = this.sensorIdsArray.filter((sensor) => {
return sensor !== 503;
});
};
this.sensorIds = "500,501,502,503,514,515,590";
this.idKey = undefined;
this.sensorIdsArray = this.sensorIds.split(",").map(Number);
}
async componentWillLoad() {
this.store = await getStore(this.idKey);
this.handleBackdoor(this.store.state.hasBackDoor);
}
render() {
return (h(Host, null, h("slot", null), this.sensorIdsArray.map((sensor) => (h("ls-status-item", { "sensor-id": sensor, "id-key": this.idKey })))));
}
static get style() { return lsStatusCss; }
}, [1, "ls-status", {
"sensorIds": [1, "sensor-ids"],
"idKey": [1, "id-key"],
"sensorIdsArray": [32]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["ls-status", "ls-status-item"];
components.forEach(tagName => { switch (tagName) {
case "ls-status":
if (!customElements.get(tagName)) {
customElements.define(tagName, LsStatus$1);
}
break;
case "ls-status-item":
if (!customElements.get(tagName)) {
defineCustomElement$2();
}
break;
} });
}
const LsStatus = LsStatus$1;
const defineCustomElement = defineCustomElement$1;
export { LsStatus, defineCustomElement };
//# sourceMappingURL=ls-status.js.map