PromoCursed/node_modules/.cache/babel-loader/29afb4d8c38aeb640829473be6653947210d22c98d21528b639d64f161397e55.json

1 line
10 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"component\", \"viewBox\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"children\"];\n// Seems this is used for iconFont\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposeRef } from \"rc-util/es/ref\";\nimport Context from \"./Context\";\nimport { svgBaseProps, warning, useInsertStyles } from \"../utils\";\nvar Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var className = props.className,\n Component = props.component,\n viewBox = props.viewBox,\n spin = props.spin,\n rotate = props.rotate,\n tabIndex = props.tabIndex,\n onClick = props.onClick,\n children = props.children,\n restProps = _objectWithoutProperties(props, _excluded);\n var iconRef = React.useRef();\n var mergedRef = useComposeRef(iconRef, ref);\n warning(Boolean(Component || children), 'Should have `component` prop or `children`.');\n useInsertStyles(iconRef);\n var _React$useContext = React.useContext(Context),\n _React$useContext$pre = _React$useContext.prefixCls,\n prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,\n rootClassName = _React$useContext.rootClassName;\n var classString = classNames(rootClassName, prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-spin\"), !!spin && !!Component), className);\n var svgClassString = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-spin\"), !!spin));\n var svgStyle = rotate ? {\n msTransform: \"rotate(\".concat(rotate, \"deg)\"),\n transform: \"rotate(\".concat(rotate, \"deg)\")\n } : undefined;\n var innerSvgProps = _objectSpread(_objectSpread({}, svgBaseProps), {}, {\n className: svgClassString,\n style: svgStyle,\n viewBox: viewBox\n });\n if (!viewBox) {\n delete innerSvgProps.viewBox;\n }\n\n // component > children\n var renderInnerNode = function renderInnerNode() {\n if (Component) {\n return /*#__PURE__*/React.createElement(Component, innerSvgProps, children);\n }\n if (children) {\n warning(Boolean(viewBox) || React.Children.count(children) === 1 && /*#__PURE__*/React.isValidElement(children) && React.Children.only(children).type === 'use', 'Make sure that you provide correct `viewBox`' + ' prop (default `0 0 1024 1024`) to the icon.');\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, innerSvgProps, {\n viewBox: viewBox\n }), children);\n }\n return null;\n };\n var iconTabIndex = tabIndex;\n if (iconTabIndex === undefined && onClick) {\n iconTabIndex = -1;\n }\n return /*#__PURE__*/React.createElement(\"span\", _extends({\n role: \"img\"\n }, restProps, {\n ref: mergedRef,\n tabIndex: iconTabIndex,\n onClick: onClick,\n className: classString\n }), renderInnerNode());\n});\nIcon.displayName = 'AntdIcon';\nexport default Icon;","map":{"version":3,"names":["_extends","_objectSpread","_defineProperty","_objectWithoutProperties","_excluded","React","classNames","useComposeRef","Context","svgBaseProps","warning","useInsertStyles","Icon","forwardRef","props","ref","className","Component","component","viewBox","spin","rotate","tabIndex","onClick","children","restProps","iconRef","useRef","mergedRef","Boolean","_React$useContext","useContext","_React$useContext$pre","prefixCls","rootClassName","classString","concat","svgClassString","svgStyle","msTransform","transform","undefined","innerSvgProps","style","renderInnerNode","createElement","Children","count","isValidElement","only","type","iconTabIndex","role","displayName"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/@ant-design/icons/es/components/Icon.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/e