aloha-vue 1.2.62 → 1.2.63

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/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "Vue.js"
15
15
  ],
16
16
  "homepage": "https://github.com/ilia-brykin/aloha/#README.md",
17
- "version": "1.2.62",
17
+ "version": "1.2.63",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -1,5 +1,7 @@
1
1
  import {
2
- h, provide, toRef,
2
+ h,
3
+ provide,
4
+ toRef,
3
5
  } from "vue";
4
6
 
5
7
  import AMenuBreadcrumbs from "../AMenuBreadcrumbs/AMenuBreadcrumbs";
@@ -7,6 +9,7 @@ import AMenuPanelGroup from "../AMenuPanelGroup/AMenuPanelGroup";
7
9
 
8
10
  import GroupAPI from "./compositionAPI/GroupAPI";
9
11
  import IdAPI from "./compositionAPI/IdAPI";
12
+ import LevelAPI from "./compositionAPI/LevelAPI";
10
13
  import PanelOpenAPI from "./compositionAPI/PanelOpenAPI";
11
14
 
12
15
  export default {
@@ -83,6 +86,11 @@ export default {
83
86
  panelId,
84
87
  } = IdAPI(props);
85
88
 
89
+ const {
90
+ openedLevelIndex,
91
+ styleZIndex,
92
+ } = LevelAPI(props);
93
+
86
94
  const {
87
95
  isItemsWithoutGroup,
88
96
  itemsGroup,
@@ -91,7 +99,9 @@ export default {
91
99
  const {
92
100
  isChildPanelOpen,
93
101
  isPanelOpen,
94
- } = PanelOpenAPI(props);
102
+ } = PanelOpenAPI(props, {
103
+ openedLevelIndex,
104
+ });
95
105
 
96
106
  provide("isChildPanelOpen", isChildPanelOpen);
97
107
  provide("isPanelMain", isPanelMain);
@@ -102,6 +112,7 @@ export default {
102
112
  isPanelOpen,
103
113
  itemsGroup,
104
114
  panelId,
115
+ styleZIndex,
105
116
  };
106
117
  },
107
118
  render() {
@@ -113,6 +124,7 @@ export default {
113
124
  a_menu_2__panel_opened: !this.isSearchActive && this.isPanelOpen,
114
125
  a_menu_2__panel_parent: !this.isSearchActive && this.isChildPanelOpen,
115
126
  }],
127
+ style: this.styleZIndex,
116
128
  }, [
117
129
  (!this.isPanelMain && this.isPanelOpen) && h(AMenuBreadcrumbs, {
118
130
  breadcrumbsLinkClass: this.breadcrumbsLinkClass,
@@ -0,0 +1,25 @@
1
+ import {
2
+ computed,
3
+ toRef,
4
+ } from "vue";
5
+
6
+ export default function LevelAPI(props) {
7
+ const panelParentsOpen = toRef(props, "panelParentsOpen");
8
+ const parentId = toRef(props, "parentId");
9
+
10
+ const openedLevelIndex = computed(() => {
11
+ return panelParentsOpen.value.indexOf(parentId.value);
12
+ });
13
+
14
+ const styleZIndex = computed(() => {
15
+ if (openedLevelIndex.value !== -1) {
16
+ return `z-index: ${ openedLevelIndex.value + 2 };`;
17
+ }
18
+ return undefined;
19
+ });
20
+
21
+ return {
22
+ openedLevelIndex,
23
+ styleZIndex,
24
+ };
25
+ }
@@ -3,11 +3,12 @@ import {
3
3
  toRef,
4
4
  } from "vue";
5
5
 
6
- export default function PanelOpenAPI(props) {
6
+ export default function PanelOpenAPI(props, {
7
+ openedLevelIndex = computed(() => -1),
8
+ }) {
7
9
  const isPanelMain = toRef(props, "isPanelMain");
8
10
  const isSearchActive = toRef(props, "isSearchActive");
9
11
  const panelParentsOpen = toRef(props, "panelParentsOpen");
10
- const parentId = toRef(props, "parentId");
11
12
 
12
13
  const isPanelOpen = computed(() => {
13
14
  if (isSearchActive.value) {
@@ -17,7 +18,7 @@ export default function PanelOpenAPI(props) {
17
18
  return panelParentsOpen.value.length === 0;
18
19
  }
19
20
  if (panelParentsOpen.value.length) {
20
- return panelParentsOpen.value.indexOf(parentId.value) === panelParentsOpen.value.length - 1;
21
+ return openedLevelIndex.value === panelParentsOpen.value.length - 1;
21
22
  }
22
23
  return false;
23
24
  });
@@ -26,7 +27,7 @@ export default function PanelOpenAPI(props) {
26
27
  if (isPanelMain.value) {
27
28
  return panelParentsOpen.value.length > 0;
28
29
  }
29
- const INDEX = panelParentsOpen.value.indexOf(parentId.value);
30
+ const INDEX = openedLevelIndex.value;
30
31
 
31
32
  return INDEX !== -1 && INDEX !== panelParentsOpen.value.length - 1;
32
33
  });
@@ -567,4 +567,5 @@
567
567
  }
568
568
  .a_menu_2__breadcrumb__ul_truncated__dropdown {
569
569
  padding: .2rem;
570
+ min-width: auto;
570
571
  }