import { App } from 'vue' ; import * as Components from './components' ; import { vcplaceholder , vcpopover , vctooltip } from './directives' ; const removeKeysFromObject = ( object , keys ) => { return Object . entries ( object ) . reduce ( ( obj , [ key , value ] ) => { if ( ! keys . includes ( key ) && ! keys . includes ( value . name ) ) { obj [ key ] = value ; } return obj ; } , { } ) ; } ; const CoreuiVue = { install : ( app , options ) : void => { let pluginComponents = Components ; const toRemove = options && options . remove ? options . remove : null ; if ( toRemove && Array . isArray ( toRemove ) ) { pluginComponents = removeKeysFromObject ( Components , toRemove ) ; } for ( const plugin in pluginComponents ) { app . component ( plugin , Components [ plugin ] ) ; } app . directive ( 'c-placeholder' , vcplaceholder ) ; app . directive ( 'c-popover' , vcpopover ) ; app . directive ( 'c-tooltip' , vctooltip ) ; } , } ; export default CoreuiVue ; export * from './components' ; export * from './directives' ;