import type { Meta, StoryObj } from '@storybook/vue3' import RangeField from './RangeField.vue' const meta = { title: 'Composants/Formulaires/RangeField', component: RangeField, argTypes: { 'min': { control: 'number', description: 'Valeur minimale du champ', table: { type: { summary: 'number', }, }, }, 'max': { control: 'number', description: 'Valeur maximale du champ', table: { type: { summary: 'number', }, }, }, 'step': { control: 'number', description: 'Le pas du slider', table: { type: { summary: 'number', }, }, }, 'modelValue': { control: 'object', description: 'Valeur du champ', defaultValue: [0, 0], table: { category: 'props', type: { summary: '[number, number]', }, }, }, 'onUpdate:modelValue': { action: 'update:modelValue', description: 'Événement émis lors de la modification de la valeur du champ', table: { category: 'events', type: { summary: '[number, number]', }, }, }, 'bgColor': { control: 'color', description: 'Couleur de fond du champ', table: { type: { summary: 'string', }, }, }, 'fieldsetLabel': { control: 'text', description: 'Label du champ du fieldset, si passé a false, le champ est affiché sans fieldset. Il faudra alors veiller a ajouter un titre.', table: { type: { summary: 'string | false', }, defaultValue: { summary: 'false', }, }, }, 'thumbMinLabel': { control: 'text', description: 'Label du curseur min', table: { type: { summary: 'string', }, defaultValue: { summary: 'Valeur min', }, }, }, 'thumbMaxLabel': { control: 'text', description: 'Label du curseur max', table: { type: { summary: 'string', }, defaultValue: { summary: 'Valeur max', }, }, }, 'textFieldMinLabel': { control: 'text', description: 'Label du champ min', table: { type: { summary: 'string', }, defaultValue: { summary: 'Valeur min', }, }, }, 'textFieldMaxLabel': { control: 'text', description: 'Label du champ max', table: { type: { summary: 'string', }, defaultValue: { summary: 'Valeur max', }, }, }, 'vuetifyOptions': { control: 'object', description: 'Personnalisation des composants Vuetify internes', table: { category: 'props', defaultValue: { detail: ` { textField: { hideDetails: true, class: 'ma-3', variant: 'outlined', }, }`, }, type: { summary: 'Record', detail: ` { textField?: Record, rangeSlider?: Record, } `, }, }, }, }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { parameters: { sourceCode: [ { name: 'Template', code: ` `, }, { name: 'Script', code: ` `, }, ], }, } export const OtherRange: Story = { args: { min: -50, max: 50, }, parameters: { sourceCode: [ { name: 'Template', code: ` `, }, { name: 'Script', code: ` `, }, ], }, } export const Customization: Story = { args: { vuetifyOptions: { textField: { variant: 'plain', }, rangeSlider: { 'thumb-color': 'purple', 'track-color': 'LightSteelBlue', 'track-fill-color': 'purple', }, }, }, parameters: { sourceCode: [ { name: 'Template', code: ` `, }, { name: 'Script', code: ` `, }, ], }, }