comand-component-library 3.1.73 → 3.1.76

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.umd.min.js +1 -1
  3. package/package.json +3 -3
  4. package/src/App.vue +112 -79
  5. package/src/assets/data/cookie-disclaimer.json +7 -6
  6. package/src/assets/data/input-group-radiobuttons.json +23 -0
  7. package/src/assets/data/input-group-replaced-radiobuttons.json +23 -0
  8. package/src/assets/data/input-group-toggle-switch-radiobuttons.json +23 -0
  9. package/src/assets/styles/global-styles.scss +20 -59
  10. package/src/components/CmdAddressData.vue +7 -7
  11. package/src/components/CmdBankAccountData.vue +7 -7
  12. package/src/components/CmdBox.vue +25 -31
  13. package/src/components/CmdBoxSiteSearch.vue +9 -9
  14. package/src/components/CmdCookieDisclaimer.vue +93 -25
  15. package/src/components/CmdFakeSelect.vue +36 -52
  16. package/src/components/CmdFormElement.vue +36 -57
  17. package/src/components/{CmdCustomHeadline.vue → CmdHeadline.vue} +1 -1
  18. package/src/components/CmdInputGroup.vue +156 -24
  19. package/src/components/CmdListOfLinks.vue +8 -8
  20. package/src/components/CmdListOfRequirements.vue +150 -0
  21. package/src/components/CmdLoginForm.vue +17 -17
  22. package/src/components/CmdMainNavigation.vue +2 -2
  23. package/src/components/CmdOpeningHours.vue +5 -5
  24. package/src/components/CmdSiteFooter.vue +76 -0
  25. package/src/components/CmdSiteHeader.vue +2 -1
  26. package/src/components/CmdSlideshow.vue +6 -6
  27. package/src/components/CmdSystemMessage.vue +28 -11
  28. package/src/components/CmdTabs.vue +8 -8
  29. package/src/components/CmdToggleDarkMode.vue +42 -5
  30. package/src/components/CmdTooltip.vue +13 -13
  31. package/src/components/CmdTooltipForInputElements.vue +122 -0
  32. package/src/components/CmdUploadForm.vue +32 -32
  33. package/src/components/CmdWidthLimitationWrapper.vue +0 -17
  34. package/src/documentation/generated/CmdAddressDataPropertyDescriptions.json +2 -2
  35. package/src/documentation/generated/CmdBankAccountDataPropertyDescriptions.json +2 -2
  36. package/src/documentation/generated/CmdBoxPropertyDescriptions.json +2 -2
  37. package/src/documentation/generated/CmdBoxSiteSearchPropertyDescriptions.json +2 -2
  38. package/src/documentation/generated/CmdCookieDisclaimerPropertyDescriptions.json +7 -2
  39. package/src/documentation/generated/CmdFormElementPropertyDescriptions.json +7 -2
  40. package/src/documentation/generated/CmdHeadlinePropertyDescriptions.json +22 -0
  41. package/src/documentation/generated/CmdInputGroupPropertyDescriptions.json +32 -1
  42. package/src/documentation/generated/CmdListOfLinksPropertyDescriptions.json +2 -2
  43. package/src/documentation/generated/CmdListOfRequirementsPropertyDescriptions.json +32 -0
  44. package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +4 -4
  45. package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +2 -2
  46. package/src/documentation/generated/CmdSiteFooterPropertyDescriptions.json +12 -0
  47. package/src/documentation/generated/CmdSystemMessagePropertyDescriptions.json +5 -0
  48. package/src/documentation/generated/CmdTabsPropertyDescriptions.json +2 -2
  49. package/src/documentation/generated/CmdTooltipForInputElementsPropertyDescriptions.json +42 -0
  50. package/src/documentation/generated/CmdTooltipPropertyDescriptions.json +1 -1
  51. package/src/documentation/generated/CmdUploadFormPropertyDescriptions.json +14 -14
  52. package/src/index.js +2 -1
  53. package/src/mixins/CmdCookieDisclaimer/DefaultMessageProperties.js +10 -0
  54. package/src/mixins/FieldValidation.js +16 -6
  55. package/src/mixins/Tooltip.js +1 -1
@@ -33,6 +33,11 @@
33
33
  @import 'variables'; /* scss-variables (only used for media-query-breakpoints) */
34
34
  /* ---------------------------------------------- END IMPORTS -------------------------------------------------- */
35
35
 
