Completely updated React, fixed #11, (hopefully)
This commit is contained in:
60
goTorrentWebUI/node_modules/material-ui/es/Divider/Divider.js
generated
vendored
60
goTorrentWebUI/node_modules/material-ui/es/Divider/Divider.js
generated
vendored
@@ -1,10 +1,10 @@
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
||||
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import withStyles from '../styles/withStyles';
|
||||
import { fade } from '../styles/colorManipulator';
|
||||
|
||||
export const styles = theme => ({
|
||||
root: {
|
||||
@@ -13,14 +13,14 @@ export const styles = theme => ({
|
||||
border: 'none',
|
||||
flexShrink: 0
|
||||
},
|
||||
default: {
|
||||
backgroundColor: theme.palette.text.divider
|
||||
},
|
||||
inset: {
|
||||
marginLeft: 72
|
||||
},
|
||||
default: {
|
||||
backgroundColor: theme.palette.divider
|
||||
},
|
||||
light: {
|
||||
backgroundColor: theme.palette.text.lightDivider
|
||||
backgroundColor: fade(theme.palette.divider, 0.08)
|
||||
},
|
||||
absolute: {
|
||||
position: 'absolute',
|
||||
@@ -31,20 +31,52 @@ export const styles = theme => ({
|
||||
});
|
||||
|
||||
function Divider(props) {
|
||||
const { absolute, classes, className: classNameProp, inset, light } = props,
|
||||
other = _objectWithoutProperties(props, ['absolute', 'classes', 'className', 'inset', 'light']);
|
||||
const {
|
||||
absolute,
|
||||
classes,
|
||||
className: classNameProp,
|
||||
component: Component,
|
||||
inset,
|
||||
light
|
||||
} = props,
|
||||
other = _objectWithoutProperties(props, ['absolute', 'classes', 'className', 'component', 'inset', 'light']);
|
||||
|
||||
const className = classNames(classes.root, {
|
||||
[classes.absolute]: absolute,
|
||||
[classes.inset]: inset,
|
||||
[light ? classes.light : classes.default]: true
|
||||
}, classNameProp);
|
||||
[classes.inset]: inset
|
||||
}, light ? classes.light : classes.default, classNameProp);
|
||||
|
||||
return React.createElement('hr', _extends({ className: className }, other));
|
||||
return React.createElement(Component, _extends({ className: className }, other));
|
||||
}
|
||||
|
||||
Divider.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
absolute: PropTypes.bool,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
component: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
||||
/**
|
||||
* If `true`, the divider will be indented.
|
||||
*/
|
||||
inset: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the divider will have a lighter color.
|
||||
*/
|
||||
light: PropTypes.bool
|
||||
} : {};
|
||||
|
||||
Divider.defaultProps = {
|
||||
absolute: false,
|
||||
component: 'hr',
|
||||
inset: false,
|
||||
light: false
|
||||
};
|
||||
|
Reference in New Issue
Block a user