forked from verdnatura/hedera-web
52 lines
692 B
JavaScript
52 lines
692 B
JavaScript
|
|
var Component = require('vn/component');
|
|
|
|
module.exports = new Class({
|
|
Extends: Component
|
|
,Tag: 'htk-icon'
|
|
,Properties:
|
|
{
|
|
name: {
|
|
type: String
|
|
,set(x) {
|
|
this._icon = x;
|
|
this._setIcon();
|
|
}
|
|
,get() {
|
|
return this._icon;
|
|
}
|
|
|
|
},
|
|
theme: {
|
|
type: String
|
|
,set(x) {
|
|
this._theme = x;
|
|
this._setIcon();
|
|
}
|
|
,get() {
|
|
return this._theme;
|
|
}
|
|
},
|
|
alt: {
|
|
type: String
|
|
,set(x) {
|
|
this.node.alt = x;
|
|
}
|
|
,get() {
|
|
return this.node.alt;
|
|
}
|
|
}
|
|
}
|
|
|
|
,_icon: null
|
|
|
|
,render() {
|
|
const node = this.createRoot('span');
|
|
node.classList.add('material-symbols-rounded');
|
|
}
|
|
|
|
,_setIcon() {
|
|
this.node.innerText = this._icon;
|
|
}
|
|
});
|