Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,31 @@
import * as React from 'react';
import { StandardProps } from '..';
import { PaperProps, PaperClassKey } from '../Paper';
import { ButtonProps } from '../Button';
export interface MobileStepperProps extends StandardProps<
PaperProps,
MobileStepperClassKey
> {
activeStep?: number;
backButton: React.ReactElement<any>;
nextButton: React.ReactElement<any>;
position?: 'bottom' | 'top' | 'static';
steps: number;
type?: 'text' | 'dots' | 'progress';
}
export type MobileStepperClassKey =
| PaperClassKey
| 'positionBottom'
| 'positionTop'
| 'positionStatic'
| 'dots'
| 'dot'
| 'dotActive'
| 'progress'
;
declare const MobileStepper: React.ComponentType<MobileStepperProps>;
export default MobileStepper;

View File

@@ -0,0 +1,104 @@
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
// @inheritedComponent Paper
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import Paper from '../Paper';
import { capitalizeFirstLetter } from '../utils/helpers';
import { LinearProgress } from '../Progress';
export const styles = theme => ({
root: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
background: theme.palette.background.default,
padding: theme.spacing.unit
},
positionBottom: {
position: 'fixed',
bottom: 0,
left: 0,
right: 0,
zIndex: theme.zIndex.mobileStepper
},
positionTop: {
position: 'fixed',
top: 0,
left: 0,
right: 0,
zIndex: theme.zIndex.mobileStepper
},
positionStatic: {},
dots: {
display: 'flex',
flexDirection: 'row'
},
dot: {
backgroundColor: theme.palette.action.disabled,
borderRadius: '50%',
width: theme.spacing.unit,
height: theme.spacing.unit,
margin: '0 2px'
},
dotActive: {
backgroundColor: theme.palette.primary[500]
},
progress: {
width: '50%'
}
});
function MobileStepper(props) {
const {
activeStep,
backButton,
classes,
className: classNameProp,
position,
type,
nextButton,
steps
} = props,
other = _objectWithoutProperties(props, ['activeStep', 'backButton', 'classes', 'className', 'position', 'type', 'nextButton', 'steps']);
const className = classNames(classes.root, classes[`position${capitalizeFirstLetter(position)}`], classNameProp);
return React.createElement(
Paper,
_extends({ square: true, elevation: 0, className: className }, other),
backButton,
type === 'dots' && React.createElement(
'div',
{ className: classes.dots },
[...new Array(steps)].map((_, step) => {
const dotClassName = classNames({
[classes.dotActive]: step === activeStep
}, classes.dot);
// eslint-disable-next-line react/no-array-index-key
return React.createElement('div', { key: step, className: dotClassName });
})
),
type === 'progress' && React.createElement(
'div',
{ className: classes.progress },
React.createElement(LinearProgress, { mode: 'determinate', value: Math.ceil(activeStep / (steps - 1) * 100) })
),
nextButton
);
}
MobileStepper.defaultProps = {
activeStep: 0,
position: 'bottom',
type: 'dots'
};
export default withStyles(styles, { name: 'MuiMobileStepper' })(MobileStepper);

View File

@@ -0,0 +1,2 @@
export { default } from './MobileStepper';
export * from './MobileStepper';

View File

@@ -0,0 +1 @@
export { default } from './MobileStepper';