Completely updated React, fixed #11, (hopefully)
This commit is contained in:
159
goTorrentWebUI/node_modules/material-ui/Avatar/Avatar.js
generated
vendored
159
goTorrentWebUI/node_modules/material-ui/Avatar/Avatar.js
generated
vendored
@@ -17,12 +17,14 @@ var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProp
|
||||
|
||||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
||||
|
||||
var _ref;
|
||||
|
||||
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);
|
||||
@@ -31,14 +33,8 @@ var _withStyles = require('../styles/withStyles');
|
||||
|
||||
var _withStyles2 = _interopRequireDefault(_withStyles);
|
||||
|
||||
var _colorManipulator = require('../styles/colorManipulator');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Element = require('react').babelPluginFlowReactPropTypes_proptype_Element || require('prop-types').any;
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_ElementType = require('react').babelPluginFlowReactPropTypes_proptype_ElementType || require('prop-types').any;
|
||||
|
||||
var styles = exports.styles = function styles(theme) {
|
||||
return {
|
||||
root: {
|
||||
@@ -47,8 +43,8 @@ var styles = exports.styles = function styles(theme) {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: theme.spacing.unit * 5,
|
||||
height: theme.spacing.unit * 5,
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontSize: theme.typography.pxToRem(20),
|
||||
borderRadius: '50%',
|
||||
@@ -57,90 +53,30 @@ var styles = exports.styles = function styles(theme) {
|
||||
},
|
||||
colorDefault: {
|
||||
color: theme.palette.background.default,
|
||||
backgroundColor: (0, _colorManipulator.emphasize)(theme.palette.background.default, 0.26)
|
||||
backgroundColor: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
|
||||
},
|
||||
img: {
|
||||
maxWidth: '100%',
|
||||
width: '100%',
|
||||
height: 'auto'
|
||||
height: '100%',
|
||||
textAlign: 'center',
|
||||
// Handle non-square image. The property isn't supported by IE11.
|
||||
objectFit: 'cover'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
/**
|
||||
* Used in combination with `src` or `srcSet` to
|
||||
* provide an alt attribute for the rendered `img` element.
|
||||
*/
|
||||
alt: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* Used to render icon or text elements inside the Avatar.
|
||||
* `src` and `alt` props will not be used and no `img` will
|
||||
* be rendered by default.
|
||||
*
|
||||
* This can be an element, or just a string.
|
||||
*/
|
||||
children: require('prop-types').oneOfType([require('prop-types').string, typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element)]),
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
* The className of the child element.
|
||||
* Used by Chip and ListItemIcon to style the Avatar icon.
|
||||
*/
|
||||
childrenClassName: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
component: typeof babelPluginFlowReactPropTypes_proptype_ElementType === 'function' ? babelPluginFlowReactPropTypes_proptype_ElementType : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_ElementType),
|
||||
|
||||
/**
|
||||
* Properties applied to the `img` element when the component
|
||||
* is used to display an image.
|
||||
*/
|
||||
imgProps: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* The `sizes` attribute for the `img` element.
|
||||
*/
|
||||
sizes: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* The `src` attribute for the `img` element.
|
||||
*/
|
||||
src: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* The `srcSet` attribute for the `img` element.
|
||||
*/
|
||||
srcSet: require('prop-types').string
|
||||
};
|
||||
|
||||
|
||||
function Avatar(props) {
|
||||
var alt = props.alt,
|
||||
classes = props.classes,
|
||||
classNameProp = props.className,
|
||||
childrenProp = props.children,
|
||||
childrenClassNameProp = props.childrenClassName,
|
||||
ComponentProp = props.component,
|
||||
classes = props.classes,
|
||||
classNameProp = props.className,
|
||||
Component = props.component,
|
||||
imgProps = props.imgProps,
|
||||
sizes = props.sizes,
|
||||
src = props.src,
|
||||
srcSet = props.srcSet,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['alt', 'classes', 'className', 'children', 'childrenClassName', 'component', 'imgProps', 'sizes', 'src', 'srcSet']);
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['alt', 'children', 'childrenClassName', 'classes', 'className', 'component', 'imgProps', 'sizes', 'src', 'srcSet']);
|
||||
|
||||
|
||||
var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.colorDefault, childrenProp && !src && !srcSet), classNameProp);
|
||||
@@ -148,8 +84,8 @@ function Avatar(props) {
|
||||
|
||||
if (childrenProp) {
|
||||
if (childrenClassNameProp && typeof childrenProp !== 'string' && _react2.default.isValidElement(childrenProp)) {
|
||||
var _childrenClassName = (0, _classnames2.default)(childrenClassNameProp, childrenProp.props.className);
|
||||
children = _react2.default.cloneElement(childrenProp, { className: _childrenClassName });
|
||||
var childrenClassName = (0, _classnames2.default)(childrenClassNameProp, childrenProp.props.className);
|
||||
children = _react2.default.cloneElement(childrenProp, { className: childrenClassName });
|
||||
} else {
|
||||
children = childrenProp;
|
||||
}
|
||||
@@ -164,19 +100,64 @@ function Avatar(props) {
|
||||
}
|
||||
|
||||
return _react2.default.createElement(
|
||||
ComponentProp,
|
||||
Component,
|
||||
(0, _extends3.default)({ className: className }, other),
|
||||
children
|
||||
);
|
||||
}
|
||||
|
||||
Avatar.propTypes = process.env.NODE_ENV !== "production" ? (_ref = {
|
||||
classes: require('prop-types').object.isRequired,
|
||||
component: typeof babelPluginFlowReactPropTypes_proptype_ElementType === 'function' ? babelPluginFlowReactPropTypes_proptype_ElementType.isRequired ? babelPluginFlowReactPropTypes_proptype_ElementType.isRequired : babelPluginFlowReactPropTypes_proptype_ElementType : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_ElementType).isRequired,
|
||||
alt: require('prop-types').string,
|
||||
children: require('prop-types').oneOfType([require('prop-types').string, typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element)]),
|
||||
childrenClassName: require('prop-types').string
|
||||
}, (0, _defineProperty3.default)(_ref, 'classes', require('prop-types').object), (0, _defineProperty3.default)(_ref, 'className', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'component', typeof babelPluginFlowReactPropTypes_proptype_ElementType === 'function' ? babelPluginFlowReactPropTypes_proptype_ElementType : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_ElementType)), (0, _defineProperty3.default)(_ref, 'imgProps', require('prop-types').object), (0, _defineProperty3.default)(_ref, 'sizes', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'src', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'srcSet', require('prop-types').string), _ref) : {};
|
||||
Avatar.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* Used in combination with `src` or `srcSet` to
|
||||
* provide an alt attribute for the rendered `img` element.
|
||||
*/
|
||||
alt: _propTypes2.default.string,
|
||||
/**
|
||||
* Used to render icon or text elements inside the Avatar.
|
||||
* `src` and `alt` props will not be used and no `img` will
|
||||
* be rendered by default.
|
||||
*
|
||||
* This can be an element, or just a string.
|
||||
*/
|
||||
children: _propTypes2.default.node,
|
||||
/**
|
||||
* @ignore
|
||||
* The className of the child element.
|
||||
* Used by Chip and ListItemIcon to style the Avatar icon.
|
||||
*/
|
||||
childrenClassName: _propTypes2.default.string,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: _propTypes2.default.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: _propTypes2.default.string,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),
|
||||
/**
|
||||
* Properties applied to the `img` element when the component
|
||||
* is used to display an image.
|
||||
*/
|
||||
imgProps: _propTypes2.default.object,
|
||||
/**
|
||||
* The `sizes` attribute for the `img` element.
|
||||
*/
|
||||
sizes: _propTypes2.default.string,
|
||||
/**
|
||||
* The `src` attribute for the `img` element.
|
||||
*/
|
||||
src: _propTypes2.default.string,
|
||||
/**
|
||||
* The `srcSet` attribute for the `img` element.
|
||||
*/
|
||||
srcSet: _propTypes2.default.string
|
||||
} : {};
|
||||
|
||||
Avatar.defaultProps = {
|
||||
component: 'div'
|
||||
};
|
||||
|
Reference in New Issue
Block a user