1- import React , { useCallback } from 'react' ;
1+ import React , { useCallback } from 'react' ;
22import XHRMock from 'xhr-mock' ;
3- import { storiesOf } from '@storybook/react' ;
3+ import { storiesOf } from '@storybook/react' ;
44import Grid from '../src/index' ;
55import TuiGrid from 'tui-grid' ;
6- import { actions } from '@storybook/addon-actions' ;
7- import { withKnobs , number , radios , button , object , array } from '@storybook/addon-knobs' ;
8- import { data } from './dummy-data' ;
6+ import { actions } from '@storybook/addon-actions' ;
7+ import { withKnobs , number , radios , button , object , array } from '@storybook/addon-knobs' ;
8+ import { data } from './dummy-data' ;
99import 'tui-grid/dist/tui-grid.css' ;
1010import 'tui-pagination/dist/tui-pagination.css' ;
1111
1212const columns = [
13- { header : 'Name' , name : 'name' } ,
14- { header : 'Artist' , name : 'artist' } ,
15- { header : 'Type' , name : 'type' , editor : 'text' } ,
16- { header : 'Release' , name : 'release' , editor : 'text' } ,
17- { header : 'Genre' , name : 'genre' , editor : 'text' }
13+ { header : 'Name' , name : 'name' } ,
14+ { header : 'Artist' , name : 'artist' } ,
15+ { header : 'Type' , name : 'type' , editor : 'text' } ,
16+ { header : 'Release' , name : 'release' , editor : 'text' } ,
17+ { header : 'Genre' , name : 'genre' , editor : 'text' }
1818] ;
1919
2020const stories = storiesOf ( 'Toast UI Grid' , module ) . addDecorator ( withKnobs ) ;
2121
22- stories . add ( 'Normal' , ( ) => < Grid columns = { columns } data = { data } header = { { height : 60 } } /> ) ;
22+ stories . add ( 'Normal' , ( ) => < Grid columns = { columns } data = { data } header = { { height : 60 } } /> ) ;
2323
2424stories . add ( 'Set Language' , ( ) => {
2525 const options = {
@@ -85,7 +85,7 @@ stories.add('Using Method', () => {
8585 }
8686
8787 handleClickAppend = ( ) => {
88- this . grid . appendRow ( { } , { at : 0 } ) ;
88+ this . grid . appendRow ( { } , { at : 0 } ) ;
8989 } ;
9090
9191 handleClickSort = ( ) => {
@@ -206,15 +206,17 @@ stories.add('dataSource', () => {
206206 withCredentials : false ,
207207 initialRequest : true ,
208208 api : {
209- readData : { url : 'api/readData' , method : 'GET' }
209+ readData : { url : 'api/readData' , method : 'GET' }
210210 }
211211 } ;
212212
213- return < Grid columns = { columns } pagination = { true } data = { dataSource } pageOptions = { { perPage : 3 } } /> ;
213+ return (
214+ < Grid columns = { columns } pagination = { true } data = { dataSource } pageOptions = { { perPage : 3 } } />
215+ ) ;
214216} ) ;
215217
216218stories . add ( 'hook' , ( ) => {
217- const condition = radios ( 'condition' , { true : 'true' , false : 'false' } , 'true' ) ;
219+ const condition = radios ( 'condition' , { true : 'true' , false : 'false' } , 'true' ) ;
218220 const ReactComponent = ( ) => {
219221 const onClick = useCallback ( ( ) => {
220222 console . log ( 'condition:' , condition ) ;
@@ -227,7 +229,7 @@ stories.add('hook', () => {
227229} ) ;
228230
229231stories . add ( 'change event based on condition' , ( ) => {
230- const condition = radios ( 'condition' , { true : 'true' , false : 'false' } , 'true' ) ;
232+ const condition = radios ( 'condition' , { true : 'true' , false : 'false' } , 'true' ) ;
231233
232234 return (
233235 < Grid
0 commit comments