0
1
Fork 0
hedera-web-mindshore/js/htk/icon/index.js

52 lines
692 B
JavaScript
Raw Permalink Normal View History

2016-09-26 09:28:47 +00:00
2022-06-06 12:49:18 +00:00
var Component = require('vn/component');
2016-09-26 09:28:47 +00:00
2022-05-21 21:31:56 +00:00
module.exports = new Class({
2022-06-06 12:49:18 +00:00
Extends: Component
2016-09-26 09:28:47 +00:00
,Tag: 'htk-icon'
,Properties:
{
2022-05-21 21:31:56 +00:00
name: {
2016-09-26 09:28:47 +00:00
type: String
2022-11-16 01:46:44 +00:00
,set(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-11-16 01:46:44 +00:00
,get() {
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-11-16 01:46:44 +00:00
,set(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-11-16 01:46:44 +00:00
,get() {
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-11-16 01:46:44 +00:00
,set(x) {
2016-09-26 09:28:47 +00:00
this.node.alt = x;
}
2022-11-16 01:46:44 +00:00
,get() {
2016-09-26 09:28:47 +00:00
return this.node.alt;
}
}
}
,_icon: null
2022-11-16 01:46:44 +00:00
,render() {
2022-05-21 21:31:56 +00:00
const node = this.createRoot('span');
2022-06-06 17:13:57 +00:00
node.classList.add('material-symbols-rounded');
2016-09-26 09:28:47 +00:00
}
2022-11-16 01:46:44 +00:00
,_setIcon() {
2022-05-21 21:31:56 +00:00
this.node.innerText = this._icon;
2016-09-26 09:28:47 +00:00
}
});