ednl-liftstatus-web-components
Version:
The EDNL LiftStatus web components
81 lines (80 loc) • 2.2 kB
JavaScript
import { Host, h } from "@stencil/core";
import { getStore } from "../../store";
export class LsStatus {
constructor() {
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 is() { return "ls-status"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["ls-status.css"]
};
}
static get styleUrls() {
return {
"$": ["ls-status.css"]
};
}
static get properties() {
return {
"sensorIds": {
"type": "string",
"mutable": false,
"complexType": {
"original": "\"500,501,502,503,514,515,590\"",
"resolved": "\"500,501,502,503,514,515,590\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Specifies the IDs of the sensors that are to be displayed."
},
"attribute": "sensor-ids",
"reflect": false,
"defaultValue": "\"500,501,502,503,514,515,590\""
},
"idKey": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "The unique key that is used to identify store data."
},
"attribute": "id-key",
"reflect": false
}
};
}
static get states() {
return {
"sensorIdsArray": {}
};
}
}
//# sourceMappingURL=ls-status.js.map