DropdownMenuSubContent.vue 1.3 KB

12345678910111213141516171819202122232425262728
  1. <script setup lang="ts">
  2. import type { DropdownMenuSubContentEmits, DropdownMenuSubContentProps } from "reka-ui"
  3. import type { HTMLAttributes } from "vue"
  4. import { reactiveOmit } from "@vueuse/core"
  5. import {
  6. DropdownMenuSubContent,
  7. useForwardPropsEmits,
  8. } from "reka-ui"
  9. import { cn } from '@/Packages/Shadcn/Lib/utils'
  10. const props = defineProps<DropdownMenuSubContentProps & { class?: HTMLAttributes["class"] }>()
  11. const emits = defineEmits<DropdownMenuSubContentEmits>()
  12. const delegatedProps = reactiveOmit(props, "class")
  13. const forwarded = useForwardPropsEmits(delegatedProps, emits)
  14. </script>
  15. <template>
  16. <DropdownMenuSubContent
  17. data-slot="dropdown-menu-sub-content"
  18. v-bind="forwarded"
  19. :class="cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg', props.class)"
  20. >
  21. <slot />
  22. </DropdownMenuSubContent>
  23. </template>