1 line
12 KiB
JSON
1 line
12 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\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};\nimport * as React from 'react';\nimport DownOutlined from \"@ant-design/icons/es/icons/DownOutlined\";\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport Dropdown from '../dropdown/dropdown';\nimport BreadcrumbSeparator from './BreadcrumbSeparator';\nimport { renderItem } from './useItemRender';\nexport const InternalBreadcrumbItem = props => {\n const {\n prefixCls,\n separator = '/',\n children,\n menu,\n overlay,\n dropdownProps,\n href\n } = props;\n // Warning for deprecated usage\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Breadcrumb.Item');\n warning.deprecated(!('overlay' in props), 'overlay', 'menu');\n }\n /** If overlay is have Wrap a Dropdown */\n const renderBreadcrumbNode = breadcrumbItem => {\n if (menu || overlay) {\n const mergeDropDownProps = Object.assign({}, dropdownProps);\n if (menu) {\n const _a = menu || {},\n {\n items\n } = _a,\n menuProps = __rest(_a, [\"items\"]);\n mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {\n items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {\n var {\n key,\n title,\n label,\n path\n } = _a,\n itemProps = __rest(_a, [\"key\", \"title\", \"label\", \"path\"]);\n let mergedLabel = label !== null && label !== void 0 ? label : title;\n if (path) {\n mergedLabel = /*#__PURE__*/React.createElement(\"a\", {\n href: `${href}${path}`\n }, mergedLabel);\n }\n return Object.assign(Object.assign({}, itemProps), {\n key: key !== null && key !== void 0 ? key : index,\n label: mergedLabel\n });\n })\n });\n } else if (overlay) {\n mergeDropDownProps.overlay = overlay;\n }\n return /*#__PURE__*/React.createElement(Dropdown, Object.assign({\n placement: \"bottom\"\n }, mergeDropDownProps), /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-overlay-link`\n }, breadcrumbItem, /*#__PURE__*/React.createElement(DownOutlined, null)));\n }\n return breadcrumbItem;\n };\n // wrap to dropDown\n const link = renderBreadcrumbNode(children);\n if (link !== undefined && link !== null) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"li\", null, link), separator && /*#__PURE__*/React.createElement(BreadcrumbSeparator, null, separator));\n }\n return null;\n};\nconst BreadcrumbItem = props => {\n const {\n prefixCls: customizePrefixCls,\n children,\n href\n } = props,\n restProps = __rest(props, [\"prefixCls\", \"children\", \"href\"]);\n const {\n getPrefixCls\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);\n return /*#__PURE__*/React.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {\n prefixCls: prefixCls\n }), renderItem(prefixCls, restProps, children, href));\n};\nBreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;\nexport default BreadcrumbItem;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","DownOutlined","devUseWarning","ConfigContext","Dropdown","BreadcrumbSeparator","render
|