mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-22 23:49: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
70
web/node_modules/@material-ui/core/Avatar/Avatar.d.ts
generated
vendored
Normal file
70
web/node_modules/@material-ui/core/Avatar/Avatar.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
import * as React from 'react';
|
||||
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
||||
|
||||
export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
||||
props: P & {
|
||||
/**
|
||||
* Used in combination with `src` or `srcSet` to
|
||||
* provide an alt attribute for the rendered `img` element.
|
||||
*/
|
||||
alt?: string;
|
||||
/**
|
||||
* Used to render icon or text elements inside the Avatar if `src` is not set.
|
||||
* This can be an element, or just a string.
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* Attributes applied to the `img` element if the component is used to display an image.
|
||||
* It can be used to listen for the loading error event.
|
||||
*/
|
||||
imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
|
||||
/**
|
||||
* The `sizes` attribute for the `img` element.
|
||||
*/
|
||||
sizes?: string;
|
||||
/**
|
||||
* The `src` attribute for the `img` element.
|
||||
*/
|
||||
src?: string;
|
||||
/**
|
||||
* The `srcSet` attribute for the `img` element.
|
||||
* Use this attribute for responsive image display.
|
||||
*/
|
||||
srcSet?: string;
|
||||
/**
|
||||
* The shape of the avatar.
|
||||
*/
|
||||
variant?: 'circle' | 'circular' | 'rounded' | 'square';
|
||||
};
|
||||
defaultComponent: D;
|
||||
classKey: AvatarClassKey;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Avatars](https://material-ui.com/components/avatars/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [Avatar API](https://material-ui.com/api/avatar/)
|
||||
*/
|
||||
declare const Avatar: OverridableComponent<AvatarTypeMap>;
|
||||
|
||||
export type AvatarClassKey =
|
||||
| 'root'
|
||||
| 'colorDefault'
|
||||
| 'circle'
|
||||
| 'circular'
|
||||
| 'rounded'
|
||||
| 'square'
|
||||
| 'img'
|
||||
| 'fallback';
|
||||
|
||||
export type AvatarProps<
|
||||
D extends React.ElementType = AvatarTypeMap['defaultComponent'],
|
||||
P = {}
|
||||
> = OverrideProps<AvatarTypeMap<P, D>, D>;
|
||||
|
||||
export default Avatar;
|
270
web/node_modules/@material-ui/core/Avatar/Avatar.js
generated
vendored
Normal file
270
web/node_modules/@material-ui/core/Avatar/Avatar.js
generated
vendored
Normal file
|
@ -0,0 +1,270 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.styles = void 0;
|
||||
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
|
||||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||
|
||||
var _clsx = _interopRequireDefault(require("clsx"));
|
||||
|
||||
var _utils = require("@material-ui/utils");
|
||||
|
||||
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
||||
|
||||
var _Person = _interopRequireDefault(require("../internal/svg-icons/Person"));
|
||||
|
||||
var styles = function styles(theme) {
|
||||
return {
|
||||
/* Styles applied to the root element. */
|
||||
root: {
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
width: 40,
|
||||
height: 40,
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontSize: theme.typography.pxToRem(20),
|
||||
lineHeight: 1,
|
||||
borderRadius: '50%',
|
||||
overflow: 'hidden',
|
||||
userSelect: 'none'
|
||||
},
|
||||
|
||||
/* Styles applied to the root element if not `src` or `srcSet`. */
|
||||
colorDefault: {
|
||||
color: theme.palette.background.default,
|
||||
backgroundColor: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
|
||||
},
|
||||
|
||||
/* Styles applied to the root element if `variant="circle"`. */
|
||||
circle: {},
|
||||
|
||||
/* Styles applied to the root element if `variant="circular"`. */
|
||||
circular: {},
|
||||
|
||||
/* Styles applied to the root element if `variant="rounded"`. */
|
||||
rounded: {
|
||||
borderRadius: theme.shape.borderRadius
|
||||
},
|
||||
|
||||
/* Styles applied to the root element if `variant="square"`. */
|
||||
square: {
|
||||
borderRadius: 0
|
||||
},
|
||||
|
||||
/* Styles applied to the img element if either `src` or `srcSet` is defined. */
|
||||
img: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
textAlign: 'center',
|
||||
// Handle non-square image. The property isn't supported by IE 11.
|
||||
objectFit: 'cover',
|
||||
// Hide alt text.
|
||||
color: 'transparent',
|
||||
// Hide the image broken icon, only works on Chrome.
|
||||
textIndent: 10000
|
||||
},
|
||||
|
||||
/* Styles applied to the fallback icon */
|
||||
fallback: {
|
||||
width: '75%',
|
||||
height: '75%'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports.styles = styles;
|
||||
|
||||
function useLoaded(_ref) {
|
||||
var src = _ref.src,
|
||||
srcSet = _ref.srcSet;
|
||||
|
||||
var _React$useState = React.useState(false),
|
||||
loaded = _React$useState[0],
|
||||
setLoaded = _React$useState[1];
|
||||
|
||||
React.useEffect(function () {
|
||||
if (!src && !srcSet) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
setLoaded(false);
|
||||
var active = true;
|
||||
var image = new Image();
|
||||
image.src = src;
|
||||
image.srcSet = srcSet;
|
||||
|
||||
image.onload = function () {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
|
||||
setLoaded('loaded');
|
||||
};
|
||||
|
||||
image.onerror = function () {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
|
||||
setLoaded('error');
|
||||
};
|
||||
|
||||
return function () {
|
||||
active = false;
|
||||
};
|
||||
}, [src, srcSet]);
|
||||
return loaded;
|
||||
}
|
||||
|
||||
var Avatar = /*#__PURE__*/React.forwardRef(function Avatar(props, ref) {
|
||||
var alt = props.alt,
|
||||
childrenProp = props.children,
|
||||
classes = props.classes,
|
||||
className = props.className,
|
||||
_props$component = props.component,
|
||||
Component = _props$component === void 0 ? 'div' : _props$component,
|
||||
imgProps = props.imgProps,
|
||||
sizes = props.sizes,
|
||||
src = props.src,
|
||||
srcSet = props.srcSet,
|
||||
_props$variant = props.variant,
|
||||
variant = _props$variant === void 0 ? 'circular' : _props$variant,
|
||||
other = (0, _objectWithoutProperties2.default)(props, ["alt", "children", "classes", "className", "component", "imgProps", "sizes", "src", "srcSet", "variant"]);
|
||||
var children = null; // Use a hook instead of onError on the img element to support server-side rendering.
|
||||
|
||||
var loaded = useLoaded({
|
||||
src: src,
|
||||
srcSet: srcSet
|
||||
});
|
||||
var hasImg = src || srcSet;
|
||||
var hasImgNotFailing = hasImg && loaded !== 'error';
|
||||
|
||||
if (hasImgNotFailing) {
|
||||
children = /*#__PURE__*/React.createElement("img", (0, _extends2.default)({
|
||||
alt: alt,
|
||||
src: src,
|
||||
srcSet: srcSet,
|
||||
sizes: sizes,
|
||||
className: classes.img
|
||||
}, imgProps));
|
||||
} else if (childrenProp != null) {
|
||||
children = childrenProp;
|
||||
} else if (hasImg && alt) {
|
||||
children = alt[0];
|
||||
} else {
|
||||
children = /*#__PURE__*/React.createElement(_Person.default, {
|
||||
className: classes.fallback
|
||||
});
|
||||
}
|
||||
|
||||
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({
|
||||
className: (0, _clsx.default)(classes.root, classes.system, classes[variant], className, !hasImgNotFailing && classes.colorDefault),
|
||||
ref: ref
|
||||
}, other), children);
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? Avatar.propTypes = {
|
||||
// ----------------------------- Warning --------------------------------
|
||||
// | These PropTypes are generated from the TypeScript type definitions |
|
||||
// | To update them edit the d.ts file and run "yarn proptypes" |
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Used in combination with `src` or `srcSet` to
|
||||
* provide an alt attribute for the rendered `img` element.
|
||||
*/
|
||||
alt: _propTypes.default.string,
|
||||
|
||||
/**
|
||||
* Used to render icon or text elements inside the Avatar if `src` is not set.
|
||||
* This can be an element, or just a string.
|
||||
*/
|
||||
children: _propTypes.default.node,
|
||||
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
* See [CSS API](#css) below for more details.
|
||||
*/
|
||||
classes: (0, _utils.chainPropTypes)(_propTypes.default.object, function (props) {
|
||||
var classes = props.classes;
|
||||
|
||||
if (classes == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (classes.circle != null && // 2 classnames? one from withStyles the other must be custom
|
||||
classes.circle.split(' ').length > 1) {
|
||||
throw new Error("Material-UI: The `circle` class is deprecated. Use `circular` instead.");
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: _propTypes.default.string,
|
||||
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: _propTypes.default
|
||||
/* @typescript-to-proptypes-ignore */
|
||||
.elementType,
|
||||
|
||||
/**
|
||||
* Attributes applied to the `img` element if the component is used to display an image.
|
||||
* It can be used to listen for the loading error event.
|
||||
*/
|
||||
imgProps: _propTypes.default.object,
|
||||
|
||||
/**
|
||||
* The `sizes` attribute for the `img` element.
|
||||
*/
|
||||
sizes: _propTypes.default.string,
|
||||
|
||||
/**
|
||||
* The `src` attribute for the `img` element.
|
||||
*/
|
||||
src: _propTypes.default.string,
|
||||
|
||||
/**
|
||||
* The `srcSet` attribute for the `img` element.
|
||||
* Use this attribute for responsive image display.
|
||||
*/
|
||||
srcSet: _propTypes.default.string,
|
||||
|
||||
/**
|
||||
* The shape of the avatar.
|
||||
*/
|
||||
variant: (0, _utils.chainPropTypes)(_propTypes.default.oneOf(['circle', 'circular', 'rounded', 'square']), function (props) {
|
||||
var variant = props.variant;
|
||||
|
||||
if (variant === 'circle') {
|
||||
throw new Error('Material-UI: `variant="circle"` is deprecated. Use `variant="circular"` instead.');
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
} : void 0;
|
||||
|
||||
var _default = (0, _withStyles.default)(styles, {
|
||||
name: 'MuiAvatar'
|
||||
})(Avatar);
|
||||
|
||||
exports.default = _default;
|
2
web/node_modules/@material-ui/core/Avatar/index.d.ts
generated
vendored
Normal file
2
web/node_modules/@material-ui/core/Avatar/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export { default } from './Avatar';
|
||||
export * from './Avatar';
|
15
web/node_modules/@material-ui/core/Avatar/index.js
generated
vendored
Normal file
15
web/node_modules/@material-ui/core/Avatar/index.js
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _Avatar.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
5
web/node_modules/@material-ui/core/Avatar/package.json
generated
vendored
Normal file
5
web/node_modules/@material-ui/core/Avatar/package.json
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"sideEffects": false,
|
||||
"module": "../esm/Avatar/index.js",
|
||||
"typings": "./index.d.ts"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue