fix(transport) : immatriculations LIOT filtrées via mask maska (focus/curseur natifs, plus de hack) (ERP-193)
This commit is contained in:
@@ -30,9 +30,8 @@
|
||||
MalioInputText (inheritAttrs:false) renvoie `class` sur l'input. -->
|
||||
<div v-if="isLiot" class="col-span-2 xl:col-span-3">
|
||||
<MalioInputText
|
||||
:key="liotPlatesKey"
|
||||
:model-value="main.liotPlates"
|
||||
@update:model-value="onLiotPlatesInput"
|
||||
v-model="main.liotPlates"
|
||||
:mask="LIOT_PLATES_MASK"
|
||||
:label="t('transport.carriers.form.main.liotPlates')"
|
||||
:hint="t('transport.carriers.form.main.liotPlatesHint')"
|
||||
:required="true"
|
||||
@@ -220,7 +219,7 @@ import CarrierQualimatTab from '~/modules/transport/components/CarrierQualimatTa
|
||||
import { useCarrierForm } from '~/modules/transport/composables/useCarrierForm'
|
||||
import { useCarrier } from '~/modules/transport/composables/useCarrier'
|
||||
import type { QualimatCarrierRow } from '~/modules/transport/composables/useQualimatSearch'
|
||||
import { clampPercent, sanitizeDecimal, sanitizeLiotPlates } from '~/modules/transport/utils/forms/numberInput'
|
||||
import { clampPercent, LIOT_PLATES_MASK, sanitizeDecimal } from '~/modules/transport/utils/forms/numberInput'
|
||||
import { sanitizeFreeText } from '~/shared/utils/textSanitize'
|
||||
|
||||
interface SelectOption {
|
||||
@@ -371,20 +370,6 @@ function onIndexationInput(value: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
// Immatriculations LIOT : la clé force le ré-affichage quand le filtrage laisse le
|
||||
// modelValue inchangé (ex: caractère interdit seul tapé) — sinon le DOM garderait
|
||||
// le caractère parasite alors que le modèle est déjà propre.
|
||||
const liotPlatesKey = ref(0)
|
||||
|
||||
/** Saisie des immatriculations LIOT : filtre la saisie et re-synchronise si filtré. */
|
||||
function onLiotPlatesInput(value: string): void {
|
||||
const clean = sanitizeLiotPlates(value)
|
||||
main.liotPlates = clean
|
||||
if (clean !== value) {
|
||||
liotPlatesKey.value += 1
|
||||
}
|
||||
}
|
||||
|
||||
function goBack(): void {
|
||||
router.push(`/carriers/${carrierId}`)
|
||||
}
|
||||
|
||||
@@ -33,9 +33,8 @@
|
||||
`class` sur l'input interne, pas sur la cellule de grille. -->
|
||||
<div v-if="isLiot" class="col-span-2 xl:col-span-3">
|
||||
<MalioInputText
|
||||
:key="liotPlatesKey"
|
||||
:model-value="main.liotPlates"
|
||||
@update:model-value="onLiotPlatesInput"
|
||||
v-model="main.liotPlates"
|
||||
:mask="LIOT_PLATES_MASK"
|
||||
:label="t('transport.carriers.form.main.liotPlates')"
|
||||
:hint="t('transport.carriers.form.main.liotPlatesHint')"
|
||||
:required="true"
|
||||
@@ -314,7 +313,7 @@ import CarrierPriceBlock from '~/modules/transport/components/CarrierPriceBlock.
|
||||
import CarrierQualimatTab from '~/modules/transport/components/CarrierQualimatTab.vue'
|
||||
import { useCarrierForm } from '~/modules/transport/composables/useCarrierForm'
|
||||
import type { QualimatCarrierRow } from '~/modules/transport/composables/useQualimatSearch'
|
||||
import { clampPercent, sanitizeDecimal, sanitizeLiotPlates } from '~/modules/transport/utils/forms/numberInput'
|
||||
import { clampPercent, LIOT_PLATES_MASK, sanitizeDecimal } from '~/modules/transport/utils/forms/numberInput'
|
||||
import { sanitizeFreeText } from '~/shared/utils/textSanitize'
|
||||
|
||||
interface SelectOption {
|
||||
@@ -580,20 +579,6 @@ function onIndexationInput(value: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
// Immatriculations LIOT : la clé force le ré-affichage quand le filtrage laisse le
|
||||
// modelValue inchangé (ex: caractère interdit seul tapé) — sinon le DOM garderait
|
||||
// le caractère parasite alors que le modèle est déjà propre.
|
||||
const liotPlatesKey = ref(0)
|
||||
|
||||
/** Saisie des immatriculations LIOT : filtre la saisie et re-synchronise si filtré. */
|
||||
function onLiotPlatesInput(value: string): void {
|
||||
const clean = sanitizeLiotPlates(value)
|
||||
main.liotPlates = clean
|
||||
if (clean !== value) {
|
||||
liotPlatesKey.value += 1
|
||||
}
|
||||
}
|
||||
|
||||
/** Retour vers le repertoire transporteurs (fleche d'en-tete). */
|
||||
function goBack(): void {
|
||||
router.push('/carriers')
|
||||
|
||||
Reference in New Issue
Block a user