File tree Expand file tree Collapse file tree
assets/src/components/repeater/layout/table Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import type { Meta , StoryObj } from '@storybook/react-vite'
2+
3+ import { Field } from '../../../../index'
4+
5+ const fields = [
6+ {
7+ label : 'Text' ,
8+ type : 'text' ,
9+ name : 'text_name' ,
10+ } ,
11+ {
12+ label : 'Date field' ,
13+ type : 'date-picker' ,
14+ name : 'date_picker_name' ,
15+ } ,
16+ {
17+ label : 'Color' ,
18+ type : 'color-picker' ,
19+ name : 'color' ,
20+ } ,
21+ ]
22+
23+ const meta = {
24+ title : 'Repeater (Legacy)/Table' ,
25+ component : Field ,
26+ decorators : [
27+ Story => (
28+ < div style = { { minWidth : '600px' } } >
29+ < Story />
30+ </ div >
31+ )
32+ ] ,
33+ parameters : {
34+ layout : 'padded'
35+ } ,
36+ args : {
37+ type : 'repeater' ,
38+ label : 'Repeater field' ,
39+ layout : 'table' ,
40+ fields : fields ,
41+ }
42+ } satisfies Meta < typeof Field >
43+
44+ export default meta
45+
46+ type Story = StoryObj < typeof meta >
47+
48+ export const Default : Story = { }
49+
50+ export const NonRepeatable : Story = {
51+ args : {
52+ repeatable : false ,
53+ }
54+ }
55+
56+ export const MaxRows : Story = {
57+ args : {
58+ maxlength : 3 ,
59+ }
60+ }
61+
62+ /**
63+ * With bulk actions for batch operations on rows
64+ */
65+ export const BulkActions : Story = {
66+ args : {
67+ useBulk : true ,
68+ }
69+ }
You can’t perform that action at this time.
0 commit comments