Completely updated React, fixed #11, (hopefully)
This commit is contained in:
156
goTorrentWebUI/node_modules/material-ui/Checkbox/Checkbox.js
generated
vendored
156
goTorrentWebUI/node_modules/material-ui/Checkbox/Checkbox.js
generated
vendored
@@ -5,47 +5,55 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.styles = undefined;
|
||||
|
||||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
||||
|
||||
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
||||
|
||||
var _extends2 = require('babel-runtime/helpers/extends');
|
||||
|
||||
var _extends3 = _interopRequireDefault(_extends2);
|
||||
|
||||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
||||
|
||||
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
||||
|
||||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
||||
|
||||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
||||
|
||||
var _ref;
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _withStyles = require('../styles/withStyles');
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _withStyles2 = _interopRequireDefault(_withStyles);
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _classnames = require('classnames');
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var _SwitchBase = require('../internal/SwitchBase');
|
||||
|
||||
var _SwitchBase2 = _interopRequireDefault(_SwitchBase);
|
||||
|
||||
var _IndeterminateCheckBox = require('../svg-icons/IndeterminateCheckBox');
|
||||
var _IndeterminateCheckBox = require('../internal/svg-icons/IndeterminateCheckBox');
|
||||
|
||||
var _IndeterminateCheckBox2 = _interopRequireDefault(_IndeterminateCheckBox);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
var _withStyles = require('../styles/withStyles');
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Node = require('react').babelPluginFlowReactPropTypes_proptype_Node || require('prop-types').any;
|
||||
var _withStyles2 = _interopRequireDefault(_withStyles);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var styles = exports.styles = function styles(theme) {
|
||||
return {
|
||||
default: {
|
||||
color: theme.palette.text.secondary
|
||||
},
|
||||
checked: {
|
||||
color: theme.palette.primary[500]
|
||||
checked: {},
|
||||
checkedPrimary: {
|
||||
color: theme.palette.primary.main
|
||||
},
|
||||
checkedSecondary: {
|
||||
color: theme.palette.secondary.main
|
||||
},
|
||||
disabled: {
|
||||
color: theme.palette.action.disabled
|
||||
@@ -53,128 +61,98 @@ var styles = exports.styles = function styles(theme) {
|
||||
};
|
||||
};
|
||||
|
||||
var SwitchBase = (0, _SwitchBase2.default)();
|
||||
function Checkbox(props) {
|
||||
var _classNames;
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
var checkedIcon = props.checkedIcon,
|
||||
classes = props.classes,
|
||||
color = props.color,
|
||||
icon = props.icon,
|
||||
indeterminate = props.indeterminate,
|
||||
indeterminateIcon = props.indeterminateIcon,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['checkedIcon', 'classes', 'color', 'icon', 'indeterminate', 'indeterminateIcon']);
|
||||
|
||||
var checkedClass = (0, _classnames2.default)(classes.checked, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.checkedPrimary, color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.checkedSecondary, color === 'secondary'), _classNames));
|
||||
|
||||
return _react2.default.createElement(_SwitchBase2.default, (0, _extends3.default)({
|
||||
checkedIcon: indeterminate ? indeterminateIcon : checkedIcon,
|
||||
classes: {
|
||||
default: classes.default,
|
||||
checked: checkedClass,
|
||||
disabled: classes.disabled
|
||||
},
|
||||
icon: indeterminate ? indeterminateIcon : icon
|
||||
}, other));
|
||||
}
|
||||
|
||||
Checkbox.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* If `true`, the component is checked.
|
||||
*/
|
||||
checked: require('prop-types').oneOfType([require('prop-types').bool, require('prop-types').string]),
|
||||
|
||||
/**
|
||||
* The CSS class name of the root element when checked.
|
||||
*/
|
||||
checkedClassName: require('prop-types').string,
|
||||
|
||||
checked: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.string]),
|
||||
/**
|
||||
* The icon to display when the component is checked.
|
||||
* If a string is provided, it will be used as a font ligature.
|
||||
*/
|
||||
checkedIcon: typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node),
|
||||
|
||||
checkedIcon: _propTypes2.default.node,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
classes: _propTypes2.default.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
* The color of the component. It supports those theme colors that make sense for this component.
|
||||
*/
|
||||
className: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
defaultChecked: require('prop-types').bool,
|
||||
|
||||
color: _propTypes2.default.oneOf(['primary', 'secondary']),
|
||||
/**
|
||||
* If `true`, the switch will be disabled.
|
||||
*/
|
||||
disabled: require('prop-types').bool,
|
||||
|
||||
/**
|
||||
* The CSS class name of the root element when disabled.
|
||||
*/
|
||||
disabledClassName: require('prop-types').string,
|
||||
|
||||
disabled: _propTypes2.default.bool,
|
||||
/**
|
||||
* If `true`, the ripple effect will be disabled.
|
||||
*/
|
||||
disableRipple: require('prop-types').bool,
|
||||
|
||||
disableRipple: _propTypes2.default.bool,
|
||||
/**
|
||||
* The icon to display when the component is unchecked.
|
||||
* If a string is provided, it will be used as a font ligature.
|
||||
*/
|
||||
icon: typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node),
|
||||
|
||||
icon: _propTypes2.default.node,
|
||||
/**
|
||||
* The id of the `input` element.
|
||||
*/
|
||||
id: _propTypes2.default.string,
|
||||
/**
|
||||
* If `true`, the component appears indeterminate.
|
||||
*/
|
||||
indeterminate: require('prop-types').bool,
|
||||
|
||||
indeterminate: _propTypes2.default.bool,
|
||||
/**
|
||||
* The icon to display when the component is indeterminate.
|
||||
* If a string is provided, it will be used as a font ligature.
|
||||
*/
|
||||
indeterminateIcon: typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node),
|
||||
|
||||
indeterminateIcon: _propTypes2.default.node,
|
||||
/**
|
||||
* Properties applied to the `input` element.
|
||||
*/
|
||||
inputProps: require('prop-types').object,
|
||||
|
||||
inputProps: _propTypes2.default.object,
|
||||
/**
|
||||
* Use that property to pass a ref callback to the native input component.
|
||||
*/
|
||||
inputRef: require('prop-types').func,
|
||||
|
||||
/*
|
||||
* @ignore
|
||||
*/
|
||||
name: require('prop-types').string,
|
||||
|
||||
inputRef: _propTypes2.default.func,
|
||||
/**
|
||||
* Callback fired when the state is changed.
|
||||
*
|
||||
* @param {object} event The event source of the callback
|
||||
* @param {boolean} checked The `checked` value of the switch
|
||||
*/
|
||||
onChange: require('prop-types').func,
|
||||
|
||||
onChange: _propTypes2.default.func,
|
||||
/**
|
||||
* @ignore
|
||||
* The input component property `type`.
|
||||
*/
|
||||
tabIndex: require('prop-types').oneOfType([require('prop-types').number, require('prop-types').string]),
|
||||
|
||||
type: _propTypes2.default.string,
|
||||
/**
|
||||
* The value of the component.
|
||||
*/
|
||||
value: require('prop-types').string
|
||||
};
|
||||
value: _propTypes2.default.string
|
||||
} : {};
|
||||
|
||||
|
||||
function Checkbox(props) {
|
||||
var checkedIcon = props.checkedIcon,
|
||||
icon = props.icon,
|
||||
indeterminate = props.indeterminate,
|
||||
indeterminateIcon = props.indeterminateIcon,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['checkedIcon', 'icon', 'indeterminate', 'indeterminateIcon']);
|
||||
|
||||
|
||||
return _react2.default.createElement(SwitchBase, (0, _extends3.default)({
|
||||
checkedIcon: indeterminate ? indeterminateIcon : checkedIcon,
|
||||
icon: indeterminate ? indeterminateIcon : icon
|
||||
}, other));
|
||||
}
|
||||
|
||||
Checkbox.propTypes = process.env.NODE_ENV !== "production" ? (_ref = {
|
||||
classes: require('prop-types').object.isRequired,
|
||||
checked: require('prop-types').oneOfType([require('prop-types').bool, require('prop-types').string]),
|
||||
checkedClassName: require('prop-types').string,
|
||||
checkedIcon: typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node)
|
||||
}, (0, _defineProperty3.default)(_ref, 'classes', require('prop-types').object), (0, _defineProperty3.default)(_ref, 'className', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'defaultChecked', require('prop-types').bool), (0, _defineProperty3.default)(_ref, 'disabled', require('prop-types').bool), (0, _defineProperty3.default)(_ref, 'disabledClassName', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'disableRipple', require('prop-types').bool), (0, _defineProperty3.default)(_ref, 'icon', typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node)), (0, _defineProperty3.default)(_ref, 'indeterminate', require('prop-types').bool), (0, _defineProperty3.default)(_ref, 'indeterminateIcon', typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node)), (0, _defineProperty3.default)(_ref, 'inputProps', require('prop-types').object), (0, _defineProperty3.default)(_ref, 'inputRef', require('prop-types').func), (0, _defineProperty3.default)(_ref, 'name', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'onChange', require('prop-types').func), (0, _defineProperty3.default)(_ref, 'tabIndex', require('prop-types').oneOfType([require('prop-types').number, require('prop-types').string])), (0, _defineProperty3.default)(_ref, 'value', require('prop-types').string), _ref) : {};
|
||||
Checkbox.defaultProps = {
|
||||
color: 'secondary',
|
||||
indeterminate: false,
|
||||
indeterminateIcon: _react2.default.createElement(_IndeterminateCheckBox2.default, null)
|
||||
};
|
||||
|
Reference in New Issue
Block a user