58d8dd8eaebcf2bcdb78481d17d1d95e.json
18.5 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport ArrowLeftOutlined from '@ant-design/icons/ArrowLeftOutlined';\nimport ArrowRightOutlined from '@ant-design/icons/ArrowRightOutlined';\nimport ResizeObserver from 'rc-resize-observer';\nimport { ConfigConsumer } from '../config-provider';\nimport Breadcrumb from '../breadcrumb';\nimport Avatar from '../avatar';\nimport TransButton from '../_util/transButton';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\n\nvar renderBack = function renderBack(prefixCls, backIcon, onBack) {\n if (!backIcon || !onBack) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"PageHeader\"\n }, function (_ref) {\n var back = _ref.back;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-back\")\n }, /*#__PURE__*/React.createElement(TransButton, {\n onClick: function onClick(e) {\n if (onBack) {\n onBack(e);\n }\n },\n className: \"\".concat(prefixCls, \"-back-button\"),\n \"aria-label\": back\n }, backIcon));\n });\n};\n\nvar renderBreadcrumb = function renderBreadcrumb(breadcrumb) {\n return /*#__PURE__*/React.createElement(Breadcrumb, breadcrumb);\n};\n\nvar getBackIcon = function getBackIcon(props) {\n var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ltr';\n\n if (props.backIcon !== undefined) {\n return props.backIcon;\n }\n\n return direction === 'rtl' ? /*#__PURE__*/React.createElement(ArrowRightOutlined, null) : /*#__PURE__*/React.createElement(ArrowLeftOutlined, null);\n};\n\nvar renderTitle = function renderTitle(prefixCls, props) {\n var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';\n var title = props.title,\n avatar = props.avatar,\n subTitle = props.subTitle,\n tags = props.tags,\n extra = props.extra,\n onBack = props.onBack;\n var headingPrefixCls = \"\".concat(prefixCls, \"-heading\");\n var hasHeading = title || subTitle || tags || extra; // 如果 什么都没有,直接返回一个 null\n\n if (!hasHeading) {\n return null;\n }\n\n var backIcon = getBackIcon(props, direction);\n var backIconDom = renderBack(prefixCls, backIcon, onBack);\n var hasTitle = backIconDom || avatar || hasHeading;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: headingPrefixCls\n }, hasTitle && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(headingPrefixCls, \"-left\")\n }, backIconDom, avatar && /*#__PURE__*/React.createElement(Avatar, avatar), title && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-title\"),\n title: typeof title === 'string' ? title : undefined\n }, title), subTitle && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-sub-title\"),\n title: typeof subTitle === 'string' ? subTitle : undefined\n }, subTitle), tags && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-tags\")\n }, tags)), extra && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-extra\")\n }, extra));\n};\n\nvar renderFooter = function renderFooter(prefixCls, footer) {\n if (footer) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, footer);\n }\n\n return null;\n};\n\nvar renderChildren = function renderChildren(prefixCls, children) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, children);\n};\n\nvar PageHeader = function PageHeader(props) {\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n compact = _React$useState2[0],\n updateCompact = _React$useState2[1];\n\n var onResize = function onResize(_ref2) {\n var width = _ref2.width;\n updateCompact(width < 768);\n };\n\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref3) {\n var _classNames;\n\n var getPrefixCls = _ref3.getPrefixCls,\n pageHeader = _ref3.pageHeader,\n direction = _ref3.direction;\n var customizePrefixCls = props.prefixCls,\n style = props.style,\n footer = props.footer,\n children = props.children,\n breadcrumb = props.breadcrumb,\n customizeClassName = props.className;\n var ghost = true; // Use `ghost` from `props` or from `ConfigProvider` instead.\n\n if ('ghost' in props) {\n ghost = props.ghost;\n } else if (pageHeader && 'ghost' in pageHeader) {\n ghost = pageHeader.ghost;\n }\n\n var prefixCls = getPrefixCls('page-header', customizePrefixCls);\n var breadcrumbDom = breadcrumb && breadcrumb.routes ? renderBreadcrumb(breadcrumb) : null;\n var className = classNames(prefixCls, customizeClassName, (_classNames = {\n 'has-breadcrumb': breadcrumbDom,\n 'has-footer': footer\n }, _defineProperty(_classNames, \"\".concat(prefixCls, \"-ghost\"), ghost), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-compact\"), compact), _classNames));\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: style\n }, breadcrumbDom, renderTitle(prefixCls, props, direction), children && renderChildren(prefixCls, children), renderFooter(prefixCls, footer)));\n });\n};\n\nexport default PageHeader;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/page-header/index.js"],"names":["_defineProperty","_slicedToArray","React","classNames","ArrowLeftOutlined","ArrowRightOutlined","ResizeObserver","ConfigConsumer","Breadcrumb","Avatar","TransButton","LocaleReceiver","renderBack","prefixCls","backIcon","onBack","createElement","componentName","_ref","back","className","concat","onClick","e","renderBreadcrumb","breadcrumb","getBackIcon","props","direction","arguments","length","undefined","renderTitle","title","avatar","subTitle","tags","extra","headingPrefixCls","hasHeading","backIconDom","hasTitle","renderFooter","footer","renderChildren","children","PageHeader","_React$useState","useState","_React$useState2","compact","updateCompact","onResize","_ref2","width","_ref3","_classNames","getPrefixCls","pageHeader","customizePrefixCls","style","customizeClassName","ghost","breadcrumbDom","routes"],"mappings":"A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aADqD;AAEvE,oBAAcpB;AAFyD,KAAd,EAGxD3C,eAAe,CAACwD,WAAD,EAAc,GAAGnC,MAAH,CAAUR,SAAV,EAAqB,QAArB,CAAd,EAA8CiD,KAA9C,CAHyC,EAGa9D,eAAe,CAACwD,WAAD,EAAc,GAAGnC,MAAH,CAAUR,SAAV,EAAqB,MAArB,CAAd,EAA4Ce,SAAS,KAAK,KAA1D,CAH5B,EAG8F5B,eAAe,CAACwD,WAAD,EAAc,GAAGnC,MAAH,CAAUR,SAAV,EAAqB,UAArB,CAAd,EAAgDqC,OAAhD,CAH7G,EAGuKM,WAHxM,EAA1B;AAIA,WAAO,aAAatD,KAAK,CAACc,aAAN,CAAoBV,cAApB,EAAoC;AACtD8C,MAAAA,QAAQ,EAAEA;AAD4C,KAApC,EAEjB,aAAalD,KAAK,CAACc,aAAN,CAAoB,KAApB,EAA2B;AACzCI,MAAAA,SAAS,EAAEA,SAD8B;AAEzCwC,MAAAA,KAAK,EAAEA;AAFkC,KAA3B,EAGbG,aAHa,EAGE/B,WAAW,CAACnB,SAAD,EAAYc,KAAZ,EAAmBC,SAAnB,CAHb,EAG4CiB,QAAQ,IAAID,cAAc,CAAC/B,SAAD,EAAYgC,QAAZ,CAHtE,EAG6FH,YAAY,CAAC7B,SAAD,EAAY8B,MAAZ,CAHzG,CAFI,CAApB;AAMD,GAhCmB,CAApB;AAiCD,CA5CD;;AA8CA,eAAeG,UAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport ArrowLeftOutlined from '@ant-design/icons/ArrowLeftOutlined';\nimport ArrowRightOutlined from '@ant-design/icons/ArrowRightOutlined';\nimport ResizeObserver from 'rc-resize-observer';\nimport { ConfigConsumer } from '../config-provider';\nimport Breadcrumb from '../breadcrumb';\nimport Avatar from '../avatar';\nimport TransButton from '../_util/transButton';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\n\nvar renderBack = function renderBack(prefixCls, backIcon, onBack) {\n if (!backIcon || !onBack) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"PageHeader\"\n }, function (_ref) {\n var back = _ref.back;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-back\")\n }, /*#__PURE__*/React.createElement(TransButton, {\n onClick: function onClick(e) {\n if (onBack) {\n onBack(e);\n }\n },\n className: \"\".concat(prefixCls, \"-back-button\"),\n \"aria-label\": back\n }, backIcon));\n });\n};\n\nvar renderBreadcrumb = function renderBreadcrumb(breadcrumb) {\n return /*#__PURE__*/React.createElement(Breadcrumb, breadcrumb);\n};\n\nvar getBackIcon = function getBackIcon(props) {\n var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ltr';\n\n if (props.backIcon !== undefined) {\n return props.backIcon;\n }\n\n return direction === 'rtl' ? /*#__PURE__*/React.createElement(ArrowRightOutlined, null) : /*#__PURE__*/React.createElement(ArrowLeftOutlined, null);\n};\n\nvar renderTitle = function renderTitle(prefixCls, props) {\n var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';\n var title = props.title,\n avatar = props.avatar,\n subTitle = props.subTitle,\n tags = props.tags,\n extra = props.extra,\n onBack = props.onBack;\n var headingPrefixCls = \"\".concat(prefixCls, \"-heading\");\n var hasHeading = title || subTitle || tags || extra; // 如果 什么都没有,直接返回一个 null\n\n if (!hasHeading) {\n return null;\n }\n\n var backIcon = getBackIcon(props, direction);\n var backIconDom = renderBack(prefixCls, backIcon, onBack);\n var hasTitle = backIconDom || avatar || hasHeading;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: headingPrefixCls\n }, hasTitle && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(headingPrefixCls, \"-left\")\n }, backIconDom, avatar && /*#__PURE__*/React.createElement(Avatar, avatar), title && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-title\"),\n title: typeof title === 'string' ? title : undefined\n }, title), subTitle && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-sub-title\"),\n title: typeof subTitle === 'string' ? subTitle : undefined\n }, subTitle), tags && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-tags\")\n }, tags)), extra && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(headingPrefixCls, \"-extra\")\n }, extra));\n};\n\nvar renderFooter = function renderFooter(prefixCls, footer) {\n if (footer) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, footer);\n }\n\n return null;\n};\n\nvar renderChildren = function renderChildren(prefixCls, children) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, children);\n};\n\nvar PageHeader = function PageHeader(props) {\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n compact = _React$useState2[0],\n updateCompact = _React$useState2[1];\n\n var onResize = function onResize(_ref2) {\n var width = _ref2.width;\n updateCompact(width < 768);\n };\n\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref3) {\n var _classNames;\n\n var getPrefixCls = _ref3.getPrefixCls,\n pageHeader = _ref3.pageHeader,\n direction = _ref3.direction;\n var customizePrefixCls = props.prefixCls,\n style = props.style,\n footer = props.footer,\n children = props.children,\n breadcrumb = props.breadcrumb,\n customizeClassName = props.className;\n var ghost = true; // Use `ghost` from `props` or from `ConfigProvider` instead.\n\n if ('ghost' in props) {\n ghost = props.ghost;\n } else if (pageHeader && 'ghost' in pageHeader) {\n ghost = pageHeader.ghost;\n }\n\n var prefixCls = getPrefixCls('page-header', customizePrefixCls);\n var breadcrumbDom = breadcrumb && breadcrumb.routes ? renderBreadcrumb(breadcrumb) : null;\n var className = classNames(prefixCls, customizeClassName, (_classNames = {\n 'has-breadcrumb': breadcrumbDom,\n 'has-footer': footer\n }, _defineProperty(_classNames, \"\".concat(prefixCls, \"-ghost\"), ghost), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-compact\"), compact), _classNames));\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: style\n }, breadcrumbDom, renderTitle(prefixCls, props, direction), children && renderChildren(prefixCls, children), renderFooter(prefixCls, footer)));\n });\n};\n\nexport default PageHeader;"]},"metadata":{},"sourceType":"module"}