Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selectBtnField: fix padding + inline display #3796

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Conversation

DavidFyon
Copy link
Contributor

@DavidFyon DavidFyon commented Oct 11, 2024

Description

Fix padding + inline display

Playground

<template>
	<PageContainer>
		<SelectBtnField
			v-model="value1"
			:items="items"
			label="Moyen de contact"
		/>

		<br /><br />

		<SelectBtnField
			v-model="value2"
			:items="items"
			multiple
			label="Moyen de contact"
		/>

		<br /><br />

		<SelectBtnField
			v-model="value3"
			:items="items"
			inline
			label="Moyen de contact"
		/>

		<br /><br />

		<SelectBtnField
			v-model="value4"
			:items="items"
			label="Moyen de contact"
			hint="Par défaut, le moyen de contact est l’email."
		/>

		<br /><br />

		<SelectBtnField
			v-model="value5"
			:items="items"
			v-model:error="error"
			v-model:error-messages="errorMessages"
			label="Moyen de contact"
		/>
		<VBtn
			color="primary"
			class="mt-3"
			@click="resetExample"
		>
			Réinitialiser
		</VBtn>
	</PageContainer>
</template>

<script lang="ts">
import { defineComponent } from "vue";

import type { SelectBtnItem } from '@/patterns/SelectBtnField/types';

import SelectBtnField from "@/patterns/SelectBtnField/SelectBtnField.vue";
import PageContainer from "@/elements/PageContainer/PageContainer.vue";

export default defineComponent({
	components: {
		PageContainer,
		SelectBtnField
	},
	data() {
		return {
			value1: null,
			value2: null,
			value3: null,
			value4: null,
			value5: null,

			items: [
				{
					text: 'Email',
					value: 'email'
				},
				{
					text: 'Courrier',
					value: 'courrier'
				},
				{
					text: 'SMS',
					value: 'sms'
				}
			] as SelectBtnItem[],

			error: true,

			errorMessages: [
				'Le champ est requis.'
			] as string[]

		};
	},
	methods: {
		resetExample(): void {
			this.value5 = null;
			this.error = true;
			this.errorMessages = ['Le champ est requis.'];
		}
	}
});
</script>

Type de changement

  • Correction de bug

Checklist

  • Ma Pull Request pointe vers la bonne branche
  • Mon code suit le style de code du projet
  • J'ai effectué une review de mon propre code
  • J'ai commenté mon code, en particulier dans les parties difficiles à comprendre
  • J'ai apporté les modifications correspondantes à la documentation
  • Mes modifications ne génèrent aucun nouveau warning
  • J'ai ajouté des tests qui prouvent que mon correctif est efficace ou que ma fonctionnalité fonctionne
  • Les tests unitaires passent localement avec mes modifications
  • J'ai mis à jour le fichier Changelog

@DavidFyon DavidFyon self-assigned this Oct 11, 2024
@DavidFyon DavidFyon changed the title fix selectBtnField selectBtnField: fix padding + inline display Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants