@larva.io/webcomponents
Version:
Fentrica SmartUnits WebComponents package
82 lines (77 loc) • 2.73 kB
JavaScript
/*!
* (C) Fentrica http://fentrica.com - Seee LICENSE.md
*/
'use strict';
var index = require('./index-B0SElCD3.js');
const debugCss = "slot-fb[hidden],slot[hidden]{display:initial !important}";
const Debug = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.output = index.createEvent(this, "output");
this.request = index.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 [
index.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 }, index.h("slot", { key: 'bf31cd884ea3ced9c0288ae90afb9a8fe1cc2e38' }))
];
}
get el() { return index.getElement(this); }
};
Debug.style = debugCss;
exports.lar_debug = Debug;
//# sourceMappingURL=lar-debug.entry.cjs.js.map