@tagplus/components 4.7.15 → 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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "email": "bruno@tagplus.com.br"
9
9
  }
10
10
  ],
11
- "version": "4.7.15",
11
+ "version": "4.7.16",
12
12
  "main": "./dist/tp.common.js",
13
13
  "directories": {
14
14
  "lib": "src/lib"
@@ -327,10 +327,7 @@ export default {
327
327
 
328
328
  return this.filterable && this.allowCreate && !hasExistingOption
329
329
  },
330
- // Monta a lista com ou sem "Cadastrar Novo Item"
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) {
@@ -480,7 +483,7 @@ export default {
480
483
 
481
484
  /** Atualiza a label de algum dos elementos da listagem do altosuggest */
482
485
  atualizarLabelOpcao (index, val) {
483
- this.suggestionsList[index][this.labelKey] = val
486
+ this.rawSuggestionsList[index].label = val
484
487
  },
485
488
 
486
489
  /**
@@ -524,11 +527,14 @@ export default {
524
527
 
525
528
  for (let i = 0; i <= this.cachedOptions.length - 1; i++) {
526
529
  const cachedOption = this.cachedOptions[i]
530
+
527
531
  let isEqual = false
532
+
528
533
  if (isObject) {
529
534
  isEqual = getValueByPath(cachedOption.value, this.valueKey) === getValueByPath(value, this.valueKey)
530
535
  } else {
531
536
  isEqual = cachedOption.value === value
537
+
532
538
  if (initialLabel && isEqual) {
533
539
  this.atualizarLabelOpcao(i, initialLabel)
534
540
  }