@nent/core
Version:
32 lines (27 loc) • 839 B
JavaScript
/*!
* NENT 2022
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-1829aebc.js');
const state = require('./state-d62be6f1.js');
require('./index-96f3ab3f.js');
const AppThemeSwitch = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
/**
* The inner input ID
*/
this.inputId = 'dark-mode';
}
render() {
return (index.h(index.Host, { onClick: () => {
state.state.darkMode = !state.state.darkMode;
} }, index.h("input", { type: "checkbox", ref: el => {
this.checkbox = el;
}, class: this.inputClass, id: this.inputId, onChange: () => {
state.state.darkMode = this.checkbox.checked;
}, checked: state.state.darkMode || false })));
}
};
exports.n_app_theme_switch = AppThemeSwitch;