@tagplus/components 4.7.13 → 4.7.16
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 +1 -1
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +1 -1
- package/dist/tp.umd.js +1 -1
- 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/Autosuggest/Autosuggest.vue +17 -6
package/package.json
CHANGED
|
@@ -327,10 +327,7 @@ export default {
|
|
|
327
327
|
|
|
328
328
|
return this.filterable && this.allowCreate && !hasExistingOption
|
|
329
329
|
},
|
|
330
|
-
|
|
331
|
-
suggestionsList () {
|
|
332
|
-
if (this.loading) return []
|
|
333
|
-
|
|
330
|
+
rawSuggestionsList () {
|
|
334
331
|
// transformando em Array
|
|
335
332
|
const list =
|
|
336
333
|
typeof this.suggestions === 'object'
|
|
@@ -347,6 +344,12 @@ export default {
|
|
|
347
344
|
|
|
348
345
|
return list
|
|
349
346
|
},
|
|
347
|
+
// Monta a lista com ou sem "Cadastrar Novo Item"
|
|
348
|
+
suggestionsList () {
|
|
349
|
+
if (this.loading) return []
|
|
350
|
+
|
|
351
|
+
return this.rawSuggestionsList
|
|
352
|
+
},
|
|
350
353
|
|
|
351
354
|
emptyText () {
|
|
352
355
|
if (this.loading) {
|
|
@@ -478,6 +481,11 @@ export default {
|
|
|
478
481
|
}
|
|
479
482
|
},
|
|
480
483
|
|
|
484
|
+
/** Atualiza a label de algum dos elementos da listagem do altosuggest */
|
|
485
|
+
atualizarLabelOpcao (index, val) {
|
|
486
|
+
this.rawSuggestionsList[index].label = val
|
|
487
|
+
},
|
|
488
|
+
|
|
481
489
|
/**
|
|
482
490
|
* Sobrescreve o getOption do select para mostrar o labelValue em vez do idValue
|
|
483
491
|
*/
|
|
@@ -519,13 +527,16 @@ export default {
|
|
|
519
527
|
|
|
520
528
|
for (let i = 0; i <= this.cachedOptions.length - 1; i++) {
|
|
521
529
|
const cachedOption = this.cachedOptions[i]
|
|
530
|
+
|
|
522
531
|
let isEqual = false
|
|
532
|
+
|
|
523
533
|
if (isObject) {
|
|
524
534
|
isEqual = getValueByPath(cachedOption.value, this.valueKey) === getValueByPath(value, this.valueKey)
|
|
525
535
|
} else {
|
|
526
536
|
isEqual = cachedOption.value === value
|
|
527
|
-
|
|
528
|
-
|
|
537
|
+
|
|
538
|
+
if (initialLabel && isEqual) {
|
|
539
|
+
this.atualizarLabelOpcao(i, initialLabel)
|
|
529
540
|
}
|
|
530
541
|
}
|
|
531
542
|
|