@tagplus/components 0.2.94 → 0.2.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tp.common.js +570 -1006
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +1 -1
- package/dist/tp.umd.js +570 -1006
- package/dist/tp.umd.js.map +1 -1
- package/dist/tp.umd.min.js +1 -1
- package/dist/tp.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Multisuggest/Multisuggest.vue +32 -24
package/package.json
CHANGED
|
@@ -363,20 +363,17 @@ export default {
|
|
|
363
363
|
let newVal = ''
|
|
364
364
|
if (typeof this.value === 'boolean') {
|
|
365
365
|
newVal = ''
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
this.valueKey +
|
|
374
|
-
'\' key'
|
|
375
|
-
)
|
|
366
|
+
}
|
|
367
|
+
else if (Array.isArray(this.value)) {
|
|
368
|
+
this.value.forEach((item) => {
|
|
369
|
+
if (!item[this.valueKey]) {
|
|
370
|
+
if (process.env.DEBUG === 'true') {
|
|
371
|
+
throw new TypeError('Autosuggest this.value doesn\'t have a valueKey \'' + this.valueKey + '\' key')
|
|
372
|
+
}
|
|
376
373
|
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
newVal = this.value
|
|
380
377
|
}
|
|
381
378
|
|
|
382
379
|
return newVal
|
|
@@ -459,6 +456,19 @@ export default {
|
|
|
459
456
|
this.handleQueryChange(e.target.value, forceBusca)
|
|
460
457
|
}
|
|
461
458
|
})
|
|
459
|
+
|
|
460
|
+
this.value.forEach((item,key) => {
|
|
461
|
+
if (item[this.valueKey]) {
|
|
462
|
+
this.selectedLabelsArray.push(item)
|
|
463
|
+
this.value[key] = item[this.valueKey]
|
|
464
|
+
}
|
|
465
|
+
})
|
|
466
|
+
|
|
467
|
+
this.selectedLabels = this.selectedLabelsArray
|
|
468
|
+
.map(item => {
|
|
469
|
+
return item[this.labelKey]
|
|
470
|
+
})
|
|
471
|
+
.join(', ')
|
|
462
472
|
},
|
|
463
473
|
|
|
464
474
|
beforeMount () {
|
|
@@ -509,20 +519,18 @@ export default {
|
|
|
509
519
|
value = ''
|
|
510
520
|
} else if (Array.isArray(val)) {
|
|
511
521
|
value = val
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
this.valueKey +
|
|
518
|
-
'\' key'
|
|
519
|
-
)
|
|
522
|
+
}
|
|
523
|
+
else if (val && typeof val === 'object') {
|
|
524
|
+
// Se val for Object converte para outro tipo
|
|
525
|
+
if (!val[this.valueKey]) {
|
|
526
|
+
throw new TypeError('Autosuggest this.value doesn\'t have a valueKey \'' + this.valueKey + '\' key')
|
|
520
527
|
} else {
|
|
521
528
|
// Se mandou a label no objeto value
|
|
522
|
-
if (
|
|
523
|
-
initialLabel =
|
|
529
|
+
if (val[this.labelKey]) {
|
|
530
|
+
initialLabel = val[this.labelKey]
|
|
524
531
|
}
|
|
525
|
-
|
|
532
|
+
|
|
533
|
+
value = val
|
|
526
534
|
}
|
|
527
535
|
} else {
|
|
528
536
|
value = val
|