comand-component-library 3.1.68 → 3.1.69
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.umd.min.js +1 -1
- package/package.json +2 -2
- package/src/App.vue +103 -99
- package/src/assets/styles/global-styles.scss +30 -48
- package/src/components/CmdBackToTopButton.vue +1 -1
- package/src/components/CmdBox.vue +40 -24
- package/src/components/CmdBoxSiteSearch.vue +228 -46
- package/src/components/CmdCompanyLogo.vue +34 -9
- package/src/components/CmdCookieDisclaimer.vue +0 -17
- package/src/components/CmdCustomHeadline.vue +1 -1
- package/src/components/CmdFakeSelect.vue +5 -5
- package/src/components/CmdFormElement.vue +76 -67
- package/src/components/CmdInputGroup.vue +12 -3
- package/src/components/CmdLoginForm.vue +4 -2
- package/src/components/CmdMultipleSwitch.vue +14 -2
- package/src/components/CmdMultistepFormProgressBar.vue +3 -3
- package/src/components/CmdSiteHeader.vue +12 -3
- package/src/components/CmdTabs.vue +3 -3
- package/src/components/CmdThumbnailScroller.vue +1 -1
- package/src/components/CmdToggleDarkMode.vue +66 -0
- package/src/components/CmdUploadForm.vue +4 -5
- package/src/index.js +0 -1
- package/src/components/CmdSwitchButton.vue +0 -181
@@ -1,9 +1,9 @@
|
|
1
1
|
<template>
|
2
2
|
<!-- begin boxType 'content' -->
|
3
|
-
<div v-if="boxType === 'content'" :class="['cmd-box box content', {open : open, collapsible: collapsible}]">
|
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
|
-
<a v-if="collapsible" href="#" :title="open ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility">
|
6
|
+
<a v-if="collapsible" class="box-header" href="#" :title="open ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility">
|
7
7
|
<!-- begin slot 'header' -->
|
8
8
|
<slot name="header"></slot>
|
9
9
|
<!-- end slot 'header' -->
|
@@ -12,16 +12,16 @@
|
|
12
12
|
<!-- end collapsible header with slot -->
|
13
13
|
|
14
14
|
<!-- begin default header with slot -->
|
15
|
-
<
|
15
|
+
<div v-else class="box-header">
|
16
16
|
<!-- begin slot 'header' -->
|
17
17
|
<slot name="header"></slot>
|
18
18
|
<!-- end slot 'header' -->
|
19
|
-
</
|
19
|
+
</div>
|
20
20
|
<!-- end default header with slot -->
|
21
21
|
</template>
|
22
22
|
<template v-else>
|
23
23
|
<!-- begin header for collapsible -->
|
24
|
-
<a v-if="collapsible" href="#" :title="open ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility">
|
24
|
+
<a v-if="collapsible" class="box-header" href="#" :title="open ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility">
|
25
25
|
<!-- begin CmdCustomHeadline -->
|
26
26
|
<CmdCustomHeadline v-if="cmdCustomHeadline?.headlineText"
|
27
27
|
v-bind="cmdCustomHeadline"/>
|
@@ -32,7 +32,9 @@
|
|
32
32
|
|
33
33
|
<!-- begin CmdCustomHeadline -->
|
34
34
|
<CmdCustomHeadline v-else-if="!collapsible && cmdCustomHeadline?.headlineText"
|
35
|
-
|
35
|
+
class="box-header"
|
36
|
+
v-bind="cmdCustomHeadline"
|
37
|
+
/>
|
36
38
|
<!-- end CmdCustomHeadline -->
|
37
39
|
</template>
|
38
40
|
|
@@ -48,17 +50,17 @@
|
|
48
50
|
</div>
|
49
51
|
<!-- end box-body -->
|
50
52
|
|
51
|
-
<
|
53
|
+
<div v-if="useSlots?.includes('footer')" class="box-footer">
|
52
54
|
<!-- begin slot 'footer' -->
|
53
55
|
<slot name="footer"></slot>
|
54
56
|
<!-- end slot 'footer' -->
|
55
|
-
</
|
57
|
+
</div>
|
56
58
|
</div>
|
57
59
|
<!-- end boxType 'content' -->
|
58
60
|
|
59
61
|
<!-- begin boxType 'product' -->
|
60
|
-
<a v-else-if="boxType === 'product' && product" class="cmd-box box product" href="#" @click.prevent="clickOnProduct(product)">
|
61
|
-
<div>
|
62
|
+
<a v-else-if="boxType === 'product' && product" :class="['cmd-box box product', {'stretch-vertically': stretchVertically}]" href="#" @click.prevent="clickOnProduct(product)">
|
63
|
+
<div class="box-header flex-container vertical">
|
62
64
|
<img v-if="product.image" :src="product.image.src" :alt="product.image.alt"/>
|
63
65
|
<div class="ribbon-new" v-if="product.new">
|
64
66
|
<span>{{ getMessage("cmdbox.productbox.new") }}</span>
|
@@ -81,8 +83,8 @@
|
|
81
83
|
<!-- end boxType 'product' -->
|
82
84
|
|
83
85
|
<!-- begin boxType 'user' -->
|
84
|
-
<div v-else-if="boxType === 'user' && user" class="cmd-box box user">
|
85
|
-
<div>
|
86
|
+
<div v-else-if="boxType === 'user' && user" :class="['cmd-box box user', {'stretch-vertically': stretchVertically}]">
|
87
|
+
<div class="box-header">
|
86
88
|
<img v-if="user.image" :src="user.image.src" :alt="user.image.alt"/>
|
87
89
|
<div v-else :class="defaultProfileIconClass" :title="user.name"></div>
|
88
90
|
<!-- begin CmdCustomHeadline -->
|
@@ -96,9 +98,9 @@
|
|
96
98
|
<p v-if="user.position">{{ user.position }}</p>
|
97
99
|
<p v-if="user.description" class="description">{{ user.description }}</p>
|
98
100
|
</div>
|
99
|
-
<
|
101
|
+
<div v-if="user.links" class="box-footer">
|
100
102
|
<CmdListOfLinks :links="user.links" orientation="horizontal" :useGap="false"/>
|
101
|
-
</
|
103
|
+
</div>
|
102
104
|
</div>
|
103
105
|
<!-- end boxType 'user' -->
|
104
106
|
</template>
|
@@ -233,6 +235,13 @@ export default {
|
|
233
235
|
}
|
234
236
|
}
|
235
237
|
},
|
238
|
+
/**
|
239
|
+
* allow box to be stretched as high as parent-element
|
240
|
+
*/
|
241
|
+
stretchVertically: {
|
242
|
+
type: Boolean,
|
243
|
+
default: true
|
244
|
+
},
|
236
245
|
/**
|
237
246
|
* properties for CmdCustomHeadline-component
|
238
247
|
*/
|
@@ -288,6 +297,10 @@ export default {
|
|
288
297
|
padding: var(--default-padding);
|
289
298
|
}
|
290
299
|
|
300
|
+
&.stretch-vertically {
|
301
|
+
height: 100%;
|
302
|
+
}
|
303
|
+
|
291
304
|
&.content {
|
292
305
|
> * {
|
293
306
|
> *:last-child {
|
@@ -299,7 +312,7 @@ export default {
|
|
299
312
|
}
|
300
313
|
}
|
301
314
|
|
302
|
-
> header, > a {
|
315
|
+
> .box-header, > a {
|
303
316
|
display: flex;
|
304
317
|
align-items: center;
|
305
318
|
border-top-left-radius: var(--border-radius);
|
@@ -324,7 +337,7 @@ export default {
|
|
324
337
|
}
|
325
338
|
|
326
339
|
.box-body {
|
327
|
-
|
340
|
+
flex-grow: 1;
|
328
341
|
padding: 0;
|
329
342
|
|
330
343
|
.padding {
|
@@ -367,7 +380,7 @@ export default {
|
|
367
380
|
}
|
368
381
|
}
|
369
382
|
|
370
|
-
footer {
|
383
|
+
.box-footer {
|
371
384
|
border-bottom-left-radius: var(--border-radius);
|
372
385
|
border-bottom-right-radius: var(--border-radius);
|
373
386
|
padding: var(--default-padding);
|
@@ -425,7 +438,7 @@ export default {
|
|
425
438
|
}
|
426
439
|
}
|
427
440
|
|
428
|
-
>
|
441
|
+
> .box-header {
|
429
442
|
> img, > div {
|
430
443
|
display: table;
|
431
444
|
margin: 0 auto;
|
@@ -433,6 +446,8 @@ export default {
|
|
433
446
|
}
|
434
447
|
|
435
448
|
.box-body {
|
449
|
+
flex-grow: 1;
|
450
|
+
|
436
451
|
> * {
|
437
452
|
text-align: center;
|
438
453
|
}
|
@@ -449,11 +464,10 @@ export default {
|
|
449
464
|
}
|
450
465
|
|
451
466
|
&.user {
|
452
|
-
>
|
467
|
+
> .box-header {
|
453
468
|
padding: var(--default-padding);
|
454
|
-
background: var(--pure-white);
|
455
469
|
|
456
|
-
> img, > div {
|
470
|
+
> img, > div:first-child {
|
457
471
|
display: table;
|
458
472
|
margin: 0 auto;
|
459
473
|
padding: calc(var(--default-padding) * 3);
|
@@ -465,6 +479,8 @@ export default {
|
|
465
479
|
}
|
466
480
|
|
467
481
|
.box-body {
|
482
|
+
flex-grow: 1;
|
483
|
+
|
468
484
|
p {
|
469
485
|
text-align: center;
|
470
486
|
font-weight: bold;
|
@@ -479,13 +495,13 @@ export default {
|
|
479
495
|
}
|
480
496
|
}
|
481
497
|
|
482
|
-
footer {
|
498
|
+
.box-footer {
|
483
499
|
margin-top: auto;
|
484
500
|
border-top: var(--default-border);
|
485
501
|
|
486
|
-
|
487
502
|
.cmd-list-of-links {
|
488
503
|
ul {
|
504
|
+
width: 100%;
|
489
505
|
margin-bottom: 0;
|
490
506
|
|
491
507
|
li {
|
@@ -495,7 +511,7 @@ export default {
|
|
495
511
|
flex: 1;
|
496
512
|
padding: var(--default-padding);
|
497
513
|
text-align: center;
|
498
|
-
background: var(--
|
514
|
+
background: var(--color-scheme-background-color);
|
499
515
|
border-left: var(--default-border);
|
500
516
|
}
|
501
517
|
|
@@ -13,52 +13,72 @@
|
|
13
13
|
|
14
14
|
<!-- begin form-elements -->
|
15
15
|
<div class="flex-container">
|
16
|
-
<!-- begin CmdFormElement -->
|
16
|
+
<!-- begin CmdFormElement for first input -->
|
17
17
|
<CmdFormElement
|
18
|
+
v-if="cmdFormElementInput1.show"
|
18
19
|
element="input"
|
19
|
-
type="
|
20
|
-
:
|
21
|
-
:
|
20
|
+
:type="cmdFormElementInput1.type"
|
21
|
+
:show-label="cmdFormElementInput1.showLabel"
|
22
|
+
:labelText="cmdFormElementInput1.labelText"
|
23
|
+
:placeholder="cmdFormElementInput1.placeholder"
|
24
|
+
v-model="searchValue1"
|
22
25
|
/>
|
23
|
-
<!-- end CmdFormElement -->
|
26
|
+
<!-- end CmdFormElement for first input -->
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
<div class="flex-container no-gap">
|
29
|
+
<!-- begin CmdFormElement for second input -->
|
30
|
+
<CmdFormElement
|
31
|
+
v-if="cmdFormElementInput2.show"
|
32
|
+
element="input"
|
33
|
+
:type="cmdFormElementInput2.type"
|
34
|
+
:show-label="cmdFormElementInput2.showLabel"
|
35
|
+
:labelText="cmdFormElementInput2.labelText"
|
36
|
+
:placeholder="cmdFormElementInput2.placeholder"
|
37
|
+
v-model="searchValue2"
|
38
|
+
/>
|
39
|
+
<!-- end CmdFormElement for second input -->
|
33
40
|
|
34
|
-
|
41
|
+
<!-- begin CmdFormElement for radius -->
|
42
|
+
<CmdFormElement
|
43
|
+
v-if="cmdFormElementRadius.show"
|
44
|
+
element="select"
|
45
|
+
class="no-flex"
|
46
|
+
v-model="radius"
|
47
|
+
:show-label="cmdFormElementRadius.showLabel"
|
48
|
+
:labelText="cmdFormElementRadius.labelText"
|
49
|
+
:select-options="cmdFormElementRadius.selectOptions"
|
50
|
+
/>
|
51
|
+
<!-- end CmdFormElement for radius -->
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<!-- begin CmdFormElement for search-button -->
|
35
55
|
<CmdFormElement
|
36
56
|
element="button"
|
37
|
-
:
|
38
|
-
|
39
|
-
@click="$emit('click', $event)"
|
57
|
+
:nativeButton="cmdFormElementSearchButton"
|
58
|
+
@click="onSearchButtonClick"
|
40
59
|
aria-live="assertive"
|
41
60
|
/>
|
42
|
-
<!-- end CmdFormElement -->
|
61
|
+
<!-- end CmdFormElement for search-button -->
|
62
|
+
|
43
63
|
</div>
|
44
64
|
<!-- end form-elements -->
|
45
65
|
|
46
66
|
<!-- begin filters -->
|
47
|
-
<template v-if="
|
67
|
+
<template v-if="cmdFakeSelect?.show">
|
48
68
|
<a href="#" @click.prevent="showFilters = !showFilters">
|
49
69
|
<span :class="showFilters ? 'icon-single-arrow-up' : 'icon-single-arrow-down'"></span>
|
50
70
|
<span v-if="showFilters">{{ getMessage("cmdsitesearch.hide_filter_options") }}</span>
|
51
71
|
<span v-else>{{ getMessage("cmdsitesearch.show_filter_options") }}</span>
|
52
72
|
</a>
|
53
73
|
<transition name="fade">
|
54
|
-
<div v-if="showFilters &&
|
74
|
+
<div v-if="showFilters && cmdFakeSelect?.selectData.length" class="flex-container no-flex" aria-expanded="true">
|
55
75
|
<!-- begin CmdFakeSelect -->
|
56
76
|
<CmdFakeSelect
|
57
|
-
:selectData="
|
58
|
-
v-model="
|
59
|
-
defaultOptionName="
|
60
|
-
type="
|
61
|
-
labelText="
|
77
|
+
:selectData="cmdFakeSelect?.selectData"
|
78
|
+
v-model="searchFilters"
|
79
|
+
:defaultOptionName="cmdFakeSelect?.defaultOptionName"
|
80
|
+
:type="cmdFakeSelect?.type"
|
81
|
+
:labelText="cmdFakeSelect?.labelText"
|
62
82
|
/>
|
63
83
|
<!-- end CmdFakeSelect -->
|
64
84
|
</div>
|
@@ -66,7 +86,7 @@
|
|
66
86
|
</template>
|
67
87
|
<!-- end filters -->
|
68
88
|
</fieldset>
|
69
|
-
<CmdFormFilters v-if="
|
89
|
+
<CmdFormFilters v-if="cmdFakeSelect?.show" v-model="searchFilters" :selectedOptionsName="getOptionName"/>
|
70
90
|
</template>
|
71
91
|
|
72
92
|
<script>
|
@@ -81,6 +101,13 @@ import CmdFormElement from "./CmdFormElement"
|
|
81
101
|
import CmdFormFilters from "./CmdFormFilters"
|
82
102
|
|
83
103
|
export default {
|
104
|
+
emits: [
|
105
|
+
"search",
|
106
|
+
"update:modelValueInput1",
|
107
|
+
"update:modelValueInput2",
|
108
|
+
"update:modelValueRadius",
|
109
|
+
"update:modelValueSearchFilters"
|
110
|
+
],
|
84
111
|
name: "CmdBoxSiteSearch",
|
85
112
|
mixins: [I18n, DefaultMessageProperties],
|
86
113
|
components: {
|
@@ -91,34 +118,45 @@ export default {
|
|
91
118
|
},
|
92
119
|
data() {
|
93
120
|
return {
|
94
|
-
showFilters: false
|
95
|
-
fakeSelectFilters: []
|
121
|
+
showFilters: false
|
96
122
|
}
|
97
123
|
},
|
98
124
|
props: {
|
99
125
|
/**
|
100
|
-
*
|
126
|
+
* custom modelValue for first input-field
|
101
127
|
*/
|
102
|
-
|
103
|
-
type:
|
128
|
+
modelValueInput1: {
|
129
|
+
type: String,
|
104
130
|
required: false
|
105
131
|
},
|
106
132
|
/**
|
107
|
-
*
|
133
|
+
* custom modelValue for second input-field
|
108
134
|
*/
|
109
|
-
|
110
|
-
type:
|
111
|
-
|
135
|
+
modelValueInput2: {
|
136
|
+
type: String,
|
137
|
+
required: false
|
112
138
|
},
|
113
139
|
/**
|
114
|
-
*
|
115
|
-
|
116
|
-
|
140
|
+
* custom modelValue for radius
|
141
|
+
*/
|
142
|
+
modelValueRadius: {
|
143
|
+
type: [String, Number],
|
144
|
+
required: false
|
145
|
+
},
|
146
|
+
/**
|
147
|
+
* custom modelValue for search-filters
|
117
148
|
*/
|
118
|
-
|
149
|
+
modelValueSearchFilters: {
|
119
150
|
type: Array,
|
120
151
|
required: false
|
121
152
|
},
|
153
|
+
/**
|
154
|
+
* toggle use of filters (must configured)
|
155
|
+
*/
|
156
|
+
useFilters: {
|
157
|
+
type: Boolean,
|
158
|
+
default: true
|
159
|
+
},
|
122
160
|
/**
|
123
161
|
* text for legend
|
124
162
|
*
|
@@ -150,31 +188,168 @@ export default {
|
|
150
188
|
cmdCustomHeadline: {
|
151
189
|
type: Object,
|
152
190
|
required: false
|
191
|
+
},
|
192
|
+
/**
|
193
|
+
* properties for CmdFormElement-component first search-field
|
194
|
+
*/
|
195
|
+
cmdFormElementInput1: {
|
196
|
+
type: Object,
|
197
|
+
default() {
|
198
|
+
return {
|
199
|
+
show: true,
|
200
|
+
type: "text",
|
201
|
+
showLabel: true,
|
202
|
+
labelText: "What do you like to search for?",
|
203
|
+
placeholder: "Search"
|
204
|
+
}
|
205
|
+
}
|
206
|
+
},
|
207
|
+
/**
|
208
|
+
* properties for CmdFormElement-component for second search-field
|
209
|
+
*/
|
210
|
+
cmdFormElementInput2: {
|
211
|
+
type: Object,
|
212
|
+
default() {
|
213
|
+
return {
|
214
|
+
show: true,
|
215
|
+
type: "text",
|
216
|
+
showLabel: true,
|
217
|
+
labelText: "Where do you like to search?",
|
218
|
+
placeholder: "City, Zip"
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
/**
|
223
|
+
* properties for CmdFormElement-component for radius
|
224
|
+
*/
|
225
|
+
cmdFormElementRadius: {
|
226
|
+
type: Object,
|
227
|
+
default() {
|
228
|
+
return {
|
229
|
+
show: true,
|
230
|
+
showLabel: true,
|
231
|
+
labelText: "Radius",
|
232
|
+
selectOptions: [
|
233
|
+
{
|
234
|
+
text: "5 Km",
|
235
|
+
value: 5
|
236
|
+
},
|
237
|
+
{
|
238
|
+
text: "10 Km",
|
239
|
+
value: 10
|
240
|
+
},
|
241
|
+
{
|
242
|
+
text: "15 Km",
|
243
|
+
value: 15
|
244
|
+
},
|
245
|
+
{
|
246
|
+
text: "50 Km",
|
247
|
+
value: 50
|
248
|
+
},
|
249
|
+
{
|
250
|
+
text: "100 Km",
|
251
|
+
value: 100
|
252
|
+
}
|
253
|
+
]
|
254
|
+
}
|
255
|
+
}
|
256
|
+
},
|
257
|
+
/**
|
258
|
+
* properties for CmdFormElement-component for search-button
|
259
|
+
*/
|
260
|
+
cmdFormElementSearchButton: {
|
261
|
+
type: Object,
|
262
|
+
default() {
|
263
|
+
return {
|
264
|
+
icon: {
|
265
|
+
show: true,
|
266
|
+
position: "before",
|
267
|
+
iconClass: "icon-search"
|
268
|
+
},
|
269
|
+
text: "Search"
|
270
|
+
}
|
271
|
+
}
|
272
|
+
},
|
273
|
+
/**
|
274
|
+
* properties for CmdFakeSelect-component for filters
|
275
|
+
*/
|
276
|
+
cmdFakeSelect: {
|
277
|
+
type: Object,
|
278
|
+
required: false
|
153
279
|
}
|
154
280
|
},
|
155
281
|
computed: {
|
156
|
-
|
157
|
-
|
158
|
-
return this.
|
282
|
+
searchValue1: {
|
283
|
+
get() {
|
284
|
+
return this.modelValueInput1
|
285
|
+
},
|
286
|
+
set(value) {
|
287
|
+
this.$emit("update:modelValueInput1", value)
|
288
|
+
}
|
289
|
+
},
|
290
|
+
searchValue2: {
|
291
|
+
get() {
|
292
|
+
return this.modelValueInput2
|
293
|
+
},
|
294
|
+
set(value) {
|
295
|
+
this.$emit("update:modelValueInput2", value)
|
296
|
+
}
|
297
|
+
},
|
298
|
+
radius: {
|
299
|
+
get() {
|
300
|
+
return this.modelValueRadius
|
301
|
+
},
|
302
|
+
set(value) {
|
303
|
+
this.$emit("update:modelValueRadius", value)
|
304
|
+
}
|
305
|
+
},
|
306
|
+
searchFilters: {
|
307
|
+
get() {
|
308
|
+
return this.modelValueSearchFilters
|
309
|
+
},
|
310
|
+
set(value) {
|
311
|
+
this.$emit("update:modelValueSearchFilters", value)
|
159
312
|
}
|
160
|
-
return "Search"
|
161
313
|
}
|
162
314
|
},
|
163
315
|
methods: {
|
316
|
+
onSearchButtonClick() {
|
317
|
+
this.$emit("search", {
|
318
|
+
searchValue1: this.searchValue1,
|
319
|
+
searchValue2: this.searchValue2,
|
320
|
+
searchFilters: this.searchFilters,
|
321
|
+
radius: this.radius
|
322
|
+
})
|
323
|
+
},
|
164
324
|
getOptionName(option) {
|
165
|
-
for (let i = 0; i < this.
|
166
|
-
if (option === this.
|
167
|
-
return this.
|
325
|
+
for (let i = 0; i < this.cmdFakeSelect.selectData.length; i++) {
|
326
|
+
if (option === this.cmdFakeSelect.selectData[i].value) {
|
327
|
+
return this.cmdFakeSelect.selectData[i].text
|
168
328
|
}
|
169
329
|
}
|
170
330
|
return null
|
171
331
|
}
|
332
|
+
},
|
333
|
+
watch: {
|
334
|
+
cmdFormElementRadius: {
|
335
|
+
handler() {
|
336
|
+
if (this.cmdFormElementRadius?.selectOptions && this.cmdFormElementRadius?.selectOptions.length && this.modelValueRadius == null) {
|
337
|
+
this.radius = this.cmdFormElementRadius.selectOptions[0].value
|
338
|
+
}
|
339
|
+
},
|
340
|
+
immediate: true,
|
341
|
+
deep: true
|
342
|
+
}
|
172
343
|
}
|
173
344
|
}
|
174
345
|
</script>
|
175
346
|
|
176
347
|
<style lang="scss">
|
348
|
+
/* begin cmd-box-site-search ---------------------------------------------------------------------------------------- */
|
349
|
+
@import '../assets/styles/variables';
|
177
350
|
.cmd-box-site-search {
|
351
|
+
flex-wrap: nowrap;
|
352
|
+
|
178
353
|
> a {
|
179
354
|
[class*='icon'] {
|
180
355
|
font-size: 1rem;
|
@@ -185,4 +360,11 @@ export default {
|
|
185
360
|
align-self: flex-end;
|
186
361
|
}
|
187
362
|
}
|
363
|
+
|
364
|
+
@media only screen and (max-width: $small-max-width) {
|
365
|
+
.cmd-box-site-search {
|
366
|
+
flex-wrap: nowrap;
|
367
|
+
}
|
368
|
+
}
|
369
|
+
/* end cmd-box-site-search ---------------------------------------------------------------------------------------- */
|
188
370
|
</style>
|
@@ -53,26 +53,51 @@ export default {
|
|
53
53
|
},
|
54
54
|
computed: {
|
55
55
|
pathCurrentLogo() {
|
56
|
-
if (this.prefersColorScheme ===
|
56
|
+
if (this.prefersColorScheme === "light" || !this.pathDarkmodeLogo) {
|
57
57
|
return this.pathDefaultLogo
|
58
58
|
}
|
59
59
|
return this.pathDarkmodeLogo
|
60
60
|
}
|
61
61
|
},
|
62
62
|
created() {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
this.prefersColorScheme = "dark"
|
67
|
-
}
|
63
|
+
this.toggleColorScheme()
|
64
|
+
|
65
|
+
window.matchMedia("(prefers-color-scheme: light)").addEventListener("change", this.onColorSchemeChange)
|
68
66
|
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
/* observe if class changes in html-tag */
|
68
|
+
const htmlTag = document.querySelector("html")
|
69
|
+
this.$_observer = new MutationObserver(this.observeDom)
|
70
|
+
this.$_observer.observe(htmlTag, {attributes: true})
|
71
|
+
},
|
72
|
+
beforeUnmount() {
|
73
|
+
window.matchMedia("(prefers-color-scheme: light)").removeEventListener("change", this.onColorSchemeChange)
|
74
|
+
this.$_observer.disconnect()
|
72
75
|
},
|
73
76
|
methods: {
|
77
|
+
onColorSchemeChange(event) {
|
78
|
+
this.prefersColorScheme = event.matches ? "light" : "dark"
|
79
|
+
},
|
80
|
+
observeDom(mutationList) {
|
81
|
+
for(let i = 0; i < mutationList.length; i++) {
|
82
|
+
if(mutationList[i].type === 'attributes') {
|
83
|
+
this.toggleColorScheme()
|
84
|
+
break
|
85
|
+
}
|
86
|
+
}
|
87
|
+
},
|
74
88
|
getRoute(language) {
|
75
89
|
return getRoute(language)
|
90
|
+
},
|
91
|
+
toggleColorScheme() {
|
92
|
+
if (document.querySelector("html").classList.contains("light-mode")) {
|
93
|
+
this.prefersColorScheme = "light"
|
94
|
+
} else if(document.querySelector("html").classList.contains("dark-mode")) {
|
95
|
+
this.prefersColorScheme = "dark"
|
96
|
+
} else if (matchMedia("(prefers-color-scheme: light)").matches) {
|
97
|
+
this.prefersColorScheme = "light"
|
98
|
+
} else {
|
99
|
+
this.prefersColorScheme = "dark"
|
100
|
+
}
|
76
101
|
}
|
77
102
|
}
|
78
103
|
}
|
@@ -22,14 +22,6 @@
|
|
22
22
|
>
|
23
23
|
<template v-slot:header>
|
24
24
|
<!-- begin CmdSwitchButton -->
|
25
|
-
<CmdSwitchButton
|
26
|
-
type="checkbox"
|
27
|
-
:id="cookie.id"
|
28
|
-
:labelText="cookie.labelText"
|
29
|
-
v-model="cookie.checked"
|
30
|
-
:status="cookie.status"
|
31
|
-
disabled="disabled"
|
32
|
-
/>
|
33
25
|
<!-- end CmdSwitchButton -->
|
34
26
|
</template>
|
35
27
|
<template v-slot:body>
|
@@ -58,13 +50,6 @@
|
|
58
50
|
>
|
59
51
|
<template v-slot:header>
|
60
52
|
<!-- begin CmdSwitchButton -->
|
61
|
-
<CmdSwitchButton
|
62
|
-
type="checkbox"
|
63
|
-
:id="cookie.id"
|
64
|
-
:labelText="cookie.labelText"
|
65
|
-
v-model="cookie.checked"
|
66
|
-
:status="cookie.status"
|
67
|
-
/>
|
68
53
|
<!-- end CmdSwitchButton -->
|
69
54
|
</template>
|
70
55
|
<template v-slot:body>
|
@@ -107,14 +92,12 @@
|
|
107
92
|
// import components
|
108
93
|
import CmdBox from "./CmdBox"
|
109
94
|
import CmdCustomHeadline from "./CmdCustomHeadline"
|
110
|
-
import CmdSwitchButton from "./CmdSwitchButton"
|
111
95
|
|
112
96
|
export default {
|
113
97
|
name: "CmdCookieDisclaimer",
|
114
98
|
components: {
|
115
99
|
CmdBox,
|
116
100
|
CmdCustomHeadline,
|
117
|
-
CmdSwitchButton
|
118
101
|
},
|
119
102
|
data() {
|
120
103
|
return {
|