@larva.io/webcomponents
Version:
Fentrica SmartUnits WebComponents package
80 lines (76 loc) • 2.73 kB
JavaScript
/*!
* (C) Fentrica http://fentrica.com - Seee LICENSE.md
*/
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-C4h1muVj.js';
const debugCss = "slot-fb[hidden],slot[hidden]{display:initial !important}";
const Debug = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.output = createEvent(this, "output");
this.request = createEvent(this, "request");
/////// LarvaNode base properties
/**
* Component main icon
*/
this.icon = 'security';
/**
* 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';
this.loading = true;
}
componentDidLoad() {
const el = this.el.shadowRoot || this.el;
this.node = el.querySelector('lar-node');
this.output.emit();
this.readInterval = window.setInterval(() => {
this.loading = true;
this.output.emit(); // send read again
}, 5000);
}
/**
* Larva error input
*/
async error(data) {
if (this.node) {
this.node.error(data);
}
this.clearReadInterval();
this.loading = false;
}
/**
* Input Larva event message (see abow)
*/
async input(data) {
this.clearReadInterval();
this.loading = false;
this.text = data;
}
clearReadInterval() {
if (this.readInterval !== undefined) {
clearInterval(this.readInterval);
this.readInterval = undefined;
}
}
render() {
const compnentProps = {
text: this.text
};
return [
h("lar-node", { key: 'abf65cc33d6421afc1fdd589df9ea640f82e8e6c', icon: this.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, nodeSize: this.nodeSize, log: this.log, loading: this.loading, component: "lar-debug-content", componentProps: compnentProps }, h("slot", { key: 'bf31cd884ea3ced9c0288ae90afb9a8fe1cc2e38' }))
];
}
get el() { return getElement(this); }
};
Debug.style = debugCss;
export { Debug as lar_debug };
//# sourceMappingURL=lar-debug.entry.js.map