aloha-vue 1.0.80 → 1.0.82
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/docs/src/App/App.pug +5 -8
- package/docs/src/components/TheMenu/TheMenu.js +101 -19
- package/docs/src/components/TheMenu/TheMenu.pug +11 -7
- package/docs/src/components/TheNavbar/TheNavbar.js +3 -3
- package/docs/src/components/TheNavbar/TheNavbar.pug +2 -0
- package/docs/src/main.js +2 -12
- package/docs/src/mainIcons.js +11 -0
- package/package.json +1 -1
- package/src/AMenu/AMenu.js +177 -0
- package/src/AMenu/AMenuBreadcrumbs.js +90 -0
- package/src/AMenu/AMenuBreadcrumbsItem.js +60 -0
- package/src/AMenu/AMenuButtonToggle.js +62 -0
- package/src/AMenu/AMenuPanel.js +152 -0
- package/src/AMenu/AMenuPanelGroup.js +62 -0
- package/src/AMenu/AMenuPanelLink.js +141 -0
- package/src/AMenu/compositionAPI/AMenuPanelsAPI.js +21 -0
- package/src/AMenu/compositionAPI/AMenuSearchAPI.js +16 -0
- package/src/AMenu/compositionAPI/AMenuToggleAPI.js +41 -0
- package/src/ATable/ATable.js +1 -0
- package/src/styles/components/AMenu.scss +271 -0
- package/src/styles/styles.scss +1 -0
- package/src/ui/AErrors/AErrors.js +13 -0
package/docs/src/App/App.pug
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
div
|
|
2
|
-
the-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
the-menu
|
|
7
|
-
.a_d_inline_block.a_pl_4(
|
|
8
|
-
style="width: calc(100vw - 280px);"
|
|
2
|
+
the-menu
|
|
3
|
+
.a_menu__page
|
|
4
|
+
the-navbar(
|
|
5
|
+
@change-framework="changeFramework"
|
|
9
6
|
)
|
|
10
|
-
|
|
7
|
+
router-view
|
|
11
8
|
|
|
12
9
|
a-modal-confirm
|
|
13
10
|
a-notification
|
|
@@ -1,107 +1,189 @@
|
|
|
1
|
+
import AMenu from "../../../../src/AMenu/AMenu";
|
|
2
|
+
|
|
1
3
|
import TheMenuItem from "../TheMenuItem/TheMenuItem.vue";
|
|
2
4
|
|
|
3
5
|
export default {
|
|
4
6
|
name: "TheMenu",
|
|
5
7
|
components: {
|
|
8
|
+
AMenu,
|
|
6
9
|
TheMenuItem,
|
|
7
10
|
},
|
|
8
11
|
data() {
|
|
9
12
|
return {
|
|
10
13
|
menuItems: [
|
|
11
14
|
{
|
|
15
|
+
group: "Aloha",
|
|
12
16
|
id: "spinner",
|
|
13
|
-
name: "PageSpinner",
|
|
14
17
|
label: "Spinner",
|
|
18
|
+
to: {
|
|
19
|
+
name: "PageSpinner",
|
|
20
|
+
},
|
|
21
|
+
icon: "Duplicate",
|
|
15
22
|
},
|
|
16
23
|
{
|
|
24
|
+
group: "Aloha",
|
|
17
25
|
id: "table",
|
|
18
|
-
name: "PageTable",
|
|
19
26
|
label: "Table",
|
|
27
|
+
to: {
|
|
28
|
+
name: "PageTable",
|
|
29
|
+
},
|
|
30
|
+
icon: "Envelope",
|
|
20
31
|
},
|
|
21
32
|
{
|
|
33
|
+
group: "Hola",
|
|
22
34
|
id: "collapse",
|
|
23
|
-
name: "PageCollapse",
|
|
24
35
|
label: "Collapse",
|
|
36
|
+
to: {
|
|
37
|
+
name: "PageCollapse",
|
|
38
|
+
},
|
|
39
|
+
icon: "Export",
|
|
25
40
|
},
|
|
26
41
|
{
|
|
42
|
+
group: "Hola",
|
|
27
43
|
id: "cloak",
|
|
28
|
-
name: "PageCloak",
|
|
29
44
|
label: "Cloak",
|
|
45
|
+
to: {
|
|
46
|
+
name: "PageCloak",
|
|
47
|
+
},
|
|
48
|
+
icon: "EyeOpen",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "ui",
|
|
52
|
+
label: "ui",
|
|
53
|
+
icon: "Export",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "ui-child",
|
|
57
|
+
label: "Child",
|
|
58
|
+
parent: "ui",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "input",
|
|
62
|
+
to: {
|
|
63
|
+
name: "PageInput",
|
|
64
|
+
},
|
|
65
|
+
label: "Input",
|
|
66
|
+
parent: "ui-child",
|
|
30
67
|
},
|
|
31
68
|
{
|
|
32
69
|
id: "input",
|
|
33
|
-
|
|
70
|
+
to: {
|
|
71
|
+
name: "PageInput",
|
|
72
|
+
},
|
|
34
73
|
label: "Input",
|
|
74
|
+
parent: "ui",
|
|
35
75
|
},
|
|
36
76
|
{
|
|
37
77
|
id: "json",
|
|
38
|
-
name: "PageAJson",
|
|
39
78
|
label: "JSON",
|
|
79
|
+
to: {
|
|
80
|
+
name: "PageAJson",
|
|
81
|
+
},
|
|
82
|
+
parent: "ui",
|
|
40
83
|
},
|
|
41
84
|
{
|
|
42
85
|
id: "accordion",
|
|
43
|
-
name: "PageAccordion",
|
|
44
86
|
label: "Accordion",
|
|
87
|
+
to: {
|
|
88
|
+
name: "PageAccordion",
|
|
89
|
+
},
|
|
90
|
+
icon: "Duplicate",
|
|
45
91
|
},
|
|
46
92
|
{
|
|
47
93
|
id: "alert",
|
|
48
|
-
name: "PageAlert",
|
|
49
94
|
label: "Alert",
|
|
95
|
+
to: {
|
|
96
|
+
name: "PageAlert",
|
|
97
|
+
},
|
|
98
|
+
icon: "Home",
|
|
50
99
|
},
|
|
51
100
|
{
|
|
52
101
|
id: "modal",
|
|
53
|
-
name: "PageModal",
|
|
54
102
|
label: "Modal",
|
|
103
|
+
to: {
|
|
104
|
+
name: "PageModal",
|
|
105
|
+
},
|
|
106
|
+
icon: "Lock",
|
|
55
107
|
},
|
|
56
108
|
{
|
|
57
109
|
id: "confirm",
|
|
58
|
-
name: "PageConfirm",
|
|
59
110
|
label: "Confirm",
|
|
111
|
+
to: {
|
|
112
|
+
name: "PageConfirm",
|
|
113
|
+
},
|
|
114
|
+
icon: "Minus",
|
|
60
115
|
},
|
|
61
116
|
{
|
|
62
117
|
id: "notification",
|
|
63
|
-
name: "PageNotification",
|
|
64
118
|
label: "Notification",
|
|
119
|
+
to: {
|
|
120
|
+
name: "PageNotification",
|
|
121
|
+
},
|
|
122
|
+
icon: "Duplicate",
|
|
65
123
|
},
|
|
66
124
|
{
|
|
67
125
|
id: "checkbox",
|
|
68
|
-
name: "PageCheckbox",
|
|
69
126
|
label: "Checkbox",
|
|
127
|
+
to: {
|
|
128
|
+
name: "PageCheckbox",
|
|
129
|
+
},
|
|
130
|
+
parent: "ui",
|
|
70
131
|
},
|
|
71
132
|
{
|
|
72
133
|
id: "radio",
|
|
73
|
-
name: "PageRadio",
|
|
74
134
|
label: "Radio",
|
|
135
|
+
to: {
|
|
136
|
+
name: "PageRadio",
|
|
137
|
+
},
|
|
138
|
+
parent: "ui",
|
|
75
139
|
},
|
|
76
140
|
{
|
|
77
141
|
id: "select",
|
|
78
|
-
name: "PageSelect",
|
|
79
142
|
label: "Select",
|
|
143
|
+
to: {
|
|
144
|
+
name: "PageSelect",
|
|
145
|
+
},
|
|
146
|
+
parent: "ui",
|
|
80
147
|
},
|
|
81
148
|
{
|
|
82
149
|
id: "form",
|
|
83
|
-
name: "PageForm",
|
|
84
150
|
label: "Form",
|
|
151
|
+
to: {
|
|
152
|
+
name: "PageForm",
|
|
153
|
+
},
|
|
154
|
+
parent: "ui",
|
|
85
155
|
},
|
|
86
156
|
{
|
|
87
157
|
id: "dropdown",
|
|
88
|
-
name: "PageDropdown",
|
|
89
158
|
label: "Dropdown",
|
|
159
|
+
to: {
|
|
160
|
+
name: "PageDropdown",
|
|
161
|
+
},
|
|
162
|
+
icon: "Cog",
|
|
90
163
|
},
|
|
91
164
|
{
|
|
92
165
|
id: "tabs",
|
|
93
|
-
name: "PageTabs",
|
|
94
166
|
label: "Tabs",
|
|
167
|
+
to: {
|
|
168
|
+
name: "PageTabs",
|
|
169
|
+
},
|
|
170
|
+
icon: "Cross",
|
|
95
171
|
},
|
|
96
172
|
{
|
|
97
173
|
id: "progress",
|
|
98
|
-
name: "PageProgress",
|
|
99
174
|
label: "Progress",
|
|
175
|
+
to: {
|
|
176
|
+
name: "PageProgress",
|
|
177
|
+
},
|
|
178
|
+
icon: "Dnd",
|
|
100
179
|
},
|
|
101
180
|
{
|
|
102
181
|
id: "list",
|
|
103
|
-
name: "PageList",
|
|
104
182
|
label: "List",
|
|
183
|
+
to: {
|
|
184
|
+
name: "PageList",
|
|
185
|
+
},
|
|
186
|
+
icon: "EyeClose",
|
|
105
187
|
},
|
|
106
188
|
],
|
|
107
189
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
a-menu(
|
|
2
|
+
:items="menuItems"
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
//.the_menu
|
|
6
|
+
// ul.the_menu__ul
|
|
7
|
+
// the-menu-item(
|
|
8
|
+
// v-for="item in menuItems"
|
|
9
|
+
// :key="item.id"
|
|
10
|
+
// :data="item"
|
|
11
|
+
// )
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
} from "../../../../dist";
|
|
1
|
+
import AIcon from "../../../../src/AIcon/AIcon";
|
|
2
|
+
import AMenuButtonToggle from "../../../../src/AMenu/AMenuButtonToggle";
|
|
4
3
|
|
|
5
4
|
import frameworks from "../../../../src/const/frameworks";
|
|
6
5
|
|
|
@@ -8,6 +7,7 @@ export default {
|
|
|
8
7
|
name: "TheNavbar",
|
|
9
8
|
components: {
|
|
10
9
|
AIcon,
|
|
10
|
+
AMenuButtonToggle,
|
|
11
11
|
},
|
|
12
12
|
emits: [
|
|
13
13
|
"change-framework",
|
package/docs/src/main.js
CHANGED
|
@@ -5,6 +5,7 @@ import router from "./router/index";
|
|
|
5
5
|
import AI18nPlugin from "../../src/plugins/AI18nPlugin";
|
|
6
6
|
// import alohaPlugin from "../src/plugins/alohaPlugin";
|
|
7
7
|
import AIconPlugin from "../../src/plugins/AIconPlugin";
|
|
8
|
+
import mainIcons from "./mainIcons";
|
|
8
9
|
|
|
9
10
|
import de from "./i18n/de.json";
|
|
10
11
|
import en from "./i18n/en.json";
|
|
@@ -24,18 +25,7 @@ const TRANSLATIONS = {
|
|
|
24
25
|
ru: { ...ruGlobal, ...ru },
|
|
25
26
|
};
|
|
26
27
|
APP.use(AI18nPlugin, TRANSLATIONS, "de");
|
|
27
|
-
APP.use(AIconPlugin,
|
|
28
|
-
Plus2: `<svg
|
|
29
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
-
viewBox="0 0 18 18"
|
|
31
|
-
height="18"
|
|
32
|
-
width="18"
|
|
33
|
-
>
|
|
34
|
-
<path
|
|
35
|
-
d="M 17.986481,14.773554 14.757239,17.986512 9.0000154,12.245611 3.2427918,17.986512 0.01353176,14.773554 9.0163185,5.770767 Z"
|
|
36
|
-
/>
|
|
37
|
-
</svg>`,
|
|
38
|
-
});
|
|
28
|
+
APP.use(AIconPlugin, mainIcons);
|
|
39
29
|
// APP.use(alohaPlugin, {
|
|
40
30
|
// framework: "bootstrap",
|
|
41
31
|
// });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ChevronRight from "../../src/AIcon/Icons/bootstrap3/ChevronRight";
|
|
2
|
+
import Duplicate from "../../src/AIcon/Icons/bootstrap3/Duplicate";
|
|
3
|
+
import Envelope from "../../src/AIcon/Icons/bootstrap3/Envelope";
|
|
4
|
+
import Export from "../../src/AIcon/Icons/bootstrap3/Export";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
ChevronRight,
|
|
8
|
+
Duplicate,
|
|
9
|
+
Envelope,
|
|
10
|
+
Export,
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
h,
|
|
4
|
+
provide,
|
|
5
|
+
toRef,
|
|
6
|
+
} from "vue";
|
|
7
|
+
|
|
8
|
+
import AInput from "../ui/AInput/AInput";
|
|
9
|
+
import AMenuBreadcrumbs from "./AMenuBreadcrumbs";
|
|
10
|
+
import AMenuPanel from "./AMenuPanel";
|
|
11
|
+
|
|
12
|
+
import AMenuPanelsAPI from "./compositionAPI/AMenuPanelsAPI";
|
|
13
|
+
import AMenuSearchAPI from "./compositionAPI/AMenuSearchAPI";
|
|
14
|
+
import AMenuToggleAPI from "./compositionAPI/AMenuToggleAPI";
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
forEach,
|
|
18
|
+
get,
|
|
19
|
+
isNil,
|
|
20
|
+
} from "lodash-es";
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: "AMenu",
|
|
24
|
+
props: {
|
|
25
|
+
isOpenDefault: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: false,
|
|
28
|
+
default: true,
|
|
29
|
+
},
|
|
30
|
+
items: {
|
|
31
|
+
type: Array,
|
|
32
|
+
required: false,
|
|
33
|
+
default: () => [],
|
|
34
|
+
},
|
|
35
|
+
keyGroup: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false,
|
|
38
|
+
default: "group",
|
|
39
|
+
},
|
|
40
|
+
keyIcon: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: false,
|
|
43
|
+
default: "icon",
|
|
44
|
+
},
|
|
45
|
+
keyId: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false,
|
|
48
|
+
default: "id",
|
|
49
|
+
},
|
|
50
|
+
keyLabel: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: false,
|
|
53
|
+
default: "label",
|
|
54
|
+
},
|
|
55
|
+
keyParent: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: false,
|
|
58
|
+
default: "parent",
|
|
59
|
+
},
|
|
60
|
+
isBreadcrumbsAll: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
required: false,
|
|
63
|
+
default: true,
|
|
64
|
+
},
|
|
65
|
+
isSearch: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false,
|
|
68
|
+
default: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
setup(props) {
|
|
72
|
+
const items = toRef(props, "items");
|
|
73
|
+
const keyParent = toRef(props, "keyParent");
|
|
74
|
+
|
|
75
|
+
const itemsProParent = computed(() => {
|
|
76
|
+
const MAIN = [];
|
|
77
|
+
const ITEMS_PRO_PARENT = {};
|
|
78
|
+
forEach(items.value, item => {
|
|
79
|
+
const PARENT = get(item, keyParent.value);
|
|
80
|
+
if (isNil(PARENT)) {
|
|
81
|
+
MAIN.push(item);
|
|
82
|
+
} else {
|
|
83
|
+
ITEMS_PRO_PARENT[PARENT] = ITEMS_PRO_PARENT[PARENT] || [];
|
|
84
|
+
ITEMS_PRO_PARENT[PARENT].push(item);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
main: MAIN,
|
|
90
|
+
children: ITEMS_PRO_PARENT,
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const {
|
|
95
|
+
initMenuOpenOrClose,
|
|
96
|
+
isMenuOpen,
|
|
97
|
+
} = AMenuToggleAPI();
|
|
98
|
+
|
|
99
|
+
const {
|
|
100
|
+
modelSearch,
|
|
101
|
+
updateModelSearch,
|
|
102
|
+
} = AMenuSearchAPI();
|
|
103
|
+
|
|
104
|
+
const {
|
|
105
|
+
panelParentsOpen,
|
|
106
|
+
togglePanel,
|
|
107
|
+
} = AMenuPanelsAPI();
|
|
108
|
+
|
|
109
|
+
provide("togglePanel", togglePanel);
|
|
110
|
+
|
|
111
|
+
const isOpenDefault = toRef(props, "isOpenDefault");
|
|
112
|
+
initMenuOpenOrClose(isOpenDefault.value);
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
itemsProParent,
|
|
116
|
+
panelParentsOpen,
|
|
117
|
+
|
|
118
|
+
isMenuOpen,
|
|
119
|
+
|
|
120
|
+
modelSearch,
|
|
121
|
+
updateModelSearch,
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
render() {
|
|
125
|
+
return h("nav", {
|
|
126
|
+
class: "a_menu"
|
|
127
|
+
}, [
|
|
128
|
+
h("div", {
|
|
129
|
+
class: "a_menu__blocker",
|
|
130
|
+
ariaHidden: true,
|
|
131
|
+
}),
|
|
132
|
+
h("div", {
|
|
133
|
+
class: "a_menu__navbar_top",
|
|
134
|
+
}, [
|
|
135
|
+
this.isSearch && h(AInput, {
|
|
136
|
+
id: "a_menu_search",
|
|
137
|
+
class: "a_menu__navbar_top__search",
|
|
138
|
+
modelValue: this.modelSearch,
|
|
139
|
+
label: "Suche",
|
|
140
|
+
"onUpdate:modelValue": this.updateModelSearch,
|
|
141
|
+
}),
|
|
142
|
+
h(AMenuBreadcrumbs, {
|
|
143
|
+
items: this.items,
|
|
144
|
+
isBreadcrumbsAll: this.isBreadcrumbsAll,
|
|
145
|
+
keyId: this.keyId,
|
|
146
|
+
keyLabel: this.keyLabel,
|
|
147
|
+
panelParentsOpen: this.panelParentsOpen,
|
|
148
|
+
}),
|
|
149
|
+
]),
|
|
150
|
+
h("div", {
|
|
151
|
+
class: "a_menu__panels",
|
|
152
|
+
}, [
|
|
153
|
+
h(AMenuPanel, {
|
|
154
|
+
isFirst: true,
|
|
155
|
+
keyGroup: this.keyGroup,
|
|
156
|
+
keyIcon: this.keyIcon,
|
|
157
|
+
keyId: this.keyId,
|
|
158
|
+
keyLabel: this.keyLabel,
|
|
159
|
+
panelItems: this.itemsProParent.main,
|
|
160
|
+
panelParentsOpen: this.panelParentsOpen,
|
|
161
|
+
}),
|
|
162
|
+
Object.keys(this.itemsProParent.children).map(key => {
|
|
163
|
+
return h(AMenuPanel, {
|
|
164
|
+
key,
|
|
165
|
+
keyGroup: this.keyGroup,
|
|
166
|
+
keyIcon: this.keyIcon,
|
|
167
|
+
keyId: this.keyId,
|
|
168
|
+
keyLabel: this.keyLabel,
|
|
169
|
+
parentId: key,
|
|
170
|
+
panelItems: this.itemsProParent.children[key],
|
|
171
|
+
panelParentsOpen: this.panelParentsOpen,
|
|
172
|
+
});
|
|
173
|
+
}),
|
|
174
|
+
]),
|
|
175
|
+
]);
|
|
176
|
+
},
|
|
177
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
h,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
import AMenuBreadcrumbsItem from "./AMenuBreadcrumbsItem";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
forEach,
|
|
11
|
+
get,
|
|
12
|
+
keyBy,
|
|
13
|
+
} from "lodash-es";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: "AMenuBreadcrumbs",
|
|
18
|
+
props: {
|
|
19
|
+
items: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
isBreadcrumbsAll: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
keyId: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
keyLabel: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
panelParentsOpen: {
|
|
36
|
+
type: Array,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
setup(props) {
|
|
41
|
+
const keyId = toRef(props, "keyId");
|
|
42
|
+
const keyLabel = toRef(props, "keyLabel");
|
|
43
|
+
const items = toRef(props, "items");
|
|
44
|
+
const itemsKeyById = computed(() => {
|
|
45
|
+
return keyBy(items.value, keyId.value);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const panelParentsOpen = toRef(props, "panelParentsOpen");
|
|
49
|
+
const isBreadcrumbsAll = toRef(props, "isBreadcrumbsAll");
|
|
50
|
+
|
|
51
|
+
const setBreadcrumbsItem = panelParentId => {
|
|
52
|
+
return {
|
|
53
|
+
label: get(itemsKeyById.value, `${ panelParentId }.${ keyLabel.value }`),
|
|
54
|
+
panelParentId,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const breadcrumbsItems = computed(() => {
|
|
59
|
+
if (!panelParentsOpen.value.length) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const BREADCRUMBS_ITEMS = [];
|
|
63
|
+
if (isBreadcrumbsAll.value) {
|
|
64
|
+
forEach(panelParentsOpen.value, panelParentId => {
|
|
65
|
+
BREADCRUMBS_ITEMS.push(setBreadcrumbsItem(panelParentId));
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
BREADCRUMBS_ITEMS.push(setBreadcrumbsItem(panelParentsOpen.value[panelParentsOpen.value.length - 1]));
|
|
69
|
+
}
|
|
70
|
+
return BREADCRUMBS_ITEMS;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
breadcrumbsItems,
|
|
75
|
+
itemsKeyById,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
render() {
|
|
79
|
+
return h("div", {
|
|
80
|
+
class: "a_menu__breadcrumbs"
|
|
81
|
+
}, [
|
|
82
|
+
this.breadcrumbsItems.map(breadcrumbsItem => {
|
|
83
|
+
return h(AMenuBreadcrumbsItem, {
|
|
84
|
+
label: breadcrumbsItem.label,
|
|
85
|
+
panelParentId: breadcrumbsItem.panelParentId,
|
|
86
|
+
});
|
|
87
|
+
}),
|
|
88
|
+
]);
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
h, inject, toRef,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import AIcon from "../AIcon/AIcon";
|
|
6
|
+
|
|
7
|
+
import AKeysCode from "../const/AKeysCode";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: "AMenuBreadcrumbsItem",
|
|
11
|
+
props: {
|
|
12
|
+
label: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
panelParentId: {
|
|
17
|
+
type: [String, Number],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
setup(props,) {
|
|
22
|
+
const panelParentId = toRef(props, "panelParentId");
|
|
23
|
+
const togglePanel = inject("togglePanel");
|
|
24
|
+
const onClick = () => {
|
|
25
|
+
togglePanel({ parentId: panelParentId.value });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const onKeydown = $event => {
|
|
29
|
+
if ($event.keyCode === AKeysCode.enter ||
|
|
30
|
+
$event.keyCode === AKeysCode.space) {
|
|
31
|
+
onClick();
|
|
32
|
+
$event.stopPropagation();
|
|
33
|
+
$event.preventDefault();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
onClick,
|
|
39
|
+
onKeydown,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
render() {
|
|
43
|
+
return h("a", {
|
|
44
|
+
class: "a_menu__breadcrumbs__item a_menu__link",
|
|
45
|
+
role: "button",
|
|
46
|
+
tabindex: 0,
|
|
47
|
+
ariaLabel: "Untermenü schließen",
|
|
48
|
+
onClick: this.onClick,
|
|
49
|
+
onKeydown: this.onKeydown,
|
|
50
|
+
}, [
|
|
51
|
+
h(AIcon, {
|
|
52
|
+
icon: "ChevronLeft",
|
|
53
|
+
class: "a_mr_2",
|
|
54
|
+
}),
|
|
55
|
+
h("span", {
|
|
56
|
+
ariaHidden: true,
|
|
57
|
+
}, this.label),
|
|
58
|
+
]);
|
|
59
|
+
},
|
|
60
|
+
};
|