UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

28 lines (25 loc) 747 B
/*! * 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 };