Skip to content

Commit 53d4938

Browse files
committed
update event names, add docs
1 parent 6c63ddb commit 53d4938

File tree

2 files changed

+45
-12
lines changed

2 files changed

+45
-12
lines changed

packages/dialtone-vue3/components/hovercard/hovercard.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@
2121
@opened="(e) => ($emit('opened', e))"
2222
@mouseenter-popover="onMouseEnter"
2323
@mouseleave-popover="onMouseLeave"
24+
@mouseenter-popover-anchor="onMouseEnter"
25+
@mouseleave-popover-anchor="onMouseLeave"
2426
>
2527
<template #anchor="{ attrs }">
26-
<div
27-
@mouseenter-popover="onMouseEnter"
28-
@mouseleave-popover="onMouseLeave"
29-
>
30-
<!-- @slot Anchor element that activates the hovercard. Usually a button. -->
31-
<slot
32-
name="anchor"
33-
v-bind="attrs"
34-
/>
35-
</div>
28+
<!-- @slot Anchor element that activates the hovercard. Usually a button. -->
29+
<slot
30+
name="anchor"
31+
v-bind="attrs"
32+
/>
3633
</template>
3734
<template #content>
3835
<!-- @slot Slot for the content that is displayed in the hovercard. -->

packages/dialtone-vue3/components/popover/popover.vue

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
:css="$attrs.css"
6464
:tabindex="contentTabindex"
6565
v-on="popoverListeners"
66-
@mouseenter="onMouseEnter"
67-
@mouseleave="onMouseLeave"
66+
@mouseenter="onMouseEnterAnchor"
67+
@mouseleave="onMouseLeaveAnchor"
6868
>
6969
<popover-header-footer
7070
v-if="hasSlotContent($slots.headerContent) || showCloseButton"
@@ -538,6 +538,34 @@ export default {
538538
* @type {Boolean | Array}
539539
*/
540540
'opened',
541+
542+
/**
543+
* Emitted when the mouse enters the popover
544+
*
545+
* @event mouseenter-popover
546+
*/
547+
'mouseenter-popover',
548+
549+
/**
550+
* Emitted when the mouse leaves the popover
551+
*
552+
* @event mouseleave-popover
553+
*/
554+
'mouseleave-popover',
555+
556+
/**
557+
* Emitted when the mouse enters the popover anchor
558+
*
559+
* @event mouseenter-popover-anchor
560+
*/
561+
'mouseenter-popover-anchor',
562+
563+
/**
564+
* Emitted when the mouse leaves the popover anchor
565+
*
566+
* @event mouseleave-popover-anchor
567+
*/
568+
'mouseleave-popover-anchor',
541569
],
542570
543571
data () {
@@ -1024,6 +1052,14 @@ export default {
10241052
onMouseLeave () {
10251053
this.$emit('mouseleave-popover');
10261054
},
1055+
1056+
onMouseEnterAnchor () {
1057+
this.$emit('mouseenter-popover-anchor');
1058+
},
1059+
1060+
onMouseLeaveAnchor () {
1061+
this.$emit('mouseleave-popover-anchor');
1062+
},
10271063
},
10281064
};
10291065
</script>

0 commit comments

Comments
 (0)