Completely updated React, fixed #11, (hopefully)
This commit is contained in:
142
goTorrentWebUI/node_modules/material-ui/Progress/LinearProgress.js
generated
vendored
142
goTorrentWebUI/node_modules/material-ui/Progress/LinearProgress.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);
|
||||
@@ -35,6 +37,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 TRANSITION_DURATION = 4; // 400ms
|
||||
@@ -47,24 +51,24 @@ var styles = exports.styles = function styles(theme) {
|
||||
height: 5
|
||||
},
|
||||
primaryColor: {
|
||||
backgroundColor: theme.palette.primary[100]
|
||||
backgroundColor: (0, _colorManipulator.lighten)(theme.palette.primary.light, 0.6)
|
||||
},
|
||||
primaryColorBar: {
|
||||
backgroundColor: theme.palette.primary[500]
|
||||
backgroundColor: theme.palette.primary.main
|
||||
},
|
||||
primaryDashed: {
|
||||
background: 'radial-gradient(' + theme.palette.primary[100] + ' 0%, ' + theme.palette.primary[100] + ' 16%, transparent 42%)',
|
||||
background: 'radial-gradient(' + (0, _colorManipulator.lighten)(theme.palette.primary.light, 0.6) + ' 0%, ' + (0, _colorManipulator.lighten)(theme.palette.primary.light, 0.6) + ' 16%, transparent 42%)',
|
||||
backgroundSize: '10px 10px',
|
||||
backgroundPosition: '0px -23px'
|
||||
},
|
||||
accentColor: {
|
||||
backgroundColor: theme.palette.secondary.A100
|
||||
secondaryColor: {
|
||||
backgroundColor: (0, _colorManipulator.lighten)(theme.palette.secondary.light, 0.4)
|
||||
},
|
||||
accentColorBar: {
|
||||
backgroundColor: theme.palette.secondary.A400
|
||||
secondaryColorBar: {
|
||||
backgroundColor: theme.palette.secondary.main
|
||||
},
|
||||
accentDashed: {
|
||||
background: 'radial-gradient(' + theme.palette.secondary.A100 + ' 0%, ' + theme.palette.secondary.A100 + ' 16%, transparent 42%)',
|
||||
secondaryDashed: {
|
||||
background: 'radial-gradient(' + (0, _colorManipulator.lighten)(theme.palette.secondary.light, 0.4) + ' 0%, ' + (0, _colorManipulator.lighten)(theme.palette.secondary.light, 0.6) + ' 16%, transparent 42%)',
|
||||
backgroundSize: '10px 10px',
|
||||
backgroundPosition: '0px -23px'
|
||||
},
|
||||
@@ -112,14 +116,6 @@ var styles = exports.styles = function styles(theme) {
|
||||
zIndex: 1,
|
||||
transition: 'transform .' + TRANSITION_DURATION + 's linear'
|
||||
},
|
||||
bufferBar2Primary: {
|
||||
transition: 'transform .' + TRANSITION_DURATION + 's linear',
|
||||
backgroundColor: theme.palette.primary[100]
|
||||
},
|
||||
bufferBar2Accent: {
|
||||
transition: 'transform .' + TRANSITION_DURATION + 's linear',
|
||||
backgroundColor: theme.palette.secondary.A100
|
||||
},
|
||||
// Legends:
|
||||
// || represents the viewport
|
||||
// - represents a light background
|
||||
@@ -173,93 +169,91 @@ var styles = exports.styles = function styles(theme) {
|
||||
};
|
||||
};
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
/**
|
||||
* 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(['primary', 'accent']),
|
||||
|
||||
/**
|
||||
* The mode of show your progress, indeterminate
|
||||
* for when there is no value for progress.
|
||||
*/
|
||||
mode: require('prop-types').oneOf(['determinate', 'indeterminate', 'buffer', 'query']),
|
||||
|
||||
/**
|
||||
* The value of progress, only works in determinate and buffer mode.
|
||||
* Value between 0 and 100.
|
||||
*/
|
||||
value: require('prop-types').number,
|
||||
|
||||
/**
|
||||
* The value of buffer, only works in buffer mode.
|
||||
* Value between 0 and 100.
|
||||
*/
|
||||
valueBuffer: require('prop-types').number
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* ## ARIA
|
||||
*
|
||||
* If the progress bar is describing the loading progress of a particular region of a page,
|
||||
* you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`
|
||||
* attribute to `true` on that region until it has finished loading.
|
||||
*/
|
||||
function LinearProgress(props) {
|
||||
var _classNames, _classNames2, _classNames3, _classNames4;
|
||||
|
||||
var classes = props.classes,
|
||||
className = props.className,
|
||||
color = props.color,
|
||||
mode = props.mode,
|
||||
value = props.value,
|
||||
valueBuffer = props.valueBuffer,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'color', 'mode', 'value', 'valueBuffer']);
|
||||
variant = props.variant,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'color', 'value', 'valueBuffer', 'variant']);
|
||||
|
||||
|
||||
var dashedClass = (0, _classnames2.default)(classes.dashed, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.primaryDashed, color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.accentDashed, color === 'accent'), _classNames));
|
||||
var dashedClass = (0, _classnames2.default)(classes.dashed, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.primaryDashed, color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.secondaryDashed, color === 'secondary'), _classNames));
|
||||
|
||||
var rootClassName = (0, _classnames2.default)(classes.root, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.primaryColor, color === 'primary'), (0, _defineProperty3.default)(_classNames2, classes.accentColor, color === 'accent'), (0, _defineProperty3.default)(_classNames2, classes.rootBuffer, mode === 'buffer'), (0, _defineProperty3.default)(_classNames2, classes.rootQuery, mode === 'query'), _classNames2), className);
|
||||
var primaryClassName = (0, _classnames2.default)(classes.bar, (_classNames3 = {}, (0, _defineProperty3.default)(_classNames3, classes.primaryColorBar, color === 'primary'), (0, _defineProperty3.default)(_classNames3, classes.accentColorBar, color === 'accent'), (0, _defineProperty3.default)(_classNames3, classes.indeterminateBar1, mode === 'indeterminate' || mode === 'query'), (0, _defineProperty3.default)(_classNames3, classes.determinateBar1, mode === 'determinate'), (0, _defineProperty3.default)(_classNames3, classes.bufferBar1, mode === 'buffer'), _classNames3));
|
||||
var secondaryClassName = (0, _classnames2.default)(classes.bar, (_classNames4 = {}, (0, _defineProperty3.default)(_classNames4, classes.bufferBar2, mode === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.primaryColorBar, color === 'primary' && mode !== 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.primaryColor, color === 'primary' && mode === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.accentColorBar, color === 'accent' && mode !== 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.accentColor, color === 'accent' && mode === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.indeterminateBar2, mode === 'indeterminate' || mode === 'query'), _classNames4));
|
||||
var rootClassName = (0, _classnames2.default)(classes.root, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.primaryColor, color === 'primary'), (0, _defineProperty3.default)(_classNames2, classes.secondaryColor, color === 'secondary'), (0, _defineProperty3.default)(_classNames2, classes.rootBuffer, variant === 'buffer'), (0, _defineProperty3.default)(_classNames2, classes.rootQuery, variant === 'query'), _classNames2), className);
|
||||
var primaryClassName = (0, _classnames2.default)(classes.bar, (_classNames3 = {}, (0, _defineProperty3.default)(_classNames3, classes.primaryColorBar, color === 'primary'), (0, _defineProperty3.default)(_classNames3, classes.secondaryColorBar, color === 'secondary'), (0, _defineProperty3.default)(_classNames3, classes.indeterminateBar1, variant === 'indeterminate' || variant === 'query'), (0, _defineProperty3.default)(_classNames3, classes.determinateBar1, variant === 'determinate'), (0, _defineProperty3.default)(_classNames3, classes.bufferBar1, variant === 'buffer'), _classNames3));
|
||||
var secondaryClassName = (0, _classnames2.default)(classes.bar, (_classNames4 = {}, (0, _defineProperty3.default)(_classNames4, classes.bufferBar2, variant === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.primaryColorBar, color === 'primary' && variant !== 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.primaryColor, color === 'primary' && variant === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.secondaryColorBar, color === 'secondary' && variant !== 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.secondaryColor, color === 'secondary' && variant === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.indeterminateBar2, variant === 'indeterminate' || variant === 'query'), _classNames4));
|
||||
var inlineStyles = { primary: {}, secondary: {} };
|
||||
var rootProps = {};
|
||||
|
||||
if (mode === 'determinate') {
|
||||
if (variant === 'determinate' || variant === 'buffer') {
|
||||
if (value !== undefined) {
|
||||
inlineStyles.primary.transform = 'scaleX(' + value / 100 + ')';
|
||||
rootProps['aria-valuenow'] = Math.round(value);
|
||||
} else {
|
||||
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: you need to provide a value property ' + 'when LinearProgress is in determinate mode.') : void 0;
|
||||
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: you need to provide a value property ' + 'when using the determinate or buffer variant of LinearProgress .') : void 0;
|
||||
}
|
||||
} else if (mode === 'buffer') {
|
||||
if (value !== undefined) {
|
||||
inlineStyles.primary.transform = 'scaleX(' + value / 100 + ')';
|
||||
}
|
||||
if (variant === 'buffer') {
|
||||
if (valueBuffer !== undefined) {
|
||||
inlineStyles.secondary.transform = 'scaleX(' + (valueBuffer || 0) / 100 + ')';
|
||||
} else {
|
||||
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: you need to provide a value property when LinearProgress is in buffer mode.') : void 0;
|
||||
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: you need to provide a valueBuffer property ' + 'when using the buffer variant of LinearProgress.') : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
return _react2.default.createElement(
|
||||
'div',
|
||||
(0, _extends3.default)({ className: rootClassName }, rootProps, other),
|
||||
mode === 'buffer' ? _react2.default.createElement('div', { className: dashedClass }) : null,
|
||||
(0, _extends3.default)({ className: rootClassName, role: 'progressbar' }, rootProps, other),
|
||||
variant === 'buffer' ? _react2.default.createElement('div', { className: dashedClass }) : null,
|
||||
_react2.default.createElement('div', { className: primaryClassName, style: inlineStyles.primary }),
|
||||
mode === 'determinate' ? null : _react2.default.createElement('div', { className: secondaryClassName, style: inlineStyles.secondary })
|
||||
variant === 'determinate' ? null : _react2.default.createElement('div', { className: secondaryClassName, style: inlineStyles.secondary })
|
||||
);
|
||||
}
|
||||
|
||||
LinearProgress.propTypes = process.env.NODE_ENV !== "production" ? (_ref = {
|
||||
classes: require('prop-types').object.isRequired
|
||||
}, (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(['primary', 'accent'])), (0, _defineProperty3.default)(_ref, 'mode', require('prop-types').oneOf(['determinate', 'indeterminate', 'buffer', 'query'])), (0, _defineProperty3.default)(_ref, 'value', require('prop-types').number), (0, _defineProperty3.default)(_ref, 'valueBuffer', require('prop-types').number), _ref) : {};
|
||||
LinearProgress.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* 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(['primary', 'secondary']),
|
||||
/**
|
||||
* The value of the progress indicator for the determinate and buffer variants.
|
||||
* Value between 0 and 100.
|
||||
*/
|
||||
value: _propTypes2.default.number,
|
||||
/**
|
||||
* The value for the buffer variant.
|
||||
* Value between 0 and 100.
|
||||
*/
|
||||
valueBuffer: _propTypes2.default.number,
|
||||
/**
|
||||
* The variant of progress indicator. Use indeterminate or query
|
||||
* when there is no progress value.
|
||||
*/
|
||||
variant: _propTypes2.default.oneOf(['determinate', 'indeterminate', 'buffer', 'query'])
|
||||
} : {};
|
||||
|
||||
LinearProgress.defaultProps = {
|
||||
color: 'primary',
|
||||
mode: 'indeterminate'
|
||||
variant: 'indeterminate'
|
||||
};
|
||||
|
||||
exports.default = (0, _withStyles2.default)(styles, { name: 'MuiLinearProgress' })(LinearProgress);
|
Reference in New Issue
Block a user