UNPKG

@larva.io/webcomponents

Version:

Fentrica SmartUnits WebComponents package

69 lines (66 loc) 2.51 kB
/*! * (C) Fentrica http://fentrica.com - Seee LICENSE.md */ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-C4h1muVj.js'; const Weather = class { constructor(hostRef) { registerInstance(this, hostRef); this.output = createEvent(this, "output"); this.request = createEvent(this, "request"); /////// LarvaNode base properties /** * Component main icon */ this.icon = 'cloud'; /** * The color to use from your application's color palette. * Detrouble options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. */ this.color = 'primary'; /** * Is logging for this component enabled (lar-log subcomponent loaded) */ this.log = false; /** * Node size */ this.nodeSize = 'default'; /////// LarvaNode base properties and events - end this.dataIn = {}; this.loading = true; } componentDidLoad() { const el = this.el.shadowRoot || this.el; this.node = el.querySelector('lar-node'); this.output.emit(); } /** * Larva error input */ async error(data) { if (this.node) { this.node.error(data); } this.loading = false; } /** * Input Larva event message (see abow) */ async input(data) { this.loading = false; this.dataIn = data; } render() { const compnentProps = { data: this.dataIn, }; const value = this.dataIn.temperature !== undefined ? `${String(this.dataIn.temperature)}°` : null; const icon = this.dataIn.icon ? this.dataIn.icon : this.icon; return [ h("lar-node", { key: 'b464ed292d0c4c1bdd1e70f59a6fe1a6f3e632c3', icon: icon, hideTitles: this.hideTitles, color: this.color, supTitle: this.supTitle, mainTitle: this.mainTitle, subTitle: this.subTitle, colorModal: this.colorModal, colorInputs: this.colorInputs, colorIconSmall: this.colorIconSmall, log: this.log, value: value, loading: this.loading, nodeSize: this.nodeSize, component: "lar-weather-content", componentProps: compnentProps }, h("slot", { key: 'c9e662431de17c34299170663414c714cd8649f6' })) ]; } get el() { return getElement(this); } }; export { Weather as lar_weather }; //# sourceMappingURL=lar-weather.entry.js.map