comand-component-library 3.1.57 → 3.1.58
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -275,7 +275,7 @@ export default {
|
|
275
275
|
computed: {
|
276
276
|
// get the displayed option name
|
277
277
|
optionName() {
|
278
|
-
// fake a
|
278
|
+
// fake a native selectbox
|
279
279
|
if (this.type !== "checkboxOptions" && this.type !== "content" && this.modelValue) {
|
280
280
|
const result = this.selectData.find(option => option.value === this.modelValue)?.text
|
281
281
|
|
@@ -288,7 +288,7 @@ export default {
|
|
288
288
|
// selectbox with checkbox-options
|
289
289
|
else if (this.type === "checkboxOptions") {
|
290
290
|
if (this.modelValue.length === 1) {
|
291
|
-
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
|
292
292
|
} else if (this.modelValue.length > 1) {
|
293
293
|
return this.modelValue.length + " options selected"
|
294
294
|
}
|
@@ -382,7 +382,7 @@ export default {
|
|
382
382
|
}
|
383
383
|
|
384
384
|
this.showOptions = false
|
385
|
-
this.$emit('update:modelValue', optionValue)
|
385
|
+
this.$emit('update:modelValue', optionValue)
|
386
386
|
},
|
387
387
|
// check if a checkbox is changed for selectbox with checkboxes
|
388
388
|
optionSelect(event) {
|
@@ -390,15 +390,15 @@ export default {
|
|
390
390
|
|
391
391
|
let value = [...this.modelValue] // copy array from props
|
392
392
|
if (event.target.checked) {
|
393
|
-
value.push(event.target.value)
|
393
|
+
value.push(event.target.value) // attention: value will be transformed into string!
|
394
394
|
} else {
|
395
|
-
value = value.filter(
|
395
|
+
value = value.filter(item => item !== event.target.value && String(item) !== event.target.value)
|
396
396
|
}
|
397
397
|
if (this.$attrs.required !== undefined && !value.length) {
|
398
398
|
this.validationStatus = "error"
|
399
399
|
}
|
400
400
|
|
401
|
-
this.$emit('update:modelValue', value)
|
401
|
+
this.$emit('update:modelValue', value)
|
402
402
|
},
|
403
403
|
closeOptions() {
|
404
404
|
this.showOptions = false
|