267ac7cfdddc4810eaebe27df4b68251.json
6.38 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport { isPresetColor } from './utils';\n\nvar Ribbon = function Ribbon(_ref) {\n var _classNames;\n\n var className = _ref.className,\n customizePrefixCls = _ref.prefixCls,\n style = _ref.style,\n color = _ref.color,\n children = _ref.children,\n text = _ref.text,\n _ref$placement = _ref.placement,\n placement = _ref$placement === void 0 ? 'end' : _ref$placement;\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n var colorInPreset = isPresetColor(color);\n var ribbonCls = classNames(prefixCls, \"\".concat(prefixCls, \"-placement-\").concat(placement), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-color-\").concat(color), colorInPreset), _classNames), className);\n var colorStyle = {};\n var cornerColorStyle = {};\n\n if (color && !colorInPreset) {\n colorStyle.background = color;\n cornerColorStyle.color = color;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-wrapper\")\n }, children, /*#__PURE__*/React.createElement(\"div\", {\n className: ribbonCls,\n style: _extends(_extends({}, colorStyle), style)\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-text\")\n }, text), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-corner\"),\n style: cornerColorStyle\n })));\n};\n\nexport default Ribbon;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/badge/Ribbon.js"],"names":["_extends","_defineProperty","React","classNames","ConfigContext","isPresetColor","Ribbon","_ref","_classNames","className","customizePrefixCls","prefixCls","style","color","children","text","_ref$placement","placement","_React$useContext","useContext","getPrefixCls","direction","colorInPreset","ribbonCls","concat","colorStyle","cornerColorStyle","background","createElement"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,aAAT,QAA8B,SAA9B;;AAEA,IAAIC,MAAM,GAAG,SAASA,MAAT,CAAgBC,IAAhB,EAAsB;AACjC,MAAIC,WAAJ;;AAEA,MAAIC,SAAS,GAAGF,IAAI,CAACE,SAArB;AAAA,MACIC,kBAAkB,GAAGH,IAAI,CAACI,SAD9B;AAAA,MAEIC,KAAK,GAAGL,IAAI,CAACK,KAFjB;AAAA,MAGIC,KAAK,GAAGN,IAAI,CAACM,KAHjB;AAAA,MAIIC,QAAQ,GAAGP,IAAI,CAACO,QAJpB;AAAA,MAKIC,IAAI,GAAGR,IAAI,CAACQ,IALhB;AAAA,MAMIC,cAAc,GAAGT,IAAI,CAACU,SAN1B;AAAA,MAOIA,SAAS,GAAGD,cAAc,KAAK,KAAK,CAAxB,GAA4B,KAA5B,GAAoCA,cAPpD;;AASA,MAAIE,iBAAiB,GAAGhB,KAAK,CAACiB,UAAN,CAAiBf,aAAjB,CAAxB;AAAA,MACIgB,YAAY,GAAGF,iBAAiB,CAACE,YADrC;AAAA,MAEIC,SAAS,GAAGH,iBAAiB,CAACG,SAFlC;;AAIA,MAAIV,SAAS,GAAGS,YAAY,CAAC,QAAD,EAAWV,kBAAX,CAA5B;AACA,MAAIY,aAAa,GAAGjB,aAAa,CAACQ,KAAD,CAAjC;AACA,MAAIU,SAAS,GAAGpB,UAAU,CAACQ,SAAD,EAAY,GAAGa,MAAH,CAAUb,SAAV,EAAqB,aAArB,EAAoCa,MAApC,CAA2CP,SAA3C,CAAZ,GAAoET,WAAW,G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AtCD;;AAwCA,eAAepB,MAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport { isPresetColor } from './utils';\n\nvar Ribbon = function Ribbon(_ref) {\n var _classNames;\n\n var className = _ref.className,\n customizePrefixCls = _ref.prefixCls,\n style = _ref.style,\n color = _ref.color,\n children = _ref.children,\n text = _ref.text,\n _ref$placement = _ref.placement,\n placement = _ref$placement === void 0 ? 'end' : _ref$placement;\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n var colorInPreset = isPresetColor(color);\n var ribbonCls = classNames(prefixCls, \"\".concat(prefixCls, \"-placement-\").concat(placement), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-color-\").concat(color), colorInPreset), _classNames), className);\n var colorStyle = {};\n var cornerColorStyle = {};\n\n if (color && !colorInPreset) {\n colorStyle.background = color;\n cornerColorStyle.color = color;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-wrapper\")\n }, children, /*#__PURE__*/React.createElement(\"div\", {\n className: ribbonCls,\n style: _extends(_extends({}, colorStyle), style)\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-text\")\n }, text), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-corner\"),\n style: cornerColorStyle\n })));\n};\n\nexport default Ribbon;"]},"metadata":{},"sourceType":"module"}