Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract MultiAutoComplete.Item to separate Chip component to reuse as…
… List filter
- Loading branch information
Showing
10 changed files
with
64 additions
and
31 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
28 changes: 28 additions & 0 deletions
28
src/Sulu/Bundle/AdminBundle/Resources/js/components/Chip/README.md
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Chips are compact elements that represent an attribute in its used context. It can e.g. be used to display tags in a tag | ||
selection or can indicate that a list is filtered. | ||
|
||
```javascript | ||
<div style={{backgroundColor: 'white', padding: '10px'}}> | ||
<Chip>Tag 1</Chip> | ||
</div> | ||
``` | ||
|
||
Chips can also be displayed in a disabled state: | ||
|
||
```javascript | ||
<div style={{backgroundColor: 'white', padding: '10px'}}> | ||
<Chip disabled={true}>Tag 2</Chip> | ||
</div> | ||
``` | ||
|
||
They also accept a `onDelete` callback, which will render an `Icon` the user can click: | ||
|
||
```javascript | ||
const handleDelete = (value) => { | ||
alert('Delete the chip with the value ' + value); | ||
}; | ||
|
||
<div style={{backgroundColor: 'white', padding: '10px'}}> | ||
<Chip onDelete={handleDelete} value={9}>Remove me!</Chip> | ||
</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
4 changes: 4 additions & 0 deletions
4
src/Sulu/Bundle/AdminBundle/Resources/js/components/Chip/index.js
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @flow | ||
import Chip from './Chip'; | ||
|
||
export default Chip; |
8 changes: 4 additions & 4 deletions
8
...ents/MultiAutoComplete/tests/Item.test.js → ...ces/js/components/Chip/tests/Chip.test.js
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