Completely updated React, fixed #11, (hopefully)
This commit is contained in:
189
goTorrentWebUI/node_modules/material-ui/Tabs/Tab.js
generated
vendored
189
goTorrentWebUI/node_modules/material-ui/Tabs/Tab.js
generated
vendored
@@ -45,6 +45,10 @@ 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);
|
||||
@@ -59,13 +63,8 @@ var _ButtonBase2 = _interopRequireDefault(_ButtonBase);
|
||||
|
||||
var _helpers = require('../utils/helpers');
|
||||
|
||||
var _Icon = require('../Icon');
|
||||
|
||||
var _Icon2 = _interopRequireDefault(_Icon);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Element = require('react').babelPluginFlowReactPropTypes_proptype_Element || require('prop-types').any;
|
||||
// @inheritedComponent ButtonBase
|
||||
|
||||
var styles = exports.styles = function styles(theme) {
|
||||
@@ -84,27 +83,27 @@ var styles = exports.styles = function styles(theme) {
|
||||
rootLabelIcon: {
|
||||
height: 72
|
||||
},
|
||||
rootAccent: {
|
||||
color: theme.palette.text.secondary
|
||||
},
|
||||
rootAccentSelected: {
|
||||
color: theme.palette.secondary.A200
|
||||
},
|
||||
rootAccentDisabled: {
|
||||
color: theme.palette.text.disabled
|
||||
rootInherit: {
|
||||
color: 'inherit',
|
||||
opacity: 0.7
|
||||
},
|
||||
rootPrimary: {
|
||||
color: theme.palette.text.secondary
|
||||
},
|
||||
rootPrimarySelected: {
|
||||
color: theme.palette.primary[500]
|
||||
color: theme.palette.primary.main
|
||||
},
|
||||
rootPrimaryDisabled: {
|
||||
color: theme.palette.text.disabled
|
||||
},
|
||||
rootInherit: {
|
||||
color: 'inherit',
|
||||
opacity: 0.7
|
||||
rootSecondary: {
|
||||
color: theme.palette.text.secondary
|
||||
},
|
||||
rootSecondarySelected: {
|
||||
color: theme.palette.secondary.main
|
||||
},
|
||||
rootSecondaryDisabled: {
|
||||
color: theme.palette.text.disabled
|
||||
},
|
||||
rootInheritSelected: {
|
||||
opacity: 1
|
||||
@@ -137,81 +136,12 @@ var styles = exports.styles = function styles(theme) {
|
||||
}, theme.breakpoints.up('md'), {
|
||||
fontSize: theme.typography.pxToRem(theme.typography.fontSize - 1)
|
||||
}),
|
||||
labelWrapped: (0, _defineProperty3.default)({}, theme.breakpoints.down('md'), {
|
||||
labelWrapped: (0, _defineProperty3.default)({}, theme.breakpoints.down('sm'), {
|
||||
fontSize: theme.typography.pxToRem(theme.typography.fontSize - 2)
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: require('prop-types').string,
|
||||
|
||||
/**
|
||||
* If `true`, the tab will be disabled.
|
||||
*/
|
||||
disabled: require('prop-types').bool,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
fullWidth: require('prop-types').bool,
|
||||
|
||||
/**
|
||||
* The icon element. If a string is provided, it will be used as a font ligature.
|
||||
*/
|
||||
icon: require('prop-types').oneOfType([require('prop-types').string, typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element)]),
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
* For server side rendering consideration, we let the selected tab
|
||||
* render the indicator.
|
||||
*/
|
||||
indicator: require('prop-types').oneOfType([require('prop-types').string, typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element)]),
|
||||
|
||||
/**
|
||||
* The label element.
|
||||
*/
|
||||
label: require('prop-types').oneOfType([require('prop-types').string, typeof babelPluginFlowReactPropTypes_proptype_Element === 'function' ? babelPluginFlowReactPropTypes_proptype_Element : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Element)]),
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onChange: require('prop-types').func,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: require('prop-types').func,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
selected: require('prop-types').bool,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
style: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
textColor: require('prop-types').oneOfType([require('prop-types').oneOf(['accent']), require('prop-types').oneOf(['primary']), require('prop-types').oneOf(['inherit']), require('prop-types').string]),
|
||||
|
||||
/**
|
||||
* You can provide your own value. Otherwise, we fallback to the child position index.
|
||||
*/
|
||||
value: require('prop-types').any
|
||||
};
|
||||
|
||||
var Tab = function (_React$Component) {
|
||||
(0, _inherits3.default)(Tab, _React$Component);
|
||||
|
||||
@@ -244,9 +174,9 @@ var Tab = function (_React$Component) {
|
||||
}
|
||||
}, _this.label = undefined, _this.checkTextWrap = function () {
|
||||
if (_this.label) {
|
||||
var _wrappedText = _this.label.getClientRects().length > 1;
|
||||
if (_this.state.wrappedText !== _wrappedText) {
|
||||
_this.setState({ wrappedText: _wrappedText });
|
||||
var wrappedText = _this.label.getClientRects().length > 1;
|
||||
if (_this.state.wrappedText !== wrappedText) {
|
||||
_this.setState({ wrappedText: wrappedText });
|
||||
}
|
||||
}
|
||||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
|
||||
@@ -280,7 +210,7 @@ var Tab = function (_React$Component) {
|
||||
classNameProp = _props.className,
|
||||
disabled = _props.disabled,
|
||||
fullWidth = _props.fullWidth,
|
||||
iconProp = _props.icon,
|
||||
icon = _props.icon,
|
||||
indicator = _props.indicator,
|
||||
labelProp = _props.label,
|
||||
onChange = _props.onChange,
|
||||
@@ -291,21 +221,11 @@ var Tab = function (_React$Component) {
|
||||
other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'className', 'disabled', 'fullWidth', 'icon', 'indicator', 'label', 'onChange', 'selected', 'style', 'textColor', 'value']);
|
||||
|
||||
|
||||
var icon = void 0;
|
||||
|
||||
if (iconProp !== undefined) {
|
||||
icon = _react2.default.isValidElement(iconProp) ? iconProp : _react2.default.createElement(
|
||||
_Icon2.default,
|
||||
null,
|
||||
iconProp
|
||||
);
|
||||
}
|
||||
|
||||
var label = void 0;
|
||||
|
||||
if (labelProp !== undefined) {
|
||||
label = _react2.default.createElement(
|
||||
'div',
|
||||
'span',
|
||||
{ className: classes.labelContainer },
|
||||
_react2.default.createElement(
|
||||
'span',
|
||||
@@ -320,11 +240,11 @@ var Tab = function (_React$Component) {
|
||||
);
|
||||
}
|
||||
|
||||
var className = (0, _classnames2.default)(classes.root, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes['root' + (0, _helpers.capitalizeFirstLetter)(textColor)], true), (0, _defineProperty3.default)(_classNames2, classes['root' + (0, _helpers.capitalizeFirstLetter)(textColor) + 'Disabled'], disabled), (0, _defineProperty3.default)(_classNames2, classes['root' + (0, _helpers.capitalizeFirstLetter)(textColor) + 'Selected'], selected), (0, _defineProperty3.default)(_classNames2, classes.rootLabelIcon, icon && label), (0, _defineProperty3.default)(_classNames2, classes.fullWidth, fullWidth), _classNames2), classNameProp);
|
||||
var className = (0, _classnames2.default)(classes.root, classes['root' + (0, _helpers.capitalize)(textColor)], (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes['root' + (0, _helpers.capitalize)(textColor) + 'Disabled'], disabled), (0, _defineProperty3.default)(_classNames2, classes['root' + (0, _helpers.capitalize)(textColor) + 'Selected'], selected), (0, _defineProperty3.default)(_classNames2, classes.rootLabelIcon, icon && label), (0, _defineProperty3.default)(_classNames2, classes.fullWidth, fullWidth), _classNames2), classNameProp);
|
||||
|
||||
var style = {};
|
||||
|
||||
if (textColor !== 'accent' && textColor !== 'inherit') {
|
||||
if (textColor !== 'secondary' && textColor !== 'inherit') {
|
||||
style.color = textColor;
|
||||
}
|
||||
|
||||
@@ -355,7 +275,66 @@ var Tab = function (_React$Component) {
|
||||
return Tab;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Tab.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: _propTypes2.default.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: _propTypes2.default.string,
|
||||
/**
|
||||
* If `true`, the tab will be disabled.
|
||||
*/
|
||||
disabled: _propTypes2.default.bool,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
fullWidth: _propTypes2.default.bool,
|
||||
/**
|
||||
* The icon element.
|
||||
*/
|
||||
icon: _propTypes2.default.node,
|
||||
/**
|
||||
* @ignore
|
||||
* For server side rendering consideration, we let the selected tab
|
||||
* render the indicator.
|
||||
*/
|
||||
indicator: _propTypes2.default.node,
|
||||
/**
|
||||
* The label element.
|
||||
*/
|
||||
label: _propTypes2.default.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onChange: _propTypes2.default.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: _propTypes2.default.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
selected: _propTypes2.default.bool,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
style: _propTypes2.default.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
textColor: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.oneOf(['secondary', 'primary', 'inherit'])]),
|
||||
/**
|
||||
* You can provide your own value. Otherwise, we fallback to the child position index.
|
||||
*/
|
||||
value: _propTypes2.default.any
|
||||
} : {};
|
||||
|
||||
Tab.defaultProps = {
|
||||
disabled: false
|
||||
disabled: false,
|
||||
textColor: 'inherit'
|
||||
};
|
||||
|
||||
exports.default = (0, _withStyles2.default)(styles, { name: 'MuiTab' })(Tab);
|
Reference in New Issue
Block a user