hedera-web/js/htk/icon.js

52 lines
764 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2022-05-21 21:31:56 +00:00
var Widget = require('./widget');
2016-09-26 09:28:47 +00:00
2022-05-21 21:31:56 +00:00
module.exports = new Class({
2016-09-26 09:28:47 +00:00
Extends: Widget
,Tag: 'htk-icon'
,Properties:
{
2022-05-21 21:31:56 +00:00
name: {
2016-09-26 09:28:47 +00:00
type: String
2022-05-21 21:31:56 +00:00
,set: function(x) {
2016-09-26 09:28:47 +00:00
this._icon = x;
2022-05-21 21:31:56 +00:00
this._setIcon();
2016-09-26 09:28:47 +00:00
}
2022-05-21 21:31:56 +00:00
,get: function() {
2016-09-26 09:28:47 +00:00
return this._icon;
}
},
2022-05-21 21:31:56 +00:00
theme: {
2016-09-26 09:28:47 +00:00
type: String
2022-05-21 21:31:56 +00:00
,set: function(x) {
2016-09-26 09:28:47 +00:00
this._theme = x;
2022-05-21 21:31:56 +00:00
this._setIcon();
2016-09-26 09:28:47 +00:00
}
2022-05-21 21:31:56 +00:00
,get: function() {
2016-09-26 09:28:47 +00:00
return this._theme;
}
},
2022-05-21 21:31:56 +00:00
alt: {
2016-09-26 09:28:47 +00:00
type: String
2022-05-21 21:31:56 +00:00
,set: function(x) {
2016-09-26 09:28:47 +00:00
this.node.alt = x;
}
2022-05-21 21:31:56 +00:00
,get: function() {
2016-09-26 09:28:47 +00:00
return this.node.alt;
}
}
}
,_icon: null
2022-05-21 21:31:56 +00:00
,render: function() {
const node = this.createRoot('span');
node.className = 'material-symbols-rounded icon';
2016-09-26 09:28:47 +00:00
}
2022-05-21 21:31:56 +00:00
,_setIcon: function() {
this.node.innerText = this._icon;
2016-09-26 09:28:47 +00:00
}
});