From 3f0ca0d230a06a927051502d7bfdc549b0eaa4e3 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sat, 24 Aug 2019 15:55:07 +0800 Subject: [PATCH] 20190925 release --- docs/basic-filter.md | 29 ++++++++++++++++++++++--- docs/basic-row-expand.md | 7 +++++- docs/column-props.md | 4 ++++ docs/row-expand-props.md | 27 +++++++++++++++++++++-- website/blog/2019-08-25-version-bump.md | 28 ++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 website/blog/2019-08-25-version-bump.md diff --git a/docs/basic-filter.md b/docs/basic-filter.md index f48fd08..c044ab9 100644 --- a/docs/basic-filter.md +++ b/docs/basic-filter.md @@ -121,8 +121,11 @@ const qualityFilter = selectFilter({ // omit... ``` -> Note, the `selectOptions` can be an array also: - ```js +> Note, the `selectOptions` can be an array or a function as well: + +### Array as options + +```js const selectOptions = [ { value: 0, label: 'good' }, { value: 1, label: 'Bad' }, @@ -138,7 +141,27 @@ const columns = [ }) }]; ``` - The benifit is `react-bootstrap-table2` will render the select options by the order of array. + +### Function as options + +```js +const selectOptions = [ + { value: 0, label: 'good' }, + { value: 1, label: 'Bad' }, + { value: 2, label: 'unknown' } +]; +const columns = [ + ..., { + dataField: 'quality', + text: 'Product Quailty', + formatter: cell => selectOptions.find(opt => opt.value === cell).label, + filter: selectFilter({ + options: () => selectOptions + }) +}]; +``` + +The benifit is `react-bootstrap-table2` will render the select options by the order of array. ## MultiSelect Filter diff --git a/docs/basic-row-expand.md b/docs/basic-row-expand.md index 4983175..6f7032e 100644 --- a/docs/basic-row-expand.md +++ b/docs/basic-row-expand.md @@ -39,11 +39,16 @@ This is an example for [manage on expands](../storybook/index.html?selectedKind= ## Customization ### Style/Class -`expandRow.renderer` allow you to render everything in the content of expanding row. You can control the style or class by yourself. However, a expand row is wrapped by a HTML `tr` element(Parent row). Currently, we support following way to custom the class/style on parent row element: +`expandRow.renderer` allow you to render everything in the content of expanding row. You can custom the style or class by yourself. However, a expand row is wrapped by a HTML `tr` element(Parent row). Currently, we support following way to custom the class/style on parent row element: * For the class of parent row: [`expandRow.parentClassName`](./row-expand-props.html#expandrowparentclassname-string-function) * For the style of parent row: N/A +In addition, the way to custom the class/style on expanding row element: +* For the class of expanding row: [`expandRow.className`](./row-expand-props.html#expandrowclassname-string-function) +* For the style of expanding row: N/A + + ### Expand Column `react-bootstrap-table2` default doesn't render a additional indicator column, just like row selection. But if you want it, you can enable it via [`expandRow.showExpandColumn`](./row-expand-props.html#expandrowshowexpandcolumn-bool) diff --git a/docs/column-props.md b/docs/column-props.md index 16ee1ee..ac2b5dc 100644 --- a/docs/column-props.md +++ b/docs/column-props.md @@ -52,6 +52,7 @@ Definition of columns props on BootstrapTable * [editorRenderer](#columneditorrenderer-function) * [filter](#columnfilter-object) * [filterValue](#columnfiltervalue-function) +* [searchable](#columnsearchable-bool) * [csvType](#columncsvType-object) * [csvFormatter](#columncsvFormatter-function) * [csvText](#columncsvText-string) @@ -902,6 +903,9 @@ A final `String` value you want to be filtered. } ``` +## column.searchable - [Bool] +Default the column is searchable. Give `false` to disable search functionality on specified column. + ## column.csvType - [Object] Default is `String`. Currently, the available value is `String` and `Number`. If `Number` assigned, the cell value will not wrapped with double quote. diff --git a/docs/row-expand-props.md b/docs/row-expand-props.md index d11598f..f24d6c3 100644 --- a/docs/row-expand-props.md +++ b/docs/row-expand-props.md @@ -20,6 +20,7 @@ title: Row Expand Props * [expandColumnPosition](#expandrowexpandcolumnposition-string) * [expandColumnRenderer](#expandrowexpandcolumnrenderer-function) * [expandHeaderColumnRenderer](#expandrowexpandheadercolumnrenderer-function) +* [className](#expandrowclassname-string-function) * [parentClassName](#expandrowparentclassname-string-function) ----- @@ -182,10 +183,32 @@ const expandRow = { }; ``` +## expandRow.className - [String | Function] +Apply the custom class name on the expanding row. For example: + +```js +const expandRow = { + renderer: (row) => ..., + className: 'foo' +}; +``` + +Following case is more flexible way to custom the class name: + +```js +const expandRow = { + renderer: (row) => ..., + className: (isExpanded, row, rowIndex) => { + if (rowIndex > 2) return 'foo'; + return 'bar'; + } +}; +``` + ## expandRow.parentClassName - [String | Function] Apply the custom class name on parent row of expanded row. For example: - ```js +```js const expandRow = { renderer: (row) => ..., parentClassName: 'foo' @@ -193,7 +216,7 @@ const expandRow = { ``` Below case is more flexible way to custom the class name: - ```js +```js const expandRow = { renderer: (row) => ..., parentClassName: (isExpanded, row, rowIndex) => { diff --git a/website/blog/2019-08-25-version-bump.md b/website/blog/2019-08-25-version-bump.md new file mode 100644 index 0000000..c5df23c --- /dev/null +++ b/website/blog/2019-08-25-version-bump.md @@ -0,0 +1,28 @@ +--- +title: New Release (2019-08-25) +author: Allen Fang +authorURL: https://twitter.com/allenfang_tw +--- + +## Changed Packages + +We got following packages version bump in this release: + +* `react-bootstrap-table-next@3.1.9` +* `react-bootstrap-table2-filter@1.1.12` + + +## Changelog + +### Bug fixes +* Fixed `onFilter` broken([eb204f6](https://github.com/react-bootstrap-table/react-bootstrap-table2/commit/eb204f65261da47f479eab9d1417e06c57ff7f39)) +* Fixed columns doesn't update correctly when enable column toggle([43b5eeb](https://github.com/react-bootstrap-table/react-bootstrap-table2/commit/43b5eeb74f9cf700dfa6dff0a87e967b6ac0cf43)) +* Fixed disabling cell edit on table throws exception([70827ee](https://github.com/react-bootstrap-table/react-bootstrap-table2/commit/70827eecd6f6cb791d8b14b1a53a5413d1131400)) + + +### Features +N/A + +### Enhancements +* Allow to configure the options of select filter by a custom function([23cb0bb](https://github.com/react-bootstrap-table/react-bootstrap-table2/commit/23cb0bb317e41ec97e36148c926526af61b361c8)) +* Add `expandRow.className` for customing the class on expanding row([c12d3fa](https://github.com/react-bootstrap-table/react-bootstrap-table2/commit/c12d3faba309b2abc1a4776e440ed420174ee3c7)) \ No newline at end of file