mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-23 07:59:15 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
2
web/node_modules/@material-ui/styles/esm/withTheme/index.js
generated
vendored
Normal file
2
web/node_modules/@material-ui/styles/esm/withTheme/index.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export { default } from './withTheme';
|
||||
export * from './withTheme';
|
63
web/node_modules/@material-ui/styles/esm/withTheme/withTheme.js
generated
vendored
Normal file
63
web/node_modules/@material-ui/styles/esm/withTheme/withTheme.js
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import hoistNonReactStatics from 'hoist-non-react-statics';
|
||||
import { chainPropTypes, getDisplayName } from '@material-ui/utils';
|
||||
import useTheme from '../useTheme';
|
||||
export function withThemeCreator() {
|
||||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var defaultTheme = options.defaultTheme;
|
||||
|
||||
var withTheme = function withTheme(Component) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (Component === undefined) {
|
||||
throw new Error(['You are calling withTheme(Component) with an undefined component.', 'You may have forgotten to import it.'].join('\n'));
|
||||
}
|
||||
}
|
||||
|
||||
var WithTheme = /*#__PURE__*/React.forwardRef(function WithTheme(props, ref) {
|
||||
var innerRef = props.innerRef,
|
||||
other = _objectWithoutProperties(props, ["innerRef"]);
|
||||
|
||||
var theme = useTheme() || defaultTheme;
|
||||
return /*#__PURE__*/React.createElement(Component, _extends({
|
||||
theme: theme,
|
||||
ref: innerRef || ref
|
||||
}, other));
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? WithTheme.propTypes = {
|
||||
/**
|
||||
* Use that prop to pass a ref to the decorated component.
|
||||
* @deprecated
|
||||
*/
|
||||
innerRef: chainPropTypes(PropTypes.oneOfType([PropTypes.func, PropTypes.object]), function (props) {
|
||||
if (props.innerRef == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Error('Material-UI: The `innerRef` prop is deprecated and will be removed in v5. ' + 'Refs are now automatically forwarded to the inner component.');
|
||||
})
|
||||
} : void 0;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
WithTheme.displayName = "WithTheme(".concat(getDisplayName(Component), ")");
|
||||
}
|
||||
|
||||
hoistNonReactStatics(WithTheme, Component);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// Exposed for test purposes.
|
||||
WithTheme.Naked = Component;
|
||||
}
|
||||
|
||||
return WithTheme;
|
||||
};
|
||||
|
||||
return withTheme;
|
||||
} // Provide the theme object as a prop to the input component.
|
||||
// It's an alternative API to useTheme().
|
||||
// We encourage the usage of useTheme() where possible.
|
||||
|
||||
var withTheme = withThemeCreator();
|
||||
export default withTheme;
|
Loading…
Add table
Add a link
Reference in a new issue