PromoCursed/node_modules/.cache/babel-loader/14df60fea287a7a81a77b21c87634cfa070dd16970a663e07cb43b508f6b08a3.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/Аришина)/Desktop/promo/node_modules/@ant-design/icons/es/components/Icon.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\