import { defineComponent , h , inject , toRefs , Ref } from 'vue' ; const CDropdownMenu = defineComponent ( { name : 'CDropdownMenu' , props : { values component : { type : String , default : 'div' , required : false , } , } , setup ( props , { slots } ) { const dropdownMenuRef = inject ( 'dropdownMenuRef' ) as Ref < HTMLElement > ; const config = inject ( 'config' ) as any ; const { alignment , dark , popper , visible } = toRefs ( config ) ; const alignmentClassNames = ( alignment ) => { const classNames = [ ] ; if ( typeof alignment === 'object' ) { Object . keys ( alignment ) . map ( ( key ) => { classNames . push ( `dropdown-menu${ key === 'xs' ? '' : `-${ key }` }-${ alignment [ key ] }` ) ; } ) ; } if ( typeof alignment === 'string' ) { classNames . push ( `dropdown-menu-${ alignment }` ) ; } return classNames ; } ; return ( ) => h ( props . component , { class : [ 'dropdown-menu' , { 'dropdown-menu-dark' : dark . value , show : visible . value } , alignmentClassNames ( alignment . value ) , ] , ... ( ( typeof alignment . value === 'object' || ! popper . value ) && { 'data-coreui-popper' : 'static' , } ) , ref : dropdownMenuRef , } , props . component === 'ul' ? slots . default && slots . default ( ) . map ( ( vnode ) => h ( 'li' , { } , vnode ) ) : slots . default && slots . default ( ) ) ; } , } ) ; export { CDropdownMenu } ;