Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, {PureComponent, PropTypes} from 'react';
import {Set as ImmutableSet, Map as ImmutableMap} from 'immutable';
// Temporarily using relative reference until we publish on npm.
import {getCorrectEventName} from '@material/animation/dist/mdc.animation';
import {MDCRipple, MDCRippleFoundation} from '@material/ripple/dist/mdc.ripple';
import {MDCCheckboxFoundation} from '@material/checkbox/dist/mdc.checkbox';
import '@material/checkbox/dist/mdc.checkbox.css';
function getMatchesProperty(HTMLElementPrototype) {
return [
'webkitMatchesSelector', 'msMatchesSelector', 'matches',
].filter((p) => p in HTMLElementPrototype).pop();
}
const {ANIM_END_EVENT_NAME} = MDCCheckboxFoundation.strings;
const MATCHES = getMatchesProperty(HTMLElement.prototype);
export default class Checkbox extends PureComponent {
static propTypes = {
id: PropTypes.string,
labelId: PropTypes.string,
checked: PropTypes.bool,
disabled: PropTypes.bool,
indeterminate: PropTypes.bool,
onChange: PropTypes.func
}
static defaultProps = {
checked: false,
disabled: false,