@tagplus/components 4.10.3 → 4.10.5
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/demo.html +1 -0
- package/dist/fonts/bevi-bold.7e4dcd11.woff +0 -0
- package/dist/fonts/bevi-bold.873def84.woff2 +0 -0
- package/dist/fonts/bevi-medium.6187e050.woff2 +0 -0
- package/dist/fonts/bevi-medium.65b3056d.woff +0 -0
- package/dist/fonts/bevi-regular.c89f126e.woff +0 -0
- package/dist/fonts/bevi-regular.f81e4b8f.woff2 +0 -0
- package/dist/tp.common.js +2 -0
- package/dist/tp.common.js.map +1 -0
- package/dist/tp.css +167 -0
- package/dist/tp.umd.js +2 -0
- package/dist/tp.umd.js.map +1 -0
- package/dist/tp.umd.min.js +2 -0
- package/dist/tp.umd.min.js.map +1 -0
- package/package.json +1 -1
- package/src/components/Autosuggest/Autosuggest.vue +55 -0
package/package.json
CHANGED
|
@@ -379,6 +379,25 @@ export default {
|
|
|
379
379
|
}
|
|
380
380
|
},
|
|
381
381
|
|
|
382
|
+
watch: {
|
|
383
|
+
suggestions () {
|
|
384
|
+
// Quando os resultados da busca chegam e há um select pendente (Enter pressionado antes da busca completar)
|
|
385
|
+
if (this._pendingSelectAfterSearch) {
|
|
386
|
+
this._pendingSelectAfterSearch = false
|
|
387
|
+
this.$nextTick(() => {
|
|
388
|
+
// Seleciona o primeiro item visível (não-created) da lista
|
|
389
|
+
for (let i = 0; i < this.options.length; ++i) {
|
|
390
|
+
const option = this.options[i]
|
|
391
|
+
if (!option.disabled && !option.groupDisabled && option.visible && !option.created) {
|
|
392
|
+
this.handleOptionSelect(option)
|
|
393
|
+
return
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
|
|
382
401
|
created () {
|
|
383
402
|
this.debouncedOnInputChange = debounce(this.debounce, e => {
|
|
384
403
|
// Correção para mobile ativar a busca enquanto digita
|
|
@@ -562,6 +581,42 @@ export default {
|
|
|
562
581
|
return newOption
|
|
563
582
|
},
|
|
564
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Sobrescreve selectOption do el-select para evitar que o mouseenter de um item da lista
|
|
586
|
+
* sobreponha a seleção correta ao pressionar Enter (ex: leitor de código de barras).
|
|
587
|
+
* Quando o texto digitado ainda não foi buscado (debounce pendente), dispara a busca
|
|
588
|
+
* imediatamente e seleciona o primeiro resultado quando a lista atualizar.
|
|
589
|
+
*/
|
|
590
|
+
selectOption () {
|
|
591
|
+
if (!this.visible) {
|
|
592
|
+
this.toggleMenu()
|
|
593
|
+
return
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// Se o usuário digitou algo novo que ainda não foi buscado (debounce pendente)
|
|
597
|
+
if (this.filterable && this.selectedLabel && this.selectedLabel !== this.query) {
|
|
598
|
+
// Dispara a busca imediatamente sem esperar o debounce
|
|
599
|
+
this._pendingSelectAfterSearch = true
|
|
600
|
+
this.onInputChange()
|
|
601
|
+
return
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Recalcula o hoverIndex para o primeiro item visível, ignorando hover do mouse
|
|
605
|
+
if (this.query) {
|
|
606
|
+
for (let i = 0; i < this.options.length; ++i) {
|
|
607
|
+
const option = this.options[i]
|
|
608
|
+
if (!option.disabled && !option.groupDisabled && option.visible && !option.created) {
|
|
609
|
+
this.hoverIndex = i
|
|
610
|
+
break
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if (this.options[this.hoverIndex]) {
|
|
616
|
+
this.handleOptionSelect(this.options[this.hoverIndex])
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
|
|
565
620
|
checkDefaultFirstOption () {
|
|
566
621
|
this.$nextTick(() => {
|
|
567
622
|
this.hoverIndex = -1
|