comand-component-library 4.3.27 → 5.0.0

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.
Files changed (64) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.js +7568 -7448
  3. package/dist/styles/demopage-only.css +35 -1
  4. package/package.json +47 -46
  5. package/src/ComponentLibrary.vue +2697 -2688
  6. package/src/assets/data/component-structure.json +1 -1
  7. package/src/assets/data/form-elements.json +224 -224
  8. package/src/assets/data/social-networks-page-by-json.json +43 -43
  9. package/src/assets/styles/component-library-global-styles.scss +296 -295
  10. package/src/componentSettingsDataAndControls.vue +1 -18
  11. package/src/components/CmdAccordion.vue +1 -1
  12. package/src/components/CmdAddressData.vue +6 -1
  13. package/src/components/CmdAddressDataItem.vue +6 -1
  14. package/src/components/CmdBasicForm.vue +2 -2
  15. package/src/components/CmdBox.vue +1103 -1086
  16. package/src/components/CmdBoxWrapper.vue +11 -1
  17. package/src/components/CmdBreadcrumbs.vue +2 -2
  18. package/src/components/CmdCodeOutput.vue +1 -1
  19. package/src/components/CmdContainer.vue +13 -1
  20. package/src/components/CmdCookieDisclaimer.vue +480 -480
  21. package/src/components/CmdFakeSelect.vue +930 -917
  22. package/src/components/CmdFlexibleScrollContainer.vue +42 -42
  23. package/src/components/CmdForm.vue +481 -481
  24. package/src/components/CmdFormElement.vue +1110 -1091
  25. package/src/components/CmdFormFilters.vue +146 -146
  26. package/src/components/CmdGoogleMaps.vue +1 -1
  27. package/src/components/CmdHeadline.vue +21 -4
  28. package/src/components/CmdIcon.vue +8 -2
  29. package/src/components/CmdImage.vue +27 -21
  30. package/src/components/CmdImageZoom.vue +9 -8
  31. package/src/components/CmdInputGroup.vue +436 -435
  32. package/src/components/CmdLink.vue +1 -1
  33. package/src/components/CmdList.vue +3 -3
  34. package/src/components/CmdListOfRequirements.vue +192 -192
  35. package/src/components/CmdLoginForm.vue +618 -618
  36. package/src/components/CmdMailToolFilter.vue +217 -217
  37. package/src/components/CmdMainNavigation.vue +581 -572
  38. package/src/components/CmdMultistepFormProgressBar.vue +9 -9
  39. package/src/components/CmdNewsletterSubscription.vue +199 -199
  40. package/src/components/CmdPagination.vue +4 -2
  41. package/src/components/CmdParagraph.vue +10 -4
  42. package/src/components/CmdProgressBar.vue +72 -72
  43. package/src/components/CmdSiteHeader.vue +382 -389
  44. package/src/components/CmdSiteSearch.vue +420 -420
  45. package/src/components/CmdSiteWrapper.vue +12 -5
  46. package/src/components/CmdSlideshow.vue +519 -519
  47. package/src/components/CmdSmartSearch.vue +291 -291
  48. package/src/components/CmdSystemMessage.vue +3 -2
  49. package/src/components/CmdTable.vue +401 -401
  50. package/src/components/CmdTabs.vue +262 -262
  51. package/src/components/CmdTag.vue +2 -2
  52. package/src/components/CmdTextImageBlock.vue +8 -2
  53. package/src/components/CmdThumbnailScroller.vue +0 -7
  54. package/src/components/CmdToast.vue +1 -1
  55. package/src/components/CmdToggleDarkMode.vue +13 -11
  56. package/src/components/CmdTooltip.vue +305 -301
  57. package/src/components/CmdUploadForm.vue +1299 -1305
  58. package/src/components/CmdWidthLimitationWrapper.vue +1 -1
  59. package/src/components/EditComponentWrapper.vue +5 -5
  60. package/src/index.js +5 -0
  61. package/src/main.js +4 -3
  62. package/src/utils/template.js +57 -0
  63. package/dist/styles/templates/casual.css +0 -3
  64. package/src/assets/styles/template.css +0 -1
