1 |
- {"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nvar RADIUS_STANDARD = 10;\nvar RADIUS_DOT = 4;\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n position: 'relative',\n display: 'inline-flex',\n // For correct alignment with the text.\n verticalAlign: 'middle',\n flexShrink: 0\n },\n\n /* Styles applied to the badge `span` element. */\n badge: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignContent: 'center',\n alignItems: 'center',\n position: 'absolute',\n boxSizing: 'border-box',\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.pxToRem(12),\n minWidth: RADIUS_STANDARD * 2,\n lineHeight: 1,\n padding: '0 6px',\n height: RADIUS_STANDARD * 2,\n borderRadius: RADIUS_STANDARD,\n zIndex: 1,\n // Render the badge on top of potential ripples.\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeInOut,\n duration: theme.transitions.duration.enteringScreen\n })\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.primary.contrastText\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n backgroundColor: theme.palette.secondary.main,\n color: theme.palette.secondary.contrastText\n },\n\n /* Styles applied to the root element if `color=\"error\"`. */\n colorError: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText\n },\n\n /* Styles applied to the root element if `variant=\"dot\"`. */\n dot: {\n borderRadius: RADIUS_DOT,\n height: RADIUS_DOT * 2,\n minWidth: RADIUS_DOT * 2,\n padding: 0\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }} overlap=\"rectangle\"`. */\n anchorOriginTopRightRectangle: {\n top: 0,\n right: 0,\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }} overlap=\"rectangle\"`. */\n anchorOriginBottomRightRectangle: {\n bottom: 0,\n right: 0,\n transform: 'scale(1) translate(50%, 50%)',\n transformOrigin: '100% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, 50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }} overlap=\"rectangle\"`. */\n anchorOriginTopLeftRectangle: {\n top: 0,\n left: 0,\n transform: 'scale(1) translate(-50%, -50%)',\n transformOrigin: '0% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }} overlap=\"rectangle\"`. */\n anchorOriginBottomLeftRectangle: {\n bottom: 0,\n left: 0,\n transform: 'scale(1) translate(-50%, 50%)',\n transformOrigin: '0% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, 50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }} overlap=\"circle\"`. */\n anchorOriginTopRightCircle: {\n top: '14%',\n right: '14%',\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }} overlap=\"circle\"`. */\n anchorOriginBottomRightCircle: {\n bottom: '14%',\n right: '14%',\n transform: 'scale(1) translate(50%, 50%)',\n transformOrigin: '100% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, 50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }} overlap=\"circle\"`. */\n anchorOriginTopLeftCircle: {\n top: '14%',\n left: '14%',\n transform: 'scale(1) translate(-50%, -50%)',\n transformOrigin: '0% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }} overlap=\"circle\"`. */\n anchorOriginBottomLeftCircle: {\n bottom: '14%',\n left: '14%',\n transform: 'scale(1) translate(-50%, 50%)',\n transformOrigin: '0% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, 50%)'\n }\n },\n\n /* Pseudo-class to the badge `span` element if `invisible={true}`. */\n invisible: {\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeInOut,\n duration: theme.transitions.duration.leavingScreen\n })\n }\n };\n};\nvar Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {\n var _props$anchorOrigin = props.anchorOrigin,\n anchorOrigin = _props$anchorOrigin === void 0 ? {\n vertical: 'top',\n horizontal: 'right'\n } : _props$anchorOrigin,\n badgeContent = props.badgeContent,\n children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'default' : _props$color,\n _props$component = props.component,\n ComponentProp = _props$component === void 0 ? 'span' : _props$component,\n invisibleProp = props.invisible,\n _props$max = props.max,\n max = _props$max === void 0 ? 99 : _props$max,\n _props$overlap = props.overlap,\n overlap = _props$overlap === void 0 ? 'rectangle' : _props$overlap,\n _props$showZero = props.showZero,\n showZero = _props$showZero === void 0 ? false : _props$showZero,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'standard' : _props$variant,\n other = _objectWithoutProperties(props, [\"anchorOrigin\", \"badgeContent\", \"children\", \"classes\", \"className\", \"color\", \"component\", \"invisible\", \"max\", \"overlap\", \"showZero\", \"variant\"]);\n\n var invisible = invisibleProp;\n\n if (invisibleProp == null && (badgeContent === 0 && !showZero || badgeContent == null && variant !== 'dot')) {\n invisible = true;\n }\n\n var displayValue = '';\n\n if (variant !== 'dot') {\n displayValue = badgeContent > max ? \"\".concat(max, \"+\") : badgeContent;\n }\n\n return /*#__PURE__*/React.createElement(ComponentProp, _extends({\n className: clsx(classes.root, className),\n ref: ref\n }, other), children, /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(classes.badge, classes[\"\".concat(anchorOrigin.horizontal).concat(capitalize(anchorOrigin.vertical), \"}\")], classes[\"anchorOrigin\".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)).concat(capitalize(overlap))], color !== 'default' && classes[\"color\".concat(capitalize(color))], invisible && classes.invisible, variant === 'dot' && classes.dot)\n }, displayValue));\n});\nprocess.env.NODE_ENV !== \"production\" ? Badge.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The anchor of the badge.\n */\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'right']).isRequired,\n vertical: PropTypes.oneOf(['bottom', 'top']).isRequired\n }),\n\n /**\n * The content rendered within the badge.\n */\n badgeContent: PropTypes.node,\n\n /**\n * The badge will be added relative to this node.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['default', 'error', 'primary', 'secondary']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * If `true`, the badge will be invisible.\n */\n invisible: PropTypes.bool,\n\n /**\n * Max count to show.\n */\n max: PropTypes.number,\n\n /**\n * Wrapped shape the badge should overlap.\n */\n overlap: PropTypes.oneOf(['circle', 'rectangle']),\n\n /**\n * Controls whether the badge is hidden when `badgeContent` is zero.\n */\n showZero: PropTypes.bool,\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['dot', 'standard'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiBadge'\n})(Badge);","map":{"version":3,"sources":["/Users/holunyeung/Documents/GitHub/Photo_React/photo/node_modules/@material-ui/core/esm/Badge/Badge.js"],"names":["_extends","_objectWithoutProperties","React","PropTypes","clsx","withStyles","capitalize","RADIUS_STANDARD","RADIUS_DOT","styles","theme","root","position","display","verticalAlign","flexShrink","badge","flexDirection","flexWrap","justifyContent","alignContent","alignItems","boxSizing","fontFamily","typography","fontWeight","fontWeightMedium","fontSize","pxToRem","minWidth","lineHeight","padding","height","borderRadius","zIndex","transition","transitions","create","easing","easeInOut","duration","enteringScreen","colorPrimary","backgroundColor","palette","primary","main","color","contrastText","colorSecondary","secondary","colorError","error","dot","anchorOriginTopRightRectangle","top","right","transform","transformOrigin","anchorOriginBottomRightRectangle","bottom","anchorOriginTopLeftRectangle","left","anchorOriginBottomLeftRectangle","anchorOriginTopRightCircle","anchorOriginBottomRightCircle","anchorOriginTopLeftCircle","anchorOriginBottomLeftCircle","invisible","leavingScreen","Badge","forwardRef","props","ref","_props$anchorOrigin","anchorOrigin","vertical","horizontal","badgeContent","children","classes","className","_props$color","_props$component","component","ComponentProp","invisibleProp","_props$max","max","_props$overlap","overlap","_props$showZero","showZero","_props$variant","variant","other","displayValue","concat","createElement","process","env","NODE_ENV","propTypes","shape","oneOf","isRequired","node","object","string","elementType","bool","number","name"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,UAAP,MAAuB,sBAAvB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,IAAIC,eAAe,GAAG,EAAtB;AACA,IAAIC,UAAU,GAAG,CAAjB;AACA,OAAO,IAAIC,M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ends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nvar RADIUS_STANDARD = 10;\nvar RADIUS_DOT = 4;\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n position: 'relative',\n display: 'inline-flex',\n // For correct alignment with the text.\n verticalAlign: 'middle',\n flexShrink: 0\n },\n\n /* Styles applied to the badge `span` element. */\n badge: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignContent: 'center',\n alignItems: 'center',\n position: 'absolute',\n boxSizing: 'border-box',\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.pxToRem(12),\n minWidth: RADIUS_STANDARD * 2,\n lineHeight: 1,\n padding: '0 6px',\n height: RADIUS_STANDARD * 2,\n borderRadius: RADIUS_STANDARD,\n zIndex: 1,\n // Render the badge on top of potential ripples.\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeInOut,\n duration: theme.transitions.duration.enteringScreen\n })\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.primary.contrastText\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n backgroundColor: theme.palette.secondary.main,\n color: theme.palette.secondary.contrastText\n },\n\n /* Styles applied to the root element if `color=\"error\"`. */\n colorError: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText\n },\n\n /* Styles applied to the root element if `variant=\"dot\"`. */\n dot: {\n borderRadius: RADIUS_DOT,\n height: RADIUS_DOT * 2,\n minWidth: RADIUS_DOT * 2,\n padding: 0\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }} overlap=\"rectangle\"`. */\n anchorOriginTopRightRectangle: {\n top: 0,\n right: 0,\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }} overlap=\"rectangle\"`. */\n anchorOriginBottomRightRectangle: {\n bottom: 0,\n right: 0,\n transform: 'scale(1) translate(50%, 50%)',\n transformOrigin: '100% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, 50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }} overlap=\"rectangle\"`. */\n anchorOriginTopLeftRectangle: {\n top: 0,\n left: 0,\n transform: 'scale(1) translate(-50%, -50%)',\n transformOrigin: '0% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }} overlap=\"rectangle\"`. */\n anchorOriginBottomLeftRectangle: {\n bottom: 0,\n left: 0,\n transform: 'scale(1) translate(-50%, 50%)',\n transformOrigin: '0% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, 50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }} overlap=\"circle\"`. */\n anchorOriginTopRightCircle: {\n top: '14%',\n right: '14%',\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }} overlap=\"circle\"`. */\n anchorOriginBottomRightCircle: {\n bottom: '14%',\n right: '14%',\n transform: 'scale(1) translate(50%, 50%)',\n transformOrigin: '100% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(50%, 50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }} overlap=\"circle\"`. */\n anchorOriginTopLeftCircle: {\n top: '14%',\n left: '14%',\n transform: 'scale(1) translate(-50%, -50%)',\n transformOrigin: '0% 0%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, -50%)'\n }\n },\n\n /* Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }} overlap=\"circle\"`. */\n anchorOriginBottomLeftCircle: {\n bottom: '14%',\n left: '14%',\n transform: 'scale(1) translate(-50%, 50%)',\n transformOrigin: '0% 100%',\n '&$invisible': {\n transform: 'scale(0) translate(-50%, 50%)'\n }\n },\n\n /* Pseudo-class to the badge `span` element if `invisible={true}`. */\n invisible: {\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeInOut,\n duration: theme.transitions.duration.leavingScreen\n })\n }\n };\n};\nvar Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {\n var _props$anchorOrigin = props.anchorOrigin,\n anchorOrigin = _props$anchorOrigin === void 0 ? {\n vertical: 'top',\n horizontal: 'right'\n } : _props$anchorOrigin,\n badgeContent = props.badgeContent,\n children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'default' : _props$color,\n _props$component = props.component,\n ComponentProp = _props$component === void 0 ? 'span' : _props$component,\n invisibleProp = props.invisible,\n _props$max = props.max,\n max = _props$max === void 0 ? 99 : _props$max,\n _props$overlap = props.overlap,\n overlap = _props$overlap === void 0 ? 'rectangle' : _props$overlap,\n _props$showZero = props.showZero,\n showZero = _props$showZero === void 0 ? false : _props$showZero,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'standard' : _props$variant,\n other = _objectWithoutProperties(props, [\"anchorOrigin\", \"badgeContent\", \"children\", \"classes\", \"className\", \"color\", \"component\", \"invisible\", \"max\", \"overlap\", \"showZero\", \"variant\"]);\n\n var invisible = invisibleProp;\n\n if (invisibleProp == null && (badgeContent === 0 && !showZero || badgeContent == null && variant !== 'dot')) {\n invisible = true;\n }\n\n var displayValue = '';\n\n if (variant !== 'dot') {\n displayValue = badgeContent > max ? \"\".concat(max, \"+\") : badgeContent;\n }\n\n return /*#__PURE__*/React.createElement(ComponentProp, _extends({\n className: clsx(classes.root, className),\n ref: ref\n }, other), children, /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(classes.badge, classes[\"\".concat(anchorOrigin.horizontal).concat(capitalize(anchorOrigin.vertical), \"}\")], classes[\"anchorOrigin\".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)).concat(capitalize(overlap))], color !== 'default' && classes[\"color\".concat(capitalize(color))], invisible && classes.invisible, variant === 'dot' && classes.dot)\n }, displayValue));\n});\nprocess.env.NODE_ENV !== \"production\" ? Badge.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The anchor of the badge.\n */\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'right']).isRequired,\n vertical: PropTypes.oneOf(['bottom', 'top']).isRequired\n }),\n\n /**\n * The content rendered within the badge.\n */\n badgeContent: PropTypes.node,\n\n /**\n * The badge will be added relative to this node.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['default', 'error', 'primary', 'secondary']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * If `true`, the badge will be invisible.\n */\n invisible: PropTypes.bool,\n\n /**\n * Max count to show.\n */\n max: PropTypes.number,\n\n /**\n * Wrapped shape the badge should overlap.\n */\n overlap: PropTypes.oneOf(['circle', 'rectangle']),\n\n /**\n * Controls whether the badge is hidden when `badgeContent` is zero.\n */\n showZero: PropTypes.bool,\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['dot', 'standard'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiBadge'\n})(Badge);"]},"metadata":{},"sourceType":"module"}
|