52 lines
764 B
JavaScript
52 lines
764 B
JavaScript
|
|
var Widget = require('./widget');
|
|
|
|
module.exports = new Class({
|
|
Extends: Widget
|
|
,Tag: 'htk-icon'
|
|
,Properties:
|
|
{
|
|
name: {
|
|
type: String
|
|
,set: function(x) {
|
|
this._icon = x;
|
|
this._setIcon();
|
|
}
|
|
,get: function() {
|
|
return this._icon;
|
|
}
|
|
|
|
},
|
|
theme: {
|
|
type: String
|
|
,set: function(x) {
|
|
this._theme = x;
|
|
this._setIcon();
|
|
}
|
|
,get: function() {
|
|
return this._theme;
|
|
}
|
|
},
|
|
alt: {
|
|
type: String
|
|
,set: function(x) {
|
|
this.node.alt = x;
|
|
}
|
|
,get: function() {
|
|
return this.node.alt;
|
|
}
|
|
}
|
|
}
|
|
|
|
,_icon: null
|
|
|
|
,render: function() {
|
|
const node = this.createRoot('span');
|
|
node.className = 'material-symbols-rounded icon';
|
|
}
|
|
|
|
,_setIcon: function() {
|
|
this.node.innerText = this._icon;
|
|
}
|
|
});
|