36
+ body, .cmd-site-header, .cmd-site-footer, .cmd-copyright-information {
37
+ transition: background linear .5s;
38
+ }
39
+
40
+
36
41
  /* ---------------------------------------------- BEGIN COMPONENTS AND GLOBAL STYLES -------------------------------------------------- */
37
42
  /* begin .avoid-scrolling --------------------------------------------------------------------------------------------------------------------------------------------------- */
38
43
  body.avoid-scrolling {
@@ -173,11 +178,18 @@ body.avoid-scrolling {
173
178
  /* end product-listing --------------------------------------------------------------------------------------------------------------------------------------------------- */
174
179
 
175
180
  /* begin tooltip for cmd-form-element and cmd-fake-select ---------------------------------------------------------------------------------------------------------------- */
176
- .cmd-form-element, .cmd-fake-select {
181
+ .cmd-form-element, .cmd-fake-select, .cmd-input-group {
182
+ .cmd-tooltip {
183
+ position: absolute;
184
+ right: 0;
185
+ transform: translateY(calc(-100% - calc(var(--default-margin) / 2)));
186
+ left: auto !important; /* overwrite calculated inline-styles from javascript for cmd-tooltip-component */
187
+ top: 0 !important; /* overwrite calculated inline-styles from javascript for cmd-tooltip-component */
188
+ }
177
189
 
178
190
  &.has-state, & + .cmd-tooltip {
179
191
  .label-text {
180
- span, sup {
192
+ > span, > a, sup {
181
193
  color: var(--status-color);
182
194
  }
183
195
  }
@@ -190,7 +202,6 @@ body.avoid-scrolling {
190
202
  --status-color: var(--warning-color);
191
203
  }
192
204
 
193
-
194
205
  &.success {
195
206
  --status-color: var(--success-color);
196
207
  }
@@ -202,44 +213,6 @@ body.avoid-scrolling {
202
213
 
203
214
  & + .cmd-tooltip {
204
215
  border-color: var(--status-color);
205
-
206
- h6:last-of-type {
207
- margin-top: 0;
208
- }
209
-
210
- .list-of-requirements {
211
- .error {
212
- color: var(--error-color);
213
- }
214
-
215
- .warning {
216
- color: var(--warning-color);
217
- }
218
-
219
- .success {
220
- color: var(--success-color);
221
- }
222
-
223
- .info {
224
- color: var(--info-color);
225
- }
226
-
227
- span[class*="icon"] {
228
- font-size: 1.2rem;
229
- }
230
-
231
- & ~ a {
232
- display: flex;
233
- align-items: center;
234
- justify-content: center;
235
- text-align: center;
236
- text-decoration: none;
237
-
238
- span[class*="icon"] {
239
- font-size: 1.2rem;
240
- }
241
- }
242
- }
243
216
  }
244
217
  }
245
218
  /* end tooltip for cmd-form-element and cmd-fake-select ------------------------------------------------------------------------------------------------------------------ */
@@ -252,14 +225,6 @@ body.avoid-scrolling {
252
225
  --grid-small-span: 3; /* default column span smaller part */
253
226
  --grid-large-span: 3; /* default column span larger part */
254
227
  }
255
-
256
- #site-footer {
257
- footer {
258
- li {
259
- margin-bottom: calc(var(--default-margin) * 2);
260
- }
261
- }
262
- }
263
228
  }
264
229
  /* end styles for medium screens --------------------------------------------------------------------------------------------------------------------------------------------------- */
265
230
 
@@ -278,16 +243,6 @@ body.avoid-scrolling {
278
243
  padding: calc(var(--default-padding) * 2) 0;
279
244
  }
280
245
 
281
- #site-footer {
282
- a {
283
- text-decoration: underline;
284
-
285
- &:active {
286
- text-decoration: none;
287
- }
288
- }
289
- }
290
-
291
246
  a[href^="tel"] {
292
247
  text-decoration: underline;
293
248
  }
@@ -300,6 +255,7 @@ html {
300
255
  &.light-mode {
301
256
  /* assign default colors for custom light-mode set by class */
302
257
  --color-scheme-text-color: var(--light-mode-text-color);
258
+ --color-scheme-text-color-buttons: var(--light-mode-text-color-buttons);
303
259
  --color-scheme-background-color: var(--light-mode-background-color);
304
260
  --color-scheme-text-color-inverted: var(--dark-mode-text-color);
305
261
  --color-scheme-background-inverted: var(--dark-mode-background-color);
@@ -309,10 +265,15 @@ html {
309
265
  &.dark-mode {
310
266
  /* assign default colors for custom dark-mode set by class */
311
267
  --color-scheme-text-color: var(--dark-mode-text-color);
268
+ --color-scheme-text-color-buttons: var(--dark-mode-background-color);
312
269
  --color-scheme-background-color: var(--dark-mode-background-color);
313
270
  --color-scheme-text-color-inverted: var(--light-mode-text-color);
314
271
  --color-scheme-background-inverted: var(--light-mode-background-color);
315
272
  --default-background-color-lightness: 20%;
273
+
274
+ :where(label, .label) .label-text [class*="icon"] {
275
+ background: var(--dark-gray);
276
+ }
316
277
  }
317
278
  }
318
279
 
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="cmd-address-data vcard">
3
- <!-- begin CmdCustomHeadline -->
4
- <CmdCustomHeadline v-if="cmdCustomHeadline" v-bind="cmdCustomHeadline" />
5
- <!-- end CmdCustomHeadline -->
3
+ <!-- begin CmdHeadline -->
4
+ <CmdHeadline v-if="CmdHeadline" v-bind="CmdHeadline" />
5
+ <!-- end CmdHeadline -->
6
6
 
7
7
  <!-- begin address-data in vCard microformat -->
8
8
  <address class="adr">
@@ -120,13 +120,13 @@ import I18n from "../mixins/I18n"
120
120
  import DefaultMessageProperties from "../mixins/CmdAddressData/DefaultMessageProperties"
121
121
 
122
122
  // import components
123
- import CmdCustomHeadline from "./CmdCustomHeadline"
123
+ import CmdHeadline from "./CmdHeadline"
124
124
 
125
125
  export default {
126
126
  name: "CmdAddressData",
127
127
  mixins: [I18n, DefaultMessageProperties],
128
128
  components: {
129
- CmdCustomHeadline
129
+ CmdHeadline
130
130
  },
131
131
  props: {
132
132
  /**
@@ -144,9 +144,9 @@ export default {
144
144
  default: true
145
145
  },
146
146
  /**
147
- * properties for CmdCustomHeadline-component
147
+ * properties for CmdHeadline-component
148
148
  */
149
- cmdCustomHeadline: {
149
+ CmdHeadline: {
150
150
  type: Object,
151
151
  required: false
152
152
  },
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="cmd-bank-account-data">
3
- <!-- begin CmdCustomHeadline -->
4
- <CmdCustomHeadline v-if="cmdCustomHeadline" v-bind="cmdCustomHeadline"/>
5
- <!-- end CmdCustomHeadline -->
3
+ <!-- begin CmdHeadline -->
4
+ <CmdHeadline v-if="CmdHeadline" v-bind="CmdHeadline"/>
5
+ <!-- end CmdHeadline -->
6
6
 
7
7
  <!-- begin account data -->
8
8
  <dl>
@@ -27,11 +27,11 @@
27
27
 
28
28
  <script>
29
29
  // import components
30
- import CmdCustomHeadline from "./CmdCustomHeadline"
30
+ import CmdHeadline from "./CmdHeadline"
31
31
 
32
32
  export default {
33
33
  name: "CmdBankAccountData",
34
- components: {CmdCustomHeadline},
34
+ components: {CmdHeadline},
35
35
  props: {
36
36
  /**
37
37
  * bank account data
@@ -71,9 +71,9 @@ export default {
71
71
  }
72
72
  },
73
73
  /**
74
- * properties for CmdCustomHeadline-component
74
+ * properties for CmdHeadline-component
75
75
  */
76
- cmdCustomHeadline: {
76
+ CmdHeadline: {
77
77
  type: Object,
78
78
  required: false
79
79
  }
@@ -3,17 +3,12 @@
3
3
  <div v-if="boxType === 'content'" :class="['cmd-box box content', {open : open, collapsible: collapsible, 'stretch-vertically': stretchVertically}]">
4
4
  <template v-if="useSlots?.includes('header')">
5
5
  <!-- begin collapsible header with slot -->
6
- <div v-if="collapsible" class="box-header">
6
+ <a v-if="collapsible" href="#" class="box-header" @click.prevent="toggleContentVisibility" :title="open ? iconOpen.tooltip : iconClosed.tooltip">
7
7
  <!-- begin slot 'header' -->
8
8
  <slot name="header"></slot>
9
9
  <!-- end slot 'header' -->
10
- <a href="#"
11
- class="toggle-icon"
12
- :title="open ? iconOpen.tooltip : iconClosed.tooltip"
13
- @click.prevent="toggleContentVisibility">
14
- <span :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
15
- </a>
16
- </div>
10
+ <span class="toggle-icon" :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
11
+ </a>
17
12
  <!-- end collapsible header with slot -->
18
13
 
19
14
  <!-- begin default header with slot -->
@@ -27,24 +22,23 @@
27
22
  <template v-else>
28
23
  <!-- begin header for collapsible -->
29
24
  <a v-if="collapsible" class="box-header" href="#" :title="open ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility">
30
- <!-- begin CmdCustomHeadline -->
31
- <CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText"
32
- v-bind="cmdCustomHeadline"/>
33
- <!-- end CmdCustomHeadline -->
25
+ <!-- begin CmdHeadline -->
26
+ <CmdHeadline v-if="CmdHeadline?.headlineText" v-bind="CmdHeadline"/>
27
+ <!-- end CmdHeadline -->
34
28
  <span class="toggle-icon" :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
35
29
  </a>
36
30
  <!-- end header for collapsible -->
37
31
 
38
- <!-- begin CmdCustomHeadline -->
39
- <CmdCustomHeadline v-else-if="!collapsible && cmdCustomHeadline?.headlineText"
32
+ <!-- begin CmdHeadline -->
33
+ <CmdHeadline v-else-if="!collapsible && CmdHeadline?.headlineText"
40
34
  class="box-header"
41
- v-bind="cmdCustomHeadline"
35
+ v-bind="CmdHeadline"
42
36
  />
43
- <!-- end CmdCustomHeadline -->
37
+ <!-- end CmdHeadline -->
44
38
  </template>
45
39
 
46
40
  <!-- begin box-body -->
47
- <div v-if="open" class="box-body" aria-expanded="true">
41
+ <div v-if="open" class="box-body" aria-expanded="true" role="article">
48
42
  <!-- begin slot 'body' -->
49
43
  <slot name="body">
50
44
  <transition :name="toggleTransition">
@@ -73,11 +67,11 @@
73
67
  <div v-if="product.discount" class="ribbon-discount">
74
68
  <span>{{ product.discount }}</span>
75
69
  </div>
76
- <!-- begin CmdCustomHeadline -->
77
- <CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText || product.name"
78
- v-bind="cmdCustomHeadline || {}"
79
- :headlineText="cmdCustomHeadline?.headlineText ? cmdCustomHeadline?.headlineText : product.name"/>
80
- <!-- end CmdCustomHeadline -->
70
+ <!-- begin CmdHeadline -->
71
+ <CmdHeadline v-if="CmdHeadline?.headlineText || product.name"
72
+ v-bind="CmdHeadline || {}"
73
+ :headlineText="CmdHeadline?.headlineText ? CmdHeadline?.headlineText : product.name"/>
74
+ <!-- end CmdHeadline -->
81
75
  </div>
82
76
  <div class="box-body">
83
77
  <p v-if="product.articleNumber">{{ getMessage("cmdbox.productbox.article_no") }} {{ product.articleNumber }}</p>
@@ -94,11 +88,11 @@
94
88
  <div class="box-header">
95
89
  <img v-if="user.image" :src="user.image.src" :alt="user.image.alt"/>
96
90
  <div v-else :class="defaultProfileIconClass" :title="user.name"></div>
97
- <!-- begin CmdCustomHeadline -->
98
- <CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText || user.name"
99
- v-bind="cmdCustomHeadline || {}"
100
- :headlineText="cmdCustomHeadline?.headlineText ? cmdCustomHeadline?.headlineText : user.name"/>
101
- <!-- end CmdCustomHeadline -->
91
+ <!-- begin CmdHeadline -->
92
+ <CmdHeadline v-if="CmdHeadline?.headlineText || user.name"
93
+ v-bind="CmdHeadline || {}"
94
+ :headlineText="CmdHeadline?.headlineText ? CmdHeadline?.headlineText : user.name"/>
95
+ <!-- end CmdHeadline -->
102
96
  </div>
103
97
  <div class="box-body">
104
98
  <p v-if="user.profession">{{ user.profession }}</p>
@@ -119,13 +113,13 @@ import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
119
113
  import GlobalCurrency from "../mixins/GlobalCurrency"
120
114
 
121
115
  // import components
122
- import CmdCustomHeadline from "./CmdCustomHeadline"
116
+ import CmdHeadline from "./CmdHeadline"
123
117
  import CmdListOfLinks from "./CmdListOfLinks"
124
118
 
125
119
  export default {
126
120
  name: "CmdBox",
127
121
  components: {
128
- CmdCustomHeadline,
122
+ CmdHeadline,
129
123
  CmdListOfLinks,
130
124
  },
131
125
  mixins: [
@@ -250,9 +244,9 @@ export default {
250
244
  default: true
251
245
  },
252
246
  /**
253
- * properties for CmdCustomHeadline-component
247
+ * properties for CmdHeadline-component
254
248
  */
255
- cmdCustomHeadline: {
249
+ CmdHeadline: {
256
250
  type: Object,
257
251
  required: false
258
252
  }
@@ -4,12 +4,12 @@
4
4
  <legend v-if="showLegend">{{ textLegend }}</legend>
5
5
  <!-- begin legend -->
6
6
 
7
- <!-- begin CmdCustomHeadline -->
8
- <CmdCustomHeadline
9
- v-if="cmdCustomHeadline"
10
- v-bind="cmdCustomHeadline"
7
+ <!-- begin CmdHeadline -->
8
+ <CmdHeadline
9
+ v-if="CmdHeadline"
10
+ v-bind="CmdHeadline"
11
11
  />
12
- <!-- end CmdCustomHeadline -->
12
+ <!-- end CmdHeadline -->
13
13
 
14
14
  <!-- begin form-elements -->
15
15
  <div class="flex-container">
@@ -95,7 +95,7 @@ import I18n from "../mixins/I18n"
95
95
  import DefaultMessageProperties from "../mixins/CmdSiteSearch/DefaultMessageProperties"
96
96
 
97
97
  // import files for components
98
- import CmdCustomHeadline from "./CmdCustomHeadline"
98
+ import CmdHeadline from "./CmdHeadline"
99
99
  import CmdFakeSelect from "./CmdFakeSelect"
100
100
  import CmdFormElement from "./CmdFormElement"
101
101
  import CmdFormFilters from "./CmdFormFilters"
@@ -111,7 +111,7 @@ export default {
111
111
  name: "CmdBoxSiteSearch",
112
112
  mixins: [I18n, DefaultMessageProperties],
113
113
  components: {
114
- CmdCustomHeadline,
114
+ CmdHeadline,
115
115
  CmdFakeSelect,
116
116
  CmdFormElement,
117
117
  CmdFormFilters
@@ -183,9 +183,9 @@ export default {
183
183
  required: false
184
184
  },
185
185
  /**
186
- * properties for CmdCustomHeadline-component
186
+ * properties for CmdHeadline-component
187
187
  */
188
- cmdCustomHeadline: {
188
+ CmdHeadline: {
189
189
  type: Object,
190
190
  required: false
191
191
  },
@@ -1,21 +1,22 @@
1
1
  <template>
2
2
  <transition name="fade">
3
3
  <div class="cmd-cookie-disclaimer flex-container vertical">
4
- <!-- begin CmdCustomHeadline -->
5
- <CmdCustomHeadline
6
- v-if="cmdCustomHeadlineCookieDisclaimer?.show && cmdCustomHeadlineCookieDisclaimer?.headlineText && cmdCustomHeadlineCookieDisclaimer?.headlineLevel"
7
- v-bind="cmdCustomHeadlineCookieDisclaimer"
8
- :headlineText="cmdCustomHeadlineCookieDisclaimer.headlineText"
9
- :headlineLevel="cmdCustomHeadlineCookieDisclaimer.headlineLevel"
4
+ <!-- begin CmdHeadline -->
5
+ <CmdHeadline
6
+ v-if="CmdHeadlineCookieDisclaimer?.show && CmdHeadlineCookieDisclaimer?.headlineText && CmdHeadlineCookieDisclaimer?.headlineLevel"
7
+ v-bind="CmdHeadlineCookieDisclaimer"
8
+ :headlineText="CmdHeadlineCookieDisclaimer.headlineText"
9
+ :headlineLevel="CmdHeadlineCookieDisclaimer.headlineLevel"
10
10
  />
11
- <!-- end CmdCustomHeadline -->
11
+ <!-- end CmdHeadline -->
12
12
 
13
13
  <!-- begin slot for cookie-options -->
14
14
  <slot name="cookie-options">
15
- <div v-if="cookieOptions.required" class="flex-container vertical">
16
- <CmdCustomHeadline v-if="cmdBoxRequiredCookies?.showHeadline" :headline-text="cmdBoxRequiredCookies?.headlineText" :headline-level="cmdBoxRequiredCookies?.headlineLevel "/>
15
+ <!-- begin required cookies -->
16
+ <div v-if="cookieOptions?.required" class="flex-container vertical">
17
+ <CmdHeadline v-if="cmdBoxRequiredCookies?.showHeadline" :headline-text="cmdBoxRequiredCookies?.headlineText" :headline-level="cmdBoxRequiredCookies?.headlineLevel "/>
17
18
  <!-- begin CmdBox -->
18
- <CmdBox v-for="(cookie, index) in cookieOptions.required.cookies"
19
+ <CmdBox v-for="(cookie, index) in cookieOptions.required.cookies || []"
19
20
  :useSlots="['header', 'body']"
20
21
  v-bind="cmdBoxRequiredCookies"
21
22
  :key="index"
@@ -25,9 +26,13 @@
25
26
  <CmdFormElement
26
27
  element="input"
27
28
  type="checkbox"
28
- labelText="Google Analytics"
29
- id="google-analytics"
29
+ v-model="acceptedCookies"
30
+ :inputValue="cookie.value"
31
+ :labelText="cookie.labelText"
32
+ :disabled="cookie.disabled"
33
+ :id="cookie.id"
30
34
  :toggleSwitch="true"
35
+ :title="getMessage('cmdcookiedisclaimer.title.cookie_cannot_be_disabled')"
31
36
  />
32
37
  <!-- end CmdFormElement -->
33
38
  </template>
@@ -46,11 +51,15 @@
46
51
  </CmdBox>
47
52
  <!-- end CmdBox -->
48
53
  </div>
54
+ <!-- end required cookies -->
55
+
49
56
  <hr/>
50
- <div v-if="cookieOptions.optional" class="flex-container vertical">
51
- <CmdCustomHeadline v-if="cmdBoxOptionalCookies?.showHeadline" :headline-text="cmdBoxOptionalCookies?.headlineText" :headline-level="cmdBoxOptionalCookies?.headlineLevel "/>
57
+
58
+ <!-- begin optional cookies -->
59
+ <div v-if="cookieOptions?.optional" class="flex-container vertical">
60
+ <CmdHeadline v-if="cmdBoxOptionalCookies?.showHeadline" :headline-text="cmdBoxOptionalCookies?.headlineText" :headline-level="cmdBoxOptionalCookies?.headlineLevel "/>
52
61
  <!-- begin CmdBox -->
53
- <CmdBox v-for="(cookie, index) in cookieOptions.optional.cookies"
62
+ <CmdBox v-for="(cookie, index) in cookieOptions.optional.cookies || []"
54
63
  :useSlots="['header', 'body']"
55
64
  v-bind="cmdBoxOptionalCookies"
56
65
  :key="index"
@@ -60,9 +69,13 @@
60
69
  <CmdFormElement
61
70
  element="input"
62
71
  type="checkbox"
63
- labelText="Google Analytics"
64
- id="google-analytics"
72
+ v-model="acceptedCookies"
73
+ :inputValue="cookie.value"
74
+ :labelText="cookie.labelText"
75
+ :disabled="cookie.disabled"
76
+ :id="cookie.id"
65
77
  :toggleSwitch="true"
78
+ :title="getMessage('cmdcookiedisclaimer.title.toggle_to_accept_cookie')"
66
79
  />
67
80
  <!-- end CmdFormElement -->
68
81
  </template>
@@ -81,6 +94,7 @@
81
94
  </CmdBox>
82
95
  <!-- end CmdBox -->
83
96
  </div>
97
+ <!-- end optional cookies -->
84
98
  </slot>
85
99
  <!-- end slot for cookie-options -->
86
100
 
@@ -90,10 +104,10 @@
90
104
 
91
105
  <!-- begin button-wrapper for 'accept'-buttons -->
92
106
  <div class="button-wrapper align-center">
93
- <button v-if="buttonLabelAcceptCurrentSettings" type="button" @click="acceptCookies('currentSettings')">
107
+ <button v-if="buttonLabelAcceptCurrentSettings" type="button" @click="acceptCurrentCookies">
94
108
  <span>{{ buttonLabelAcceptCurrentSettings }}</span>
95
109
  </button>
96
- <button v-if="buttonLabelAcceptAllCookies" type="button" class="primary" @click="acceptCookies('allCookies')">
110
+ <button v-if="buttonLabelAcceptAllCookies" type="button" class="primary" @click="acceptAllCookies">
97
111
  <span>{{ buttonLabelAcceptAllCookies }}</span>
98
112
  </button>
99
113
  </div>
@@ -103,16 +117,21 @@
103
117
  </template>
104
118
 
105
119
  <script>
120
+ // import mixins
121
+ import I18n from "../mixins/I18n"
122
+ import DefaultMessageProperties from "../mixins/CmdCookieDisclaimer/DefaultMessageProperties"
123
+
106
124
  // import components
107
125
  import CmdBox from "./CmdBox"
108
- import CmdCustomHeadline from "./CmdCustomHeadline"
126
+ import CmdHeadline from "./CmdHeadline"
109
127
  import CmdFormElement from "./CmdFormElement"
110
128
 
111
129
  export default {
112
130
  name: "CmdCookieDisclaimer",
131
+ mixins: [I18n, DefaultMessageProperties],
113
132
  components: {
114
133
  CmdBox,
115
- CmdCustomHeadline,
134
+ CmdHeadline,
116
135
  CmdFormElement
117
136
  },
118
137
  data() {
@@ -123,9 +142,16 @@ export default {
123
142
  },
124
143
  props: {
125
144
  /**
126
- * properties for CmdCustomHeadline-component at top of cookie disclaimer
145
+ * set default v-model (must be named modelValue in Vue3)
127
146
  */
128
- cmdCustomHeadlineCookieDisclaimer: {
147
+ modelValue: {
148
+ type: Array,
149
+ required: false
150
+ },
151
+ /**
152
+ * properties for CmdHeadline-component at top of cookie disclaimer
153
+ */
154
+ CmdHeadlineCookieDisclaimer: {
129
155
  type: Object,
130
156
  default() {
131
157
  return {
@@ -185,9 +211,43 @@ export default {
185
211
  default: "Proceed with current settings!"
186
212
  }
187
213
  },
214
+ computed: {
215
+ acceptedCookies: {
216
+ get() {
217
+ const cookies = this.modelValue ? [...this.modelValue] : []
218
+ const requiredCookies = this.cookieOptions?.required?.cookies || []
219
+ for (let i = 0; i < requiredCookies.length; i++) {
220
+ if(!cookies.includes(requiredCookies[i].value)) {
221
+ cookies.push(requiredCookies[i].value)
222
+ }
223
+ }
224
+ return cookies
225
+ },
226
+ set(value) {
227
+ this.$emit("update:modelValue", value)
228
+ }
229
+ }
230
+ },
188
231
  methods: {
189
- acceptCookies(cookies) {
190
- this.$emit("close-cookie-disclaimer", cookies)
232
+ acceptCurrentCookies() {
233
+ this.$emit("close-cookie-disclaimer", this.acceptedCookies)
234
+ },
235
+ acceptAllCookies() {
236
+ const allCookies = []
237
+
238
+ // push all required cookies to array
239
+ const requiredCookies = this.cookieOptions?.required?.cookies
240
+ for(let i = 0; i < requiredCookies.length ; i++) {
241
+ allCookies.push(requiredCookies[i].value)
242
+ }
243
+
244
+ // push all optional cookies to array
245
+ const optionalCookies = this.cookieOptions?.optional?.cookies
246
+ for(let i = 0; i < optionalCookies.length ; i++) {
247
+ allCookies.push(optionalCookies[i].value)
248
+ }
249
+
250
+ this.$emit("close-cookie-disclaimer", allCookies)
191
251
  },
192
252
  openDataPrivacy(event) {
193
253
  /* first 'target' = clicked-element, second 'target' = target-attribute */
@@ -215,6 +275,14 @@ export default {
215
275
  top: auto;
216
276
 
217
277
  .cmd-box {
278
+ .box-header {
279
+ label.disabled {
280
+ .label-text span {
281
+ color: var(--pure-white) !important;
282
+ }
283
+ }
284
+ }
285
+
218
286
  .box-body {
219
287
  padding: var(--default-padding);
220
288
  }