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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "3.1.57",
3
+ "version": "3.1.58",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -275,7 +275,7 @@ export default {
275
275
  computed: {
276
276
  // get the displayed option name
277
277
  optionName() {
278
- // fake a normal checkbox
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); // attention: value will be transformed into string!
393
+ value.push(event.target.value) // attention: value will be transformed into string!
394
394
  } else {
395
- value = value.filter(v => v !== event.target.value);
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