diff --git a/README.md b/README.md
index 39f14b1..5098694 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ Rebuilt [react-bootstrap-table](https://github.com/AllenFang/react-bootstrap-tab
* [`react-bootstrap-table2-overlay`](https://www.npmjs.com/package/react-bootstrap-table2-overlay)
* [`react-bootstrap-table2-toolkit`](https://www.npmjs.com/package/react-bootstrap-table2-toolkit)
-This can help your application with less bundled size and also help us have clean design to avoid handling to much logic in kernal module(SRP).
+This can help your application with less bundled size and also help us have clean design to avoid handling to much logic in kernel module(SRP).
## Migration
If you are the user from legacy [`react-bootstrap-table`](https://github.com/AllenFang/react-bootstrap-table/), please have a look on [this](./docs/migration.md).
@@ -40,4 +40,4 @@ $ yarn storybook
$ Go to localhost:6006
```
-**Storybook examples: [`packages/react-bootstrap-table2-example/examples`](https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/master/packages/react-bootstrap-table2-example/examples)**
\ No newline at end of file
+**Storybook examples: [`packages/react-bootstrap-table2-example/examples`](https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/master/packages/react-bootstrap-table2-example/examples)**
diff --git a/docs/cell-edit.md b/docs/cell-edit.md
index 8502c8c..6c46151 100644
--- a/docs/cell-edit.md
+++ b/docs/cell-edit.md
@@ -10,6 +10,7 @@ $ npm install react-bootstrap-table2-editor --save
* [blurToSave](#blurToSave)
* [nonEditableRows](#nonEditableRows)
* [timeToCloseMessage](#timeToCloseMessage)
+* [autoSelectText](#autoSelectText)
* [beforeSaveCell](#beforeSaveCell)
* [afterSaveCell](#afterSaveCell)
* [errorMessage](#errorMessage)
@@ -43,6 +44,11 @@ Default is `false`, enable it will be able to save the cell automatically when b
### cellEdit.nonEditableRows - [Function]
`cellEdit.nonEditableRows` accept a callback function and expect return an array which used to restrict all the columns of some rows as non-editable. So the each item in return array should be rowkey(`keyField`)
+### cellEdit.autoSelectText - [Bool]
+Default is false, when enable it, `react-bootstrap-table2` will help you to select the text in the text input automatically when editing.
+
+> NOTE: This props only work for `text` and `textarea`.
+
### cellEdit.timeToCloseMessage - [Function]
If a [`column.validator`](./columns.md#validator) defined and the new value is invalid, `react-bootstrap-table2` will popup a alert at the bottom of editor. `cellEdit.timeToCloseMessage` is a chance to let you decide how long the alert should be stay. Default is 3000 millisecond.
diff --git a/docs/row-expand.md b/docs/row-expand.md
index 1aa958a..5f6b47a 100644
--- a/docs/row-expand.md
+++ b/docs/row-expand.md
@@ -13,6 +13,7 @@
* [onExpand](#onExpand)
* [onExpandAll](#onExpandAll)
* [showExpandColumn](#showExpandColumn)
+* [onlyOneExpanding](#onlyOneExpanding)
* [expandColumnRenderer](#expandColumnRenderer)
* [expandHeaderColumnRenderer](#expandHeaderColumnRenderer)
@@ -127,3 +128,13 @@ const expandRow = {
showExpandColumn: true
};
```
+
+### expandRow.onlyOneExpanding - [Bool]
+Default is `false`. Enable this will only allow one row get expand at the same time.
+
+```js
+const expandRow = {
+ renderer: (row) => ...
+ onlyOneExpanding: true
+};
+```
diff --git a/docs/row-selection.md b/docs/row-selection.md
index eb57e6b..9ed4e9f 100644
--- a/docs/row-selection.md
+++ b/docs/row-selection.md
@@ -16,6 +16,7 @@
* [onSelect](#onSelect)
* [onSelectAll](#onSelectAll)
* [hideSelectColumn](#hideSelectColumn)
+* [hideSelectAll](#hideSelectAll)
* [selectionRenderer](#selectionRenderer)
* [selectionHeaderRenderer](#selectionHeaderRenderer)
@@ -222,3 +223,13 @@ const selectRow = {
bgColor: 'red'
};
```
+
+### selectRow.hideSelectAll - [Bool]
+Default is `false`, if you don't want to render the select all checkbox on the header of selection column, give this prop as `true`!
+
+```js
+const selectRow = {
+ mode: 'checkbox',
+ hideSelectAll: true
+};
+```
diff --git a/packages/react-bootstrap-table2-editor/src/editing-cell.js b/packages/react-bootstrap-table2-editor/src/editing-cell.js
index 463c8c5..39aa9a5 100644
--- a/packages/react-bootstrap-table2-editor/src/editing-cell.js
+++ b/packages/react-bootstrap-table2-editor/src/editing-cell.js
@@ -24,6 +24,7 @@ export default (_, onStartEdit) =>
onUpdate: PropTypes.func.isRequired,
onEscape: PropTypes.func.isRequired,
timeToCloseMessage: PropTypes.number,
+ autoSelectText: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object
}
@@ -31,6 +32,7 @@ export default (_, onStartEdit) =>
static defaultProps = {
timeToCloseMessage: TIME_TO_CLOSE_MESSAGE,
className: null,
+ autoSelectText: false,
style: {}
}
@@ -121,7 +123,7 @@ export default (_, onStartEdit) =>
render() {
let editor;
- const { row, column, className, style, rowIndex, columnIndex } = this.props;
+ const { row, column, className, style, rowIndex, columnIndex, autoSelectText } = this.props;
const { dataField } = column;
const value = _.get(row, dataField);
@@ -174,13 +176,13 @@ export default (_, onStartEdit) =>
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.SELECT) {
editor = ;
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.TEXTAREA) {
- editor = ;
+ editor = ;
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.CHECKBOX) {
editor = ;
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.DATE) {
editor = ;
} else {
- editor = ;
+ editor = ;
}
return (
diff --git a/packages/react-bootstrap-table2-editor/src/text-editor.js b/packages/react-bootstrap-table2-editor/src/text-editor.js
index 1a28a29..aaee204 100644
--- a/packages/react-bootstrap-table2-editor/src/text-editor.js
+++ b/packages/react-bootstrap-table2-editor/src/text-editor.js
@@ -5,9 +5,10 @@ import PropTypes from 'prop-types';
class TextEditor extends Component {
componentDidMount() {
- const { defaultValue, didMount } = this.props;
+ const { defaultValue, didMount, autoSelectText } = this.props;
this.text.value = defaultValue;
this.text.focus();
+ if (autoSelectText) this.text.select();
if (didMount) didMount();
}
@@ -16,7 +17,7 @@ class TextEditor extends Component {
}
render() {
- const { defaultValue, didMount, className, ...rest } = this.props;
+ const { defaultValue, didMount, className, autoSelectText, ...rest } = this.props;
const editorClass = cs('form-control editor edit-text', className);
return (
+`;
+
+export default () => (
+