@nent/core
Version:
28 lines (25 loc) • 747 B
JavaScript
/*!
* NENT 2022
*/
import { r as registerInstance, h, H as Host } from './index-916ca544.js';
import { s as state } from './state-6945acbc.js';
import './index-4bfabbbd.js';
const AppThemeSwitch = class {
constructor(hostRef) {
registerInstance(this, hostRef);
/**
* The inner input ID
*/
this.inputId = 'dark-mode';
}
render() {
return (h(Host, { onClick: () => {
state.darkMode = !state.darkMode;
} }, h("input", { type: "checkbox", ref: el => {
this.checkbox = el;
}, class: this.inputClass, id: this.inputId, onChange: () => {
state.darkMode = this.checkbox.checked;
}, checked: state.darkMode || false })));
}
};
export { AppThemeSwitch as n_app_theme_switch };