34a8f91f1fa9f27324d12838706d8011.json
11.2 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\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 { ConfigContext } from '../config-provider';\n\nvar Comment = function Comment(_a) {\n var actions = _a.actions,\n author = _a.author,\n avatar = _a.avatar,\n children = _a.children,\n className = _a.className,\n content = _a.content,\n customizePrefixCls = _a.prefixCls,\n datetime = _a.datetime,\n otherProps = __rest(_a, [\"actions\", \"author\", \"avatar\", \"children\", \"className\", \"content\", \"prefixCls\", \"datetime\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var renderNested = function renderNested(prefixCls, nestedChildren) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-nested\"))\n }, nestedChildren);\n };\n\n var prefixCls = getPrefixCls('comment', customizePrefixCls);\n var avatarDom = avatar ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-avatar\")\n }, typeof avatar === 'string' ? /*#__PURE__*/React.createElement(\"img\", {\n src: avatar,\n alt: \"comment-avatar\"\n }) : avatar) : null;\n var actionDom = actions && actions.length ? /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-actions\")\n }, actions.map(function (action, index) {\n return /*#__PURE__*/React.createElement(\"li\", {\n key: \"action-\".concat(index)\n }, action) // eslint-disable-line react/no-array-index-key\n ;\n })) : null;\n var authorContent = (author || datetime) && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-author\")\n }, author && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-author-name\")\n }, author), datetime && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-author-time\")\n }, datetime));\n var contentDom = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, authorContent, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-detail\")\n }, content), actionDom);\n var cls = classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, otherProps, {\n className: cls\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner\")\n }, avatarDom, contentDom), children ? renderNested(prefixCls, children) : null);\n};\n\nexport default Comment;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/comment/index.js"],"names":["_extends","_defineProperty","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","ConfigContext","Comment","_a","actions","author","avatar","children","className","content","customizePrefixCls","prefixCls","datetime","otherProps","_React$useContext","useContext","getPrefixCls","direction","renderNested","nestedChildren","createElement","concat","avatarDom","src","alt","actionDom","map","action","index","key","authorContent","contentDom","cls"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAOC,eAAP,MAA4B,uCAA5B;;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,S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gB,SAJiB,CAA9B;AAKA,MAAIO,GAAG,GAAGhC,UAAU,CAACW,SAAD,EAAY3B,eAAe,CAAC,EAAD,EAAK,GAAGqC,MAAH,CAAUV,SAAV,EAAqB,MAArB,CAAL,EAAmCM,SAAS,KAAK,KAAjD,CAA3B,EAAoFT,SAApF,CAApB;AACA,SAAO,aAAaT,KAAK,CAACqB,aAAN,CAAoB,KAApB,EAA2BrC,QAAQ,CAAC,EAAD,EAAK8B,UAAL,EAAiB;AACtEL,IAAAA,SAAS,EAAEwB;AAD2D,GAAjB,CAAnC,EAEhB,aAAajC,KAAK,CAACqB,aAAN,CAAoB,KAApB,EAA2B;AAC1CZ,IAAAA,SAAS,EAAE,GAAGa,MAAH,CAAUV,SAAV,EAAqB,QAArB;AAD+B,GAA3B,EAEdW,SAFc,EAEHS,UAFG,CAFG,EAIOxB,QAAQ,GAAGW,YAAY,CAACP,SAAD,EAAYJ,QAAZ,CAAf,GAAuC,IAJtD,CAApB;AAKD,CAtDD;;AAwDA,eAAeL,OAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\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 { ConfigContext } from '../config-provider';\n\nvar Comment = function Comment(_a) {\n var actions = _a.actions,\n author = _a.author,\n avatar = _a.avatar,\n children = _a.children,\n className = _a.className,\n content = _a.content,\n customizePrefixCls = _a.prefixCls,\n datetime = _a.datetime,\n otherProps = __rest(_a, [\"actions\", \"author\", \"avatar\", \"children\", \"className\", \"content\", \"prefixCls\", \"datetime\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var renderNested = function renderNested(prefixCls, nestedChildren) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-nested\"))\n }, nestedChildren);\n };\n\n var prefixCls = getPrefixCls('comment', customizePrefixCls);\n var avatarDom = avatar ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-avatar\")\n }, typeof avatar === 'string' ? /*#__PURE__*/React.createElement(\"img\", {\n src: avatar,\n alt: \"comment-avatar\"\n }) : avatar) : null;\n var actionDom = actions && actions.length ? /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-actions\")\n }, actions.map(function (action, index) {\n return /*#__PURE__*/React.createElement(\"li\", {\n key: \"action-\".concat(index)\n }, action) // eslint-disable-line react/no-array-index-key\n ;\n })) : null;\n var authorContent = (author || datetime) && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-author\")\n }, author && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-author-name\")\n }, author), datetime && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-author-time\")\n }, datetime));\n var contentDom = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, authorContent, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-detail\")\n }, content), actionDom);\n var cls = classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, otherProps, {\n className: cls\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner\")\n }, avatarDom, contentDom), children ? renderNested(prefixCls, children) : null);\n};\n\nexport default Comment;"]},"metadata":{},"sourceType":"module"}