Completely updated React, fixed #11, (hopefully)
This commit is contained in:
126
goTorrentWebUI/node_modules/material-ui/styles/withStyles.js
generated
vendored
126
goTorrentWebUI/node_modules/material-ui/styles/withStyles.js
generated
vendored
@@ -61,28 +61,28 @@ var _hoistNonReactStatics = require('hoist-non-react-statics');
|
||||
|
||||
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
||||
|
||||
var _wrapDisplayName = require('recompose/wrapDisplayName');
|
||||
|
||||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName);
|
||||
|
||||
var _getDisplayName = require('recompose/getDisplayName');
|
||||
|
||||
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
|
||||
|
||||
var _wrapDisplayName = require('recompose/wrapDisplayName');
|
||||
|
||||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName);
|
||||
|
||||
var _contextTypes = require('react-jss/lib/contextTypes');
|
||||
|
||||
var _contextTypes2 = _interopRequireDefault(_contextTypes);
|
||||
|
||||
var _jss = require('jss');
|
||||
|
||||
var _jssPresetDefault = require('jss-preset-default');
|
||||
|
||||
var _jssPresetDefault2 = _interopRequireDefault(_jssPresetDefault);
|
||||
|
||||
var _ns = require('react-jss/lib/ns');
|
||||
|
||||
var ns = _interopRequireWildcard(_ns);
|
||||
|
||||
var _jssPreset = require('./jssPreset');
|
||||
|
||||
var _jssPreset2 = _interopRequireDefault(_jssPreset);
|
||||
|
||||
var _createMuiTheme = require('./createMuiTheme');
|
||||
|
||||
var _createMuiTheme2 = _interopRequireDefault(_createMuiTheme);
|
||||
@@ -103,10 +103,8 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_HigherOrderComponent = require('react-flow-types').babelPluginFlowReactPropTypes_proptype_HigherOrderComponent || require('prop-types').any; // weak
|
||||
|
||||
// New JSS instance.
|
||||
var jss = (0, _jss.create)((0, _jssPresetDefault2.default)());
|
||||
var jss = (0, _jss.create)((0, _jssPreset2.default)());
|
||||
|
||||
// Use a singleton or the provided one by the context.
|
||||
var generateClassName = (0, _createGenerateClassName2.default)();
|
||||
@@ -138,24 +136,6 @@ function getDefaultTheme() {
|
||||
return defaultTheme;
|
||||
}
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_RequiredProps = {
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* Use that property to pass a ref callback to the decorated component.
|
||||
*/
|
||||
innerRef: require('prop-types').func
|
||||
};
|
||||
var babelPluginFlowReactPropTypes_proptype_InjectedProps = {
|
||||
classes: require('prop-types').object.isRequired,
|
||||
theme: require('prop-types').object.isRequired
|
||||
};
|
||||
|
||||
// Note, theme is conditionally injected, but flow is static analysis so we need to include it.
|
||||
|
||||
// Link a style sheet with a component.
|
||||
// It does not modify the component passed to it;
|
||||
// instead, it returns a new component, with a `classes` property.
|
||||
@@ -164,42 +144,41 @@ var withStyles = function withStyles(stylesOrCreator) {
|
||||
return function (Component) {
|
||||
var _options$withTheme = options.withTheme,
|
||||
withTheme = _options$withTheme === undefined ? false : _options$withTheme,
|
||||
flip = options.flip,
|
||||
_options$flip = options.flip,
|
||||
flip = _options$flip === undefined ? null : _options$flip,
|
||||
name = options.name,
|
||||
styleSheetOptions = (0, _objectWithoutProperties3.default)(options, ['withTheme', 'flip', 'name']);
|
||||
|
||||
var stylesCreator = (0, _getStylesCreator2.default)(stylesOrCreator);
|
||||
var listenToTheme = stylesCreator.themingEnabled || withTheme || typeof name === 'string';
|
||||
|
||||
if (stylesCreator.options.index === undefined) {
|
||||
indexCounter += 1;
|
||||
stylesCreator.options.index = indexCounter;
|
||||
}
|
||||
indexCounter += 1;
|
||||
stylesCreator.options.index = indexCounter;
|
||||
|
||||
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(indexCounter < 0, ['Material-UI: you might have a memory leak.', 'The indexCounter is not supposed to grow that much.'].join(' ')) : void 0;
|
||||
|
||||
var Style = function (_React$Component) {
|
||||
(0, _inherits3.default)(Style, _React$Component);
|
||||
var WithStyles = function (_React$Component) {
|
||||
(0, _inherits3.default)(WithStyles, _React$Component);
|
||||
|
||||
function Style(props, context) {
|
||||
(0, _classCallCheck3.default)(this, Style);
|
||||
function WithStyles(props, context) {
|
||||
(0, _classCallCheck3.default)(this, WithStyles);
|
||||
|
||||
var _this = (0, _possibleConstructorReturn3.default)(this, (Style.__proto__ || (0, _getPrototypeOf2.default)(Style)).call(this, props, context));
|
||||
var _this = (0, _possibleConstructorReturn3.default)(this, (WithStyles.__proto__ || (0, _getPrototypeOf2.default)(WithStyles)).call(this, props, context));
|
||||
|
||||
_this.state = {};
|
||||
_this.unsubscribeId = null;
|
||||
_this.jss = null;
|
||||
_this.sheetsManager = sheetsManager;
|
||||
_this.disableStylesGeneration = false;
|
||||
_this.jss = null;
|
||||
_this.sheetOptions = null;
|
||||
_this.sheetsManager = sheetsManager;
|
||||
_this.stylesCreatorSaved = null;
|
||||
_this.theme = null;
|
||||
_this.sheetOptions = null;
|
||||
_this.theme = null;
|
||||
var muiThemeProviderOptions = _this.context.muiThemeProviderOptions;
|
||||
_this.unsubscribeId = null;
|
||||
|
||||
|
||||
_this.jss = _this.context[ns.jss] || jss;
|
||||
|
||||
var muiThemeProviderOptions = _this.context.muiThemeProviderOptions;
|
||||
|
||||
if (muiThemeProviderOptions) {
|
||||
if (muiThemeProviderOptions.sheetsManager) {
|
||||
_this.sheetsManager = muiThemeProviderOptions.sheetsManager;
|
||||
@@ -215,18 +194,12 @@ var withStyles = function withStyles(stylesOrCreator) {
|
||||
_this.sheetOptions = (0, _extends3.default)({
|
||||
generateClassName: generateClassName
|
||||
}, _this.context[ns.sheetOptions]);
|
||||
// We use || as it's lazy evaluated.
|
||||
// We use || as the function call is lazy evaluated.
|
||||
_this.theme = listenToTheme ? _themeListener2.default.initial(context) || getDefaultTheme() : noopTheme;
|
||||
return _this;
|
||||
}
|
||||
|
||||
// Exposed for test purposes.
|
||||
|
||||
|
||||
// Exposed for tests purposes
|
||||
|
||||
|
||||
(0, _createClass3.default)(Style, [{
|
||||
(0, _createClass3.default)(WithStyles, [{
|
||||
key: 'componentWillMount',
|
||||
value: function componentWillMount() {
|
||||
this.attach(this.theme);
|
||||
@@ -300,14 +273,15 @@ var withStyles = function withStyles(stylesOrCreator) {
|
||||
|
||||
if (sheetManagerTheme.refs === 0) {
|
||||
var styles = stylesCreatorSaved.create(theme, name);
|
||||
var _meta = void 0;
|
||||
var meta = name;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
_meta = name || (0, _getDisplayName2.default)(Component);
|
||||
if (process.env.NODE_ENV !== 'production' && !meta) {
|
||||
meta = (0, _getDisplayName2.default)(Component);
|
||||
}
|
||||
|
||||
var sheet = this.jss.createStyleSheet(styles, (0, _extends3.default)({
|
||||
meta: _meta,
|
||||
meta: meta,
|
||||
classNamePrefix: meta,
|
||||
flip: typeof flip === 'boolean' ? flip : theme.direction === 'rtl',
|
||||
link: false
|
||||
}, this.sheetOptions, stylesCreatorSaved.options, {
|
||||
@@ -394,29 +368,37 @@ var withStyles = function withStyles(stylesOrCreator) {
|
||||
return _react2.default.createElement(Component, (0, _extends3.default)({ classes: classes }, more, other, { ref: innerRef }));
|
||||
}
|
||||
}]);
|
||||
return Style;
|
||||
return WithStyles;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Style.contextTypes = (0, _extends3.default)({
|
||||
muiThemeProviderOptions: _propTypes2.default.object
|
||||
}, _contextTypes2.default, listenToTheme ? _themeListener2.default.contextTypes : {});
|
||||
Style.Naked = Component;
|
||||
Style.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
classes: require('prop-types').object,
|
||||
innerRef: require('prop-types').func
|
||||
WithStyles.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: _propTypes2.default.object,
|
||||
/**
|
||||
* Use that property to pass a ref callback to the decorated component.
|
||||
*/
|
||||
innerRef: _propTypes2.default.func
|
||||
} : {};
|
||||
|
||||
|
||||
(0, _hoistNonReactStatics2.default)(Style, Component);
|
||||
|
||||
// Higher specificity
|
||||
Style.options = options;
|
||||
WithStyles.contextTypes = (0, _extends3.default)({
|
||||
muiThemeProviderOptions: _propTypes2.default.object
|
||||
}, _contextTypes2.default, listenToTheme ? _themeListener2.default.contextTypes : {});
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Style.displayName = (0, _wrapDisplayName2.default)(Component, 'withStyles');
|
||||
WithStyles.displayName = (0, _wrapDisplayName2.default)(Component, 'WithStyles');
|
||||
}
|
||||
|
||||
return Style;
|
||||
(0, _hoistNonReactStatics2.default)(WithStyles, Component);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// Exposed for test purposes.
|
||||
WithStyles.Naked = Component;
|
||||
WithStyles.options = options;
|
||||
}
|
||||
|
||||
return WithStyles;
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user