From 75a3912727c27ab41801a68d415e8d5f8c8431b9 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 23 Feb 2026 08:56:27 +0100 Subject: [PATCH] feat : ajout du masque et de l'etat succes sur le texte --- .playground/pages/composant/inputText.vue | 50 ++++++++++------ app/assets/css/malio.css | 1 + app/components/malio/InputText.vue | 73 +++++++++++++++-------- nuxt.config.ts | 1 + package-lock.json | 9 ++- package.json | 3 +- 6 files changed, 93 insertions(+), 44 deletions(-) diff --git a/.playground/pages/composant/inputText.vue b/.playground/pages/composant/inputText.vue index aa18af6..56f1032 100644 --- a/.playground/pages/composant/inputText.vue +++ b/.playground/pages/composant/inputText.vue @@ -2,7 +2,7 @@

Simple

- +
@@ -44,7 +44,7 @@
-

Hint et erreur

+

Hint,erreur et succes

-
- -
-

Largeurs

-
+
- -
-

Erreur + icône

+
+

Succes + icône

+ +

Hint + icône

@@ -120,6 +117,13 @@ icon-size="20" />
+
+

Avec masque

+ +
@@ -129,4 +133,14 @@ const nameValue = ref('') const searchValue = ref('') const emailValue = ref('') const cityValue = ref('') + +const maskOptions = { + mask: '@@-###-@@', + tokens: { + '@': { + pattern: /[A-Za-z]/, + transform: (char: string) => char.toUpperCase() + } + } +} diff --git a/app/assets/css/malio.css b/app/assets/css/malio.css index 97ff80e..69ff193 100644 --- a/app/assets/css/malio.css +++ b/app/assets/css/malio.css @@ -14,5 +14,6 @@ --m-bg: 243 244 248; /* Couleur de fond générale */ --m-error: 155 17 30; /* rouge pur pour les erreurs */ + --m-success: 15 149 70; /* rouge pur pour les erreurs */ } } diff --git a/app/components/malio/InputText.vue b/app/components/malio/InputText.vue index 2833115..9683165 100644 --- a/app/components/malio/InputText.vue +++ b/app/components/malio/InputText.vue @@ -5,14 +5,17 @@ > -

- {{ hint }} -

+

+ {{ hint }} +

-

- {{ error }} -

+

+ {{ error }} +

+ +

+ {{ successMessage }} +