665087f7a0f6fa33e278e0b1e9a9125c.json
15.1 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport CheckableTag from './CheckableTag';\nimport { ConfigContext } from '../config-provider';\nimport { PresetColorTypes, PresetStatusColorTypes } from '../_util/colors';\nimport Wave from '../_util/wave';\nvar PresetColorRegex = new RegExp(\"^(\".concat(PresetColorTypes.join('|'), \")(-inverse)?$\"));\nvar PresetStatusColorRegex = new RegExp(\"^(\".concat(PresetStatusColorTypes.join('|'), \")$\"));\n\nvar InternalTag = function InternalTag(_a, ref) {\n var _classNames;\n\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n style = _a.style,\n children = _a.children,\n icon = _a.icon,\n color = _a.color,\n onClose = _a.onClose,\n closeIcon = _a.closeIcon,\n _a$closable = _a.closable,\n closable = _a$closable === void 0 ? false : _a$closable,\n props = __rest(_a, [\"prefixCls\", \"className\", \"style\", \"children\", \"icon\", \"color\", \"onClose\", \"closeIcon\", \"closable\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var _React$useState = React.useState(true),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n visible = _React$useState2[0],\n setVisible = _React$useState2[1];\n\n React.useEffect(function () {\n if ('visible' in props) {\n setVisible(props.visible);\n }\n }, [props.visible]);\n\n var isPresetColor = function isPresetColor() {\n if (!color) {\n return false;\n }\n\n return PresetColorRegex.test(color) || PresetStatusColorRegex.test(color);\n };\n\n var tagStyle = _extends({\n backgroundColor: color && !isPresetColor() ? color : undefined\n }, style);\n\n var presetColor = isPresetColor();\n var prefixCls = getPrefixCls('tag', customizePrefixCls);\n var tagClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(color), presetColor), _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-color\"), color && !presetColor), _defineProperty(_classNames, \"\".concat(prefixCls, \"-hidden\"), !visible), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n\n var handleCloseClick = function handleCloseClick(e) {\n e.stopPropagation();\n\n if (onClose) {\n onClose(e);\n }\n\n if (e.defaultPrevented) {\n return;\n }\n\n if (!('visible' in props)) {\n setVisible(false);\n }\n };\n\n var renderCloseIcon = function renderCloseIcon() {\n if (closable) {\n return closeIcon ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n onClick: handleCloseClick\n }, closeIcon) : /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n onClick: handleCloseClick\n });\n }\n\n return null;\n };\n\n var isNeedWave = 'onClick' in props || children && children.type === 'a';\n var tagProps = omit(props, ['visible']);\n var iconNode = icon || null;\n var kids = iconNode ? /*#__PURE__*/React.createElement(React.Fragment, null, iconNode, /*#__PURE__*/React.createElement(\"span\", null, children)) : children;\n var tagNode = /*#__PURE__*/React.createElement(\"span\", _extends({}, tagProps, {\n ref: ref,\n className: tagClassName,\n style: tagStyle\n }), kids, renderCloseIcon());\n return isNeedWave ? /*#__PURE__*/React.createElement(Wave, null, tagNode) : tagNode;\n};\n\nvar Tag = /*#__PURE__*/React.forwardRef(InternalTag);\nTag.displayName = 'Tag';\nTag.CheckableTag = CheckableTag;\nexport default Tag;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/tag/index.js"],"names":["_defineProperty","_extends","_slicedToArray","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","omit","CloseOutlined","CheckableTag","ConfigContext","PresetColorTypes","PresetStatusColorTypes","Wave","PresetColorRegex","RegExp","concat","join","PresetStatusColorRegex","InternalTag","_a","ref","_classNames","customizePrefixCls","prefixCls","className","style","children","icon","color","onClose","closeIcon","_a$closable","closable","props","_React$useContext","useContext","getPrefixCls","direction","_React$useState","useState","_React$useState2","visible","setVisible","useEffect","isPresetColor","test","tagStyle","backgroundColor","undefined","presetColor","tagClassName","handleCloseClick","stopPropagation","defaultPrevented","renderCloseIcon","createElement","onClick","isNeedWave","type","tagProps","iconNode","kids","Fragment","tagNode","Tag","forwardRef","displayName"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;AACA,OAAOC,cAAP,MAA2B,sCAA3B;;AAEA,IAAIC,MAAM,GAAG,QAAQ,KAAKA,MAAb,IAAuB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;AAClD,MAAIC,CAAC,GAAG,EAAR;;AAEA,OAAK,IAAIC,CAAT,IAAcH,CAAd,EAAiB;AACf,QAAII,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCP,CAArC,EAAwCG,CAAxC,KAA8CF,CAAC,CAACO,OAAF,CAAUL,CAAV,IAAe,CAAjE,EAAoED,CAAC,CAACC,CAAD,CAAD,GAAOH,CAAC,CAACG,CAAD,CAAR;AACrE;;AAED,MAAIH,CAAC,IAAI,IAAL,IAAa,OAAOI,MAAM,CAACK,qBAAd,KAAwC,UAAzD,EAAqE,KAAK,IAAIC,CAAC,GAAG,CAAR,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EvC,IAAAA,GAAG,EAAEA,GADuE;AAE5EI,IAAAA,SAAS,EAAE0B,YAFiE;AAG5EzB,IAAAA,KAAK,EAAEqB;AAHqE,GAAf,CAApC,EAIvBe,IAJuB,EAIjBP,eAAe,EAJE,CAA3B;AAKA,SAAOG,UAAU,GAAG,aAAarD,KAAK,CAACmD,aAAN,CAAoB3C,IAApB,EAA0B,IAA1B,EAAgCmD,OAAhC,CAAhB,GAA2DA,OAA5E;AACD,CAtFD;;AAwFA,IAAIC,GAAG,GAAG,aAAa5D,KAAK,CAAC6D,UAAN,CAAiB/C,WAAjB,CAAvB;AACA8C,GAAG,CAACE,WAAJ,GAAkB,KAAlB;AACAF,GAAG,CAACxD,YAAJ,GAAmBA,YAAnB;AACA,eAAewD,GAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport CheckableTag from './CheckableTag';\nimport { ConfigContext } from '../config-provider';\nimport { PresetColorTypes, PresetStatusColorTypes } from '../_util/colors';\nimport Wave from '../_util/wave';\nvar PresetColorRegex = new RegExp(\"^(\".concat(PresetColorTypes.join('|'), \")(-inverse)?$\"));\nvar PresetStatusColorRegex = new RegExp(\"^(\".concat(PresetStatusColorTypes.join('|'), \")$\"));\n\nvar InternalTag = function InternalTag(_a, ref) {\n var _classNames;\n\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n style = _a.style,\n children = _a.children,\n icon = _a.icon,\n color = _a.color,\n onClose = _a.onClose,\n closeIcon = _a.closeIcon,\n _a$closable = _a.closable,\n closable = _a$closable === void 0 ? false : _a$closable,\n props = __rest(_a, [\"prefixCls\", \"className\", \"style\", \"children\", \"icon\", \"color\", \"onClose\", \"closeIcon\", \"closable\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var _React$useState = React.useState(true),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n visible = _React$useState2[0],\n setVisible = _React$useState2[1];\n\n React.useEffect(function () {\n if ('visible' in props) {\n setVisible(props.visible);\n }\n }, [props.visible]);\n\n var isPresetColor = function isPresetColor() {\n if (!color) {\n return false;\n }\n\n return PresetColorRegex.test(color) || PresetStatusColorRegex.test(color);\n };\n\n var tagStyle = _extends({\n backgroundColor: color && !isPresetColor() ? color : undefined\n }, style);\n\n var presetColor = isPresetColor();\n var prefixCls = getPrefixCls('tag', customizePrefixCls);\n var tagClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(color), presetColor), _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-color\"), color && !presetColor), _defineProperty(_classNames, \"\".concat(prefixCls, \"-hidden\"), !visible), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n\n var handleCloseClick = function handleCloseClick(e) {\n e.stopPropagation();\n\n if (onClose) {\n onClose(e);\n }\n\n if (e.defaultPrevented) {\n return;\n }\n\n if (!('visible' in props)) {\n setVisible(false);\n }\n };\n\n var renderCloseIcon = function renderCloseIcon() {\n if (closable) {\n return closeIcon ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n onClick: handleCloseClick\n }, closeIcon) : /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n onClick: handleCloseClick\n });\n }\n\n return null;\n };\n\n var isNeedWave = 'onClick' in props || children && children.type === 'a';\n var tagProps = omit(props, ['visible']);\n var iconNode = icon || null;\n var kids = iconNode ? /*#__PURE__*/React.createElement(React.Fragment, null, iconNode, /*#__PURE__*/React.createElement(\"span\", null, children)) : children;\n var tagNode = /*#__PURE__*/React.createElement(\"span\", _extends({}, tagProps, {\n ref: ref,\n className: tagClassName,\n style: tagStyle\n }), kids, renderCloseIcon());\n return isNeedWave ? /*#__PURE__*/React.createElement(Wave, null, tagNode) : tagNode;\n};\n\nvar Tag = /*#__PURE__*/React.forwardRef(InternalTag);\nTag.displayName = 'Tag';\nTag.CheckableTag = CheckableTag;\nexport default Tag;"]},"metadata":{},"sourceType":"module"}