docs(playground) : exemples required + email lowercase

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 12:03:15 +02:00
parent 3e09f4278e
commit 2d8639a913
3 changed files with 40 additions and 0 deletions
@@ -84,6 +84,24 @@
:success="dynamicSuccess" :success="dynamicSuccess"
/> />
</div> </div>
<div class="rounded-lg border p-4">
<h2 class="mb-4 text-xl font-bold">Email obligatoire</h2>
<MalioInputEmail
v-model="requiredEmail"
label="Email obligatoire"
:required="true"
/>
</div>
<div class="rounded-lg border p-4">
<h2 class="mb-4 text-xl font-bold">Email normalisé (minuscules)</h2>
<MalioInputEmail
v-model="lowercaseEmail"
label="Email normalisé (minuscules)"
:lowercase="true"
/>
</div>
</div> </div>
</template> </template>
@@ -92,6 +110,8 @@ import { computed, ref } from 'vue'
const emailValue = ref('') const emailValue = ref('')
const dynamicEmail = ref('') const dynamicEmail = ref('')
const requiredEmail = ref('')
const lowercaseEmail = ref('')
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
const isDynamicValid = computed(() => emailRegex.test(dynamicEmail.value)) const isDynamicValid = computed(() => emailRegex.test(dynamicEmail.value))
@@ -108,6 +108,14 @@
icon-size="20" icon-size="20"
/> />
</div> </div>
<div class="rounded-lg border p-4">
<h2 class="mb-4 text-xl font-bold">Champ obligatoire</h2>
<MalioInputText
label="Champ obligatoire"
:required="true"
/>
</div>
<div class="rounded-lg border p-4"> <div class="rounded-lg border p-4">
<h2 class="mb-4 text-xl font-bold">Avec masque</h2> <h2 class="mb-4 text-xl font-bold">Avec masque</h2>
<MalioInputText <MalioInputText
@@ -82,6 +82,17 @@
/> />
</div> </div>
<div class="rounded-lg border p-4">
<h2 class="mb-4 text-xl font-bold">Sélection obligatoire</h2>
<MalioSelect
v-model="requiredValue"
:options="options"
label="Sélection obligatoire"
:required="true"
empty-option-label="Aucune selection"
/>
</div>
<div class="rounded-lg border p-4"> <div class="rounded-lg border p-4">
<h2 class="mb-4 text-xl font-bold">Peu d'elements (2)</h2> <h2 class="mb-4 text-xl font-bold">Peu d'elements (2)</h2>
<MalioSelect <MalioSelect
@@ -151,6 +162,7 @@ const longOptions = [
{label: 'Republique tcheque', value: 'cz'}, {label: 'Republique tcheque', value: 'cz'},
] ]
const requiredValue = ref<string | number | null>(null)
const basicValue = ref<string | number | null>(null) const basicValue = ref<string | number | null>(null)
const labelValue = ref<string | number | null>(null) const labelValue = ref<string | number | null>(null)
const selectedValue = ref<string | number | null>('fr') const selectedValue = ref<string | number | null>('fr')