#7936 improve InvoiceIn #1004
|
@ -259,28 +259,6 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
defineExpose({ opts: myOptions });
|
||||||
|
|
||||||
function handleKeyDown(event) {
|
|
||||||
if (event.key === 'Tab') {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const inputValue = vnSelectRef.value?.inputValue;
|
|
||||||
|
|
||||||
if (inputValue) {
|
|
||||||
const matchingOption = myOptions.value.find(
|
|
||||||
(option) =>
|
|
||||||
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
|
|
||||||
);
|
|
||||||
|
|
||||||
if (matchingOption) {
|
|
||||||
emit('update:modelValue', matchingOption[optionValue.value]);
|
|
||||||
} else {
|
|
||||||
emit('update:modelValue', inputValue);
|
|
||||||
}
|
|
||||||
vnSelectRef.value?.hidePopup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -291,7 +269,6 @@ function handleKeyDown(event) {
|
||||||
:option-value="optionValue"
|
:option-value="optionValue"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@filter="filterHandler"
|
@filter="filterHandler"
|
||||||
@keydown="handleKeyDown"
|
|
||||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||||
:map-options="nullishToTrue($attrs['map-options'])"
|
:map-options="nullishToTrue($attrs['map-options'])"
|
||||||
:use-input="nullishToTrue($attrs['use-input'])"
|
:use-input="nullishToTrue($attrs['use-input'])"
|
||||||
|
|
|
@ -208,7 +208,6 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
:filter-options="['id', 'vat']"
|
:filter-options="['id', 'vat']"
|
||||||
:hide-selected="false"
|
:hide-selected="false"
|
||||||
:fill-input="false"
|
|
||||||
:display-value="formatOpt(row, col, 'vat')"
|
:display-value="formatOpt(row, col, 'vat')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
@ -233,9 +232,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
:filter-options="['id', 'transaction']"
|
:filter-options="['id', 'transaction']"
|
||||||
:autofocus="col.tabIndex == 1"
|
:autofocus="col.tabIndex == 1"
|
||||||
input-debounce="0"
|
|
||||||
:hide-selected="false"
|
:hide-selected="false"
|
||||||
:fill-input="false"
|
|
||||||
:display-value="formatOpt(row, col, 'transaction')"
|
:display-value="formatOpt(row, col, 'transaction')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
|
Loading…
Reference in New Issue