Completely updated React, fixed #11, (hopefully)
This commit is contained in:
67
goTorrentWebUI/node_modules/material-ui/es/MobileStepper/MobileStepper.js
generated
vendored
67
goTorrentWebUI/node_modules/material-ui/es/MobileStepper/MobileStepper.js
generated
vendored
@@ -1,16 +1,13 @@
|
||||
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; }
|
||||
|
||||
// weak
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
||||
// @inheritedComponent Paper
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import withStyles from '../styles/withStyles';
|
||||
import Paper from '../Paper';
|
||||
import { capitalizeFirstLetter } from '../utils/helpers';
|
||||
import { capitalize } from '../utils/helpers';
|
||||
import { LinearProgress } from '../Progress';
|
||||
|
||||
export const styles = theme => ({
|
||||
@@ -49,7 +46,7 @@ export const styles = theme => ({
|
||||
margin: '0 2px'
|
||||
},
|
||||
dotActive: {
|
||||
backgroundColor: theme.palette.primary[500]
|
||||
backgroundColor: theme.palette.primary.main
|
||||
},
|
||||
progress: {
|
||||
width: '50%'
|
||||
@@ -62,20 +59,20 @@ function MobileStepper(props) {
|
||||
backButton,
|
||||
classes,
|
||||
className: classNameProp,
|
||||
position,
|
||||
type,
|
||||
nextButton,
|
||||
steps
|
||||
position,
|
||||
steps,
|
||||
variant
|
||||
} = props,
|
||||
other = _objectWithoutProperties(props, ['activeStep', 'backButton', 'classes', 'className', 'position', 'type', 'nextButton', 'steps']);
|
||||
other = _objectWithoutProperties(props, ['activeStep', 'backButton', 'classes', 'className', 'nextButton', 'position', 'steps', 'variant']);
|
||||
|
||||
const className = classNames(classes.root, classes[`position${capitalizeFirstLetter(position)}`], classNameProp);
|
||||
const className = classNames(classes.root, classes[`position${capitalize(position)}`], classNameProp);
|
||||
|
||||
return React.createElement(
|
||||
Paper,
|
||||
_extends({ square: true, elevation: 0, className: className }, other),
|
||||
backButton,
|
||||
type === 'dots' && React.createElement(
|
||||
variant === 'dots' && React.createElement(
|
||||
'div',
|
||||
{ className: classes.dots },
|
||||
[...new Array(steps)].map((_, step) => {
|
||||
@@ -86,19 +83,55 @@ function MobileStepper(props) {
|
||||
return React.createElement('div', { key: step, className: dotClassName });
|
||||
})
|
||||
),
|
||||
type === 'progress' && React.createElement(
|
||||
variant === 'progress' && React.createElement(
|
||||
'div',
|
||||
{ className: classes.progress },
|
||||
React.createElement(LinearProgress, { mode: 'determinate', value: Math.ceil(activeStep / (steps - 1) * 100) })
|
||||
React.createElement(LinearProgress, { variant: 'determinate', value: Math.ceil(activeStep / (steps - 1) * 100) })
|
||||
),
|
||||
nextButton
|
||||
);
|
||||
}
|
||||
|
||||
MobileStepper.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* Set the active step (zero based index).
|
||||
* Defines which dot is highlighted when the variant is 'dots'.
|
||||
*/
|
||||
activeStep: PropTypes.number,
|
||||
/**
|
||||
* A back button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
backButton: PropTypes.node,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* A next button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
nextButton: PropTypes.node,
|
||||
/**
|
||||
* Set the positioning type.
|
||||
*/
|
||||
position: PropTypes.oneOf(['bottom', 'top', 'static']),
|
||||
/**
|
||||
* The total steps.
|
||||
*/
|
||||
steps: PropTypes.number.isRequired,
|
||||
/**
|
||||
* The type of mobile stepper to use.
|
||||
*/
|
||||
variant: PropTypes.oneOf(['text', 'dots', 'progress'])
|
||||
} : {};
|
||||
|
||||
MobileStepper.defaultProps = {
|
||||
activeStep: 0,
|
||||
position: 'bottom',
|
||||
type: 'dots'
|
||||
variant: 'dots'
|
||||
};
|
||||
|
||||
export default withStyles(styles, { name: 'MuiMobileStepper' })(MobileStepper);
|
Reference in New Issue
Block a user