1 line
12 KiB
JSON
1 line
12 KiB
JSON
|
{"ast":null,"code":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\").default;\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\nvar _ref = require(\"rc-util/lib/ref\");\nvar _Context = _interopRequireDefault(require(\"./Context\"));\nvar _utils = require(\"../utils\");\nvar _excluded = [\"className\", \"component\", \"viewBox\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"children\"]; // Seems this is used for iconFont\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 = (0, _objectWithoutProperties2.default)(props, _excluded);\n var iconRef = React.useRef();\n var mergedRef = (0, _ref.useComposeRef)(iconRef, ref);\n (0, _utils.warning)(Boolean(Component || children), 'Should have `component` prop or `children`.');\n (0, _utils.useInsertStyles)(iconRef);\n var _React$useContext = React.useContext(_Context.default),\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 = (0, _classnames.default)(rootClassName, prefixCls, (0, _defineProperty2.default)({}, \"\".concat(prefixCls, \"-spin\"), !!spin && !!Component), className);\n var svgClassString = (0, _classnames.default)((0, _defineProperty2.default)({}, \"\".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 = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _utils.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 (0, _utils.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\", (0, _extends2.default)({}, 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\", (0, _extends2.default)({\n role: \"img\"\n }, restProps, {\n ref: mergedRef,\n tabIndex: iconTabIndex,\n onClick: onClick,\n className: classString\n }), renderInnerNode());\n});\nIcon.displayName = 'AntdIcon';\nvar _default = exports.default = Icon;","map":{"version":3,"names":["_interopRequireDefault","require","default","_interopRequireWildcard","Object","defineProperty","exports","value","_extends2","_objectSpread2","_defineProperty2","_objectWithoutProperties2","React","_cl
|