@@ -1,573 +1,582 @@
1
- <template>
2
- <!-- begin CmdMainNavigationWrapper ---------------------------------------------------------------------------------------- -->
3
- <div
4
- :class="[
5
- 'cmd-main-navigation main-navigation-wrapper',
6
- {
7
- 'hide-sub-navigation' : !showSubNavigations,
8
- 'open-off-canvas': showOffcanvas,
9
- 'persist-on-mobile': persistOnMobile,
10
- 'show-content-overlay': showContentOverlay,
11
- 'off-canvas-right': offcanvasPosition === 'right'
12
- }
13
- ]">
14
- <nav>
15
- <!-- begin main-level -->
16
- <ul :class="{'stretch-items' : stretchMainItems}">
17
- <li class="close-nav" v-if="showOffcanvas">
18
- <a href="#" id="close-offcanvas" role="button" @click.prevent="closeOffcanvasNavigation">
19
- <!-- begin CmdIcon -->
20
- <CmdIcon v-if="closeOffcanvas.iconClass" :iconClass="closeOffcanvas.iconClass" :type="closeOffcanvas.iconType" />
21
- <!-- end CmdIcon -->
22
- <span :class="{'hidden': !closeOffcanvas.showText}">{{ closeOffcanvas.text }}</span>
23
- </a>
24
- </li>
25
- <li v-for="(navigationEntry, index) in navigationEntries" :key="index"
26
- :class="{'active' : navigationEntry.active, 'open' : openEntry === index, 'has-subentries': navigationEntry?.subentries?.length}">
27
- <!-- begin type === href -->
28
- <a
29
- v-if="navigationEntry.type === 'href'"
30
- :href="navigationEntry.path"
31
- :title="navigationEntry.tooltip"
32
- :target="navigationEntry.target"
33
- @click="executeLink($event, navigationEntry, index)"
34
- @mouseover="closeAllSubentries()"
35
- @focus="closeAllSubentries()"
36
- >
37
- <!-- begin CmdIcon -->
38
- <CmdIcon v-if="navigationEntry.iconClass" :iconClass="navigationEntry.iconClass" :type="navigationEntry.iconType" />
39
- <!-- end CmdIcon -->
40
- <span v-if="navigationEntry.text">{{ navigationEntry.text }}</span>
41
- <span v-if="navigationEntry?.subentries?.length"
42
- :class="['subentry-icon', subentriesIconClass]"
43
- ></span>
44
- </a>
45
- <!-- end type === href -->
46
-
47
- <!-- begin type === router -->
48
- <router-link
49
- v-if="navigationEntry.type === 'router'"
50
- :to="getRoute(navigationEntry)"
51
- :title="navigationEntry.tooltip"
52
- @click="closeOffcanvasNavigation"
53
- >
54
- <!-- begin CmdIcon -->
55
- <CmdIcon v-if="navigationEntry.iconClass" :iconClass="navigationEntry.iconClass" :type="navigationEntry.iconType" />
56
- <!-- end CmdIcon -->
57
- <span v-if="navigationEntry.text">{{ navigationEntry.text }}</span>
58
- <span v-if="navigationEntry.subentries && navigationEntry.subentries.length > 0"
59
- :class="['subentry-icon', subentriesIconClass]"></span>
60
- </router-link>
61
- <!-- end type === router -->
62
-
63
- <!-- begin sub-level 1 -->
64
- <ul v-if="navigationEntry?.subentries?.length" :aria-expanded="openEntry ? 'true' : 'false'">
65
- <li v-for="(navigationSubEntry, subindex) in navigationEntry.subentries" :key="subindex" :class="{'open' : openSubentry === subindex, 'has-subentries': navigationSubEntry?.subentries?.length}">
66
- <!-- begin type === href -->
67
- <a v-if="navigationSubEntry.type === 'href'"
68
- :href="navigationSubEntry.path"
69
- :title="navigationSubEntry.tooltip"
70
- :target="navigationSubEntry.target"
71
- @click="executeLink($event, navigationSubEntry, subindex, 1)"
72
- @mouseover="closeAllSubentries(1)"
73
- @focus="closeAllSubentries(1)"
74
- >
75
- <!-- begin CmdIcon -->
76
- <CmdIcon v-if="navigationSubEntry.iconClass" :iconClass="navigationSubEntry.iconClass" :type="navigationSubEntry.iconType" />
77
- <!-- end CmdIcon -->
78
- <span v-if="navigationSubEntry.text">{{ navigationSubEntry.text }}</span>
79
- <span v-if="navigationSubEntry.subentries && navigationSubEntry.subentries.length > 0"
80
- :class="['subentry-icon', subentriesIconClass]"
81
- ></span>
82
- </a>
83
- <!-- end type === href -->
84
-
85
- <!-- begin type === router -->
86
- <router-link
87
- v-if="navigationSubEntry.type === 'router'"
88
- :to="getRoute(navigationSubEntry)"
89
- :title="navigationSubEntry.tooltip"
90
- @click="closeOffcanvasNavigation"
91
- >
92
- <!-- begin CmdIcon -->
93
- <CmdIcon v-if="navigationSubEntry.iconClass" :iconClass="navigationSubEntry.iconClass" :type="navigationSubEntry.iconType" />
94
- <!-- end CmdIcon -->
95
- <span v-if="navigationSubEntry.text">{{ navigationSubEntry.text }}</span>
96
- <span v-if="navigationSubEntry.subentries && navigationSubEntry.subentries.length > 0"
97
- :class="['subentry-icon', subentriesIconClass]"></span>
98
- </router-link>
99
- <!-- end type === router -->
100
-
101
- <!-- begin sub-level 2 -->
102
- <ul v-if="navigationSubEntry.subentries?.length" :aria-expanded="openSubentry ? 'true' : 'false'">
103
- <li v-for="(navigationSubSubEntry, subsubindex) in navigationSubEntry.subentries"
104
- :key="subsubindex">
105
- <!-- begin type === href -->
106
- <a v-if="navigationSubSubEntry.type === 'href'"
107
- :href="navigationSubSubEntry.path"
108
- :title="navigationSubSubEntry.tooltip"
109
- :target="navigationSubSubEntry.target"
110
- @click="executeLink($event, navigationSubSubEntry)"
111
- >
112
- <!-- begin CmdIcon -->
113
- <CmdIcon v-if="navigationSubSubEntry.iconClass" :iconClass="navigationSubSubEntry.iconClass" :type="navigationSubSubEntry.iconType" />
114
- <!-- end CmdIcon -->
115
- <span v-if="navigationSubSubEntry.text">{{ navigationSubSubEntry.text }}</span>
116
- <span v-if="navigationSubSubEntry.subentries && navigationSubSubEntry.subentries.length > 0"
117
- :class="['subentry-icon', subentriesIconClass]"
118
- ></span>
119
- </a>
120
- <!-- end type === href -->
121
-
122
- <!-- begin type === router -->
123
- <router-link v-if="navigationSubSubEntry.type === 'router'"
124
- :to="getRoute(navigationSubSubEntry)"
125
- :target="navigationSubSubEntry.target"
126
- @click="closeOffcanvasNavigation"
127
- >
128
- <!-- begin CmdIcon -->
129
- <CmdIcon v-if="navigationSubSubEntry.iconClass" :iconClass="navigationSubSubEntry.iconClass" :type="navigationSubSubEntry.iconType" />
130
- <!-- end CmdIcon -->
131
- <span v-if="navigationSubSubEntry.text">{{ navigationSubSubEntry.text }}</span>
132
- <span v-if="navigationSubSubEntry.subentries && navigationSubSubEntry.subentries.length > 0"
133
- :class="['subentry-icon', subentriesIconClass]"></span>
134
- </router-link>
135
- <!-- end type === router -->
136
- </li>
137
- </ul>
138
- <!-- end sub-level 2 -->
139
- </li>
140
- </ul>
141
- <!-- begin sub-level 1 -->
142
- </li>
143
- </ul>
144
- <!-- end main-level -->
145
- </nav>
146
- <!-- begin off-canvas-button -->
147
- <a v-if="persistOnMobile === false" href="#" class="button" id="toggle-offcanvas" @click.prevent="toggleOffcanvasNavigation">
148
- <!-- begin CmdIcon -->
149
- <CmdIcon :iconClass="buttonOffcanvas.iconClass" :type="buttonOffcanvas.iconType" />
150
- <!-- end CmdIcon -->
151
- <span :class="{'hidden' : !buttonOffcanvas.showText}">{{ buttonOffcanvas.text }}</span>
152
- </a>
153
- <!-- end off-canvas-button -->
154
- </div>
155
- <!-- end CmdMainNavigationWrapper ---------------------------------------------------------------------------------------- -->
156
- </template>
157
-
158
- <script>
159
- // import functions
160
- import {getRoute} from "../utilities.js"
161
-
162
- export default {
163
- name: "CmdMainNavigation",
164
- data() {
165
- return {
166
- showOffcanvas: false,
167
- showSubNavigations: true,
168
- openEntry: -1,
169
- openSubentry: -1
170
- }
171
- },
172
- emits: ["offcanvas"],
173
- props: {
174
- /**
175
- * toggle if main-entries (on first-level) should be (horizontally) stretched equally
176
- */
177
- stretchMainItems: {
178
- type: Boolean,
179
- default: false
180
- },
181
- /**
182
- * set if navigation should persist on mobile and not be collapsed to off-canvas
183
- *
184
- * @affectsStyling: true
185
- */
186
- persistOnMobile: {
187
- type: Boolean,
188
- default: false
189
- },
190
- /**
191
- * toggle if overlay over content should be shown if off-canvas is open
192
- *
193
- * @affectsStyling: true
194
- */
195
- showContentOverlay: {
196
- type: Boolean,
197
- default: true
198
- },
199
- /**
200
- * list of all navigation-entries (incl. sub-entries)
201
- */
202
- navigationEntries: {
203
- type: Array,
204
- required: true
205
- },
206
- /**
207
- * link shown inside off-canvas-navigation to close itself
208
- *
209
- * @requiredForAccessibility: partial
210
- */
211
- closeOffcanvas: {
212
- type: Object,
213
- default: function () {
214
- return {
215
- iconClass: "icon-cancel",
216
- text: "Close navigation",
217
- showText: true
218
- }
219
- }
220
- },
221
- /**
222
- * position for offcanvas-navigation
223
- *
224
- * @allowedValues: "right", "left"
225
- */
226
- offcanvasPosition: {
227
- type: String,
228
- default: "right",
229
- validator(value) {
230
- return value === "right" ||
231
- value === "left"
232
- }
233
- },
234
- /**
235
- * button to open off-canvas-navigation
236
- *
237
- * (persistOnMobile-property must be false)
238
- *
239
- * @requiredForAccessibility: partial
240
- */
241
- buttonOffcanvas: {
242
- type: Object,
243
- default: function () {
244
- return {
245
- iconClass: "icon-bars",
246
- text: "Open navigation",
247
- showText: false
248
- }
249
- }
250
- },
251
- /**
252
- * icon to show if a navigation-entry has sub-entries
253
- */
254
- subentriesIconClass: {
255
- type: String,
256
- default: "icon-chevron-one-stripe-down"
257
- },
258
- /**
259
- * icon to show if a sub-entry has further sub-entries
260
- */
261
- subSubentriesIconClass: {
262
- type: String,
263
- default: "icon-chevron-one-stripe-right"
264
- }
265
- },
266
- methods: {
267
- closeAllSubentries(sublevel) {
268
- if(!sublevel) {
269
- this.openEntry = -1
270
- }
271
- this.openSubentry = -1
272
- },
273
- executeLink(event, navigationEntry, index, sublevel) {
274
- // execute default-link
275
- if (navigationEntry.target || (navigationEntry.path.length > 1)) {
276
- this.showOffcanvas = false
277
- return true
278
- }
279
-
280
- // toggle subentries (no link execution)
281
- if(navigationEntry?.subentries?.length) {
282
- event.preventDefault()
283
- if(!sublevel) {
284
- // assign index for first sublevel (or close if already open)
285
- this.openEntry = this.openEntry === index ? -1 : index
286
- this.openSubentry = -1 // close all sub-entries
287
- } else {
288
- // assign index for second sublevel (or close if already open)
289
- this.openSubentry = this.openSubentry === index ? -1 : index
290
- }
291
- return
292
- }
293
-
294
- // emit event to handle navigation from outside
295
- if (navigationEntry.path === '#' || navigationEntry.path === '') {
296
- event.preventDefault()
297
- this.$emit("click", navigationEntry.path)
298
- }
299
-
300
- this.showOffcanvas = false
301
- },
302
- getRoute(navigationEntry) {
303
- return getRoute(navigationEntry)
304
- },
305
- closeOffcanvasNavigation() {
306
- this.showOffcanvas = false
307
- document.getElementById("toggle-offcanvas")?.focus()
308
- },
309
- toggleOffcanvasNavigation() {
310
- if (this.showOffcanvas) {
311
- // close offcanvas
312
- this.closeOffcanvasNavigation()
313
- } else {
314
- // open offcanvas
315
- this.showOffcanvas = true
316
- this.$nextTick(() => document.getElementById("close-offcanvas")?.focus())
317
- }
318
- }
319
- },
320
- watch: {
321
- showOffcanvas() {
322
- this.$emit("offcanvas", { open: this.showOffcanvas})
323
- }
324
- }
325
- }
326
- </script>
327
-
328
- <style>
329
- /* begin cmd-main-navigation ---------------------------------------------------------------------------------------- */
330
- .cmd-main-navigation {
331
- &.hide-sub-navigation {
332
- ul {
333
- ul {
334
- display: none;
335
- }
336
- }
337
- }
338
-
339
- nav {
340
- .stretch-items {
341
- > li {
342
- flex: 1
343
- }
344
- }
345
-
346
- > ul {
347
- > li {
348
- .close-nav {
349
- display: none;
350
- }
351
-
352
- &.open {
353
- > ul {
354
- display: block;
355
-
356
- > li {
357
- &.open {
358
- > ul {
359
- display: block;
360
- }
361
- }
362
- }
363
- }
364
- }
365
- }
366
- }
367
-
368
- + div {
369
- display: none;
370
- }
371
- }
372
-
373
- .fade-enter-active, .fade-leave-active {
374
- left: 0;
375
- }
376
-
377
- .fade-enter, .fade-leave-to {
378
- left: -100%;
379
- }
380
-
381
- header nav > ul, header nav > ul > li {
382
- border: 0;
383
- }
384
- }
385
-
386
- /* keep outside of .cmd-main-navigation to keep specificity */
387
- .off-canvas-right {
388
- #toggle-offcanvas {
389
- margin-right: 0;
390
- margin-left: auto;
391
- }
392
- }
393
-
394
- #toggle-offcanvas {
395
- margin-left: 0;
396
- display: none;
397
- aspect-ratio: 1/1;
398
- }
399
- </style>
400
-
401
- <style lang="scss">
402
- @import '../assets/styles/variables';
403
-
404
- @media only screen and (max-width: $medium-max-width) {
405
- .cmd-main-navigation.main-navigation-wrapper {
406
- --nav-transition: all .5s linear;
407
-
408
- display: flex;
409
- background: none; /* overwrite framework-css */
410
- border: 0; /* overwrite framework-css */
411
-
412
- /* begin offcanvas-navigation */
413
- &:not(.persist-on-mobile) {
414
- padding: 0 var(--default-padding);
415
- transition: var(--nav-transition);
416
-
417
- #toggle-offcanvas {
418
- display: flex;
419
- margin-bottom: 0;
420
- width: auto;
421
- }
422
-
423
- &.open-off-canvas {
424
- nav {
425
- height: 100%;
426
- left: 0;
427
- opacity: 1;
428
- padding: 0 !important;
429
- transition: var(--nav-transition);
430
- border-right: var(--default-border);
431
- display: block;
432
- }
433
-
434
- &.show-content-overlay {
435
- nav {
436
- &::after {
437
- content: "";
438
- position: fixed;
439
- width: 100%;
440
- top: 0;
441
- left: 0;
442
- height: 100dvh;
443
- display: block;
444
- background: var(--color-black-reduced-opacity);
445
- }
446
-
447
- ul {
448
- z-index: 1000; /* keep ul above overlay */
449
- height: 100%;
450
- background: var(--main-navigation-background);
451
- }
452
- }
453
- }
454
- }
455
-
456
- nav {
457
- position: fixed;
458
- top: 0;
459
- left: -100%;
460
- width: auto;
461
- height: 100dvh;
462
- opacity: 0;
463
- z-index: 1000;
464
- transition: var(--nav-transition);
465
-
466
- ul {
467
- flex-direction: column;
468
- position: relative;
469
- left: 0;
470
- border: 0;
471
-
472
- li {
473
- border-bottom: var(--default-border);
474
- border-right: 0;
475
-
476
- &.close-nav {
477
- display: block;
478
- border-bottom: var(--default-border);
479
-
480
- a {
481
- display: flex;
482
- align-items: center;
483
-
484
- span {
485
- font-weight: var(--font-weight-bold);
486
-
487
- &[class*="icon-"] {
488
- font-size: var(--font-size-small);
489
- }
490
- }
491
- }
492
-
493
- > a {
494
- text-align: left;
495
- }
496
- }
497
-
498
- &.has-subentries.open {
499
- &:hover, &:active, &:focus {
500
- > ul {
501
- display: block;
502
- }
503
- }
504
- }
505
-
506
- /* sub-level 1 */
507
- ul {
508
- li {
509
- &:not(:first-child) {
510
- border-top: 0;
511
- }
512
-
513
- &:last-child {
514
- border-bottom: 0;
515
- }
516
- > a {
517
- padding-left: calc(var(--default-margin) * 2);
518
-
519
- span {
520
- & + [class*="icon-"]::before {
521
- display: inline-block;
522
- transform: rotate(0);
523
- }
524
- }
525
- }
526
-
527
- /* sub-level 2 */
528
- ul {
529
- li {
530
- a {
531
- padding-left: calc(var(--default-margin) * 4);
532
- }
533
- }
534
- }
535
- }
536
- }
537
-
538
- &.open {
539
- > a span {
540
- + [class*="icon-"]::before {
541
- display: inline-block;
542
- transform: rotate(-180deg);
543
- }
544
- }
545
-
546
- > ul {
547
- height: auto;
548
- display: block;
549
- opacity: 1;
550
- transition: var(--nav-transition);
551
- }
552
- }
553
- }
554
- }
555
- }
556
-
557
- &.off-canvas-right {
558
- &.open-off-canvas {
559
- nav {
560
- right: 0;
561
- }
562
- }
563
-
564
- nav {
565
- right: -100%;
566
- left: auto;
567
- }
568
- }
569
- }
570
- }
571
- }
572
- /* end cmd-main-navigation ------------------------------------------------------------------------------------------ */
1
+ <template>
2
+ <!-- begin CmdMainNavigationWrapper ---------------------------------------------------------------------------------------- -->
3
+ <div
4
+ :class="[
5
+ 'cmd-main-navigation main-navigation-wrapper',
6
+ {
7
+ 'hide-sub-navigation' : !showSubNavigations,
8
+ 'open-off-canvas': showOffcanvas,
9
+ 'persist-on-mobile': persistOnMobile,
10
+ 'show-content-overlay': showContentOverlay,
11
+ 'off-canvas-right': offcanvasPosition === 'right'
12
+ }
13
+ ]">
14
+ <nav :aria-label="ariaLabel">
15
+ <!-- begin main-level -->
16
+ <ul :class="{'stretch-items' : stretchMainItems}">
17
+ <li class="close-nav" v-if="showOffcanvas">
18
+ <a href="#" :id="'close-offcanvas-' + uid" ref="closeOffcanvas" role="button" @click.prevent="closeOffcanvasNavigation">
19
+ <!-- begin CmdIcon -->
20
+ <CmdIcon v-if="closeOffcanvas.iconClass" :iconClass="closeOffcanvas.iconClass" :type="closeOffcanvas.iconType" />
21
+ <!-- end CmdIcon -->
22
+ <span :class="{'visually-hidden': !closeOffcanvas.showText}">{{ closeOffcanvas.text }}</span>
23
+ </a>
24
+ </li>
25
+ <li v-for="(navigationEntry, index) in navigationEntries" :key="index"
26
+ :class="{'active' : navigationEntry.active, 'open' : openEntry === index, 'has-subentries': navigationEntry?.subentries?.length}">
27
+ <!-- begin type === href -->
28
+ <a
29
+ v-if="navigationEntry.type === 'href'"
30
+ :href="navigationEntry.path"
31
+ :title="navigationEntry.tooltip"
32
+ :target="navigationEntry.target"
33
+ @click="executeLink($event, navigationEntry, index)"
34
+ @mouseover="closeAllSubentries()"
35
+ @focus="closeAllSubentries()"
36
+ >
37
+ <!-- begin CmdIcon -->
38
+ <CmdIcon v-if="navigationEntry.iconClass" :iconClass="navigationEntry.iconClass" :type="navigationEntry.iconType" />
39
+ <!-- end CmdIcon -->
40
+ <span v-if="navigationEntry.text">{{ navigationEntry.text }}</span>
41
+ <span v-if="navigationEntry?.subentries?.length"
42
+ :class="['subentry-icon', subentriesIconClass]"
43
+ ></span>
44
+ </a>
45
+ <!-- end type === href -->
46
+
47
+ <!-- begin type === router -->
48
+ <router-link
49
+ v-if="navigationEntry.type === 'router'"
50
+ :to="getRoute(navigationEntry)"
51
+ :title="navigationEntry.tooltip"
52
+ @click="closeOffcanvasNavigation"
53
+ >
54
+ <!-- begin CmdIcon -->
55
+ <CmdIcon v-if="navigationEntry.iconClass" :iconClass="navigationEntry.iconClass" :type="navigationEntry.iconType" />
56
+ <!-- end CmdIcon -->
57
+ <span v-if="navigationEntry.text">{{ navigationEntry.text }}</span>
58
+ <span v-if="navigationEntry.subentries && navigationEntry.subentries.length > 0"
59
+ :class="['subentry-icon', subentriesIconClass]"></span>
60
+ </router-link>
61
+ <!-- end type === router -->
62
+
63
+ <!-- begin sub-level 1 -->
64
+ <ul v-if="navigationEntry?.subentries?.length" :aria-expanded="openEntry ? 'true' : 'false'">
65
+ <li v-for="(navigationSubEntry, subindex) in navigationEntry.subentries" :key="subindex" :class="{'open' : openSubentry === subindex, 'has-subentries': navigationSubEntry?.subentries?.length}">
66
+ <!-- begin type === href -->
67
+ <a v-if="navigationSubEntry.type === 'href'"
68
+ :href="navigationSubEntry.path"
69
+ :title="navigationSubEntry.tooltip"
70
+ :target="navigationSubEntry.target"
71
+ @click="executeLink($event, navigationSubEntry, subindex, 1)"
72
+ @mouseover="closeAllSubentries(1)"
73
+ @focus="closeAllSubentries(1)"
74
+ >
75
+ <!-- begin CmdIcon -->
76
+ <CmdIcon v-if="navigationSubEntry.iconClass" :iconClass="navigationSubEntry.iconClass" :type="navigationSubEntry.iconType" />
77
+ <!-- end CmdIcon -->
78
+ <span v-if="navigationSubEntry.text">{{ navigationSubEntry.text }}</span>
79
+ <span v-if="navigationSubEntry.subentries && navigationSubEntry.subentries.length > 0"
80
+ :class="['subentry-icon', subentriesIconClass]"
81
+ ></span>
82
+ </a>
83
+ <!-- end type === href -->
84
+
85
+ <!-- begin type === router -->
86
+ <router-link
87
+ v-if="navigationSubEntry.type === 'router'"
88
+ :to="getRoute(navigationSubEntry)"
89
+ :title="navigationSubEntry.tooltip"
90
+ @click="closeOffcanvasNavigation"
91
+ >
92
+ <!-- begin CmdIcon -->
93
+ <CmdIcon v-if="navigationSubEntry.iconClass" :iconClass="navigationSubEntry.iconClass" :type="navigationSubEntry.iconType" />
94
+ <!-- end CmdIcon -->
95
+ <span v-if="navigationSubEntry.text">{{ navigationSubEntry.text }}</span>
96
+ <span v-if="navigationSubEntry.subentries && navigationSubEntry.subentries.length > 0"
97
+ :class="['subentry-icon', subentriesIconClass]"></span>
98
+ </router-link>
99
+ <!-- end type === router -->
100
+
101
+ <!-- begin sub-level 2 -->
102
+ <ul v-if="navigationSubEntry.subentries?.length" :aria-expanded="openSubentry ? 'true' : 'false'">
103
+ <li v-for="(navigationSubSubEntry, subsubindex) in navigationSubEntry.subentries"
104
+ :key="subsubindex">
105
+ <!-- begin type === href -->
106
+ <a v-if="navigationSubSubEntry.type === 'href'"
107
+ :href="navigationSubSubEntry.path"
108
+ :title="navigationSubSubEntry.tooltip"
109
+ :target="navigationSubSubEntry.target"
110
+ @click="executeLink($event, navigationSubSubEntry)"
111
+ >
112
+ <!-- begin CmdIcon -->
113
+ <CmdIcon v-if="navigationSubSubEntry.iconClass" :iconClass="navigationSubSubEntry.iconClass" :type="navigationSubSubEntry.iconType" />
114
+ <!-- end CmdIcon -->
115
+ <span v-if="navigationSubSubEntry.text">{{ navigationSubSubEntry.text }}</span>
116
+ <span v-if="navigationSubSubEntry.subentries && navigationSubSubEntry.subentries.length > 0"
117
+ :class="['subentry-icon', subentriesIconClass]"
118
+ ></span>
119
+ </a>
120
+ <!-- end type === href -->
121
+
122
+ <!-- begin type === router -->
123
+ <router-link v-if="navigationSubSubEntry.type === 'router'"
124
+ :to="getRoute(navigationSubSubEntry)"
125
+ :target="navigationSubSubEntry.target"
126
+ @click="closeOffcanvasNavigation"
127
+ >
128
+ <!-- begin CmdIcon -->
129
+ <CmdIcon v-if="navigationSubSubEntry.iconClass" :iconClass="navigationSubSubEntry.iconClass" :type="navigationSubSubEntry.iconType" />
130
+ <!-- end CmdIcon -->
131
+ <span v-if="navigationSubSubEntry.text">{{ navigationSubSubEntry.text }}</span>
132
+ <span v-if="navigationSubSubEntry.subentries && navigationSubSubEntry.subentries.length > 0"
133
+ :class="['subentry-icon', subentriesIconClass]"></span>
134
+ </router-link>
135
+ <!-- end type === router -->
136
+ </li>
137
+ </ul>
138
+ <!-- end sub-level 2 -->
139
+ </li>
140
+ </ul>
141
+ <!-- begin sub-level 1 -->
142
+ </li>
143
+ </ul>
144
+ <!-- end main-level -->
145
+ </nav>
146
+ <!-- begin off-canvas-button -->
147
+ <a v-if="persistOnMobile === false" href="#" class="button" :id="'toggle-offcanvas-' + uid" ref="toggleOffcanvas" @click.prevent="toggleOffcanvasNavigation">
148
+ <!-- begin CmdIcon -->
149
+ <CmdIcon :iconClass="buttonOffcanvas.iconClass" :type="buttonOffcanvas.iconType" />
150
+ <!-- end CmdIcon -->
151
+ <span :class="{'visually-hidden' : !buttonOffcanvas.showText}">{{ buttonOffcanvas.text }}</span>
152
+ </a>
153
+ <!-- end off-canvas-button -->
154
+ </div>
155
+ <!-- end CmdMainNavigationWrapper ---------------------------------------------------------------------------------------- -->
156
+ </template>
157
+
158
+ <script>
159
+ // import functions
160
+ import {getRoute} from "../utilities.js"
161
+ import {createUuid} from "../utils/common.js"
162
+
163
+ export default {
164
+ name: "CmdMainNavigation",
165
+ data() {
166
+ return {
167
+ uid: createUuid(),
168
+ showOffcanvas: false,
169
+ showSubNavigations: true,
170
+ openEntry: -1,
171
+ openSubentry: -1
172
+ }
173
+ },
174
+ emits: ["offcanvas"],
175
+ props: {
176
+ /**
177
+ * accessible name of the navigation-landmark (must be unique if there are several navigations on a page)
178
+ */
179
+ ariaLabel: {
180
+ type: String,
181
+ default: "Main navigation"
182
+ },
183
+ /**
184
+ * toggle if main-entries (on first-level) should be (horizontally) stretched equally
185
+ */
186
+ stretchMainItems: {
187
+ type: Boolean,
188
+ default: false
189
+ },
190
+ /**
191
+ * set if navigation should persist on mobile and not be collapsed to off-canvas
192
+ *
193
+ * @affectsStyling: true
194
+ */
195
+ persistOnMobile: {
196
+ type: Boolean,
197
+ default: false
198
+ },
199
+ /**
200
+ * toggle if overlay over content should be shown if off-canvas is open
201
+ *
202
+ * @affectsStyling: true
203
+ */
204
+ showContentOverlay: {
205
+ type: Boolean,
206
+ default: true
207
+ },
208
+ /**
209
+ * list of all navigation-entries (incl. sub-entries)
210
+ */
211
+ navigationEntries: {
212
+ type: Array,
213
+ required: true
214
+ },
215
+ /**
216
+ * link shown inside off-canvas-navigation to close itself
217
+ *
218
+ * @requiredForAccessibility: partial
219
+ */
220
+ closeOffcanvas: {
221
+ type: Object,
222
+ default: function () {
223
+ return {
224
+ iconClass: "icon-cancel",
225
+ text: "Close navigation",
226
+ showText: true
227
+ }
228
+ }
229
+ },
230
+ /**
231
+ * position for offcanvas-navigation
232
+ *
233
+ * @allowedValues: "right", "left"
234
+ */
235
+ offcanvasPosition: {
236
+ type: String,
237
+ default: "right",
238
+ validator(value) {
239
+ return value === "right" ||
240
+ value === "left"
241
+ }
242
+ },
243
+ /**
244
+ * button to open off-canvas-navigation
245
+ *
246
+ * (persistOnMobile-property must be false)
247
+ *
248
+ * @requiredForAccessibility: partial
249
+ */
250
+ buttonOffcanvas: {
251
+ type: Object,
252
+ default: function () {
253
+ return {
254
+ iconClass: "icon-bars",
255
+ text: "Open navigation",
256
+ showText: false
257
+ }
258
+ }
259
+ },
260
+ /**
261
+ * icon to show if a navigation-entry has sub-entries
262
+ */
263
+ subentriesIconClass: {
264
+ type: String,
265
+ default: "icon-chevron-one-stripe-down"
266
+ },
267
+ /**
268
+ * icon to show if a sub-entry has further sub-entries
269
+ */
270
+ subSubentriesIconClass: {
271
+ type: String,
272
+ default: "icon-chevron-one-stripe-right"
273
+ }
274
+ },
275
+ methods: {
276
+ closeAllSubentries(sublevel) {
277
+ if(!sublevel) {
278
+ this.openEntry = -1
279
+ }
280
+ this.openSubentry = -1
281
+ },
282
+ executeLink(event, navigationEntry, index, sublevel) {
283
+ // execute default-link
284
+ if (navigationEntry.target || (navigationEntry.path.length > 1)) {
285
+ this.showOffcanvas = false
286
+ return true
287
+ }
288
+
289
+ // toggle subentries (no link execution)
290
+ if(navigationEntry?.subentries?.length) {
291
+ event.preventDefault()
292
+ if(!sublevel) {
293
+ // assign index for first sublevel (or close if already open)
294
+ this.openEntry = this.openEntry === index ? -1 : index
295
+ this.openSubentry = -1 // close all sub-entries
296
+ } else {
297
+ // assign index for second sublevel (or close if already open)
298
+ this.openSubentry = this.openSubentry === index ? -1 : index
299
+ }
300
+ return
301
+ }
302
+
303
+ // emit event to handle navigation from outside
304
+ if (navigationEntry.path === '#' || navigationEntry.path === '') {
305
+ event.preventDefault()
306
+ this.$emit("click", navigationEntry.path)
307
+ }
308
+
309
+ this.showOffcanvas = false
310
+ },
311
+ getRoute(navigationEntry) {
312
+ return getRoute(navigationEntry)
313
+ },
314
+ closeOffcanvasNavigation() {
315
+ this.showOffcanvas = false
316
+ this.$refs.toggleOffcanvas?.focus()
317
+ },
318
+ toggleOffcanvasNavigation() {
319
+ if (this.showOffcanvas) {
320
+ // close offcanvas
321
+ this.closeOffcanvasNavigation()
322
+ } else {
323
+ // open offcanvas
324
+ this.showOffcanvas = true
325
+ this.$nextTick(() => this.$refs.closeOffcanvas?.focus())
326
+ }
327
+ }
328
+ },
329
+ watch: {
330
+ showOffcanvas() {
331
+ this.$emit("offcanvas", { open: this.showOffcanvas})
332
+ }
333
+ }
334
+ }
335
+ </script>
336
+
337
+ <style>
338
+ /* begin cmd-main-navigation ---------------------------------------------------------------------------------------- */
339
+ .cmd-main-navigation {
340
+ &.hide-sub-navigation {
341
+ ul {
342
+ ul {
343
+ display: none;
344
+ }
345
+ }
346
+ }
347
+
348
+ nav {
349
+ .stretch-items {
350
+ > li {
351
+ flex: 1
352
+ }
353
+ }
354
+
355
+ > ul {
356
+ > li {
357
+ .close-nav {
358
+ display: none;
359
+ }
360
+
361
+ &.open {
362
+ > ul {
363
+ display: block;
364
+
365
+ > li {
366
+ &.open {
367
+ > ul {
368
+ display: block;
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+
377
+ + div {
378
+ display: none;
379
+ }
380
+ }
381
+
382
+ .fade-enter-active, .fade-leave-active {
383
+ left: 0;
384
+ }
385
+
386
+ .fade-enter, .fade-leave-to {
387
+ left: -100%;
388
+ }
389
+
390
+ header nav > ul, header nav > ul > li {
391
+ border: 0;
392
+ }
393
+ }
394
+
395
+ /* keep outside of .cmd-main-navigation to keep specificity */
396
+ .off-canvas-right {
397
+ :is(#toggle-offcanvas, [id^="toggle-offcanvas-"]) {
398
+ margin-right: 0;
399
+ margin-left: auto;
400
+ }
401
+ }
402
+
403
+ :is(#toggle-offcanvas, [id^="toggle-offcanvas-"]) {
404
+ margin-left: 0;
405
+ display: none;
406
+ aspect-ratio: 1/1;
407
+ }
408
+ </style>
409
+
410
+ <style lang="scss">
411
+ @import '../assets/styles/variables';
412
+
413
+ @media only screen and (max-width: $medium-max-width) {
414
+ .cmd-main-navigation.main-navigation-wrapper {
415
+ --nav-transition: all .5s linear;
416
+
417
+ display: flex;
418
+ background: none; /* overwrite framework-css */
419
+ border: 0; /* overwrite framework-css */
420
+
421
+ /* begin offcanvas-navigation */
422
+ &:not(.persist-on-mobile) {
423
+ padding: 0 var(--default-padding);
424
+ transition: var(--nav-transition);
425
+
426
+ :is(#toggle-offcanvas, [id^="toggle-offcanvas-"]) {
427
+ display: flex;
428
+ margin-bottom: 0;
429
+ width: auto;
430
+ }
431
+
432
+ &.open-off-canvas {
433
+ nav {
434
+ height: 100%;
435
+ left: 0;
436
+ opacity: 1;
437
+ padding: 0 !important;
438
+ transition: var(--nav-transition);
439
+ border-right: var(--default-border);
440
+ display: block;
441
+ }
442
+
443
+ &.show-content-overlay {
444
+ nav {
445
+ &::after {
446
+ content: "";
447
+ position: fixed;
448
+ width: 100%;
449
+ top: 0;
450
+ left: 0;
451
+ height: 100dvh;
452
+ display: block;
453
+ background: var(--color-black-reduced-opacity);
454
+ }
455
+
456
+ ul {
457
+ z-index: 1000; /* keep ul above overlay */
458
+ height: 100%;
459
+ background: var(--main-navigation-background);
460
+ }
461
+ }
462
+ }
463
+ }
464
+
465
+ nav {
466
+ position: fixed;
467
+ top: 0;
468
+ left: -100%;
469
+ width: auto;
470
+ height: 100dvh;
471
+ opacity: 0;
472
+ z-index: 1000;
473
+ transition: var(--nav-transition);
474
+
475
+ ul {
476
+ flex-direction: column;
477
+ position: relative;
478
+ left: 0;
479
+ border: 0;
480
+
481
+ li {
482
+ border-bottom: var(--default-border);
483
+ border-right: 0;
484
+
485
+ &.close-nav {
486
+ display: block;
487
+ border-bottom: var(--default-border);
488
+
489
+ a {
490
+ display: flex;
491
+ align-items: center;
492
+
493
+ span {
494
+ font-weight: var(--font-weight-bold);
495
+
496
+ &[class*="icon-"] {
497
+ font-size: var(--font-size-small);
498
+ }
499
+ }
500
+ }
501
+
502
+ > a {
503
+ text-align: left;
504
+ }
505
+ }
506
+
507
+ &.has-subentries.open {
508
+ &:hover, &:active, &:focus {
509
+ > ul {
510
+ display: block;
511
+ }
512
+ }
513
+ }
514
+
515
+ /* sub-level 1 */
516
+ ul {
517
+ li {
518
+ &:not(:first-child) {
519
+ border-top: 0;
520
+ }
521
+
522
+ &:last-child {
523
+ border-bottom: 0;
524
+ }
525
+ > a {
526
+ padding-left: calc(var(--default-margin) * 2);
527
+
528
+ span {
529
+ & + [class*="icon-"]::before {
530
+ display: inline-block;
531
+ transform: rotate(0);
532
+ }
533
+ }
534
+ }
535
+
536
+ /* sub-level 2 */
537
+ ul {
538
+ li {
539
+ a {
540
+ padding-left: calc(var(--default-margin) * 4);
541
+ }
542
+ }
543
+ }
544
+ }
545
+ }
546
+
547
+ &.open {
548
+ > a span {
549
+ + [class*="icon-"]::before {
550
+ display: inline-block;
551
+ transform: rotate(-180deg);
552
+ }
553
+ }
554
+
555
+ > ul {
556
+ height: auto;
557
+ display: block;
558
+ opacity: 1;
559
+ transition: var(--nav-transition);
560
+ }
561
+ }
562
+ }
563
+ }
564
+ }
565
+
566
+ &.off-canvas-right {
567
+ &.open-off-canvas {
568
+ nav {
569
+ right: 0;
570
+ }
571
+ }
572
+
573
+ nav {
574
+ right: -100%;
575
+ left: auto;
576
+ }
577
+ }
578
+ }
579
+ }
580
+ }
581
+ /* end cmd-main-navigation ------------------------------------------------------------------------------------------ */
573
582
  </style>