Newer
Older
import type { Meta, StoryObj } from '@storybook/vue3';
import Table from './Table.vue';
const meta: Meta = {
title: 'Components/Table',
component: Table,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'A component is used to display data in tabular format.',
fontSize: { control: 'text' },
gap: { control: 'text' },
size: { control: 'select', options: ['small', 'normal', 'large', 'huge'] },
showAllLines: { control: 'boolean' },
stripedRows: { control: 'boolean' },
multipleSort: { control: 'boolean' },
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
darknessTheme: { control: 'select', options: ['100', '200', '300', '400', '500', '600', '700', '800', '900'] },
darknessTextColor: {
control: 'select',
options: ['100', '200', '300', '400', '500', '600', '700', '800', '900'],
},
theme: {
control: 'select',
options: [
'white',
'blue',
'sky',
'cyan',
'teal',
'green',
'yellow',
'orange',
'pink',
'fuchsia',
'purple',
'indigo',
'rose',
'red',
'black',
],
},
textColor: {
control: 'select',
options: [
'white',
'blue',
'sky',
'cyan',
'teal',
'green',
'yellow',
'orange',
'pink',
'fuchsia',
'purple',
'indigo',
'rose',
'red',
'black',
],
},
},
args: {},
} satisfies Meta<typeof Table>;
export default meta;
type Story = StoryObj<typeof meta>;
args: {
columns: [
{
name: 'Name',
type: 'text',
},
{
name: 'Age',
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
},
{
name: 'Hobbies',
type: 'text',
},
],
data: [
[
{
value: 'Pete',
},
{
value: '30',
},
{
value: 'Chess',
},
],
[
{
value: 'John',
},
{
value: '25',
},
{
value: 'Football',
},
],
],
},
};
export const Full: Story = {
args: {
columns: [
{
name: 'Name',
type: 'text',
type: 'number',
sortable: true,
},
{
name: 'Hobbies',
type: 'text',
padding: '30px',
filterable: true,
sortable: true,
},
{
name: 'Country',
type: 'text',
data: [
[
{
value: 'Pete',
},
{
value: '30',
},
{
value: 'Chess',
},
{
value: 'USA',
},
],
[
{
value: 'John',
},
{
},
{
value: 'Football',
},
{
},
],
[
{
value: 'Дима',
},
{
value: '22',
},
{
value: 'Frontend',
},
{
value: 'Russia',
},
],
[
{
value: 'Ксюша',
},
{
value: '32',
},
{
value: 'Frontend',
},
{
value: 'Russia',
},
],
[
{
value: 'Ксюша',
},
{
value: '32',
},
{
value: 'Backend',
},
{
value: 'Russia',
},
],
showAllLines: true,
border: 'fuchsia',
theme: 'black',