#8038 added new functionality in VnSelect and refactored styles #871
|
@ -394,7 +394,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:name="col.orderBy ?? col.name"
|
:name="col.orderBy ?? col.name"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:vertical="true"
|
:vertical="false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<slot
|
<slot
|
||||||
|
|
|
@ -138,8 +138,6 @@ onMounted(() => {
|
||||||
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
|
||||||
|
|
||||||
const arrayDataKey =
|
const arrayDataKey =
|
||||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
||||||
|
|
||||||
|
@ -259,6 +257,30 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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>
|
||||||
|
@ -269,6 +291,7 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
: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'])"
|
||||||
|
|
|
@ -241,7 +241,7 @@ input::-webkit-inner-spin-button {
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
padding: 1px 10px 1px 10px;
|
padding: 1px 10px 1px 10px;
|
||||||
max-width: 100px;
|
max-width: 130px;
|
||||||
div span {
|
div span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
Loading…
Reference in New Issue