aloha-vue 1.2.54 → 1.2.56
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
package/src/AMenu2/AMenu2.js
CHANGED
|
@@ -33,6 +33,9 @@ import {
|
|
|
33
33
|
uniqueId,
|
|
34
34
|
} from "lodash-es";
|
|
35
35
|
|
|
36
|
+
const DROPDOWN_BUTTON_WIDTH = 34;
|
|
37
|
+
const BREADCRUMBS_PADDINGS = 20;
|
|
38
|
+
|
|
36
39
|
export default {
|
|
37
40
|
name: "AMenu2",
|
|
38
41
|
provide() {
|
|
@@ -51,6 +54,11 @@ export default {
|
|
|
51
54
|
required: false,
|
|
52
55
|
default: () => ({}),
|
|
53
56
|
},
|
|
57
|
+
breadcrumbsTruncatedOffset: {
|
|
58
|
+
type: Number,
|
|
59
|
+
required: false,
|
|
60
|
+
default: () => DROPDOWN_BUTTON_WIDTH + BREADCRUMBS_PADDINGS,
|
|
61
|
+
},
|
|
54
62
|
buttonToggleClass: {
|
|
55
63
|
type: [String, Object],
|
|
56
64
|
required: false,
|
|
@@ -173,6 +181,7 @@ export default {
|
|
|
173
181
|
setup(props) {
|
|
174
182
|
const isLinkTruncated = toRef(props, "isLinkTruncated");
|
|
175
183
|
const showCountChildren = toRef(props, "showCountChildren");
|
|
184
|
+
const breadcrumbsTruncatedOffset = toRef(props, "breadcrumbsTruncatedOffset");
|
|
176
185
|
|
|
177
186
|
const {
|
|
178
187
|
dataKeyById,
|
|
@@ -309,6 +318,7 @@ export default {
|
|
|
309
318
|
provide("panelParentsOpen", panelParentsOpen);
|
|
310
319
|
provide("showCountChildren", computed(() => showCountChildren.value));
|
|
311
320
|
provide("togglePanel", togglePanel);
|
|
321
|
+
provide("breadcrumbsTruncatedOffset", computed(() => breadcrumbsTruncatedOffset.value));
|
|
312
322
|
|
|
313
323
|
initMenuOpenOrClose();
|
|
314
324
|
initEventBusUpdateViewOnResize();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
h,
|
|
3
|
+
inject,
|
|
3
4
|
withDirectives,
|
|
4
5
|
} from "vue";
|
|
5
6
|
|
|
@@ -48,6 +49,8 @@ export default {
|
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
setup(props) {
|
|
52
|
+
const breadcrumbsTruncatedOffset = inject("breadcrumbsTruncatedOffset");
|
|
53
|
+
|
|
51
54
|
const {
|
|
52
55
|
breadcrumbsItems,
|
|
53
56
|
} = ItemsAPI(props);
|
|
@@ -65,6 +68,7 @@ export default {
|
|
|
65
68
|
renderParent,
|
|
66
69
|
} = RenderTruncatedAPI({
|
|
67
70
|
breadcrumbsItems,
|
|
71
|
+
breadcrumbsTruncatedOffset,
|
|
68
72
|
});
|
|
69
73
|
|
|
70
74
|
return {
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
|
|
10
10
|
export default function RenderTruncatedAPI({
|
|
11
11
|
breadcrumbsItems = computed(() => []),
|
|
12
|
+
breadcrumbsTruncatedOffset = ref(0),
|
|
12
13
|
}) {
|
|
13
14
|
const breadcrumbsItemsDropdown = ref([]);
|
|
14
15
|
const breadcrumbsItemsTruncated = ref([]);
|
|
15
16
|
const breadcrumbsWidth = ref(0);
|
|
16
|
-
const dropdownButtonWidth = 30;
|
|
17
17
|
const indexRenderedItem = ref(undefined);
|
|
18
18
|
const isRenderedAll = ref(false);
|
|
19
19
|
const itemsWidth = ref(0);
|
|
@@ -35,7 +35,7 @@ export default function RenderTruncatedAPI({
|
|
|
35
35
|
|
|
36
36
|
const removeItem = () => {
|
|
37
37
|
if (breadcrumbsItemsTruncated.value.length <= 1 ||
|
|
38
|
-
(itemsWidth.value +
|
|
38
|
+
(itemsWidth.value + breadcrumbsTruncatedOffset.value <= breadcrumbsWidth.value)) {
|
|
39
39
|
addDropdownItems();
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
.a_menu_2 {
|
|
15
15
|
--a_menu_2_width: var(--a_menu_2_width_expanded);
|
|
16
16
|
--a_menu_2_top: 0;
|
|
17
|
-
--
|
|
17
|
+
--a_menu_2_navbar_top_height: 65px;
|
|
18
|
+
--a_menu_2_navbar_top_padding: .5rem;
|
|
19
|
+
--a_menu_2_navbar_top_margin_bottom: .5rem;
|
|
18
20
|
--a_menu_2_background: var(--a_color_white);
|
|
19
21
|
--a_menu_2_border_color: var(--a_color_gray_300);
|
|
20
22
|
--a_menu_2_panel_child_offset: 100%;
|
|
@@ -23,6 +25,8 @@
|
|
|
23
25
|
--a_menu_2_panel_color: var(--a_color_gray_600);
|
|
24
26
|
--a_menu_2_link_color: var(--a_color_gray_900);
|
|
25
27
|
--a_menu_2_listitem_padding: .3rem;
|
|
28
|
+
--a_menu_2_listitem_panel_secondary_padding_x: .6rem;
|
|
29
|
+
--a_menu_2_listitem_panel_secondary_padding_y: .3rem;
|
|
26
30
|
--a_menu_2_link_padding_x: .7rem;
|
|
27
31
|
--a_menu_2_link_padding_y: .7rem;
|
|
28
32
|
--a_menu_2_link_selected_bg: var(--a_color_gray_200);
|
|
@@ -202,8 +206,9 @@
|
|
|
202
206
|
.a_menu_2__navbar_top {
|
|
203
207
|
flex-shrink: 0;
|
|
204
208
|
display: flex;
|
|
205
|
-
padding:
|
|
206
|
-
height: var(--
|
|
209
|
+
padding: var(--a_menu_2_navbar_top_padding);
|
|
210
|
+
height: var(--a_menu_2_navbar_top_height);
|
|
211
|
+
margin-bottom: var(--a_menu_2_navbar_top_margin_bottom);
|
|
207
212
|
}
|
|
208
213
|
// search
|
|
209
214
|
.a_menu_2__panel_search {
|
|
@@ -406,6 +411,9 @@
|
|
|
406
411
|
border-top: var(--a_menu_2_submenu_border_width) solid var(--a_menu_2_submenu_open_bg);
|
|
407
412
|
border-top-left-radius: var(--a_menu_2_submenu_border_radius);
|
|
408
413
|
}
|
|
414
|
+
.a_menu_2__listitem {
|
|
415
|
+
padding: var(--a_menu_2_listitem_panel_secondary_padding_y) var(--a_menu_2_listitem_panel_secondary_padding_x);
|
|
416
|
+
}
|
|
409
417
|
}
|
|
410
418
|
.a_menu_2_sub_open,
|
|
411
419
|
.a_menu_2_close {
|