import type { StoryObj, Meta } from '@storybook/vue3-vite'
import { ref } from 'vue'
import RatingPicker from './RatingPicker.vue'
import { VBtn, VSpacer } from 'vuetify/components'
import { fn } from 'storybook/test'
import SyTextArea from '../SyTextArea/SyTextArea.vue'
import SyForm from '../Customs/SyForm/SyForm.vue'
import DialogBox from '../DialogBox/DialogBox.vue'
import SyAlert from '../SyAlert/SyAlert.vue'
import './RatingPicker.stories.scss'
const meta = {
title: 'Composants/Feedback/RatingPicker',
component: RatingPicker,
decorators: [
() => ({
template: '
',
}),
],
parameters: {
layout: 'fullscreen',
controls: {
exclude: /^on*/,
},
},
argTypes: {
locales: {
description: 'Surcharge des chaînes affichées à l\'utilisateur (libellés de notation et messages d\'état). Les valeurs par défaut sont définies dans le fichier `locales.ts` du composant. La prop accepte un objet partiel : seules les clés renseignées surchargent les valeurs par défaut, le reste est conservé.',
control: 'object',
table: {
type: { summary: 'object', detail: `{
thanks: string,
etoiles: (n: number) => string,
defaultEmotionLabels: unknown[],
toValidate: string,
validated: string,
ratingAriaLabel: (index: number, length: number) => string,
}` },
category: 'props',
},
},
type: {
description: 'Le type de notation.',
control: 'select',
options: ['emotion', 'number', 'stars'],
default: 'emotion',
table: {
type: {
summary: 'emotion, number, stars',
},
defaultValue: {
summary: 'emotion',
},
},
},
label: {
description: 'Le libellé du champ.',
control: 'text',
default: null,
table: {
type: {
summary: 'string | null',
},
},
},
center: {
description: 'Si le champ doit être centré dans la page.',
control: 'boolean',
default: false,
table: {
type: {
summary: 'boolean',
},
},
},
readonly: {
description: 'Si le champ est en lecture seule.',
control: 'boolean',
default: false,
table: {
type: {
summary: 'boolean',
},
},
},
itemLabels: {
description: 'Les libellés des items.',
control: 'object',
default: null,
table: {
type: {
summary: 'string[]',
},
},
},
twoEmotions: {
description: 'Si le champ est en deux émotions.',
control: 'boolean',
default: false,
table: {
type: {
summary: 'boolean',
},
},
},
hideAlert: {
description: 'Si le champ est en alerte.',
control: 'boolean',
default: false,
table: {
type: {
summary: 'boolean',
},
},
},
modelValue: {
description: 'La valeur sélectionnée.',
control: 'number',
default: -1,
table: {
type: {
summary: 'number',
},
},
},
freeTextLabel: {
description: 'Le libellé du champ de texte libre. Ajouter aria-label ou aria-labelledby au