File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ export default from './data-table';
8
8
export default from './forms/input' ;
9
9
export default from './forms/input/inline' ;
10
10
export default from './icon' ;
11
+ export default from './lookup' ;
11
12
export default from './spinner' ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { storiesOf , action } from '@kadira/storybook' ;
3
+
4
+ import { LOOKUP } from '../../utilities/constants' ;
5
+ import Lookup from '../../components/lookup' ;
6
+
7
+ const DemoLookup = React . createClass ( {
8
+ displayName : 'DemoLookup' ,
9
+
10
+ getInitialState ( ) {
11
+ return {
12
+ options : [
13
+ { label : 'File 1' } ,
14
+ { label : 'File 2' } ,
15
+ { label : 'File 3' } ,
16
+ { label : 'File 4' }
17
+ ]
18
+ } ;
19
+ } ,
20
+
21
+ render ( ) {
22
+ return (
23
+ < Lookup
24
+ { ...this . props }
25
+ onChange = { action ( 'change' ) }
26
+ onSelect = { this . handleSelect }
27
+ options = { this . state . options }
28
+ selectedItem = { this . state . selectedItem }
29
+ />
30
+ ) ;
31
+ } ,
32
+
33
+ handleSelect ( selectedItem , ...rest ) {
34
+ action ( 'select' ) ( selectedItem , ...rest ) ;
35
+
36
+ this . setState ( { selectedItem } ) ;
37
+ }
38
+ } ) ;
39
+
40
+ storiesOf ( LOOKUP , module )
41
+ . addDecorator ( getStory => < div className = "slds-p-around--medium" > { getStory ( ) } </ div > )
42
+ . add ( 'standard' , ( ) => < DemoLookup
43
+ emptyMessage = "No Files found"
44
+ hasError = { false }
45
+ iconCategory = "utility"
46
+ iconInverse = { false }
47
+ iconName = "open_folder"
48
+ label = "Files"
49
+ /> ) ;
You can’t perform that action at this time.
0 commit comments