@adyen/bento-vue2 2.0.0 → 2.0.1
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.
- package/dist/accordion.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{accordion-item.DOj7vqeL.js → accordion-item.B7lteJBu.js} +2 -2
- package/dist/chunks/{accordion-item.DOj7vqeL.js.map → accordion-item.B7lteJBu.js.map} +1 -1
- package/dist/chunks/{card.b9PEJ7hm.js → card.BmpB0VbL.js} +2 -2
- package/dist/chunks/{card.b9PEJ7hm.js.map → card.BmpB0VbL.js.map} +1 -1
- package/dist/chunks/{checkbox-group.UYN1ljai.js → checkbox-group.D1uyc3z3.js} +2 -2
- package/dist/chunks/{checkbox-group.UYN1ljai.js.map → checkbox-group.D1uyc3z3.js.map} +1 -1
- package/dist/chunks/{checkbox.Co4HoHKF.js → checkbox.D5xZ5Nnh.js} +14 -14
- package/dist/chunks/{checkbox.Co4HoHKF.js.map → checkbox.D5xZ5Nnh.js.map} +1 -1
- package/dist/chunks/{data-grid.B1lI07ze.js → data-grid.CMxQpfrY.js} +4 -4
- package/dist/chunks/{data-grid.B1lI07ze.js.map → data-grid.CMxQpfrY.js.map} +1 -1
- package/dist/chunks/{filter-bar.DXpLhnxG.js → filter-bar.D7Lk7wlq.js} +2 -2
- package/dist/chunks/{filter-bar.DXpLhnxG.js.map → filter-bar.D7Lk7wlq.js.map} +1 -1
- package/dist/chunks/{header-with-views.HwbE278X.js → header-with-views.BqobE7IF.js} +2 -2
- package/dist/chunks/{header-with-views.HwbE278X.js.map → header-with-views.BqobE7IF.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.B-AV49Bn.js → navigation-menu-group.BnHdXODQ.js} +2 -2
- package/dist/chunks/{navigation-menu-group.B-AV49Bn.js.map → navigation-menu-group.BnHdXODQ.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.DNmVJilP.js → rich-text-editor.rXoS7KGY.js} +2 -2
- package/dist/chunks/{rich-text-editor.DNmVJilP.js.map → rich-text-editor.rXoS7KGY.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CXtDQAay.js → secondary-nav.CgdV0QwZ.js} +2 -2
- package/dist/chunks/{secondary-nav.CXtDQAay.js.map → secondary-nav.CgdV0QwZ.js.map} +1 -1
- package/dist/chunks/{selection-card-group.DjFWMqVZ.js → selection-card-group.CmDuj1c7.js} +8 -8
- package/dist/chunks/{selection-card-group.DjFWMqVZ.js.map → selection-card-group.CmDuj1c7.js.map} +1 -1
- package/dist/chunks/use-expandable-content-height.DmFeas9-.js +36 -0
- package/dist/chunks/use-expandable-content-height.DmFeas9-.js.map +1 -0
- package/dist/data-grid.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +11 -11
- package/dist/navigation-menu.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +6 -6
- package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js +0 -34
- package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js.map +0 -1
|
@@ -9,7 +9,7 @@ import { u as R } from "./index.CPOlyau9.js";
|
|
|
9
9
|
import { b as $ } from "./tooltip.DFYc5NKM.js";
|
|
10
10
|
import { m as G } from "./index.CL3TXc0a.js";
|
|
11
11
|
import { B as Y } from "./link.Cls8XShm.js";
|
|
12
|
-
import { u as q } from "./use-expandable-content-height.
|
|
12
|
+
import { u as q } from "./use-expandable-content-height.DmFeas9-.js";
|
|
13
13
|
import { C as X } from "./chevron-down.B_QiVCoO.js";
|
|
14
14
|
import { C as Q } from "./chevron-up.YQRo8uKs.js";
|
|
15
15
|
import "../assets/navigation-menu-group.css";
|
|
@@ -215,4 +215,4 @@ export {
|
|
|
215
215
|
Ge as b,
|
|
216
216
|
Re as n
|
|
217
217
|
};
|
|
218
|
-
//# sourceMappingURL=navigation-menu-group.
|
|
218
|
+
//# sourceMappingURL=navigation-menu-group.BnHdXODQ.js.map
|
package/dist/chunks/{navigation-menu-group.B-AV49Bn.js.map → navigation-menu-group.BnHdXODQ.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu-group.B-AV49Bn.js","sources":["../../../ui-assets/icons-16/dist/vue/menu-collapse.vue","../../../ui-assets/icons-16/dist/vue/menu-expand.vue","../../src/components/navigation-menu/navigation-menu.keys.ts","../../src/components/navigation-menu/navigation-menu.vue","../../src/components/navigation-menu/components/navigation-menu-group/navigation-menu-group.keys.ts","../../src/components/navigation-menu/components/navigation-menu-item/navigation-menu-item.vue","../../src/components/navigation-menu/components/navigation-menu-group/navigation-menu-group.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M15.5303 13.4697L14.4697 14.5303L12 12.0605L9.53027 14.5303L8.46973 13.4697L12 9.93945L15.5303 13.4697Z\"/><path fill=\"#001222\" d=\"M7 13.75H0V12.25H7V13.75Z\"/><path fill=\"#001222\" d=\"M7 8.75H0V7.25H7V8.75Z\"/><path fill=\"#001222\" d=\"M15.5303 2.53027L12 6.06055L8.46973 2.53027L9.53027 1.46973L12 3.93945L14.4697 1.46973L15.5303 2.53027Z\"/><path fill=\"#001222\" d=\"M7 3.75H0V2.25H7V3.75Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M15.5303 11.5303L12 15.0605L8.46973 11.5303L9.53027 10.4697L12 12.9395L14.4697 10.4697L15.5303 11.5303Z\"/><path fill=\"#001222\" d=\"M7 13.75H0V12.25H7V13.75Z\"/><path fill=\"#001222\" d=\"M7 8.75H0V7.25H7V8.75Z\"/><path fill=\"#001222\" d=\"M15.5303 4.46973L14.4697 5.53027L12 3.06055L9.53027 5.53027L8.46973 4.46973L12 0.939453L15.5303 4.46973Z\"/><path fill=\"#001222\" d=\"M7 3.75H0V2.25H7V3.75Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","export const NAVIGATION_MENU_STATE_INJECTION_KEY = Symbol('navigation menu state injection key');\n","<template>\n <nav class=\"b-navigation-menu\" :aria-labelledby=\"label ? titleId : undefined\">\n <div v-if=\"showHeader\" class=\"b-navigation-menu__header\">\n <bento-typography\n v-if=\"label\"\n :id=\"titleId\"\n el=\"p\"\n variant=\"caption\"\n stronger\n class=\"b-navigation-menu__title\"\n >\n {{ label }}\n </bento-typography>\n <div class=\"b-navigation-menu__actions-container\">\n <div v-if=\"hasSlot('headerActions')\" class=\"b-navigation-menu__actions\">\n <slot name=\"headerActions\" />\n </div>\n <bento-button\n v-if=\"computedShowExpandAll\"\n v-bento-tooltip-directive=\"expandButtonLabel\"\n variant=\"tertiary-with-background\"\n :aria-label=\"expandButtonLabel\"\n @click=\"toggleAllGroups\"\n >\n <template #iconLeft>\n <menu-collapse-icon v-if=\"allExpanded\" aria-hidden=\"true\" />\n <menu-expand-icon v-else aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n\n <ul class=\"b-navigation-menu__content\">\n <slot />\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, ref, toRef, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import MenuCollapseIcon from '@adyen/ui-assets-icons-16/vue/menu-collapse';\n import MenuExpandIcon from '@adyen/ui-assets-icons-16/vue/menu-expand';\n import { useHasSlot } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoNavigationMenuProps } from './navigation-menu.types';\n import type {\n BentoNavigationMenuEmits,\n BentoNavigationMenuGroupRegistration,\n BentoNavigationMenuState,\n } from './navigation-menu.internal.types';\n import { NAVIGATION_MENU_STATE_INJECTION_KEY } from './navigation-menu.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n label: { default: undefined },\n showExpandAllButton: { type: Boolean, default: false },\n activePage: { default: undefined }\n});\n\n const emit = defineEmits([\"update:active-page\", \"expand-all\", \"collapse-all\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const titleId = generateUid('navigation-menu-title');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const groups = ref<Array<BentoNavigationMenuGroupRegistration>>([]);\n\n const registerGroup = (groupId: string, setOpen: (open: boolean) => void, getIsOpen: () => boolean) => {\n groups.value.push({ id: groupId, setOpen, getIsOpen });\n };\n\n const unregisterGroup = (groupId: string) => {\n groups.value = groups.value.filter(g => g.id !== groupId);\n };\n\n const allExpanded = computed(() => groups.value.length > 0 && groups.value.every(group => group.getIsOpen()));\n\n const computedShowExpandAll = computed(() => groups.value.length > 0 && props.showExpandAllButton);\n\n const showHeader = computed(() => props.label || hasSlot('headerActions') || computedShowExpandAll.value);\n\n const expandButtonLabel = computed(() => (allExpanded.value ? t('hideAllPages') : t('showAllPages')));\n\n const toggleAllGroups = () => {\n const shouldExpand = !allExpanded.value;\n groups.value.forEach(({ setOpen }) => setOpen(shouldExpand));\n if (shouldExpand) {\n emit('expand-all');\n } else {\n emit('collapse-all');\n }\n };\n\n const updateActivePage = (value: string) => {\n emit('update:active-page', value);\n };\n\n provide<BentoNavigationMenuState>(NAVIGATION_MENU_STATE_INJECTION_KEY, {\n registerGroup,\n unregisterGroup,\n activePage: toRef(props, 'activePage'),\n updateActivePage,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Navigation menu container component with optional header and action buttons.\n *\n * @usage\n * import { BentoNavigationMenu, BentoNavigationMenuItem, BentoNavigationMenuGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoNavigationMenu, BentoNavigationMenuItem, BentoNavigationMenuGroup },\n * template: `\n * <bento-navigation-menu label=\"Pages\" active-page=\"home\">\n * <template #headerActions>\n * <button>Search</button>\n * </template>\n * <bento-navigation-menu-item value=\"home\" label=\"Home\" :link=\"{ to: '/home' }\">\n * <template #icon><home-icon /></template>\n * </bento-navigation-menu-item>\n * <bento-navigation-menu-group label=\"Settings\">\n * <template #icon><folder-icon /></template>\n * <bento-navigation-menu-item nested value=\"general\" label=\"General\" :link=\"{ to: '/settings/general' }\" />\n * </bento-navigation-menu-group>\n * </bento-navigation-menu>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./navigation-menu.scss\" />\n","export const NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY = Symbol('navigation menu group state injection key');\n","<template>\n <li\n class=\"b-navigation-menu-item\"\n :class=\"{\n ...conditionalClasses,\n 'b-navigation-menu-item--no-icon': !hasSlot('icon'),\n }\"\n :aria-hidden=\"!isVisible ? 'true' : undefined\"\n >\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-navigation-menu-item__link\"\n :aria-current=\"isSelected && link ? 'page' : undefined\"\n :tabindex=\"!isVisible ? -1 : undefined\"\n :inert=\"!isVisible ? '' : undefined\"\n @click=\"handleClick\"\n >\n <div v-if=\"!nested && hasSlot('icon')\" class=\"b-navigation-menu-item__icon\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <bento-typography\n ref=\"labelRef\"\n v-bento-tooltip-directive=\"isTruncated ? label : undefined\"\n el=\"span\"\n variant=\"body\"\n stronger\n class=\"b-navigation-menu-item__label\"\n >\n {{ label }}\n </bento-typography>\n </component>\n <div v-if=\"hasSlot('action')\" class=\"b-navigation-menu-item__action\">\n <slot name=\"action\" />\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onBeforeUnmount, onMounted, ref, useSlots } from 'vue';\n import { useResizeObserver } from '@vueuse/core';\n import { BentoLink } from '@/components/link';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useHasSlot } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip';\n import type { BentoNavigationMenuItemProps } from './navigation-menu-item.types';\n import type { BentoNavigationMenuGroupState } from '../navigation-menu-group/navigation-menu-group.internal.types';\n import { NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY } from '../navigation-menu-group/navigation-menu-group.keys';\n import type { BentoNavigationMenuState } from '../../navigation-menu.internal.types';\n import { NAVIGATION_MENU_STATE_INJECTION_KEY } from '../../navigation-menu.keys';\n\n const props = defineProps({\n nested: { type: Boolean, default: false },\n label: null,\n link: null,\n value: null,\n alwaysShowActions: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const componentType = computed(() => (props.link ? BentoLink : 'div'));\n const componentProps = computed(() => (props.link ? { ...props.link, disableTypography: true } : {}));\n\n const labelRef = ref(null);\n const isTruncated = ref(false);\n\n useResizeObserver(labelRef, () => {\n const el = labelRef.value?.$el ?? labelRef.value;\n if (el) {\n isTruncated.value = el.scrollWidth > el.clientWidth;\n }\n });\n\n const itemId = generateUid('navigation-menu-item');\n const groupState = inject<BentoNavigationMenuGroupState | null>(NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY, null);\n const menuState = inject<BentoNavigationMenuState | null>(NAVIGATION_MENU_STATE_INJECTION_KEY, null);\n\n const isSelected = computed(() => menuState?.activePage?.value === props.value);\n\n const isVisible = computed(() => {\n if (!groupState) {\n return true;\n }\n if (!groupState.isSemiCollapsed.value) {\n return true;\n }\n return isSelected.value;\n });\n\n const conditionalClasses = computed(() => ({\n 'b-navigation-menu-item--selected': isSelected.value,\n 'b-navigation-menu-item--nested': props.nested,\n 'b-navigation-menu-item--hidden': !isVisible.value,\n 'b-navigation-menu-item--always-show-actions': props.alwaysShowActions,\n }));\n\n onMounted(() => {\n if (groupState && props.nested) {\n groupState.registerItem(itemId, () => isSelected.value);\n }\n });\n\n const handleClick = () => {\n menuState?.updateActivePage(props.value);\n };\n\n onBeforeUnmount(() => {\n if (groupState && props.nested) {\n groupState.unregisterItem(itemId);\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Navigation menu item component for rendering individual navigation links.\n * Can be used standalone or nested within a navigation-menu-group.\n *\n * @usage\n * import { BentoNavigationMenuItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoNavigationMenuItem },\n * template: `\n * <bento-navigation-menu-item value=\"home\" label=\"Home\" :link=\"{ to: '/home' }\">\n * <template #icon><home-icon /></template>\n * <template #action><star-icon svg-title=\"Add to favorites\" /></template>\n * </bento-navigation-menu-item>\n * `\n * }\n */\n export default {\n name: 'bento-navigation-menu-item',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./navigation-menu-item.scss\" />\n","<template>\n <li class=\"b-navigation-menu-group\">\n <button\n :id=\"buttonId\"\n type=\"button\"\n class=\"b-navigation-menu-group__header\"\n :class=\"{\n ...headerClasses,\n 'b-navigation-menu-group__header--no-icon': !hasSlot('icon'),\n }\"\n :aria-expanded=\"`${isOpen && !isSemiCollapsed}`\"\n :aria-controls=\"contentId\"\n :aria-description=\"headerAriaDescription\"\n @click=\"toggleGroup\"\n >\n <div v-if=\"hasSlot('icon')\" class=\"b-navigation-menu-group__icon\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <bento-typography\n ref=\"labelRef\"\n v-bento-tooltip-directive=\"isTruncated ? label : undefined\"\n el=\"span\"\n variant=\"body\"\n stronger\n class=\"b-navigation-menu-group__label\"\n >\n {{ label }}\n </bento-typography>\n <div class=\"b-navigation-menu-group__icon b-navigation-menu-group__icon--chevron\" aria-hidden=\"true\">\n <chevron-up-icon v-if=\"isOpen && !isSemiCollapsed\" />\n <chevron-down-icon v-else />\n </div>\n </button>\n\n <Transition name=\"b-navigation-menu-group__animation--content\">\n <div\n v-show=\"isOpen\"\n :id=\"contentId\"\n class=\"b-navigation-menu-group__content-wrapper\"\n role=\"region\"\n :aria-labelledby=\"buttonId\"\n :style=\"contentMaxHeight\"\n >\n <ul ref=\"contentDiv\" class=\"b-navigation-menu-group__content\">\n <slot />\n </ul>\n </div>\n </Transition>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onMounted, onUnmounted, provide, ref, useSlots, watch } from 'vue';\n import { useResizeObserver } from '@vueuse/core';\n import { BentoTypography } from '@/components/typography';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n import { useHasSlot } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import type { BentoNavigationMenuGroupProps } from './navigation-menu-group.types';\n import type {\n BentoNavigationMenuGroupState,\n BentoNavigationMenuItemRegistration,\n } from './navigation-menu-group.internal.types';\n import { NAVIGATION_MENU_STATE_INJECTION_KEY } from '../../navigation-menu.keys';\n import { NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY } from './navigation-menu-group.keys';\n import { type BentoNavigationMenuState } from '../../navigation-menu.internal.types';\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n isExpanded: { type: Boolean, default: false },\n label: null\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const headerClasses = computed(() => ({\n 'b-navigation-menu-group__header--expanded': isOpen.value && !isSemiCollapsed.value,\n }));\n\n const headerAriaDescription = computed(() => (isSemiCollapsed.value ? t('showingCurrentPage') : undefined));\n\n const labelRef = ref(null);\n const isTruncated = ref(false);\n\n useResizeObserver(labelRef, () => {\n const el = labelRef.value?.$el ?? labelRef.value;\n if (el) {\n isTruncated.value = el.scrollWidth > el.clientWidth;\n }\n });\n\n const groupId = generateUid('navigation-menu-group');\n const buttonId = generateUid('navigation-menu-group-button');\n const contentId = generateUid('navigation-menu-group-content');\n const navigationMenuState = inject<BentoNavigationMenuState | null>(NAVIGATION_MENU_STATE_INJECTION_KEY, null);\n\n const nestedItems = ref<Array<BentoNavigationMenuItemRegistration>>([]);\n\n const registerItem = (itemId: string, isSelected: () => boolean) => {\n nestedItems.value.push({ id: itemId, isSelected });\n };\n\n const unregisterItem = (itemId: string) => {\n nestedItems.value = nestedItems.value.filter(item => item.id !== itemId);\n };\n\n const isSemiCollapsed = ref(false);\n\n provide<BentoNavigationMenuGroupState>(NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY, {\n registerItem,\n unregisterItem,\n isSemiCollapsed,\n });\n\n const hasActiveItem = computed(() => nestedItems.value.some(item => item.isSelected()));\n\n const emit = defineEmits([\"update:is-expanded\"]);\n\n const isOpen = ref(props.isExpanded);\n const contentDiv = ref<HTMLUListElement>(null);\n\n const { contentHeight } = useExpandableContentHeight(contentDiv, isOpen);\n const contentMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n const toggleGroup = () => {\n if (isOpen.value && !isSemiCollapsed.value) {\n if (hasActiveItem.value) {\n isSemiCollapsed.value = true;\n } else {\n isOpen.value = false;\n }\n } else if (isSemiCollapsed.value) {\n isSemiCollapsed.value = false;\n } else {\n isOpen.value = true;\n }\n emit('update:is-expanded', isOpen.value && !isSemiCollapsed.value);\n };\n\n const setOpen = (open: boolean) => {\n if (open) {\n isOpen.value = true;\n isSemiCollapsed.value = false;\n } else if (hasActiveItem.value) {\n isSemiCollapsed.value = true;\n } else {\n isSemiCollapsed.value = false;\n isOpen.value = false;\n }\n emit('update:is-expanded', open);\n };\n\n watch(\n () => props.isExpanded,\n value => {\n if (!isSemiCollapsed.value) {\n isOpen.value = value;\n }\n }\n );\n\n onMounted(() => {\n if (hasActiveItem.value && !isOpen.value) {\n isOpen.value = true;\n emit('update:is-expanded', true);\n }\n if (navigationMenuState) {\n navigationMenuState.registerGroup(groupId, setOpen, () => isOpen.value && !isSemiCollapsed.value);\n }\n });\n\n onUnmounted(() => navigationMenuState?.unregisterGroup(groupId));\n</script>\n\n<script lang=\"ts\">\n /**\n * Navigation menu group component for creating collapsible sections.\n *\n * @usage\n * import { BentoNavigationMenuGroup, BentoNavigationMenuItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoNavigationMenuGroup, BentoNavigationMenuItem },\n * template: `\n * <bento-navigation-menu-group label=\"Section\" :is-expanded=\"true\">\n * <template #icon><folder-icon /></template>\n * <bento-navigation-menu-item nested value=\"item-1\" label=\"Item 1\" :link=\"{ to: '/section/item-1' }\" />\n * <bento-navigation-menu-item nested value=\"item-2\" label=\"Item 2\" :link=\"{ to: '/section/item-2' }\" />\n * </bento-navigation-menu-group>\n * `\n * }\n */\n export default {\n name: 'bento-navigation-menu-group',\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./navigation-menu-group.scss\" />\n"],"names":["instance","getCurrentInstance","uuid","NAVIGATION_MENU_STATE_INJECTION_KEY","__default__$2","messages","slots","useSlots","hasSlot","useHasSlot","titleId","generateUid","t","useI18n","groups","ref","registerGroup","groupId","setOpen","getIsOpen","unregisterGroup","g","allExpanded","computed","group","computedShowExpandAll","props","showHeader","expandButtonLabel","toggleAllGroups","shouldExpand","emit","updateActivePage","value","provide","toRef","NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY","__default__$1","componentType","BentoLink","componentProps","labelRef","isTruncated","useResizeObserver","el","itemId","groupState","inject","menuState","isSelected","isVisible","conditionalClasses","onMounted","handleClick","onBeforeUnmount","__default__","headerClasses","isOpen","isSemiCollapsed","headerAriaDescription","buttonId","contentId","navigationMenuState","nestedItems","registerItem","unregisterItem","item","hasActiveItem","contentDiv","contentHeight","useExpandableContentHeight","contentMaxHeight","toggleGroup","open","watch","onUnmounted"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,UAAAA,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;ACJA,UAAAA,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;uBCTOG,IAAA,uBAAA,qCAAA;;;;;;;;;;;;GC2IHC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;iBA1EAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,uBAAA,GAEA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAA,CAAAC,GAAAC,GAAAC,MAAA;AACI,MAAAL,EAAA,MAAA,KAAA,EAAA,IAAAG,GAA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AAC,EAAA,KAAA;AAAA,IAAiE,GAGrExC,IAAA,CAAAuD,MAAA;AACI,MAAAA,KACIhB,EAAA,QAAA,IACAC,EAAA,QAAA,MAAwBS,EAAA,QAExBT,EAAA,QAAA,MAEAA,EAAA,QAAA,IACAD,EAAA,QAAA,KAEJ1B,EAAA,sBAAA0C,CAAA;AAAA,IAA+B;AAGnC,WAAAC;AAAA,MAAA,MAAAhD,EAAA;AAAA,MACgB,CAAAO,MAAA;AAER,QAAAyB,EAAA,UACID,EAAA,QAAAxB;AAAA,MACJ;AAAA,IACJ,GAGJmB,EAAA,MAAA;AACI,MAAAe,EAAA,SAAA,CAAAV,EAAA,UACIA,EAAA,QAAA,IACA1B,EAAA,sBAAA,EAAA,IAEJ+B,KACIA,EAAA,cAAA7C,GAAAC,GAAA,MAAAuC,EAAA,SAAA,CAAAC,EAAA,KAAA;AAAA,IACJ,CAAA,GAGJiB,EAAA,MAAAb,GAAA,gBAAA7C,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"navigation-menu-group.BnHdXODQ.js","sources":["../../../ui-assets/icons-16/dist/vue/menu-collapse.vue","../../../ui-assets/icons-16/dist/vue/menu-expand.vue","../../src/components/navigation-menu/navigation-menu.keys.ts","../../src/components/navigation-menu/navigation-menu.vue","../../src/components/navigation-menu/components/navigation-menu-group/navigation-menu-group.keys.ts","../../src/components/navigation-menu/components/navigation-menu-item/navigation-menu-item.vue","../../src/components/navigation-menu/components/navigation-menu-group/navigation-menu-group.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M15.5303 13.4697L14.4697 14.5303L12 12.0605L9.53027 14.5303L8.46973 13.4697L12 9.93945L15.5303 13.4697Z\"/><path fill=\"#001222\" d=\"M7 13.75H0V12.25H7V13.75Z\"/><path fill=\"#001222\" d=\"M7 8.75H0V7.25H7V8.75Z\"/><path fill=\"#001222\" d=\"M15.5303 2.53027L12 6.06055L8.46973 2.53027L9.53027 1.46973L12 3.93945L14.4697 1.46973L15.5303 2.53027Z\"/><path fill=\"#001222\" d=\"M7 3.75H0V2.25H7V3.75Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M15.5303 11.5303L12 15.0605L8.46973 11.5303L9.53027 10.4697L12 12.9395L14.4697 10.4697L15.5303 11.5303Z\"/><path fill=\"#001222\" d=\"M7 13.75H0V12.25H7V13.75Z\"/><path fill=\"#001222\" d=\"M7 8.75H0V7.25H7V8.75Z\"/><path fill=\"#001222\" d=\"M15.5303 4.46973L14.4697 5.53027L12 3.06055L9.53027 5.53027L8.46973 4.46973L12 0.939453L15.5303 4.46973Z\"/><path fill=\"#001222\" d=\"M7 3.75H0V2.25H7V3.75Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","export const NAVIGATION_MENU_STATE_INJECTION_KEY = Symbol('navigation menu state injection key');\n","<template>\n <nav class=\"b-navigation-menu\" :aria-labelledby=\"label ? titleId : undefined\">\n <div v-if=\"showHeader\" class=\"b-navigation-menu__header\">\n <bento-typography\n v-if=\"label\"\n :id=\"titleId\"\n el=\"p\"\n variant=\"caption\"\n stronger\n class=\"b-navigation-menu__title\"\n >\n {{ label }}\n </bento-typography>\n <div class=\"b-navigation-menu__actions-container\">\n <div v-if=\"hasSlot('headerActions')\" class=\"b-navigation-menu__actions\">\n <slot name=\"headerActions\" />\n </div>\n <bento-button\n v-if=\"computedShowExpandAll\"\n v-bento-tooltip-directive=\"expandButtonLabel\"\n variant=\"tertiary-with-background\"\n :aria-label=\"expandButtonLabel\"\n @click=\"toggleAllGroups\"\n >\n <template #iconLeft>\n <menu-collapse-icon v-if=\"allExpanded\" aria-hidden=\"true\" />\n <menu-expand-icon v-else aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n\n <ul class=\"b-navigation-menu__content\">\n <slot />\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, ref, toRef, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import MenuCollapseIcon from '@adyen/ui-assets-icons-16/vue/menu-collapse';\n import MenuExpandIcon from '@adyen/ui-assets-icons-16/vue/menu-expand';\n import { useHasSlot } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoNavigationMenuProps } from './navigation-menu.types';\n import type {\n BentoNavigationMenuEmits,\n BentoNavigationMenuGroupRegistration,\n BentoNavigationMenuState,\n } from './navigation-menu.internal.types';\n import { NAVIGATION_MENU_STATE_INJECTION_KEY } from './navigation-menu.keys';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n label: { default: undefined },\n showExpandAllButton: { type: Boolean, default: false },\n activePage: { default: undefined }\n});\n\n const emit = defineEmits([\"update:active-page\", \"expand-all\", \"collapse-all\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const titleId = generateUid('navigation-menu-title');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const groups = ref<Array<BentoNavigationMenuGroupRegistration>>([]);\n\n const registerGroup = (groupId: string, setOpen: (open: boolean) => void, getIsOpen: () => boolean) => {\n groups.value.push({ id: groupId, setOpen, getIsOpen });\n };\n\n const unregisterGroup = (groupId: string) => {\n groups.value = groups.value.filter(g => g.id !== groupId);\n };\n\n const allExpanded = computed(() => groups.value.length > 0 && groups.value.every(group => group.getIsOpen()));\n\n const computedShowExpandAll = computed(() => groups.value.length > 0 && props.showExpandAllButton);\n\n const showHeader = computed(() => props.label || hasSlot('headerActions') || computedShowExpandAll.value);\n\n const expandButtonLabel = computed(() => (allExpanded.value ? t('hideAllPages') : t('showAllPages')));\n\n const toggleAllGroups = () => {\n const shouldExpand = !allExpanded.value;\n groups.value.forEach(({ setOpen }) => setOpen(shouldExpand));\n if (shouldExpand) {\n emit('expand-all');\n } else {\n emit('collapse-all');\n }\n };\n\n const updateActivePage = (value: string) => {\n emit('update:active-page', value);\n };\n\n provide<BentoNavigationMenuState>(NAVIGATION_MENU_STATE_INJECTION_KEY, {\n registerGroup,\n unregisterGroup,\n activePage: toRef(props, 'activePage'),\n updateActivePage,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Navigation menu container component with optional header and action buttons.\n *\n * @usage\n * import { BentoNavigationMenu, BentoNavigationMenuItem, BentoNavigationMenuGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoNavigationMenu, BentoNavigationMenuItem, BentoNavigationMenuGroup },\n * template: `\n * <bento-navigation-menu label=\"Pages\" active-page=\"home\">\n * <template #headerActions>\n * <button>Search</button>\n * </template>\n * <bento-navigation-menu-item value=\"home\" label=\"Home\" :link=\"{ to: '/home' }\">\n * <template #icon><home-icon /></template>\n * </bento-navigation-menu-item>\n * <bento-navigation-menu-group label=\"Settings\">\n * <template #icon><folder-icon /></template>\n * <bento-navigation-menu-item nested value=\"general\" label=\"General\" :link=\"{ to: '/settings/general' }\" />\n * </bento-navigation-menu-group>\n * </bento-navigation-menu>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./navigation-menu.scss\" />\n","export const NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY = Symbol('navigation menu group state injection key');\n","<template>\n <li\n class=\"b-navigation-menu-item\"\n :class=\"{\n ...conditionalClasses,\n 'b-navigation-menu-item--no-icon': !hasSlot('icon'),\n }\"\n :aria-hidden=\"!isVisible ? 'true' : undefined\"\n >\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-navigation-menu-item__link\"\n :aria-current=\"isSelected && link ? 'page' : undefined\"\n :tabindex=\"!isVisible ? -1 : undefined\"\n :inert=\"!isVisible ? '' : undefined\"\n @click=\"handleClick\"\n >\n <div v-if=\"!nested && hasSlot('icon')\" class=\"b-navigation-menu-item__icon\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <bento-typography\n ref=\"labelRef\"\n v-bento-tooltip-directive=\"isTruncated ? label : undefined\"\n el=\"span\"\n variant=\"body\"\n stronger\n class=\"b-navigation-menu-item__label\"\n >\n {{ label }}\n </bento-typography>\n </component>\n <div v-if=\"hasSlot('action')\" class=\"b-navigation-menu-item__action\">\n <slot name=\"action\" />\n </div>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onBeforeUnmount, onMounted, ref, useSlots } from 'vue';\n import { useResizeObserver } from '@vueuse/core';\n import { BentoLink } from '@/components/link';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useHasSlot } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip';\n import type { BentoNavigationMenuItemProps } from './navigation-menu-item.types';\n import type { BentoNavigationMenuGroupState } from '../navigation-menu-group/navigation-menu-group.internal.types';\n import { NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY } from '../navigation-menu-group/navigation-menu-group.keys';\n import type { BentoNavigationMenuState } from '../../navigation-menu.internal.types';\n import { NAVIGATION_MENU_STATE_INJECTION_KEY } from '../../navigation-menu.keys';\n\n const props = defineProps({\n nested: { type: Boolean, default: false },\n label: null,\n link: null,\n value: null,\n alwaysShowActions: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const componentType = computed(() => (props.link ? BentoLink : 'div'));\n const componentProps = computed(() => (props.link ? { ...props.link, disableTypography: true } : {}));\n\n const labelRef = ref(null);\n const isTruncated = ref(false);\n\n useResizeObserver(labelRef, () => {\n const el = labelRef.value?.$el ?? labelRef.value;\n if (el) {\n isTruncated.value = el.scrollWidth > el.clientWidth;\n }\n });\n\n const itemId = generateUid('navigation-menu-item');\n const groupState = inject<BentoNavigationMenuGroupState | null>(NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY, null);\n const menuState = inject<BentoNavigationMenuState | null>(NAVIGATION_MENU_STATE_INJECTION_KEY, null);\n\n const isSelected = computed(() => menuState?.activePage?.value === props.value);\n\n const isVisible = computed(() => {\n if (!groupState) {\n return true;\n }\n if (!groupState.isSemiCollapsed.value) {\n return true;\n }\n return isSelected.value;\n });\n\n const conditionalClasses = computed(() => ({\n 'b-navigation-menu-item--selected': isSelected.value,\n 'b-navigation-menu-item--nested': props.nested,\n 'b-navigation-menu-item--hidden': !isVisible.value,\n 'b-navigation-menu-item--always-show-actions': props.alwaysShowActions,\n }));\n\n onMounted(() => {\n if (groupState && props.nested) {\n groupState.registerItem(itemId, () => isSelected.value);\n }\n });\n\n const handleClick = () => {\n menuState?.updateActivePage(props.value);\n };\n\n onBeforeUnmount(() => {\n if (groupState && props.nested) {\n groupState.unregisterItem(itemId);\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Navigation menu item component for rendering individual navigation links.\n * Can be used standalone or nested within a navigation-menu-group.\n *\n * @usage\n * import { BentoNavigationMenuItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoNavigationMenuItem },\n * template: `\n * <bento-navigation-menu-item value=\"home\" label=\"Home\" :link=\"{ to: '/home' }\">\n * <template #icon><home-icon /></template>\n * <template #action><star-icon svg-title=\"Add to favorites\" /></template>\n * </bento-navigation-menu-item>\n * `\n * }\n */\n export default {\n name: 'bento-navigation-menu-item',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./navigation-menu-item.scss\" />\n","<template>\n <li class=\"b-navigation-menu-group\">\n <button\n :id=\"buttonId\"\n type=\"button\"\n class=\"b-navigation-menu-group__header\"\n :class=\"{\n ...headerClasses,\n 'b-navigation-menu-group__header--no-icon': !hasSlot('icon'),\n }\"\n :aria-expanded=\"`${isOpen && !isSemiCollapsed}`\"\n :aria-controls=\"contentId\"\n :aria-description=\"headerAriaDescription\"\n @click=\"toggleGroup\"\n >\n <div v-if=\"hasSlot('icon')\" class=\"b-navigation-menu-group__icon\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <bento-typography\n ref=\"labelRef\"\n v-bento-tooltip-directive=\"isTruncated ? label : undefined\"\n el=\"span\"\n variant=\"body\"\n stronger\n class=\"b-navigation-menu-group__label\"\n >\n {{ label }}\n </bento-typography>\n <div class=\"b-navigation-menu-group__icon b-navigation-menu-group__icon--chevron\" aria-hidden=\"true\">\n <chevron-up-icon v-if=\"isOpen && !isSemiCollapsed\" />\n <chevron-down-icon v-else />\n </div>\n </button>\n\n <Transition name=\"b-navigation-menu-group__animation--content\">\n <div\n v-show=\"isOpen\"\n :id=\"contentId\"\n class=\"b-navigation-menu-group__content-wrapper\"\n role=\"region\"\n :aria-labelledby=\"buttonId\"\n :style=\"contentMaxHeight\"\n >\n <ul ref=\"contentDiv\" class=\"b-navigation-menu-group__content\">\n <slot />\n </ul>\n </div>\n </Transition>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onMounted, onUnmounted, provide, ref, useSlots, watch } from 'vue';\n import { useResizeObserver } from '@vueuse/core';\n import { BentoTypography } from '@/components/typography';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n import { useHasSlot } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import type { BentoNavigationMenuGroupProps } from './navigation-menu-group.types';\n import type {\n BentoNavigationMenuGroupState,\n BentoNavigationMenuItemRegistration,\n } from './navigation-menu-group.internal.types';\n import { NAVIGATION_MENU_STATE_INJECTION_KEY } from '../../navigation-menu.keys';\n import { NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY } from './navigation-menu-group.keys';\n import { type BentoNavigationMenuState } from '../../navigation-menu.internal.types';\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n isExpanded: { type: Boolean, default: false },\n label: null\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const headerClasses = computed(() => ({\n 'b-navigation-menu-group__header--expanded': isOpen.value && !isSemiCollapsed.value,\n }));\n\n const headerAriaDescription = computed(() => (isSemiCollapsed.value ? t('showingCurrentPage') : undefined));\n\n const labelRef = ref(null);\n const isTruncated = ref(false);\n\n useResizeObserver(labelRef, () => {\n const el = labelRef.value?.$el ?? labelRef.value;\n if (el) {\n isTruncated.value = el.scrollWidth > el.clientWidth;\n }\n });\n\n const groupId = generateUid('navigation-menu-group');\n const buttonId = generateUid('navigation-menu-group-button');\n const contentId = generateUid('navigation-menu-group-content');\n const navigationMenuState = inject<BentoNavigationMenuState | null>(NAVIGATION_MENU_STATE_INJECTION_KEY, null);\n\n const nestedItems = ref<Array<BentoNavigationMenuItemRegistration>>([]);\n\n const registerItem = (itemId: string, isSelected: () => boolean) => {\n nestedItems.value.push({ id: itemId, isSelected });\n };\n\n const unregisterItem = (itemId: string) => {\n nestedItems.value = nestedItems.value.filter(item => item.id !== itemId);\n };\n\n const isSemiCollapsed = ref(false);\n\n provide<BentoNavigationMenuGroupState>(NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY, {\n registerItem,\n unregisterItem,\n isSemiCollapsed,\n });\n\n const hasActiveItem = computed(() => nestedItems.value.some(item => item.isSelected()));\n\n const emit = defineEmits([\"update:is-expanded\"]);\n\n const isOpen = ref(props.isExpanded);\n const contentDiv = ref<HTMLUListElement>(null);\n\n const { contentHeight } = useExpandableContentHeight(contentDiv, isOpen);\n const contentMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n const toggleGroup = () => {\n if (isOpen.value && !isSemiCollapsed.value) {\n if (hasActiveItem.value) {\n isSemiCollapsed.value = true;\n } else {\n isOpen.value = false;\n }\n } else if (isSemiCollapsed.value) {\n isSemiCollapsed.value = false;\n } else {\n isOpen.value = true;\n }\n emit('update:is-expanded', isOpen.value && !isSemiCollapsed.value);\n };\n\n const setOpen = (open: boolean) => {\n if (open) {\n isOpen.value = true;\n isSemiCollapsed.value = false;\n } else if (hasActiveItem.value) {\n isSemiCollapsed.value = true;\n } else {\n isSemiCollapsed.value = false;\n isOpen.value = false;\n }\n emit('update:is-expanded', open);\n };\n\n watch(\n () => props.isExpanded,\n value => {\n if (!isSemiCollapsed.value) {\n isOpen.value = value;\n }\n }\n );\n\n onMounted(() => {\n if (hasActiveItem.value && !isOpen.value) {\n isOpen.value = true;\n emit('update:is-expanded', true);\n }\n if (navigationMenuState) {\n navigationMenuState.registerGroup(groupId, setOpen, () => isOpen.value && !isSemiCollapsed.value);\n }\n });\n\n onUnmounted(() => navigationMenuState?.unregisterGroup(groupId));\n</script>\n\n<script lang=\"ts\">\n /**\n * Navigation menu group component for creating collapsible sections.\n *\n * @usage\n * import { BentoNavigationMenuGroup, BentoNavigationMenuItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoNavigationMenuGroup, BentoNavigationMenuItem },\n * template: `\n * <bento-navigation-menu-group label=\"Section\" :is-expanded=\"true\">\n * <template #icon><folder-icon /></template>\n * <bento-navigation-menu-item nested value=\"item-1\" label=\"Item 1\" :link=\"{ to: '/section/item-1' }\" />\n * <bento-navigation-menu-item nested value=\"item-2\" label=\"Item 2\" :link=\"{ to: '/section/item-2' }\" />\n * </bento-navigation-menu-group>\n * `\n * }\n */\n export default {\n name: 'bento-navigation-menu-group',\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./navigation-menu-group.scss\" />\n"],"names":["instance","getCurrentInstance","uuid","NAVIGATION_MENU_STATE_INJECTION_KEY","__default__$2","messages","slots","useSlots","hasSlot","useHasSlot","titleId","generateUid","t","useI18n","groups","ref","registerGroup","groupId","setOpen","getIsOpen","unregisterGroup","g","allExpanded","computed","group","computedShowExpandAll","props","showHeader","expandButtonLabel","toggleAllGroups","shouldExpand","emit","updateActivePage","value","provide","toRef","NAVIGATION_MENU_GROUP_STATE_INJECTION_KEY","__default__$1","componentType","BentoLink","componentProps","labelRef","isTruncated","useResizeObserver","el","itemId","groupState","inject","menuState","isSelected","isVisible","conditionalClasses","onMounted","handleClick","onBeforeUnmount","__default__","headerClasses","isOpen","isSemiCollapsed","headerAriaDescription","buttonId","contentId","navigationMenuState","nestedItems","registerItem","unregisterItem","item","hasActiveItem","contentDiv","contentHeight","useExpandableContentHeight","contentMaxHeight","toggleGroup","open","watch","onUnmounted"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,UAAAA,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;ACJA,UAAAA,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;uBCTOG,IAAA,uBAAA,qCAAA;;;;;;;;;;;;GC2IHC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;iBA1EAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,uBAAA,GAEA,EAAA,GAAAC,EAAA,IAAAC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QACIT,EAAA,QAAA,KAEAD,EAAA,QAAA,KACJC,EAAA,QAEAA,EAAA,QAAA,KAEAD,EAAA,QAAA,IAEJ1B,EAAA,sBAAA0B,EAAA,SAAA,CAAAC,EAAA,KAAA;AAAA,IAAiE,GAGrExC,IAAA,CAAAuD,MAAA;AACI,MAAAA,KACIhB,EAAA,QAAA,IACAC,EAAA,QAAA,MAAwBS,EAAA,QAExBT,EAAA,QAAA,MAEAA,EAAA,QAAA,IACAD,EAAA,QAAA,KAEJ1B,EAAA,sBAAA0C,CAAA;AAAA,IAA+B;AAGnC,WAAAC;AAAA,MAAA,MAAAhD,EAAA;AAAA,MACgB,CAAAO,MAAA;AAER,QAAAyB,EAAA,UACID,EAAA,QAAAxB;AAAA,MACJ;AAAA,IACJ,GAGJmB,EAAA,MAAA;AACI,MAAAe,EAAA,SAAA,CAAAV,EAAA,UACIA,EAAA,QAAA,IACA1B,EAAA,sBAAA,EAAA,IAEJ+B,KACIA,EAAA,cAAA7C,GAAAC,GAAA,MAAAuC,EAAA,SAAA,CAAAC,EAAA,KAAA;AAAA,IACJ,CAAA,GAGJiB,EAAA,MAAAb,GAAA,gBAAA7C,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import { B as Zn } from "./alert.DJDHwVeR.js";
|
|
|
5
5
|
import { n as yt } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import "./index.Cl4_42j5.js";
|
|
7
7
|
import { B as Gn } from "./link.Cls8XShm.js";
|
|
8
|
-
import { B as Yn } from "./checkbox.
|
|
8
|
+
import { B as Yn } from "./checkbox.D5xZ5Nnh.js";
|
|
9
9
|
import { u as Jn } from "./index.CPOlyau9.js";
|
|
10
10
|
import { u as Xn } from "./aria-label.CaUURpnB.js";
|
|
11
11
|
import { g as _e } from "./generate-uid.DBWe4g6T.js";
|
|
@@ -6199,4 +6199,4 @@ const Ao = fo.exports;
|
|
|
6199
6199
|
export {
|
|
6200
6200
|
Ao as r
|
|
6201
6201
|
};
|
|
6202
|
-
//# sourceMappingURL=rich-text-editor.
|
|
6202
|
+
//# sourceMappingURL=rich-text-editor.rXoS7KGY.js.map
|