// Mixins import Delayable from '../delayable'; import Toggleable from '../toggleable'; // Utilities import mixins from '../../util/mixins'; import { getSlot, getSlotType } from '../../util/helpers'; import { consoleError } from '../../util/console'; const baseMixins = mixins(Delayable, Toggleable); /* @vue/component */ export default baseMixins.extend({ name: 'activatable', props: { activator: { default: null, validator: val => { return ['string', 'object'].includes(typeof val); } }, disabled: Boolean, internalActivator: Boolean, openOnHover: Boolean }, data: () => ({ activatorElement: null, activatorNode: [] }), watch: { activator() { this.activatorElement = null; this.getActivator(); } }, mounted() { const slotType = getSlotType(this, 'activator', true); if (slotType && ['v-slot', 'normal'].includes(slotType)) { consoleError(`The activator slot must be bound, try '