ab1b6682a792b6e73079a96914fdd987.json
25.4 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 omit from 'omit.js';\nimport Grid from './Grid';\nimport Meta from './Meta';\nimport Tabs from '../tabs';\nimport Row from '../row';\nimport Col from '../col';\nimport { ConfigContext } from '../config-provider';\nimport SizeContext from '../config-provider/SizeContext';\n\nfunction getAction(actions) {\n var actionList = actions.map(function (action, index) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n style: {\n width: \"\".concat(100 / actions.length, \"%\")\n },\n key: \"action-\".concat(index)\n }, /*#__PURE__*/React.createElement(\"span\", null, action))\n );\n });\n return actionList;\n}\n\nvar Card = function Card(props) {\n var _extends2, _classNames;\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var size = React.useContext(SizeContext);\n\n var onTabChange = function onTabChange(key) {\n if (props.onTabChange) {\n props.onTabChange(key);\n }\n };\n\n var isContainGrid = function isContainGrid() {\n var containGrid;\n React.Children.forEach(props.children, function (element) {\n if (element && element.type && element.type === Grid) {\n containGrid = true;\n }\n });\n return containGrid;\n };\n\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n extra = props.extra,\n _props$headStyle = props.headStyle,\n headStyle = _props$headStyle === void 0 ? {} : _props$headStyle,\n _props$bodyStyle = props.bodyStyle,\n bodyStyle = _props$bodyStyle === void 0 ? {} : _props$bodyStyle,\n title = props.title,\n loading = props.loading,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n customizeSize = props.size,\n type = props.type,\n cover = props.cover,\n actions = props.actions,\n tabList = props.tabList,\n children = props.children,\n activeTabKey = props.activeTabKey,\n defaultActiveTabKey = props.defaultActiveTabKey,\n tabBarExtraContent = props.tabBarExtraContent,\n hoverable = props.hoverable,\n _props$tabProps = props.tabProps,\n tabProps = _props$tabProps === void 0 ? {} : _props$tabProps,\n others = __rest(props, [\"prefixCls\", \"className\", \"extra\", \"headStyle\", \"bodyStyle\", \"title\", \"loading\", \"bordered\", \"size\", \"type\", \"cover\", \"actions\", \"tabList\", \"children\", \"activeTabKey\", \"defaultActiveTabKey\", \"tabBarExtraContent\", \"hoverable\", \"tabProps\"]);\n\n var prefixCls = getPrefixCls('card', customizePrefixCls);\n var loadingBlockStyle = bodyStyle.padding === 0 || bodyStyle.padding === '0px' ? {\n padding: 24\n } : undefined;\n var block = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-loading-block\")\n });\n var loadingBlock = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-loading-content\"),\n style: loadingBlockStyle\n }, /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 22\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 8\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 15\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 6\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 18\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 13\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 9\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 4\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 3\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 16\n }, block)));\n var hasActiveTabKey = activeTabKey !== undefined;\n\n var extraProps = _extends(_extends({}, tabProps), (_extends2 = {}, _defineProperty(_extends2, hasActiveTabKey ? 'activeKey' : 'defaultActiveKey', hasActiveTabKey ? activeTabKey : defaultActiveTabKey), _defineProperty(_extends2, \"tabBarExtraContent\", tabBarExtraContent), _extends2));\n\n var head;\n var tabs = tabList && tabList.length ? /*#__PURE__*/React.createElement(Tabs, _extends({\n size: \"large\"\n }, extraProps, {\n className: \"\".concat(prefixCls, \"-head-tabs\"),\n onChange: onTabChange\n }), tabList.map(function (item) {\n return /*#__PURE__*/React.createElement(Tabs.TabPane, {\n tab: item.tab,\n disabled: item.disabled,\n key: item.key\n });\n })) : null;\n\n if (title || extra || tabs) {\n head = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head\"),\n style: headStyle\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head-wrapper\")\n }, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head-title\")\n }, title), extra && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), tabs);\n }\n\n var coverDom = cover ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-cover\")\n }, cover) : null;\n var body = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-body\"),\n style: bodyStyle\n }, loading ? loadingBlock : children);\n var actionDom = actions && actions.length ? /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-actions\")\n }, getAction(actions)) : null;\n var divProps = omit(others, ['onTabChange']);\n var mergedSize = customizeSize || size;\n var classString = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-loading\"), loading), _defineProperty(_classNames, \"\".concat(prefixCls, \"-bordered\"), bordered), _defineProperty(_classNames, \"\".concat(prefixCls, \"-hoverable\"), hoverable), _defineProperty(_classNames, \"\".concat(prefixCls, \"-contain-grid\"), isContainGrid()), _defineProperty(_classNames, \"\".concat(prefixCls, \"-contain-tabs\"), tabList && tabList.length), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(mergedSize), mergedSize), _defineProperty(_classNames, \"\".concat(prefixCls, \"-type-\").concat(type), !!type), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, divProps, {\n className: classString\n }), head, coverDom, body, actionDom);\n};\n\nCard.Grid = Grid;\nCard.Meta = Meta;\nexport default Card;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/card/index.js"],"names":["_defineProperty","_extends","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","omit","Grid","Meta","Tabs","Row","Col","ConfigContext","SizeContext","getAction","actions","actionList","map","action","index","createElement","style","width","concat","key","Card","props","_extends2","_classNames","_React$useContext","useContext","getPrefixCls","direction","size","onTabChange","isContainGrid","containGrid","Children","forEach","children","element","type","customizePrefixCls","prefixCls","className","extra","_props$headStyle","headStyle","_props$bodyStyle","bodyStyle","title","loading","_props$bordered","bordered","customizeSize","cover","tabList","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","_props$tabProps","tabProps","others","loadingBlockStyle","padding","undefined","block","loadingBlock","gutter","span","hasActiveTabKey","extraProps","head","tabs","onChange","item","TabPane","tab","disabled","coverDom","body","actionDom","divProps","mergedSize","classString"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;;AAEA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,EAAyad,eAAe,CAACwC,WAAD,EAAc,GAAGL,MAAH,CAAUoB,SAAV,EAAqB,GAArB,EAA0BpB,MAA1B,CAAiC6D,UAAjC,CAAd,EAA4DA,UAA5D,CAAxb,EAAigBhG,eAAe,CAACwC,WAAD,EAAc,GAAGL,MAAH,CAAUoB,SAAV,EAAqB,QAArB,EAA+BpB,MAA/B,CAAsCkB,IAAtC,CAAd,EAA2D,CAAC,CAACA,IAA7D,CAAhhB,EAAolBrD,eAAe,CAACwC,WAAD,EAAc,GAAGL,MAAH,CAAUoB,SAAV,EAAqB,MAArB,CAAd,EAA4CX,SAAS,KAAK,KAA1D,CAAnmB,EAAqqBJ,WAAlrB,GAAgsBgB,SAAhsB,CAA5B;AACA,SAAO,aAAaxC,KAAK,CAACgB,aAAN,CAAoB,KAApB,EAA2B/B,QAAQ,CAAC,EAAD,EAAK8F,QAAL,EAAe;AACpEvC,IAAAA,SAAS,EAAEyC;AADyD,GAAf,CAAnC,EAEhBZ,IAFgB,EAEVO,QAFU,EAEAC,IAFA,EAEMC,SAFN,CAApB;AAGD,CA1ID;;AA4IAzD,IAAI,CAAClB,IAAL,GAAYA,IAAZ;AACAkB,IAAI,CAACjB,IAAL,GAAYA,IAAZ;AACA,eAAeiB,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 omit from 'omit.js';\nimport Grid from './Grid';\nimport Meta from './Meta';\nimport Tabs from '../tabs';\nimport Row from '../row';\nimport Col from '../col';\nimport { ConfigContext } from '../config-provider';\nimport SizeContext from '../config-provider/SizeContext';\n\nfunction getAction(actions) {\n var actionList = actions.map(function (action, index) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n style: {\n width: \"\".concat(100 / actions.length, \"%\")\n },\n key: \"action-\".concat(index)\n }, /*#__PURE__*/React.createElement(\"span\", null, action))\n );\n });\n return actionList;\n}\n\nvar Card = function Card(props) {\n var _extends2, _classNames;\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var size = React.useContext(SizeContext);\n\n var onTabChange = function onTabChange(key) {\n if (props.onTabChange) {\n props.onTabChange(key);\n }\n };\n\n var isContainGrid = function isContainGrid() {\n var containGrid;\n React.Children.forEach(props.children, function (element) {\n if (element && element.type && element.type === Grid) {\n containGrid = true;\n }\n });\n return containGrid;\n };\n\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n extra = props.extra,\n _props$headStyle = props.headStyle,\n headStyle = _props$headStyle === void 0 ? {} : _props$headStyle,\n _props$bodyStyle = props.bodyStyle,\n bodyStyle = _props$bodyStyle === void 0 ? {} : _props$bodyStyle,\n title = props.title,\n loading = props.loading,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n customizeSize = props.size,\n type = props.type,\n cover = props.cover,\n actions = props.actions,\n tabList = props.tabList,\n children = props.children,\n activeTabKey = props.activeTabKey,\n defaultActiveTabKey = props.defaultActiveTabKey,\n tabBarExtraContent = props.tabBarExtraContent,\n hoverable = props.hoverable,\n _props$tabProps = props.tabProps,\n tabProps = _props$tabProps === void 0 ? {} : _props$tabProps,\n others = __rest(props, [\"prefixCls\", \"className\", \"extra\", \"headStyle\", \"bodyStyle\", \"title\", \"loading\", \"bordered\", \"size\", \"type\", \"cover\", \"actions\", \"tabList\", \"children\", \"activeTabKey\", \"defaultActiveTabKey\", \"tabBarExtraContent\", \"hoverable\", \"tabProps\"]);\n\n var prefixCls = getPrefixCls('card', customizePrefixCls);\n var loadingBlockStyle = bodyStyle.padding === 0 || bodyStyle.padding === '0px' ? {\n padding: 24\n } : undefined;\n var block = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-loading-block\")\n });\n var loadingBlock = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-loading-content\"),\n style: loadingBlockStyle\n }, /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 22\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 8\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 15\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 6\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 18\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 13\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 9\n }, block)), /*#__PURE__*/React.createElement(Row, {\n gutter: 8\n }, /*#__PURE__*/React.createElement(Col, {\n span: 4\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 3\n }, block), /*#__PURE__*/React.createElement(Col, {\n span: 16\n }, block)));\n var hasActiveTabKey = activeTabKey !== undefined;\n\n var extraProps = _extends(_extends({}, tabProps), (_extends2 = {}, _defineProperty(_extends2, hasActiveTabKey ? 'activeKey' : 'defaultActiveKey', hasActiveTabKey ? activeTabKey : defaultActiveTabKey), _defineProperty(_extends2, \"tabBarExtraContent\", tabBarExtraContent), _extends2));\n\n var head;\n var tabs = tabList && tabList.length ? /*#__PURE__*/React.createElement(Tabs, _extends({\n size: \"large\"\n }, extraProps, {\n className: \"\".concat(prefixCls, \"-head-tabs\"),\n onChange: onTabChange\n }), tabList.map(function (item) {\n return /*#__PURE__*/React.createElement(Tabs.TabPane, {\n tab: item.tab,\n disabled: item.disabled,\n key: item.key\n });\n })) : null;\n\n if (title || extra || tabs) {\n head = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head\"),\n style: headStyle\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head-wrapper\")\n }, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head-title\")\n }, title), extra && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), tabs);\n }\n\n var coverDom = cover ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-cover\")\n }, cover) : null;\n var body = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-body\"),\n style: bodyStyle\n }, loading ? loadingBlock : children);\n var actionDom = actions && actions.length ? /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-actions\")\n }, getAction(actions)) : null;\n var divProps = omit(others, ['onTabChange']);\n var mergedSize = customizeSize || size;\n var classString = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-loading\"), loading), _defineProperty(_classNames, \"\".concat(prefixCls, \"-bordered\"), bordered), _defineProperty(_classNames, \"\".concat(prefixCls, \"-hoverable\"), hoverable), _defineProperty(_classNames, \"\".concat(prefixCls, \"-contain-grid\"), isContainGrid()), _defineProperty(_classNames, \"\".concat(prefixCls, \"-contain-tabs\"), tabList && tabList.length), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(mergedSize), mergedSize), _defineProperty(_classNames, \"\".concat(prefixCls, \"-type-\").concat(type), !!type), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, divProps, {\n className: classString\n }), head, coverDom, body, actionDom);\n};\n\nCard.Grid = Grid;\nCard.Meta = Meta;\nexport default Card;"]},"metadata":{},"sourceType":"module"}