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OAAD,IAAY,KAAK,CAAC,OAAN,CAAc,OAAd,CAAZ,IAAsC,CAAC,OAAO,CAAC,GAAnD,EAAwD;AACtD,MAAA,WAAW,CAAC,8CAAD,EAAiD,IAAjD,CAAX;AAEA,aAAO,OAAP;AACD;;AAED,QAAI,CAAC,KAAK,QAAV,EAAoB;AAClB,MAAA,OAAO,CAAC,IAAR,GAAe,OAAO,CAAC,IAAR,IAAgB,EAA/B;;AACA,WAAK,EAAL,CAAQ,OAAO,CAAC,IAAhB,EAAsB;AACpB,QAAA,UAAU,EAAE,KAAK,YADG;AAEpB,QAAA,UAAU,EAAE,KAAK;AAFG,OAAtB;AAID;;AAED,WAAO,OAAP;AACD;;AAxDM,CAJM,CAAf","sourcesContent":["// Mixins\nimport Delayable from '../../mixins/delayable'\nimport Toggleable from '../../mixins/toggleable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport { VNode, ScopedSlotChildren } from 'vue/types/vnode'\n\nexport default mixins(\n Delayable,\n Toggleable\n /* @vue/component */\n).extend({\n name: 'v-hover',\n\n props: {\n disabled: {\n type: Boolean,\n default: false,\n },\n value: {\n type: Boolean,\n default: undefined,\n },\n },\n\n methods: {\n onMouseEnter () {\n this.runDelay('open')\n },\n onMouseLeave () {\n this.runDelay('close')\n },\n },\n\n render (): VNode {\n if (!this.$scopedSlots.default && this.value === undefined) {\n consoleWarn('v-hover is missing a default scopedSlot or bound value', this)\n\n return null as any\n }\n\n let element: VNode | ScopedSlotChildren\n\n /* istanbul ignore else */\n if (this.$scopedSlots.default) {\n element = this.$scopedSlots.default({ hover: this.isActive })\n }\n\n if (Array.isArray(element) && element.length === 1) {\n element = element[0]\n }\n\n if (!element || Array.isArray(element) || !element.tag) {\n consoleWarn('v-hover should only contain a single element', this)\n\n return element as any\n }\n\n if (!this.disabled) {\n element.data = element.data || {}\n this._g(element.data, {\n mouseenter: this.onMouseEnter,\n mouseleave: this.onMouseLeave,\n })\n }\n\n return element\n },\n})\n"],"sourceRoot":"","file":"VHover.js"} |