Completely updated React, fixed #11, (hopefully)
This commit is contained in:
12
goTorrentWebUI/node_modules/material-ui/MobileStepper/MobileStepper.d.ts
generated
vendored
12
goTorrentWebUI/node_modules/material-ui/MobileStepper/MobileStepper.d.ts
generated
vendored
@@ -3,16 +3,13 @@ import { StandardProps } from '..';
|
||||
import { PaperProps, PaperClassKey } from '../Paper';
|
||||
import { ButtonProps } from '../Button';
|
||||
|
||||
export interface MobileStepperProps extends StandardProps<
|
||||
PaperProps,
|
||||
MobileStepperClassKey
|
||||
> {
|
||||
export interface MobileStepperProps extends StandardProps<PaperProps, MobileStepperClassKey> {
|
||||
activeStep?: number;
|
||||
backButton: React.ReactElement<any>;
|
||||
nextButton: React.ReactElement<any>;
|
||||
nextButton: React.ReactElement<any>;
|
||||
position?: 'bottom' | 'top' | 'static';
|
||||
steps: number;
|
||||
type?: 'text' | 'dots' | 'progress';
|
||||
variant?: 'text' | 'dots' | 'progress';
|
||||
}
|
||||
|
||||
export type MobileStepperClassKey =
|
||||
@@ -23,8 +20,7 @@ export type MobileStepperClassKey =
|
||||
| 'dots'
|
||||
| 'dot'
|
||||
| 'dotActive'
|
||||
| 'progress'
|
||||
;
|
||||
| 'progress';
|
||||
|
||||
declare const MobileStepper: React.ComponentType<MobileStepperProps>;
|
||||
|
||||
|
119
goTorrentWebUI/node_modules/material-ui/MobileStepper/MobileStepper.js
generated
vendored
119
goTorrentWebUI/node_modules/material-ui/MobileStepper/MobileStepper.js
generated
vendored
@@ -21,13 +21,14 @@ var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProp
|
||||
|
||||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
||||
|
||||
var _ref; // weak
|
||||
// @inheritedComponent Paper
|
||||
|
||||
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);
|
||||
@@ -46,8 +47,6 @@ var _Progress = require('../Progress');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Element = require('react').babelPluginFlowReactPropTypes_proptype_Element || require('prop-types').any;
|
||||
|
||||
var styles = exports.styles = function styles(theme) {
|
||||
return {
|
||||
root: {
|
||||
@@ -85,81 +84,33 @@ var styles = exports.styles = function styles(theme) {
|
||||
margin: '0 2px'
|
||||
},
|
||||
dotActive: {
|
||||
backgroundColor: theme.palette.primary[500]
|
||||
backgroundColor: theme.palette.primary.main
|
||||
},
|
||||
progress: {
|
||||
width: '50%'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Position = require('prop-types').oneOf(['bottom', 'top', 'static']);
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Type = require('prop-types').oneOf(['text', 'dots', 'progress']);
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
/**
|
||||
* Set the active step (zero based index).
|
||||
* Defines which dot is highlighted when the type is 'dots'.
|
||||
*/
|
||||
activeStep: require('prop-types').number,
|
||||
|
||||
/**
|
||||
* A back button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
backButton: typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element.isRequired ? babelPluginFlowReactPropTypes_proptype_Element.isRequired : babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element).isRequired,
|
||||
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* A next button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
nextButton: typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element.isRequired ? babelPluginFlowReactPropTypes_proptype_Element.isRequired : babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element).isRequired,
|
||||
|
||||
/**
|
||||
* Set the positioning type.
|
||||
*/
|
||||
position: require('prop-types').oneOf(['bottom', 'top', 'static']),
|
||||
|
||||
/**
|
||||
* The total steps.
|
||||
*/
|
||||
steps: require('prop-types').number.isRequired,
|
||||
|
||||
/**
|
||||
* The type of mobile stepper to use.
|
||||
*/
|
||||
type: require('prop-types').oneOf(['text', 'dots', 'progress'])
|
||||
};
|
||||
|
||||
}; // @inheritedComponent Paper
|
||||
|
||||
function MobileStepper(props) {
|
||||
var activeStep = props.activeStep,
|
||||
backButton = props.backButton,
|
||||
classes = props.classes,
|
||||
classNameProp = props.className,
|
||||
position = props.position,
|
||||
type = props.type,
|
||||
nextButton = props.nextButton,
|
||||
position = props.position,
|
||||
steps = props.steps,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['activeStep', 'backButton', 'classes', 'className', 'position', 'type', 'nextButton', 'steps']);
|
||||
variant = props.variant,
|
||||
other = (0, _objectWithoutProperties3.default)(props, ['activeStep', 'backButton', 'classes', 'className', 'nextButton', 'position', 'steps', 'variant']);
|
||||
|
||||
|
||||
var className = (0, _classnames2.default)(classes.root, classes['position' + (0, _helpers.capitalizeFirstLetter)(position)], classNameProp);
|
||||
var className = (0, _classnames2.default)(classes.root, classes['position' + (0, _helpers.capitalize)(position)], classNameProp);
|
||||
|
||||
return _react2.default.createElement(
|
||||
_Paper2.default,
|
||||
(0, _extends3.default)({ square: true, elevation: 0, className: className }, other),
|
||||
backButton,
|
||||
type === 'dots' && _react2.default.createElement(
|
||||
variant === 'dots' && _react2.default.createElement(
|
||||
'div',
|
||||
{ className: classes.dots },
|
||||
[].concat((0, _toConsumableArray3.default)(new Array(steps))).map(function (_, step) {
|
||||
@@ -168,25 +119,55 @@ function MobileStepper(props) {
|
||||
return _react2.default.createElement('div', { key: step, className: dotClassName });
|
||||
})
|
||||
),
|
||||
type === 'progress' && _react2.default.createElement(
|
||||
variant === 'progress' && _react2.default.createElement(
|
||||
'div',
|
||||
{ className: classes.progress },
|
||||
_react2.default.createElement(_Progress.LinearProgress, { mode: 'determinate', value: Math.ceil(activeStep / (steps - 1) * 100) })
|
||||
_react2.default.createElement(_Progress.LinearProgress, { variant: 'determinate', value: Math.ceil(activeStep / (steps - 1) * 100) })
|
||||
),
|
||||
nextButton
|
||||
);
|
||||
}
|
||||
|
||||
MobileStepper.propTypes = process.env.NODE_ENV !== "production" ? (_ref = {
|
||||
activeStep: require('prop-types').number.isRequired,
|
||||
classes: require('prop-types').object.isRequired,
|
||||
position: require('prop-types').oneOf(['bottom', 'top', 'static']).isRequired,
|
||||
type: require('prop-types').oneOf(['text', 'dots', 'progress']).isRequired
|
||||
}, (0, _defineProperty3.default)(_ref, 'activeStep', require('prop-types').number), (0, _defineProperty3.default)(_ref, 'backButton', typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element.isRequired ? babelPluginFlowReactPropTypes_proptype_Element.isRequired : babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element).isRequired), (0, _defineProperty3.default)(_ref, 'classes', require('prop-types').object), (0, _defineProperty3.default)(_ref, 'className', require('prop-types').string), (0, _defineProperty3.default)(_ref, 'nextButton', typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element.isRequired ? babelPluginFlowReactPropTypes_proptype_Element.isRequired : babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element).isRequired), (0, _defineProperty3.default)(_ref, 'position', require('prop-types').oneOf(['bottom', 'top', 'static'])), (0, _defineProperty3.default)(_ref, 'steps', require('prop-types').number.isRequired), (0, _defineProperty3.default)(_ref, 'type', require('prop-types').oneOf(['text', 'dots', 'progress'])), _ref) : {};
|
||||
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: _propTypes2.default.number,
|
||||
/**
|
||||
* A back button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
backButton: _propTypes2.default.node,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: _propTypes2.default.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: _propTypes2.default.string,
|
||||
/**
|
||||
* A next button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
nextButton: _propTypes2.default.node,
|
||||
/**
|
||||
* Set the positioning type.
|
||||
*/
|
||||
position: _propTypes2.default.oneOf(['bottom', 'top', 'static']),
|
||||
/**
|
||||
* The total steps.
|
||||
*/
|
||||
steps: _propTypes2.default.number.isRequired,
|
||||
/**
|
||||
* The type of mobile stepper to use.
|
||||
*/
|
||||
variant: _propTypes2.default.oneOf(['text', 'dots', 'progress'])
|
||||
} : {};
|
||||
|
||||
MobileStepper.defaultProps = {
|
||||
activeStep: 0,
|
||||
position: 'bottom',
|
||||
type: 'dots'
|
||||
variant: 'dots'
|
||||
};
|
||||
|
||||
exports.default = (0, _withStyles2.default)(styles, { name: 'MuiMobileStepper' })(MobileStepper);
|
107
goTorrentWebUI/node_modules/material-ui/MobileStepper/MobileStepper.js.flow
generated
vendored
107
goTorrentWebUI/node_modules/material-ui/MobileStepper/MobileStepper.js.flow
generated
vendored
@@ -1,15 +1,14 @@
|
||||
// @flow weak
|
||||
// @inheritedComponent Paper
|
||||
|
||||
import React from 'react';
|
||||
import type { Element } 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: Object) => ({
|
||||
export const styles = theme => ({
|
||||
root: {
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
@@ -45,82 +44,36 @@ export const styles = (theme: Object) => ({
|
||||
margin: '0 2px',
|
||||
},
|
||||
dotActive: {
|
||||
backgroundColor: theme.palette.primary[500],
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
},
|
||||
progress: {
|
||||
width: '50%',
|
||||
},
|
||||
});
|
||||
|
||||
export type Position = 'bottom' | 'top' | 'static';
|
||||
export type Type = 'text' | 'dots' | 'progress';
|
||||
|
||||
type ProvidedProps = {
|
||||
activeStep: number,
|
||||
classes: Object,
|
||||
position: Position,
|
||||
type: Type,
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
/**
|
||||
* Set the active step (zero based index).
|
||||
* Defines which dot is highlighted when the type is 'dots'.
|
||||
*/
|
||||
activeStep?: number,
|
||||
/**
|
||||
* A back button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
backButton: Element<any>,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes?: Object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className?: string,
|
||||
/**
|
||||
* A next button element. For instance, it can be be a `Button` or a `IconButton`.
|
||||
*/
|
||||
nextButton: Element<any>,
|
||||
/**
|
||||
* Set the positioning type.
|
||||
*/
|
||||
position?: Position,
|
||||
/**
|
||||
* The total steps.
|
||||
*/
|
||||
steps: number,
|
||||
/**
|
||||
* The type of mobile stepper to use.
|
||||
*/
|
||||
type?: Type,
|
||||
};
|
||||
|
||||
function MobileStepper(props: ProvidedProps & Props) {
|
||||
function MobileStepper(props) {
|
||||
const {
|
||||
activeStep,
|
||||
backButton,
|
||||
classes,
|
||||
className: classNameProp,
|
||||
position,
|
||||
type,
|
||||
nextButton,
|
||||
position,
|
||||
steps,
|
||||
variant,
|
||||
...other
|
||||
} = props;
|
||||
|
||||
const className = classNames(
|
||||
classes.root,
|
||||
classes[`position${capitalizeFirstLetter(position)}`],
|
||||
classes[`position${capitalize(position)}`],
|
||||
classNameProp,
|
||||
);
|
||||
|
||||
return (
|
||||
<Paper square elevation={0} className={className} {...other}>
|
||||
{backButton}
|
||||
{type === 'dots' && (
|
||||
{variant === 'dots' && (
|
||||
<div className={classes.dots}>
|
||||
{[...new Array(steps)].map((_, step) => {
|
||||
const dotClassName = classNames(
|
||||
@@ -134,9 +87,9 @@ function MobileStepper(props: ProvidedProps & Props) {
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{type === 'progress' && (
|
||||
{variant === 'progress' && (
|
||||
<div className={classes.progress}>
|
||||
<LinearProgress mode="determinate" value={Math.ceil(activeStep / (steps - 1) * 100)} />
|
||||
<LinearProgress variant="determinate" value={Math.ceil(activeStep / (steps - 1) * 100)} />
|
||||
</div>
|
||||
)}
|
||||
{nextButton}
|
||||
@@ -144,10 +97,46 @@ function MobileStepper(props: ProvidedProps & Props) {
|
||||
);
|
||||
}
|
||||
|
||||
MobileStepper.propTypes = {
|
||||
/**
|
||||
* 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);
|
||||
|
2
goTorrentWebUI/node_modules/material-ui/MobileStepper/index.js.flow
generated
vendored
2
goTorrentWebUI/node_modules/material-ui/MobileStepper/index.js.flow
generated
vendored
@@ -1,3 +1 @@
|
||||
// @flow
|
||||
|
||||
export { default } from './MobileStepper';
|
||||
|
Reference in New Issue
Block a user