7a7fb2b8c7fb923f2e86f7f1c2e62543.json
15.5 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\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 { ListContext } from './index';\nimport { Col } from '../grid';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nexport var Meta = function Meta(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n avatar = _a.avatar,\n title = _a.title,\n description = _a.description,\n others = __rest(_a, [\"prefixCls\", \"className\", \"avatar\", \"title\", \"description\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var classString = classNames(\"\".concat(prefixCls, \"-item-meta\"), className);\n var content = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-content\")\n }, title && /*#__PURE__*/React.createElement(\"h4\", {\n className: \"\".concat(prefixCls, \"-item-meta-title\")\n }, title), description && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-description\")\n }, description));\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classString\n }), avatar && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-avatar\")\n }, avatar), (title || description) && content);\n};\n\nvar Item = function Item(_a) {\n var customizePrefixCls = _a.prefixCls,\n children = _a.children,\n actions = _a.actions,\n extra = _a.extra,\n className = _a.className,\n colStyle = _a.colStyle,\n others = __rest(_a, [\"prefixCls\", \"children\", \"actions\", \"extra\", \"className\", \"colStyle\"]);\n\n var _React$useContext2 = React.useContext(ListContext),\n grid = _React$useContext2.grid,\n itemLayout = _React$useContext2.itemLayout;\n\n var _React$useContext3 = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext3.getPrefixCls;\n\n var isItemContainsTextNodeAndNotSingular = function isItemContainsTextNodeAndNotSingular() {\n var result;\n React.Children.forEach(children, function (element) {\n if (typeof element === 'string') {\n result = true;\n }\n });\n return result && React.Children.count(children) > 1;\n };\n\n var isFlexMode = function isFlexMode() {\n if (itemLayout === 'vertical') {\n return !!extra;\n }\n\n return !isItemContainsTextNodeAndNotSingular();\n };\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var actionsContent = actions && actions.length > 0 && /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-item-action\"),\n key: \"actions\"\n }, actions.map(function (action, i) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n key: \"\".concat(prefixCls, \"-item-action-\").concat(i)\n }, action, i !== actions.length - 1 && /*#__PURE__*/React.createElement(\"em\", {\n className: \"\".concat(prefixCls, \"-item-action-split\")\n }))\n );\n }));\n var Element = grid ? 'div' : 'li';\n var itemChildren = /*#__PURE__*/React.createElement(Element, _extends({}, others, {\n // `li` element `onCopy` prop args is not same as `div`\n className: classNames(\"\".concat(prefixCls, \"-item\"), _defineProperty({}, \"\".concat(prefixCls, \"-item-no-flex\"), !isFlexMode()), className)\n }), itemLayout === 'vertical' && extra ? [/*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-main\"),\n key: \"content\"\n }, children, actionsContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-extra\"),\n key: \"extra\"\n }, extra)] : [children, actionsContent, cloneElement(extra, {\n key: 'extra'\n })]);\n return grid ? /*#__PURE__*/React.createElement(Col, {\n flex: 1,\n style: colStyle\n }, itemChildren) : itemChildren;\n};\n\nItem.Meta = Meta;\nexport default Item;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/list/Item.js"],"names":["_defineProperty","_extends","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","ListContext","Col","ConfigContext","cloneElement","Meta","_a","customizePrefixCls","prefixCls","className","avatar","title","description","others","_React$useContext","useContext","getPrefixCls","classString","concat","content","createElement","Item","children","actions","extra","colStyle","_React$useContext2","grid","itemLayout","_React$useContext3","isItemContainsTextNodeAndNotSingular","result","Children","forEach","element","count","isFlexMode","actionsContent","key","map","action","Element","itemChildren","flex","style"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;;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,EAAWP,CAAC,GAAGC,MAAM,CAACK,qBAAP,CAA6BT,CAA7B,CAApB,EAAqDU,CAAC,GAAGP,CAAC,CAACQ,MAA3D,EAAmED,CAAC,EAApE,EAAwE;AAC3I,QAAI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KAAK,CAACqB,aAAN,CAAoB,KAApB,EAA2B;AACpEX,IAAAA,SAAS,EAAE,GAAGS,MAAH,CAAUV,SAAV,EAAqB,aAArB,CADyD;AAEpE8B,IAAAA,GAAG,EAAE;AAF+D,GAA3B,EAGxCd,KAHwC,CAHF,CAArC,GAMS,CAACF,QAAD,EAAWe,cAAX,EAA2BjC,YAAY,CAACoB,KAAD,EAAQ;AAC1Dc,IAAAA,GAAG,EAAE;AADqD,GAAR,CAAvC,CATmB,CAAhC;AAYA,SAAOX,IAAI,GAAG,aAAa5B,KAAK,CAACqB,aAAN,CAAoBlB,GAApB,EAAyB;AAClDyC,IAAAA,IAAI,EAAE,CAD4C;AAElDC,IAAAA,KAAK,EAAEnB;AAF2C,GAAzB,EAGxBiB,YAHwB,CAAhB,GAGQA,YAHnB;AAID,CAlED;;AAoEArB,IAAI,CAAChB,IAAL,GAAYA,IAAZ;AACA,eAAegB,IAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\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 { ListContext } from './index';\nimport { Col } from '../grid';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nexport var Meta = function Meta(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n avatar = _a.avatar,\n title = _a.title,\n description = _a.description,\n others = __rest(_a, [\"prefixCls\", \"className\", \"avatar\", \"title\", \"description\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var classString = classNames(\"\".concat(prefixCls, \"-item-meta\"), className);\n var content = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-content\")\n }, title && /*#__PURE__*/React.createElement(\"h4\", {\n className: \"\".concat(prefixCls, \"-item-meta-title\")\n }, title), description && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-description\")\n }, description));\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classString\n }), avatar && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-avatar\")\n }, avatar), (title || description) && content);\n};\n\nvar Item = function Item(_a) {\n var customizePrefixCls = _a.prefixCls,\n children = _a.children,\n actions = _a.actions,\n extra = _a.extra,\n className = _a.className,\n colStyle = _a.colStyle,\n others = __rest(_a, [\"prefixCls\", \"children\", \"actions\", \"extra\", \"className\", \"colStyle\"]);\n\n var _React$useContext2 = React.useContext(ListContext),\n grid = _React$useContext2.grid,\n itemLayout = _React$useContext2.itemLayout;\n\n var _React$useContext3 = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext3.getPrefixCls;\n\n var isItemContainsTextNodeAndNotSingular = function isItemContainsTextNodeAndNotSingular() {\n var result;\n React.Children.forEach(children, function (element) {\n if (typeof element === 'string') {\n result = true;\n }\n });\n return result && React.Children.count(children) > 1;\n };\n\n var isFlexMode = function isFlexMode() {\n if (itemLayout === 'vertical') {\n return !!extra;\n }\n\n return !isItemContainsTextNodeAndNotSingular();\n };\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var actionsContent = actions && actions.length > 0 && /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-item-action\"),\n key: \"actions\"\n }, actions.map(function (action, i) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n key: \"\".concat(prefixCls, \"-item-action-\").concat(i)\n }, action, i !== actions.length - 1 && /*#__PURE__*/React.createElement(\"em\", {\n className: \"\".concat(prefixCls, \"-item-action-split\")\n }))\n );\n }));\n var Element = grid ? 'div' : 'li';\n var itemChildren = /*#__PURE__*/React.createElement(Element, _extends({}, others, {\n // `li` element `onCopy` prop args is not same as `div`\n className: classNames(\"\".concat(prefixCls, \"-item\"), _defineProperty({}, \"\".concat(prefixCls, \"-item-no-flex\"), !isFlexMode()), className)\n }), itemLayout === 'vertical' && extra ? [/*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-main\"),\n key: \"content\"\n }, children, actionsContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-extra\"),\n key: \"extra\"\n }, extra)] : [children, actionsContent, cloneElement(extra, {\n key: 'extra'\n })]);\n return grid ? /*#__PURE__*/React.createElement(Col, {\n flex: 1,\n style: colStyle\n }, itemChildren) : itemChildren;\n};\n\nItem.Meta = Meta;\nexport default Item;"]},"metadata":{},"sourceType":"module"}