This repository was archived by the owner on Oct 17, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { Table } from '../../frontend/src/component/ui/Table' ;
3- import { array , number } from '@storybook/addon-knobs' ;
3+ import { array , number , text , select } from '@storybook/addon-knobs' ;
44
55export default {
66 title : 'UI/Table' ,
77 component : Table
88} ;
99
10+ function alignSelector ( label : string ) {
11+ return select (
12+ label ,
13+ {
14+ center : 'center' ,
15+ end : 'end' ,
16+ justify : 'justify' ,
17+ left : 'left' ,
18+ 'match-parent' : 'match-parent' ,
19+ right : 'right' ,
20+ start : 'start'
21+ } ,
22+ 'left'
23+ ) ;
24+ }
25+
1026export const table = ( ) => {
1127 const headers = array ( 'Header Columns' , [ 'Long Link' , 'Alias' ] ) ;
1228 return (
@@ -15,6 +31,16 @@ export const table = () => {
1531 rows = { new Array ( number ( 'Number of rows' , 2 ) )
1632 . fill ( 0 )
1733 . map ( ( _ , i ) => headers . map ( ( _ , j ) => `data ${ i } -${ j } ` ) ) }
34+ headerFontSize = { `${ number ( 'Header Font Size (px)' , 16 ) } px` }
35+ widths = { headers . map (
36+ ( _ , i ) => number ( `Column ${ i + 1 } Width (%)` , 50 ) + '%'
37+ ) }
38+ alignHeaders = { headers . map ( ( _ , i ) =>
39+ alignSelector ( `Column ${ i + 1 } Header Alignment (%)` )
40+ ) }
41+ alignBodyColumns = { headers . map ( ( _ , i ) =>
42+ alignSelector ( `Column ${ i + 1 } Body Column Alignment (%)` )
43+ ) }
1844 />
1945 ) ;
2046} ;
You can’t perform that action at this time.
0 commit comments