@iris-ui-kit/vue 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/admin.cjs CHANGED
@@ -660,6 +660,11 @@ var IrisNavMenu = vue.defineComponent({
660
660
  state.value = current.filter((item) => item !== key);
661
661
  }
662
662
  };
663
+ const keepsPointerInside = (container, event) => {
664
+ if (!container || !(container instanceof HTMLElement)) return false;
665
+ const next = event.relatedTarget;
666
+ return !!(next && next instanceof Node && container.contains(next));
667
+ };
663
668
  const interactionKeyAtDepth = (keys, depth) => keys.find((key) => core.findNavPath(props.items, key).length === depth + 1);
664
669
  const horizontalBranchVisible = (key, depth) => {
665
670
  const hoveredAtDepth = interactionKeyAtDepth(hoveredBranches.value, depth);
@@ -720,8 +725,10 @@ var IrisNavMenu = vue.defineComponent({
720
725
  onMouseenter: () => {
721
726
  if (!node.disabled) hovered.value = node.key;
722
727
  },
723
- onMouseleave: () => {
724
- if (hovered.value === node.key) hovered.value = null;
728
+ onMouseleave: (event) => {
729
+ if (hovered.value === node.key && !keepsPointerInside(event.currentTarget, event)) {
730
+ hovered.value = null;
731
+ }
725
732
  },
726
733
  onClick: () => select(branch ? core.firstLeaf(node) : node)
727
734
  },
@@ -766,8 +773,10 @@ var IrisNavMenu = vue.defineComponent({
766
773
  onMouseenter: () => {
767
774
  if (!node.disabled) hovered.value = node.key;
768
775
  },
769
- onMouseleave: () => {
770
- if (hovered.value === node.key) hovered.value = null;
776
+ onMouseleave: (event) => {
777
+ if (hovered.value === node.key && !keepsPointerInside(event.currentTarget, event)) {
778
+ hovered.value = null;
779
+ }
771
780
  },
772
781
  onClick: () => branch ? toggle(node.key) : select(node)
773
782
  },
@@ -811,8 +820,26 @@ var IrisNavMenu = vue.defineComponent({
811
820
  `iris-nav-menu-group--depth-${Math.min(9, depth)}`
812
821
  ],
813
822
  ...horizontal ? {
814
- onMouseenter: () => setBranchInteraction(hoveredBranches, node.key, true),
815
- onMouseleave: () => setBranchInteraction(hoveredBranches, node.key, false),
823
+ onMouseenter: (event) => {
824
+ if (!keepsPointerInside(event.currentTarget, event)) {
825
+ setBranchInteraction(hoveredBranches, node.key, true);
826
+ }
827
+ },
828
+ onMouseover: (event) => {
829
+ if (!keepsPointerInside(event.currentTarget, event)) {
830
+ setBranchInteraction(hoveredBranches, node.key, true);
831
+ }
832
+ },
833
+ onMouseout: (event) => {
834
+ if (!keepsPointerInside(event.currentTarget, event)) {
835
+ setBranchInteraction(hoveredBranches, node.key, false);
836
+ }
837
+ },
838
+ onMouseleave: (event) => {
839
+ if (!keepsPointerInside(event.currentTarget, event)) {
840
+ setBranchInteraction(hoveredBranches, node.key, false);
841
+ }
842
+ },
816
843
  onFocusin: () => setBranchInteraction(focusedBranches, node.key, true),
817
844
  onFocusout: (event) => {
818
845
  const group = event.currentTarget;