import { CheckboxDefaultProps } from './props';
import fmtEvent from '../_util/fmtEvent';
import mixinValue from '../mixins/value';
import '../_util/assert-component2';
Component({
    props: CheckboxDefaultProps,
    mixins: [
        mixinValue({
            valueKey: 'checked',
            defaultValueKey: 'defaultChecked',
        }),
    ],
    methods: {
        onChange: function (e) {
            var value = !this.getValue();
            if (!this.isControlled()) {
                this.update(value);
            }
            if (this.props.onChange) {
                this.props.onChange(value, fmtEvent(this.props, e));
            }
        },
    },
});
