comand-component-library 3.1.56 → 3.1.59
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.umd.min.js +1 -1
- package/package.json +1 -1
- package/src/App.vue +0 -1
- package/src/components/CmdFakeSelect.vue +45 -38
- package/src/components/CmdGoogleMaps.vue +1 -1
- package/src/components/CmdLoginForm.vue +6 -6
- package/src/components/CmdOpeningHours.vue +1 -1
- package/src/components/CmdSystemMessage.vue +1 -1
- package/src/components/CmdTabs.vue +2 -1
package/package.json
CHANGED
package/src/App.vue
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
'has-state': validationStatus && validationStatus !== 'none'
|
9
9
|
}
|
10
10
|
]"
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
:aria-labelledby="labelText"
|
12
|
+
:aria-required="$attrs.required !== undefined"
|
13
|
+
ref="fakeselect"
|
14
14
|
>
|
15
15
|
<span v-if="showLabel">
|
16
16
|
<!-- begin label -->
|
@@ -19,14 +19,14 @@
|
|
19
19
|
</span>
|
20
20
|
<!-- end label -->
|
21
21
|
<a v-if="$attrs.required || inputRequirements.length"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
href="#"
|
23
|
+
@click.prevent
|
24
|
+
:class="getStatusIconClass"
|
25
|
+
:title="!useCustomTooltip ? getValidationMessage : ''"
|
26
|
+
:aria-errormessage="getValidationMessage"
|
27
|
+
aria-live="assertive"
|
28
|
+
:id="tooltipId"
|
29
|
+
:role="validationStatus === 'error' ? 'alert' : 'dialog'">
|
30
30
|
</a>
|
31
31
|
</span>
|
32
32
|
<ul :class="{'open': showOptions}" @clickout="closeOptions">
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<li v-for="(option, index) in selectData" :key="index">
|
67
67
|
<label v-if="type === 'checkboxOptions'" :for="'option-' + (index + 1)" :class="{'active' : modelValue.includes(`${option.value}`)}">
|
68
68
|
<input type="checkbox" :value="option.value" @change="optionSelect"
|
69
|
-
:checked="
|
69
|
+
:checked="compareValues(option.value)" :id="'option-' + (index + 1)"/>
|
70
70
|
<span>{{ option.text }}</span>
|
71
71
|
</label>
|
72
72
|
|
@@ -82,12 +82,14 @@
|
|
82
82
|
<span>{{ option.text }}</span>
|
83
83
|
</a>
|
84
84
|
</li>
|
85
|
+
<!-- begin (de)select all options -->
|
85
86
|
<li v-if="showSelectAllOptions && type === 'checkboxOptions'" class="select-all-options">
|
86
87
|
<a href="#" @click.prevent="toggleAllOptions">
|
87
88
|
<span :class="selectAllOptionsIcon"></span>
|
88
89
|
<span>{{ selectAllOptionsText }}</span>
|
89
90
|
</a>
|
90
91
|
</li>
|
92
|
+
<!-- end (de)select all options -->
|
91
93
|
</ul>
|
92
94
|
<!-- end dropdown with checkboxes -->
|
93
95
|
|
@@ -112,12 +114,13 @@
|
|
112
114
|
|
113
115
|
<template v-if="showRequirements && (validationStatus === '' || validationStatus === 'error')">
|
114
116
|
<!-- begin list of requirements -->
|
115
|
-
<h6>{{ getMessage("cmdfakeselect.headline.requirements_for_input") }}<br
|
117
|
+
<h6>{{ getMessage("cmdfakeselect.headline.requirements_for_input") }}<br/>"{{ labelText }}"</h6>
|
116
118
|
<dl class="list-of-requirements">
|
117
119
|
<template v-for="(requirement, index) in inputRequirements" :key="index">
|
118
|
-
<dt aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">{{requirement.message}}:</dt>
|
120
|
+
<dt aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">{{ requirement.message }}:</dt>
|
119
121
|
<dd :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">
|
120
|
-
<span aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'icon-check-circle' : 'icon-error-circle'"
|
122
|
+
<span aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'icon-check-circle' : 'icon-error-circle'"
|
123
|
+
:title="requirement.valid(modelValue, $attrs) ? 'success' : 'error'"></span>
|
121
124
|
</dd>
|
122
125
|
</template>
|
123
126
|
</dl>
|
@@ -125,7 +128,7 @@
|
|
125
128
|
|
126
129
|
<!-- begin helplink -->
|
127
130
|
<template v-if="helplink">
|
128
|
-
<hr v-if="helplink.show"
|
131
|
+
<hr v-if="helplink.show"/>
|
129
132
|
<a v-if="helplink.show && helplink.url"
|
130
133
|
:href="helplink.url"
|
131
134
|
:target="helplink.target"
|
@@ -272,7 +275,7 @@ export default {
|
|
272
275
|
computed: {
|
273
276
|
// get the displayed option name
|
274
277
|
optionName() {
|
275
|
-
// fake a
|
278
|
+
// fake a native selectbox
|
276
279
|
if (this.type !== "checkboxOptions" && this.type !== "content" && this.modelValue) {
|
277
280
|
const result = this.selectData.find(option => option.value === this.modelValue)?.text
|
278
281
|
|
@@ -285,13 +288,11 @@ export default {
|
|
285
288
|
// selectbox with checkbox-options
|
286
289
|
else if (this.type === "checkboxOptions") {
|
287
290
|
if (this.modelValue.length === 1) {
|
288
|
-
return this.selectData.find(option => option.value === this.modelValue[0])?.text
|
291
|
+
return this.selectData.find(option => String(option.value) === String(this.modelValue[0]))?.text
|
289
292
|
} else if (this.modelValue.length > 1) {
|
290
293
|
return this.modelValue.length + " options selected"
|
291
294
|
}
|
292
|
-
}
|
293
|
-
|
294
|
-
else if (this.selectData?.length) {
|
295
|
+
} else if (this.selectData?.length) {
|
295
296
|
return this.selectData[0].text
|
296
297
|
}
|
297
298
|
|
@@ -319,7 +320,7 @@ export default {
|
|
319
320
|
return null
|
320
321
|
},
|
321
322
|
selectAllOptionsText() {
|
322
|
-
if(Array.isArray(this.modelValue) && this.modelValue.length === this.selectData.length) {
|
323
|
+
if (Array.isArray(this.modelValue) && this.modelValue.length === this.selectData.length) {
|
323
324
|
return "Deselect all options"
|
324
325
|
}
|
325
326
|
return "Select all options"
|
@@ -342,20 +343,20 @@ export default {
|
|
342
343
|
toggleAllOptions() {
|
343
344
|
this.validationStatus = "success"
|
344
345
|
const checkboxValues = []
|
345
|
-
if(this.modelValue.length === this.selectData.length) {
|
346
|
-
if(this.$attrs.required) {
|
346
|
+
if (this.modelValue.length === this.selectData.length) {
|
347
|
+
if (this.$attrs.required) {
|
347
348
|
this.validationStatus = "error"
|
348
349
|
}
|
349
350
|
} else {
|
350
351
|
for (let i = 0; i < this.selectData.length; i++) {
|
351
|
-
checkboxValues.push(this.selectData[i].value)
|
352
|
+
checkboxValues.push(String(this.selectData[i].value))
|
352
353
|
}
|
353
354
|
}
|
354
355
|
|
355
356
|
this.$emit("update:modelValue", checkboxValues)
|
356
357
|
},
|
357
358
|
limitWidth() {
|
358
|
-
if(this.$refs.fakeselect) {
|
359
|
+
if (this.$refs.fakeselect) {
|
359
360
|
const outerWidth = this.$refs.fakeselect.offsetWidth
|
360
361
|
this.limitWidthStyle = {width: outerWidth / 100 * 90 + "px"}
|
361
362
|
}
|
@@ -365,17 +366,23 @@ export default {
|
|
365
366
|
this.showOptions = !this.showOptions
|
366
367
|
}
|
367
368
|
},
|
368
|
-
// check
|
369
|
+
// check if array of selected options includes number or string version of value
|
370
|
+
compareValues(option) {
|
371
|
+
return this.modelValue.some((item) => {
|
372
|
+
return item === option || item === String(option)
|
373
|
+
})
|
374
|
+
},
|
375
|
+
// check if an option is selected for default-selectbox
|
369
376
|
selectOption(optionValue) {
|
370
377
|
this.validationStatus = "success"
|
371
|
-
if(this.$attrs.required !== undefined) {
|
372
|
-
if(!optionValue) {
|
378
|
+
if (this.$attrs.required !== undefined) {
|
379
|
+
if (!optionValue) {
|
373
380
|
this.validationStatus = "error"
|
374
381
|
}
|
375
382
|
}
|
376
383
|
|
377
384
|
this.showOptions = false
|
378
|
-
this.$emit('update:modelValue', optionValue)
|
385
|
+
this.$emit('update:modelValue', optionValue)
|
379
386
|
},
|
380
387
|
// check if a checkbox is changed for selectbox with checkboxes
|
381
388
|
optionSelect(event) {
|
@@ -383,15 +390,15 @@ export default {
|
|
383
390
|
|
384
391
|
let value = [...this.modelValue] // copy array from props
|
385
392
|
if (event.target.checked) {
|
386
|
-
value.push(event.target.value)
|
393
|
+
value.push(event.target.value) // attention: value will be transformed into string!
|
387
394
|
} else {
|
388
|
-
value = value.filter(
|
395
|
+
value = value.filter(item => item !== event.target.value && String(item) !== event.target.value)
|
389
396
|
}
|
390
|
-
if(this.$attrs.required !== undefined && !value.length) {
|
397
|
+
if (this.$attrs.required !== undefined && !value.length) {
|
391
398
|
this.validationStatus = "error"
|
392
399
|
}
|
393
400
|
|
394
|
-
this.$emit('update:modelValue', value)
|
401
|
+
this.$emit('update:modelValue', value)
|
395
402
|
},
|
396
403
|
closeOptions() {
|
397
404
|
this.showOptions = false
|
@@ -420,10 +427,10 @@ export default {
|
|
420
427
|
},
|
421
428
|
selectData: {
|
422
429
|
handler() {
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
430
|
+
// check if given value by modelValue exists (else pre-select first option)
|
431
|
+
if (this.type === "default" && this.selectData?.length && !this.selectData.some((option) => option.value === this.modelValue)) {
|
432
|
+
this.$emit("update:modelValue", this.selectData[0].value)
|
433
|
+
}
|
427
434
|
},
|
428
435
|
immediate: true,
|
429
436
|
deep: true
|
@@ -21,7 +21,7 @@ export default {
|
|
21
21
|
if(this.address) {
|
22
22
|
const url = new URL("https://maps.google.de/maps?ie=UTF8&t=&z=17&iwloc=B&output=embed")
|
23
23
|
url.searchParams.set("hl", "de")
|
24
|
-
url.searchParams.set("q", [this.address.streetNo, this.address.zip, this.address.city, this.address.latitude, this.address.longitude, this.location].join(" ").trim())
|
24
|
+
url.searchParams.set("q", [this.address.streetNo, this.address.zip, this.address.city, this.address.latitude, this.address.longitude, this.address.location].join(" ").trim())
|
25
25
|
return url.href
|
26
26
|
}
|
27
27
|
return "https://maps.google.de/maps?ie=UTF8&t=&z=17&iwloc=B&output=embed"
|
@@ -15,7 +15,7 @@
|
|
15
15
|
type="text"
|
16
16
|
:name="cmdFormElementUsername.name"
|
17
17
|
:id="cmdFormElementUsername.id"
|
18
|
-
v-model
|
18
|
+
v-model="username"
|
19
19
|
:inner-icon-class="cmdFormElementUsername.innerIconClass"
|
20
20
|
:labelText="cmdFormElementUsername.labelText"
|
21
21
|
:placeholder="cmdFormElementUsername.placeholder"
|
@@ -29,7 +29,7 @@
|
|
29
29
|
:name="cmdFormElementPassword.name"
|
30
30
|
:id="cmdFormElementPassword.id"
|
31
31
|
:inner-icon-class="cmdFormElementPassword.innerIconClass"
|
32
|
-
v-model
|
32
|
+
v-model="password"
|
33
33
|
:labelText="cmdFormElementPassword.labelText"
|
34
34
|
:placeholder="cmdFormElementPassword.placeholder"
|
35
35
|
/>
|
@@ -277,8 +277,8 @@ export default {
|
|
277
277
|
default() {
|
278
278
|
return {
|
279
279
|
show: true,
|
280
|
-
|
281
|
-
|
280
|
+
headlineText: "Login",
|
281
|
+
headlineLevel: 2
|
282
282
|
}
|
283
283
|
}
|
284
284
|
},
|
@@ -290,8 +290,8 @@ export default {
|
|
290
290
|
default() {
|
291
291
|
return {
|
292
292
|
show: true,
|
293
|
-
|
294
|
-
|
293
|
+
headlineText: "Send Login",
|
294
|
+
headlineLevel: 2
|
295
295
|
}
|
296
296
|
}
|
297
297
|
},
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="cmd-opening-hours">
|
3
3
|
<!-- begin cmd-custom-headline -->
|
4
|
-
<CmdCustomHeadline v-if="cmdCustomHeadline"
|
4
|
+
<CmdCustomHeadline v-if="cmdCustomHeadline" v-bind="cmdCustomHeadline" />
|
5
5
|
<!-- end cmd-custom-headline -->
|
6
6
|
|
7
7
|
<!-- begin opening-status with link to detail-page -->
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div
|
4
4
|
v-if="showSystemMessage"
|
5
5
|
:class="['cmd-system-message', 'system-message', 'flex-container', 'vertical', { 'full-width': fullWidth }, validationStatus]"
|
6
|
-
:role="
|
6
|
+
:role="validationStatus === 'error' ? 'alert' : 'dialog'"
|
7
7
|
>
|
8
8
|
<a
|
9
9
|
v-if="iconClose.show && iconClose.iconClass"
|
@@ -19,7 +19,8 @@
|
|
19
19
|
<!-- begin CmdCustomHeadline -->
|
20
20
|
<CmdCustomHeadline
|
21
21
|
v-bind="cmdCustomHeadline"
|
22
|
-
:headlineText="tabs[showTab].
|
22
|
+
:headlineText="tabs[showTab].headlineText"
|
23
|
+
:headlineLevel="tabs[showTab].headlineLevel"
|
23
24
|
/>
|
24
25
|
<!-- end CmdCustomHeadline -->
|
25
26
|
|