-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
964 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,127 @@ | ||
import React, { Component } from 'react'; | ||
import { DocsTile, DocsText, Separator, Header, Description, Import, Properties } from '../'; | ||
import { | ||
DocsTile, | ||
DocsText, | ||
Separator, | ||
Header, | ||
Description, | ||
Import, | ||
Properties | ||
} from '../'; | ||
import { MultiInput } from '../'; | ||
|
||
export class MultiInputComponent extends Component { | ||
data = [ | ||
'Apple', | ||
'Apricot', | ||
'Acai', | ||
'African Moringa', | ||
'Bearberry', | ||
'Bilberry', | ||
'Blood orange', | ||
'Barbadine', | ||
'Barbados cherry', | ||
'Balsam Apple', | ||
'Chokeberry', | ||
'Cranberry', | ||
'Cupuacu' | ||
]; | ||
data = [ | ||
'Apple', | ||
'Apricot', | ||
'Acai', | ||
'African Moringa', | ||
'Bearberry', | ||
'Bilberry', | ||
'Blood orange', | ||
'Barbadine', | ||
'Barbados cherry', | ||
'Balsam Apple', | ||
'Chokeberry', | ||
'Cranberry', | ||
'Cupuacu' | ||
]; | ||
|
||
constructor(props) { | ||
super(props); | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
data: [] | ||
}; | ||
} | ||
|
||
performTagsUpdate = aTags => { | ||
// console.log(aTags); | ||
this.state = { | ||
data: [] | ||
}; | ||
} | ||
|
||
performTagsUpdate = aTags => { | ||
alert(aTags); | ||
}; | ||
|
||
multiInputCode = `<MultiInput | ||
multiInputCode = `<MultiInput | ||
data={this.data} | ||
onTagsUpdate={this.performTagsUpdate} | ||
placeHolder="Select a Fruit" | ||
/>`; | ||
|
||
multiInputCompactCode = `<MultiInput | ||
multiInputCompactCode = `<MultiInput | ||
data={this.data} | ||
onTagsUpdate={this.performTagsUpdate} | ||
placeHolder="Select a Fruit" | ||
compact={true} | ||
/>`; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<Header>Multi Input</Header> | ||
<Description /> | ||
<Import module='MultiInput' path='/fundamental-react/src/' /> | ||
render() { | ||
return ( | ||
<div> | ||
<Header>Multi Input</Header> | ||
<Description /> | ||
<Import module='MultiInput' path='/fundamental-react/src/' /> | ||
|
||
<Separator /> | ||
<Separator /> | ||
|
||
<Properties | ||
type='Inputs' | ||
properties={[ | ||
{ | ||
name: 'data', | ||
description: 'array (Required) - Collection of items to display in the list.' | ||
}, | ||
{ | ||
name: 'placeHolder', | ||
description: 'string - The text to use as placeholder when no text is entered.' | ||
}, | ||
{ | ||
name: 'onTagsUpdate', | ||
description: | ||
'func - Method to fire on add or remove of tag. Component returns array of tags selected.' | ||
}, | ||
{ | ||
name: 'compact', | ||
description: 'bool - true: display compact style, false: default style' | ||
} | ||
]} /> | ||
<Properties | ||
type='Inputs' | ||
properties={[ | ||
{ | ||
name: 'data', | ||
description: | ||
'array (Required) - Collection of items to display in the list.' | ||
}, | ||
{ | ||
name: 'placeHolder', | ||
description: | ||
'string - The text to use as placeholder when no text is entered.' | ||
}, | ||
{ | ||
name: 'onTagsUpdate', | ||
description: | ||
'func - Method to fire on add or remove of tag. Component returns array of tags selected.' | ||
}, | ||
{ | ||
name: 'compact', | ||
description: | ||
'bool - true: display compact style, false: default style' | ||
} | ||
]} /> | ||
|
||
<Separator /> | ||
<Separator /> | ||
|
||
<h2>Default</h2> | ||
<Description>A text input when on focus will show list of items to select.</Description> | ||
<DocsTile> | ||
<div> | ||
<MultiInput | ||
data={this.data} | ||
onTagsUpdate={this.performTagsUpdate} | ||
placeHolder='Select a Fruit' /> | ||
</div> | ||
</DocsTile> | ||
<DocsText>{this.multiInputCode}</DocsText> | ||
<h2>Default</h2> | ||
<Description> | ||
A text input when on focus will show list of items to select. | ||
</Description> | ||
<DocsTile> | ||
<div> | ||
<MultiInput | ||
data={this.data} | ||
onTagsUpdate={this.performTagsUpdate} | ||
placeHolder='Select a Fruit' /> | ||
</div> | ||
</DocsTile> | ||
<DocsText>{this.multiInputCode}</DocsText> | ||
|
||
<Separator /> | ||
<Separator /> | ||
|
||
<h2>Compact Style</h2> | ||
<Description> | ||
A text input when on focus will show list of items to select, but with a compact input box. | ||
</Description> | ||
<DocsTile> | ||
<div> | ||
<MultiInput | ||
data={this.data} | ||
onTagsUpdate={this.performTagsUpdate} | ||
placeHolder='Select a Fruit' | ||
compact /> | ||
</div> | ||
</DocsTile> | ||
<DocsText>{this.multiInputCompactCode}</DocsText> | ||
<h2>Compact Style</h2> | ||
<Description> | ||
A text input when on focus will show list of items to select, but with | ||
a compact input box. | ||
</Description> | ||
<DocsTile> | ||
<div> | ||
<MultiInput | ||
data={this.data} | ||
onTagsUpdate={this.performTagsUpdate} | ||
placeHolder='Select a Fruit' | ||
compact /> | ||
</div> | ||
</DocsTile> | ||
<DocsText>{this.multiInputCompactCode}</DocsText> | ||
|
||
<Separator /> | ||
</div> | ||
); | ||
} | ||
<Separator /> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.