|
1 | | -import type { Meta, StoryObj } from '@storybook/vue3-vite' |
2 | | -import { fn } from 'storybook/test' |
3 | | -import VuSearch from './VuSearch.vue' |
| 1 | +import type { Meta, StoryObj } from '@storybook/vue3-vite'; |
| 2 | +import { fn } from 'storybook/test'; |
| 3 | +import VuSearch from './VuSearch.vue'; |
4 | 4 |
|
5 | 5 | const meta = { |
6 | | - title: 'Viribus Unitis/Search', |
7 | | - component: VuSearch, |
8 | | - tags: ['autodocs'], |
9 | | - args: { |
10 | | - onClickFilter: fn(), |
11 | | - 'onUpdate:modelValue': fn(), |
12 | | - placeholder: 'Поиск преподавателя', |
13 | | - }, |
14 | | - argTypes: { |
15 | | - modelValue: { |
16 | | - control: 'text', |
17 | | - description: 'Значение v-model', |
18 | | - }, |
19 | | - placeholder: { |
20 | | - control: 'text', |
21 | | - description: 'Текст плейсхолдера', |
22 | | - }, |
23 | | - }, |
24 | | -} satisfies Meta<typeof VuSearch> |
| 6 | + title: 'Viribus Unitis/Search', |
| 7 | + component: VuSearch, |
| 8 | + tags: ['autodocs'], |
| 9 | + args: { |
| 10 | + 'onClick:filter': fn(), |
| 11 | + 'onUpdate:modelValue': fn(), |
| 12 | + placeholder: 'Поиск преподавателя', |
| 13 | + }, |
| 14 | + argTypes: { |
| 15 | + modelValue: { |
| 16 | + control: 'text', |
| 17 | + description: 'Значение v-model', |
| 18 | + }, |
| 19 | + placeholder: { |
| 20 | + control: 'text', |
| 21 | + description: 'Текст плейсхолдера', |
| 22 | + }, |
| 23 | + }, |
| 24 | +} satisfies Meta<typeof VuSearch>; |
25 | 25 |
|
26 | | -export default meta |
27 | | -type Story = StoryObj<typeof meta> |
| 26 | +export default meta; |
| 27 | +type Story = StoryObj<typeof meta>; |
28 | 28 |
|
29 | 29 | export const Default: Story = { |
30 | | - args: { |
31 | | - modelValue: '', |
32 | | - }, |
33 | | -} |
| 30 | + args: { |
| 31 | + modelValue: '', |
| 32 | + }, |
| 33 | +}; |
34 | 34 |
|
35 | 35 | export const WithValue: Story = { |
36 | | - args: { |
37 | | - modelValue: 'Поисковый запрос', |
38 | | - }, |
39 | | -} |
| 36 | + args: { |
| 37 | + modelValue: 'Поисковый запрос', |
| 38 | + }, |
| 39 | +}; |
40 | 40 |
|
41 | 41 | export const Hovered: Story = { |
42 | | - parameters: { |
43 | | - pseudo: { |
44 | | - hover: true, |
45 | | - }, |
46 | | - }, |
47 | | -} |
| 42 | + parameters: { |
| 43 | + pseudo: { |
| 44 | + hover: true, |
| 45 | + }, |
| 46 | + }, |
| 47 | +}; |
48 | 48 |
|
49 | 49 | export const Active: Story = { |
50 | | - args: { |
51 | | - modelValue: 'Печатаем...', |
52 | | - }, |
53 | | - play: ({ canvasElement }) => { |
54 | | - const field = canvasElement.querySelector('.v-field') |
55 | | - field?.classList.add('v-field--focused') |
56 | | - }, |
57 | | -} |
| 50 | + args: { |
| 51 | + modelValue: 'Печатаем...', |
| 52 | + }, |
| 53 | + play: ({ canvasElement }) => { |
| 54 | + const field = canvasElement.querySelector('.v-field'); |
| 55 | + field?.classList.add('v-field--focused'); |
| 56 | + }, |
| 57 | +}; |
0 commit comments