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.

32 lines (27 loc) 839 B
/*! * NENT 2022 */ 'use strict'; 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;