-
Notifications
You must be signed in to change notification settings - Fork 430
Migrate to React@16.3 for Context API #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
0ff0c33
upgrade react and react-dom
AllenFang 906180a
implement context-based container
AllenFang 6d08a24
implement selection context
AllenFang 2525465
implement sort context
AllenFang 143acde
refactoring remote sort
AllenFang 5307e58
implement data operator
AllenFang 216bc10
implement celledit context
AllenFang 4f6809d
fix custom filter value example broken
AllenFang 2f7d010
add clear all filter story
AllenFang 8f4dc99
implement filter context
AllenFang 1e72c80
construct context dynamically
AllenFang 6c086c3
implement pagination context
AllenFang 4ecf243
no more state anti-pattern
AllenFang d534c42
change to partial selection when pagination enabled
AllenFang b1c086f
fix cache context issue
AllenFang 400c307
refine remote method
AllenFang 74bf885
remove useless code
AllenFang fc0b99e
patch tests for react-bootstrap-table-next
AllenFang 167352f
fix selectRow doesnt pass to CellEditContext
AllenFang c13b3fa
patch test for editor, filter, pagination
AllenFang 9c677fe
enhance remote all example
AllenFang 78ea630
fix bug for default sort and filter have potential issue when remote ...
AllenFang 77301c2
implement table search
AllenFang 760d459
add example for tble search
AllenFang 0d4d32c
patch for remote cell edit
AllenFang 7b15bf4
patch tests for search
AllenFang 18b785d
update peer dependencies for react react-dom
AllenFang 46f0ce4
prepare builds for react-bootstrap-table2-toolkit
AllenFang 6eaffe1
patch docs for table search
AllenFang 35b1e37
implement expand row sketch
AllenFang dbd0f89
add stories for expand row
AllenFang 4af5b4f
implement expand indicator
AllenFang 81ddd2c
add stories for expand indicator
AllenFang c36aa24
fix filter context tests broken due to missing onExternalFilter
AllenFang a18932e
patch docs for expand row
AllenFang 5a442bf
add missing expandRow props
AllenFang e6d4a96
data, keyField and columns is necessary value for toolkits context
AllenFang 0ec5b6c
add simple toolkit context wrapper for user
AllenFang 03ece4b
refactoring search
AllenFang f0e37b1
implement export csv
AllenFang b792803
add export csv stories
AllenFang ec77a05
patch docs for export CSV
AllenFang fadbcda
a workaround for fixing the _ module missing
AllenFang 7919a40
enhance for #402
AllenFang 0d64443
fix sort caret broken on bootstrap4
AllenFang f7ba8e3
upgrade enzyme
AllenFang c0416fc
fix selection column broken when bootstrap4
AllenFang 4958757
refine new context API tests
AllenFang 3f957db
fix pagination broken when bootstrap4
AllenFang 62c6949
add bootstrap4 style links
AllenFang 925d3d7
final docs patch
AllenFang f7406bc
add toolkits styles
AllenFang 2ec55f6
patch for default sort and filter have potential issue when remote
AllenFang d5d8c54
fix React doesn't allow Date Object as children
AllenFang cb970cd
fix peerdep
AllenFang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
129 changes: 129 additions & 0 deletions
docs/row-expand.md
This file contains hidden or 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,129 @@ | ||
|
||
# Row expand | ||
`react-bootstrap-table2` supports the row expand feature. By passing prop `expandRow` to enable this functionality. | ||
|
||
> Default is click to expand/collapse a row. In addition, we don't support any way to chagne this mechanism! | ||
|
||
## Required | ||
* [renderer (**required**)](#renderer) | ||
|
||
## Optional | ||
* [expanded](#expanded) | ||
* [nonExpandable](#nonExpandable) | ||
* [onExpand](#onExpand) | ||
* [onExpandAll](#onExpandAll) | ||
* [showExpandColumn](#showExpandColumn) | ||
* [expandColumnRenderer](#expandColumnRenderer) | ||
* [expandHeaderColumnRenderer](#expandHeaderColumnRenderer) | ||
|
||
### <a name="renderer">expandRow.renderer - [Function]</a> | ||
|
||
Specify the content of expand row, `react-bootstrap-table2` will pass a row object as argument and expect return a react element. | ||
|
||
#### values | ||
* **row** | ||
|
||
#### examples | ||
|
||
```js | ||
const expandRow = { | ||
renderer: row => ( | ||
<div> | ||
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p> | ||
<p>You can render anything here, also you can add additional data on every row object</p> | ||
<p>expandRow.renderer callback will pass the origin row object to you</p> | ||
</div> | ||
) | ||
}; | ||
|
||
<BootstrapTable | ||
keyField='id' | ||
data={ products } | ||
columns={ columns } | ||
expandRow={ expandRow } | ||
/> | ||
``` | ||
|
||
### <a name='expanded'>expandRow.expanded - [Array]</a> | ||
`expandRow.expanded` allow you have default row expandations on table. | ||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
expanded: [1, 3] // should be a row keys array | ||
}; | ||
``` | ||
|
||
### <a name='nonExpandable'>expandRow.nonExpandable - [Array]</a> | ||
This prop allow you to restrict some rows which can not be expanded by user. `expandRow.nonExpandable` accept an rowkeys array. | ||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
nonExpandable: [1, 3 ,5] | ||
}; | ||
``` | ||
|
||
### <a name='onExpand'>expandRow.onExpand - [Function]</a> | ||
This callback function will be called when a row is expand/collapse and pass following four arguments: | ||
`row`, `isExpand`, `rowIndex` and `e`. | ||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
onExpand: (row, isExpand, rowIndex, e) => { | ||
// ... | ||
} | ||
}; | ||
``` | ||
|
||
### <a name='onExpandAll'>expandRow.onExpandAll - [Function]</a> | ||
This callback function will be called when expand/collapse all. It only work when you configure [`expandRow.showExpandColumn`](#showExpandColumn) as `true`. | ||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
onExpandAll: (isExpandAll, results, e) => { | ||
// ... | ||
} | ||
}; | ||
``` | ||
|
||
### <a name='expandColumnRenderer'>expandRow.expandColumnRenderer - [Function]</a> | ||
Provide a callback function which allow you to custom the expand indicator. This callback only have one argument which is an object and contain one property `expanded` which indicate if current row is expanded | ||
|
||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
expandColumnRenderer: ({ expanded }) => ( | ||
// .... | ||
) | ||
}; | ||
``` | ||
|
||
> By default, `react-bootstrap-table2` will help you to handle the click event, it's not necessary to handle again by developer. | ||
|
||
### <a name='expandHeaderColumnRenderer'>expandRow.expandHeaderColumnRenderer - [Function]</a> | ||
Provide a callback function which allow you to custom the expand indicator in the expand header column. This callback only have one argument which is an object and contain one property `isAnyExpands` which indicate if there's any rows are expanded: | ||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
expandHeaderColumnRenderer: ({ isAnyExpands }) => ( | ||
// .... | ||
) | ||
}; | ||
``` | ||
|
||
> By default, `react-bootstrap-table2` will help you to handle the click event, it's not necessary to handle again by developer. | ||
|
||
### <a name='showExpandColumn'>expandRow.showExpandColumn - [Bool]</a> | ||
Default is `false`, if you want to have a expand indicator, give this prop as `true` | ||
|
||
```js | ||
const expandRow = { | ||
renderer: (row) => ... | ||
showExpandColumn: true | ||
}; | ||
``` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.