import {MDCCheckbox} from '@material/checkbox/'; import {h} from 'preact'; import MaterialComponent from '../Base/MaterialComponent'; export interface ICheckboxProps { indeterminate?: boolean; disabled?: boolean; onChange?: JSX.GenericEventHandler; checked?: boolean; } export interface ICheckboxState {} export class Checkbox extends MaterialComponent< ICheckboxProps, ICheckboxState > { public MDComponent?: MDCCheckbox; protected componentName = 'checkbox'; protected mdcProps = ['disabled']; protected mdcNotifyProps = ['checked', 'indeterminate', 'disabled']; public componentDidMount() { super.componentDidMount(); if (this.control) { this.MDComponent = new MDCCheckbox(this.control); } this.afterComponentDidMount(); } public componentWillUnmount() { super.componentWillUnmount(); if (this.MDComponent) { this.MDComponent.destroy(); } } protected materialDom(allprops) { return (
); } } export default Checkbox;