@iris-ui-kit/vue 0.2.32 → 0.2.34

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,7 +660,7 @@ function installNavMenuStyles() {
660
660
  document.head.appendChild(style);
661
661
  installed = true;
662
662
  }
663
- var HOVER_OPEN_DELAY_VAL = 60;
663
+ var HOVER_OPEN_DELAY_VAL = 40;
664
664
  var HOVER_CLOSE_DELAY_VAL = 150;
665
665
  function createNavMenuFlyout(ctx) {
666
666
  const hovered = vue.ref(null);
@@ -702,13 +702,13 @@ function createNavMenuFlyout(ctx) {
702
702
  const rect = trigger.getBoundingClientRect();
703
703
  const dir = getComputedStyle(trigger).direction;
704
704
  panel.style.position = "fixed";
705
- panel.style.top = `${ctx.collapsed ? rect.top : rect.bottom}px`;
705
+ panel.style.top = `${ctx.collapsed.value ? rect.top : rect.bottom}px`;
706
706
  if (dir === "rtl") {
707
707
  panel.style.left = "";
708
- panel.style.right = `${window.innerWidth - (ctx.collapsed ? rect.left : rect.right)}px`;
708
+ panel.style.right = `${window.innerWidth - (ctx.collapsed.value ? rect.left : rect.right)}px`;
709
709
  } else {
710
710
  panel.style.right = "";
711
- panel.style.left = `${ctx.collapsed ? rect.right : rect.left}px`;
711
+ panel.style.left = `${ctx.collapsed.value ? rect.right : rect.left}px`;
712
712
  }
713
713
  };
714
714
  vue.onBeforeUnmount(() => {
@@ -717,8 +717,8 @@ function createNavMenuFlyout(ctx) {
717
717
  flyoutPanels.clear();
718
718
  });
719
719
  const isolateAtDepth = (key) => {
720
- const depth = core.findNavPath(ctx.items, key).length - 1;
721
- const isSameDepthOther = (k) => k !== key && core.findNavPath(ctx.items, k).length - 1 === depth;
720
+ const depth = core.findNavPath(ctx.items.value, key).length - 1;
721
+ const isSameDepthOther = (k) => k !== key && core.findNavPath(ctx.items.value, k).length - 1 === depth;
722
722
  for (const state of [hoveredBranches, clickedBranches, focusedBranches]) {
723
723
  if (state.value.some(isSameDepthOther)) {
724
724
  state.value = state.value.filter((k) => !isSameDepthOther(k));
@@ -786,7 +786,7 @@ function createNavMenuFlyout(ctx) {
786
786
  const next = event.relatedTarget;
787
787
  return !!(next && next instanceof Node && container.contains(next));
788
788
  };
789
- const interactionKeyAtDepth = (keys, depth) => keys.find((key) => core.findNavPath(ctx.items, key).length === depth + 1);
789
+ const interactionKeyAtDepth = (keys, depth) => keys.find((key) => core.findNavPath(ctx.items.value, key).length === depth + 1);
790
790
  const horizontalBranchVisible = (key, depth) => {
791
791
  const hoveredAtDepth = interactionKeyAtDepth(hoveredBranches.value, depth);
792
792
  if (hoveredAtDepth) return hoveredAtDepth === key;
@@ -998,6 +998,7 @@ var IrisNavMenu = vue.defineComponent({
998
998
  setup(props, { emit, attrs }) {
999
999
  installNavMenuStyles();
1000
1000
  const { t } = useI18n();
1001
+ const menuItems = vue.computed(() => props.items);
1001
1002
  const tree = vue.computed(() => core.visibleNav(props.items));
1002
1003
  const activePath = vue.computed(
1003
1004
  () => props.activeKey ? core.findNavPath(props.items, props.activeKey).map((n) => n.key) : []
@@ -1033,11 +1034,13 @@ var IrisNavMenu = vue.defineComponent({
1033
1034
  }
1034
1035
  };
1035
1036
  const flyout = createNavMenuFlyout({
1036
- items: props.items,
1037
+ // Keep the flyout controller in sync with async navigation data and
1038
+ // layout changes; passing .value here would freeze the initial state.
1039
+ items: menuItems,
1037
1040
  tree,
1038
1041
  expanded,
1039
- flyoutMode: { value: flyoutMode.value },
1040
- collapsed: props.collapsed,
1042
+ flyoutMode,
1043
+ collapsed: vue.computed(() => props.collapsed),
1041
1044
  toggle,
1042
1045
  emitSelect: (key, node) => emit("select", key, node)
1043
1046
  });