Completely updated React, fixed #11, (hopefully)
This commit is contained in:
15
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/BottomNavigation.d.ts
generated
vendored
15
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/BottomNavigation.d.ts
generated
vendored
@@ -1,20 +1,19 @@
|
||||
import * as React from 'react';
|
||||
import { StandardProps } from '..';
|
||||
|
||||
export interface BottomNavigationProps extends StandardProps<
|
||||
React.HTMLAttributes<HTMLDivElement>,
|
||||
BottomNavigationClassKey,
|
||||
'onChange'
|
||||
> {
|
||||
export interface BottomNavigationProps
|
||||
extends StandardProps<
|
||||
React.HTMLAttributes<HTMLDivElement>,
|
||||
BottomNavigationClassKey,
|
||||
'onChange'
|
||||
> {
|
||||
children: React.ReactNode;
|
||||
onChange?: (event: React.ChangeEvent<{}>, value: any) => void;
|
||||
showLabels?: boolean;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export type BottomNavigationClassKey =
|
||||
| 'root'
|
||||
;
|
||||
export type BottomNavigationClassKey = 'root';
|
||||
|
||||
declare const BottomNavigation: React.ComponentType<BottomNavigationProps>;
|
||||
|
||||
|
45
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/BottomNavigation.js
generated
vendored
45
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/BottomNavigation.js
generated
vendored
@@ -1,11 +1,7 @@
|
||||
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';
|
||||
import React from 'react';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import withStyles from '../styles/withStyles';
|
||||
|
||||
@@ -32,6 +28,10 @@ function BottomNavigation(props) {
|
||||
const className = classNames(classes.root, classNameProp);
|
||||
|
||||
const children = React.Children.map(childrenProp, (child, childIndex) => {
|
||||
if (!React.isValidElement(child)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const childValue = child.props.value || childIndex;
|
||||
return React.cloneElement(child, {
|
||||
selected: childValue === value,
|
||||
@@ -48,6 +48,37 @@ function BottomNavigation(props) {
|
||||
);
|
||||
}
|
||||
|
||||
BottomNavigation.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children: PropTypes.node.isRequired,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* Callback fired when the value changes.
|
||||
*
|
||||
* @param {object} event The event source of the callback
|
||||
* @param {any} value We default to the index of the child
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* If `true`, all `BottomNavigationAction`s will show their labels.
|
||||
* By default, only the selected `BottomNavigationAction` will show its label.
|
||||
*/
|
||||
showLabels: PropTypes.bool,
|
||||
/**
|
||||
* The value of the currently selected `BottomNavigationAction`.
|
||||
*/
|
||||
value: PropTypes.any
|
||||
} : {};
|
||||
|
||||
BottomNavigation.defaultProps = {
|
||||
showLabels: false
|
||||
};
|
||||
|
@@ -2,11 +2,8 @@ import * as React from 'react';
|
||||
import { StandardProps } from '..';
|
||||
import { ButtonBaseProps, ButtonBaseClassKey } from '../ButtonBase';
|
||||
|
||||
export interface BottomNavigationButtonProps extends StandardProps<
|
||||
ButtonBaseProps,
|
||||
BottomNavigationButtonClassKey,
|
||||
'onChange'
|
||||
> {
|
||||
export interface BottomNavigationActionProps
|
||||
extends StandardProps<ButtonBaseProps, BottomNavigationActionClassKey, 'onChange'> {
|
||||
icon?: string | React.ReactElement<any>;
|
||||
label?: React.ReactNode;
|
||||
onChange?: (event: React.ChangeEvent<{}>, value: any) => void;
|
||||
@@ -16,17 +13,15 @@ export interface BottomNavigationButtonProps extends StandardProps<
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export type BottomNavigationButtonClassKey =
|
||||
export type BottomNavigationActionClassKey =
|
||||
| ButtonBaseClassKey
|
||||
| 'selected'
|
||||
| 'selectedIconOnly'
|
||||
| 'wrapper'
|
||||
| 'label'
|
||||
| 'selectedLabel'
|
||||
| 'hiddenLabel'
|
||||
| 'icon'
|
||||
;
|
||||
| 'hiddenLabel';
|
||||
|
||||
declare const BottomNavigationButton: React.ComponentType<BottomNavigationButtonProps>;
|
||||
declare const BottomNavigationAction: React.ComponentType<BottomNavigationActionProps>;
|
||||
|
||||
export default BottomNavigationButton;
|
||||
export default BottomNavigationAction;
|
@@ -1,22 +1,19 @@
|
||||
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';
|
||||
// @inheritedComponent ButtonBase
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import withStyles from '../styles/withStyles';
|
||||
import ButtonBase from '../ButtonBase';
|
||||
import Icon from '../Icon';
|
||||
|
||||
export const styles = theme => ({
|
||||
root: {
|
||||
transition: theme.transitions.create(['color', 'padding-top'], {
|
||||
duration: theme.transitions.duration.short
|
||||
}),
|
||||
paddingTop: 8,
|
||||
paddingTop: theme.spacing.unit,
|
||||
paddingBottom: 10,
|
||||
paddingLeft: 12,
|
||||
paddingRight: 12,
|
||||
@@ -27,7 +24,7 @@ export const styles = theme => ({
|
||||
},
|
||||
selected: {
|
||||
paddingTop: 6,
|
||||
color: theme.palette.primary[500]
|
||||
color: theme.palette.primary.main
|
||||
},
|
||||
selectedIconOnly: {
|
||||
paddingTop: theme.spacing.unit * 2
|
||||
@@ -52,14 +49,10 @@ export const styles = theme => ({
|
||||
hiddenLabel: {
|
||||
opacity: 0,
|
||||
transitionDelay: '0s'
|
||||
},
|
||||
icon: {
|
||||
display: 'block',
|
||||
margin: 'auto'
|
||||
}
|
||||
});
|
||||
|
||||
class BottomNavigationButton extends React.Component {
|
||||
class BottomNavigationAction extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
|
||||
@@ -79,38 +72,23 @@ class BottomNavigationButton extends React.Component {
|
||||
render() {
|
||||
const _props = this.props,
|
||||
{
|
||||
label,
|
||||
icon: iconProp,
|
||||
selected,
|
||||
classes,
|
||||
className: classNameProp,
|
||||
showLabel: showLabelProp,
|
||||
icon,
|
||||
label,
|
||||
onChange,
|
||||
onClick,
|
||||
selected,
|
||||
showLabel: showLabelProp,
|
||||
value
|
||||
} = _props,
|
||||
other = _objectWithoutProperties(_props, ['label', 'icon', 'selected', 'classes', 'className', 'showLabel', 'onChange', 'value']);
|
||||
other = _objectWithoutProperties(_props, ['classes', 'className', 'icon', 'label', 'onChange', 'onClick', 'selected', 'showLabel', 'value']);
|
||||
|
||||
const className = classNames(classes.root, {
|
||||
[classes.selected]: selected,
|
||||
[classes.selectedIconOnly]: !showLabelProp && !selected
|
||||
}, classNameProp);
|
||||
|
||||
let icon = null;
|
||||
|
||||
if (iconProp) {
|
||||
if (React.isValidElement(iconProp) && typeof iconProp !== 'string') {
|
||||
icon = React.cloneElement(iconProp, {
|
||||
className: classNames(classes.icon, iconProp.props.className)
|
||||
});
|
||||
} else {
|
||||
icon = React.createElement(
|
||||
Icon,
|
||||
null,
|
||||
iconProp
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const labelClassName = classNames(classes.label, {
|
||||
[classes.selectedLabel]: selected,
|
||||
[classes.hiddenLabel]: !showLabelProp && !selected
|
||||
@@ -118,7 +96,7 @@ class BottomNavigationButton extends React.Component {
|
||||
|
||||
return React.createElement(
|
||||
ButtonBase,
|
||||
_extends({ className: className, focusRipple: true }, other, { onClick: this.handleChange }),
|
||||
_extends({ className: className, focusRipple: true, onClick: this.handleChange }, other),
|
||||
React.createElement(
|
||||
'span',
|
||||
{ className: classes.wrapper },
|
||||
@@ -133,4 +111,43 @@ class BottomNavigationButton extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default withStyles(styles, { name: 'MuiBottomNavigationButton' })(BottomNavigationButton);
|
||||
BottomNavigationAction.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The icon element.
|
||||
*/
|
||||
icon: PropTypes.node,
|
||||
/**
|
||||
* The label element.
|
||||
*/
|
||||
label: PropTypes.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onChange: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
selected: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the BottomNavigationAction will show its label.
|
||||
*/
|
||||
showLabel: PropTypes.bool,
|
||||
/**
|
||||
* You can provide your own value. Otherwise, we fallback to the child position index.
|
||||
*/
|
||||
value: PropTypes.any
|
||||
} : {};
|
||||
|
||||
export default withStyles(styles, { name: 'MuiBottomNavigationAction' })(BottomNavigationAction);
|
4
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/index.d.ts
generated
vendored
4
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/index.d.ts
generated
vendored
@@ -1,4 +1,4 @@
|
||||
export { default } from './BottomNavigation';
|
||||
export * from './BottomNavigation';
|
||||
export { default as BottomNavigationButton } from './BottomNavigationButton';
|
||||
export * from './BottomNavigationButton';
|
||||
export { default as BottomNavigationAction } from './BottomNavigationAction';
|
||||
export * from './BottomNavigationAction';
|
||||
|
2
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/index.js
generated
vendored
2
goTorrentWebUI/node_modules/material-ui/es/BottomNavigation/index.js
generated
vendored
@@ -1,2 +1,2 @@
|
||||
export { default } from './BottomNavigation';
|
||||
export { default as BottomNavigationButton } from './BottomNavigationButton';
|
||||
export { default as BottomNavigationAction } from './BottomNavigationAction';
|
Reference in New Issue
Block a user