Completely updated React, fixed #11, (hopefully)
This commit is contained in:
140
goTorrentWebUI/node_modules/material-ui/IconButton/IconButton.js
generated
vendored
140
goTorrentWebUI/node_modules/material-ui/IconButton/IconButton.js
generated
vendored
@@ -17,13 +17,14 @@ var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProp
|
||||
|
||||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
||||
|
||||
var _ref; // weak
|
||||
// @inheritedComponent ButtonBase
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _classnames = require('classnames');
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
@@ -38,18 +39,15 @@ var _ButtonBase2 = _interopRequireDefault(_ButtonBase);
|
||||
|
||||
var _helpers = require('../utils/helpers');
|
||||
|
||||
var _Icon = require('../Icon');
|
||||
|
||||
var _Icon2 = _interopRequireDefault(_Icon);
|
||||
var _reactHelpers = require('../utils/reactHelpers');
|
||||
|
||||
require('../SvgIcon');
|
||||
|
||||
var _reactHelpers = require('../utils/reactHelpers');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Node = require('react').babelPluginFlowReactPropTypes_proptype_Node || require('prop-types').any; // Ensure CSS specificity
|
||||
// Ensure CSS specificity
|
||||
|
||||
// @inheritedComponent ButtonBase
|
||||
|
||||
var styles = exports.styles = function styles(theme) {
|
||||
return {
|
||||
@@ -66,18 +64,15 @@ var styles = exports.styles = function styles(theme) {
|
||||
duration: theme.transitions.duration.shortest
|
||||
})
|
||||
},
|
||||
colorAccent: {
|
||||
color: theme.palette.secondary.A200
|
||||
},
|
||||
colorContrast: {
|
||||
color: theme.palette.getContrastText(theme.palette.primary[500])
|
||||
},
|
||||
colorPrimary: {
|
||||
color: theme.palette.primary[500]
|
||||
},
|
||||
colorInherit: {
|
||||
color: 'inherit'
|
||||
},
|
||||
colorPrimary: {
|
||||
color: theme.palette.primary.main
|
||||
},
|
||||
colorSecondary: {
|
||||
color: theme.palette.secondary.main
|
||||
},
|
||||
disabled: {
|
||||
color: theme.palette.action.disabled
|
||||
},
|
||||
@@ -86,61 +81,10 @@ var styles = exports.styles = function styles(theme) {
|
||||
display: 'flex',
|
||||
alignItems: 'inherit',
|
||||
justifyContent: 'inherit'
|
||||
},
|
||||
icon: {
|
||||
width: '1em',
|
||||
height: '1em'
|
||||
},
|
||||
keyboardFocused: {
|
||||
backgroundColor: theme.palette.text.divider
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
/**
|
||||
* Use that property to pass a ref callback to the native button component.
|
||||
*/
|
||||
buttonRef: require('prop-types').func,
|
||||
|
||||
/**
|
||||
* The icon element.
|
||||
* If a string is provided, it will be used as an icon font ligature.
|
||||
*/
|
||||
children: typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node),
|
||||
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* The color of the component. It's using the theme palette when that makes sense.
|
||||
*/
|
||||
color: require('prop-types').oneOf(['default', 'inherit', 'primary', 'contrast', 'accent']),
|
||||
|
||||
/**
|
||||
* If `true`, the button will be disabled.
|
||||
*/
|
||||
disabled: require('prop-types').bool,
|
||||
|
||||
/**
|
||||
* If `true`, the ripple will be disabled.
|
||||
*/
|
||||
disableRipple: require('prop-types').bool,
|
||||
|
||||
/**
|
||||
* Use that property to pass a ref callback to the root component.
|
||||
*/
|
||||
rootRef: require('prop-types').func
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Refer to the [Icons](/style/icons) section of the documentation
|
||||
* regarding the available icon options.
|
||||
@@ -148,52 +92,62 @@ var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
function IconButton(props) {
|
||||
var _classNames;
|
||||
|
||||
var buttonRef = props.buttonRef,
|
||||
children = props.children,
|
||||
var children = props.children,
|
||||
classes = props.classes,
|
||||
className = props.className,
|
||||
color = props.color,
|
||||
disabled = props.disabled,
|
||||
rootRef = props.rootRef,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['buttonRef', 'children', 'classes', 'className', 'color', 'disabled', 'rootRef']);
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'color', 'disabled']);
|
||||
|
||||
|
||||
return _react2.default.createElement(
|
||||
_ButtonBase2.default,
|
||||
(0, _extends3.default)({
|
||||
className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalizeFirstLetter)(color)], color !== 'default'), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), _classNames), className),
|
||||
className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'default'), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), _classNames), className),
|
||||
centerRipple: true,
|
||||
keyboardFocusedClassName: classes.keyboardFocused,
|
||||
focusRipple: true,
|
||||
disabled: disabled
|
||||
}, other, {
|
||||
rootRef: buttonRef,
|
||||
ref: rootRef
|
||||
}),
|
||||
}, other),
|
||||
_react2.default.createElement(
|
||||
'span',
|
||||
{ className: classes.label },
|
||||
typeof children === 'string' ? _react2.default.createElement(
|
||||
_Icon2.default,
|
||||
{ className: classes.icon },
|
||||
children
|
||||
) : _react2.default.Children.map(children, function (child) {
|
||||
_react2.default.Children.map(children, function (child) {
|
||||
if ((0, _reactHelpers.isMuiElement)(child, ['Icon', 'SvgIcon'])) {
|
||||
return _react2.default.cloneElement(child, {
|
||||
className: (0, _classnames2.default)(classes.icon, child.props.className)
|
||||
});
|
||||
return _react2.default.cloneElement(child, { fontSize: true });
|
||||
}
|
||||
|
||||
return child;
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
IconButton.propTypes = process.env.NODE_ENV !== "production" ? (_ref = {
|
||||
classes: require('prop-types').object.isRequired,
|
||||
buttonRef: require('prop-types').func,
|
||||
children: 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, 'color', require('prop-types').oneOf(['default', 'inherit', 'primary', 'contrast', 'accent'])), (0, _defineProperty3.default)(_ref, 'disabled', require('prop-types').bool), (0, _defineProperty3.default)(_ref, 'disableRipple', require('prop-types').bool), (0, _defineProperty3.default)(_ref, 'rootRef', require('prop-types').func), _ref) : {};
|
||||
IconButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* The icon element.
|
||||
*/
|
||||
children: _propTypes2.default.node,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: _propTypes2.default.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: _propTypes2.default.string,
|
||||
/**
|
||||
* The color of the component. It supports those theme colors that make sense for this component.
|
||||
*/
|
||||
color: _propTypes2.default.oneOf(['default', 'inherit', 'primary', 'secondary']),
|
||||
/**
|
||||
* If `true`, the button will be disabled.
|
||||
*/
|
||||
disabled: _propTypes2.default.bool,
|
||||
/**
|
||||
* If `true`, the ripple will be disabled.
|
||||
*/
|
||||
disableRipple: _propTypes2.default.bool
|
||||
} : {};
|
||||
|
||||
IconButton.defaultProps = {
|
||||
color: 'default',
|
||||
disabled: false,
|
||||
|
Reference in New Issue
Block a user