|
|
@@ -118,7 +118,6 @@
|
|
|
input-class="text-text"
|
|
|
input-debounce="0"
|
|
|
map-options
|
|
|
- maxlength="3"
|
|
|
menu-anchor="bottom left"
|
|
|
menu-self="top left"
|
|
|
options-dense
|
|
|
@@ -354,14 +353,8 @@ const getBankList = (response) => {
|
|
|
//
|
|
|
|
|
|
const filterBanks = (val, update) => {
|
|
|
- const sanitized = onlyBankCodeDigits(val);
|
|
|
-
|
|
|
- if (val !== sanitized) {
|
|
|
- bankSelectRef.value?.updateInputValue(sanitized, true);
|
|
|
- }
|
|
|
-
|
|
|
update(() => {
|
|
|
- const needle = normalizeText(sanitized);
|
|
|
+ const needle = normalizeText(val).trim();
|
|
|
|
|
|
if (!needle) {
|
|
|
setBankOptions(banks.value);
|
|
|
@@ -370,8 +363,9 @@ const filterBanks = (val, update) => {
|
|
|
|
|
|
const filtered = banks.value.filter((bank) => {
|
|
|
const code = getBankCode(bank);
|
|
|
+ const name = normalizeText(getBankName(bank));
|
|
|
|
|
|
- return code.includes(needle);
|
|
|
+ return code.includes(needle) || name.includes(needle);
|
|
|
});
|
|
|
|
|
|
setBankOptions(filtered);
|
|
|
@@ -396,8 +390,6 @@ const normalizeText = (text) =>
|
|
|
.replace(/[\u0300-\u036f]/g, '')
|
|
|
.toLowerCase();
|
|
|
|
|
|
-const onlyBankCodeDigits = (value) => String(value ?? '').replace(/\D/g, '').slice(0, 3);
|
|
|
-
|
|
|
const setBankOptions = (list) => {
|
|
|
bankOptions.value = list.map(formatBankOption).filter((bank) => bank.code);
|
|
|
};
|
|
|
@@ -419,13 +411,7 @@ const clearInvalidBankInput = () => {
|
|
|
};
|
|
|
|
|
|
const onBankInputValue = (value) => {
|
|
|
- const sanitized = onlyBankCodeDigits(value);
|
|
|
-
|
|
|
- if (value !== sanitized) {
|
|
|
- bankSelectRef.value?.updateInputValue(sanitized, true);
|
|
|
- }
|
|
|
-
|
|
|
- if (sanitized !== bankForm.bank) {
|
|
|
+ if (String(value ?? '') !== bankForm.bank) {
|
|
|
bankForm.bank = '';
|
|
|
}
|
|
|
};
|