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,1087 +1,1104 @@
1
- <template>
2
- <!-- begin CmdBox ---------------------------------------------------------------------------------------- -->
3
- <!-- begin boxType 'content' -->
4
- <div v-if="boxType === 'content'"
5
- ref="cmdBox"
6
- :class="[
7
- 'cmd-box box content',
8
- {
9
- open : open, collapsible: collapsible,
10
- 'stretch-vertically': stretchVertically && !collapsible,
11
- 'stretch-horizontally': stretchHorizontally,
12
- 'row-view': rowView
13
- },
14
- ]"
15
- >
16
- <!-- begin collapsible header with slot -->
17
- <a v-if="collapsible"
18
- href="#"
19
- class="box-header"
20
- :title="open ? iconOpen.tooltip : iconClosed.tooltip"
21
- @click.prevent="toggleContentVisibility"
22
- >
23
- <!-- begin slot 'header' -->
24
- <slot v-if="useSlots?.includes('header')" name="header"></slot>
25
- <!-- end slot 'header' -->
26
-
27
- <!-- begin CmdHeadline -->
28
- <CmdHeadline
29
- v-else-if="cmdHeadline?.headlineText && headlinePosition === 'header'"
30
- v-bind="cmdHeadline"
31
- />
32
- <!-- end CmdHeadline -->
33
-
34
- <!-- begin CmdIcon -->
35
- <CmdIcon
36
- :iconClass="open ? iconOpen.iconClass : iconClosed.iconClass"
37
- :type="open ? iconOpen.iconType : iconClosed.iconType"
38
- />
39
- <!-- end CmdIcon -->
40
- </a>
41
- <!-- end collapsible header with slot -->
42
-
43
- <!-- begin default header with slot -->
44
- <template v-else>
45
- <div v-if="useSlots?.includes('header') || (cmdHeadline?.headlineText && headlinePosition === 'header')" class="box-header">
46
- <!-- begin slot 'header' -->
47
- <slot v-if="useSlots?.includes('header')" name="header"></slot>
48
- <!-- end slot 'header' -->
49
-
50
- <!-- begin CmdHeadline -->
51
- <CmdHeadline
52
- v-if="cmdHeadline?.headlineText && headlinePosition === 'header'"
53
- v-bind="cmdHeadline"
54
- />
55
- <!-- end CmdHeadline -->
56
- </div>
57
- </template>
58
- <!-- end default header with slot -->
59
-
60
- <!-- begin box-body -->
61
- <div v-show="open" :class="['box-body', boxBodyClass]" aria-expanded="true" role="article">
62
- <!-- begin content given slot -->
63
- <div v-if="useSlots?.includes('body')"
64
- class="inner-box-body-wrapper"
65
- :class="{'box-body-padding': useBoxBodyPadding, 'allow-scroll': allowContentToScroll}"
66
- ref="boxBody"
67
- :style="allowContentToScroll ? 'max-height: ' + calculatedBodyHeight : null"
68
- >
69
- <!-- begin slot 'body' -->
70
- <slot name="body">
71
- <!-- begin CmdHeadline -->
72
- <CmdHeadline
73
- v-if="cmdHeadline?.headlineText && headlinePosition === 'body'"
74
- v-bind="cmdHeadline"
75
- />
76
- <!-- end CmdHeadline -->
77
-
78
- <div v-if="cmdIcon !== undefined" class="body-icon-wrapper">
79
- <!-- begin CmdIcon -->
80
- <CmdIcon :iconClass="cmdIcon.iconClass" :type="cmdIcon.type" />
81
- <!-- end CmdIcon -->
82
- </div>
83
-
84
- <transition-group :name="toggleTransition">
85
- <!-- begin textBody -->
86
- <div
87
- v-if="textBody"
88
- :class="{
89
- 'cutoff-text': cutoffTextLines > 0,
90
- 'fade-last-line': fadeLastLine && !showCutOffText,
91
- 'show-text' : showCutOffText
92
- }"
93
- v-html='textBody'
94
- >
95
- </div>
96
- <!-- end textBody -->
97
-
98
- <a v-if="cutoffTextLines > 0" href="#" @click.prevent="toggleCutOffText">
99
- {{
100
- showCutOffText ? getMessage("box.contentbox.collapse_text") : getMessage("box.contentbox.expand_text")
101
- }}
102
- </a>
103
- </transition-group>
104
- </slot>
105
- <!-- end slot 'body' -->
106
- </div>
107
- <!-- end content given slot -->
108
-
109
- <!-- begin content given by properties -->
110
- <div v-else
111
- class="inner-box-body-wrapper"
112
- :class="{'allow-scroll': allowContentToScroll}"
113
- >
114
- <!-- begin CmdImage -->
115
- <CmdImage v-if="cmdImage" v-bind="cmdImage" />
116
- <!-- end CmdImage -->
117
-
118
- <div v-if="cmdHeadline?.headlineText && headlinePosition === 'body' || textBody"
119
- :class="{'box-body-padding': useBoxBodyPadding, 'allow-scroll': allowContentToScroll}">
120
- <div v-if="cmdIcon !== undefined" class="body-icon-wrapper">
121
- <!-- begin CmdIcon -->
122
- <CmdIcon v-bind="cmdIcon" />
123
- <!-- end CmdIcon -->
124
- </div>
125
-
126
- <!-- begin CmdHeadline -->
127
- <CmdHeadline
128
- v-if="cmdHeadline?.headlineText && headlinePosition === 'body'"
129
- v-bind="cmdHeadline"
130
- />
131
- <!-- end CmdHeadline -->
132
-
133
- <!-- begin textBody -->
134
- <p v-if="textBody" v-html="textBody"></p>
135
- <!-- end textBody -->
136
- </div>
137
- </div>
138
- <!-- end content given by properties -->
139
- </div>
140
- <!-- end box-body -->
141
-
142
- <!-- begin additionalLink in box-footer -->
143
- <div v-if="cmdLink?.linkType" class="box-footer">
144
- <CmdLink v-bind="cmdLink" />
145
- </div>
146
- <!-- end additionalLink in box-footer -->
147
-
148
- <div v-if="useSlots?.includes('footer')" class="box-footer">
149
- <!-- begin slot 'footer' -->
150
- <slot name="footer"></slot>
151
- <!-- end slot 'footer' -->
152
- </div>
153
- </div>
154
- <!-- end boxType 'content' -->
155
-
156
- <!-- begin boxType 'product' -->
157
- <a v-else-if="boxType === 'product' && product"
158
- :class="['cmd-box box product', {'stretch-vertically': stretchVertically, 'stretch-horizontally': stretchHorizontally, 'row-view': rowView}]"
159
- href="#"
160
- @click.prevent="clickOnProduct(product)">
161
- <div class="box-header flex-container vertical">
162
- <CmdImage v-if="product.image?.src" v-bind="{image:{...product.image}}" />
163
-
164
- <!-- begin ribbons -->
165
- <div v-if="product.new" class="ribbon-new">
166
- <span>{{ getMessage("box.productbox.new") }}</span>
167
- </div>
168
- <div v-if="product.discount" class="ribbon-discount">
169
- <span>{{ product.discount }}</span>
170
- </div>
171
- <!-- end ribbons -->
172
- </div>
173
- <!-- begin box-body -->
174
- <div class="box-body">
175
- <p v-if="product.articleNumber">{{ getMessage("box.productbox.article_no") }} {{
176
- product.articleNumber
177
- }}</p>
178
- <p v-if="product.price" class="price">
179
- <span>{{ product.price }}</span><span :title="globalCurrency.name">{{ globalCurrency.symbol }}</span>
180
- </p>
181
- <p v-if="product.description">{{ product.description }}</p>
182
- </div>
183
- <!-- end box-body -->
184
- </a>
185
- <!-- end boxType 'product' -->
186
-
187
- <!-- begin boxType 'user' -->
188
- <div v-else-if="boxType === 'user' && user"
189
- :class="[
190
- 'cmd-box box user',
191
- profileType,
192
- {
193
- 'stretch-vertically': stretchVertically,
194
- 'stretch-horizontally': stretchHorizontally,
195
- 'row-view': rowView
196
- }
197
- ]">
198
- <!-- begin box-header -->
199
- <div class="box-header flex-container vertical">
200
- <!-- begin user-image -->
201
- <figure v-if="user.image?.src">
202
- <img :src="user.image.src" :alt="user.image.alt"/>
203
- <figcaption v-if="!rowView" class="user-name">
204
- {{ user.name }}
205
- <span v-if="user.age" class="user-age">
206
- ({{ user.age }})
207
- </span>
208
- </figcaption>
209
- </figure>
210
- <!-- end no user-image -->
211
-
212
- <!-- begin no user-image -->
213
- <template v-else>
214
- <div class="no-user-image">
215
- <CmdIcon
216
- :iconClass="iconUserProfile.iconClass"
217
- :type="iconUserProfile.iconType"
218
- :title="user.name"
219
- />
220
- </div>
221
- <p v-if="!rowView" class="user-name">
222
- {{ user.name }}
223
- <span v-if="user.age" class="user-age">
224
- ({{ user.age }})
225
- </span>
226
- </p>
227
- </template>
228
- <!-- end no user-image -->
229
- </div>
230
- <!-- end box-header -->
231
-
232
- <!-- begin box-body -->
233
- <div class="box-body">
234
- <p v-if="rowView" class="user-name">{{ user.name }}</p>
235
- <p v-if="user.profession">{{ user.profession }}</p>
236
- <p v-if="user.position">{{ user.position }}</p>
237
- <p v-if="user.description" class="description">{{ user.description }}</p>
238
- </div>
239
- <!-- end box-body -->
240
-
241
- <!-- begin user-tags -->
242
- <ul v-if="user.tags && user.tags.length" class="tags">
243
- <li v-for="(tag, index) in user.tags" :key="index">
244
- {{ tag }}
245
- </li>
246
- </ul>
247
- <!-- end user-tags -->
248
-
249
- <!-- begin box-footer -->
250
- <div v-if="user.links && user.links.length" class="box-footer">
251
- <CmdList :items="user.links" orientation="horizontal" :useGap="false"/>
252
- </div>
253
- <!-- end box-footer -->
254
- </div>
255
- <!-- end boxType 'user' -->
256
- <!-- end CmdBox ---------------------------------------------------------------------------------------- -->
257
- </template>
258
-
259
- <script>
260
- // import mixins
261
- import I18n from "../mixins/I18n"
262
- import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
263
- import GlobalCurrency from "../mixins/GlobalCurrency"
264
-
265
- export default {
266
- name: "CmdBox",
267
- mixins: [
268
- I18n,
269
- DefaultMessageProperties,
270
- GlobalCurrency
271
- ],
272
- emits: ["click", "toggle-collapse", "toggle-cutofftext"],
273
- data() {
274
- return {
275
- open: this.collapsible ? this.openCollapsedBox : true,
276
- active: true,
277
- showCutOffText: false,
278
- calculatedBodyHeight: this.maxBoxBodyHeight
279
- }
280
- },
281
- props: {
282
- /**
283
- * activate to set a collapsible box to open
284
- */
285
- openCollapsedBox: {
286
- type: Boolean,
287
- required: false
288
- },
289
- /**
290
- * arranges box-content in a row
291
- *
292
- * @affectsStyling: true
293
- */
294
- rowView: {
295
- type: Boolean,
296
- default: false
297
- },
298
- /**
299
- * set type to show different types of boxes/contents
300
- *
301
- * @allowedValues: content, product, user
302
- * @affectsStyling: true
303
- */
304
- boxType: {
305
- type: String,
306
- default: "content",
307
- validator(value) {
308
- return value === "content" ||
309
- value === "product" ||
310
- value === "user"
311
- }
312
- },
313
- /**
314
- * set if content (in box-body) should scroll
315
- *
316
- * (maxBoxBodyHeight must be set)
317
- */
318
- allowContentToScroll: {
319
- type: Boolean,
320
- default: false
321
- },
322
- /**
323
- * set max-height for body (should only be used if allowContentToScroll-property is active)
324
- */
325
- maxBoxBodyHeight: {
326
- type: String,
327
- default: "20rem"
328
- },
329
- /**
330
- * activate if box should be collapsible
331
- */
332
- collapsible: {
333
- type: Boolean,
334
- default: false
335
- },
336
- /**
337
- * number of lines to show if text should be cutoff
338
- */
339
- cutoffTextLines: {
340
- type: Number,
341
- default: 0
342
- },
343
- /**
344
- * deactivate if no default-padding should be used (has no effect on content given by textBody-property)
345
- *
346
- * @affectsStyling: true
347
- */
348
- useBoxBodyPadding: {
349
- type: Boolean,
350
- default: true
351
- },
352
- /**
353
- * show fade-effect on last line
354
- *
355
- * cutoffTextLines-property must be large 0
356
- */
357
- fadeLastLine: {
358
- type: Boolean,
359
- default: false
360
- },
361
- /**
362
- * use transition to expand and collapse box-body
363
- *
364
- * 'boyType-property' must be set to 'content' and 'collapsible-property' must be activated
365
- */
366
- useTransition: {
367
- type: Boolean,
368
- default: true
369
- },
370
- /**
371
- * custom class placed on box-body-container
372
- */
373
- boxBodyClass: {
374
- type: String,
375
- required: false
376
- },
377
- /**
378
- * the shown product (incl. name, price, image, description)
379
- *
380
- * @required: only available for boxtype===product
381
- */
382
- product: {
383
- type: Object,
384
- required: false
385
- },
386
- /**
387
- * the shown user-profile (incl. name, image, contact-data)
388
- *
389
- * @required: only available for boxtype===user
390
- */
391
- user: {
392
- type: Object,
393
- required: false
394
- },
395
- /**
396
- * profile types for user-boxes
397
- *
398
- * @required: only available for boxtype===user
399
- *
400
- * @allowedValues: 'business', 'influencer', 'material-web'
401
- */
402
- profileType: {
403
- type: String,
404
- default: "business",
405
- validator(value) {
406
- return value === "business" ||
407
- value === "influencer" ||
408
- value === "material-web"
409
- }
410
- },
411
- /**
412
- * activated if all content (incl. headline) is given by slot
413
- *
414
- * if false textBody-property must be set
415
- */
416
- useSlots: {
417
- type: Array,
418
- required: false
419
- },
420
- /**
421
- * image-object for box-body of content-box
422
- *
423
- * properties for CmdImage-component
424
- */
425
- cmdImage: {
426
- type: Object,
427
- required: false
428
- },
429
- /**
430
- * String used as content (placed in a paragraph-tag) for box-body
431
- *
432
- * should only be used, if no further html-structure is required for box-body
433
- *
434
- * @canContainHtml: true
435
- */
436
- textBody: {
437
- type: String,
438
- default: ""
439
- },
440
- /**
441
- * icon for user-profile if no user-image exists
442
- *
443
- * {
444
- * iconClass: string,
445
- * iconType: string
446
- * }
447
- * @requiredForAccessibility: partial
448
- */
449
- iconUserProfile: {
450
- type: Object,
451
- default: function () {
452
- return {
453
- iconClass: "icon-user-profile",
454
- iconType: "auto"
455
- }
456
- }
457
- },
458
- /**
459
- * icon to expand an accordion
460
- *
461
- * @requiredForAccessibility: partial
462
- */
463
- iconOpen: {
464
- type: Object,
465
- default: function () {
466
- return {
467
- iconClass: "icon-chevron-one-stripe-up",
468
- tooltip: "Close content",
469
- iconType: "auto"
470
- }
471
- }
472
- },
473
- /**
474
- * icon to collapse an accordion
475
- *
476
- * @requiredForAccessibility: partial
477
- */
478
- iconClosed: {
479
- type: Object,
480
- default: function () {
481
- return {
482
- iconClass: "icon-chevron-one-stripe-down",
483
- tooltip: "Show content",
484
- iconType: "auto"
485
- }
486
- }
487
- },
488
- /**
489
- * allow box to be stretched as wide as parent-element
490
- */
491
- stretchHorizontally: {
492
- type: Boolean,
493
- default: true
494
- },
495
- /**
496
- * allow box to be stretched as high as parent-element
497
- */
498
- stretchVertically: {
499
- type: Boolean,
500
- default: true
501
- },
502
- /**
503
- * position of headline
504
- *
505
- * cmdHeadline-property must be set
506
- */
507
- headlinePosition: {
508
- type: String,
509
- default: "header",
510
- validator(value) {
511
- return value === "header" || value === "body"
512
- }
513
- },
514
- /**
515
- * properties for CmdHeadline-component
516
- */
517
- cmdHeadline: {
518
- type: Object,
519
- required: false
520
- },
521
- /**
522
- * properties for CmdLink-component to set additional link at bottom of box
523
- */
524
- cmdLink: {
525
- type: Object,
526
- default: {}
527
- },
528
- /**
529
- * properties for CmdIcon-component to set large icon in box-body
530
- */
531
- cmdIcon: {
532
- type: Object,
533
- required: false
534
- }
535
- },
536
- /*
537
- mounted() {
538
- if (this.allowContentToScroll && this.$refs.boxBody) {
539
- const topPosition = this.$refs.boxBody.getBoundingClientRect().top
540
- this.calculatedBodyHeight = (document.documentElement.clientHeight - topPosition) + "px"
541
- }
542
- },*/
543
- computed: {
544
- toggleTransition() {
545
- if (this.useTransition) {
546
- return "fade"
547
- }
548
- return ""
549
- }
550
- },
551
- methods: {
552
- // for collapsible boxes of boxType === content
553
- toggleContentVisibility() {
554
- this.open = !this.open
555
- this.active = !this.active
556
-
557
- this.$emit("toggle-collapse", this.open)
558
- },
559
- // toggle cutofftext (between full and faded text)
560
- toggleCutOffText() {
561
- this.showCutOffText = !this.showCutOffText
562
- this.$emit("toggle-cutofftext", this.showCutOffText)
563
- },
564
- // for boxType === product
565
- clickOnProduct(product) {
566
- this.$emit("click", product)
567
- },
568
- // set focus on first input if box contains form-elements
569
- setFocus() {
570
- this.$nextTick(() => {
571
- if (this.open) {
572
- const firstFormElement = this.$refs.cmdBox.querySelector(":is(input, select, textarea):first-of-type")
573
-
574
- if (firstFormElement) {
575
- firstFormElement.focus()
576
- }
577
- }
578
- })
579
- }
580
- },
581
- watch: {
582
- openCollapsedBox() {
583
- // toggle collapse-status of all boxes if changed in outer component
584
- if (this.collapsible) {
585
- this.open = this.openCollapsedBox
586
- this.setFocus()
587
- }
588
- },
589
- open() {
590
- this.setFocus()
591
- }
592
- }
593
- }
594
- </script>
595
-
596
- <style>
597
- /* begin cmd-box ---------------------------------------------------------------------------------------- */
598
- .cmd-box {
599
- display: inline-flex;
600
- flex-direction: column;
601
- padding: 0;
602
- align-self: start;
603
-
604
- &.stretch-horizontally {
605
- display: flex;
606
- width: 100%;
607
- }
608
-
609
- &.stretch-vertically {
610
- align-self: auto;
611
- }
612
-
613
- .box-header {
614
- overflow: hidden; /* hide edges of optional badges */
615
-
616
- .cmd-headline {
617
- margin-bottom: 0;
618
- text-decoration: none;
619
-
620
- &:only-child {
621
- width: 100% /* stretch in flex-container */
622
- }
623
- }
624
- }
625
-
626
- &:has(.cmd-image) {
627
- align-self: auto !important; /* overwrite settings form frontend-framework */
628
- }
629
-
630
- &:has(> .cmd-image:only-child) {
631
- align-self: start !important;
632
- }
633
-
634
- /* collapsible box only */
635
- &.collapsible {
636
- a.box-header {
637
- justify-content: space-between;
638
- background: var(--box-header-background);
639
- border-radius: var(--box-border-radius);
640
- border-bottom: 0;
641
-
642
- &:hover, &:active, &:focus {
643
- background: var(--color-white);
644
-
645
- * {
646
- color: var(--hyperlink-color);
647
- }
648
- }
649
- }
650
-
651
- .box-body {
652
- border-top: var(--box-border);
653
- }
654
- }
655
-
656
- > .box-body:first-child {
657
- border-top: 0 !important;
658
- }
659
-
660
- .box-body {
661
- .allow-scroll {
662
- overflow-y: auto;
663
-
664
- & * {
665
- flex-shrink: 0;
666
- }
667
- }
668
- }
669
-
670
- /* boyType === 'content' */
671
- &.content {
672
- > * {
673
- *:last-child {
674
- margin-bottom: 0;
675
- }
676
- }
677
-
678
- &.open {
679
- > .box-header {
680
- border-bottom-left-radius: 0;
681
- border-bottom-right-radius: 0;
682
- }
683
-
684
- fieldset {
685
- border: 0;
686
- padding: var(--default-padding);
687
- }
688
- }
689
-
690
- > .box-header {
691
- text-decoration: none;
692
-
693
- > .cmd-custom-headline {
694
- margin-bottom: 0;
695
- }
696
-
697
- * {
698
- color: var(--box-header-text-color);
699
- margin-bottom: 0;
700
- }
701
-
702
- > .toggle-icon {
703
- margin-left: auto;
704
- }
705
-
706
- > .toggle-icon, .toggle-icon > [class*="icon-"] {
707
- font-size: var(--font-size-small);
708
- }
709
- }
710
-
711
- .box-body {
712
- display: flex;
713
- flex-grow: 1;
714
-
715
- .box-body-padding {
716
- padding: var(--box-body-padding);
717
- }
718
-
719
- & > div:only-child {
720
- flex-grow: 1;
721
- }
722
-
723
- .body-icon-wrapper {
724
- display: flex;
725
- justify-content: center;
726
- margin-bottom: var(--default-margin);
727
-
728
- span[class*="icon"] {
729
- font-size: 8rem;
730
- }
731
- }
732
-
733
- p.cutoff-text {
734
- padding: var(--default-padding);
735
- margin: 0;
736
- overflow: hidden;
737
- height: calc(var(--line-of-text-height) * v-bind(cutoffTextLines));
738
-
739
- &.fade-last-line::after {
740
- content: "";
741
- width: 100%;
742
- position: absolute;
743
- left: 0;
744
- bottom: 0;
745
- height: calc(var(--line-of-text-height) * 3);
746
- background: linear-gradient(to bottom, transparent 0%, var(--default-background) 100%);
747
- }
748
-
749
- &.show-text {
750
- height: auto;
751
- }
752
-
753
- & + a {
754
- border-top: var(--box-border);
755
- display: block;
756
- padding: var(--default-padding);
757
- margin: 0;
758
- }
759
- }
760
-
761
- img {
762
- display: block;
763
- border-radius: 0;
764
- }
765
-
766
- .inner-box-body-wrapper {
767
- & > * {
768
- border-radius: 0;
769
- }
770
-
771
- &:has(figure:only-child) {
772
- border-bottom-left-radius: var(--box-border-radius);
773
- border-bottom-right-radius: var(--box-border-radius);
774
-
775
- img {
776
- border-radius: inherit;
777
- }
778
- }
779
- }
780
-
781
- .navigation {
782
- margin: 0;
783
- height: 100%;
784
-
785
- li {
786
- list-style-type: none;
787
- margin: 0;
788
-
789
- a {
790
- display: block;
791
- padding: var(--default-padding);
792
- text-decoration: none;
793
- border-bottom: var(--box-border);
794
-
795
- &:hover, &:active, &:focus {
796
- background: var(--primary-color);
797
- color: var(--color-white);
798
- }
799
- }
800
-
801
- &:last-child {
802
- a {
803
- border: 0;
804
- }
805
- }
806
- }
807
- }
808
- }
809
- }
810
-
811
- /* boyType === 'product' and boxType === 'user' */
812
- &.product, &.user {
813
- > div {
814
- > .cmd-custom-headline {
815
- margin-top: var(--default-margin);
816
- justify-content: center;
817
- }
818
- }
819
- }
820
-
821
- /* boyType === 'product' */
822
- &.product {
823
- text-decoration: none;
824
- overflow: hidden;
825
-
826
- [class*="ribbon"] {
827
- position: absolute;
828
- z-index: 10;
829
- overflow: hidden;
830
- width: 10rem;
831
- height: 10rem;
832
- top: 0;
833
- left: 0;
834
-
835
- span {
836
- position: absolute;
837
- display: block;
838
- transform: rotate(-45deg);
839
- width: 100%;
840
- top: 15%;
841
- left: -25%;
842
- background: var(--error-color);
843
- font-weight: bold;
844
- color: var(--color-white);
845
- text-transform: uppercase;
846
- text-align: center;
847
- }
848
- }
849
-
850
- .ribbon-discount {
851
- left: auto;
852
- right: 0;
853
-
854
- span {
855
- transform: rotate(45deg);
856
- right: -20%;
857
- left: auto;
858
- background: green;
859
- }
860
- }
861
-
862
- > .box-header {
863
- padding: 0;
864
-
865
- > img, > div {
866
- display: table;
867
- margin: 0 auto;
868
- }
869
-
870
- img {
871
- border: 0;
872
- border-bottom-left-radius: 0;
873
- border-bottom-right-radius: 0;
874
- }
875
- }
876
-
877
- .box-body {
878
- flex-grow: 1;
879
- padding: var(--default-padding);
880
-
881
- > * {
882
- text-align: center;
883
-
884
- &:last-child {
885
- margin-bottom: 0;
886
- }
887
- }
888
-
889
- .price {
890
- font-size: 1.8rem;
891
- font-weight: bold;
892
-
893
- span:last-child {
894
- margin-left: calc(var(--default-margin) / 2);
895
- }
896
- }
897
- }
898
-
899
- &:hover, &:active, &:focus {
900
- border-color: var(--hyperlink-color-highlighted);
901
- }
902
-
903
-
904
- &.row-view {
905
- flex-direction: row;
906
- align-items: center;
907
- }
908
- }
909
-
910
- /* boxType === 'user' */
911
- &.user {
912
- --box-header-padding: var(--default-padding);
913
-
914
- .user-name {
915
- color: var(--color-scheme-text-color);
916
- font-size: 2rem;
917
- font-weight: bold;
918
- }
919
-
920
- .user-age {
921
- font-size: var(--default-font-size);
922
- }
923
-
924
- > .box-header {
925
- --default-icon-size: 6rem;
926
- --box-header-text-color: var(--primary-color);
927
-
928
- background: none;
929
- gap: calc(var(--default-gap) / 2);
930
-
931
- > div:first-child > [class*="icon-"] {
932
- aspect-ratio: 1/1;
933
- }
934
-
935
- img {
936
- margin: 0 auto var(--default-margin) auto;
937
-
938
- & + p, & + figcaption {
939
- margin: 0 auto;
940
- text-align: center;
941
- font-weight: bold;
942
- font-size: 2rem;
943
- }
944
- }
945
-
946
- img, .no-user-image {
947
- padding: 0;
948
- width: calc(var(--default-icon-size) * 2);
949
- aspect-ratio: 1/1;
950
- max-width: 12rem;
951
- border-radius: var(--full-circle);
952
- background: var(--box-header-background);
953
- display: flex;
954
- color: var(--color-white);
955
- justify-content: center;
956
- align-items: center;
957
- font-size: var(--default-icon-size);
958
- }
959
-
960
- .no-user-image {
961
- background: var(--default-background);
962
- border: var(--image-border);
963
- box-shadow: var(--image-box-shadow);
964
- }
965
- }
966
-
967
- .box-body {
968
- flex-grow: 1;
969
- padding: var(--default-padding);
970
-
971
- border-bottom: 0;
972
-
973
- p {
974
- text-align: center;
975
- font-weight: bold;
976
-
977
- &:last-child {
978
- margin-bottom: 0;
979
- }
980
-
981
- &.description {
982
- font-weight: normal;
983
- }
984
- }
985
- }
986
-
987
- .box-footer {
988
- margin-top: auto;
989
- padding: 0;
990
- border-top: var(--box-border);
991
-
992
- .cmd-list {
993
- ul {
994
- width: 100%;
995
- margin-bottom: 0;
996
-
997
- li {
998
- flex: 1;
999
- border-radius: var(--box-border-radius);
1000
- border-top-left-radius: 0;
1001
- border-top-right-radius: 0;
1002
-
1003
- &:not(:only-child) {
1004
- border-bottom-left-radius: 0;
1005
- border-bottom-right-radius: 0;
1006
-
1007
- &:first-child {
1008
- border-bottom-left-radius: var(--box-border-radius);
1009
- }
1010
-
1011
- &:last-child {
1012
- border-bottom-right-radius: var(--box-border-radius);
1013
- }
1014
- }
1015
-
1016
- a {
1017
- flex: 1;
1018
- padding: var(--default-padding);
1019
- text-align: center;
1020
- background: var(--color-scheme-background);
1021
- border-left: var(--box-border);
1022
- border-radius: inherit;
1023
- line-height: 100%;
1024
- }
1025
-
1026
- .cmd-link:has(span[class*="icon-"]) {
1027
- justify-content: center;
1028
- }
1029
-
1030
- &:hover, &:active, &:focus {
1031
- a {
1032
- background: var(--primary-color);
1033
- color: var(--color-white);
1034
-
1035
- span, [class*="icon-"] {
1036
- color: var(--color-white);
1037
- }
1038
- }
1039
- }
1040
-
1041
- &:first-child {
1042
- a {
1043
- border: 0;
1044
- }
1045
- }
1046
- }
1047
- }
1048
- }
1049
- }
1050
-
1051
- &.row-view {
1052
- .box-header {
1053
- border: 0;
1054
- }
1055
-
1056
- .box-body {
1057
- padding: 0;
1058
-
1059
- p {
1060
- text-align: left;
1061
- }
1062
- }
1063
-
1064
- .box-footer {
1065
- border: 0;
1066
- background: none;
1067
-
1068
- .cmd-list-of-links {
1069
- background: none;
1070
-
1071
- ul li {
1072
- aspect-ratio: 1/1;
1073
- border-radius: var(--box-border-radius) !important; /* overwrite settings from default-/column-view */
1074
- }
1075
-
1076
- ul, ul * {
1077
- border: 0;
1078
- background: inherit;
1079
- }
1080
- }
1081
- }
1082
- }
1083
- }
1084
- }
1085
-
1086
- /* end cmd-box ------------------------------------------------------------------------------------------ */
1
+ <template>
2
+ <!-- begin CmdBox ---------------------------------------------------------------------------------------- -->
3
+ <!-- begin boxType 'content' -->
4
+ <div v-if="boxType === 'content'"
5
+ ref="cmdBox"
6
+ :class="[
7
+ 'cmd-box box content',
8
+ {
9
+ open : open, collapsible: collapsible,
10
+ 'stretch-vertically': stretchVertically && !collapsible,
11
+ 'stretch-horizontally': stretchHorizontally,
12
+ 'row-view': rowView
13
+ },
14
+ ]"
15
+ >
16
+ <!-- begin collapsible header with slot -->
17
+ <a v-if="collapsible"
18
+ href="#"
19
+ class="box-header"
20
+ :title="open ? iconOpen.tooltip : iconClosed.tooltip"
21
+ @click.prevent="toggleContentVisibility"
22
+ >
23
+ <!-- begin slot 'header' -->
24
+ <slot v-if="useSlots?.includes('header')" name="header"></slot>
25
+ <!-- end slot 'header' -->
26
+
27
+ <!-- begin CmdHeadline -->
28
+ <CmdHeadline
29
+ v-else-if="cmdHeadline?.headlineText && headlinePosition === 'header'"
30
+ v-bind="cmdHeadline"
31
+ />
32
+ <!-- end CmdHeadline -->
33
+
34
+ <!-- begin CmdIcon -->
35
+ <CmdIcon
36
+ :iconClass="open ? iconOpen.iconClass : iconClosed.iconClass"
37
+ :type="open ? iconOpen.iconType : iconClosed.iconType"
38
+ />
39
+ <!-- end CmdIcon -->
40
+ </a>
41
+ <!-- end collapsible header with slot -->
42
+
43
+ <!-- begin default header with slot -->
44
+ <template v-else>
45
+ <div v-if="useSlots?.includes('header') || (cmdHeadline?.headlineText && headlinePosition === 'header')" class="box-header">
46
+ <!-- begin slot 'header' -->
47
+ <slot v-if="useSlots?.includes('header')" name="header"></slot>
48
+ <!-- end slot 'header' -->
49
+
50
+ <!-- begin CmdHeadline -->
51
+ <CmdHeadline
52
+ v-if="cmdHeadline?.headlineText && headlinePosition === 'header'"
53
+ v-bind="cmdHeadline"
54
+ />
55
+ <!-- end CmdHeadline -->
56
+ </div>
57
+ </template>
58
+ <!-- end default header with slot -->
59
+
60
+ <!-- begin box-body -->
61
+ <div :class="['box-body', boxBodyClass]" aria-expanded="true" role="article">
62
+ <!-- begin content given slot -->
63
+ <div v-if="useSlots?.includes('body')"
64
+ class="inner-box-body-wrapper"
65
+ :class="{'box-body-padding': useBoxBodyPadding, 'allow-scroll': allowContentToScroll}"
66
+ :tabindex="allowContentToScroll ? 0 : null"
67
+ ref="boxBody"
68
+ :style="allowContentToScroll ? 'max-height: ' + calculatedBodyHeight : null"
69
+ >
70
+ <!-- begin slot 'body' -->
71
+ <slot name="body">
72
+ <!-- begin CmdHeadline -->
73
+ <CmdHeadline
74
+ v-if="cmdHeadline?.headlineText && headlinePosition === 'body'"
75
+ v-bind="cmdHeadline"
76
+ />
77
+ <!-- end CmdHeadline -->
78
+
79
+ <div v-if="cmdIcon !== undefined" class="body-icon-wrapper">
80
+ <!-- begin CmdIcon -->
81
+ <CmdIcon :iconClass="cmdIcon.iconClass" :type="cmdIcon.type" />
82
+ <!-- end CmdIcon -->
83
+ </div>
84
+
85
+ <transition-group :name="toggleTransition">
86
+ <!-- begin textBody -->
87
+ <div
88
+ v-if="textBody"
89
+ :class="{
90
+ 'cutoff-text': cutoffTextLines > 0,
91
+ 'fade-last-line': fadeLastLine && !showCutOffText,
92
+ 'show-text' : showCutOffText
93
+ }"
94
+ v-html='textBody'
95
+ >
96
+ </div>
97
+ <!-- end textBody -->
98
+
99
+ <a v-if="cutoffTextLines > 0" href="#" @click.prevent="toggleCutOffText">
100
+ {{
101
+ showCutOffText ? getMessage("box.contentbox.collapse_text") : getMessage("box.contentbox.expand_text")
102
+ }}
103
+ </a>
104
+ </transition-group>
105
+ </slot>
106
+ <!-- end slot 'body' -->
107
+ </div>
108
+ <!-- end content given slot -->
109
+
110
+ <!-- begin content given by properties -->
111
+ <div v-else
112
+ class="inner-box-body-wrapper"
113
+ :class="{'allow-scroll': allowContentToScroll}"
114
+ :tabindex="allowContentToScroll ? 0 : null"
115
+ >
116
+ <!-- begin CmdImage -->
117
+ <CmdImage v-if="cmdImage" v-bind="cmdImage" />
118
+ <!-- end CmdImage -->
119
+
120
+ <div v-if="cmdHeadline?.headlineText && headlinePosition === 'body' || textBody"
121
+ :class="{'box-body-padding': useBoxBodyPadding, 'allow-scroll': allowContentToScroll}"
122
+ :tabindex="allowContentToScroll ? 0 : null">
123
+ <div v-if="cmdIcon !== undefined" class="body-icon-wrapper">
124
+ <!-- begin CmdIcon -->
125
+ <CmdIcon v-bind="cmdIcon" />
126
+ <!-- end CmdIcon -->
127
+ </div>
128
+
129
+ <!-- begin CmdHeadline -->
130
+ <CmdHeadline
131
+ v-if="cmdHeadline?.headlineText && headlinePosition === 'body'"
132
+ v-bind="cmdHeadline"
133
+ />
134
+ <!-- end CmdHeadline -->
135
+
136
+ <!-- begin textBody -->
137
+ <p v-if="textBody" v-html="textBody"></p>
138
+ <!-- end textBody -->
139
+ </div>
140
+ </div>
141
+ <!-- end content given by properties -->
142
+ </div>
143
+ <!-- end box-body -->
144
+
145
+ <!-- begin additionalLink in box-footer -->
146
+ <div v-if="cmdLink?.linkType" class="box-footer">
147
+ <CmdLink v-bind="cmdLink" />
148
+ </div>
149
+ <!-- end additionalLink in box-footer -->
150
+
151
+ <div v-if="useSlots?.includes('footer')" class="box-footer">
152
+ <!-- begin slot 'footer' -->
153
+ <slot name="footer"></slot>
154
+ <!-- end slot 'footer' -->
155
+ </div>
156
+ </div>
157
+ <!-- end boxType 'content' -->
158
+
159
+ <!-- begin boxType 'product' -->
160
+ <a v-else-if="boxType === 'product' && product"
161
+ :class="['cmd-box box product', {'stretch-vertically': stretchVertically, 'stretch-horizontally': stretchHorizontally, 'row-view': rowView}]"
162
+ href="#"
163
+ @click.prevent="clickOnProduct(product)">
164
+ <div class="box-header flex-container vertical">
165
+ <CmdImage v-if="product.image?.src" v-bind="{image:{...product.image}}" />
166
+
167
+ <!-- begin ribbons -->
168
+ <div v-if="product.new" class="ribbon-new">
169
+ <span>{{ getMessage("box.productbox.new") }}</span>
170
+ </div>
171
+ <div v-if="product.discount" class="ribbon-discount">
172
+ <span>{{ product.discount }}</span>
173
+ </div>
174
+ <!-- end ribbons -->
175
+ </div>
176
+ <!-- begin box-body -->
177
+ <div class="box-body">
178
+ <p v-if="product.articleNumber">{{ getMessage("box.productbox.article_no") }} {{
179
+ product.articleNumber
180
+ }}</p>
181
+ <p v-if="product.price" class="price">
182
+ <span>{{ product.price }}</span><span :title="globalCurrency.name">{{ globalCurrency.symbol }}</span>
183
+ </p>
184
+ <p v-if="product.description">{{ product.description }}</p>
185
+ </div>
186
+ <!-- end box-body -->
187
+ </a>
188
+ <!-- end boxType 'product' -->
189
+
190
+ <!-- begin boxType 'user' -->
191
+ <div v-else-if="boxType === 'user' && user"
192
+ :class="[
193
+ 'cmd-box box user',
194
+ profileType,
195
+ {
196
+ 'stretch-vertically': stretchVertically,
197
+ 'stretch-horizontally': stretchHorizontally,
198
+ 'row-view': rowView
199
+ }
200
+ ]">
201
+ <!-- begin box-header -->
202
+ <div class="box-header flex-container vertical">
203
+ <!-- begin user-image -->
204
+ <figure v-if="user.image?.src">
205
+ <img :src="user.image.src" :alt="user.image.alt"/>
206
+ <figcaption v-if="!rowView" class="user-name">
207
+ {{ user.name }}
208
+ <span v-if="user.age" class="user-age">
209
+ ({{ user.age }})
210
+ </span>
211
+ </figcaption>
212
+ </figure>
213
+ <!-- end no user-image -->
214
+
215
+ <!-- begin no user-image -->
216
+ <template v-else>
217
+ <div class="no-user-image">
218
+ <CmdIcon
219
+ :iconClass="iconUserProfile.iconClass"
220
+ :type="iconUserProfile.iconType"
221
+ :title="user.name"
222
+ />
223
+ </div>
224
+ <p v-if="!rowView" class="user-name">
225
+ {{ user.name }}
226
+ <span v-if="user.age" class="user-age">
227
+ ({{ user.age }})
228
+ </span>
229
+ </p>
230
+ </template>
231
+ <!-- end no user-image -->
232
+ </div>
233
+ <!-- end box-header -->
234
+
235
+ <!-- begin box-body -->
236
+ <div class="box-body">
237
+ <p v-if="rowView" class="user-name">{{ user.name }}</p>
238
+ <p v-if="user.profession">{{ user.profession }}</p>
239
+ <p v-if="user.position">{{ user.position }}</p>
240
+ <p v-if="user.description" class="description">{{ user.description }}</p>
241
+ </div>
242
+ <!-- end box-body -->
243
+
244
+ <!-- begin user-tags -->
245
+ <ul v-if="user.tags && user.tags.length" class="tags">
246
+ <li v-for="(tag, index) in user.tags" :key="index">
247
+ {{ tag }}
248
+ </li>
249
+ </ul>
250
+ <!-- end user-tags -->
251
+
252
+ <!-- begin box-footer -->
253
+ <div v-if="user.links && user.links.length" class="box-footer">
254
+ <CmdList :items="user.links" orientation="horizontal" :useGap="false"/>
255
+ </div>
256
+ <!-- end box-footer -->
257
+ </div>
258
+ <!-- end boxType 'user' -->
259
+ <!-- end CmdBox ---------------------------------------------------------------------------------------- -->
260
+ </template>
261
+
262
+ <script>
263
+ // import mixins
264
+ import I18n from "../mixins/I18n"
265
+ import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
266
+ import GlobalCurrency from "../mixins/GlobalCurrency"
267
+
268
+ export default {
269
+ name: "CmdBox",
270
+ mixins: [
271
+ I18n,
272
+ DefaultMessageProperties,
273
+ GlobalCurrency
274
+ ],
275
+ emits: ["click", "toggle-collapse", "toggle-cutofftext"],
276
+ data() {
277
+ return {
278
+ open: this.collapsible ? this.openCollapsedBox : true,
279
+ active: true,
280
+ showCutOffText: false,
281
+ calculatedBodyHeight: this.maxBoxBodyHeight
282
+ }
283
+ },
284
+ props: {
285
+ /**
286
+ * activate to set a collapsible box to open
287
+ */
288
+ openCollapsedBox: {
289
+ type: Boolean,
290
+ required: false
291
+ },
292
+ /**
293
+ * arranges box-content in a row
294
+ *
295
+ * @affectsStyling: true
296
+ */
297
+ rowView: {
298
+ type: Boolean,
299
+ default: false
300
+ },
301
+ /**
302
+ * set type to show different types of boxes/contents
303
+ *
304
+ * @allowedValues: content, product, user
305
+ * @affectsStyling: true
306
+ */
307
+ boxType: {
308
+ type: String,
309
+ default: "content",
310
+ validator(value) {
311
+ return value === "content" ||
312
+ value === "product" ||
313
+ value === "user"
314
+ }
315
+ },
316
+ /**
317
+ * set if content (in box-body) should scroll
318
+ *
319
+ * (maxBoxBodyHeight must be set)
320
+ */
321
+ allowContentToScroll: {
322
+ type: Boolean,
323
+ default: false
324
+ },
325
+ /**
326
+ * set max-height for body (should only be used if allowContentToScroll-property is active)
327
+ */
328
+ maxBoxBodyHeight: {
329
+ type: String,
330
+ default: "20rem"
331
+ },
332
+ /**
333
+ * activate if box should be collapsible
334
+ */
335
+ collapsible: {
336
+ type: Boolean,
337
+ default: false
338
+ },
339
+ /**
340
+ * number of lines to show if text should be cutoff
341
+ */
342
+ cutoffTextLines: {
343
+ type: Number,
344
+ default: 0
345
+ },
346
+ /**
347
+ * deactivate if no default-padding should be used (has no effect on content given by textBody-property)
348
+ *
349
+ * @affectsStyling: true
350
+ */
351
+ useBoxBodyPadding: {
352
+ type: Boolean,
353
+ default: true
354
+ },
355
+ /**
356
+ * show fade-effect on last line
357
+ *
358
+ * cutoffTextLines-property must be large 0
359
+ */
360
+ fadeLastLine: {
361
+ type: Boolean,
362
+ default: false
363
+ },
364
+ /**
365
+ * use transition to expand and collapse box-body
366
+ *
367
+ * 'boyType-property' must be set to 'content' and 'collapsible-property' must be activated
368
+ */
369
+ useTransition: {
370
+ type: Boolean,
371
+ default: true
372
+ },
373
+ /**
374
+ * custom class placed on box-body-container
375
+ */
376
+ boxBodyClass: {
377
+ type: String,
378
+ required: false
379
+ },
380
+ /**
381
+ * the shown product (incl. name, price, image, description)
382
+ *
383
+ * @required: only available for boxtype===product
384
+ */
385
+ product: {
386
+ type: Object,
387
+ required: false
388
+ },
389
+ /**
390
+ * the shown user-profile (incl. name, image, contact-data)
391
+ *
392
+ * @required: only available for boxtype===user
393
+ */
394
+ user: {
395
+ type: Object,
396
+ required: false
397
+ },
398
+ /**
399
+ * profile types for user-boxes
400
+ *
401
+ * @required: only available for boxtype===user
402
+ *
403
+ * @allowedValues: 'business', 'influencer', 'material-web'
404
+ */
405
+ profileType: {
406
+ type: String,
407
+ default: "business",
408
+ validator(value) {
409
+ return value === "business" ||
410
+ value === "influencer" ||
411
+ value === "material-web"
412
+ }
413
+ },
414
+ /**
415
+ * activated if all content (incl. headline) is given by slot
416
+ *
417
+ * if false textBody-property must be set
418
+ */
419
+ useSlots: {
420
+ type: Array,
421
+ required: false
422
+ },
423
+ /**
424
+ * image-object for box-body of content-box
425
+ *
426
+ * properties for CmdImage-component
427
+ */
428
+ cmdImage: {
429
+ type: Object,
430
+ required: false
431
+ },
432
+ /**
433
+ * String used as content (placed in a paragraph-tag) for box-body
434
+ *
435
+ * should only be used, if no further html-structure is required for box-body
436
+ *
437
+ * @canContainHtml: true
438
+ */
439
+ textBody: {
440
+ type: String,
441
+ default: ""
442
+ },
443
+ /**
444
+ * icon for user-profile if no user-image exists
445
+ *
446
+ * {
447
+ * iconClass: string,
448
+ * iconType: string
449
+ * }
450
+ * @requiredForAccessibility: partial
451
+ */
452
+ iconUserProfile: {
453
+ type: Object,
454
+ default: function () {
455
+ return {
456
+ iconClass: "icon-user-profile",
457
+ iconType: "auto"
458
+ }
459
+ }
460
+ },
461
+ /**
462
+ * icon to expand an accordion
463
+ *
464
+ * @requiredForAccessibility: partial
465
+ */
466
+ iconOpen: {
467
+ type: Object,
468
+ default: function () {
469
+ return {
470
+ iconClass: "icon-chevron-one-stripe-up",
471
+ tooltip: "Close content",
472
+ iconType: "auto"
473
+ }
474
+ }
475
+ },
476
+ /**
477
+ * icon to collapse an accordion
478
+ *
479
+ * @requiredForAccessibility: partial
480
+ */
481
+ iconClosed: {
482
+ type: Object,
483
+ default: function () {
484
+ return {
485
+ iconClass: "icon-chevron-one-stripe-down",
486
+ tooltip: "Show content",
487
+ iconType: "auto"
488
+ }
489
+ }
490
+ },
491
+ /**
492
+ * allow box to be stretched as wide as parent-element
493
+ */
494
+ stretchHorizontally: {
495
+ type: Boolean,
496
+ default: true
497
+ },
498
+ /**
499
+ * allow box to be stretched as high as parent-element
500
+ */
501
+ stretchVertically: {
502
+ type: Boolean,
503
+ default: true
504
+ },
505
+ /**
506
+ * position of headline
507
+ *
508
+ * cmdHeadline-property must be set
509
+ */
510
+ headlinePosition: {
511
+ type: String,
512
+ default: "header",
513
+ validator(value) {
514
+ return value === "header" || value === "body"
515
+ }
516
+ },
517
+ /**
518
+ * properties for CmdHeadline-component
519
+ */
520
+ cmdHeadline: {
521
+ type: Object,
522
+ required: false
523
+ },
524
+ /**
525
+ * properties for CmdLink-component to set additional link at bottom of box
526
+ */
527
+ cmdLink: {
528
+ type: Object,
529
+ default: {}
530
+ },
531
+ /**
532
+ * properties for CmdIcon-component to set large icon in box-body
533
+ */
534
+ cmdIcon: {
535
+ type: Object,
536
+ required: false
537
+ }
538
+ },
539
+ /*
540
+ mounted() {
541
+ if (this.allowContentToScroll && this.$refs.boxBody) {
542
+ const topPosition = this.$refs.boxBody.getBoundingClientRect().top
543
+ this.calculatedBodyHeight = (document.documentElement.clientHeight - topPosition) + "px"
544
+ }
545
+ },*/
546
+ computed: {
547
+ toggleTransition() {
548
+ if (this.useTransition) {
549
+ return "fade"
550
+ }
551
+ return ""
552
+ }
553
+ },
554
+ methods: {
555
+ // for collapsible boxes of boxType === content
556
+ toggleContentVisibility() {
557
+ this.open = !this.open
558
+ this.active = !this.active
559
+
560
+ this.$emit("toggle-collapse", this.open)
561
+ },
562
+ // toggle cutofftext (between full and faded text)
563
+ toggleCutOffText() {
564
+ this.showCutOffText = !this.showCutOffText
565
+ this.$emit("toggle-cutofftext", this.showCutOffText)
566
+ },
567
+ // for boxType === product
568
+ clickOnProduct(product) {
569
+ this.$emit("click", product)
570
+ },
571
+ // set focus on first input if box contains form-elements
572
+ setFocus() {
573
+ this.$nextTick(() => {
574
+ if (this.open) {
575
+ const firstFormElement = this.$refs.cmdBox.querySelector(":is(input, select, textarea):first-of-type")
576
+
577
+ if (firstFormElement) {
578
+ firstFormElement.focus()
579
+ }
580
+ }
581
+ })
582
+ }
583
+ },
584
+ watch: {
585
+ openCollapsedBox() {
586
+ // toggle collapse-status of all boxes if changed in outer component
587
+ if (this.collapsible) {
588
+ this.open = this.openCollapsedBox
589
+ this.setFocus()
590
+ }
591
+ },
592
+ open() {
593
+ this.setFocus()
594
+ }
595
+ }
596
+ }
597
+ </script>
598
+
599
+ <style>
600
+ /* begin cmd-box ---------------------------------------------------------------------------------------- */
601
+ .cmd-box {
602
+ display: inline-flex;
603
+ flex-direction: column;
604
+ padding: 0;
605
+ align-self: start;
606
+
607
+ &.stretch-horizontally {
608
+ display: flex;
609
+ width: 100%;
610
+ }
611
+
612
+ &.stretch-vertically {
613
+ align-self: auto;
614
+ }
615
+
616
+ .box-header {
617
+ overflow: hidden; /* hide edges of optional badges */
618
+
619
+ .cmd-headline {
620
+ margin-bottom: 0;
621
+ text-decoration: none;
622
+
623
+ &:only-child {
624
+ width: 100% /* stretch in flex-container */
625
+ }
626
+ }
627
+ }
628
+
629
+ &:has(.cmd-image) {
630
+ align-self: auto !important; /* overwrite settings form frontend-framework */
631
+ }
632
+
633
+ &:has(> .cmd-image:only-child) {
634
+ align-self: start !important;
635
+ }
636
+
637
+ /* collapsible box only */
638
+ &.collapsible {
639
+ a.box-header {
640
+ justify-content: space-between;
641
+ background: var(--box-header-background);
642
+ border-radius: var(--box-border-radius);
643
+ border-bottom: 0;
644
+
645
+ &:hover, &:active, &:focus {
646
+ background: var(--color-scheme-background);
647
+
648
+ * {
649
+ color: var(--hyperlink-color);
650
+ }
651
+ }
652
+ }
653
+
654
+ &.stretch-vertically {
655
+ align-self: flex-start;
656
+ }
657
+
658
+ .box-body {
659
+ display: none;
660
+ border-top: var(--box-border);
661
+ }
662
+ }
663
+
664
+ > .box-body:first-child {
665
+ border-top: 0 !important;
666
+ }
667
+
668
+ .box-body {
669
+ .allow-scroll {
670
+ overflow-y: auto;
671
+
672
+ & * {
673
+ flex-shrink: 0;
674
+ }
675
+ }
676
+ }
677
+
678
+ /* boyType === 'content' */
679
+ &.content {
680
+ > * {
681
+ *:last-child {
682
+ margin-bottom: 0;
683
+ }
684
+ }
685
+
686
+ &.open {
687
+ > .box-header {
688
+ border-bottom-left-radius: 0;
689
+ border-bottom-right-radius: 0;
690
+ }
691
+
692
+ fieldset {
693
+ border: 0;
694
+ padding: var(--default-padding);
695
+ }
696
+
697
+ .box-body {
698
+ display: flex;
699
+ }
700
+ }
701
+
702
+ > .box-header {
703
+ text-decoration: none;
704
+
705
+ > .cmd-custom-headline {
706
+ margin-bottom: 0;
707
+ }
708
+
709
+ * {
710
+ color: var(--box-header-text-color);
711
+ margin-bottom: 0;
712
+ }
713
+
714
+ > .toggle-icon {
715
+ margin-left: auto;
716
+ }
717
+
718
+ > .toggle-icon, .toggle-icon > [class*="icon-"] {
719
+ font-size: var(--font-size-small);
720
+ }
721
+ }
722
+
723
+ .box-body {
724
+ flex-grow: 1;
725
+
726
+ .box-body-padding {
727
+ padding: var(--box-body-padding);
728
+ }
729
+
730
+ & > div:only-child {
731
+ flex-grow: 1;
732
+ }
733
+
734
+ .body-icon-wrapper {
735
+ display: flex;
736
+ justify-content: center;
737
+ margin-bottom: var(--default-margin);
738
+
739
+ span[class*="icon"] {
740
+ font-size: 8rem;
741
+ }
742
+ }
743
+
744
+ p.cutoff-text {
745
+ padding: var(--default-padding);
746
+ margin: 0;
747
+ overflow: hidden;
748
+ height: calc(var(--line-of-text-height) * v-bind(cutoffTextLines));
749
+
750
+ &.fade-last-line::after {
751
+ content: "";
752
+ width: 100%;
753
+ position: absolute;
754
+ left: 0;
755
+ bottom: 0;
756
+ height: calc(var(--line-of-text-height) * 3);
757
+ background: linear-gradient(to bottom, transparent 0%, var(--color-scheme-background-subtle) 100%);
758
+ }
759
+
760
+ &.show-text {
761
+ height: auto;
762
+ }
763
+
764
+ & + a {
765
+ border-top: var(--box-border);
766
+ display: block;
767
+ padding: var(--default-padding);
768
+ margin: 0;
769
+ }
770
+ }
771
+
772
+ img {
773
+ display: block;
774
+ border-radius: 0;
775
+ }
776
+
777
+ .inner-box-body-wrapper {
778
+ & > * {
779
+ border-radius: 0;
780
+ }
781
+
782
+ &:has(figure:only-child) {
783
+ border-bottom-left-radius: var(--box-border-radius);
784
+ border-bottom-right-radius: var(--box-border-radius);
785
+
786
+ img {
787
+ border-radius: inherit;
788
+ }
789
+ }
790
+ }
791
+
792
+ .navigation {
793
+ margin: 0;
794
+ height: 100%;
795
+
796
+ li {
797
+ list-style-type: none;
798
+ margin: 0;
799
+
800
+ a {
801
+ display: block;
802
+ padding: var(--default-padding);
803
+ text-decoration: none;
804
+ border-bottom: var(--box-border);
805
+
806
+ &:hover, &:active, &:focus {
807
+ background: var(--primary-color);
808
+ color: var(--primary-color-contrast-text);
809
+ }
810
+ }
811
+
812
+ &:last-child {
813
+ a {
814
+ border: 0;
815
+ }
816
+ }
817
+ }
818
+ }
819
+ }
820
+ }
821
+
822
+ /* boyType === 'product' and boxType === 'user' */
823
+ &.product, &.user {
824
+ > div {
825
+ > .cmd-custom-headline {
826
+ margin-top: var(--default-margin);
827
+ justify-content: center;
828
+ }
829
+ }
830
+ }
831
+
832
+ /* boyType === 'product' */
833
+ &.product {
834
+ text-decoration: none;
835
+ overflow: hidden;
836
+
837
+ [class*="ribbon"] {
838
+ position: absolute;
839
+ z-index: 10;
840
+ overflow: hidden;
841
+ width: 10rem;
842
+ height: 10rem;
843
+ top: 0;
844
+ left: 0;
845
+
846
+ span {
847
+ position: absolute;
848
+ display: block;
849
+ transform: rotate(-45deg);
850
+ width: 100%;
851
+ top: 15%;
852
+ left: -25%;
853
+ background: var(--error-color);
854
+ font-weight: bold;
855
+ color: var(--color-white);
856
+ text-transform: uppercase;
857
+ text-align: center;
858
+ }
859
+ }
860
+
861
+ .ribbon-discount {
862
+ left: auto;
863
+ right: 0;
864
+
865
+ span {
866
+ transform: rotate(45deg);
867
+ right: -20%;
868
+ left: auto;
869
+ background: green;
870
+ }
871
+ }
872
+
873
+ > .box-header {
874
+ padding: 0;
875
+
876
+ > img, > div {
877
+ display: table;
878
+ margin: 0 auto;
879
+ }
880
+
881
+ img {
882
+ border: 0;
883
+ border-bottom-left-radius: 0;
884
+ border-bottom-right-radius: 0;
885
+ }
886
+ }
887
+
888
+ .box-body {
889
+ flex-grow: 1;
890
+ padding: var(--default-padding);
891
+
892
+ > * {
893
+ text-align: center;
894
+
895
+ &:last-child {
896
+ margin-bottom: 0;
897
+ }
898
+ }
899
+
900
+ .price {
901
+ font-size: 1.8rem;
902
+ font-weight: bold;
903
+
904
+ span:last-child {
905
+ margin-left: calc(var(--default-margin) / 2);
906
+ }
907
+ }
908
+ }
909
+
910
+ &:hover, &:active, &:focus {
911
+ border-color: var(--hyperlink-color-highlighted);
912
+ }
913
+
914
+
915
+ &.row-view {
916
+ flex-direction: row;
917
+ align-items: center;
918
+ }
919
+ }
920
+
921
+ /* boxType === 'user' */
922
+ &.user {
923
+ --box-header-padding: var(--default-padding);
924
+
925
+ .user-name {
926
+ color: var(--color-scheme-text-color);
927
+ font-size: 2rem;
928
+ font-weight: bold;
929
+ }
930
+
931
+ .user-age {
932
+ font-size: var(--default-font-size);
933
+ }
934
+
935
+ > .box-header {
936
+ --default-icon-size: 6rem;
937
+ --box-header-text-color: var(--primary-color);
938
+
939
+ background: none;
940
+ gap: calc(var(--default-gap) / 2);
941
+
942
+ > div:first-child > [class*="icon-"] {
943
+ aspect-ratio: 1/1;
944
+ }
945
+
946
+ img {
947
+ margin: 0 auto var(--default-margin) auto;
948
+
949
+ & + p, & + figcaption {
950
+ margin: 0 auto;
951
+ text-align: center;
952
+ font-weight: bold;
953
+ font-size: 2rem;
954
+ }
955
+ }
956
+
957
+ img, .no-user-image {
958
+ padding: 0;
959
+ width: calc(var(--default-icon-size) * 2);
960
+ aspect-ratio: 1/1;
961
+ max-width: 12rem;
962
+ border-radius: var(--full-circle);
963
+ background: var(--box-header-background);
964
+ display: flex;
965
+ color: var(--box-header-text-color);
966
+ justify-content: center;
967
+ align-items: center;
968
+ font-size: var(--default-icon-size);
969
+ }
970
+
971
+ .no-user-image {
972
+ background: var(--color-scheme-background-subtle);
973
+ border: var(--image-border);
974
+ box-shadow: var(--image-box-shadow);
975
+ }
976
+ }
977
+
978
+ .box-body {
979
+ flex-grow: 1;
980
+ padding: var(--default-padding);
981
+
982
+ border-bottom: 0;
983
+
984
+ p {
985
+ text-align: center;
986
+ font-weight: bold;
987
+
988
+ &:last-child {
989
+ margin-bottom: 0;
990
+ }
991
+
992
+ &.description {
993
+ font-weight: normal;
994
+ }
995
+ }
996
+ }
997
+
998
+ .box-footer {
999
+ margin-top: auto;
1000
+ padding: 0;
1001
+ border-top: var(--box-border);
1002
+
1003
+ .cmd-list {
1004
+ ul {
1005
+ width: 100%;
1006
+ margin-bottom: 0;
1007
+
1008
+ li {
1009
+ flex: 1;
1010
+ border-radius: var(--box-border-radius);
1011
+ border-top-left-radius: 0;
1012
+ border-top-right-radius: 0;
1013
+
1014
+ &:not(:only-child) {
1015
+ border-bottom-left-radius: 0;
1016
+ border-bottom-right-radius: 0;
1017
+
1018
+ &:first-child {
1019
+ border-bottom-left-radius: var(--box-border-radius);
1020
+ }
1021
+
1022
+ &:last-child {
1023
+ border-bottom-right-radius: var(--box-border-radius);
1024
+ }
1025
+ }
1026
+
1027
+ a {
1028
+ flex: 1;
1029
+ padding: var(--default-padding);
1030
+ text-align: center;
1031
+ background: var(--color-scheme-background);
1032
+ border-left: var(--box-border);
1033
+ border-radius: inherit;
1034
+ line-height: 100%;
1035
+ }
1036
+
1037
+ .cmd-link:has(span[class*="icon-"]) {
1038
+ justify-content: center;
1039
+ }
1040
+
1041
+ &:hover, &:active, &:focus {
1042
+ a {
1043
+ background: var(--primary-color);
1044
+ color: var(--primary-color-contrast-text);
1045
+
1046
+ span, [class*="icon-"] {
1047
+ color: var(--primary-color-contrast-text);
1048
+ }
1049
+ }
1050
+ }
1051
+
1052
+ &:first-child {
1053
+ a {
1054
+ border: 0;
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+
1060
+ ul.horizontal {
1061
+ li {
1062
+ border-radius: 0 !important;
1063
+ }
1064
+ }
1065
+ }
1066
+ }
1067
+
1068
+ &.row-view {
1069
+ .box-header {
1070
+ border: 0;
1071
+ }
1072
+
1073
+ .box-body {
1074
+ padding: 0;
1075
+
1076
+ p {
1077
+ text-align: left;
1078
+ }
1079
+ }
1080
+
1081
+ .box-footer {
1082
+ border: 0;
1083
+ background: none;
1084
+
1085
+ .cmd-list-of-links {
1086
+ background: none;
1087
+
1088
+ ul li {
1089
+ aspect-ratio: 1/1;
1090
+ border-radius: var(--box-border-radius) !important; /* overwrite settings from default-/column-view */
1091
+ }
1092
+
1093
+ ul, ul * {
1094
+ border: 0;
1095
+ background: inherit;
1096
+ }
1097
+ }
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+
1103
+ /* end cmd-box ------------------------------------------------------------------------------------------ */
1087
1104
  </style>