@next-bricks/nav 1.20.4 → 1.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/bricks.json +33 -33
  2. package/dist/chunks/{2133.559b27f4.js → 2133.aef409c7.js} +2 -2
  3. package/dist/chunks/{2133.559b27f4.js.map → 2133.aef409c7.js.map} +1 -1
  4. package/dist/chunks/{2252.41e4ffe1.js → 2252.1f2ddd43.js} +3 -3
  5. package/dist/chunks/{2252.41e4ffe1.js.map → 2252.1f2ddd43.js.map} +1 -1
  6. package/dist/chunks/{3796.d842d92d.js → 3796.a67f6b8b.js} +3 -3
  7. package/dist/chunks/{3796.d842d92d.js.map → 3796.a67f6b8b.js.map} +1 -1
  8. package/dist/chunks/{4185.20553a3b.js → 4185.0c02786e.js} +3 -3
  9. package/dist/chunks/4185.0c02786e.js.map +1 -0
  10. package/dist/chunks/{4727.ad0cf061.js → 4727.f8d5254c.js} +2 -2
  11. package/dist/chunks/{4727.ad0cf061.js.map → 4727.f8d5254c.js.map} +1 -1
  12. package/dist/chunks/{4837.9ff6a495.js → 4837.4c653276.js} +2 -2
  13. package/dist/chunks/{4837.9ff6a495.js.map → 4837.4c653276.js.map} +1 -1
  14. package/dist/chunks/{6595.29578dae.js → 6595.b2dd96b5.js} +2 -2
  15. package/dist/chunks/{6595.29578dae.js.map → 6595.b2dd96b5.js.map} +1 -1
  16. package/dist/chunks/{7218.e7af0875.js → 7218.6c2c7ced.js} +2 -2
  17. package/dist/chunks/{7218.e7af0875.js.map → 7218.6c2c7ced.js.map} +1 -1
  18. package/dist/chunks/7505.cfc7935d.js +2 -0
  19. package/dist/chunks/{7505.23929a28.js.map → 7505.cfc7935d.js.map} +1 -1
  20. package/dist/chunks/{8274.f3eac0a0.js → 8274.d432bcf7.js} +3 -3
  21. package/dist/chunks/{8274.f3eac0a0.js.map → 8274.d432bcf7.js.map} +1 -1
  22. package/dist/chunks/{9149.6d7bbb31.js → 9149.ee32e2cf.js} +2 -2
  23. package/dist/chunks/{9149.6d7bbb31.js.map → 9149.ee32e2cf.js.map} +1 -1
  24. package/dist/chunks/{easyops-navbar-alerts.c422031d.js → easyops-navbar-alerts.5b1581a4.js} +2 -2
  25. package/dist/chunks/{easyops-navbar-alerts.c422031d.js.map → easyops-navbar-alerts.5b1581a4.js.map} +1 -1
  26. package/dist/chunks/{eo-directory-tree.4a6b5daf.js → eo-directory-tree.ee975134.js} +3 -3
  27. package/dist/chunks/{eo-directory-tree.4a6b5daf.js.map → eo-directory-tree.ee975134.js.map} +1 -1
  28. package/dist/chunks/{eo-directory.4fad406c.js → eo-directory.d6fc18cf.js} +3 -3
  29. package/dist/chunks/{eo-directory.4fad406c.js.map → eo-directory.d6fc18cf.js.map} +1 -1
  30. package/dist/chunks/{eo-frame-breadcrumb.ae790b2b.js → eo-frame-breadcrumb.5e0dd891.js} +2 -2
  31. package/dist/chunks/{eo-frame-breadcrumb.ae790b2b.js.map → eo-frame-breadcrumb.5e0dd891.js.map} +1 -1
  32. package/dist/chunks/{eo-launchpad-button-v2.64cf59ce.js → eo-launchpad-button-v2.4f8487f2.js} +3 -3
  33. package/dist/chunks/{eo-launchpad-button-v2.64cf59ce.js.map → eo-launchpad-button-v2.4f8487f2.js.map} +1 -1
  34. package/dist/chunks/{eo-nav-menu.95d97bec.js → eo-nav-menu.9b6796fc.js} +2 -2
  35. package/dist/chunks/{eo-nav-menu.95d97bec.js.map → eo-nav-menu.9b6796fc.js.map} +1 -1
  36. package/dist/chunks/{eo-sidebar-menu-group.5bb5c7c3.js → eo-sidebar-menu-group.ff0786e7.js} +3 -3
  37. package/dist/chunks/{eo-sidebar-menu-group.5bb5c7c3.js.map → eo-sidebar-menu-group.ff0786e7.js.map} +1 -1
  38. package/dist/chunks/{eo-sidebar-menu-submenu.15fad528.js → eo-sidebar-menu-submenu.b0bf87c3.js} +3 -3
  39. package/dist/chunks/{eo-sidebar-menu-submenu.15fad528.js.map → eo-sidebar-menu-submenu.b0bf87c3.js.map} +1 -1
  40. package/dist/chunks/{eo-sidebar-menu.3f7b4dc7.js → eo-sidebar-menu.7471c495.js} +2 -2
  41. package/dist/chunks/{eo-sidebar-menu.3f7b4dc7.js.map → eo-sidebar-menu.7471c495.js.map} +1 -1
  42. package/dist/chunks/{eo-sidebar-sub-menu.a809e015.js → eo-sidebar-sub-menu.b4b34ccd.js} +3 -3
  43. package/dist/chunks/{eo-sidebar-sub-menu.a809e015.js.map → eo-sidebar-sub-menu.b4b34ccd.js.map} +1 -1
  44. package/dist/chunks/{eo-sidebar.9a9a6054.js → eo-sidebar.6eaf5e26.js} +3 -3
  45. package/dist/chunks/{eo-sidebar.9a9a6054.js.map → eo-sidebar.6eaf5e26.js.map} +1 -1
  46. package/dist/chunks/{launchpad-config.479407f6.js → launchpad-config.e983ca1b.js} +3 -3
  47. package/dist/chunks/{launchpad-config.479407f6.js.map → launchpad-config.e983ca1b.js.map} +1 -1
  48. package/dist/chunks/main.c4f2045a.js +2 -0
  49. package/dist/chunks/{main.0231200e.js.map → main.c4f2045a.js.map} +1 -1
  50. package/dist/chunks/{nav-logo.3e0f52b3.js → nav-logo.b899f2ea.js} +2 -2
  51. package/dist/chunks/{nav-logo.3e0f52b3.js.map → nav-logo.b899f2ea.js.map} +1 -1
  52. package/dist/chunks/{poll-announce.66dcddef.js → poll-announce.2d383f61.js} +3 -3
  53. package/dist/chunks/{poll-announce.66dcddef.js.map → poll-announce.2d383f61.js.map} +1 -1
  54. package/dist/examples.json +9 -9
  55. package/dist/index.c8148736.js +2 -0
  56. package/dist/{index.0a520103.js.map → index.c8148736.js.map} +1 -1
  57. package/dist/manifest.json +102 -102
  58. package/dist/types.json +58 -58
  59. package/package.json +2 -2
  60. package/dist/chunks/4185.20553a3b.js.map +0 -1
  61. package/dist/chunks/7505.23929a28.js +0 -2
  62. package/dist/chunks/main.0231200e.js +0 -2
  63. package/dist/index.0a520103.js +0 -2
  64. /package/dist/chunks/{2252.41e4ffe1.js.LICENSE.txt → 2252.1f2ddd43.js.LICENSE.txt} +0 -0
  65. /package/dist/chunks/{3796.d842d92d.js.LICENSE.txt → 3796.a67f6b8b.js.LICENSE.txt} +0 -0
  66. /package/dist/chunks/{4185.20553a3b.js.LICENSE.txt → 4185.0c02786e.js.LICENSE.txt} +0 -0
  67. /package/dist/chunks/{8274.f3eac0a0.js.LICENSE.txt → 8274.d432bcf7.js.LICENSE.txt} +0 -0
  68. /package/dist/chunks/{eo-directory-tree.4a6b5daf.js.LICENSE.txt → eo-directory-tree.ee975134.js.LICENSE.txt} +0 -0
  69. /package/dist/chunks/{eo-directory.4fad406c.js.LICENSE.txt → eo-directory.d6fc18cf.js.LICENSE.txt} +0 -0
  70. /package/dist/chunks/{eo-launchpad-button-v2.64cf59ce.js.LICENSE.txt → eo-launchpad-button-v2.4f8487f2.js.LICENSE.txt} +0 -0
  71. /package/dist/chunks/{eo-sidebar-menu-group.5bb5c7c3.js.LICENSE.txt → eo-sidebar-menu-group.ff0786e7.js.LICENSE.txt} +0 -0
  72. /package/dist/chunks/{eo-sidebar-menu-submenu.15fad528.js.LICENSE.txt → eo-sidebar-menu-submenu.b0bf87c3.js.LICENSE.txt} +0 -0
  73. /package/dist/chunks/{eo-sidebar-sub-menu.a809e015.js.LICENSE.txt → eo-sidebar-sub-menu.b4b34ccd.js.LICENSE.txt} +0 -0
  74. /package/dist/chunks/{eo-sidebar.9a9a6054.js.LICENSE.txt → eo-sidebar.6eaf5e26.js.LICENSE.txt} +0 -0
  75. /package/dist/chunks/{launchpad-config.479407f6.js.LICENSE.txt → launchpad-config.e983ca1b.js.LICENSE.txt} +0 -0
  76. /package/dist/chunks/{poll-announce.66dcddef.js.LICENSE.txt → poll-announce.2d383f61.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/eo-launchpad-button-v2.64cf59ce.js","mappings":";uYAyBA,MAAM,cAAEA,IAAkBC,EAAAA,EAAAA,oBAEpBC,GAAiBC,EAAA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AAKQ,OAAO,qFAAqFC,OAAOF,GAAaR,sECC7PW,EAA6C,WACtD,IAAIzI,GAAO,QAAkB,UAAW0I,EAAQZ,GAC9C,aAA0F,EAAAC,KAAKY,IAAI,mFAAmF,QAAc,OAAc,CAAC,EAAGb,GAAU,CAAC,EAAG,CAChOY,aAEJ,IACF,IACA,OAAO,SAAuCT,EAAIC,GAChD,OAAOlI,EAAKmI,MAAMxI,KAAMyI,UAC1B,CACF,CAVwD,4DCD7CQ,EAAwC,WACjD,IAAI5I,GAAO,QAAkB,UAAW6I,EAAUhB,EAAMC,GACtD,aAA6E,EAAAC,KAAKC,KAAK,oDAAoDQ,OAAOK,EAAU,qBAAsBhB,EAAMC,IACxL,IACF,IACA,OAAO,SAAkCG,EAAIC,EAAKY,GAChD,OAAO9I,EAAKmI,MAAMxI,KAAMyI,UAC1B,CACF,CARmD","sources":["webpack:///./src/launchpad-button-v2/index.tsx","webpack:///../../node_modules/react-transition-group/esm/utils/ChildMapping.js","webpack:///../../node_modules/react-transition-group/esm/TransitionGroup.js","webpack:///./src/images/launchpad.svg","webpack:///../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:///../../node_modules/@next-api-sdk/user-service-sdk/dist/esm/api/user_service/launchpad/createCollectionV2.js","webpack:///../../node_modules/@next-api-sdk/user-service-sdk/dist/esm/api/user_service/launchpad/deleteCollectionV2.js","webpack:///../../node_modules/@next-api-sdk/user-service-sdk/dist/esm/api/user_service/launchpad/listCollectionV2.js","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/postSearchV3.js"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport \"@next-core/theme\";\nimport { getHistory, getRuntime } from \"@next-core/runtime\";\nimport type { lockBodyScroll as _lockBodyScroll } from \"@next-bricks/basic/data-providers/lock-body-scroll/lock-body-scroll\";\n// import { useTranslation, initializeReactI18n } from \"@next-core/i18n/react\";\nimport hotkeys from \"hotkeys-js\";\nimport classNames from \"classnames\";\n// import { K, NS, locales } from \"./i18n.js\";\nimport LaunchpadSvg from \"../images/launchpad.svg\";\nimport styleText from \"./styles.shadow.css\";\nimport platformCategoryStyleText from \"./PlatformCategory.shadow.css\";\nimport { Launchpad } from \"./Launchpad\";\nimport {\n deferredFavorites,\n deferredLaunchpadInfo,\n deferredPlatformCategories,\n} from \"./useLaunchpadInfo\";\nimport launchpadStyleText from \"./Launchpad.shadow.css\";\nimport \"./host-context.css\";\n\n// initializeReactI18n(NS, locales);\n\nconst { defineElement } = createDecorators();\n\nconst lockBodyScroll = unwrapProvider<typeof _lockBodyScroll>(\n \"basic.lock-body-scroll\"\n);\n\n/**\n * 构件 `eo-launchpad-button-v2`\n * @insider\n */\nexport\n@defineElement(\"eo-launchpad-button-v2\", {\n styleTexts: [styleText, platformCategoryStyleText, launchpadStyleText],\n})\nclass EoLaunchpadButtonV2 extends ReactNextElement {\n disconnectedCallback(): void {\n super.disconnectedCallback();\n lockBodyScroll(this, false);\n }\n\n render() {\n return <EoLaunchpadButtonV2Component host={this} />;\n }\n}\n\nexport function EoLaunchpadButtonV2Component({ host }: { host: HTMLElement }) {\n const [initialized, setInitialized] = useState(false);\n const [active, setActive] = useState(false);\n const toggleLaunchpad = (): void => {\n setActive((previous) => !previous);\n };\n\n useEffect(() => {\n // 当切换页面时,关闭 Launchpad。\n const unlisten = getHistory().listen(() => {\n setActive(false);\n });\n return unlisten;\n }, []);\n\n useEffect(() => {\n // 打开一次 launchpad 后,保留 DOM。\n if (active && !initialized) {\n setInitialized(true);\n }\n }, [active, initialized]);\n\n // istanbul ignore next\n useEffect(() => {\n hotkeys.filter = function () {\n return true;\n };\n\n // 快捷打开/关闭 Launchpad\n hotkeys(\"alt+l\", (event) => {\n event.preventDefault();\n setActive((previous) => !previous);\n });\n\n // 按 Esc 关闭 Launchpad\n hotkeys(\"esc\", () => {\n setActive(false);\n });\n\n return () => {\n hotkeys.unbind(\"alt+l\");\n hotkeys.unbind(\"esc\");\n };\n }, []);\n\n useEffect(() => {\n lockBodyScroll(host, active);\n }, [active, host]);\n\n useEffect(() => {\n deferredLaunchpadInfo.schedulePrefetch();\n deferredFavorites.schedulePrefetch();\n getRuntime()?.getFeatureFlags()[\"launchpad-show-platform-category\"] &&\n deferredPlatformCategories.schedulePrefetch();\n }, []);\n\n return (\n <>\n <a\n role=\"button\"\n className={classNames(\"launchpad-button\", { active })}\n onClick={toggleLaunchpad}\n >\n <LaunchpadSvg />\n </a>\n <div\n className={classNames(\"mask\", { active })}\n onClick={toggleLaunchpad}\n ></div>\n {initialized && <Launchpad active={active} />}\n </>\n );\n}\n","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `<TransitionGroup>` component manages a set of transition components\n * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition\n * components, `<TransitionGroup>` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the `<TransitionGroup>`.\n *\n * Note that `<TransitionGroup>` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `<TransitionGroup>` renders a `<div>` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `<div>` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `<Transition>` components, that are toggled `in` and out as they\n * leave. the `<TransitionGroup>` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `<Transition>` as\n * with our `<Fade>` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import * as React from \"react\";\nconst SvgLaunchpad = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={16} height={16} viewBox=\"0 0 16 16\" {...props}><g fill=\"currentColor\" fillRule=\"nonzero\"><path d=\"M0 0h4v4H0zM0 6h4v4H0zM6 0h4v4H6zM6 6h4v4H6zM12 0h4v4h-4zM12 6h4v4h-4zM0 12h4v4H0zM6 12h4v4H6zM12 12h4v4h-4z\" /></g></svg>;\nexport default SvgLaunchpad;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 新增我的收藏V2\n * @endpoint POST /api/v2/launchpad/collection\n */\nexport var LaunchpadApi_createCollectionV2 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (data, options) {\n return (/**! @contract easyops.api.user_service.launchpad.CreateCollectionV2@1.0.0 */(yield http.post(\"api/gateway/user_service.launchpad.CreateCollectionV2/api/v2/launchpad/collection\", data, options)).data\n );\n });\n return function LaunchpadApi_createCollectionV2(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=createCollectionV2.js.map","import { http } from \"@next-core/http\";\n\n/**\n * @description 删除我的收藏V2\n * @endpoint DELETE /api/v2/launchpad/collection/:instanceId\n */\nexport var LaunchpadApi_deleteCollectionV2 = (instanceId, options) => /**! @contract easyops.api.user_service.launchpad.DeleteCollectionV2@1.0.0 */http.delete(\"api/gateway/user_service.launchpad.DeleteCollectionV2/api/v2/launchpad/collection/\".concat(instanceId), options);\n//# sourceMappingURL=deleteCollectionV2.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 获取我的收藏列表V2\n * @endpoint LIST /api/v2/launchpad/collection\n */\nexport var LaunchpadApi_listCollectionV2 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (params, options) {\n return (/**! @contract easyops.api.user_service.launchpad.ListCollectionV2@1.0.0 */(yield http.get(\"api/gateway/user_service.launchpad.ListCollectionV2/api/v2/launchpad/collection\", _objectSpread(_objectSpread({}, options), {}, {\n params\n }))).data\n );\n });\n return function LaunchpadApi_listCollectionV2(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=listCollectionV2.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 搜索实例V3 (支持多属性排序)\n * @endpoint POST /v3/object/:objectId/instance/_search\n */\nexport var InstanceApi_postSearchV3 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.PostSearchV3@1.1.0 */(yield http.post(\"api/gateway/cmdb.instance.PostSearchV3/v3/object/\".concat(objectId, \"/instance/_search\"), data, options)).data\n );\n });\n return function InstanceApi_postSearchV3(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=postSearchV3.js.map"],"names":["defineElement","createDecorators","lockBodyScroll","unwrapProvider","_EoLaunchpadButtonV","EoLaunchpadButtonV2","ReactNextElement","disconnectedCallback","super","this","render","React","EoLaunchpadButtonV2Component","host","_ref","initialized","setInitialized","useState","active","setActive","toggleLaunchpad","previous","useEffect","getHistory","listen","hotkeys","filter","event","preventDefault","unbind","_getRuntime","deferredLaunchpadInfo","schedulePrefetch","deferredFavorites","getRuntime","getFeatureFlags","deferredPlatformCategories","role","className","classNames","onClick","LaunchpadSvg","Launchpad","_EoLaunchpadButtonV2","_initClass","_applyDecs","styleTexts","styleText","platformCategoryStyleText","launchpadStyleText","c","getChildMapping","children","mapFn","result","Object","create","Children","map","forEach","child","key","isValidElement","mapper","getProp","prop","props","getNextChildMapping","nextProps","prevChildMapping","onExited","nextChildMapping","prev","next","getValueForKey","i","nextKeysPending","pendingKeys","prevKey","length","push","childMapping","nextKey","pendingNextKey","mergeChildMappings","keys","hasPrev","hasNext","prevChild","isLeaving","in","cloneElement","bind","exit","enter","values","obj","k","TransitionGroup","_React$Component","context","_this","handleExited","call","state","contextValue","isMounting","firstRender","_proto","prototype","componentDidMount","mounted","setState","componentWillUnmount","getDerivedStateFromProps","appear","node","currentChildMapping","_this$props","Component","component","childFactory","TransitionGroupContext","Provider","value","propTypes","defaultProps","_extends","xmlns","width","height","viewBox","fill","fillRule","d","_assertThisInitialized","self","ReferenceError","LaunchpadApi_createCollectionV2","data","options","http","post","_x","_x2","apply","arguments","LaunchpadApi_deleteCollectionV2","instanceId","delete","concat","LaunchpadApi_listCollectionV2","params","get","InstanceApi_postSearchV3","objectId","_x3"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/eo-launchpad-button-v2.4f8487f2.js","mappings":";uYAyBA,MAAM,cAAEA,IAAkBC,EAAAA,EAAAA,oBAEpBC,GAAiBC,EAAAA,EAAAA,gBACrB,0BAGF,IAAAC,EAKA,MAAAC,UAGkCC,EAAAA,iBAChCC,oBAAAA,GACEC,MAAMD,uBACNL,EAAeO,MAAM,EACvB,CAEAC,MAAAA,GACE,OAAOC,IAAAA,cAACC,EAA4B,CAACC,KAAMJ,MAC7C,EAGK,SAASG,EAA4BE,GAAkC,IAAjC,KAAED,GAA6BC,EAC1E,MAAOC,EAAaC,IAAkBC,EAAAA,EAAAA,WAAS,IACxCC,EAAQC,IAAaF,EAAAA,EAAAA,WAAS,GAC/BG,EAAkBA,KACtBD,GAAWE,IAAcA,GAAS,EAoDpC,OAjDAC,EAAAA,EAAAA,YAAU,KAESC,EAAAA,EAAAA,cAAaC,QAAO,KACnCL,GAAU,EAAM,KAGjB,KAEHG,EAAAA,EAAAA,YAAU,KAEJJ,IAAWH,GACbC,GAAe,EACjB,GACC,CAACE,EAAQH,KAGZO,EAAAA,EAAAA,YAAU,KACRG,EAAAA,EAAQC,OAAS,WACf,OAAO,CACT,GAGAD,EAAAA,EAAAA,GAAQ,SAAUE,IAChBA,EAAMC,iBACNT,GAAWE,IAAcA,GAAS,KAIpCI,EAAAA,EAAAA,GAAQ,OAAO,KACbN,GAAU,EAAM,IAGX,KACLM,EAAAA,EAAQI,OAAO,SACfJ,EAAAA,EAAQI,OAAO,MAAM,IAEtB,KAEHP,EAAAA,EAAAA,YAAU,KACRpB,EAAeW,EAAMK,EAAO,GAC3B,CAACA,EAAQL,KAEZS,EAAAA,EAAAA,YAAU,KAAM,IAAAQ,EACdC,EAAAA,GAAsBC,mBACtBC,EAAAA,GAAkBD,oBACN,QAAZF,GAAAI,EAAAA,EAAAA,qBAAY,IAAAJ,OAAA,EAAZA,EAAcK,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,KAAKC,KAAK,oFAAqFH,EAAMC,IACjM,IACF,IACA,OAAO,SAAyCG,EAAIC,GAClD,OAAOlI,EAAKmI,MAAMxI,KAAMyI,UAC1B,CACF,CAR0D,kDCA/CC,EAAkC,CAACC,EAAYR,IAAyF,EAAAC,KAAKQ,OAAO,qFAAqFC,OAAOF,GAAaR,sECC7PW,EAA6C,WACtD,IAAIzI,GAAO,QAAkB,UAAW0I,EAAQZ,GAC9C,aAA0F,EAAAC,KAAKY,IAAI,mFAAmF,QAAc,OAAc,CAAC,EAAGb,GAAU,CAAC,EAAG,CAChOY,aAEJ,IACF,IACA,OAAO,SAAuCT,EAAIC,GAChD,OAAOlI,EAAKmI,MAAMxI,KAAMyI,UAC1B,CACF,CAVwD,4DCD7CQ,EAAwC,WACjD,IAAI5I,GAAO,QAAkB,UAAW6I,EAAUhB,EAAMC,GACtD,aAA6E,EAAAC,KAAKC,KAAK,oDAAoDQ,OAAOK,EAAU,qBAAsBhB,EAAMC,IACxL,IACF,IACA,OAAO,SAAkCG,EAAIC,EAAKY,GAChD,OAAO9I,EAAKmI,MAAMxI,KAAMyI,UAC1B,CACF,CARmD","sources":["webpack:///./src/launchpad-button-v2/index.tsx","webpack:///../../node_modules/react-transition-group/esm/utils/ChildMapping.js","webpack:///../../node_modules/react-transition-group/esm/TransitionGroup.js","webpack:///./src/images/launchpad.svg","webpack:///../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:///../../node_modules/@next-api-sdk/user-service-sdk/dist/esm/api/user_service/launchpad/createCollectionV2.js","webpack:///../../node_modules/@next-api-sdk/user-service-sdk/dist/esm/api/user_service/launchpad/deleteCollectionV2.js","webpack:///../../node_modules/@next-api-sdk/user-service-sdk/dist/esm/api/user_service/launchpad/listCollectionV2.js","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/postSearchV3.js"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport \"@next-core/theme\";\nimport { getHistory, getRuntime } from \"@next-core/runtime\";\nimport type { lockBodyScroll as _lockBodyScroll } from \"@next-bricks/basic/data-providers/lock-body-scroll/lock-body-scroll\";\n// import { useTranslation, initializeReactI18n } from \"@next-core/i18n/react\";\nimport hotkeys from \"hotkeys-js\";\nimport classNames from \"classnames\";\n// import { K, NS, locales } from \"./i18n.js\";\nimport LaunchpadSvg from \"../images/launchpad.svg\";\nimport styleText from \"./styles.shadow.css\";\nimport platformCategoryStyleText from \"./PlatformCategory.shadow.css\";\nimport { Launchpad } from \"./Launchpad\";\nimport {\n deferredFavorites,\n deferredLaunchpadInfo,\n deferredPlatformCategories,\n} from \"./useLaunchpadInfo\";\nimport launchpadStyleText from \"./Launchpad.shadow.css\";\nimport \"./host-context.css\";\n\n// initializeReactI18n(NS, locales);\n\nconst { defineElement } = createDecorators();\n\nconst lockBodyScroll = unwrapProvider<typeof _lockBodyScroll>(\n \"basic.lock-body-scroll\"\n);\n\n/**\n * 构件 `eo-launchpad-button-v2`\n * @insider\n */\nexport\n@defineElement(\"eo-launchpad-button-v2\", {\n styleTexts: [styleText, platformCategoryStyleText, launchpadStyleText],\n})\nclass EoLaunchpadButtonV2 extends ReactNextElement {\n disconnectedCallback(): void {\n super.disconnectedCallback();\n lockBodyScroll(this, false);\n }\n\n render() {\n return <EoLaunchpadButtonV2Component host={this} />;\n }\n}\n\nexport function EoLaunchpadButtonV2Component({ host }: { host: HTMLElement }) {\n const [initialized, setInitialized] = useState(false);\n const [active, setActive] = useState(false);\n const toggleLaunchpad = (): void => {\n setActive((previous) => !previous);\n };\n\n useEffect(() => {\n // 当切换页面时,关闭 Launchpad。\n const unlisten = getHistory().listen(() => {\n setActive(false);\n });\n return unlisten;\n }, []);\n\n useEffect(() => {\n // 打开一次 launchpad 后,保留 DOM。\n if (active && !initialized) {\n setInitialized(true);\n }\n }, [active, initialized]);\n\n // istanbul ignore next\n useEffect(() => {\n hotkeys.filter = function () {\n return true;\n };\n\n // 快捷打开/关闭 Launchpad\n hotkeys(\"alt+l\", (event) => {\n event.preventDefault();\n setActive((previous) => !previous);\n });\n\n // 按 Esc 关闭 Launchpad\n hotkeys(\"esc\", () => {\n setActive(false);\n });\n\n return () => {\n hotkeys.unbind(\"alt+l\");\n hotkeys.unbind(\"esc\");\n };\n }, []);\n\n useEffect(() => {\n lockBodyScroll(host, active);\n }, [active, host]);\n\n useEffect(() => {\n deferredLaunchpadInfo.schedulePrefetch();\n deferredFavorites.schedulePrefetch();\n getRuntime()?.getFeatureFlags()[\"launchpad-show-platform-category\"] &&\n deferredPlatformCategories.schedulePrefetch();\n }, []);\n\n return (\n <>\n <a\n role=\"button\"\n className={classNames(\"launchpad-button\", { active })}\n onClick={toggleLaunchpad}\n >\n <LaunchpadSvg />\n </a>\n <div\n className={classNames(\"mask\", { active })}\n onClick={toggleLaunchpad}\n ></div>\n {initialized && <Launchpad active={active} />}\n </>\n );\n}\n","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `<TransitionGroup>` component manages a set of transition components\n * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition\n * components, `<TransitionGroup>` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the `<TransitionGroup>`.\n *\n * Note that `<TransitionGroup>` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `<TransitionGroup>` renders a `<div>` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `<div>` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `<Transition>` components, that are toggled `in` and out as they\n * leave. the `<TransitionGroup>` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `<Transition>` as\n * with our `<Fade>` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import * as React from \"react\";\nconst SvgLaunchpad = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={16} height={16} viewBox=\"0 0 16 16\" {...props}><g fill=\"currentColor\" fillRule=\"nonzero\"><path d=\"M0 0h4v4H0zM0 6h4v4H0zM6 0h4v4H6zM6 6h4v4H6zM12 0h4v4h-4zM12 6h4v4h-4zM0 12h4v4H0zM6 12h4v4H6zM12 12h4v4h-4z\" /></g></svg>;\nexport default SvgLaunchpad;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 新增我的收藏V2\n * @endpoint POST /api/v2/launchpad/collection\n */\nexport var LaunchpadApi_createCollectionV2 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (data, options) {\n return (/**! @contract easyops.api.user_service.launchpad.CreateCollectionV2@1.0.0 */(yield http.post(\"api/gateway/user_service.launchpad.CreateCollectionV2/api/v2/launchpad/collection\", data, options)).data\n );\n });\n return function LaunchpadApi_createCollectionV2(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=createCollectionV2.js.map","import { http } from \"@next-core/http\";\n\n/**\n * @description 删除我的收藏V2\n * @endpoint DELETE /api/v2/launchpad/collection/:instanceId\n */\nexport var LaunchpadApi_deleteCollectionV2 = (instanceId, options) => /**! @contract easyops.api.user_service.launchpad.DeleteCollectionV2@1.0.0 */http.delete(\"api/gateway/user_service.launchpad.DeleteCollectionV2/api/v2/launchpad/collection/\".concat(instanceId), options);\n//# sourceMappingURL=deleteCollectionV2.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 获取我的收藏列表V2\n * @endpoint LIST /api/v2/launchpad/collection\n */\nexport var LaunchpadApi_listCollectionV2 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (params, options) {\n return (/**! @contract easyops.api.user_service.launchpad.ListCollectionV2@1.0.0 */(yield http.get(\"api/gateway/user_service.launchpad.ListCollectionV2/api/v2/launchpad/collection\", _objectSpread(_objectSpread({}, options), {}, {\n params\n }))).data\n );\n });\n return function LaunchpadApi_listCollectionV2(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=listCollectionV2.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 搜索实例V3 (支持多属性排序)\n * @endpoint POST /v3/object/:objectId/instance/_search\n */\nexport var InstanceApi_postSearchV3 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.PostSearchV3@1.1.0 */(yield http.post(\"api/gateway/cmdb.instance.PostSearchV3/v3/object/\".concat(objectId, \"/instance/_search\"), data, options)).data\n );\n });\n return function InstanceApi_postSearchV3(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=postSearchV3.js.map"],"names":["defineElement","createDecorators","lockBodyScroll","unwrapProvider","_EoLaunchpadButtonV","EoLaunchpadButtonV2","ReactNextElement","disconnectedCallback","super","this","render","React","EoLaunchpadButtonV2Component","host","_ref","initialized","setInitialized","useState","active","setActive","toggleLaunchpad","previous","useEffect","getHistory","listen","hotkeys","filter","event","preventDefault","unbind","_getRuntime","deferredLaunchpadInfo","schedulePrefetch","deferredFavorites","getRuntime","getFeatureFlags","deferredPlatformCategories","role","className","classNames","onClick","LaunchpadSvg","Launchpad","_EoLaunchpadButtonV2","_initClass","_applyDecs","styleTexts","styleText","platformCategoryStyleText","launchpadStyleText","c","getChildMapping","children","mapFn","result","Object","create","Children","map","forEach","child","key","isValidElement","mapper","getProp","prop","props","getNextChildMapping","nextProps","prevChildMapping","onExited","nextChildMapping","prev","next","getValueForKey","i","nextKeysPending","pendingKeys","prevKey","length","push","childMapping","nextKey","pendingNextKey","mergeChildMappings","keys","hasPrev","hasNext","prevChild","isLeaving","in","cloneElement","bind","exit","enter","values","obj","k","TransitionGroup","_React$Component","context","_this","handleExited","call","state","contextValue","isMounting","firstRender","_proto","prototype","componentDidMount","mounted","setState","componentWillUnmount","getDerivedStateFromProps","appear","node","currentChildMapping","_this$props","Component","component","childFactory","TransitionGroupContext","Provider","value","propTypes","defaultProps","_extends","xmlns","width","height","viewBox","fill","fillRule","d","_assertThisInitialized","self","ReferenceError","LaunchpadApi_createCollectionV2","data","options","http","post","_x","_x2","apply","arguments","LaunchpadApi_deleteCollectionV2","instanceId","delete","concat","LaunchpadApi_listCollectionV2","params","get","InstanceApi_postSearchV3","objectId","_x3"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_nav=globalThis.webpackChunk_next_bricks_nav||[]).push([[5821],{816:(e,t,n)=>{n.r(t),n.d(t,{NavMenu:()=>z});var l,i=n(918),a=n(6121),o=n(829),r=n(2740),s=n(9575),m=n(8769),c=n.n(m),u=n(6192),d=n(6911),h=n(9859),p=n(6370),y=n(9527),v=n(63),g=(n(6477),n(3373)),w=n.n(g),b=n(1283),T=n(9044),f=n(9998),E=n(839),k=n(1122);let M,x,S,A,N,K,D;n(4211);const{defineElement:C,property:R}=(0,u.createDecorators)(),_=(0,h.wrapBrick)("eo-menu-item"),W=(0,h.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",onBeforeVisibleChange:"before.visible.change"});function B(e){const{item:t}=e;return(0,y.Wf)(t,e.topData)?c().createElement(L,(0,s.A)({},e,{item:t})):(0,y.IZ)(t)?c().createElement(V,(0,s.A)({},e,{item:t})):c().createElement(F,(0,s.A)({},e,{item:t}))}function F(e){const{item:t,index:n,hidden:l,showTooltip:i,selectedKey:a=[]}=e;return c().createElement(_,{"data-index":n,className:l?"overflow-menu-item":"",key:t.key,title:i?t.text:"",active:!!t.key&&a.includes(t.key)},(0,y.q5)(t,{width:"100%"},e.mainMenuTitleStyle))}let G;const I=e=>{const t=null!=G?G:G=window.innerWidth-document.body.clientWidth;document.body.style.paddingRight=e.detail?t+"px":"",document.body.style.overflow=e.detail?"hidden":"",document.body.style.touchAction=e.detail?"none":""};function L(e){var t;let{index:n,hidden:l,item:i,topData:a,showTooltip:o,selectedKey:r=[],overflow:s,mainMenuTitleStyle:m}=e;return(null===(t=i.items)||void 0===t?void 0:t.length)>0?c().createElement(W,{"data-index":n,className:w()("popover",{subprime:!a,"overflow-menu-item":l}),arrow:!1,trigger:"hover",placement:a?"bottom-start":"right-start",distance:0,anchorDisplay:"block",strategy:"fixed"},c().createElement(_,{className:"sub-menu-item-label 22",key:i.key,slot:"anchor",title:o?i.title:""},(0,y.Gn)(i,!a,{...m})),c().createElement("div",{className:w()("sub-menu-wrapper",{"overflow-menu-wrapper":s})},i.items.map((e=>c().createElement(c().Fragment,{key:e.key},c().createElement(B,{item:e,selectedKey:r,showTooltip:o})))))):null}function V(e){var t;let{item:n,showTooltip:l,selectedKey:i=[]}=e;return(null===(t=n.items)||void 0===t?void 0:t.length)>0?"category"===n.childLayout?c().createElement(P,{item:n,selectedKey:i,showTooltip:l,placement:"right-start",anchorDisplay:"block"}):"siteMap"===n.childLayout?c().createElement(q,{item:n,selectedKey:i,showTooltip:l,placement:"right-start",anchorDisplay:"block",topData:!1}):c().createElement(c().Fragment,null,c().createElement("div",{className:"group-label"},n.title),c().createElement("div",{className:"group-wrapper"},n.items.map((e=>c().createElement(c().Fragment,{key:e.key},c().createElement(B,{item:e,showTooltip:l,selectedKey:i})))))):null}function P(e){var t;let{index:n,hidden:l,item:i,selectedKey:a=[],showTooltip:o,placement:r="bottom-start",anchorDisplay:s,mainMenuTitleStyle:m}=e;return(null===(t=i.items)||void 0===t?void 0:t.length)>0?c().createElement(W,{"data-index":n,className:w()("three-level-menu-popover","popover",{"overflow-menu-item":l}),arrow:!1,trigger:"hover",placement:r,distance:0,key:i.key,strategy:"fixed",anchorDisplay:s,onBeforeVisibleChange:I},c().createElement(_,{className:"sub-menu-item-label",key:i.key,slot:"anchor",title:o?i.title:""},(0,y.Gn)(i,!1,m)),c().createElement("div",{className:"sub-menu-wrapper"},c().createElement(b.s,{menuItem:i,selectedKey:a}))):null}function q(e){var t;let{index:n,hidden:l,item:i,selectedKey:a=[],showTooltip:o,placement:r="bottom-start",anchorDisplay:s,topData:u,mainMenuTitleStyle:d}=e;const[h,p]=(0,m.useState)();return(null===(t=i.items)||void 0===t?void 0:t.length)>0?c().createElement(W,{"data-index":n,className:w()("popover",{"overflow-menu-item":l}),trigger:"hover",placement:r,distance:0,key:i.key,strategy:"fixed",arrow:!1,anchorDisplay:s,onBeforeVisibleChange:e=>{p(e.detail),I(e)}},c().createElement(_,{className:"sub-menu-item-label",key:i.key,slot:"anchor",title:o?i.title:""},(0,y.Gn)(i,!1,d)),c().createElement("div",{className:w()("sub-menu-sit-map-wrapper",{"in-group-site-map":!u}),onClick:e=>e.stopPropagation()},c().createElement(T.bw,{menuGroup:i,selectedKey:a,visible:h}))):null}let z;var H=new WeakMap,O=new WeakMap,X=new WeakMap;class Z extends h.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,H,x(this)),(0,i.A)(this,O,(S(this),A(this))),(0,i.A)(this,X,(N(this),K(this))),D(this)}get menu(){return(0,o.A)(H,this)}set menu(e){(0,a.A)(H,this,e)}get mainMenuTitleStyle(){return(0,o.A)(O,this)}set mainMenuTitleStyle(e){(0,a.A)(O,this,e)}get showTooltip(){return(0,o.A)(X,this)}set showTooltip(e){(0,a.A)(X,this,e)}render(){return c().createElement(j,{menu:this.menu,showTooltip:this.showTooltip,mainMenuTitleStyle:this.mainMenuTitleStyle})}}function j(e){const{menu:t,showTooltip:n}=e,l=(0,d.getHistory)(),i=(0,m.useRef)(null),[a,o]=(0,m.useState)(l.location),[r,s]=(0,m.useState)(Number.MAX_SAFE_INTEGER),{pathname:u,search:h}=a,p=(0,m.useMemo)((()=>{var e;return(null!==(e=null==t?void 0:t.menuItems)&&void 0!==e?e:[]).filter((e=>{var t;return"default"===e.type||!e.type||["group","subMenu"].includes(e.type)&&(null===(t=e.items)||void 0===t?void 0:t.length)}))}),[null==t?void 0:t.menuItems]),g=(0,m.useMemo)((()=>{const{selectedKeys:e}=(0,v.LP)(null!=p?p:[],u,h,"");return e}),[p,u,h]);(0,m.useEffect)((()=>{const e=l.listen((e=>{o(e)}));return e}),[]),(0,m.useEffect)((()=>{if(i.current){const e=new ResizeObserver((()=>{if(i.current){var e;const{width:t}=null!==(e=i.current.getClientRects()[0])&&void 0!==e?e:{},n=i.current.childNodes;if(n.length&&t){let e=t,l=n.length;for(let t=0;t<n.length;t++){const{width:i,height:a}=n[t].getClientRects()[0];if(!a&&e-40<0){l=t-1;break}if(e=e-i-(t>0?8:0),e<0){l=t;break}}s(l<0?0:l)}}}));return e.observe(i.current),()=>{e.disconnect()}}}),[]);const w=(0,m.useMemo)((()=>({type:"subMenu",title:"···",items:p.slice(r,p.length)})),[p,r]);return c().createElement("div",{ref:i,className:"nav-menu-wrapper"},p.map(((t,l)=>{var i;const a=r<=l;return c().createElement(c().Fragment,{key:t.key},(0,y.Wf)(t,!0)&&"category"===t.childLayout&&null!==(i=t.items)&&void 0!==i&&i.length?c().createElement(P,{index:l,hidden:a,item:t,showTooltip:n,selectedKey:g,mainMenuTitleStyle:e.mainMenuTitleStyle}):"group"===t.type&&"siteMap"===t.childLayout?c().createElement(q,{index:l,hidden:a,item:t,showTooltip:n,selectedKey:g,topData:!0,mainMenuTitleStyle:e.mainMenuTitleStyle}):c().createElement(B,{index:l,hidden:a,item:t,showTooltip:n,selectedKey:g,topData:!0,mainMenuTitleStyle:e.mainMenuTitleStyle}))})),c().createElement(B,{hidden:r>p.length,item:w,showTooltip:n,selectedKey:g,overflow:!0,topData:!0,mainMenuTitleStyle:e.mainMenuTitleStyle}))}l=Z,({e:[x,S,A,N,K,D],c:[z,M]}=(0,r.A)(l,[C("eo-nav-menu",{styleTexts:[f.A,E.A,k.A,p.A]})],[[R({attribute:!1}),1,"menu"],[R({attribute:!1}),1,"mainMenuTitleStyle"],[R({type:Boolean}),1,"showTooltip"]],0,void 0,h.ReactNextElement)),M()}}]);
2
- //# sourceMappingURL=eo-nav-menu.95d97bec.js.map
1
+ "use strict";(globalThis.webpackChunk_next_bricks_nav=globalThis.webpackChunk_next_bricks_nav||[]).push([[5821],{816:(e,t,n)=>{n.r(t),n.d(t,{NavMenu:()=>z});var l,i=n(918),a=n(6121),o=n(829),r=n(2740),s=n(9575),m=n(8769),c=n.n(m),u=n(6192),d=n(8626),h=n(9859),p=n(6370),y=n(9527),v=n(63),g=(n(6477),n(3373)),w=n.n(g),b=n(1283),T=n(9044),f=n(9998),E=n(839),k=n(1122);let M,x,S,A,N,K,D;n(4211);const{defineElement:C,property:R}=(0,u.createDecorators)(),_=(0,h.wrapBrick)("eo-menu-item"),W=(0,h.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",onBeforeVisibleChange:"before.visible.change"});function B(e){const{item:t}=e;return(0,y.Wf)(t,e.topData)?c().createElement(L,(0,s.A)({},e,{item:t})):(0,y.IZ)(t)?c().createElement(V,(0,s.A)({},e,{item:t})):c().createElement(F,(0,s.A)({},e,{item:t}))}function F(e){const{item:t,index:n,hidden:l,showTooltip:i,selectedKey:a=[]}=e;return c().createElement(_,{"data-index":n,className:l?"overflow-menu-item":"",key:t.key,title:i?t.text:"",active:!!t.key&&a.includes(t.key)},(0,y.q5)(t,{width:"100%"},e.mainMenuTitleStyle))}let G;const I=e=>{const t=null!=G?G:G=window.innerWidth-document.body.clientWidth;document.body.style.paddingRight=e.detail?t+"px":"",document.body.style.overflow=e.detail?"hidden":"",document.body.style.touchAction=e.detail?"none":""};function L(e){var t;let{index:n,hidden:l,item:i,topData:a,showTooltip:o,selectedKey:r=[],overflow:s,mainMenuTitleStyle:m}=e;return(null===(t=i.items)||void 0===t?void 0:t.length)>0?c().createElement(W,{"data-index":n,className:w()("popover",{subprime:!a,"overflow-menu-item":l}),arrow:!1,trigger:"hover",placement:a?"bottom-start":"right-start",distance:0,anchorDisplay:"block",strategy:"fixed"},c().createElement(_,{className:"sub-menu-item-label 22",key:i.key,slot:"anchor",title:o?i.title:""},(0,y.Gn)(i,!a,{...m})),c().createElement("div",{className:w()("sub-menu-wrapper",{"overflow-menu-wrapper":s})},i.items.map((e=>c().createElement(c().Fragment,{key:e.key},c().createElement(B,{item:e,selectedKey:r,showTooltip:o})))))):null}function V(e){var t;let{item:n,showTooltip:l,selectedKey:i=[]}=e;return(null===(t=n.items)||void 0===t?void 0:t.length)>0?"category"===n.childLayout?c().createElement(P,{item:n,selectedKey:i,showTooltip:l,placement:"right-start",anchorDisplay:"block"}):"siteMap"===n.childLayout?c().createElement(q,{item:n,selectedKey:i,showTooltip:l,placement:"right-start",anchorDisplay:"block",topData:!1}):c().createElement(c().Fragment,null,c().createElement("div",{className:"group-label"},n.title),c().createElement("div",{className:"group-wrapper"},n.items.map((e=>c().createElement(c().Fragment,{key:e.key},c().createElement(B,{item:e,showTooltip:l,selectedKey:i})))))):null}function P(e){var t;let{index:n,hidden:l,item:i,selectedKey:a=[],showTooltip:o,placement:r="bottom-start",anchorDisplay:s,mainMenuTitleStyle:m}=e;return(null===(t=i.items)||void 0===t?void 0:t.length)>0?c().createElement(W,{"data-index":n,className:w()("three-level-menu-popover","popover",{"overflow-menu-item":l}),arrow:!1,trigger:"hover",placement:r,distance:0,key:i.key,strategy:"fixed",anchorDisplay:s,onBeforeVisibleChange:I},c().createElement(_,{className:"sub-menu-item-label",key:i.key,slot:"anchor",title:o?i.title:""},(0,y.Gn)(i,!1,m)),c().createElement("div",{className:"sub-menu-wrapper"},c().createElement(b.s,{menuItem:i,selectedKey:a}))):null}function q(e){var t;let{index:n,hidden:l,item:i,selectedKey:a=[],showTooltip:o,placement:r="bottom-start",anchorDisplay:s,topData:u,mainMenuTitleStyle:d}=e;const[h,p]=(0,m.useState)();return(null===(t=i.items)||void 0===t?void 0:t.length)>0?c().createElement(W,{"data-index":n,className:w()("popover",{"overflow-menu-item":l}),trigger:"hover",placement:r,distance:0,key:i.key,strategy:"fixed",arrow:!1,anchorDisplay:s,onBeforeVisibleChange:e=>{p(e.detail),I(e)}},c().createElement(_,{className:"sub-menu-item-label",key:i.key,slot:"anchor",title:o?i.title:""},(0,y.Gn)(i,!1,d)),c().createElement("div",{className:w()("sub-menu-sit-map-wrapper",{"in-group-site-map":!u}),onClick:e=>e.stopPropagation()},c().createElement(T.bw,{menuGroup:i,selectedKey:a,visible:h}))):null}let z;var H=new WeakMap,O=new WeakMap,X=new WeakMap;class Z extends h.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,H,x(this)),(0,i.A)(this,O,(S(this),A(this))),(0,i.A)(this,X,(N(this),K(this))),D(this)}get menu(){return(0,o.A)(H,this)}set menu(e){(0,a.A)(H,this,e)}get mainMenuTitleStyle(){return(0,o.A)(O,this)}set mainMenuTitleStyle(e){(0,a.A)(O,this,e)}get showTooltip(){return(0,o.A)(X,this)}set showTooltip(e){(0,a.A)(X,this,e)}render(){return c().createElement(j,{menu:this.menu,showTooltip:this.showTooltip,mainMenuTitleStyle:this.mainMenuTitleStyle})}}function j(e){const{menu:t,showTooltip:n}=e,l=(0,d.getHistory)(),i=(0,m.useRef)(null),[a,o]=(0,m.useState)(l.location),[r,s]=(0,m.useState)(Number.MAX_SAFE_INTEGER),{pathname:u,search:h}=a,p=(0,m.useMemo)((()=>{var e;return(null!==(e=null==t?void 0:t.menuItems)&&void 0!==e?e:[]).filter((e=>{var t;return"default"===e.type||!e.type||["group","subMenu"].includes(e.type)&&(null===(t=e.items)||void 0===t?void 0:t.length)}))}),[null==t?void 0:t.menuItems]),g=(0,m.useMemo)((()=>{const{selectedKeys:e}=(0,v.LP)(null!=p?p:[],u,h,"");return e}),[p,u,h]);(0,m.useEffect)((()=>{const e=l.listen((e=>{o(e)}));return e}),[]),(0,m.useEffect)((()=>{if(i.current){const e=new ResizeObserver((()=>{if(i.current){var e;const{width:t}=null!==(e=i.current.getClientRects()[0])&&void 0!==e?e:{},n=i.current.childNodes;if(n.length&&t){let e=t,l=n.length;for(let t=0;t<n.length;t++){const{width:i,height:a}=n[t].getClientRects()[0];if(!a&&e-40<0){l=t-1;break}if(e=e-i-(t>0?8:0),e<0){l=t;break}}s(l<0?0:l)}}}));return e.observe(i.current),()=>{e.disconnect()}}}),[]);const w=(0,m.useMemo)((()=>({type:"subMenu",title:"···",items:p.slice(r,p.length)})),[p,r]);return c().createElement("div",{ref:i,className:"nav-menu-wrapper"},p.map(((t,l)=>{var i;const a=r<=l;return c().createElement(c().Fragment,{key:t.key},(0,y.Wf)(t,!0)&&"category"===t.childLayout&&null!==(i=t.items)&&void 0!==i&&i.length?c().createElement(P,{index:l,hidden:a,item:t,showTooltip:n,selectedKey:g,mainMenuTitleStyle:e.mainMenuTitleStyle}):"group"===t.type&&"siteMap"===t.childLayout?c().createElement(q,{index:l,hidden:a,item:t,showTooltip:n,selectedKey:g,topData:!0,mainMenuTitleStyle:e.mainMenuTitleStyle}):c().createElement(B,{index:l,hidden:a,item:t,showTooltip:n,selectedKey:g,topData:!0,mainMenuTitleStyle:e.mainMenuTitleStyle}))})),c().createElement(B,{hidden:r>p.length,item:w,showTooltip:n,selectedKey:g,overflow:!0,topData:!0,mainMenuTitleStyle:e.mainMenuTitleStyle}))}l=Z,({e:[x,S,A,N,K,D],c:[z,M]}=(0,r.A)(l,[C("eo-nav-menu",{styleTexts:[f.A,E.A,k.A,p.A]})],[[R({attribute:!1}),1,"menu"],[R({attribute:!1}),1,"mainMenuTitleStyle"],[R({type:Boolean}),1,"showTooltip"]],0,void 0,h.ReactNextElement)),M()}}]);
2
+ //# sourceMappingURL=eo-nav-menu.9b6796fc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/eo-nav-menu.95d97bec.js","mappings":"wYAwCA,MAAM,cAAEA,EAAa,SAAEC,IAAaC,EAAAA,EAAAA,oBAE9BC,GAAkBC,EAAAA,EAAAA,WACtB,gBAEIC,GAAiBD,EAAAA,EAAAA,WAKrB,aAAc,CACdE,gBAAiB,iBACjBC,sBAAuB,0BA2BzB,SAASC,EAAkBC,GACzB,MAAM,KAAEC,GAASD,EACjB,OAAOE,EAAAA,EAAAA,IAAUD,EAA0BD,EAAMG,SAC/CC,IAAAA,cAACC,GAAcC,EAAAA,EAAAA,GAAA,GAAKN,EAAK,CAAEC,KA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Q2H,EACRrI,KAAMA,EACNW,YAAaA,EACbC,YAAaA,EACbV,SAAS,EACTmB,mBAAoBtB,EAAMsB,qBAGf,IAGrBlB,IAAAA,cAACL,EAAiB,CAChBY,OAAQyF,EAAgBM,EAAUnE,OAClCtC,KAAMiI,EACNtH,YAAaA,EACbC,YAAaA,EACbqB,UAAU,EACV/B,SAAS,EACTmB,mBAAoBtB,EAAMsB,qBAIlC,CArJCiH,EAAA3D,IAAAT,GAAAc,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAAkD,GAAAjE,EAAAkE,KAAAC,EAAAA,EAAAA,GAAAH,EAAA,CAvCAhJ,EAAc,cAAe,CAC5BoJ,WAAY,CACVC,EAAAA,EACAC,EAAAA,EACAC,EAAAA,EACAC,EAAAA,MAEF,EAKCvJ,EAAS,CACRwJ,WAAW,IACX,WAGDxJ,EAAS,CACRwJ,WAAW,IACX,yBAMDxJ,EAAS,CACRuH,KAAMkC,UACN,2BAnBkBpE,EAAAA,mBAAgB4D,G","sources":["webpack:///./src/nav-menu/index.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators } from \"@next-core/element\";\nimport { getHistory } from \"@next-core/runtime\";\nimport { ReactNextElement, wrapBrick } from \"@next-core/react-element\";\nimport styleText from \"./nav-menu.shadow.css\";\nimport { UnregisterCallback } from \"history\";\nimport type { SidebarMenu } from \"@next-bricks/basic/menu\";\nimport type {\n MenuItem as MenuItemComponent,\n MenuComponentProps,\n} from \"@next-bricks/basic/menu-item\";\nimport { isSubMenu, isGroup, renderLinkCom, renderSpanCom } from \"./utils.js\";\nimport { initMenuItemAndMatchCurrentPathKeys } from \"@next-shared/general/menu\";\nimport type {\n SidebarMenuGroup,\n SidebarMenuItem,\n SidebarMenuSimpleItem,\n} from \"@next-shared/general/types\";\nimport type {\n Popover,\n PopoverProps,\n PopoverEvents,\n PopoverEventsMapping,\n Placement,\n} from \"@next-bricks/basic/popover\";\nimport \"@next-core/theme\";\nimport classnames from \"classnames\";\nimport { ThreeLevelMenuPopoverContent } from \"./ThreeLevelMenuPopoverContent.js\";\nimport { SiteMapItem } from \"./site-map/SiteMapItem.js\";\nimport SiteMapStyleText from \"../nav-menu/site-map/SiteMapItem.shadow.css\";\nimport ItemTagStyleText from \"../nav-menu/site-map/ItemTag.shadow.css\";\nimport GroupItemStyleText from \"../nav-menu/site-map/GroupItem.shadow.css\";\nimport \"./host-context.css\";\n\nconst { defineElement, property } = createDecorators();\n\nconst WrappedMenuItem = wrapBrick<MenuItemComponent, MenuComponentProps>(\n \"eo-menu-item\"\n);\nconst WrappedPopover = wrapBrick<\n Popover,\n PopoverProps,\n PopoverEvents,\n PopoverEventsMapping\n>(\"eo-popover\", {\n onVisibleChange: \"visible.change\",\n onBeforeVisibleChange: \"before.visible.change\",\n});\n\nconst GAP_WIDTH = 8;\n\ninterface NavMenuProps {\n menu?: SidebarMenu;\n showTooltip?: boolean;\n mainMenuTitleStyle: CSSProperties | undefined;\n}\n\ninterface MenuItemComProps {\n index?: number;\n hidden?: boolean;\n item: SidebarMenuItem;\n topData?: boolean;\n selectedKey?: string[];\n showTooltip?: boolean;\n overflow?: boolean;\n mainMenuTitleStyle?: CSSProperties;\n}\ninterface SimpleMenuItemComProps extends MenuItemComProps {\n item: SidebarMenuSimpleItem;\n}\ninterface MenuGroupComProps extends MenuItemComProps {\n item: SidebarMenuGroup;\n}\nfunction RenderMenuItemCom(props: MenuItemComProps) {\n const { item } = props;\n return isSubMenu(item as SidebarMenuGroup, props.topData) ? (\n <SubMenuItemCom {...props} item={item as SidebarMenuGroup}></SubMenuItemCom>\n ) : isGroup(item) ? (\n <GroupMenuItemCom {...props} item={item as SidebarMenuGroup} />\n ) : (\n <SimpleMenuItemCom\n {...props}\n item={item as SidebarMenuSimpleItem}\n ></SimpleMenuItemCom>\n );\n}\nfunction SimpleMenuItemCom(props: SimpleMenuItemComProps) {\n const { item, index, hidden, showTooltip, selectedKey = [] } = props;\n return (\n <WrappedMenuItem\n data-index={index}\n className={hidden ? \"overflow-menu-item\" : \"\"}\n key={item.key}\n title={showTooltip ? item.text : \"\"}\n active={item.key ? selectedKey.includes(item.key) : false}\n >\n {renderLinkCom(item, { width: \"100%\" }, props.mainMenuTitleStyle)}\n </WrappedMenuItem>\n );\n}\n\nlet scrollWidth: number;\n// istanbul ignore next;\nconst handlePopupVisibleChange = (event: CustomEvent<boolean>) => {\n // 当用户设置滚动条一直显示时,来回切换 overflow: hidden 会导致滚动条显示或隐藏\n // 造成页面宽度变化而导致的抖动的问题\n const paddingRight =\n scrollWidth ??\n (scrollWidth = window.innerWidth - document.body.clientWidth);\n\n document.body.style.paddingRight = event.detail ? paddingRight + \"px\" : \"\";\n document.body.style.overflow = event.detail ? \"hidden\" : \"\";\n document.body.style.touchAction = event.detail ? \"none\" : \"\";\n};\n\nfunction SubMenuItemCom({\n index,\n hidden,\n item,\n topData,\n showTooltip,\n selectedKey = [],\n overflow,\n mainMenuTitleStyle,\n}: MenuGroupComProps) {\n return item.items?.length > 0 ? (\n <WrappedPopover\n data-index={index}\n className={classnames(\"popover\", {\n subprime: !topData,\n \"overflow-menu-item\": hidden,\n })}\n arrow={false}\n trigger=\"hover\"\n placement={topData ? \"bottom-start\" : \"right-start\"}\n distance={0}\n anchorDisplay=\"block\"\n strategy=\"fixed\"\n >\n <WrappedMenuItem\n className=\"sub-menu-item-label 22\"\n key={item.key}\n slot=\"anchor\"\n title={showTooltip ? item.title : \"\"}\n >\n {renderSpanCom(item, !topData, { ...mainMenuTitleStyle })}\n </WrappedMenuItem>\n <div\n className={classnames(\"sub-menu-wrapper\", {\n \"overflow-menu-wrapper\": overflow,\n })}\n >\n {item.items.map((innerItem) => (\n <React.Fragment key={innerItem.key}>\n <RenderMenuItemCom\n item={innerItem}\n selectedKey={selectedKey}\n showTooltip={showTooltip}\n />\n </React.Fragment>\n ))}\n </div>\n </WrappedPopover>\n ) : null;\n}\n\nfunction GroupMenuItemCom({\n item,\n showTooltip,\n selectedKey = [],\n}: MenuGroupComProps) {\n return item.items?.length > 0 ? (\n item.childLayout === \"category\" ? (\n <ThreeLevelMenuCom\n item={item}\n selectedKey={selectedKey}\n showTooltip={showTooltip}\n placement=\"right-start\"\n anchorDisplay=\"block\"\n />\n ) : (item as SidebarMenuGroup).childLayout === \"siteMap\" ? (\n <SitMapMenCom\n item={item}\n selectedKey={selectedKey}\n showTooltip={showTooltip}\n placement=\"right-start\"\n anchorDisplay=\"block\"\n topData={false}\n />\n ) : (\n <>\n <div className=\"group-label\">{item.title}</div>\n <div className=\"group-wrapper\">\n {item.items.map((innerItem) => {\n return (\n <React.Fragment key={innerItem.key}>\n <RenderMenuItemCom\n item={innerItem}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n />\n </React.Fragment>\n );\n })}\n </div>\n </>\n )\n ) : null;\n}\n\nfunction ThreeLevelMenuCom({\n index,\n hidden,\n item,\n selectedKey = [],\n showTooltip,\n placement = \"bottom-start\",\n anchorDisplay,\n mainMenuTitleStyle,\n}: {\n index?: number;\n hidden?: boolean;\n item: SidebarMenuGroup;\n selectedKey?: string[];\n showTooltip?: boolean;\n placement?: Placement;\n anchorDisplay?: CSSProperties[\"display\"];\n mainMenuTitleStyle?: CSSProperties;\n}) {\n return item.items?.length > 0 ? (\n <WrappedPopover\n data-index={index}\n className={classnames(\"three-level-menu-popover\", \"popover\", {\n \"overflow-menu-item\": hidden,\n })}\n arrow={false}\n trigger={\"hover\"}\n placement={placement}\n distance={0}\n key={item.key}\n strategy=\"fixed\"\n anchorDisplay={anchorDisplay}\n onBeforeVisibleChange={handlePopupVisibleChange}\n >\n <WrappedMenuItem\n className=\"sub-menu-item-label\"\n key={item.key}\n slot=\"anchor\"\n title={showTooltip ? item.title : \"\"}\n >\n {renderSpanCom(item, false, mainMenuTitleStyle)}\n </WrappedMenuItem>\n <div className=\"sub-menu-wrapper\">\n <ThreeLevelMenuPopoverContent\n menuItem={item}\n selectedKey={selectedKey}\n ></ThreeLevelMenuPopoverContent>\n </div>\n </WrappedPopover>\n ) : null;\n}\n\nfunction SitMapMenCom({\n index,\n hidden,\n item,\n selectedKey = [],\n showTooltip,\n placement = \"bottom-start\",\n anchorDisplay,\n topData,\n mainMenuTitleStyle,\n}: {\n index?: number;\n hidden?: boolean;\n item: SidebarMenuGroup;\n selectedKey?: string[];\n showTooltip?: boolean;\n placement?: Placement;\n anchorDisplay?: CSSProperties[\"display\"];\n topData?: boolean;\n mainMenuTitleStyle?: CSSProperties;\n}) {\n const [visible, setVisible] = useState<boolean>();\n\n const handleVisibleChange = (event: CustomEvent<boolean>): void => {\n setVisible(event.detail);\n handlePopupVisibleChange(event);\n };\n\n return item.items?.length > 0 ? (\n <WrappedPopover\n data-index={index}\n className={classnames(\"popover\", {\n \"overflow-menu-item\": hidden,\n })}\n trigger={\"hover\"}\n placement={placement}\n distance={0}\n key={item.key}\n strategy=\"fixed\"\n arrow={false}\n anchorDisplay={anchorDisplay}\n onBeforeVisibleChange={handleVisibleChange}\n >\n <WrappedMenuItem\n className=\"sub-menu-item-label\"\n key={item.key}\n slot=\"anchor\"\n title={showTooltip ? item.title : \"\"}\n >\n {renderSpanCom(item, false, mainMenuTitleStyle)}\n </WrappedMenuItem>\n <div\n className={classnames(\"sub-menu-sit-map-wrapper\", {\n \"in-group-site-map\": !topData,\n })}\n onClick={(e) => e.stopPropagation()}\n >\n <SiteMapItem\n menuGroup={item}\n selectedKey={selectedKey}\n visible={visible}\n />\n </div>\n </WrappedPopover>\n ) : null;\n}\n\n/**\n * 菜单构件\n * @author sailor\n * @category navigation\n */\n@defineElement(\"eo-nav-menu\", {\n styleTexts: [\n SiteMapStyleText,\n ItemTagStyleText,\n GroupItemStyleText,\n styleText,\n ],\n})\nclass NavMenu extends ReactNextElement {\n /**\n * 菜单项\n */\n @property({\n attribute: false,\n })\n accessor menu: SidebarMenu | undefined;\n\n @property({\n attribute: false,\n })\n accessor mainMenuTitleStyle: CSSProperties | undefined;\n\n /**\n * 是否显示 tooltip\n */\n @property({\n type: Boolean,\n })\n accessor showTooltip: boolean | undefined;\n\n render() {\n return (\n <NavMenuComponent\n menu={this.menu}\n showTooltip={this.showTooltip}\n mainMenuTitleStyle={this.mainMenuTitleStyle}\n />\n );\n }\n}\n\nfunction NavMenuComponent(props: NavMenuProps) {\n const { menu, showTooltip } = props;\n\n const history = getHistory();\n const navMenuWrapperRef = useRef<HTMLDivElement>(null);\n const [location, setLocation] = useState(history.location);\n const [overflowIndex, setOverflowIndex] = useState<number>(\n Number.MAX_SAFE_INTEGER\n );\n const { pathname, search } = location;\n\n const menuItems = useMemo(() => {\n return (menu?.menuItems ?? []).filter(\n (item) =>\n // 默认\n item.type === \"default\" ||\n // 没有类型\n !item.type ||\n // 分组类型并且没有子项,过滤\n ([\"group\", \"subMenu\"].includes(item.type) &&\n (item as SidebarMenuGroup).items?.length)\n );\n }, [menu?.menuItems]);\n\n const selectedKey = useMemo(() => {\n const { selectedKeys } = initMenuItemAndMatchCurrentPathKeys(\n menuItems ?? [],\n pathname,\n search,\n \"\"\n );\n return selectedKeys;\n }, [menuItems, pathname, search]);\n\n useEffect(() => {\n const unListen: UnregisterCallback = history.listen((location) => {\n setLocation(location);\n });\n return unListen;\n }, []);\n\n useEffect(() => {\n if (navMenuWrapperRef.current) {\n const resizeObserver = new ResizeObserver(() => {\n if (navMenuWrapperRef.current) {\n const { width } = navMenuWrapperRef.current.getClientRects()[0] ?? {};\n const childNodes = navMenuWrapperRef.current.childNodes;\n\n if (childNodes.length && width) {\n let wrapperWidth = width;\n let overflowIndex = childNodes.length;\n\n for (let i = 0; i < childNodes.length; i++) {\n const { width: childWidth, height: childHeight } = (\n childNodes[i] as HTMLElement\n ).getClientRects()[0];\n\n if (!childHeight && wrapperWidth - 40 < 0) {\n overflowIndex = i - 1;\n break;\n }\n\n wrapperWidth =\n wrapperWidth - childWidth - (i > 0 ? GAP_WIDTH : 0);\n if (wrapperWidth < 0) {\n overflowIndex = i;\n break;\n }\n }\n\n setOverflowIndex(overflowIndex < 0 ? 0 : overflowIndex);\n }\n }\n });\n resizeObserver.observe(navMenuWrapperRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n }, []);\n\n const overflowMenu = useMemo(\n (): SidebarMenuItem => ({\n type: \"subMenu\",\n title: \"···\",\n items: menuItems.slice(\n overflowIndex,\n menuItems.length\n ) as SidebarMenuItem[],\n }),\n [menuItems, overflowIndex]\n );\n\n return (\n <div ref={navMenuWrapperRef} className=\"nav-menu-wrapper\">\n {menuItems.map((item, index) => {\n const isHidden = overflowIndex <= index;\n return (\n <React.Fragment key={item.key}>\n {isSubMenu(item as SidebarMenuGroup, true) &&\n (item as SidebarMenuGroup).childLayout === \"category\" &&\n (item as SidebarMenuGroup).items?.length ? (\n <ThreeLevelMenuCom\n index={index}\n hidden={isHidden}\n item={item as SidebarMenuGroup}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n ) : (item as SidebarMenuGroup).type === \"group\" &&\n (item as SidebarMenuGroup).childLayout === \"siteMap\" ? (\n <SitMapMenCom\n index={index}\n hidden={isHidden}\n item={item as SidebarMenuGroup}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n topData={true}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n ) : (\n <RenderMenuItemCom\n index={index}\n hidden={isHidden}\n item={item}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n topData={true}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n )}\n </React.Fragment>\n );\n })}\n <RenderMenuItemCom\n hidden={overflowIndex > menuItems.length}\n item={overflowMenu}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n overflow={true}\n topData={true}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n </div>\n );\n}\n\nexport { NavMenu };\n"],"names":["defineElement","property","createDecorators","WrappedMenuItem","wrapBrick","WrappedPopover","onVisibleChange","onBeforeVisibleChange","RenderMenuItemCom","props","item","isSubMenu","topData","React","SubMenuItemCom","_extends","isGroup","GroupMenuItemCom","SimpleMenuItemCom","index","hidden","showTooltip","selectedKey","className","key","title","text","active","includes","renderLinkCom","width","mainMenuTitleStyle","scrollWidth","handlePopupVisibleChange","event","paddingRight","window","innerWidth","document","body","clientWidth","style","detail","overflow","touchAction","_ref","_item$items","items","length","classnames","subprime","arrow","trigger","placement","distance","anchorDisplay","strategy","slot","renderSpanCom","map","innerItem","_ref2","_item$items2","childLayout","ThreeLevelMenuCom","SitMapMenCom","_ref3","_item$items3","ThreeLevelMenuPopoverContent","menuItem","_ref4","_item$items4","visible","setVisible","useState","onClick","e","stopPropagation","SiteMapItem","menuGroup","_NavMenu","_A","WeakMap","_B","_C","NavMenu","ReactNextElement","constructor","arguments","_classPrivateFieldInitSpec","_init_menu","_init_extra_menu","_init_mainMenuTitleStyle","_init_extra_mainMenuTitleStyle","_init_showTooltip","_init_extra_showTooltip","menu","_classPrivateFieldGet","v","_classPrivateFieldSet","render","NavMenuComponent","this","history","getHistory","navMenuWrapperRef","useRef","location","setLocation","overflowIndex","setOverflowIndex","Number","MAX_SAFE_INTEGER","pathname","search","menuItems","useMemo","_menu$menuItems","filter","_items","type","selectedKeys","initMenuItemAndMatchCurrentPathKeys","useEffect","unListen","listen","current","resizeObserver","ResizeObserver","_navMenuWrapperRef$cu","getClientRects","childNodes","wrapperWidth","i","childWidth","height","childHeight","observe","disconnect","overflowMenu","slice","ref","_items2","isHidden","_NavMenu2","c","_initClass","_applyDecs","styleTexts","SiteMapStyleText","ItemTagStyleText","GroupItemStyleText","styleText","attribute","Boolean"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/eo-nav-menu.9b6796fc.js","mappings":"wYAwCA,MAAM,cAAEA,EAAa,SAAEC,IAAaC,EAAAA,EAAAA,oBAE9BC,GAAkBC,EAAAA,EAAAA,WACtB,gBAEIC,GAAiBD,EAAAA,EAAAA,WAKrB,aAAc,CACdE,gBAAiB,iBACjBC,sBAAuB,0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EAAY,CACX9C,MAAOA,EACPC,OAAQ2H,EACRrI,KAAMA,EACNW,YAAaA,EACbC,YAAaA,EACbV,SAAS,EACTmB,mBAAoBtB,EAAMsB,qBAG5BlB,IAAAA,cAACL,EAAiB,CAChBW,MAAOA,EACPC,OAAQ2H,EACRrI,KAAMA,EACNW,YAAaA,EACbC,YAAaA,EACbV,SAAS,EACTmB,mBAAoBtB,EAAMsB,qBAGf,IAGrBlB,IAAAA,cAACL,EAAiB,CAChBY,OAAQyF,EAAgBM,EAAUnE,OAClCtC,KAAMiI,EACNtH,YAAaA,EACbC,YAAaA,EACbqB,UAAU,EACV/B,SAAS,EACTmB,mBAAoBtB,EAAMsB,qBAIlC,CArJCiH,EAAA3D,IAAAT,GAAAc,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAAkD,GAAAjE,EAAAkE,KAAAC,EAAAA,EAAAA,GAAAH,EAAA,CAvCAhJ,EAAc,cAAe,CAC5BoJ,WAAY,CACVC,EAAAA,EACAC,EAAAA,EACAC,EAAAA,EACAC,EAAAA,MAEF,EAKCvJ,EAAS,CACRwJ,WAAW,IACX,WAGDxJ,EAAS,CACRwJ,WAAW,IACX,yBAMDxJ,EAAS,CACRuH,KAAMkC,UACN,2BAnBkBpE,EAAAA,mBAAgB4D,G","sources":["webpack:///./src/nav-menu/index.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators } from \"@next-core/element\";\nimport { getHistory } from \"@next-core/runtime\";\nimport { ReactNextElement, wrapBrick } from \"@next-core/react-element\";\nimport styleText from \"./nav-menu.shadow.css\";\nimport { UnregisterCallback } from \"history\";\nimport type { SidebarMenu } from \"@next-bricks/basic/menu\";\nimport type {\n MenuItem as MenuItemComponent,\n MenuComponentProps,\n} from \"@next-bricks/basic/menu-item\";\nimport { isSubMenu, isGroup, renderLinkCom, renderSpanCom } from \"./utils.js\";\nimport { initMenuItemAndMatchCurrentPathKeys } from \"@next-shared/general/menu\";\nimport type {\n SidebarMenuGroup,\n SidebarMenuItem,\n SidebarMenuSimpleItem,\n} from \"@next-shared/general/types\";\nimport type {\n Popover,\n PopoverProps,\n PopoverEvents,\n PopoverEventsMapping,\n Placement,\n} from \"@next-bricks/basic/popover\";\nimport \"@next-core/theme\";\nimport classnames from \"classnames\";\nimport { ThreeLevelMenuPopoverContent } from \"./ThreeLevelMenuPopoverContent.js\";\nimport { SiteMapItem } from \"./site-map/SiteMapItem.js\";\nimport SiteMapStyleText from \"../nav-menu/site-map/SiteMapItem.shadow.css\";\nimport ItemTagStyleText from \"../nav-menu/site-map/ItemTag.shadow.css\";\nimport GroupItemStyleText from \"../nav-menu/site-map/GroupItem.shadow.css\";\nimport \"./host-context.css\";\n\nconst { defineElement, property } = createDecorators();\n\nconst WrappedMenuItem = wrapBrick<MenuItemComponent, MenuComponentProps>(\n \"eo-menu-item\"\n);\nconst WrappedPopover = wrapBrick<\n Popover,\n PopoverProps,\n PopoverEvents,\n PopoverEventsMapping\n>(\"eo-popover\", {\n onVisibleChange: \"visible.change\",\n onBeforeVisibleChange: \"before.visible.change\",\n});\n\nconst GAP_WIDTH = 8;\n\ninterface NavMenuProps {\n menu?: SidebarMenu;\n showTooltip?: boolean;\n mainMenuTitleStyle: CSSProperties | undefined;\n}\n\ninterface MenuItemComProps {\n index?: number;\n hidden?: boolean;\n item: SidebarMenuItem;\n topData?: boolean;\n selectedKey?: string[];\n showTooltip?: boolean;\n overflow?: boolean;\n mainMenuTitleStyle?: CSSProperties;\n}\ninterface SimpleMenuItemComProps extends MenuItemComProps {\n item: SidebarMenuSimpleItem;\n}\ninterface MenuGroupComProps extends MenuItemComProps {\n item: SidebarMenuGroup;\n}\nfunction RenderMenuItemCom(props: MenuItemComProps) {\n const { item } = props;\n return isSubMenu(item as SidebarMenuGroup, props.topData) ? (\n <SubMenuItemCom {...props} item={item as SidebarMenuGroup}></SubMenuItemCom>\n ) : isGroup(item) ? (\n <GroupMenuItemCom {...props} item={item as SidebarMenuGroup} />\n ) : (\n <SimpleMenuItemCom\n {...props}\n item={item as SidebarMenuSimpleItem}\n ></SimpleMenuItemCom>\n );\n}\nfunction SimpleMenuItemCom(props: SimpleMenuItemComProps) {\n const { item, index, hidden, showTooltip, selectedKey = [] } = props;\n return (\n <WrappedMenuItem\n data-index={index}\n className={hidden ? \"overflow-menu-item\" : \"\"}\n key={item.key}\n title={showTooltip ? item.text : \"\"}\n active={item.key ? selectedKey.includes(item.key) : false}\n >\n {renderLinkCom(item, { width: \"100%\" }, props.mainMenuTitleStyle)}\n </WrappedMenuItem>\n );\n}\n\nlet scrollWidth: number;\n// istanbul ignore next;\nconst handlePopupVisibleChange = (event: CustomEvent<boolean>) => {\n // 当用户设置滚动条一直显示时,来回切换 overflow: hidden 会导致滚动条显示或隐藏\n // 造成页面宽度变化而导致的抖动的问题\n const paddingRight =\n scrollWidth ??\n (scrollWidth = window.innerWidth - document.body.clientWidth);\n\n document.body.style.paddingRight = event.detail ? paddingRight + \"px\" : \"\";\n document.body.style.overflow = event.detail ? \"hidden\" : \"\";\n document.body.style.touchAction = event.detail ? \"none\" : \"\";\n};\n\nfunction SubMenuItemCom({\n index,\n hidden,\n item,\n topData,\n showTooltip,\n selectedKey = [],\n overflow,\n mainMenuTitleStyle,\n}: MenuGroupComProps) {\n return item.items?.length > 0 ? (\n <WrappedPopover\n data-index={index}\n className={classnames(\"popover\", {\n subprime: !topData,\n \"overflow-menu-item\": hidden,\n })}\n arrow={false}\n trigger=\"hover\"\n placement={topData ? \"bottom-start\" : \"right-start\"}\n distance={0}\n anchorDisplay=\"block\"\n strategy=\"fixed\"\n >\n <WrappedMenuItem\n className=\"sub-menu-item-label 22\"\n key={item.key}\n slot=\"anchor\"\n title={showTooltip ? item.title : \"\"}\n >\n {renderSpanCom(item, !topData, { ...mainMenuTitleStyle })}\n </WrappedMenuItem>\n <div\n className={classnames(\"sub-menu-wrapper\", {\n \"overflow-menu-wrapper\": overflow,\n })}\n >\n {item.items.map((innerItem) => (\n <React.Fragment key={innerItem.key}>\n <RenderMenuItemCom\n item={innerItem}\n selectedKey={selectedKey}\n showTooltip={showTooltip}\n />\n </React.Fragment>\n ))}\n </div>\n </WrappedPopover>\n ) : null;\n}\n\nfunction GroupMenuItemCom({\n item,\n showTooltip,\n selectedKey = [],\n}: MenuGroupComProps) {\n return item.items?.length > 0 ? (\n item.childLayout === \"category\" ? (\n <ThreeLevelMenuCom\n item={item}\n selectedKey={selectedKey}\n showTooltip={showTooltip}\n placement=\"right-start\"\n anchorDisplay=\"block\"\n />\n ) : (item as SidebarMenuGroup).childLayout === \"siteMap\" ? (\n <SitMapMenCom\n item={item}\n selectedKey={selectedKey}\n showTooltip={showTooltip}\n placement=\"right-start\"\n anchorDisplay=\"block\"\n topData={false}\n />\n ) : (\n <>\n <div className=\"group-label\">{item.title}</div>\n <div className=\"group-wrapper\">\n {item.items.map((innerItem) => {\n return (\n <React.Fragment key={innerItem.key}>\n <RenderMenuItemCom\n item={innerItem}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n />\n </React.Fragment>\n );\n })}\n </div>\n </>\n )\n ) : null;\n}\n\nfunction ThreeLevelMenuCom({\n index,\n hidden,\n item,\n selectedKey = [],\n showTooltip,\n placement = \"bottom-start\",\n anchorDisplay,\n mainMenuTitleStyle,\n}: {\n index?: number;\n hidden?: boolean;\n item: SidebarMenuGroup;\n selectedKey?: string[];\n showTooltip?: boolean;\n placement?: Placement;\n anchorDisplay?: CSSProperties[\"display\"];\n mainMenuTitleStyle?: CSSProperties;\n}) {\n return item.items?.length > 0 ? (\n <WrappedPopover\n data-index={index}\n className={classnames(\"three-level-menu-popover\", \"popover\", {\n \"overflow-menu-item\": hidden,\n })}\n arrow={false}\n trigger={\"hover\"}\n placement={placement}\n distance={0}\n key={item.key}\n strategy=\"fixed\"\n anchorDisplay={anchorDisplay}\n onBeforeVisibleChange={handlePopupVisibleChange}\n >\n <WrappedMenuItem\n className=\"sub-menu-item-label\"\n key={item.key}\n slot=\"anchor\"\n title={showTooltip ? item.title : \"\"}\n >\n {renderSpanCom(item, false, mainMenuTitleStyle)}\n </WrappedMenuItem>\n <div className=\"sub-menu-wrapper\">\n <ThreeLevelMenuPopoverContent\n menuItem={item}\n selectedKey={selectedKey}\n ></ThreeLevelMenuPopoverContent>\n </div>\n </WrappedPopover>\n ) : null;\n}\n\nfunction SitMapMenCom({\n index,\n hidden,\n item,\n selectedKey = [],\n showTooltip,\n placement = \"bottom-start\",\n anchorDisplay,\n topData,\n mainMenuTitleStyle,\n}: {\n index?: number;\n hidden?: boolean;\n item: SidebarMenuGroup;\n selectedKey?: string[];\n showTooltip?: boolean;\n placement?: Placement;\n anchorDisplay?: CSSProperties[\"display\"];\n topData?: boolean;\n mainMenuTitleStyle?: CSSProperties;\n}) {\n const [visible, setVisible] = useState<boolean>();\n\n const handleVisibleChange = (event: CustomEvent<boolean>): void => {\n setVisible(event.detail);\n handlePopupVisibleChange(event);\n };\n\n return item.items?.length > 0 ? (\n <WrappedPopover\n data-index={index}\n className={classnames(\"popover\", {\n \"overflow-menu-item\": hidden,\n })}\n trigger={\"hover\"}\n placement={placement}\n distance={0}\n key={item.key}\n strategy=\"fixed\"\n arrow={false}\n anchorDisplay={anchorDisplay}\n onBeforeVisibleChange={handleVisibleChange}\n >\n <WrappedMenuItem\n className=\"sub-menu-item-label\"\n key={item.key}\n slot=\"anchor\"\n title={showTooltip ? item.title : \"\"}\n >\n {renderSpanCom(item, false, mainMenuTitleStyle)}\n </WrappedMenuItem>\n <div\n className={classnames(\"sub-menu-sit-map-wrapper\", {\n \"in-group-site-map\": !topData,\n })}\n onClick={(e) => e.stopPropagation()}\n >\n <SiteMapItem\n menuGroup={item}\n selectedKey={selectedKey}\n visible={visible}\n />\n </div>\n </WrappedPopover>\n ) : null;\n}\n\n/**\n * 菜单构件\n * @author sailor\n * @category navigation\n */\n@defineElement(\"eo-nav-menu\", {\n styleTexts: [\n SiteMapStyleText,\n ItemTagStyleText,\n GroupItemStyleText,\n styleText,\n ],\n})\nclass NavMenu extends ReactNextElement {\n /**\n * 菜单项\n */\n @property({\n attribute: false,\n })\n accessor menu: SidebarMenu | undefined;\n\n @property({\n attribute: false,\n })\n accessor mainMenuTitleStyle: CSSProperties | undefined;\n\n /**\n * 是否显示 tooltip\n */\n @property({\n type: Boolean,\n })\n accessor showTooltip: boolean | undefined;\n\n render() {\n return (\n <NavMenuComponent\n menu={this.menu}\n showTooltip={this.showTooltip}\n mainMenuTitleStyle={this.mainMenuTitleStyle}\n />\n );\n }\n}\n\nfunction NavMenuComponent(props: NavMenuProps) {\n const { menu, showTooltip } = props;\n\n const history = getHistory();\n const navMenuWrapperRef = useRef<HTMLDivElement>(null);\n const [location, setLocation] = useState(history.location);\n const [overflowIndex, setOverflowIndex] = useState<number>(\n Number.MAX_SAFE_INTEGER\n );\n const { pathname, search } = location;\n\n const menuItems = useMemo(() => {\n return (menu?.menuItems ?? []).filter(\n (item) =>\n // 默认\n item.type === \"default\" ||\n // 没有类型\n !item.type ||\n // 分组类型并且没有子项,过滤\n ([\"group\", \"subMenu\"].includes(item.type) &&\n (item as SidebarMenuGroup).items?.length)\n );\n }, [menu?.menuItems]);\n\n const selectedKey = useMemo(() => {\n const { selectedKeys } = initMenuItemAndMatchCurrentPathKeys(\n menuItems ?? [],\n pathname,\n search,\n \"\"\n );\n return selectedKeys;\n }, [menuItems, pathname, search]);\n\n useEffect(() => {\n const unListen: UnregisterCallback = history.listen((location) => {\n setLocation(location);\n });\n return unListen;\n }, []);\n\n useEffect(() => {\n if (navMenuWrapperRef.current) {\n const resizeObserver = new ResizeObserver(() => {\n if (navMenuWrapperRef.current) {\n const { width } = navMenuWrapperRef.current.getClientRects()[0] ?? {};\n const childNodes = navMenuWrapperRef.current.childNodes;\n\n if (childNodes.length && width) {\n let wrapperWidth = width;\n let overflowIndex = childNodes.length;\n\n for (let i = 0; i < childNodes.length; i++) {\n const { width: childWidth, height: childHeight } = (\n childNodes[i] as HTMLElement\n ).getClientRects()[0];\n\n if (!childHeight && wrapperWidth - 40 < 0) {\n overflowIndex = i - 1;\n break;\n }\n\n wrapperWidth =\n wrapperWidth - childWidth - (i > 0 ? GAP_WIDTH : 0);\n if (wrapperWidth < 0) {\n overflowIndex = i;\n break;\n }\n }\n\n setOverflowIndex(overflowIndex < 0 ? 0 : overflowIndex);\n }\n }\n });\n resizeObserver.observe(navMenuWrapperRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n }, []);\n\n const overflowMenu = useMemo(\n (): SidebarMenuItem => ({\n type: \"subMenu\",\n title: \"···\",\n items: menuItems.slice(\n overflowIndex,\n menuItems.length\n ) as SidebarMenuItem[],\n }),\n [menuItems, overflowIndex]\n );\n\n return (\n <div ref={navMenuWrapperRef} className=\"nav-menu-wrapper\">\n {menuItems.map((item, index) => {\n const isHidden = overflowIndex <= index;\n return (\n <React.Fragment key={item.key}>\n {isSubMenu(item as SidebarMenuGroup, true) &&\n (item as SidebarMenuGroup).childLayout === \"category\" &&\n (item as SidebarMenuGroup).items?.length ? (\n <ThreeLevelMenuCom\n index={index}\n hidden={isHidden}\n item={item as SidebarMenuGroup}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n ) : (item as SidebarMenuGroup).type === \"group\" &&\n (item as SidebarMenuGroup).childLayout === \"siteMap\" ? (\n <SitMapMenCom\n index={index}\n hidden={isHidden}\n item={item as SidebarMenuGroup}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n topData={true}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n ) : (\n <RenderMenuItemCom\n index={index}\n hidden={isHidden}\n item={item}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n topData={true}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n )}\n </React.Fragment>\n );\n })}\n <RenderMenuItemCom\n hidden={overflowIndex > menuItems.length}\n item={overflowMenu}\n showTooltip={showTooltip}\n selectedKey={selectedKey}\n overflow={true}\n topData={true}\n mainMenuTitleStyle={props.mainMenuTitleStyle}\n />\n </div>\n );\n}\n\nexport { NavMenu };\n"],"names":["defineElement","property","createDecorators","WrappedMenuItem","wrapBrick","WrappedPopover","onVisibleChange","onBeforeVisibleChange","RenderMenuItemCom","props","item","isSubMenu","topData","React","SubMenuItemCom","_extends","isGroup","GroupMenuItemCom","SimpleMenuItemCom","index","hidden","showTooltip","selectedKey","className","key","title","text","active","includes","renderLinkCom","width","mainMenuTitleStyle","scrollWidth","handlePopupVisibleChange","event","paddingRight","window","innerWidth","document","body","clientWidth","style","detail","overflow","touchAction","_ref","_item$items","items","length","classnames","subprime","arrow","trigger","placement","distance","anchorDisplay","strategy","slot","renderSpanCom","map","innerItem","_ref2","_item$items2","childLayout","ThreeLevelMenuCom","SitMapMenCom","_ref3","_item$items3","ThreeLevelMenuPopoverContent","menuItem","_ref4","_item$items4","visible","setVisible","useState","onClick","e","stopPropagation","SiteMapItem","menuGroup","_NavMenu","_A","WeakMap","_B","_C","NavMenu","ReactNextElement","constructor","arguments","_classPrivateFieldInitSpec","_init_menu","_init_extra_menu","_init_mainMenuTitleStyle","_init_extra_mainMenuTitleStyle","_init_showTooltip","_init_extra_showTooltip","menu","_classPrivateFieldGet","v","_classPrivateFieldSet","render","NavMenuComponent","this","history","getHistory","navMenuWrapperRef","useRef","location","setLocation","overflowIndex","setOverflowIndex","Number","MAX_SAFE_INTEGER","pathname","search","menuItems","useMemo","_menu$menuItems","filter","_items","type","selectedKeys","initMenuItemAndMatchCurrentPathKeys","useEffect","unListen","listen","current","resizeObserver","ResizeObserver","_navMenuWrapperRef$cu","getClientRects","childNodes","wrapperWidth","i","childWidth","height","childHeight","observe","disconnect","overflowMenu","slice","ref","_items2","isHidden","_NavMenu2","c","_initClass","_applyDecs","styleTexts","SiteMapStyleText","ItemTagStyleText","GroupItemStyleText","styleText","attribute","Boolean"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
- /*! For license information please see eo-sidebar-menu-group.5bb5c7c3.js.LICENSE.txt */
2
- (globalThis.webpackChunk_next_bricks_nav=globalThis.webpackChunk_next_bricks_nav||[]).push([[62,1369,2052],{829:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2559);function o(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2016);function o(e,t,n){(0,r.A)(e,t),t.set(e,n)}},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1369:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7545);function o(e){var t=function(e){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,r.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},2016:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},2559:(e,t,n)=>{"use strict";function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},2740:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(7545),o=n(6902);function i(e,t,n){"symbol"==(0,r.A)(t)&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}var a=n(1369);function s(e,t,n,s,l,c){var u,p,d,m,f,h,g,b=Symbol.metadata||Symbol.for("Symbol.metadata"),v=Object.defineProperty,y=Object.create,w=[y(null),y(null)],E=t.length;function x(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a<t.length;a++)i=t[a].apply(o,r?[i]:[]);return r?i:o}}function A(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function k(e,t,n,o,a,s,l,c,d,m,f){function h(e){if(!f(e))throw new TypeError("Attempted to access private element on non-instance")}var g=[].concat(t[0]),b=t[3],y=!l,E=1===a,k=3===a,S=4===a,C=2===a;function j(t,n,r){return function(o,i){return n&&(i=o,o=e),r&&r(o),z[t].call(o,i)}}if(!y){var z={},O=[],K=k?"get":S||E?"set":"value";if(d?(m||E?z={get:i((function(){return b(this)}),o,"get"),set:function(e){t[4](this,e)}}:z[K]=b,m||i(z[K],o,C?"":K)):m||(z=Object.getOwnPropertyDescriptor(e,o)),!m&&!d){if((p=w[+c][o])&&7!=(p^a))throw Error("Decorating two elements with the same name ("+z[K].name+") is not supported yet");w[+c][o]=a<3?1:a}}for(var N=e,B=g.length-1;B>=0;B-=n?2:1){var M=A(g[B],"A decorator","be",!0),P=n?g[B-1]:void 0,T={},I={kind:["field","accessor","method","getter","setter","class"][a],name:o,metadata:u,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");A(t,"An initializer","be",!0),s.push(t)}.bind(null,T)};if(y)p=M.call(P,N,I),T.v=1,A(p,"class decorators","return")&&(N=p);else if(I.static=c,I.private=d,p=I.access={has:d?f.bind():function(e){return o in e}},S||(p.get=d?C?function(e){return h(e),z.value}:j("get",0,h):function(e){return e[o]}),C||k||(p.set=d?j("set",0,h):function(e,t){e[o]=t}),N=M.call(P,E?{get:z.get,set:z.set}:z[K],I),T.v=1,E){if("object"==(0,r.A)(N)&&N)(p=A(N.get,"accessor.get"))&&(z.get=p),(p=A(N.set,"accessor.set"))&&(z.set=p),(p=A(N.init,"accessor.init"))&&O.unshift(p);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else A(N,(m?"field":"method")+" decorators","return")&&(m?O.unshift(N):z[K]=N)}return a<2&&l.push(x(O,c,1),x(s,c,0)),m||y||(d?E?l.splice(-1,0,j("get",c),j("set",c)):l.push(C?z[K]:A.call.bind(z[K])):v(e,o,z)),N}function S(e){return v(e,b,{configurable:!0,enumerable:!0,value:u})}return void 0!==c&&(u=c[b]),u=y(null==u?null:u),f=[],h=function(e){e&&f.push(x(e))},g=function(t,r){for(var i=0;i<n.length;i++){var s=n[i],c=s[1],u=7&c;if((8&c)==t&&!u==r){var p=s[2],h=!!s[3],g=16&c;k(t?e:e.prototype,s,g,h?"#"+p:(0,a.A)(p),u,u<2?[]:t?m=m||[]:d=d||[],f,!!t,h,r,t&&h?function(t){return(0,o.A)(t)===e}:l)}}},g(8,0),g(0,0),g(8,1),g(0,1),h(d),h(m),p=f,E||S(e),{e:p,get c(){var n=[];return E&&[S(e=k(e,[t],s,e.name,5,n)),x(n,1)]}}}},3352:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>d,VI:()=>h,Wb:()=>p,i2:()=>g,k_:()=>m,mK:()=>u,wZ:()=>C,zD:()=>f});var r=n(9575),o=n(8769),i=n.n(o),a=n(6911),s=n(9859);const l=new Set(["EO-SIDEBAR-MENU-ITEM","EO-SIDEBAR-MENU-GROUP","EO-SIDEBAR-MENU-SUBMENU"]),c=e=>l.has(e.tagName);function u(e){const t=(0,o.useRef)(null),n=(0,o.useCallback)((()=>{var n;null===(n=t.current)||void 0===n||n.assignedElements().forEach((t=>{c(t)&&(t.menuCollapsed=e)}))}),[e]);return(0,o.useEffect)((()=>{n()}),[e,n]),(0,o.useEffect)((()=>{const e=t.current,r=()=>{n()};return null==e||e.addEventListener("slotchange",r),()=>{null==e||e.removeEventListener("slotchange",r)}}),[n]),[t]}const p="side-bar-has-been-used",d="side-bar-expand-state",m="side-bar-resize-width";let f=function(e){return e.Collapsed="collapsed",e.Hovered="hovered",e.Expanded="expanded",e}({});const h=parseInt((0,a.getCssPropertyValue)("--side-bar-width",document.body),10)||220,g=parseInt((0,a.getCssPropertyValue)("--side-bar-collapsed-width",document.body),10)||60,b=(0,o.createContext)({selectedKeys:[],openedKeys:[],matchedKeys:[]}),v=(0,s.wrapBrick)("eo-sidebar-menu"),y=(0,s.wrapBrick)("eo-sidebar-menu-item"),w=(0,s.wrapBrick)("eo-sidebar-menu-group"),E=(0,s.wrapBrick)("eo-sidebar-menu-submenu");function x(e){const{to:t,href:n,target:r,icon:a,text:s,id:l,inSubmenu:c}=e,{selectedKeys:u}=(0,o.useContext)(b);return i().createElement(y,{url:t,href:n,target:r,icon:a,inSubmenu:c,selected:u.includes(l)},s)}function A(e){const{title:t,items:n,id:a,top:s,inSubmenu:l}=e,{matchedKeys:c}=(0,o.useContext)(b),u=a&&c.includes(a);return(null==n?void 0:n.length)>0?i().createElement(w,{selected:!!u,collapsable:!s},i().createElement("span",{slot:"title"},t),e.items.map((e=>i().createElement(S,(0,r.A)({key:e.key},e,{id:e.key,top:!1,inSubmenu:l}))))):null}function k(e){const{title:t,icon:n,items:a,id:s}=e,{openedKeys:l,matchedKeys:c}=(0,o.useContext)(b),u=s&&c.includes(s);return(null==a?void 0:a.length)>0?i().createElement(E,{icon:n,collapsed:!l.includes(s),selected:!!u},i().createElement("span",{slot:"title"},t),e.items.map((e=>i().createElement(S,(0,r.A)({key:e.key},e,{id:e.key,top:!1,inSubmenu:!0}))))):null}function S(e){return"subMenu"===e.type?i().createElement(k,e):"group"===e.type?i().createElement(A,e):i().createElement(x,e)}function C(e){var t;const{menu:n,expandedState:o,selectedKeys:a,openedKeys:s,matchedKeys:l}=e;return i().createElement(b.Provider,{value:{selectedKeys:a||[],openedKeys:s||[],matchedKeys:l||[]}},i().createElement(v,{menuCollapsed:o===f.Collapsed},null==n||null===(t=n.menuItems)||void 0===t?void 0:t.map((e=>i().createElement(S,(0,r.A)({key:e.key},e,{id:e.key,top:!0}))))))}},3373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},6121:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2559);function o(e,t,n){return e.set((0,r.A)(e,t),n),n}},6758:e=>{"use strict";e.exports=function(e){return e[1]}},6902:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7545);function o(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==e?(0,r.A)(e):"null"));return e}},7144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EoSidebarMenuGroup:()=>j,EoSidebarMenuGroupComponent:()=>P});var r,o=n(918),i=n(6121),a=n(829),s=n(2740),l=n(8769),c=n.n(l),u=n(6192),p=n(9859),d=(n(6477),n(8619)),m=n(3352),f=n(3373),h=n.n(f);let g,b,v,y,w,E,x,A,k;const{defineElement:S,property:C}=(0,u.createDecorators)();let j;var z=new WeakMap,O=new WeakMap,K=new WeakMap,N=new WeakMap,B=new WeakMap;class M extends p.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,z,b(this)),(0,o.A)(this,O,(v(this),y(this))),(0,o.A)(this,K,(w(this),E(this))),(0,o.A)(this,N,(x(this),A(this))),(0,o.A)(this,B,(k(this),e=>{this.collapsed=e}))}get collapsable(){return(0,a.A)(z,this)}set collapsable(e){(0,i.A)(z,this,e)}get collapsed(){return(0,a.A)(O,this)}set collapsed(e){(0,i.A)(O,this,e)}get selected(){return(0,a.A)(K,this)}set selected(e){(0,i.A)(K,this,e)}get menuCollapsed(){return(0,a.A)(N,this)}set menuCollapsed(e){(0,i.A)(N,this,e)}render(){return c().createElement(P,{collapsable:this.collapsable,selected:this.selected,collapsed:this.collapsed,menuCollapsed:this.menuCollapsed,onCollapseChange:(0,a.A)(B,this)})}}function P(e){const{collapsable:t=!1,collapsed:n,menuCollapsed:r,onCollapseChange:o}=e,[i]=(0,m.mK)(r),a=(0,l.useRef)(null),s=(0,l.useCallback)((()=>{!r&&(null==o||o(!n))}),[r,o,n]);return(0,l.useEffect)((()=>{const e=a.current;return null==e||e.addEventListener("click",s),()=>{null==e||e.removeEventListener("click",s)}}),[s]),c().createElement("div",{className:h()("menu-group",{"menu-group-collapsed":!!r||n})},c().createElement("div",{className:"menu-group-title",ref:a},c().createElement("span",{className:"menu-group-title-icon-container"},c().createElement("span",{className:"menu-group-title-icon"})),c().createElement("div",{className:"menu-group-title-text"},c().createElement("slot",{name:"title"})),t&&c().createElement("span",{className:"menu-group-arrow"})),c().createElement("div",{className:"menu-group-list"},c().createElement("div",{className:"menu-group-list-inner"},c().createElement("slot",{ref:i}))))}r=M,({e:[b,v,y,w,E,x,A,k],c:[j,g]}=(0,s.A)(r,[S("eo-sidebar-menu-group",{styleTexts:[d.A]})],[[C({type:Boolean}),1,"collapsable"],[C({type:Boolean}),1,"collapsed"],[C({type:Boolean}),1,"selected"],[C({type:Boolean}),1,"menuCollapsed"]],0,void 0,p.ReactNextElement)),g()},7545:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},8619:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(6758),o=n.n(r),i=n(935),a=n.n(i)()(o());a.push([e.id,':host{display:block;--menu-item-icon-size:20px}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.menu-group-title{position:relative;display:flex;align-items:center;min-height:36px;padding:8px 12px;line-height:20px;color:var(--left-secondary-text-color);border-radius:var(--larger-border-radius);transition:all var(--side-bar-collapse-transition-duration) var(--side-bar-collapse-transition-timing-function)}.menu-group-title-icon-container{flex-shrink:0;margin-right:14px;display:flex;align-items:center;justify-content:center;width:var(--menu-item-icon-size);height:var(--menu-item-icon-size);color:var(--left-sidebar-item-collapsed-icon-color);font-size:var(--menu-item-icon-size);transition:all var(--side-bar-collapse-transition-duration) var(--side-bar-collapse-transition-timing-function)}.menu-group-title-icon{width:1em;height:1em;border-bottom:2px solid var(--left-sidebar-group-border-color)}.menu-group-title-text{flex:1;font-size:12px;overflow:hidden;white-space:nowrap;margin-right:12px}.menu-group-list slot::slotted(*){margin-top:2px}.menu-group-arrow{position:absolute;top:50%;right:12px;width:10px;transform:translateY(-2px);transition:all 0.3s cubic-bezier(0.645,0.045,0.355,1)}.menu-group-arrow::before,\n.menu-group-arrow::after{content:"";position:absolute;width:6px;height:1.5px;background-color:currentColor;border-radius:2px;transition:all 0.3s cubic-bezier(0.645,0.045,0.355,1)}.menu-group-arrow::before{transform:rotate(45deg) translateX(2.5px)}.menu-group-arrow::after{transform:rotate(-45deg) translateX(-2.5px)}.menu-group-collapsed .menu-group-arrow{transform:translateY(-50%)}.menu-group-collapsed .menu-group-arrow::before{transform:rotate(-45deg) translateX(2.5px)}.menu-group-collapsed .menu-group-arrow::after{transform:rotate(45deg) translateX(-2.5px)}.menu-group-list{display:grid;grid-template-rows:1fr;transition:all var(--side-bar-collapse-transition-duration) var(--side-bar-collapse-transition-timing-function)}.menu-group-list-inner{overflow:hidden}:host([menu-collapsed]) .menu-group-title{padding:0px calc(50% - var(--menu-item-icon-size) / 2)}:host(:not([menu-collapsed])) .menu-group-title-icon-container{width:0;margin-right:0;opacity:0}:host([menu-collapsed]) .menu-group-title-text{opacity:0}:host([menu-collapsed]) .menu-group-arrow{opacity:0}:host(:not([menu-collapsed])) .menu-group-title-text{white-space:pre-wrap;display:-webkit-inline-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;text-overflow:ellipsis;color:#7f8ba6}:host([collapsable]) .menu-group-collapsed .menu-group-list{grid-template-rows:0fr;opacity:0}',""]);const s=a.toString()},9575:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})}}]);
3
- //# sourceMappingURL=eo-sidebar-menu-group.5bb5c7c3.js.map
1
+ /*! For license information please see eo-sidebar-menu-group.ff0786e7.js.LICENSE.txt */
2
+ (globalThis.webpackChunk_next_bricks_nav=globalThis.webpackChunk_next_bricks_nav||[]).push([[62,1369,2052],{829:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2559);function o(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2016);function o(e,t,n){(0,r.A)(e,t),t.set(e,n)}},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1369:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7545);function o(e){var t=function(e){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,r.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},2016:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},2559:(e,t,n)=>{"use strict";function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},2740:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(7545),o=n(6902);function i(e,t,n){"symbol"==(0,r.A)(t)&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}var a=n(1369);function s(e,t,n,s,l,c){var u,p,d,m,f,h,g,b=Symbol.metadata||Symbol.for("Symbol.metadata"),v=Object.defineProperty,y=Object.create,w=[y(null),y(null)],E=t.length;function x(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a<t.length;a++)i=t[a].apply(o,r?[i]:[]);return r?i:o}}function A(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function k(e,t,n,o,a,s,l,c,d,m,f){function h(e){if(!f(e))throw new TypeError("Attempted to access private element on non-instance")}var g=[].concat(t[0]),b=t[3],y=!l,E=1===a,k=3===a,S=4===a,C=2===a;function j(t,n,r){return function(o,i){return n&&(i=o,o=e),r&&r(o),z[t].call(o,i)}}if(!y){var z={},O=[],K=k?"get":S||E?"set":"value";if(d?(m||E?z={get:i((function(){return b(this)}),o,"get"),set:function(e){t[4](this,e)}}:z[K]=b,m||i(z[K],o,C?"":K)):m||(z=Object.getOwnPropertyDescriptor(e,o)),!m&&!d){if((p=w[+c][o])&&7!=(p^a))throw Error("Decorating two elements with the same name ("+z[K].name+") is not supported yet");w[+c][o]=a<3?1:a}}for(var N=e,B=g.length-1;B>=0;B-=n?2:1){var M=A(g[B],"A decorator","be",!0),P=n?g[B-1]:void 0,T={},I={kind:["field","accessor","method","getter","setter","class"][a],name:o,metadata:u,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");A(t,"An initializer","be",!0),s.push(t)}.bind(null,T)};if(y)p=M.call(P,N,I),T.v=1,A(p,"class decorators","return")&&(N=p);else if(I.static=c,I.private=d,p=I.access={has:d?f.bind():function(e){return o in e}},S||(p.get=d?C?function(e){return h(e),z.value}:j("get",0,h):function(e){return e[o]}),C||k||(p.set=d?j("set",0,h):function(e,t){e[o]=t}),N=M.call(P,E?{get:z.get,set:z.set}:z[K],I),T.v=1,E){if("object"==(0,r.A)(N)&&N)(p=A(N.get,"accessor.get"))&&(z.get=p),(p=A(N.set,"accessor.set"))&&(z.set=p),(p=A(N.init,"accessor.init"))&&O.unshift(p);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else A(N,(m?"field":"method")+" decorators","return")&&(m?O.unshift(N):z[K]=N)}return a<2&&l.push(x(O,c,1),x(s,c,0)),m||y||(d?E?l.splice(-1,0,j("get",c),j("set",c)):l.push(C?z[K]:A.call.bind(z[K])):v(e,o,z)),N}function S(e){return v(e,b,{configurable:!0,enumerable:!0,value:u})}return void 0!==c&&(u=c[b]),u=y(null==u?null:u),f=[],h=function(e){e&&f.push(x(e))},g=function(t,r){for(var i=0;i<n.length;i++){var s=n[i],c=s[1],u=7&c;if((8&c)==t&&!u==r){var p=s[2],h=!!s[3],g=16&c;k(t?e:e.prototype,s,g,h?"#"+p:(0,a.A)(p),u,u<2?[]:t?m=m||[]:d=d||[],f,!!t,h,r,t&&h?function(t){return(0,o.A)(t)===e}:l)}}},g(8,0),g(0,0),g(8,1),g(0,1),h(d),h(m),p=f,E||S(e),{e:p,get c(){var n=[];return E&&[S(e=k(e,[t],s,e.name,5,n)),x(n,1)]}}}},3352:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>d,VI:()=>h,Wb:()=>p,i2:()=>g,k_:()=>m,mK:()=>u,wZ:()=>C,zD:()=>f});var r=n(9575),o=n(8769),i=n.n(o),a=n(8626),s=n(9859);const l=new Set(["EO-SIDEBAR-MENU-ITEM","EO-SIDEBAR-MENU-GROUP","EO-SIDEBAR-MENU-SUBMENU"]),c=e=>l.has(e.tagName);function u(e){const t=(0,o.useRef)(null),n=(0,o.useCallback)((()=>{var n;null===(n=t.current)||void 0===n||n.assignedElements().forEach((t=>{c(t)&&(t.menuCollapsed=e)}))}),[e]);return(0,o.useEffect)((()=>{n()}),[e,n]),(0,o.useEffect)((()=>{const e=t.current,r=()=>{n()};return null==e||e.addEventListener("slotchange",r),()=>{null==e||e.removeEventListener("slotchange",r)}}),[n]),[t]}const p="side-bar-has-been-used",d="side-bar-expand-state",m="side-bar-resize-width";let f=function(e){return e.Collapsed="collapsed",e.Hovered="hovered",e.Expanded="expanded",e}({});const h=parseInt((0,a.getCssPropertyValue)("--side-bar-width",document.body),10)||220,g=parseInt((0,a.getCssPropertyValue)("--side-bar-collapsed-width",document.body),10)||60,b=(0,o.createContext)({selectedKeys:[],openedKeys:[],matchedKeys:[]}),v=(0,s.wrapBrick)("eo-sidebar-menu"),y=(0,s.wrapBrick)("eo-sidebar-menu-item"),w=(0,s.wrapBrick)("eo-sidebar-menu-group"),E=(0,s.wrapBrick)("eo-sidebar-menu-submenu");function x(e){const{to:t,href:n,target:r,icon:a,text:s,id:l,inSubmenu:c}=e,{selectedKeys:u}=(0,o.useContext)(b);return i().createElement(y,{url:t,href:n,target:r,icon:a,inSubmenu:c,selected:u.includes(l)},s)}function A(e){const{title:t,items:n,id:a,top:s,inSubmenu:l}=e,{matchedKeys:c}=(0,o.useContext)(b),u=a&&c.includes(a);return(null==n?void 0:n.length)>0?i().createElement(w,{selected:!!u,collapsable:!s},i().createElement("span",{slot:"title"},t),e.items.map((e=>i().createElement(S,(0,r.A)({key:e.key},e,{id:e.key,top:!1,inSubmenu:l}))))):null}function k(e){const{title:t,icon:n,items:a,id:s}=e,{openedKeys:l,matchedKeys:c}=(0,o.useContext)(b),u=s&&c.includes(s);return(null==a?void 0:a.length)>0?i().createElement(E,{icon:n,collapsed:!l.includes(s),selected:!!u},i().createElement("span",{slot:"title"},t),e.items.map((e=>i().createElement(S,(0,r.A)({key:e.key},e,{id:e.key,top:!1,inSubmenu:!0}))))):null}function S(e){return"subMenu"===e.type?i().createElement(k,e):"group"===e.type?i().createElement(A,e):i().createElement(x,e)}function C(e){var t;const{menu:n,expandedState:o,selectedKeys:a,openedKeys:s,matchedKeys:l}=e;return i().createElement(b.Provider,{value:{selectedKeys:a||[],openedKeys:s||[],matchedKeys:l||[]}},i().createElement(v,{menuCollapsed:o===f.Collapsed},null==n||null===(t=n.menuItems)||void 0===t?void 0:t.map((e=>i().createElement(S,(0,r.A)({key:e.key},e,{id:e.key,top:!0}))))))}},3373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},6121:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2559);function o(e,t,n){return e.set((0,r.A)(e,t),n),n}},6758:e=>{"use strict";e.exports=function(e){return e[1]}},6902:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7545);function o(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==e?(0,r.A)(e):"null"));return e}},7144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EoSidebarMenuGroup:()=>j,EoSidebarMenuGroupComponent:()=>P});var r,o=n(918),i=n(6121),a=n(829),s=n(2740),l=n(8769),c=n.n(l),u=n(6192),p=n(9859),d=(n(6477),n(8619)),m=n(3352),f=n(3373),h=n.n(f);let g,b,v,y,w,E,x,A,k;const{defineElement:S,property:C}=(0,u.createDecorators)();let j;var z=new WeakMap,O=new WeakMap,K=new WeakMap,N=new WeakMap,B=new WeakMap;class M extends p.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,z,b(this)),(0,o.A)(this,O,(v(this),y(this))),(0,o.A)(this,K,(w(this),E(this))),(0,o.A)(this,N,(x(this),A(this))),(0,o.A)(this,B,(k(this),e=>{this.collapsed=e}))}get collapsable(){return(0,a.A)(z,this)}set collapsable(e){(0,i.A)(z,this,e)}get collapsed(){return(0,a.A)(O,this)}set collapsed(e){(0,i.A)(O,this,e)}get selected(){return(0,a.A)(K,this)}set selected(e){(0,i.A)(K,this,e)}get menuCollapsed(){return(0,a.A)(N,this)}set menuCollapsed(e){(0,i.A)(N,this,e)}render(){return c().createElement(P,{collapsable:this.collapsable,selected:this.selected,collapsed:this.collapsed,menuCollapsed:this.menuCollapsed,onCollapseChange:(0,a.A)(B,this)})}}function P(e){const{collapsable:t=!1,collapsed:n,menuCollapsed:r,onCollapseChange:o}=e,[i]=(0,m.mK)(r),a=(0,l.useRef)(null),s=(0,l.useCallback)((()=>{!r&&(null==o||o(!n))}),[r,o,n]);return(0,l.useEffect)((()=>{const e=a.current;return null==e||e.addEventListener("click",s),()=>{null==e||e.removeEventListener("click",s)}}),[s]),c().createElement("div",{className:h()("menu-group",{"menu-group-collapsed":!!r||n})},c().createElement("div",{className:"menu-group-title",ref:a},c().createElement("span",{className:"menu-group-title-icon-container"},c().createElement("span",{className:"menu-group-title-icon"})),c().createElement("div",{className:"menu-group-title-text"},c().createElement("slot",{name:"title"})),t&&c().createElement("span",{className:"menu-group-arrow"})),c().createElement("div",{className:"menu-group-list"},c().createElement("div",{className:"menu-group-list-inner"},c().createElement("slot",{ref:i}))))}r=M,({e:[b,v,y,w,E,x,A,k],c:[j,g]}=(0,s.A)(r,[S("eo-sidebar-menu-group",{styleTexts:[d.A]})],[[C({type:Boolean}),1,"collapsable"],[C({type:Boolean}),1,"collapsed"],[C({type:Boolean}),1,"selected"],[C({type:Boolean}),1,"menuCollapsed"]],0,void 0,p.ReactNextElement)),g()},7545:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},8619:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(6758),o=n.n(r),i=n(935),a=n.n(i)()(o());a.push([e.id,':host{display:block;--menu-item-icon-size:20px}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.menu-group-title{position:relative;display:flex;align-items:center;min-height:36px;padding:8px 12px;line-height:20px;color:var(--left-secondary-text-color);border-radius:var(--larger-border-radius);transition:all var(--side-bar-collapse-transition-duration) var(--side-bar-collapse-transition-timing-function)}.menu-group-title-icon-container{flex-shrink:0;margin-right:14px;display:flex;align-items:center;justify-content:center;width:var(--menu-item-icon-size);height:var(--menu-item-icon-size);color:var(--left-sidebar-item-collapsed-icon-color);font-size:var(--menu-item-icon-size);transition:all var(--side-bar-collapse-transition-duration) var(--side-bar-collapse-transition-timing-function)}.menu-group-title-icon{width:1em;height:1em;border-bottom:2px solid var(--left-sidebar-group-border-color)}.menu-group-title-text{flex:1;font-size:12px;overflow:hidden;white-space:nowrap;margin-right:12px}.menu-group-list slot::slotted(*){margin-top:2px}.menu-group-arrow{position:absolute;top:50%;right:12px;width:10px;transform:translateY(-2px);transition:all 0.3s cubic-bezier(0.645,0.045,0.355,1)}.menu-group-arrow::before,\n.menu-group-arrow::after{content:"";position:absolute;width:6px;height:1.5px;background-color:currentColor;border-radius:2px;transition:all 0.3s cubic-bezier(0.645,0.045,0.355,1)}.menu-group-arrow::before{transform:rotate(45deg) translateX(2.5px)}.menu-group-arrow::after{transform:rotate(-45deg) translateX(-2.5px)}.menu-group-collapsed .menu-group-arrow{transform:translateY(-50%)}.menu-group-collapsed .menu-group-arrow::before{transform:rotate(-45deg) translateX(2.5px)}.menu-group-collapsed .menu-group-arrow::after{transform:rotate(45deg) translateX(-2.5px)}.menu-group-list{display:grid;grid-template-rows:1fr;transition:all var(--side-bar-collapse-transition-duration) var(--side-bar-collapse-transition-timing-function)}.menu-group-list-inner{overflow:hidden}:host([menu-collapsed]) .menu-group-title{padding:0px calc(50% - var(--menu-item-icon-size) / 2)}:host(:not([menu-collapsed])) .menu-group-title-icon-container{width:0;margin-right:0;opacity:0}:host([menu-collapsed]) .menu-group-title-text{opacity:0}:host([menu-collapsed]) .menu-group-arrow{opacity:0}:host(:not([menu-collapsed])) .menu-group-title-text{white-space:pre-wrap;display:-webkit-inline-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;text-overflow:ellipsis;color:#7f8ba6}:host([collapsable]) .menu-group-collapsed .menu-group-list{grid-template-rows:0fr;opacity:0}',""]);const s=a.toString()},9575:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})}}]);
3
+ //# sourceMappingURL=eo-sidebar-menu-group.ff0786e7.js.map