@oruga-ui/oruga-next
Version:
UI components for Vue.js and CSS framework agnostic
1 lines • 24 kB
Source Map (JSON)
{"version":3,"file":"menu.cjs","sources":["../../src/components/menu/MenuItem.vue","../../src/components/menu/Menu.vue","../../src/components/menu/index.ts"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { computed, ref, useId } from \"vue\";\n\nimport OIcon from \"../icon/Icon.vue\";\nimport PlainButton from \"../utils/PlainButton\";\n\nimport { getDefault } from \"@/utils/config\";\nimport {\n defineClasses,\n normalizeOptions,\n useProviderChild,\n useProviderParent,\n type ProviderItem,\n} from \"@/composables\";\n\nimport type {\n MenuComponent,\n MenuItemComponent,\n MenuItemProvider,\n} from \"./types\";\nimport type { MenuItemProps } from \"./props\";\n\n/**\n * A menu list item.\n * @displayName Menu Item\n */\ndefineOptions({\n isOruga: true,\n name: \"OMenuItem\",\n configField: \"menu\",\n inheritAttrs: false,\n});\n\nconst props = withDefaults(defineProps<MenuItemProps<T>>(), {\n override: undefined,\n active: false,\n options: undefined,\n label: undefined,\n expanded: false,\n disabled: false,\n hidden: false,\n submenuId: () => useId(),\n icon: undefined,\n iconPack: () => getDefault(\"menu.iconPack\"),\n iconSize: () => getDefault(\"menu.iconSize\"),\n animation: () => getDefault(\"menu.animation\", \"slide\"),\n tag: () => getDefault(\"menu.itemTag\", PlainButton),\n});\n\nconst emits = defineEmits<{\n /**\n * active prop two-way binding\n * @param value {boolean} updated active prop\n */\n \"update:active\": [value: boolean];\n /**\n * onclick event\n * @param value {string | number | object} value prop data\n * @param event {event} Native Event\n */\n click: [value: T, event: Event];\n}>();\n\nconst itemValue = props.value ?? useId();\n\n// provided data is a computed ref to ensure reactivity\nconst provideData = computed<MenuItemProvider<T>>(() => ({\n expanded: isExpanded.value,\n setExpand,\n triggerReset,\n}));\n\n/** provide functionalities and data to child item components */\nconst { childItems } = useProviderParent({\n key: \"menu-item\",\n data: provideData,\n});\n\n/** inject functionalities and data from the parent menu-item component */\nconst menuItem = useProviderChild<MenuItemProvider<T>>({\n key: \"menu-item\",\n needParent: false,\n});\n\n// provided data is a computed ref to ensure reactivity\nconst providedData = computed<MenuItemComponent<T>>(() => ({\n ...props,\n value: itemValue,\n parent: menuItem.parent.value,\n hasChildren: hasChildren.value,\n expanded: isExpanded.value,\n setExpand,\n reset,\n selectItem,\n}));\n\n/** inject functionalities and data from the parent menu component */\nconst { parent, item } = useProviderChild<\n MenuComponent<T>,\n MenuItemComponent<T>\n>({ data: providedData });\n\nconst nextSequence = parent.value.nextSequence;\n\n/** normalized programamtic options */\nconst normalizedOptions = computed(() =>\n normalizeOptions<T>(props.options, nextSequence),\n);\n\nconst isActive = defineModel<boolean>(\"active\", { default: false });\n\nconst hasChildren = computed(() => !!childItems.value.length);\n\nconst isFocused = computed(\n () => item.value.identifier === parent.value.focsuedIdentifier,\n);\n\nfunction selectItem(event: Event): void {\n if (props.disabled || parent.value.disabled) return;\n triggerReset();\n isActive.value = !isActive.value;\n if (parent.value.accordion) isExpanded.value = isActive.value;\n parent.value.selectItem(isActive.value ? item.value : undefined);\n emits(\"click\", itemValue as T, event);\n}\n\nfunction triggerReset(childs?: ProviderItem<MenuItemComponent<T>>[]): void {\n // The point of this method is to collect references to the clicked item and any parent,\n // this way we can skip resetting those elements.\n if (typeof menuItem.parent.value?.triggerReset === \"function\") {\n menuItem.parent.value.triggerReset(\n childs ? [item.value, ...childs] : [item.value],\n );\n }\n // else if not a sub item reset parent menu\n else if (typeof parent.value.resetMenu === \"function\") {\n parent.value.resetMenu(childs ? [item.value, ...childs] : [item.value]);\n }\n}\n\nconst isExpanded = ref(props.expanded);\n// always expand if not accordion feature\nif (!parent.value.accordion) isExpanded.value = true;\n\nfunction setExpand(state: boolean): void {\n if (!parent.value.accordion) return;\n isExpanded.value = state;\n\n if (typeof menuItem.parent.value?.setExpand === \"function\")\n menuItem.parent.value.setExpand(state);\n}\n\nfunction reset(): void {\n if (parent.value.accordion) isExpanded.value = false;\n isActive.value = false;\n}\n\n// #region --- Computed Component Classes ---\n\nconst itemClasses = defineClasses(\n [\"itemClass\", \"o-menu__item\"],\n [\"itemActiveClass\", \"o-menu__item--active\", null, isActive],\n [\"itemFocusedClass\", \"o-menu__item--focused\", null, isFocused],\n [\n \"itemDisabledClass\",\n \"o-menu__item--disabled\",\n null,\n computed(() => props.disabled || parent.value.disabled),\n ],\n);\n\nconst buttonClasses = defineClasses(\n [\"itemButtonClass\", \"o-menu__item__button\"],\n [\"itemButtonActiveClass\", \"o-menu__item__button--active\", null, isActive],\n [\n \"itemButtonFocusedClass\",\n \"o-menu__item__button--focused\",\n null,\n isFocused,\n ],\n [\n \"itemButtonDisabledClass\",\n \"o-menu__item__button--disabled\",\n null,\n computed(() => props.disabled || parent.value.disabled),\n ],\n [\n \"itemButtonIconClass\",\n \"o-menu__item__button--icon\",\n null,\n computed(() => !!props.icon),\n ],\n);\n\nconst submenuClasses = defineClasses([\n \"itemSubmenuClass\",\n \"o-menu__item__submenu\",\n]);\n\n// #endregion --- Computed Component Classes ---\n</script>\n\n<template>\n <li\n v-show=\"!hidden\"\n :id=\"`${parent.menuId}-${item.identifier}`\"\n data-oruga=\"menu-item\"\n :data-id=\"`menu-${item.identifier}`\"\n :class=\"itemClasses\"\n role=\"none\">\n <component\n :is=\"tag\"\n v-bind=\"$attrs\"\n :class=\"buttonClasses\"\n :role=\"parent.role + 'item'\"\n :disabled=\"disabled || parent.disabled\"\n tabindex=\"-1\"\n :aria-selected=\"parent.role == 'tree' ? isActive : undefined\"\n :aria-disabled=\"disabled || parent.disabled\"\n :aria-expanded=\"hasChildren ? isExpanded : undefined\"\n :aria-owns=\"hasChildren ? submenuId : undefined\"\n @click=\"selectItem\"\n @keydown.enter=\"selectItem\"\n @keydown.space=\"selectItem\">\n <o-icon\n v-if=\"icon\"\n :icon=\"icon\"\n :pack=\"iconPack\"\n :size=\"iconSize\" />\n <!-- \n @slot Override label\n @binding {boolean} expanded - item expanded state\n @binding {boolean} active - item active state\n -->\n <slot name=\"label\" :expanded=\"isExpanded\" :active=\"isActive\">\n <span>{{ label }}</span>\n </slot>\n </component>\n\n <!-- sub menu items -->\n <transition v-if=\"$slots.default || options\" :name=\"animation\">\n <ul\n v-show=\"isExpanded\"\n :id=\"submenuId\"\n :class=\"submenuClasses\"\n tabindex=\"-1\"\n role=\"group\">\n <!--\n @slot Place menu items here \n -->\n <slot>\n <OMenuItem\n v-for=\"option in normalizedOptions\"\n :key=\"option.key\"\n v-bind=\"option.attrs\"\n :value=\"option.value\"\n :label=\"option.label\"\n :hidden=\"option.hidden\" />\n </slot>\n </ul>\n </transition>\n </li>\n</template>\n","<script setup lang=\"ts\" generic=\"T\">\nimport { computed, ref, useId, useTemplateRef } from \"vue\";\n\nimport OIcon from \"../icon/Icon.vue\";\nimport OMenuItem from \"../menu/MenuItem.vue\";\n\nimport { getDefault } from \"@/utils/config\";\nimport { mod } from \"@/utils/helpers\";\nimport {\n defineClasses,\n isGroupOption,\n normalizeOptions,\n useProviderParent,\n useSequentialId,\n type ProviderItem,\n} from \"@/composables\";\n\nimport type { MenuChildItem, MenuComponent, MenuItemComponent } from \"./types\";\nimport type { MenuProps } from \"./props\";\n\n/**\n * A simple menu, for any type of vertical navigation.\n * @displayName Menu\n * @requires ./MenuItem.vue\n * @style _menu.scss\n */\ndefineOptions({\n isOruga: true,\n name: \"OMenu\",\n configField: \"menu\",\n});\n\ntype ModelValue = MenuProps<T>[\"modelValue\"];\n\nconst props = withDefaults(defineProps<MenuProps<T>>(), {\n override: undefined,\n modelValue: undefined,\n options: undefined,\n label: undefined,\n accordion: true,\n disabled: false,\n menuId: () => useId(),\n labelId: () => useId(),\n role: () => getDefault(\"menu.role\", \"tree\"),\n icon: undefined,\n iconPack: () => getDefault(\"menu.iconPack\"),\n iconSize: () => getDefault(\"menu.iconSize\"),\n});\n\ndefineEmits<{\n /**\n * modelValue prop two-way binding\n * @param value {T} updated modelValue prop\n */\n \"update:model-value\": [value: ModelValue];\n}>();\n\nconst rootRef = useTemplateRef(\"rootElement\");\n\n// provided data is a computed ref to ensure reactivity\nconst provideData = computed<MenuComponent<T>>(() => ({\n focsuedIdentifier: focusedItem.value?.identifier,\n menuId: props.menuId,\n accordion: props.accordion,\n disabled: props.disabled,\n role: props.role,\n nextSequence,\n resetMenu,\n selectItem,\n}));\n\n/** provide functionalities and data to child item components */\nconst { childItems } = useProviderParent<\n MenuItemComponent<T>,\n MenuComponent<T>\n>({ rootRef, data: provideData });\n\n// create a unique id sequence\nconst { nextSequence } = useSequentialId();\n\n/** normalized programamtic options */\nconst normalizedOptions = computed(() =>\n normalizeOptions<T>(props.options, nextSequence),\n);\n\n/** call reset for every menu item excluding the given one */\nfunction resetMenu(\n excludedItems: ProviderItem<MenuItemComponent<T>>[] = [],\n): void {\n childItems.value.forEach((item) => {\n if (!excludedItems.map((i) => i?.identifier).includes(item.identifier))\n item.data?.reset();\n });\n}\n\n// #region --- Select Feature ---\n\n/** The selected item value, use v-model to make it two-way binding */\nconst vmodel = defineModel<ModelValue>({ default: undefined });\n\nconst selectedItem = ref<MenuChildItem<T>>();\n\nfunction selectItem(\n item: ProviderItem<MenuItemComponent<T>> | undefined,\n): void {\n const value = item?.data?.value;\n if (vmodel.value == value) return;\n vmodel.value = value;\n selectedItem.value = item;\n}\n\n// #endregion --- Select Feature ---\n\n// #region --- Focus Feature ---\n\nconst focusedItem = ref<MenuChildItem<T>>();\n\n/** is any option visible */\nconst isNotEmpty = computed(() => childItems.value.some(isItemViable));\n\nfunction onCollapse(): void {\n if (!focusedItem.value) return;\n\n // collapse the item if already expanded\n if (focusedItem.value.data?.expanded)\n focusedItem.value.data?.setExpand(false);\n // else move focus to the previus item\n else moveFocus(-1);\n}\n\nfunction onExpend(): void {\n if (!focusedItem.value) return;\n\n // expand the item if not already expanded\n if (\n focusedItem.value.data?.hasChildren &&\n !focusedItem.value.data?.expanded\n )\n focusedItem.value.data?.setExpand(true);\n // else move focus to the next item\n else moveFocus(1);\n}\n\n/** Set focus on a dropdown item. */\nfunction setFocus(item: MenuChildItem<T>): void {\n focusedItem.value = item;\n}\n\n/** Set focus on a tab item. */\nfunction moveFocus(delta: 1 | -1): void {\n if (!isNotEmpty.value) return;\n const item = getFirstViableItem(focusedItem.value?.index || 0, delta);\n setFocus(item);\n}\n\nfunction onUpPressed(): void {\n moveFocus(-1);\n}\n\nfunction onDownPressed(): void {\n moveFocus(1);\n}\n\nfunction onEnter(event: Event): void {\n if (!focusedItem.value) return;\n setFocus(focusedItem.value);\n focusedItem.value.data?.selectItem(event);\n}\n\n/** Go to the first viable item */\nfunction onHomePressed(): void {\n if (!isNotEmpty.value) return;\n const item = getFirstViableItem(0, 1);\n setFocus(item);\n}\n\n/** Go to the last viable item */\nfunction onEndPressed(): void {\n if (!isNotEmpty.value) return;\n const item = getFirstViableItem(childItems.value.length - 1, -1);\n setFocus(item);\n}\n\n/**\n * Get the first 'viable' child, starting at startingIndex and in the direction specified\n * by the boolean parameter forward. In other words, first try to select the child at index\n * startingIndex, and if it is not visible or it is disabled, then go to the index in the\n * specified direction until either returning to startIndex or finding a viable child item.\n */\nfunction getFirstViableItem(\n startingIndex: number,\n delta: 1 | -1,\n): MenuChildItem<T> {\n let newIndex = mod(\n focusedItem.value?.index == startingIndex\n ? startingIndex + delta\n : startingIndex,\n childItems.value.length,\n );\n for (\n ;\n newIndex !== focusedItem.value?.index;\n newIndex = mod(newIndex + delta, childItems.value.length)\n ) {\n // Break if the item at this index is viable (not disabled)\n if (isItemViable(childItems.value[newIndex])) break;\n }\n\n return childItems.value[newIndex];\n}\n\nfunction isItemViable(item: MenuChildItem<T>): boolean {\n return (\n !item.data?.disabled &&\n !item.data?.hidden &&\n (item.data?.parent?.expanded ?? true)\n );\n}\n\nfunction onFocusLeave(): void {\n focusedItem.value = undefined;\n}\n\n// #endregion --- Focus Feature ---\n\n// #region --- Computed Component Classes ---\n\nconst rootClasses = defineClasses([\"rootClass\", \"o-menu\"]);\n\nconst listClasses = defineClasses([\"listClass\", \"o-menu__list\"]);\n\nconst labelClasses = defineClasses([\"labelClass\", \"o-menu__label\"]);\n\n// #endregion --- Computed Component Classes ---\n</script>\n\n<template>\n <nav\n ref=\"rootElement\"\n data-oruga=\"menu\"\n :class=\"rootClasses\"\n @focusout=\"onFocusLeave\">\n <div v-if=\"label || $slots.label\" :id=\"labelId\" :class=\"labelClasses\">\n <!-- \n @slot Override icon and label\n @binding {T} focused - the focused item value\n @binding {number} focusedIndex - index of the focused item\n @binding {T} selected - the selected item value\n @binding {number} selectedIndex - index of the selected item\n -->\n <slot\n name=\"label\"\n :focused=\"focusedItem?.data\"\n :focused-index=\"focusedItem?.index\"\n :selected=\"selectedItem?.data\"\n :selected-index=\"selectedItem?.index\">\n <o-icon\n v-if=\"icon\"\n :icon=\"icon\"\n :pack=\"iconPack\"\n :size=\"iconSize\" />\n <span>{{ label }}</span>\n </slot>\n </div>\n\n <ul\n :id=\"menuId\"\n :class=\"listClasses\"\n :role=\"role\"\n :tabindex=\"0\"\n :aria-labelledby=\"labelId\"\n @keydown.left=\"onCollapse\"\n @keydown.right=\"onExpend\"\n @keydown.enter.prevent=\"onEnter\"\n @keydown.space.prevent=\"onEnter\"\n @keydown.up.prevent=\"onUpPressed\"\n @keydown.down.prevent=\"onDownPressed\"\n @keydown.home.prevent=\"onHomePressed\"\n @keydown.end.prevent=\"onEndPressed\">\n <!--\n @slot Place menu items here \n @binding {T} focused - the focused item value\n @binding {number} focusedIndex - index of the focused item\n @binding {T} selected - the selected item value\n @binding {number} selectedIndex - index of the selected item\n -->\n <slot\n :focused=\"focusedItem?.data\"\n :focused-index=\"focusedItem?.index\"\n :selected=\"selectedItem?.data\"\n :selected-index=\"selectedItem?.index\">\n <template v-for=\"option in normalizedOptions\" :key=\"option.key\">\n <OMenuItem\n v-if=\"isGroupOption(option)\"\n v-bind=\"option.attrs\"\n :label=\"option.label\"\n :hidden=\"option.hidden\">\n <OMenuItem\n v-for=\"_option in option.options\"\n v-bind=\"_option.attrs\"\n :key=\"_option.key\"\n :value=\"_option.value\"\n :label=\"_option.label\"\n :hidden=\"_option.hidden\" />\n </OMenuItem>\n\n <OMenuItem\n v-else\n v-bind=\"option.attrs\"\n :value=\"option.value\"\n :label=\"option.label\"\n :hidden=\"option.hidden\" />\n </template>\n </slot>\n </ul>\n </nav>\n</template>\n","import type { App, Plugin } from \"vue\";\n\nimport Menu from \"./Menu.vue\";\nimport MenuItem from \"./MenuItem.vue\";\n\nimport { registerComponent } from \"@/utils/plugins\";\n\n/** export menu plugin */\nexport default {\n install(app: App) {\n registerComponent(app, Menu);\n registerComponent(app, MenuItem);\n },\n} as Plugin;\n\n/** export menu components */\nexport { Menu as OMenu, MenuItem as OMenuItem };\n"],"names":["useId","computed","useProviderParent","useProviderChild","normalizeOptions","_useModel","ref","defineClasses","useTemplateRef","useSequentialId","mod","registerComponent","Menu","MenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,UAAM,QAAQ;AAgBd,UAAM,QAAQ;AAcR,UAAA,YAAY,MAAM,SAASA,UAAM;AAGjC,UAAA,cAAcC,IAAAA,SAA8B,OAAO;AAAA,MACrD,UAAU,WAAW;AAAA,MACrB;AAAA,MACA;AAAA,IAAA,EACF;AAGI,UAAA,EAAE,WAAW,IAAIC,oCAAkB;AAAA,MACrC,KAAK;AAAA,MACL,MAAM;AAAA,IAAA,CACT;AAGD,UAAM,WAAWC,kBAAAA,iBAAsC;AAAA,MACnD,KAAK;AAAA,MACL,YAAY;AAAA,IAAA,CACf;AAGK,UAAA,eAAeF,IAAAA,SAA+B,OAAO;AAAA,MACvD,GAAG;AAAA,MACH,OAAO;AAAA,MACP,QAAQ,SAAS,OAAO;AAAA,MACxB,aAAa,YAAY;AAAA,MACzB,UAAU,WAAW;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,IAAA,EACF;AAGI,UAAA,EAAE,QAAQ,KAAK,IAAIE,mCAGvB,EAAE,MAAM,cAAc;AAElB,UAAA,eAAe,OAAO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