diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 83c6c8a75..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "presets": ["react", "es2015", "stage-0"]
-}
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index ca70c653f..000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "extends": "airbnb",
- "parser": "babel-eslint",
- "env": {
- "browser": true,
- "jest": true,
- "node": true
- },
- "plugins": [
- "react"
- ],
- "rules": {
- "comma-dangle": ["error", "never"],
- "react/jsx-curly-spacing": [2, "always"],
- "react/forbid-prop-types": 0,
- "react/jsx-filename-extension": 0,
- "react/jsx-space-before-closing": 0,
- "react/jsx-tag-spacing": ["error", { "beforeSelfClosing": "always" }],
- "import/extensions": 0, // skip import extensions
- "import/no-unresolved": [0, { "ignore": ["^react-bootstrap-table"] }], // monorepo setup
- "import/prefer-default-export": 0,
- "import/no-extraneous-dependencies": 0
- },
- "globals": {
- "jest": false
- }
-}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 1f0b21e4b..000000000
--- a/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-# node
-node_modules
-package-lock.json
-
-# testing
-coverage
-.eslintcache
-
-# misc
-.DS_Store
-.vscode
-
-# logs
-lerna-debug.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 02a549251..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-language: node_js
-
-node_js:
- - "7"
- - "6"
-
-cache:
- yarn: true
-
-branches:
- only:
- # skip master branch when it's under development phase
- # - master
- - develop
-
-before_install:
- - curl -o- -L https://yarnpkg.com/install.sh | bash -s
- - export PATH="$HOME/.yarn/bin:$PATH"
-
-install: yarn install
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 9d8ed0161..000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# Contributing
-
-# Issues
-Before opening an issue, please make sure your problem or request doesn't exist. When opening an issue, please provide the following information if possible:
-
-* Example code or repo (please keep it simple and minimal)
-* Steps to reproduce.
-* `react-bootstrap-table2` version.
-
-Additionally, asking questions and requesting new features are welcomed via [issue tracker](https://github.com/react-bootstrap-table/react-bootstrap-table2/issues).
-
-# Pull Requests
-Check [here](./docs/development.md) for getting started with development.
-
-* We recommend filing an [issue](https://github.com/react-bootstrap-table/react-bootstrap-table2/issues) before you implement any new features.
-* Please ensure that all the test suites have passed before submitting a PR. Besides, always test the actual business logic.
-* If your PR is trying to fix a bug, please describe the details as much as you could and tag the bug number with hashtag.
-
-# For the members of react-bootstrap-table2 org
-* Please convert the ticket to issue when the ticket has moved from `Backlog` to `Ready`.
-* Please update the docs if any API, feature or component props was changed or added. The code and docs should always be in sync.
-* Please add a story example if any new feature was implemented.
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index 1d5d13d79..000000000
--- a/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# react-bootstrap-table2
-Rebuilt [react-bootstrap-table](https://github.com/AllenFang/react-bootstrap-table)
-
-## The problems/features I want to solve
-* Performance
-* Fully compatiable with bootstrap 3 and 4(`react-bootstrap-table@4.0.0` already done)
-* Clean Code and Testing
-* Decrease the size of bundled file
-* **Split module/functionality from core module, make core module more lightweight**
-* Use [`storybook`](https://github.com/storybooks/storybook) to build examples
-* Support the aggregation(summary) view
-* Support the table footer
-* Support column/row span on header and body
-* Support sticky header
-* Support table section([react-bootstrap-table#721](https://github.com/AllenFang/react-bootstrap-table/pull/721))
-* Handle events well
-* Fix unalign issues
-* Make **stateless** table more easy to use(`react-bootstrap-table` alread have `remote` mode but have some bugs)
-* Customizable table
-* Support the nested data([react-bootstrap-table#50](https://github.com/AllenFang/react-bootstrap-table/issues/50◊))
-* Consider to support column resize
-* Consider to make animation on `react-bootstrap-table2` more easy
-
-## The feature may lost on react-bootstrap-table
-* Have a great chance that I don't support the vertical scrollbar on table
\ No newline at end of file
diff --git a/blog/2018/01/24/new-version-0.1.0.html b/blog/2018/01/24/new-version-0.1.0.html
new file mode 100644
index 000000000..e7a93d232
--- /dev/null
+++ b/blog/2018/01/24/new-version-0.1.0.html
@@ -0,0 +1,54 @@
+
New Version 0.1.0 · react-bootstrap-table2 Preface
+About five months works, we finally get a first drop for react-bootstrap-table2
. I just want to say that I'm very sorry to let you guys to wait for a long time.
+I know a lots of people experienced many bugs or feel hard to customize on table. Anyway, I'm very appreciated everyone's helps and feedbacks, I think that's the reason why I decided to rebuilt react-bootstrap-table2
.
+For the first drop, I really can't finish all the legacy features, but I will work more hard to finish them by March or April. Please see the release plan for more details.
+ 0.1.0
+ Legacy Features
+
+Basic Table
+
+Scrollabe table is not yet implement
+
+Basic Table Sort
+
+Multi sort is not yet implement
+Sort management is not yet implement
+
+Basic Row Selection
+
+Custom Selection is not yet implement
+
+Basic Cell Edit
+
+Custom Cell Edit is not yet implement
+
+Basic Pagination
+
+Custom Pagination is not yet implement
+
+Basic Column Filter(Text Filter only)
+
+ New Features
+
+ Enhancement
+
+One table structure, never unalign again.
+Remote enhancement, please read it .
+100% easy to customize the header columns, cells and rows !!!
+
+
+In 2018, let's try react-bootstrap-table2
and give a star for this repo, I think it's the biggest encouragement for me :)
+
+Feel free to open issues to ask any questions.
+Regards,
+Allen Fang
+
\ No newline at end of file
diff --git a/blog/2018/01/24/release-plan.html b/blog/2018/01/24/release-plan.html
new file mode 100644
index 000000000..931a5b8cf
--- /dev/null
+++ b/blog/2018/01/24/release-plan.html
@@ -0,0 +1,81 @@
+Roadmap · react-bootstrap-table2 2018 Q1
+ 0.1.0
+
+ 0.1.1
+
+Select Filter
+Regex Filter
+
+ 0.1.2
+
+Date Filter
+Number Filter
+
+ 0.1.3
+
+Filter functionality enhancement
+
+Clean filter or clean all
+Programmatically filter
+
+
+ 0.1.4
+
+ 0.2.0
+
+Expand row
+Start compatible for bootstrap@4
+Sort management(External sort)
+Work on partial data(sort, filter) for pagination(remote or not remote)
+
+ 0.2.1
+
+ 0.2.2
+
+ 0.2.3
+
+ 0.2.4
+
+Scrol Table(Probably not implement, we are still investigation)
+
+ 0.3.0
+
+Row/Column span
+Table toolkit base
+
+ 0.3.1
+
+Row delete
+export CSV
+
+ 0.3.2
+
+ 0.3.3
+
+ 2018 Q2
+ 0.4.0
+
+Sticky Header
+Frozen Column
+
+
\ No newline at end of file
diff --git a/blog/2018/02/02/version-bump.html b/blog/2018/02/02/version-bump.html
new file mode 100644
index 000000000..358363018
--- /dev/null
+++ b/blog/2018/02/02/version-bump.html
@@ -0,0 +1,31 @@
+New Release (2018-02-02) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.2
+react-bootstrap-table2-filter@0.1.2
+
+ Changelog
+ Bug fixes
+
+Fixed call selectRow.onSelect
twice(#180 )
+Fixed wrong colSpan for noDataIndication
if there are column is hidden(#185 )
+
+ Features
+
+Support Select Filter(#183 )
+
+ Enhancements
+
+Column filter style improvement(#183 )
+
+Remember to add the css of react-bootstrap-table2-filter
+
+Fix key field in cell should not be cell value(#172 )
+
+
\ No newline at end of file
diff --git a/blog/2018/02/14/version-bump.html b/blog/2018/02/14/version-bump.html
new file mode 100644
index 000000000..03c968ed0
--- /dev/null
+++ b/blog/2018/02/14/version-bump.html
@@ -0,0 +1,29 @@
+New Release (2018-02-14) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.3
+react-bootstrap-table2-filter@0.1.3
+
+ Changelog
+ Bug fixes
+
+Fixed TextFilter contains an input of type text with both value and defaultValue props(a0af964 )
+
+ Features
+
+Support Number Filter(#200 )
+Support caseSensitive
on Text and Select filter(#201 )
+Support sort event listener(#202 )
+
+ Enhancements
+
+Text Filter right now is case insensitive which same as react-bootstrap-table
#201
+rowEvents.onClick
will be wrapped so that funcation can recieve additional informatnion like: row
and rowIndex
(#187 )
+
+
\ No newline at end of file
diff --git a/blog/2018/03/06/version-bump.html b/blog/2018/03/06/version-bump.html
new file mode 100644
index 000000000..4a429728c
--- /dev/null
+++ b/blog/2018/03/06/version-bump.html
@@ -0,0 +1,25 @@
+New Release (2018-03-06) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.4
+react-bootstrap-table2-editor@0.1.2
+
+ Changelog
+ Bug fixes
+
+Fix the sort will not be triggered when data is changed(#232 )
+Fix empty element issue(#219 )
+Fix Failed prop type: The prop defaultValue
is marked as required in TextEditor
, but its value is null
(5dd1f1e9 )
+
+ Features
+ Enhancements
+
+rowEvents.onMouseEnter
and rowEvents.onMouseLeave
will be wrapped up and pass row informations(#233 )
+
+
\ No newline at end of file
diff --git a/blog/2018/03/19/version.bump.html b/blog/2018/03/19/version.bump.html
new file mode 100644
index 000000000..34acf1408
--- /dev/null
+++ b/blog/2018/03/19/version.bump.html
@@ -0,0 +1,23 @@
+New Release (2018-03-19) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.5
+
+ Changelog
+ Bug fixes
+
+Fix selection was broken when data changed(#260 )
+
+ Features
+ Enhancements
+
+Add classes
and id
on BootstrapTable
for customization(#247 )
+column.hidden
will not render element instead of setting display:none
(#261 )
+
+
\ No newline at end of file
diff --git a/blog/2018/04/01/verion-bump.html b/blog/2018/04/01/verion-bump.html
new file mode 100644
index 000000000..a607c9f65
--- /dev/null
+++ b/blog/2018/04/01/verion-bump.html
@@ -0,0 +1,28 @@
+New Release (2018-04-01) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.6
+react-bootstrap-table-editor@0.1.4
+
+ Changelog
+ Bug fixes
+
+Fixed includes and find are not supported in IE(#274 )
+Fixed empty table is missing the last cell when row seleciton is enable(#276 )
+
+ Features
+
+Allow to configure the default sort direction(#286 )
+Allow to custom the cell editor's style and class(#268 )
+
+ Enhancements
+
+Don't render anything if noDataIndication
is not given(#275 )
+
+
\ No newline at end of file
diff --git a/blog/2018/04/01/version-bump.html b/blog/2018/04/01/version-bump.html
new file mode 100644
index 000000000..8f94d4c1f
--- /dev/null
+++ b/blog/2018/04/01/version-bump.html
@@ -0,0 +1,29 @@
+New Release (2018-04-01) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.6
+react-bootstrap-table2-editor@0.1.4
+react-bootstrap-table2-filter@0.1.4
+
+ Changelog
+ Bug fixes
+
+Fixed includes and find are not supported in IE(#274 )
+Fixed empty table is missing the last cell when row seleciton is enable(#276 )
+
+ Features
+
+Allow to configure the default sort direction(#286 )
+Allow to custom the cell editor's style and class(#268 )
+
+ Enhancements
+
+Don't render anything if noDataIndication
is not given(#275 )
+
+
\ No newline at end of file
diff --git a/blog/2018/04/15/version-bump.html b/blog/2018/04/15/version-bump.html
new file mode 100644
index 000000000..32a9cea18
--- /dev/null
+++ b/blog/2018/04/15/version-bump.html
@@ -0,0 +1,26 @@
+New Release (2018-04-15) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.8
+react-bootstrap-table2-filter@0.1.6
+
+ Changelog
+ Bug fixes
+
+ Features
+
+Programmtically Filters(#287 )
+
+ Enhancements
+
+Pass event object to selectRow.onSelect
and selectRow.onSelectAll
.(#304 )
+
+
\ No newline at end of file
diff --git a/blog/2018/05/07/version-bump.html b/blog/2018/05/07/version-bump.html
new file mode 100644
index 000000000..51524a770
--- /dev/null
+++ b/blog/2018/05/07/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2018-05-07) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.9
+react-bootstrap-table2-editor@0.2.0
+react-bootstrap-table2-paginator@0.1.2
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+Rich cell editors(#322 )
+Allow to custom cell editors(#322 )
+Implement pagination total indication(#323 )
+
+ Enhancements
+
+rowEvents
support onDoubleClick
(#324 )
+
+
\ No newline at end of file
diff --git a/blog/2018/05/13/version-bump.html b/blog/2018/05/13/version-bump.html
new file mode 100644
index 000000000..9076dc6ca
--- /dev/null
+++ b/blog/2018/05/13/version-bump.html
@@ -0,0 +1,25 @@
+New Release (2018-05-13) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.11
+react-bootstrap-table2-filter@0.1.7
+
+ Changelog
+ Bug fixes
+
+Fixed filtered table doesn't rerender on prop change(#303 )
+Fix programmatically filter broken when filter multiple column at the same time(#334 )
+
+ Features
+N/A
+ Enhancements
+
+Implement wrapperClasses
to allow to custom the class on outer element which wrap up the table
element(#325 )
+
+
\ No newline at end of file
diff --git a/blog/2018/05/23/version-bump.html b/blog/2018/05/23/version-bump.html
new file mode 100644
index 000000000..0d0ee9c8f
--- /dev/null
+++ b/blog/2018/05/23/version-bump.html
@@ -0,0 +1,21 @@
+New Release (2018-05-23) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.12
+
+ Changelog
+ Bug fixes
+
+Fix the bool rendering issues in React (#340 )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2018/06/04/version-bump.html b/blog/2018/06/04/version-bump.html
new file mode 100644
index 000000000..2804b9bd7
--- /dev/null
+++ b/blog/2018/06/04/version-bump.html
@@ -0,0 +1,30 @@
+New Release (2018-06-04) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.13
+react-bootstrap-table2-paginator@0.1.4
+react-bootstrap-table2-filter@0.2.0
+react-bootstrap-table2-overlay@0.1.2
+
+ Changelog
+ Bug fixes
+
+Fix remote sort still sorting data(#354 )
+Fix react-bootstrap-table2-overlay
does not consider caption height(b11019c )
+
+ Features
+
+Support date filter(#365 )
+
+ Enhancements
+
+Support to custome the pagination total(#359 )
+Support to custom the selection column(#364 )
+
+
\ No newline at end of file
diff --git a/blog/2018/06/24/version-bump.html b/blog/2018/06/24/version-bump.html
new file mode 100644
index 000000000..1b4746bb2
--- /dev/null
+++ b/blog/2018/06/24/version-bump.html
@@ -0,0 +1,26 @@
+New Release (2018-06-24) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.14
+react-bootstrap-table2-paginator@0.1.5
+react-bootstrap-table2-filter@0.3.0
+
+ Changelog
+ Bug fixes
+
+Fix table will jump to first page after cell editing in remote mode(42c6bc0 )
+Click on filter will trigger sorting(#380 )
+
+ Features
+
+Support custom filter(#389 )
+
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2018/07/15/version-bump.html b/blog/2018/07/15/version-bump.html
new file mode 100644
index 000000000..fbb34db92
--- /dev/null
+++ b/blog/2018/07/15/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2018-07-15) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.15
+react-bootstrap-table2-paginator@0.1.6
+
+ Changelog
+ Bug fixes
+
+Fixed Filter + Pagination returns empty rows(7a787bb )
+
+ Features
+N/A
+ Enhancements
+
+Custom the table header class via [headerClasses
] prop on BootstrapTable
(199bf8e )
+
+
\ No newline at end of file
diff --git a/blog/2018/07/28/version-bump.html b/blog/2018/07/28/version-bump.html
new file mode 100644
index 000000000..b489dcb3b
--- /dev/null
+++ b/blog/2018/07/28/version-bump.html
@@ -0,0 +1,21 @@
+New Release (2018-07-30) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table2-filter@0.3.1
+
+ Changelog
+ Bug fixes
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2018/08/01/version-bump.html b/blog/2018/08/01/version-bump.html
new file mode 100644
index 000000000..8c44a66fc
--- /dev/null
+++ b/blog/2018/08/01/version-bump.html
@@ -0,0 +1,21 @@
+New Release (2018-08-01) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table2-filter@0.3.2
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2018/08/04/version-bump.html b/blog/2018/08/04/version-bump.html
new file mode 100644
index 000000000..18b86ace5
--- /dev/null
+++ b/blog/2018/08/04/version-bump.html
@@ -0,0 +1,33 @@
+New Release (2018-08-04) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.0.0
+react-bootstrap-table2-filter@1.0.0
+react-bootstrap-table2-editor@1.0.0
+react-bootstrap-table2-paginator@1.0.0
+react-bootstrap-table2-toolkit@1.0.0
+
+ Notes
+In 1.0.0
, you have to upgrade react
and react-dom
to 16.3.0
or behind.
+ Changelog
+ Bug fixes
+
+fix bug for default sort and filter have potential issue when remote enabled.
+
+ Features
+
+Row Expand
+Table Search
+Export CSV
+
+ Enhancements
+
+
\ No newline at end of file
diff --git a/blog/2018/08/12/version-bump.html b/blog/2018/08/12/version-bump.html
new file mode 100644
index 000000000..91b44ea2b
--- /dev/null
+++ b/blog/2018/08/12/version-bump.html
@@ -0,0 +1,30 @@
+New Release (2018-08-12) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.0
+react-bootstrap-table2-toolkit@1.0.1
+react-bootstrap-table2-paginator@1.0.1
+
+ Changelog
+ Bug fixes
+
+Fixed column.style and column.align will conflicts(#481 )
+Fixed search will be clear if search the same text twice(#470 )
+Fixed debounce bug(#468 )
+Fixed pagination.paginationTotalRenderer
give wrong from
and to
argument(#467 )
+
+ Features
+
+Export CSV allow to export current display data instead of whole list(#469 )
+
+ Enhancements
+
+Performance improvment on cell level(#449 )
+
+
\ No newline at end of file
diff --git a/blog/2018/08/21/version-bump.html b/blog/2018/08/21/version-bump.html
new file mode 100644
index 000000000..d8838b4a4
--- /dev/null
+++ b/blog/2018/08/21/version-bump.html
@@ -0,0 +1,30 @@
+New Release (2018-08-21) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.2
+react-bootstrap-table-toolkit@1.0.2
+react-bootstrap-table2-paginator@1.0.2
+
+ Changelog
+ Bug fixes
+
+Fixed missing onChange prop for selection checkbox(#417 )
+Fixed pagination calculation fails when data change(#474 )
+
+
+ Features
+N/A
+ Enhancements
+
+Fixed some wrong code in storybooks
+
+
\ No newline at end of file
diff --git a/blog/2018/08/27/version-bump.html b/blog/2018/08/27/version-bump.html
new file mode 100644
index 000000000..de24cbd46
--- /dev/null
+++ b/blog/2018/08/27/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2018-08-27) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.3
+
+ Changelog
+ Bug fixes
+
+Fixed selectRow.onSelectAll
will return undefined
value after search(#509 )
+
+ Features
+N/A
+ Enhancements
+
+Fixed some wrong code in storybooks
+column.sortFunc
now pass rowA and rowB(#508 )
+
+
\ No newline at end of file
diff --git a/blog/2018/09/03/version-bump.html b/blog/2018/09/03/version-bump.html
new file mode 100644
index 000000000..adfb1fc0d
--- /dev/null
+++ b/blog/2018/09/03/version-bump.html
@@ -0,0 +1,31 @@
+New Release (2018-09-03) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.4
+react-bootstrap-table2-editor@1.0.1
+react-bootstrap-table2-toolkit@1.0.3
+
+ Changelog
+ Bug fixes
+
+Fixed selectRow.onSelectAll
will return undefined
value after search(#509 )
+
+ Features
+
+Support dummy column(#520 )
+
+Enable it via column.isDummyField
+
+Able to export csv by current selected rows(#522 )
+
+ Enhancements
+
+Add onStartEdit
callback which will be called when cell editor is trigger(#523 )
+
+
\ No newline at end of file
diff --git a/blog/2018/09/30/version-bump.html b/blog/2018/09/30/version-bump.html
new file mode 100644
index 000000000..8e108d219
--- /dev/null
+++ b/blog/2018/09/30/version-bump.html
@@ -0,0 +1,32 @@
+New Release (2018-09-30) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.2.0
+react-bootstrap-table2-editor@1.1.0
+react-bootstrap-table2-toolkit@1.1.0
+
+ Changelog
+ Bug fixes
+
+Fixed cannot assign to read only property 'textAlign' of object(#575 )
+Fixed wrong results pass to selectRow.onSelectAll when isSelect argument is false(#570 )
+
+ Features
+
+Implement expandRow.onlyOneExpanding
(#574 )
+Implement selectRow.hideSelectAll
(#574 )
+Support Default Search(#571 )
+Implement auto select input text when editing cell(#569 )
+
+ Enhancements
+
+Fixe a non printable characters in csv output(#572 )
+Add onContextMenu
on rowEvents
(#556 )
+
+
\ No newline at end of file
diff --git a/blog/2018/10/07/version-bump.html b/blog/2018/10/07/version-bump.html
new file mode 100644
index 000000000..8eef4f2ba
--- /dev/null
+++ b/blog/2018/10/07/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2018-10-07) · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.2.1
+react-bootstrap-table2-paginator@1.0.3
+react-bootstrap-table2-toolkit@1.1.1
+
+ Changelog
+ Bug fixes
+
+Fixed remote search bug(#591 )
+Fixed wrong calculation for from
and to
in pagination when remote search/filter enable and data is shrink below the current page(#594 )
+
+ Features
+
+Implement column.sortCaret
(#593 ) for customing the sort caret
+
+ Enhancements
+
+Easy to access the exposed API from react ref
(#592 )
+
+
\ No newline at end of file
diff --git a/blog/2018/10/14/version-bump.html b/blog/2018/10/14/version-bump.html
new file mode 100644
index 000000000..00a424a40
--- /dev/null
+++ b/blog/2018/10/14/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2018-10-14) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.3.0
+react-bootstrap-table2-editor@1.2.0
+
+ Changelog
+ Bug fixes
+
+Fixed bug if pagination
props changes(#599 )
+
+ Features
+
+Support expand/collapse row only though expand indicator(#546 )
+Support selectRow.clickToExpand
, which allow user to click on row to select/expand row at the same time(#497 )
+Support render tabIndex
on td
(#607 )
+
+ Enhancements
+
+Improve row level performance(#497 )
+
+
\ No newline at end of file
diff --git a/blog/2018/10/29/version-bump.html b/blog/2018/10/29/version-bump.html
new file mode 100644
index 000000000..24c278e5b
--- /dev/null
+++ b/blog/2018/10/29/version-bump.html
@@ -0,0 +1,25 @@
+New Release (2018-10-29) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.3.1
+react-bootstrap-table2-editor@1.2.1
+
+ Changelog
+ Bug fixes
+
+Try to fixed Uncaught TypeError: l.getData is not a function.
+
+ Features
+ Enhancements
+
+Support async cellEdit.beforeSaveCell
(#634 )
+Support async column.validator
(#633 )
+Enhance column.events
(#632 )
+
+
\ No newline at end of file
diff --git a/blog/2018/11/04/version.bump.html b/blog/2018/11/04/version.bump.html
new file mode 100644
index 000000000..bc8fe3834
--- /dev/null
+++ b/blog/2018/11/04/version.bump.html
@@ -0,0 +1,21 @@
+New Release (2018-11-04) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.0
+react-bootstrap-table2-filter@1.0.2
+
+ Changelog
+ Bug fixes
+ Features
+ Enhancements
+
+Allow to call setState
in selectRow.onSelect
and selectRow.onSelectAll
(#644 )
+Allow to use array for select filter options(#646 )
+
+
\ No newline at end of file
diff --git a/blog/2018/11/10/version-bump.html b/blog/2018/11/10/version-bump.html
new file mode 100644
index 000000000..40b632352
--- /dev/null
+++ b/blog/2018/11/10/version-bump.html
@@ -0,0 +1,25 @@
+New Release (2018-11-10) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.1
+react-bootstrap-table2-filter@1.1.0
+react-bootstrap-table2-paginator@1.0.4
+react-bootstrap-table2-editor@1.2.2
+
+ Changelog
+ Bug fixes
+
+Fixed wrong usage of label
and value
for the options of select filter.
+Fixed wrong from
and to
value when enable showTotal
for pagination.
+Fixed condensed
is broken in bootstrap@4
+Fixed the error message disappear in bootstrap@4
+
+ Features
+ Enhancements
+
\ No newline at end of file
diff --git a/blog/2018/12/05/version-bump.html b/blog/2018/12/05/version-bump.html
new file mode 100644
index 000000000..be66d4ace
--- /dev/null
+++ b/blog/2018/12/05/version-bump.html
@@ -0,0 +1,23 @@
+New Release (2018-12-05) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.2
+
+ Changelog
+ Bug fixes
+
+Fixed expandRow.onExpand
called twice on click by expand column(a23599f )
+Fixed synthetic event issue for selectRow.onSelect
and selectRow.onSelectAll
(a7ae524 )
+
+ Features
+ Enhancements
+
+
\ No newline at end of file
diff --git a/blog/2018/12/21/version-bump.html b/blog/2018/12/21/version-bump.html
new file mode 100644
index 000000000..53b780d91
--- /dev/null
+++ b/blog/2018/12/21/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2018-12-21) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.3
+
+ Changelog
+ Bug fixes
+
+Fixed a non expandable row still expandable when expandRow.showExpandColumn
is enable(#698 )
+
+ Features
+N/A
+ Enhancements
+
+Support hidden row(4ddbfd4 )
+Pass rowKey
and expandable
to expandRow.expandColumnRenderer
callback function(bc4697b )
+
+
\ No newline at end of file
diff --git a/blog/2018/12/23/version-bump.html b/blog/2018/12/23/version-bump.html
new file mode 100644
index 000000000..4a7b29c42
--- /dev/null
+++ b/blog/2018/12/23/version-bump.html
@@ -0,0 +1,21 @@
+New Release (2018-12-23) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.4
+
+ Changelog
+ Bug fixes
+
+Fixed expand row borken(#725 )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2018/12/24/version.bump.html b/blog/2018/12/24/version.bump.html
new file mode 100644
index 000000000..6ce7ee2aa
--- /dev/null
+++ b/blog/2018/12/24/version.bump.html
@@ -0,0 +1,22 @@
+New Release (2018-12-25) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.0.0
+react-bootstrap-table2-paginator@2.0.0
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Impove the flexibility about customizing pagination components.
+
+
\ No newline at end of file
diff --git a/blog/2019/01/06/version-bump.html b/blog/2019/01/06/version-bump.html
new file mode 100644
index 000000000..4b9239f1f
--- /dev/null
+++ b/blog/2019/01/06/version-bump.html
@@ -0,0 +1,30 @@
+New Release (2019-01-06) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.0.1
+react-bootstrap-table2-filter@1.1.1
+react-bootstrap-table2-paginator@2.0.1
+react-bootstrap-table2-toolkit@1.1.2
+
+ Changelog
+ Bug fixes
+
+Fixed export csv error (TypeError: this.visibleRows is not a function)(#745 )
+Fixed typeError happened on export CSV after js file compression(#745 )
+Fixed column header hides but not columnBody or columnData(#741 )
+Fixed props type mismatch for SizePerPageOption component(#742 )
+
+ Features
+N/A
+ Enhancements
+
+Support render expand column at the right side(#746 )
+Support column.onFilter
hook function(#743 )
+
+
\ No newline at end of file
diff --git a/blog/2019/01/20/version-bump.html b/blog/2019/01/20/version-bump.html
new file mode 100644
index 000000000..fdd690a30
--- /dev/null
+++ b/blog/2019/01/20/version-bump.html
@@ -0,0 +1,26 @@
+New Release (2019-01-20) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.1.0
+react-bootstrap-table2-filter@1.1.2
+react-bootstrap-table2-toolkit@1.2.0
+
+ Changelog
+ Bug fixes
+
+Fixed can not clear date filter(9988e79 )
+
+ Features
+
+Support built-in search clear button(1c68892 )
+Support table footer(#703 )
+
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/02/09/version-bump.html b/blog/2019/02/09/version-bump.html
new file mode 100644
index 000000000..8adf3b8cd
--- /dev/null
+++ b/blog/2019/02/09/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2019-02-09) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.1.1
+react-bootstrap-table2-filter@1.1.3
+react-bootstrap-table2-toolkit@1.2.1
+react-bootstrap-table2-paginator@2.0.2
+
+ Changelog
+ Bug fixes
+
+Fixed Standalone Pagination render wrong page list when user do the filter or search(cf043c6 , 63c2630 , cacc28e )
+Fixed Controlled input element lose focus on re-render inside expanded rows(8bef7eb )
+
+ Features
+N/A
+ Enhancements
+
+Allow to return a custom filter results from onFilter
(aafbc7e )
+
+
\ No newline at end of file
diff --git a/blog/2019/02/16/version-bump.html b/blog/2019/02/16/version-bump.html
new file mode 100644
index 000000000..5c1f6d235
--- /dev/null
+++ b/blog/2019/02/16/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2019-02-16) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.1.2
+react-bootstrap-table2-filter@1.1.4
+react-bootstrap-table2-toolkit@1.2.2
+
+ Changelog
+ Bug fixes
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/02/18/version-bump.html b/blog/2019/02/18/version-bump.html
new file mode 100644
index 000000000..4ccacb097
--- /dev/null
+++ b/blog/2019/02/18/version-bump.html
@@ -0,0 +1,26 @@
+New Release (2019-02-18) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.2.0
+react-bootstrap-table2-toolkit@1.3.0
+react-bootstrap-table2-paginator@2.0.3
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+Support Column Toggle(#800 )
+
+ Enhancements
+
+Support PaginationTotalStandalone
component(#801 )
+Add rowIndex
for selectRow.selectionRenderer
(a7c2a49 )
+
+
\ No newline at end of file
diff --git a/blog/2019/02/24/version-bump.html b/blog/2019/02/24/version-bump.html
new file mode 100644
index 000000000..1820e419e
--- /dev/null
+++ b/blog/2019/02/24/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2019-02-24) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.0
+react-bootstrap-table2-filter@1.1.5
+react-bootstrap-table2-toolkit@1.3.1
+
+ Changelog
+ Bug fixes
+
+Fixed cell didn't rerender correctly when column.formatter
defined and use row
inside the column.formatter
function.(bf0c5c4 )
+Fixed selection broken when call setState
in selectRow.onSelect
(c01f45a )
+Fixed search and filter perform a abnormal behavor(#811 )
+
+ Features
+N/A
+ Enhancements
+
+Allow to add custom className on Export CSV and Clear Search button(09f21e8 )
+Allow to operate on cell editing context via reacr refs
(#815 )
+
+
\ No newline at end of file
diff --git a/blog/2019/03/10/version-bump.html b/blog/2019/03/10/version-bump.html
new file mode 100644
index 000000000..0888f3ee1
--- /dev/null
+++ b/blog/2019/03/10/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2019-03-10) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.1
+react-bootstrap-table2-filter@1.1.6
+react-bootstrap-table2-paginator@2.0.4
+react-bootstrap-table2-toolkit@1.3.2
+
+ Changelog
+ Bug fixes
+
+Fixed btnContextual
prop on SizePerPageDropdownStandalone
not passed to SizePerPageDropdown
(3af30a0 )
+Fixed expanded row column span does not update(#837 )
+Fixed column filter with custom pagination is not work well(921e8c7 )
+Fixed pagination is not work well when data delete or insert(e9f08d2 )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/03/17/version-bump.html b/blog/2019/03/17/version-bump.html
new file mode 100644
index 000000000..924d3106d
--- /dev/null
+++ b/blog/2019/03/17/version-bump.html
@@ -0,0 +1,26 @@
+New Release (2019-03-17) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.2
+react-bootstrap-table2-filter@1.1.7
+react-bootstrap-table2-toolkit@1.4.0
+
+ Changelog
+ Bug fixes
+
+Fixed remote filter borken(7642bfa )
+Fixed custom editor didn't cancel when switch to anther cell(c5d9e04 )
+
+ Features
+
+Support to export only searched/filtered data cross pagesd0e70f7
+
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/03/26/version-bump.html b/blog/2019/03/26/version-bump.html
new file mode 100644
index 000000000..f46bc21ec
--- /dev/null
+++ b/blog/2019/03/26/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2019-03-26) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.3
+react-bootstrap-table2-paginator@2.0.5
+
+ Changelog
+ Bug fixes
+
+Fixed cell won't be updated when column.formatExtraData
change(196ae33 )
+Fix pagination.alwaysShowAllBtns
perform wrongly in some case(7f1b7a6 )
+Fix column won't be updated when switch column order dynamically(a6ccafc )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/03/31/version-bump.html b/blog/2019/03/31/version-bump.html
new file mode 100644
index 000000000..edca09fb7
--- /dev/null
+++ b/blog/2019/03/31/version-bump.html
@@ -0,0 +1,25 @@
+New Release (2019-03-31) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.0
+react-bootstrap-table2-editor@1.2.3
+react-bootstrap-table2-filter@1.1.8
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+Animation on expand/collapse row(#861 )
+
+ Enhancements
+
+Get Date information via UTC methods(#874 )
+
+
\ No newline at end of file
diff --git a/blog/2019/04/16/version-bump.html b/blog/2019/04/16/version-bump.html
new file mode 100644
index 000000000..5599d4e6a
--- /dev/null
+++ b/blog/2019/04/16/version-bump.html
@@ -0,0 +1,29 @@
+New Release (2019-04-16) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.1
+react-bootstrap-table2-filter@1.1.9
+react-bootstrap-table2-paginator@2.0.6
+react-bootstrap-table2-toolkit@1.4.1
+
+ Changelog
+ Bug fixes
+
+Fix expandRow.expanded undefined when enable sort and row expand(160dede )
+
+ Features
+
+Add onDataSizeChange
prop for listening data size change in table(363a432 )
+
+ Enhancements
+
+Allow select options initialization with empty array(#894 )
+Accessibility on table seach input and filter(#890 )
+
+
\ No newline at end of file
diff --git a/blog/2019/04/27/version-bump.html b/blog/2019/04/27/version-bump.html
new file mode 100644
index 000000000..f3497dc7f
--- /dev/null
+++ b/blog/2019/04/27/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2019-04-27) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.2
+react-bootstrap-table2-toolkit@1.4.2
+
+ Changelog
+ Bug fixes
+
+Fix rendering searchbar will throw tableId
prop type warning(#914 )
+Fix expandRow
does not work with nested keyField
(36fa9b8 )
+Fix CSV Export doesn't handle double quotes(737922a )
+Fix column.onClick
some parameters is undefined
if column.editable
is true(6168bd7 )
+
+ Features
+N/A
+ Enhancements
+
+Allow to custom the style on selection header cell via selectRow.headerColumnStyle
(0f37fae )
+
+
\ No newline at end of file
diff --git a/blog/2019/05/19/version-bump.html b/blog/2019/05/19/version-bump.html
new file mode 100644
index 000000000..c62fd4f9c
--- /dev/null
+++ b/blog/2019/05/19/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2019-05-19) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.3
+react-bootstrap-table2-toolkit@2.0.0
+react-bootstrap-table2-overlay@2.0.0
+
+ Changelog
+ Bug fixes
+
+Fix clicking on selection column will trigger row expand(2c6cc91 )
+Fix file saver issue for IE(55eea6f )
+
+ Features
+N/A
+ Enhancements
+
+Enhance Table header accessibility(a1457df )
+Enhance Search input accessibility(7c259cd )
+Upgrade react-loading-overlay
for react-bootstrap-table2-overlay
(036c3fd )
+
+
\ No newline at end of file
diff --git a/blog/2019/06/10/version-bump.html b/blog/2019/06/10/version-bump.html
new file mode 100644
index 000000000..69ea6c326
--- /dev/null
+++ b/blog/2019/06/10/version-bump.html
@@ -0,0 +1,37 @@
+New Release (2019-06-10) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.4
+react-bootstrap-table2-editor@1.2.4
+react-bootstrap-table2-toolkit@2.0.1
+
+ Changelog
+ Bug fixes
+
+Fixed tabindex on table headers should not be > 0(4ec02b2 )
+
+ Features
+N/A
+ Enhancements
+
+
\ No newline at end of file
diff --git a/blog/2019/06/25/version-bump.html b/blog/2019/06/25/version-bump.html
new file mode 100644
index 000000000..eeb6b9ddc
--- /dev/null
+++ b/blog/2019/06/25/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2019-06-25) · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.5
+react-bootstrap-table2-filter@1.1.10
+react-bootstrap-table2-paginator@2.0.7
+
+ Changelog
+ Bug fixes
+
+Fixed can not use classes
in IE(221e336 )
+Fixed column formatter can not work with external state with expandRow(4cf6e65 )
+Fixed multiselect filter broken in IE(e58533d )
+
+ Features
+N/A
+ Enhancements
+
+Allow firstPageText
, prePageText
, nextPageText
and lastPageText
adopt PropType.node
type(7382010 )
+
+
\ No newline at end of file
diff --git a/blog/2019/07/21/version-bump.html b/blog/2019/07/21/version-bump.html
new file mode 100644
index 000000000..d68e28e80
--- /dev/null
+++ b/blog/2019/07/21/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2019-07-21) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.1.6
+react-bootstrap-table2-editor@1.3.0
+
+ Changelog
+ Bug fixes
+
+Fixed incorrect column size when dynamic change selectRow.hideSelectColumn
(d7e1f1d )
+
+ Features
+
+Support saving type of cell editing(92f1449 )
+
+ Enhancements
+
+Enhance serveral examples and docs
+Allow to custom the classname on the parent row of expanded row(ec4864d )
+Add rowIndex
as second arguments for expandRow.renderer
(db22bb9 )
+
+
\ No newline at end of file
diff --git a/blog/2019/08/10/version-bump.html b/blog/2019/08/10/version-bump.html
new file mode 100644
index 000000000..d8022ff14
--- /dev/null
+++ b/blog/2019/08/10/version-bump.html
@@ -0,0 +1,29 @@
+New Release (2019-08-10) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.1.8
+react-bootstrap-table2-editor@1.3.2
+react-bootstrap-table2-filter@1.1.11
+react-bootstrap-table2-paginator@2.0.9
+
+ Changelog
+ Bug fixes
+
+Fixed inconsistence filter logic in custom filtering(423769c )
+Fixed column toggle will cancel the filter state(4de565b )
+Fixed wrong type convert when column didn't have specified type(08ec8a9 )
+Fixed pagination elements not on same row/line(1a44ce0 )
+
+ Features
+N/A
+ Enhancements
+
+column.editor.getOptions
recieve the second argument which contain row
and column
(856e63d )
+
+
\ No newline at end of file
diff --git a/blog/2019/08/25/version-bump.html b/blog/2019/08/25/version-bump.html
new file mode 100644
index 000000000..a95012014
--- /dev/null
+++ b/blog/2019/08/25/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2019-08-25) · react-bootstrap-table2 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 )
+Fixed columns doesn't update correctly when enable column toggle(43b5eeb )
+Fixed disabling cell edit on table throws exception(70827ee )
+
+ Features
+N/A
+ Enhancements
+
+Allow to configure the options of select filter by a custom function(23cb0bb )
+Add expandRow.className
for customing the class on expanding row(c12d3fa )
+
+
\ No newline at end of file
diff --git a/blog/2019/09/08/version-bump.html b/blog/2019/09/08/version-bump.html
new file mode 100644
index 000000000..b3bd25a9f
--- /dev/null
+++ b/blog/2019/09/08/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2019-09-08) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.2.0
+react-bootstrap-table2-editor@1.4.0
+react-bootstrap-table2-filter@1.2.0
+react-bootstrap-table2-paginator@2.1.0
+react-bootstrap-table2-toolkit@2.1.0
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Avoid warning for react legacy lifecycle(7c8bf00
)
+Support custom search on cell level(00b1558
)
+Support column.sortValue
for custom the sort value of cell(ec1f96c )
+Enhance column.headerEvents
and column.footerEvents
for adding some useful data(16128e7 )
+
+
\ No newline at end of file
diff --git a/blog/2019/09/29/version-bump.html b/blog/2019/09/29/version-bump.html
new file mode 100644
index 000000000..b73cb9fae
--- /dev/null
+++ b/blog/2019/09/29/version-bump.html
@@ -0,0 +1,23 @@
+New Release (2019-09-29) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.2.1
+
+ Changelog
+ Bug fixes
+
+Fixed select all broken if keyField
is nested(1b9bd63 )
+Fixed can not configure tabIndex
for header column(b2121fd )
+Try to fix abnormal issue in selection.js
(18caf0a )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/11/09/version-bump.html b/blog/2019/11/09/version-bump.html
new file mode 100644
index 000000000..77ee2093c
--- /dev/null
+++ b/blog/2019/11/09/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2019-11-09) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.0
+react-bootstrap-table2-filter@1.3.0
+
+ Changelog
+ Bug fixes
+
+Fixed select all broken if keyField
is nested(1b9bd63 )
+Fixed can not configure tabIndex
for header column(b2121fd )
+Try to fix abnormal issue in selection.js
(18caf0a )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/11/16/version-bump.html b/blog/2019/11/16/version-bump.html
new file mode 100644
index 000000000..f94a1cd84
--- /dev/null
+++ b/blog/2019/11/16/version-bump.html
@@ -0,0 +1,23 @@
+New Release (2019-11-16) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.1
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Support selectRow.nonSelectableStyle
and selectRow.nonSelectableClasses
to custom nonselectable row
+Add default class to selection column and expand column.
+Fix react key warning when apply filterPosition
props
+
+
\ No newline at end of file
diff --git a/blog/2019/12/02/version-bump.html b/blog/2019/12/02/version-bump.html
new file mode 100644
index 000000000..3ac834c27
--- /dev/null
+++ b/blog/2019/12/02/version-bump.html
@@ -0,0 +1,22 @@
+New Release (2019-12-02) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.2
+
+ Changelog
+ Bug fixes
+
+Fixed incorrect row colspan when apply column toggle or column.hidden(4a340c7 )
+Fixed filterPosition
property does not work with rowSelect(8ecdbf6 )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2019/12/07/version-bump.html b/blog/2019/12/07/version-bump.html
new file mode 100644
index 000000000..2bbbd7c14
--- /dev/null
+++ b/blog/2019/12/07/version-bump.html
@@ -0,0 +1,27 @@
+New Release (2019-12-07) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.3
+react-bootstrap-table2-toolkit@2.1.1
+
+ Changelog
+ Bug fixes
+
+Fixed wrong table caption in bootstrap 4(38b0fb3 )
+
+ Features
+
+Allow to export table footer to csv file(47d6eb0 )
+Allow to manage sorting state(2068f51 )
+
+ Enhancements
+
+One-time sorting configuration(a07b2da )
+
+
\ No newline at end of file
diff --git a/blog/2020/02/09/version-bump.html b/blog/2020/02/09/version-bump.html
new file mode 100644
index 000000000..c3d3d56eb
--- /dev/null
+++ b/blog/2020/02/09/version-bump.html
@@ -0,0 +1,26 @@
+New Release (2020-02-09) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.4
+react-bootstrap-table2-toolkit@2.1.2
+
+ Changelog
+ Bug fixes
+
+Fixed accessibility issue: Users navigating with tab
cannot trigger sort functionality(bfb2592 )
+Fixed column sorting feature breaks if the initial columns array doesn't have sort field(5cc7882 )
+Fixed columns initially hidden when using ToolKitProvider and columns array changes(7162728 )
+
+ Features
+N/A
+ Enhancements
+
+Allow to add class on thead
and tbody
(7b593a7 )
+
+
\ No newline at end of file
diff --git a/blog/2020/02/16/version-bump.html b/blog/2020/02/16/version-bump.html
new file mode 100644
index 000000000..7447b19d9
--- /dev/null
+++ b/blog/2020/02/16/version-bump.html
@@ -0,0 +1,22 @@
+New Release (2020-02-16) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.5
+
+ Changelog
+ Bug fixes
+
+Fixed Accessibility Issue: Sortable table headers not read by sceen reader(2d418d8 )
+Fixed column sorting feature breaks if the initial columns array doesn't have sort field(c1d1d72 )
+
+ Features
+N/A
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/2020/03/07/version-bump.html b/blog/2020/03/07/version-bump.html
new file mode 100644
index 000000000..33c8b5b12
--- /dev/null
+++ b/blog/2020/03/07/version-bump.html
@@ -0,0 +1,28 @@
+New Release (2020-03-07) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.0
+react-bootstrap-table2-filter@1.3.1
+react-bootstrap-table2-paginator@2.1.1
+
+ Changelog
+ Bug fixes
+
+Fixed hardcode id for size per page dropdown(094c907 )
+Add type=button
for size per page dropdown(094c907 )
+Fix abnormal onFilter
calls(SelectFilter onFilter hook is not fired when filter value is reset)(1f73806 )
+Fix hardcode id for column filters(6d7a4c4 )
+
+ Features
+N/A
+ Enhancements
+
+Upgrade react-transition-group
(9c66a20 )
+
+
\ No newline at end of file
diff --git a/blog/2020/03/16/version-bump.html b/blog/2020/03/16/version-bump.html
new file mode 100644
index 000000000..24bb48a67
--- /dev/null
+++ b/blog/2020/03/16/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2020-03-16) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table2-paginator@2.1.2
+
+ Changelog
+ Bug fixes
+
+Fix hidePageListOnlyOnePage
isn't work on PaginationListStandalone
(ac73e9b )
+Fix bootstrap4
isn't work for SizePerPageDropdownStandalone
(b55aba6 )
+
+ Features
+N/A
+ Enhancements
+
+Implement disablePageTitle
to allow to disable title on page button(a3f8cfc )
+
+
\ No newline at end of file
diff --git a/blog/2020/04/18/version-bump.html b/blog/2020/04/18/version-bump.html
new file mode 100644
index 000000000..6b47dbe2a
--- /dev/null
+++ b/blog/2020/04/18/version-bump.html
@@ -0,0 +1,23 @@
+New Release (2020-04-18) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.1
+react-bootstrap-table2-filter@1.3.2
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Implement afterFilter
function(51fbb1e )
+Add onAuxClick
event for column and row event(54df96c )
+
+
\ No newline at end of file
diff --git a/blog/2020/05/17/version-bump.html b/blog/2020/05/17/version-bump.html
new file mode 100644
index 000000000..23b2a919b
--- /dev/null
+++ b/blog/2020/05/17/version-bump.html
@@ -0,0 +1,24 @@
+New Release (2020-05-17) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.2
+react-bootstrap-table2-filter@1.3.3
+react-bootstrap-table2-toolkit@2.1.3
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Implement afterFilter
function(51fbb1e )
+Add onAuxClick
event for column and row event(54df96c )
+
+
\ No newline at end of file
diff --git a/blog/2020/05/31/version-bump.html b/blog/2020/05/31/version-bump.html
new file mode 100644
index 000000000..e9a9df734
--- /dev/null
+++ b/blog/2020/05/31/version-bump.html
@@ -0,0 +1,23 @@
+New Release (2020-05-31) · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.3
+
+ Changelog
+ Bug fixes
+
+Fixed Lodash for underscore - _utils2.default.contains
is not a function(cd00c3c )
+
+ Features
+N/A
+ Enhancements
+
+Allow data containing dots in key names(8b6992b )
+
+
\ No newline at end of file
diff --git a/blog/atom.xml b/blog/atom.xml
new file mode 100644
index 000000000..52c1d6ed1
--- /dev/null
+++ b/blog/atom.xml
@@ -0,0 +1,1448 @@
+
+
+ https://react-bootstrap-table.github.io/blog
+ react-bootstrap-table2 Blog
+ 2020-05-31T06:00:00Z
+ Feed for Node.js
+
+ The best place to stay up-to-date with the latest react-bootstrap-table2 news and events.
+ https://react-bootstrap-table.github.ioimg/logo/hybrid-white-large.svg
+ Copyright © 2020 react-bootstrap-table2
+
+
+ https://react-bootstrap-table.github.io/blog/2020/05/31/version-bump.html
+
+
+ 2020-05-31T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2020/05/17/version-bump.html
+
+
+ 2020-05-17T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2020/04/18/version-bump.html
+
+
+ 2020-04-18T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2020/03/16/version-bump.html
+
+
+ 2020-03-16T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2020/03/07/version-bump.html
+
+
+ 2020-03-07T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2020/02/16/version-bump.html
+
+
+ 2020-02-16T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2020/02/09/version-bump.html
+
+
+ 2020-02-09T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/12/07/version-bump.html
+
+
+ 2019-12-07T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/12/02/version-bump.html
+
+
+ 2019-12-02T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/11/16/version-bump.html
+
+
+ 2019-11-16T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/11/09/version-bump.html
+
+
+ 2019-11-09T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/09/29/version-bump.html
+
+
+ 2019-09-29T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/09/08/version-bump.html
+
+
+ 2019-09-08T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/08/25/version-bump.html
+
+
+ 2019-08-25T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/08/10/version-bump.html
+
+
+ 2019-08-10T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/07/21/version-bump.html
+
+
+ 2019-07-21T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/06/25/version-bump.html
+
+
+ 2019-06-25T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/06/10/version-bump.html
+
+
+ 2019-06-10T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/05/19/version-bump.html
+
+
+ 2019-05-19T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/04/27/version-bump.html
+
+
+ 2019-04-27T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/04/16/version-bump.html
+
+
+ 2019-04-16T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/03/31/version-bump.html
+
+
+ 2019-03-31T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/03/26/version-bump.html
+
+
+ 2019-03-26T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/03/17/version-bump.html
+
+
+ 2019-03-17T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/03/10/version-bump.html
+
+
+ 2019-03-10T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/02/24/version-bump.html
+
+
+ 2019-02-24T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/02/18/version-bump.html
+
+
+ 2019-02-18T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/02/16/version-bump.html
+
+
+ 2019-02-16T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/02/09/version-bump.html
+
+
+ 2019-02-09T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/01/20/version-bump.html
+
+
+ 2019-01-20T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2019/01/06/version-bump.html
+
+
+ 2019-01-06T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/12/24/version.bump.html
+
+
+ 2018-12-24T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/12/23/version-bump.html
+
+
+ 2018-12-23T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/12/21/version-bump.html
+
+
+ 2018-12-21T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/12/05/version-bump.html
+
+
+ 2018-12-05T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/11/10/version-bump.html
+
+
+ 2018-11-10T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/11/04/version.bump.html
+
+
+ 2018-11-04T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/10/29/version-bump.html
+
+
+ 2018-10-29T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/10/14/version-bump.html
+
+
+ 2018-10-14T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/10/07/version-bump.html
+
+
+ 2018-10-07T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/09/30/version-bump.html
+
+
+ 2018-09-30T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/09/03/version-bump.html
+
+
+ 2018-09-03T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/08/27/version-bump.html
+
+
+ 2018-08-27T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/08/21/version-bump.html
+
+
+ 2018-08-21T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/08/12/version-bump.html
+
+
+ 2018-08-12T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/08/04/version-bump.html
+
+
+ 2018-08-04T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/08/01/version-bump.html
+
+
+ 2018-08-01T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/07/28/version-bump.html
+
+
+ 2018-07-28T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/07/15/version-bump.html
+
+
+ 2018-07-15T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/06/24/version-bump.html
+
+
+ 2018-06-24T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/06/04/version-bump.html
+
+
+ 2018-06-04T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/05/23/version-bump.html
+
+
+ 2018-05-23T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/05/13/version-bump.html
+
+
+ 2018-05-13T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/05/07/version-bump.html
+
+
+ 2018-05-07T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/04/15/version-bump.html
+
+
+ 2018-04-15T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/04/01/version-bump.html
+
+
+ 2018-04-01T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/03/19/version.bump.html
+
+
+ 2018-03-19T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/03/06/version-bump.html
+
+
+ 2018-03-06T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/02/14/version-bump.html
+
+
+ 2018-02-14T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/02/02/version-bump.html
+
+
+ 2018-02-02T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/01/24/release-plan.html
+
+
+ 2018-01-24T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
+
+ https://react-bootstrap-table.github.io/blog/2018/01/24/new-version-0.1.0.html
+
+
+ 2018-01-24T06:00:00Z
+
+
+ Allen Fang
+ https://twitter.com/allenfang_tw
+
+
+
\ No newline at end of file
diff --git a/blog/feed.xml b/blog/feed.xml
new file mode 100644
index 000000000..b58073e0a
--- /dev/null
+++ b/blog/feed.xml
@@ -0,0 +1,1144 @@
+
+
+
+ react-bootstrap-table2 Blog
+ https://react-bootstrap-table.github.io/blog
+ The best place to stay up-to-date with the latest react-bootstrap-table2 news and events.
+ Sun, 31 May 2020 06:00:00 GMT
+ http://blogs.law.harvard.edu/tech/rss
+ Feed for Node.js
+
+ react-bootstrap-table2 Blog
+ https://react-bootstrap-table.github.ioimg/logo/hybrid-white-large.svg
+ https://react-bootstrap-table.github.io/blog
+
+ Copyright © 2020 react-bootstrap-table2
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/05/31/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/05/31/version-bump.html
+ Sun, 31 May 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/05/17/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/05/17/version-bump.html
+ Sun, 17 May 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/04/18/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/04/18/version-bump.html
+ Sat, 18 Apr 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/03/16/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/03/16/version-bump.html
+ Mon, 16 Mar 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/03/07/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/03/07/version-bump.html
+ Sat, 07 Mar 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/02/16/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/02/16/version-bump.html
+ Sun, 16 Feb 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2020/02/09/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2020/02/09/version-bump.html
+ Sun, 09 Feb 2020 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/12/07/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/12/07/version-bump.html
+ Sat, 07 Dec 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/12/02/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/12/02/version-bump.html
+ Mon, 02 Dec 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/11/16/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/11/16/version-bump.html
+ Sat, 16 Nov 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/11/09/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/11/09/version-bump.html
+ Sat, 09 Nov 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/09/29/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/09/29/version-bump.html
+ Sun, 29 Sep 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/09/08/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/09/08/version-bump.html
+ Sun, 08 Sep 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/08/25/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/08/25/version-bump.html
+ Sun, 25 Aug 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/08/10/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/08/10/version-bump.html
+ Sat, 10 Aug 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/07/21/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/07/21/version-bump.html
+ Sun, 21 Jul 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/06/25/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/06/25/version-bump.html
+ Tue, 25 Jun 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/06/10/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/06/10/version-bump.html
+ Mon, 10 Jun 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/05/19/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/05/19/version-bump.html
+ Sun, 19 May 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/04/27/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/04/27/version-bump.html
+ Sat, 27 Apr 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/04/16/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/04/16/version-bump.html
+ Tue, 16 Apr 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/03/31/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/03/31/version-bump.html
+ Sun, 31 Mar 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/03/26/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/03/26/version-bump.html
+ Tue, 26 Mar 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/03/17/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/03/17/version-bump.html
+ Sun, 17 Mar 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/03/10/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/03/10/version-bump.html
+ Sun, 10 Mar 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/02/24/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/02/24/version-bump.html
+ Sun, 24 Feb 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/02/18/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/02/18/version-bump.html
+ Mon, 18 Feb 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/02/16/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/02/16/version-bump.html
+ Sat, 16 Feb 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/02/09/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/02/09/version-bump.html
+ Sat, 09 Feb 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/01/20/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/01/20/version-bump.html
+ Sun, 20 Jan 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2019/01/06/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2019/01/06/version-bump.html
+ Sun, 06 Jan 2019 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/12/24/version.bump.html
+ https://react-bootstrap-table.github.io/blog/2018/12/24/version.bump.html
+ Mon, 24 Dec 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/12/23/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/12/23/version-bump.html
+ Sun, 23 Dec 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/12/21/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/12/21/version-bump.html
+ Fri, 21 Dec 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/12/05/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/12/05/version-bump.html
+ Wed, 05 Dec 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/11/10/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/11/10/version-bump.html
+ Sat, 10 Nov 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/11/04/version.bump.html
+ https://react-bootstrap-table.github.io/blog/2018/11/04/version.bump.html
+ Sun, 04 Nov 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/10/29/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/10/29/version-bump.html
+ Mon, 29 Oct 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/10/14/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/10/14/version-bump.html
+ Sun, 14 Oct 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/10/07/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/10/07/version-bump.html
+ Sun, 07 Oct 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/09/30/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/09/30/version-bump.html
+ Sun, 30 Sep 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/09/03/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/09/03/version-bump.html
+ Mon, 03 Sep 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/08/27/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/08/27/version-bump.html
+ Mon, 27 Aug 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/08/21/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/08/21/version-bump.html
+ Tue, 21 Aug 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/08/12/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/08/12/version-bump.html
+ Sun, 12 Aug 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/08/04/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/08/04/version-bump.html
+ Sat, 04 Aug 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/08/01/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/08/01/version-bump.html
+ Wed, 01 Aug 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/07/28/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/07/28/version-bump.html
+ Sat, 28 Jul 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/07/15/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/07/15/version-bump.html
+ Sun, 15 Jul 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/06/24/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/06/24/version-bump.html
+ Sun, 24 Jun 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/06/04/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/06/04/version-bump.html
+ Mon, 04 Jun 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/05/23/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/05/23/version-bump.html
+ Wed, 23 May 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/05/13/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/05/13/version-bump.html
+ Sun, 13 May 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/05/07/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/05/07/version-bump.html
+ Mon, 07 May 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/04/15/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/04/15/version-bump.html
+ Sun, 15 Apr 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/04/01/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/04/01/version-bump.html
+ Sun, 01 Apr 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/03/19/version.bump.html
+ https://react-bootstrap-table.github.io/blog/2018/03/19/version.bump.html
+ Mon, 19 Mar 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/03/06/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/03/06/version-bump.html
+ Tue, 06 Mar 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/02/14/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/02/14/version-bump.html
+ Wed, 14 Feb 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/02/02/version-bump.html
+ https://react-bootstrap-table.github.io/blog/2018/02/02/version-bump.html
+ Fri, 02 Feb 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/01/24/release-plan.html
+ https://react-bootstrap-table.github.io/blog/2018/01/24/release-plan.html
+ Wed, 24 Jan 2018 06:00:00 GMT
+
+
+ -
+
+ https://react-bootstrap-table.github.io/blog/2018/01/24/new-version-0.1.0.html
+ https://react-bootstrap-table.github.io/blog/2018/01/24/new-version-0.1.0.html
+ Wed, 24 Jan 2018 06:00:00 GMT
+
+
+
+
\ No newline at end of file
diff --git a/blog/index.html b/blog/index.html
new file mode 100644
index 000000000..23cab48ca
--- /dev/null
+++ b/blog/index.html
@@ -0,0 +1,179 @@
+Blog · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.3
+
+ Changelog
+ Bug fixes
+
+Fixed Lodash for underscore - _utils2.default.contains
is not a function(cd00c3c )
+
+ Features
+N/A
+ Enhancements
+
+Allow data containing dots in key names(8b6992b )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.2
+react-bootstrap-table2-filter@1.3.3
+react-bootstrap-table2-toolkit@2.1.3
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Implement afterFilter
function(51fbb1e )
+Add onAuxClick
event for column and row event(54df96c )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.1
+react-bootstrap-table2-filter@1.3.2
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Implement afterFilter
function(51fbb1e )
+Add onAuxClick
event for column and row event(54df96c )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table2-paginator@2.1.2
+
+ Changelog
+ Bug fixes
+
+Fix hidePageListOnlyOnePage
isn't work on PaginationListStandalone
(ac73e9b )
+Fix bootstrap4
isn't work for SizePerPageDropdownStandalone
(b55aba6 )
+
+ Features
+N/A
+ Enhancements
+
+Implement disablePageTitle
to allow to disable title on page button(a3f8cfc )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@4.0.0
+react-bootstrap-table2-filter@1.3.1
+react-bootstrap-table2-paginator@2.1.1
+
+ Changelog
+ Bug fixes
+
+Fixed hardcode id for size per page dropdown(094c907 )
+Add type=button
for size per page dropdown(094c907 )
+Fix abnormal onFilter
calls(SelectFilter onFilter hook is not fired when filter value is reset)(1f73806 )
+Fix hardcode id for column filters(6d7a4c4 )
+
+ Features
+N/A
+ Enhancements
+
+Upgrade react-transition-group
(9c66a20 )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.5
+
+ Changelog
+ Bug fixes
+
+Fixed Accessibility Issue: Sortable table headers not read by sceen reader(2d418d8 )
+Fixed column sorting feature breaks if the initial columns array doesn't have sort field(c1d1d72 )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.4
+react-bootstrap-table2-toolkit@2.1.2
+
+ Changelog
+ Bug fixes
+
+Fixed accessibility issue: Users navigating with tab
cannot trigger sort functionality(bfb2592 )
+Fixed column sorting feature breaks if the initial columns array doesn't have sort field(5cc7882 )
+Fixed columns initially hidden when using ToolKitProvider and columns array changes(7162728 )
+
+ Features
+N/A
+ Enhancements
+
+Allow to add class on thead
and tbody
(7b593a7 )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.3
+react-bootstrap-table2-toolkit@2.1.1
+
+ Changelog
+ Bug fixes
+
+Fixed wrong table caption in bootstrap 4(38b0fb3 )
+
+ Features
+
+Allow to export table footer to csv file(47d6eb0 )
+Allow to manage sorting state(2068f51 )
+
+ Enhancements
+
+One-time sorting configuration(a07b2da )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.2
+
+ Changelog
+ Bug fixes
+
+Fixed incorrect row colspan when apply column toggle or column.hidden(4a340c7 )
+Fixed filterPosition
property does not work with rowSelect(8ecdbf6 )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.1
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Support selectRow.nonSelectableStyle
and selectRow.nonSelectableClasses
to custom nonselectable row
+Add default class to selection column and expand column.
+Fix react key warning when apply filterPosition
props
+
+
\ No newline at end of file
diff --git a/blog/page2/index.html b/blog/page2/index.html
new file mode 100644
index 000000000..4c8786110
--- /dev/null
+++ b/blog/page2/index.html
@@ -0,0 +1,215 @@
+Blog · react-bootstrap-table2 Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.3.0
+react-bootstrap-table2-filter@1.3.0
+
+ Changelog
+ Bug fixes
+
+Fixed select all broken if keyField
is nested(1b9bd63 )
+Fixed can not configure tabIndex
for header column(b2121fd )
+Try to fix abnormal issue in selection.js
(18caf0a )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.2.1
+
+ Changelog
+ Bug fixes
+
+Fixed select all broken if keyField
is nested(1b9bd63 )
+Fixed can not configure tabIndex
for header column(b2121fd )
+Try to fix abnormal issue in selection.js
(18caf0a )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.2.0
+react-bootstrap-table2-editor@1.4.0
+react-bootstrap-table2-filter@1.2.0
+react-bootstrap-table2-paginator@2.1.0
+react-bootstrap-table2-toolkit@2.1.0
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Avoid warning for react legacy lifecycle(7c8bf00
)
+Support custom search on cell level(00b1558
)
+Support column.sortValue
for custom the sort value of cell(ec1f96c )
+Enhance column.headerEvents
and column.footerEvents
for adding some useful data(16128e7 )
+
+ 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 )
+Fixed columns doesn't update correctly when enable column toggle(43b5eeb )
+Fixed disabling cell edit on table throws exception(70827ee )
+
+ Features
+N/A
+ Enhancements
+
+Allow to configure the options of select filter by a custom function(23cb0bb )
+Add expandRow.className
for customing the class on expanding row(c12d3fa )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.1.8
+react-bootstrap-table2-editor@1.3.2
+react-bootstrap-table2-filter@1.1.11
+react-bootstrap-table2-paginator@2.0.9
+
+ Changelog
+ Bug fixes
+
+Fixed inconsistence filter logic in custom filtering(423769c )
+Fixed column toggle will cancel the filter state(4de565b )
+Fixed wrong type convert when column didn't have specified type(08ec8a9 )
+Fixed pagination elements not on same row/line(1a44ce0 )
+
+ Features
+N/A
+ Enhancements
+
+column.editor.getOptions
recieve the second argument which contain row
and column
(856e63d )
+
+ Changed Packages
+We got following packages version bump in this release:
+
+react-bootstrap-table-next@3.1.6
+react-bootstrap-table2-editor@1.3.0
+
+ Changelog
+ Bug fixes
+
+Fixed incorrect column size when dynamic change selectRow.hideSelectColumn
(d7e1f1d )
+
+ Features
+
+Support saving type of cell editing(92f1449 )
+
+ Enhancements
+
+Enhance serveral examples and docs
+Allow to custom the classname on the parent row of expanded row(ec4864d )
+Add rowIndex
as second arguments for expandRow.renderer
(db22bb9 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.5
+react-bootstrap-table2-filter@1.1.10
+react-bootstrap-table2-paginator@2.0.7
+
+ Changelog
+ Bug fixes
+
+Fixed can not use classes
in IE(221e336 )
+Fixed column formatter can not work with external state with expandRow(4cf6e65 )
+Fixed multiselect filter broken in IE(e58533d )
+
+ Features
+N/A
+ Enhancements
+
+Allow firstPageText
, prePageText
, nextPageText
and lastPageText
adopt PropType.node
type(7382010 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.4
+react-bootstrap-table2-editor@1.2.4
+react-bootstrap-table2-toolkit@2.0.1
+
+ Changelog
+ Bug fixes
+
+Fixed tabindex on table headers should not be > 0(4ec02b2 )
+
+ Features
+N/A
+ Enhancements
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.3
+react-bootstrap-table2-toolkit@2.0.0
+react-bootstrap-table2-overlay@2.0.0
+
+ Changelog
+ Bug fixes
+
+Fix clicking on selection column will trigger row expand(2c6cc91 )
+Fix file saver issue for IE(55eea6f )
+
+ Features
+N/A
+ Enhancements
+
+Enhance Table header accessibility(a1457df )
+Enhance Search input accessibility(7c259cd )
+Upgrade react-loading-overlay
for react-bootstrap-table2-overlay
(036c3fd )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.2
+react-bootstrap-table2-toolkit@1.4.2
+
+ Changelog
+ Bug fixes
+
+Fix rendering searchbar will throw tableId
prop type warning(#914 )
+Fix expandRow
does not work with nested keyField
(36fa9b8 )
+Fix CSV Export doesn't handle double quotes(737922a )
+Fix column.onClick
some parameters is undefined
if column.editable
is true(6168bd7 )
+
+ Features
+N/A
+ Enhancements
+
+Allow to custom the style on selection header cell via selectRow.headerColumnStyle
(0f37fae )
+
+
\ No newline at end of file
diff --git a/blog/page3/index.html b/blog/page3/index.html
new file mode 100644
index 000000000..e1dd2ce91
--- /dev/null
+++ b/blog/page3/index.html
@@ -0,0 +1,199 @@
+Blog · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.1
+react-bootstrap-table2-filter@1.1.9
+react-bootstrap-table2-paginator@2.0.6
+react-bootstrap-table2-toolkit@1.4.1
+
+ Changelog
+ Bug fixes
+
+Fix expandRow.expanded undefined when enable sort and row expand(160dede )
+
+ Features
+
+Add onDataSizeChange
prop for listening data size change in table(363a432 )
+
+ Enhancements
+
+Allow select options initialization with empty array(#894 )
+Accessibility on table seach input and filter(#890 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.1.0
+react-bootstrap-table2-editor@1.2.3
+react-bootstrap-table2-filter@1.1.8
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+Animation on expand/collapse row(#861 )
+
+ Enhancements
+
+Get Date information via UTC methods(#874 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.3
+react-bootstrap-table2-paginator@2.0.5
+
+ Changelog
+ Bug fixes
+
+Fixed cell won't be updated when column.formatExtraData
change(196ae33 )
+Fix pagination.alwaysShowAllBtns
perform wrongly in some case(7f1b7a6 )
+Fix column won't be updated when switch column order dynamically(a6ccafc )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.2
+react-bootstrap-table2-filter@1.1.7
+react-bootstrap-table2-toolkit@1.4.0
+
+ Changelog
+ Bug fixes
+
+Fixed remote filter borken(7642bfa )
+Fixed custom editor didn't cancel when switch to anther cell(c5d9e04 )
+
+ Features
+
+Support to export only searched/filtered data cross pagesd0e70f7
+
+ Enhancements
+N/A
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.1
+react-bootstrap-table2-filter@1.1.6
+react-bootstrap-table2-paginator@2.0.4
+react-bootstrap-table2-toolkit@1.3.2
+
+ Changelog
+ Bug fixes
+
+Fixed btnContextual
prop on SizePerPageDropdownStandalone
not passed to SizePerPageDropdown
(3af30a0 )
+Fixed expanded row column span does not update(#837 )
+Fixed column filter with custom pagination is not work well(921e8c7 )
+Fixed pagination is not work well when data delete or insert(e9f08d2 )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@3.0.0
+react-bootstrap-table2-filter@1.1.5
+react-bootstrap-table2-toolkit@1.3.1
+
+ Changelog
+ Bug fixes
+
+Fixed cell didn't rerender correctly when column.formatter
defined and use row
inside the column.formatter
function.(bf0c5c4 )
+Fixed selection broken when call setState
in selectRow.onSelect
(c01f45a )
+Fixed search and filter perform a abnormal behavor(#811 )
+
+ Features
+N/A
+ Enhancements
+
+Allow to add custom className on Export CSV and Clear Search button(09f21e8 )
+Allow to operate on cell editing context via reacr refs
(#815 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.2.0
+react-bootstrap-table2-toolkit@1.3.0
+react-bootstrap-table2-paginator@2.0.3
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+Support Column Toggle(#800 )
+
+ Enhancements
+
+Support PaginationTotalStandalone
component(#801 )
+Add rowIndex
for selectRow.selectionRenderer
(a7c2a49 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.1.2
+react-bootstrap-table2-filter@1.1.4
+react-bootstrap-table2-toolkit@1.2.2
+
+ Changelog
+ Bug fixes
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.1.1
+react-bootstrap-table2-filter@1.1.3
+react-bootstrap-table2-toolkit@1.2.1
+react-bootstrap-table2-paginator@2.0.2
+
+ Changelog
+ Bug fixes
+
+Fixed Standalone Pagination render wrong page list when user do the filter or search(cf043c6 , 63c2630 , cacc28e )
+Fixed Controlled input element lose focus on re-render inside expanded rows(8bef7eb )
+
+ Features
+N/A
+ Enhancements
+
+Allow to return a custom filter results from onFilter
(aafbc7e )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.1.0
+react-bootstrap-table2-filter@1.1.2
+react-bootstrap-table2-toolkit@1.2.0
+
+ Changelog
+ Bug fixes
+
+Fixed can not clear date filter(9988e79 )
+
+ Features
+
+Support built-in search clear button(1c68892 )
+Support table footer(#703 )
+
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/page4/index.html b/blog/page4/index.html
new file mode 100644
index 000000000..032e75a37
--- /dev/null
+++ b/blog/page4/index.html
@@ -0,0 +1,184 @@
+Blog · react-bootstrap-table2 Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.0.1
+react-bootstrap-table2-filter@1.1.1
+react-bootstrap-table2-paginator@2.0.1
+react-bootstrap-table2-toolkit@1.1.2
+
+ Changelog
+ Bug fixes
+
+Fixed export csv error (TypeError: this.visibleRows is not a function)(#745 )
+Fixed typeError happened on export CSV after js file compression(#745 )
+Fixed column header hides but not columnBody or columnData(#741 )
+Fixed props type mismatch for SizePerPageOption component(#742 )
+
+ Features
+N/A
+ Enhancements
+
+Support render expand column at the right side(#746 )
+Support column.onFilter
hook function(#743 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@2.0.0
+react-bootstrap-table2-paginator@2.0.0
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+N/A
+ Enhancements
+
+Impove the flexibility about customizing pagination components.
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.4
+
+ Changelog
+ Bug fixes
+
+Fixed expand row borken(#725 )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.3
+
+ Changelog
+ Bug fixes
+
+Fixed a non expandable row still expandable when expandRow.showExpandColumn
is enable(#698 )
+
+ Features
+N/A
+ Enhancements
+
+Support hidden row(4ddbfd4 )
+Pass rowKey
and expandable
to expandRow.expandColumnRenderer
callback function(bc4697b )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.2
+
+ Changelog
+ Bug fixes
+
+Fixed expandRow.onExpand
called twice on click by expand column(a23599f )
+Fixed synthetic event issue for selectRow.onSelect
and selectRow.onSelectAll
(a7ae524 )
+
+ Features
+ Enhancements
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.1
+react-bootstrap-table2-filter@1.1.0
+react-bootstrap-table2-paginator@1.0.4
+react-bootstrap-table2-editor@1.2.2
+
+ Changelog
+ Bug fixes
+
+Fixed wrong usage of label
and value
for the options of select filter.
+Fixed wrong from
and to
value when enable showTotal
for pagination.
+Fixed condensed
is broken in bootstrap@4
+Fixed the error message disappear in bootstrap@4
+
+ Features
+ Enhancements
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.4.0
+react-bootstrap-table2-filter@1.0.2
+
+ Changelog
+ Bug fixes
+ Features
+ Enhancements
+
+Allow to call setState
in selectRow.onSelect
and selectRow.onSelectAll
(#644 )
+Allow to use array for select filter options(#646 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.3.1
+react-bootstrap-table2-editor@1.2.1
+
+ Changelog
+ Bug fixes
+
+Try to fixed Uncaught TypeError: l.getData is not a function.
+
+ Features
+ Enhancements
+
+Support async cellEdit.beforeSaveCell
(#634 )
+Support async column.validator
(#633 )
+Enhance column.events
(#632 )
+
+ Changed Packages
+We got following package version bump in this release:
+
+react-bootstrap-table-next@1.3.0
+react-bootstrap-table2-editor@1.2.0
+
+ Changelog
+ Bug fixes
+
+Fixed bug if pagination
props changes(#599 )
+
+ Features
+
+Support expand/collapse row only though expand indicator(#546 )
+Support selectRow.clickToExpand
, which allow user to click on row to select/expand row at the same time(#497 )
+Support render tabIndex
on td
(#607 )
+
+ Enhancements
+
+Improve row level performance(#497 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.2.1
+react-bootstrap-table2-paginator@1.0.3
+react-bootstrap-table2-toolkit@1.1.1
+
+ Changelog
+ Bug fixes
+
+Fixed remote search bug(#591 )
+Fixed wrong calculation for from
and to
in pagination when remote search/filter enable and data is shrink below the current page(#594 )
+
+ Features
+
+Implement column.sortCaret
(#593 ) for customing the sort caret
+
+ Enhancements
+
+Easy to access the exposed API from react ref
(#592 )
+
+
\ No newline at end of file
diff --git a/blog/page5/index.html b/blog/page5/index.html
new file mode 100644
index 000000000..a53c8a682
--- /dev/null
+++ b/blog/page5/index.html
@@ -0,0 +1,209 @@
+Blog · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.2.0
+react-bootstrap-table2-editor@1.1.0
+react-bootstrap-table2-toolkit@1.1.0
+
+ Changelog
+ Bug fixes
+
+Fixed cannot assign to read only property 'textAlign' of object(#575 )
+Fixed wrong results pass to selectRow.onSelectAll when isSelect argument is false(#570 )
+
+ Features
+
+Implement expandRow.onlyOneExpanding
(#574 )
+Implement selectRow.hideSelectAll
(#574 )
+Support Default Search(#571 )
+Implement auto select input text when editing cell(#569 )
+
+ Enhancements
+
+Fixe a non printable characters in csv output(#572 )
+Add onContextMenu
on rowEvents
(#556 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.4
+react-bootstrap-table2-editor@1.0.1
+react-bootstrap-table2-toolkit@1.0.3
+
+ Changelog
+ Bug fixes
+
+Fixed selectRow.onSelectAll
will return undefined
value after search(#509 )
+
+ Features
+
+Support dummy column(#520 )
+
+Enable it via column.isDummyField
+
+Able to export csv by current selected rows(#522 )
+
+ Enhancements
+
+Add onStartEdit
callback which will be called when cell editor is trigger(#523 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.3
+
+ Changelog
+ Bug fixes
+
+Fixed selectRow.onSelectAll
will return undefined
value after search(#509 )
+
+ Features
+N/A
+ Enhancements
+
+Fixed some wrong code in storybooks
+column.sortFunc
now pass rowA and rowB(#508 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.2
+react-bootstrap-table-toolkit@1.0.2
+react-bootstrap-table2-paginator@1.0.2
+
+ Changelog
+ Bug fixes
+
+Fixed missing onChange prop for selection checkbox(#417 )
+Fixed pagination calculation fails when data change(#474 )
+
+
+ Features
+N/A
+ Enhancements
+
+Fixed some wrong code in storybooks
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.1.0
+react-bootstrap-table2-toolkit@1.0.1
+react-bootstrap-table2-paginator@1.0.1
+
+ Changelog
+ Bug fixes
+
+Fixed column.style and column.align will conflicts(#481 )
+Fixed search will be clear if search the same text twice(#470 )
+Fixed debounce bug(#468 )
+Fixed pagination.paginationTotalRenderer
give wrong from
and to
argument(#467 )
+
+ Features
+
+Export CSV allow to export current display data instead of whole list(#469 )
+
+ Enhancements
+
+Performance improvment on cell level(#449 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@1.0.0
+react-bootstrap-table2-filter@1.0.0
+react-bootstrap-table2-editor@1.0.0
+react-bootstrap-table2-paginator@1.0.0
+react-bootstrap-table2-toolkit@1.0.0
+
+ Notes
+In 1.0.0
, you have to upgrade react
and react-dom
to 16.3.0
or behind.
+ Changelog
+ Bug fixes
+
+fix bug for default sort and filter have potential issue when remote enabled.
+
+ Features
+
+Row Expand
+Table Search
+Export CSV
+
+ Enhancements
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table2-filter@0.3.2
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+ Enhancements
+N/A
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table2-filter@0.3.1
+
+ Changelog
+ Bug fixes
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.15
+react-bootstrap-table2-paginator@0.1.6
+
+ Changelog
+ Bug fixes
+
+Fixed Filter + Pagination returns empty rows(7a787bb )
+
+ Features
+N/A
+ Enhancements
+
+Custom the table header class via [headerClasses
] prop on BootstrapTable
(199bf8e )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.14
+react-bootstrap-table2-paginator@0.1.5
+react-bootstrap-table2-filter@0.3.0
+
+ Changelog
+ Bug fixes
+
+Fix table will jump to first page after cell editing in remote mode(42c6bc0 )
+Click on filter will trigger sorting(#380 )
+
+ Features
+
+Support custom filter(#389 )
+
+ Enhancements
+N/A
+
\ No newline at end of file
diff --git a/blog/page6/index.html b/blog/page6/index.html
new file mode 100644
index 000000000..e611efc23
--- /dev/null
+++ b/blog/page6/index.html
@@ -0,0 +1,203 @@
+Blog · react-bootstrap-table2 Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.13
+react-bootstrap-table2-paginator@0.1.4
+react-bootstrap-table2-filter@0.2.0
+react-bootstrap-table2-overlay@0.1.2
+
+ Changelog
+ Bug fixes
+
+Fix remote sort still sorting data(#354 )
+Fix react-bootstrap-table2-overlay
does not consider caption height(b11019c )
+
+ Features
+
+Support date filter(#365 )
+
+ Enhancements
+
+Support to custome the pagination total(#359 )
+Support to custom the selection column(#364 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.12
+
+ Changelog
+ Bug fixes
+
+Fix the bool rendering issues in React (#340 )
+
+ Features
+N/A
+ Enhancements
+N/A
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.11
+react-bootstrap-table2-filter@0.1.7
+
+ Changelog
+ Bug fixes
+
+Fixed filtered table doesn't rerender on prop change(#303 )
+Fix programmatically filter broken when filter multiple column at the same time(#334 )
+
+ Features
+N/A
+ Enhancements
+
+Implement wrapperClasses
to allow to custom the class on outer element which wrap up the table
element(#325 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.9
+react-bootstrap-table2-editor@0.2.0
+react-bootstrap-table2-paginator@0.1.2
+
+ Changelog
+ Bug fixes
+N/A
+ Features
+
+Rich cell editors(#322 )
+Allow to custom cell editors(#322 )
+Implement pagination total indication(#323 )
+
+ Enhancements
+
+rowEvents
support onDoubleClick
(#324 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.8
+react-bootstrap-table2-filter@0.1.6
+
+ Changelog
+ Bug fixes
+
+ Features
+
+Programmtically Filters(#287 )
+
+ Enhancements
+
+Pass event object to selectRow.onSelect
and selectRow.onSelectAll
.(#304 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.6
+react-bootstrap-table2-editor@0.1.4
+react-bootstrap-table2-filter@0.1.4
+
+ Changelog
+ Bug fixes
+
+Fixed includes and find are not supported in IE(#274 )
+Fixed empty table is missing the last cell when row seleciton is enable(#276 )
+
+ Features
+
+Allow to configure the default sort direction(#286 )
+Allow to custom the cell editor's style and class(#268 )
+
+ Enhancements
+
+Don't render anything if noDataIndication
is not given(#275 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.5
+
+ Changelog
+ Bug fixes
+
+Fix selection was broken when data changed(#260 )
+
+ Features
+ Enhancements
+
+Add classes
and id
on BootstrapTable
for customization(#247 )
+column.hidden
will not render element instead of setting display:none
(#261 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.4
+react-bootstrap-table2-editor@0.1.2
+
+ Changelog
+ Bug fixes
+
+Fix the sort will not be triggered when data is changed(#232 )
+Fix empty element issue(#219 )
+Fix Failed prop type: The prop defaultValue
is marked as required in TextEditor
, but its value is null
(5dd1f1e9 )
+
+ Features
+ Enhancements
+
+rowEvents.onMouseEnter
and rowEvents.onMouseLeave
will be wrapped up and pass row informations(#233 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.3
+react-bootstrap-table2-filter@0.1.3
+
+ Changelog
+ Bug fixes
+
+Fixed TextFilter contains an input of type text with both value and defaultValue props(a0af964 )
+
+ Features
+
+Support Number Filter(#200 )
+Support caseSensitive
on Text and Select filter(#201 )
+Support sort event listener(#202 )
+
+ Enhancements
+
+Text Filter right now is case insensitive which same as react-bootstrap-table
#201
+rowEvents.onClick
will be wrapped so that funcation can recieve additional informatnion like: row
and rowIndex
(#187 )
+
+ Changed Packages
+This release bump following packages:
+
+react-bootstrap-table-next@0.1.2
+react-bootstrap-table2-filter@0.1.2
+
+ Changelog
+ Bug fixes
+
+Fixed call selectRow.onSelect
twice(#180 )
+Fixed wrong colSpan for noDataIndication
if there are column is hidden(#185 )
+
+ Features
+
+Support Select Filter(#183 )
+
+ Enhancements
+
+Column filter style improvement(#183 )
+
+Remember to add the css of react-bootstrap-table2-filter
+
+Fix key field in cell should not be cell value(#172 )
+
+
\ No newline at end of file
diff --git a/blog/page7/index.html b/blog/page7/index.html
new file mode 100644
index 000000000..c16bfe7c7
--- /dev/null
+++ b/blog/page7/index.html
@@ -0,0 +1,128 @@
+Blog · react-bootstrap-table2 2018 Q1
+ 0.1.0
+
+ 0.1.1
+
+Select Filter
+Regex Filter
+
+ 0.1.2
+
+Date Filter
+Number Filter
+
+ 0.1.3
+
+Filter functionality enhancement
+
+Clean filter or clean all
+Programmatically filter
+
+
+ 0.1.4
+
+ 0.2.0
+
+Expand row
+Start compatible for bootstrap@4
+Sort management(External sort)
+Work on partial data(sort, filter) for pagination(remote or not remote)
+
+ 0.2.1
+
+ 0.2.2
+
+ 0.2.3
+
+ 0.2.4
+
+Scrol Table(Probably not implement, we are still investigation)
+
+ 0.3.0
+
+Row/Column span
+Table toolkit base
+
+ 0.3.1
+
+Row delete
+export CSV
+
+ 0.3.2
+
+ 0.3.3
+
+ 2018 Q2
+ 0.4.0
+
+Sticky Header
+Frozen Column
+
+ Preface
+About five months works, we finally get a first drop for react-bootstrap-table2
. I just want to say that I'm very sorry to let you guys to wait for a long time.
+I know a lots of people experienced many bugs or feel hard to customize on table. Anyway, I'm very appreciated everyone's helps and feedbacks, I think that's the reason why I decided to rebuilt react-bootstrap-table2
.
+For the first drop, I really can't finish all the legacy features, but I will work more hard to finish them by March or April. Please see the release plan for more details.
+ 0.1.0
+ Legacy Features
+
+Basic Table
+
+Scrollabe table is not yet implement
+
+Basic Table Sort
+
+Multi sort is not yet implement
+Sort management is not yet implement
+
+Basic Row Selection
+
+Custom Selection is not yet implement
+
+Basic Cell Edit
+
+Custom Cell Edit is not yet implement
+
+Basic Pagination
+
+Custom Pagination is not yet implement
+
+Basic Column Filter(Text Filter only)
+
+ New Features
+
+ Enhancement
+
+One table structure, never unalign again.
+Remote enhancement, please read it .
+100% easy to customize the header columns, cells and rows !!!
+
+
+In 2018, let's try react-bootstrap-table2
and give a star for this repo, I think it's the biggest encouragement for me :)
+
+Feel free to open issues to ask any questions.
+Regards,
+Allen Fang
+
\ No newline at end of file
diff --git a/css/main.css b/css/main.css
new file mode 100644
index 000000000..8a5cdb218
--- /dev/null
+++ b/css/main.css
@@ -0,0 +1,1862 @@
+/* Reset */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+/* Base */
+
+body {
+ background: #f9f9f9;
+ color: #393939;
+ font: normal 16px/1.4em -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ height: 100vh;
+ text-align: left;
+ text-rendering: optimizeLegibility;
+}
+
+p {
+ line-height: 1.4;
+}
+
+img {
+ max-width: 100%;
+ height: auto;
+}
+
+article p img, article iframe {
+ max-width: 100%;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+a {
+ color: #1976d2;
+ text-decoration: none;
+}
+
+a.anchor {
+ display: block;
+ position: relative;
+ top: -62px;
+}
+
+a.hash-link {
+ float: left;
+ padding-right: 4px;
+ margin-top: 4px;
+ margin-left: -20px;
+ line-height: 1.2;
+ opacity: 0;
+ transition: opacity 0.3s;
+}
+
+h1:hover .hash-link,
+h2:hover .hash-link,
+h3:hover .hash-link,
+h4:hover .hash-link {
+ opacity: 0.5;
+ transition: none;
+}
+a.hash-link:hover {
+ opacity: 1!important;
+ transition: none;
+}
+
+blockquote {
+ padding: 15px 30px 15px 15px;
+ margin: 20px 0;
+ background-color: rgba(204, 122, 111, 0.1);
+ border-left: 5px solid rgba(191, 87, 73, 0.2);
+}
+
+#fb_oss a {
+ border: 0;
+}
+
+h1, h2, h3, h4 {
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-weight: 300;
+ color: #1976d2;
+}
+
+h4 {
+ line-height: 2em;
+}
+
+header h2 {
+ color: white;
+ font-size: 20px;
+}
+
+.homeContainer {
+ background: #fff;
+ color: #1976d2;
+ text-align: center;
+}
+
+.homeContainer .homeWrapper {
+ padding: 2em 10px;
+}
+.homeContainer .homeWrapper .wrapper {
+ margin: 0px auto;
+ max-width: 900px;
+ padding: 0 20px;
+}
+.homeContainer .homeWrapper .projectLogo img {
+ height: 100px;
+ margin-bottom: 0px;
+}
+.homeContainer .homeWrapper h1#project_title {
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-size: 300%;
+ letter-spacing: -0.08em;
+ line-height: 1em;
+ margin-bottom: 80px;
+}
+.homeContainer .homeWrapper h2#project_tagline {
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-size: 200%;
+ letter-spacing: -0.04em;
+ line-height: 1em;
+}
+
+.wrapper {
+ margin: 0px auto;
+ max-width: 1100px;
+ padding: 0 20px;
+}
+
+.projectLogo {
+ display: none;
+ pointer-events: none;
+}
+.projectLogo img {
+ height: 100px;
+ margin-bottom: 0px;
+}
+
+.projectIntro {
+ margin: 40px 0;
+}
+
+.fbossFontLight {
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-weight: 300;
+ font-style: normal;
+}
+
+.fb-like {
+ display: block;
+ margin-bottom: 20px;
+ width: 100%;
+}
+.center {
+ display: block;
+ text-align: center;
+}
+
+.mainContainer {
+ background: #f9f9f9;
+ flex: 1;
+ font-size: 18px;
+}
+.mainContainer .wrapper {
+ text-align: left;
+}
+.mainContainer .wrapper .allShareBlock {
+ padding: 10px 0;
+}
+.mainContainer .wrapper .allShareBlock .pluginBlock {
+ margin: 12px 0;
+ padding: 0;
+}
+.mainContainer .wrapper a,
+.inner .projectIntro a {
+ text-decoration: none;
+}
+.mainContainer .wrapper a:hover,
+.mainContainer .wrapper a:focus,
+.inner .projectIntro a:hover,
+.inner .projectIntro a:focus {
+ text-decoration: underline;
+}
+.mainContainer .wrapper em, .mainContainer .wrapper i {
+ font-style: italic;
+}
+.mainContainer .wrapper strong, .mainContainer .wrapper b {
+ font-weight: bold;
+}
+.container .wrapper h1 {
+ font-size: 300%;
+ line-height: 1em;
+ margin: 0 0 10px 0;
+ padding: 1.4em 0 1em;
+ text-align: left;
+}
+.container .wrapper h2 {
+ color: #1976d2;
+ font-size: 22px;
+ line-height: 1em;
+ margin-top: 20px;
+ text-align: left;
+ padding: 10px 0;
+}
+.container .wrapper h2.blockHeader {
+ color: white;
+ font-size: 22px;
+ margin-top: 20px;
+ padding: 10px 0;
+}
+.container .wrapper h3 {
+ color: #1976d2;
+ font-size: 18px;
+ margin-top: 10px;
+ padding: 10px 0;
+}
+.container .wrapper h4 {
+ color: #1976d2;
+ font-size: 16px;
+ font-weight: 300;
+ margin: 0;
+ padding: 10px 0 0;
+}
+.referenceContainer .wrapper h3 {
+ border-top: 1px solid #e0e0e0;
+}
+.referenceContainer .wrapper h3:first-of-type {
+ border: 0;
+}
+.container .wrapper h4 + p {
+ padding-top: 0;
+}
+.mainContainer .wrapper p,
+.blockElement p {
+ padding: 0.8em 0 0 0;
+}
+.mainContainer .wrapper ul {
+ list-style: disc;
+}
+.mainContainer .wrapper ol, .mainContainer .wrapper ul {
+ padding: 10px 0 0 24px;
+}
+.mainContainer .wrapper ol li, .mainContainer .wrapper ul li {
+ margin: 0 0 10px 0;
+}
+.mainContainer .wrapper p,
+.blockElement p,
+.mainContainer .wrapper ul li,
+.mainContainer .wrapper ol li {
+ line-height: 1.7;
+ max-width: 50rem;
+}
+@media (max-width: 735px) {
+ .mainContainer .wrapper p,
+ .blockElement p,
+ .mainContainer .wrapper ul li,
+ .mainContainer .wrapper ol li {
+ font-size: 16px;
+ }
+}
+.mainContainer .wrapper strong {
+ font-weight: bold;
+}
+.mainContainer .wrapper .post {
+ position: relative;
+}
+.mainContainer .wrapper .post.basicPost {
+ margin-top: 30px;
+}
+
+.mainContainer .wrapper .post h1 {
+ margin-top: 20px;
+ margin-bottom: 0;
+ font-size: 250%;
+ padding: 10px 0;
+}
+.mainContainer .wrapper .post h2 {
+ font-size: 130%;
+}
+.mainContainer .wrapper .post h3 {
+ font-size: 110%;
+}
+.mainContainer .wrapper .post h5 {
+ font-weight: 300;
+ font-style: italic;
+}
+.mainContainer .wrapper .post h5 strong {
+ font-weight: 400;
+}
+.mainContainer .wrapper .post ol {
+ list-style: decimal outside none;
+}
+.mainContainer .wrapper .post .postHeader h1 {
+ font-size: 150%;
+ line-height: 1em;
+ padding: 0;
+}
+.mainContainer .wrapper .post .postHeader h1 a {
+ border: none;
+}
+.mainContainer .wrapper .post .postSocialPlugins {
+ padding-top: 1em;
+}
+.mainContainer .wrapper .post .docPagination {
+ background: #1976d2;
+ bottom: 0px;
+ left: 0px;
+ position: absolute;
+ right: 0px;
+}
+.mainContainer .wrapper .post .docPagination .pager {
+ display: inline-block;
+ width: 50%;
+}
+.mainContainer .wrapper .post .docPagination .pagingNext {
+ float: right;
+ text-align: right;
+}
+.mainContainer .wrapper .post .docPagination a {
+ border: none;
+ color: #fff;
+ display: block;
+ padding: 4px 12px;
+}
+.mainContainer .wrapper .post .docPagination a:hover {
+ background-color: #f9f9f9;
+ color: #393939;
+}
+.mainContainer .wrapper .post .docPagination a .pagerLabel {
+ display: inline;
+}
+.mainContainer .wrapper .post .docPagination a .pagerTitle {
+ display: none;
+}
+
+.mainContainer .wrapper .post h1,
+.mainContainer .wrapper .post h2,
+.mainContainer .wrapper .post h3 {
+ font-weight: 300;
+}
+
+.mainContainer .wrapper .post h4,
+.mainContainer .wrapper .post h5,
+.mainContainer .wrapper .post h6 {
+ font-weight: 400;
+}
+
+
+#integrations_title {
+ font-size: 250%;
+ margin: 80px 0;
+}
+
+.ytVideo {
+ height: 0;
+ overflow: hidden;
+ padding-bottom: 53.4%;
+ /* 16:9 */
+ padding-top: 25px;
+ position: relative;
+}
+
+.ytVideo iframe,
+.ytVideo object,
+.ytVideo embed {
+ height: 100%;
+ left: 0;
+ position: absolute;
+ top: 0;
+ width: 100%;
+}
+
+.projectTitle {
+ font-size: 250%;
+ line-height: 1em;
+ font-weight: 400;
+}
+
+.projectTitle > small {
+ display: block;
+ font-size: 50%;
+ line-height: 1em;
+ font-weight: 300;
+ margin: 0.7em 0 1.3em;
+}
+
+@media only screen and (min-width: 480px) {
+ h1#project_title {
+ font-size: 500%;
+ }
+
+ .projectTitle {
+ font-size: 300%;
+ margin: 0.3em 0;
+ }
+
+ .projectTitle > small {
+ font-size: 50%;
+ }
+
+ .projectLogo img {
+ margin-bottom: 10px;
+ height: 200px;
+ }
+
+ .homeContainer .homeWrapper {
+ padding-left: 10px;
+ padding-right: 10px;
+ }
+
+ .mainContainer .wrapper .post h2 {
+ font-size: 180%;
+ }
+ .mainContainer .wrapper .post h3 {
+ font-size: 120%;
+ }
+ .mainContainer .wrapper .post .docPagination a .pagerLabel {
+ display: none;
+ }
+ .mainContainer .wrapper .post .docPagination a .pagerTitle {
+ display: inline;
+ }
+}
+@media only screen and (min-width: 736px) {
+ .homeContainer .homeWrapper {
+ position: relative;
+ }
+ .homeContainer .homeWrapper #inner {
+ box-sizing: border-box;
+ max-width: 600px;
+ padding-right: 40px;
+ }
+ .mainContainer .wrapper .post {
+ box-sizing: border-box;
+ display: block;
+ }
+ .mainContainer .wrapper .post .postHeader h1 {
+ font-size: 250%;
+ }
+ .mainContainer .wrapper .posts .post {
+ width: 100%;
+ }
+}
+@media only screen and (min-width: 1200px) {
+ .homeContainer .homeWrapper #inner {
+ max-width: 750px;
+ }
+
+ .homeContainer .homeWrapper .projectLogo {
+ align-items: center;
+ bottom: 0;
+ display: flex;
+ justify-content: flex-end;
+ left: 0;
+ padding: 2em 100px 4em;
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+ .homeContainer .homeWrapper .projectLogo img {
+ height: 100%;
+ max-height: 250px;
+ }
+}
+@media only screen and (min-width: 1500px) {
+ .homeContainer .homeWrapper #inner {
+ max-width: 1100px;
+ padding-bottom: 40px;
+ padding-top: 40px;
+ }
+
+ .wrapper {
+ max-width: 1400px;
+ }
+}
+.fixedHeaderContainer {
+ box-sizing: border-box;
+ background: #1976d2;
+ color: #fff;
+ min-height: 50px;
+ padding: 9px 0;
+ position: fixed;
+ width: 100%;
+ z-index: 9999;
+}
+.fixedHeaderContainer a {
+ align-items: center;
+ border: 0;
+ color: #fff;
+ display: flex;
+ flex-flow: row nowrap;
+ height: 34px;
+ z-index: 10000;
+}
+.fixedHeaderContainer header {
+ display: flex;
+ flex-flow: row nowrap;
+ position: relative;
+ text-align: left;
+}
+.fixedHeaderContainer header img {
+ height: 100%;
+ margin-right: 10px;
+}
+.fixedHeaderContainer header h2 {
+ display: block;
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-weight: 400;
+ line-height: 18px;
+ position: relative;
+ z-index: 9999;
+}
+.fixedHeaderContainer header h3 {
+ text-decoration: underline;
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ color: white;
+ margin-left: 10px;
+ font-size: 16px;
+}
+@media (max-width: 375px) {
+ .logo {
+ display: none;
+ }
+
+ .headerTitle {
+ font-size: 17px;
+ }
+}
+
+.promoSection {
+ display: flex;
+ flex-flow: column wrap;
+ font-size: 125%;
+ line-height: 1.6em;
+ position: relative;
+ z-index: 99;
+}
+.promoSection .promoRow {
+ padding: 10px 0;
+}
+.promoSection .promoRow .pluginWrapper {
+ display: block;
+}
+.promoSection .promoRow .pluginWrapper.ghWatchWrapper, .promoSection .promoRow .pluginWrapper.ghStarWrapper {
+ height: 28px;
+}
+.promoSection .promoRow .pluginRowBlock {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ margin: 0 -2px;
+}
+.promoSection .promoRow .pluginRowBlock .pluginWrapper {
+ padding: 0 2px;
+}
+.promoSection .promoRow .pluginRowBlock iframe {
+ margin-left: 2px;
+ margin-top: 5px;
+}
+.button {
+ margin: 4px;
+ border: 1px solid #1976d2;
+ border-radius: 3px;
+ color: #1976d2;
+ display: inline-block;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1.2em;
+ padding: 10px;
+ text-transform: uppercase;
+ text-decoration: none !important;
+ transition: background 0.3s, color 0.3s;
+}
+.button:hover {
+ background: #1976d2;
+ color: #fff;
+}
+
+.blockButton {
+ display: block;
+}
+
+/** Search **/
+input[type="search"] {
+ -moz-appearance: none;
+ -webkit-appearance: none;
+}
+
+.navSearchWrapper {
+ align-self: center;
+ position: absolute;
+ top: 15px;
+ right: 10px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.navSearchWrapper::before {
+ border: 3px solid #e5e5e5;
+ border-radius: 50%;
+ content: " ";
+ display: block;
+ height: 6px;
+ left: 15px;
+ width: 6px;
+ position: absolute;
+ top: 50%;
+ z-index: 1;
+ transform: translateY(-58%);
+}
+.navSearchWrapper::after {
+ background: #e5e5e5;
+ content: " ";
+ height: 7px;
+ left: 24px;
+ position: absolute;
+ transform: rotate(-45deg);
+ top: 55%;
+ width: 3px;
+ z-index: 1;
+}
+.navSearchWrapper .aa-dropdown-menu {
+ background: #f9f9f9;
+ border: 3px solid rgba(57, 57, 57, 0.25);
+ color: #393939;
+ font-size: 14px;
+ left: auto !important;
+ line-height: 1.2em;
+ right: 0 !important;
+}
+.navSearchWrapper .aa-dropdown-menu .algolia-docsearch-suggestion--category-header {
+ background: #1976d2;
+ color: white;
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-weight: 400;
+ font-size: 14px;
+}
+.navSearchWrapper .aa-dropdown-menu .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight {
+ background-color: #1976d2;
+ color: #fff;
+}
+.navSearchWrapper .aa-dropdown-menu .algolia-docsearch-suggestion--title .algolia-docsearch-suggestion--highlight,
+.navSearchWrapper .aa-dropdown-menu .algolia-docsearch-suggestion--subcategory-column .algolia-docsearch-suggestion--highlight {
+ color: #1976d2;
+}
+.navSearchWrapper .aa-dropdown-menu .algolia-docsearch-suggestion__secondary,
+.navSearchWrapper .aa-dropdown-menu .algolia-docsearch-suggestion--subcategory-column {
+ border-color: rgba(57, 57, 57, 0.3);
+}
+input#search_input_react {
+ padding-left: 25px;
+ font-size: 14px;
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ font-weight: 300;
+ line-height: 20px;
+ border-radius: 20px;
+ background-color: rgba(0, 0, 0, 0.2);
+ border: none;
+ color: #fff;
+ outline: none;
+ position: relative;
+ width: 170px;
+ transition: .5s width ease;
+ -webkit-transition: .5s width ease;
+ -moz-transition: .5s width ease;
+ -o-transition: .5s width ease;
+}
+input#search_input_react:focus, input#search_input_react:active {
+ color: #fff;
+ width: 220px;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .navSearchWrapper {
+ width: 50%;
+ }
+}
+input::-webkit-input-placeholder {
+ color: #e5e5e5;
+}
+
+input::-moz-placeholder {
+ color: #e5e5e5;
+}
+
+input::placeholder {
+ color: #e5e5e5;
+}
+
+code {
+ padding: 2px 0;
+ background-color: rgba(25, 118, 210, 0.07);
+ /* box-shadow acts as padding around inline code snippets
+ * while not adding any extra spacing between words. */
+ box-shadow: 2px 0 rgba(25, 118, 210, 0.07), -2px 0 rgba(25, 118, 210, 0.07);
+ color: inherit;
+ border-radius: .3em;
+ font-family: "SFMono-Regular",source-code-pro,Menlo,Monaco,Consolas,"Roboto Mono","Droid Sans Mono","Liberation Mono",Consolas,"Courier New",Courier,monospace;
+ /* avoids scale issues on mobile */
+ word-break: break-word;
+}
+
+pre code {
+ display:block;
+ margin: 20px 0;
+ padding:0.5em;
+ border-left: 4px solid #1976d2;
+ font-family: "SFMono-Regular",source-code-pro,Menlo,Monaco,Consolas,"Roboto Mono","Droid Sans Mono","Liberation Mono",Consolas,"Courier New",Courier,monospace;
+ font-size: 13px;
+ overflow-x:auto;
+}
+
+/** GitHub **/
+.edit-page-link {
+ float: right;
+ font-size: 10px;
+ font-weight: normal;
+ text-decoration: none;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ a.edit-page-link.button{
+ display: none;
+ }
+}
+/** GridBlock **/
+.gridBlock {
+ margin: -5px 0;
+ padding: 0;
+}
+.gridBlock .twoByGridBlock,
+.gridBlock .threeByGridBlock,
+.gridBlock .fourByGridBlock {
+ padding: 5px 0;
+}
+.gridBlock .twoByGridBlock img,
+.gridBlock .threeByGridBlock img,
+.gridBlock .fourByGridBlock img {
+ max-width: 100%;
+}
+.gridBlock .gridClear {
+ clear: both;
+}
+.alignCenter {
+ text-align: center;
+}
+.alignRight {
+ text-align: right;
+}
+.imageAlignSide {
+ display: flex;
+ flex-flow: row wrap;
+}
+.blockImage {
+ max-width: 730px;
+}
+.imageAlignSide .blockImage {
+ max-width: 500px;
+ flex: 0 1 500px;
+ margin-right: 40px;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .imageAlignSide .blockImage {
+ display: none;
+ }
+}
+.imageAlignSide .blockContent {
+ flex: 1 1;
+}
+.imageAlignBottom .blockImage {
+ max-width: 730px;
+ margin: 0 auto 20px;
+}
+.imageAlignBottom.alignCenter .blockImage {
+ margin-left: auto;
+ margin-right: auto;
+}
+.imageAlignTop .blockImage {
+ max-width: 80px;
+ margin-bottom: 20px;
+}
+.imageAlignTop.alignCenter .blockImage {
+ margin-left: auto;
+ margin-right: auto;
+}
+.container .gridBlock .blockContent p {
+ padding: 0;
+}
+.highlightBackground {
+ background: rgba(153, 66, 79, 0.7);
+ color: #fff;
+}
+.highlightBackground a {
+ border-color: white;
+ color: #fff;
+ font-weight: 800;
+}
+.container.highlightBackground .wrapper h1,
+.container.highlightBackground .wrapper h2,
+.container.highlightBackground .wrapper h3,
+.container.highlightBackground .wrapper h4,
+.container.highlightBackground .wrapper h5 {
+ border-color: white;
+ color: white;
+}
+.lightBackground {
+ background: #e9e9e9;
+}
+.darkBackground {
+ background: #808080;
+ color: #fff;
+}
+.darkBackground a {
+ color: #d6b3b8;
+}
+.darkBackground code {
+ color: #d6b3b8;
+}
+.container.darkBackground .wrapper h1,
+.container.darkBackground .wrapper h2,
+.container.darkBackground .wrapper h3,
+.container.darkBackground .wrapper h4,
+.container.darkBackground .wrapper h5 {
+ border-color: white;
+ color: white;
+}
+.container.paddingAll {
+ padding: 40px;
+}
+.container.paddingBottom {
+ padding-bottom: 80px;
+}
+.container.paddingLeft {
+ padding-left: 40px;
+}
+.container.paddingRight {
+ padding-right: 40px;
+}
+.container.paddingTop {
+ padding-top: 80px;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .container.paddingBottom {
+ padding-bottom: 40px;
+ }
+ .container.paddingTop {
+ padding-top: 20px;
+ }
+}
+@media only screen and (max-width: 1023px) {
+ .responsiveList .blockContent {
+ position: relative;
+ }
+ .responsiveList .blockContent > div {
+ padding-left: 20px;
+ }
+ .responsiveList .blockContent::before {
+ content: "\2022";
+ position: absolute;
+ }
+}
+@media only screen and (min-width: 736px) {
+ .gridBlock {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ margin: -10px;
+ }
+ .gridBlock .twoByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 50%;
+ padding: 10px;
+ }
+ .gridBlock .threeByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 26%;
+ padding: 10px;
+ }
+ .gridBlock .fourByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 25%;
+ padding: 10px;
+ }
+
+ h2 + .gridBlock {
+ padding-top: 20px;
+ }
+}
+@media only screen and (min-width: 1400px) {
+ .gridBlock {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ margin: -10px;
+ }
+ .gridBlock .twoByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 50%;
+ padding: 10px 20px;
+ }
+ .gridBlock .threeByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 26%;
+ padding: 10px;
+ }
+ .gridBlock .fourByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 25%;
+ padding: 10px 20px;
+ }
+}
+.navigationSlider .navSlideout {
+ cursor: pointer;
+ padding-top: 4px;
+ position: absolute;
+ right: 10px;
+ top: 0;
+ transition: top 0.3s;
+ z-index: 101;
+}
+.navigationSlider .slidingNav {
+ box-sizing: border-box;
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: auto;
+}
+.navigationSlider .slidingNav.slidingNavActive {
+ height: auto;
+ padding-top: 42px;
+ width: 300px;
+}
+.navigationSlider .slidingNav ul {
+ box-sizing: border-box;
+ display: flex;
+ flex-wrap: nowrap;
+ list-style: none;
+ margin-top: 50px;
+ width: 100%;
+ padding: 0;
+ background: #1769aa;
+ color: #fff;
+}
+.navigationSlider .slidingNav.slidingNavActive ul {
+ display: block;
+}
+.navigationSlider .slidingNav ul li {
+ flex: 1;
+ text-align: center;
+ white-space: nowrap;
+ margin: 0;
+}
+.navigationSlider .slidingNav ul li a {
+ color: #1976d2;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin: 0;
+ height: auto;
+ color: inherit;
+ transition: background-color 0.3s;
+ height: 50px;
+ padding: 10px;
+ box-sizing: border-box;
+ font-size: 0.9em;
+}
+.navigationSlider .slidingNav ul li a:focus,
+.navigationSlider .slidingNav ul li a:hover {
+ background: #1976d2;
+}
+
+.languages-icon {
+ width: 20px;
+}
+#languages-dropdown {
+ position: absolute;
+ width:100%;
+ /* positioning can block the main menu on mobile */
+ pointer-events: none;
+}
+#languages-dropdown.visible {
+ display: flex;
+}
+#languages-dropdown.hide {
+ display: none;
+}
+ul#languages-dropdown-items {
+ display: flex;
+ background-color: #1976d2;
+ flex-direction: column;
+ min-width: 120px;
+ pointer-events: all;
+}
+
+ul#languages li {
+ display: block;
+}
+
+.menuExpand {
+ display: flex;
+ flex-flow: column nowrap;
+ height: 20px;
+ justify-content: space-between;
+}
+.menuExpand span {
+ background: #fff;
+ border-radius: 3px;
+ display: block;
+ flex: 0 0 4px;
+ height: 4px;
+ position: relative;
+ top: 0;
+ transition: background-color 0.3s, top 0.3s, opacity 0.3s, transform 0.3s;
+ width: 20px;
+}
+.navPusher {
+ padding-top: 100px;
+ position: relative;
+ left: 0;
+ z-index: 99;
+ height: 100%;
+}
+.navPusher::after {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 0;
+ height: 0;
+ background: rgba(0, 0, 0, 0.4);
+ content: '';
+ opacity: 0;
+ -webkit-transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s;
+ transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s;
+}
+
+@media only screen and (min-width: 736px) {
+ .navPusher {
+ padding-top: 50px;
+ }
+}
+.sliderActive .navPusher::after {
+ width: 100%;
+ height: 100%;
+ opacity: 1;
+ -webkit-transition: opacity 0.5s;
+ transition: opacity 0.5s;
+ z-index: 100;
+}
+@media only screen and (max-width: 735px) {
+ .reactNavSearchWrapper::before {
+ left: 6px;
+ }
+ .reactNavSearchWrapper::after {
+ left: 15px;
+ }
+ .reactNavSearchWrapper input#search_input_react {
+ box-sizing: border-box;
+ padding-left: 25px;
+ font-size: 14px;
+ line-height: 20px;
+ border-radius: 20px;
+ background-color: rgba(242, 196, 178, 0.25);
+ border: none;
+ color: #393939;
+ outline: none;
+ position: relative;
+ transition: background-color 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55), width 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55), color 0.2s ease;
+ width: 100%;
+ }
+ .reactNavSearchWrapper input#search_input_react:focus, .reactNavSearchWrapper input#search_input_react:active {
+ background-color: #1976d2;
+ color: #fff;
+ }
+ .reactNavSearchWrapper .algolia-docsearch-suggestion--subcategory-inline {
+ display: none;
+ }
+ .reactNavSearchWrapper > span {
+ width: 100%;
+ }
+ .reactNavSearchWrapper .aa-dropdown-menu {
+ background: #f9f9f9;
+ border: 0px solid #f9f9f9;
+ color: #393939;
+ font-size: 12px;
+ line-height: 2em;
+ max-height: 140px;
+ min-width: auto;
+ overflow-y: scroll;
+ -webkit-overflow-scrolling: touch;
+ padding: 0;
+ border-radius: 0;
+ position: relative !important;
+ width: 100%;
+ }
+
+ #languages-dropdown {
+ top: 50px;
+ left: 0px;
+ }
+
+ ul#languages-dropdown-items {
+ display: flex;
+ background-color: #1976d2;
+ flex-direction: row;
+ }
+}
+@media only screen and (min-width: 736px) {
+ .navSearchWrapper {
+ position: relative;
+ top: auto;
+ right: auto;
+ padding-left: 10px;
+ }
+ .navSearchWrapper .algolia-autocomplete {
+ display: block;
+ }
+ .navigationSlider {
+ height: 34px;
+ margin-left: auto;
+ position: relative;
+ }
+ .navigationSlider .navSlideout {
+ display:none;
+ }
+ .navigationSlider nav.slidingNav {
+ background: none;
+ height: auto;
+ position: relative;
+ right: auto;
+ top: auto;
+ width: auto;
+ }
+ .navigationSlider .slidingNav ul {
+ display: flex;
+ flex-flow: row nowrap;
+ margin: 0 -10px;
+ padding: 0;
+ background: none;
+ width: auto;
+ }
+ .navigationSlider .slidingNav ul li a {
+ border: 0;
+ color: rgba(255, 255, 255, 0.8);
+ display: flex;
+ margin: 0;
+ padding: 0;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.2em;
+ padding: 6px 10px;
+ height: 32px;
+ font-size: 1em;
+ }
+ .navigationSlider .slidingNav ul li a:hover {
+ color: #fff;
+ }
+ .navigationSlider .slidingNav ul li.navItemActive a {
+ color: #fff;
+ }
+}
+
+.docs-prevnext {
+ margin: 20px 0;
+}
+.docs-next {
+ float: right;
+}
+.docs-prev {
+ float: left;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .docs-prevnext {
+ height: 40px;
+ }
+ .docs-prev {
+ display: none;
+ }
+}
+
+.docsNavContainer {
+ background: #c6c6c6;
+ height: 35px;
+ left: 0;
+ position: fixed;
+ width: 100%;
+ z-index: 100;
+}
+.docMainWrapper .wrapper {
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 10px;
+}
+
+.docsSliderActive.docsNavContainer {
+ box-sizing: border-box;
+ height: 100%;
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+ padding-bottom: 50px;
+}
+
+.docsNavContainer nav.toc .navBreadcrumb {
+ box-sizing: border-box;
+ display: flex;
+ flex-flow: row nowrap;
+ font-size: 12px;
+ height: 35px;
+ overflow: hidden;
+ padding: 5px 10px;
+}
+.navBreadcrumb a, .navBreadcrumb span {
+ border: 0;
+ color: #393939;
+}
+.navBreadcrumb i {
+ padding: 0 3px;
+}
+nav.toc {
+ width: 240px;
+}
+nav.toc section {
+ padding: 0px;
+ position: relative;
+}
+nav.toc:last-child {
+ padding-bottom: 100px;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ nav.toc {
+ width: 100%;
+ }
+ nav.toc:last-child {
+ padding-bottom: 0;
+ }
+
+ a.anchor {
+ top: -144px;
+ }
+}
+.docsNavContainer nav.toc .navWrapper {
+ padding: 0;
+}
+nav.toc section .navGroups {
+ display: none;
+ padding: 40px 10px 60px;
+}
+nav.toc .toggleNav {
+ background: #c6c6c6;
+ color: #393939;
+ position: relative;
+ transition: background-color 0.3s, color 0.3s;
+}
+nav.toc .toggleNav .navToggle {
+ cursor: pointer;
+ height: 24px;
+ margin-right: 10px;
+ position: relative;
+ text-align: left;
+ width: 18px;
+}
+nav.toc .toggleNav .navToggle::before, nav.toc .toggleNav .navToggle::after {
+ content: "";
+ position: absolute;
+ top: 50%;
+ left: 0;
+ left: 8px;
+ width: 3px;
+ height: 6px;
+ border: 5px solid #393939;
+ border-width: 5px 0;
+ margin-top: -8px;
+ transform: rotate(45deg);
+ z-index: 1;
+}
+nav.toc .toggleNav .navToggle::after {
+ transform: rotate(-45deg);
+}
+nav.toc .toggleNav .navToggle i::before, nav.toc .toggleNav .navToggle i::after {
+ content: "";
+ position: absolute;
+ top: 50%;
+ left: 2px;
+ background: transparent;
+ border-width: 0 5px 5px;
+ border-style: solid;
+ border-color: transparent #393939;
+ height: 0;
+ margin-top: -7px;
+ opacity: 1;
+ width: 5px;
+ z-index: 10;
+}
+nav.toc .toggleNav .navToggle i::after {
+ border-width: 5px 5px 0;
+ margin-top: 2px;
+}
+.docsSliderActive nav.toc .toggleNav .navToggle::before,
+.docsSliderActive nav.toc .toggleNav .navToggle::after {
+ border-width: 6px 0;
+ height: 0px;
+ margin-top: -6px;
+}
+.docsSliderActive nav.toc .toggleNav .navToggle i {
+ opacity: 0;
+}
+nav.toc .toggleNav .navGroup {
+ background: #adadad;
+ margin: 1px 0;
+}
+nav.toc .toggleNav .navGroup ul {
+ display: none;
+}
+nav.toc .toggleNav .navGroup h3 {
+ background: #adadad;
+ color: #393939;
+ font-size: 18px;
+ font-weight: 400;
+ line-height: 1.2em;
+ margin: 0;
+ padding: 10px;
+ transition: color 0.2s;
+}
+nav.toc .toggleNav .navGroup h3 i:not(:empty) {
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ box-sizing: border-box;
+ text-align: center;
+ color: rgba(57, 57, 57, 0.5);
+ margin-right: 10px;
+ transition: color 0.2s;
+}
+nav.toc .toggleNav .navGroup h3:hover {
+ color: #1976d2;
+}
+nav.toc .toggleNav .navGroup h3:hover i:not(:empty) {
+ color: #1976d2;
+}
+nav.toc .toggleNav .navGroup.navGroupActive {
+ background: #e0e0e0;
+ color: #393939;
+}
+nav.toc .toggleNav .navGroup.navGroupActive ul {
+ display: block;
+ padding-bottom: 10px;
+ padding-top: 10px;
+}
+nav.toc .toggleNav .navGroup.navGroupActive h3 {
+ background: #1976d2;
+ color: #fff;
+}
+nav.toc .toggleNav ul {
+ padding-left: 0;
+ padding-right: 24px;
+}
+nav.toc .toggleNav ul li {
+ list-style-type: none;
+ padding-bottom: 0;
+ padding-left: 0;
+}
+nav.toc .toggleNav ul li a {
+ border: none;
+ color: #393939;
+ display: inline-block;
+ font-size: 14px;
+ line-height: 1.1em;
+ margin: 2px 10px 5px;
+ padding: 5px 0 2px;
+ transition: color 0.3s;
+}
+nav.toc .toggleNav ul li a:hover, nav.toc .toggleNav ul li a:focus {
+ color: #1976d2;
+}
+nav.toc .toggleNav ul li a.navItemActive {
+ color: #1976d2;
+}
+.docsSliderActive nav.toc .navBreadcrumb {
+ background: #c6c6c6;
+ margin-bottom: 20px;
+ position: fixed;
+ width: 100%;
+}
+nav.toc .toggleNav .navBreadcrumb h2 {
+ border: 0;
+ font-size: inherit;
+ line-height: inherit;
+ margin: 0;
+ padding: 1px 0 0;
+}
+.docsSliderActive nav.toc section .navGroups {
+ display: block;
+}
+
+@media only screen and (min-width: 736px) {
+ nav.toc section .navGroups {
+ padding: 40px 0 0;
+ }
+ .navToggle {
+ display: none;
+ }
+
+ .docsSliderActive .mainContainer {
+ display: block;
+ }
+
+ .sideNavVisible .navPusher .mainContainer {
+ padding-top: 0;
+ max-width: 70%;
+ }
+
+ .docsNavContainer {
+ background: none;
+ box-sizing: border-box;
+ height: auto;
+ margin: 40px 40px 0 0;
+ overflow-y: auto;
+ position: relative;
+ width: 300px;
+ }
+
+ nav.toc section .navGroups {
+ display: block;
+ padding-top: 0px;
+ }
+
+ .docMainWrapper {
+ display: flex;
+ flex-flow: row nowrap;
+ margin-bottom: 50px;
+ /*margin-bottom: -90px*/
+ }
+ .docMainWrapper .wrapper {
+ padding-left: 0;
+ padding-right: 0;
+ }
+ .docMainWrapper .wrapper {
+ padding-top: 0;
+ }
+
+ .docsNavContainer nav.toc .navBreadcrumb {
+ display: none;
+ }
+ .navBreadcrumb h2 {
+ padding: 0 10px;
+ }
+}
+table {
+ background: #F8F8F8;
+ border: 1px solid #B0B0B0;
+ border-collapse: collapse;
+ display: table;
+ margin: 20px 0;
+}
+table thead {
+ border-bottom: 1px solid #B0B0B0;
+ display: table-header-group;
+}
+table tbody {
+ display: table-row-group;
+}
+table tr {
+ display: table-row;
+}
+table tr:nth-of-type(odd) {
+ background: #E8E8E8;
+}
+table tr th, table tr td {
+ border-right: 1px dotted #B0B0B0;
+ display: table-cell;
+ font-size: 14px;
+ line-height: 1.3em;
+ padding: 10px;
+ text-align: left;
+}
+table tr th:last-of-type, table tr td:last-of-type {
+ border-right: 0;
+}
+table tr th code, table tr td code {
+ color: #2db04b;
+ display: inline-block;
+ font-size: 12px;
+}
+table tr th {
+ color: #000000;
+ font-weight: bold;
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ text-transform: uppercase;
+}
+.mainContainer:not(.blogContainer) .wrapper .post,
+.blogContainer .posts,
+.blogContainer .lonePost {
+ padding-top: 40px;
+}
+.blogContainer .posts .post {
+ border-bottom: 1px solid #e0e0e0;
+ border-radius: 3px;
+ margin-bottom: 20px;
+ padding-bottom: 20px;
+}
+
+.blogContainer .postHeader {
+ margin-bottom: 10px;
+}
+.blogContainer .postHeader a {
+ text-decoration: none;
+}
+.blogContainer .postHeader p.post-meta {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.blogContainer .postHeader .authorBlock {
+ display: flex;
+}
+.blogContainer .postHeader .post-authorName {
+ color: rgba(57, 57, 57, 0.7);
+ display: flex;
+ flex-direction: column;
+ font-size: 14px;
+ font-weight: 400;
+ justify-content: center;
+ margin-top: 0;
+ margin-right: 10px;
+ padding: 0;
+}
+.blogContainer .postHeader .authorPhoto {
+ border-radius: 50%;
+ height: 30px;
+ overflow: hidden;
+ width: 30px;
+}
+.blogContainer .postHeader .authorPhoto.authorPhoto-big {
+ height: 50px;
+ width: 50px;
+}
+.blog-recent {
+ margin: 20px 0;
+}
+.blog-recent > a {
+ float: left;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .blog-recent {
+ height: 40px;
+ }
+}
+
+.header-link {
+ position: absolute;
+ margin-left: 0.2em;
+ opacity: 0;
+ -webkit-transition: opacity 0.2s ease-in-out 0.1s;
+ -moz-transition: opacity 0.2s ease-in-out 0.1s;
+ -ms-transition: opacity 0.2s ease-in-out 0.1s;
+}
+
+h2:hover .header-link,
+h3:hover .header-link,
+h4:hover .header-link,
+h5:hover .header-link,
+h6:hover .header-link {
+ opacity: 1;
+}
+
+/** Homepage **/
+.container .wrapper .alignCenter h2 {
+ text-align: center;
+}
+.container .wrapper .imageAlignSide h2 {
+ text-align: left;
+}
+.container .wrapper .imageAlignSide p {
+ margin-bottom: 40px;
+ max-width: 560px;
+ margin: 0;
+}
+.more-users {
+ max-width: 560px;
+ margin: 0 auto;
+ text-align: center;
+}
+
+.productShowcaseSection {
+ padding: 0 20px 0;
+ text-align: center;
+}
+.productShowcaseSection.paddingTop {
+ padding-top: 20px;
+}
+.productShowcaseSection.paddingBottom {
+ padding-bottom: 80px;
+}
+.productShowcaseSection h2 {
+ color: #1976d2;
+ font-size: 30px;
+ line-height: 1em;
+ margin-top: 20px;
+ text-align: center;
+ padding: 10px 0;
+}
+.productShowcaseSection p {
+ padding: 0.8em 0;
+ max-width: 560px;
+ margin: 0 auto;
+}
+.productShowcaseSection .logos {
+ padding: 20px;
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: center;
+ align-items: center;
+}
+.productShowcaseSection .logos img {
+ max-height: 110px;
+ width: 110px;
+ padding: 20px;
+}
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .gridBlock .fourByGridBlock {
+ box-sizing: border-box;
+ flex: 1 0 26%;
+ padding: 10px;
+ }
+ .productShowcaseSection .logos img {
+ max-height: 64px;
+ width: 64px;
+ padding: 20px;
+ }
+}
+
+/** Showcase **/
+.showcaseSection {
+ max-width: 900px;
+ text-align: center;
+ margin: 0 auto;
+}
+.showcaseSection .prose h1 {
+ color: #1976d2;
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
+ text-align: center;
+ padding: 1.4em 0 0.4em;
+}
+.showcaseSection .prose {
+ max-width: 560px;
+ text-align: center;
+ margin: 0 auto;
+}
+.showcaseSection .logos {
+ align-items: center;
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: center;
+}
+.showcaseSection .logos img {
+ max-height: 128px;
+ width: 128px;
+ padding: 20px;
+}
+
+@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
+ .showcaseSection .logos img {
+ max-height: 64px;
+ width: 64px;
+ padding: 20px;
+ }
+}
+
+/** Footer **/
+footer.nav-footer {
+ position: relative;
+ box-sizing: border-box;
+ border: none;
+ font-weight: 400;
+ color: #202020;
+ font-size: 15px;
+ line-height: 24px;
+ background: #808080;
+ box-shadow: inset 0 10px 10px -5px rgba(0,0,0,0.2);
+ padding-top: 2em;
+ padding-bottom: 2em;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+footer .sitemap {
+ display: flex;
+ justify-content: space-between;
+ max-width: 1080px;
+ margin: 0 auto 3em;
+}
+footer .sitemap div {
+ flex: 1;
+}
+footer .sitemap .nav-home {
+ display: table;
+ margin: -12px 20px 0 0;
+ padding: 10px;
+ width: 50px;
+ height: 50px;
+ opacity: 0.4;
+ transition: opacity 0.15s ease-in-out;
+}
+footer .sitemap .nav-home:hover,
+footer .sitemap .nav-home:focus {
+ opacity: 1.0;
+}
+@media screen and (max-width: 735px) {
+ footer .sitemap {
+ display: flex;
+ flex-direction: column;
+ margin: 0 2em 3em;
+ }
+}
+
+footer .sitemap a {
+ color: rgba(255, 255, 255, 0.6);
+ display: table;
+ margin: 2px -10px;
+ padding: 3px 10px;
+}
+footer .sitemap a:hover,
+footer .sitemap a:focus {
+ color: white;
+ text-decoration: none;
+}
+footer .sitemap h5 > a:hover,
+footer .sitemap h5 > a:focus {
+ color: white;
+ text-decoration: none;
+}
+footer .sitemap h5,
+footer .sitemap h6 {
+ margin: 0 0 10px;
+}
+footer .sitemap h5 {
+ color: white;
+}
+
+footer .sitemap h6,
+footer .sitemap h5 > a,
+footer .sitemap h6 > a {
+ color: white;
+}
+footer .sitemap h5 > a,
+footer .sitemap h6 > a {
+ margin: 0 -10px;
+}
+footer .fbOpenSource {
+ display: block;
+ margin: 1em auto;
+ opacity: 0.4;
+ transition: opacity 0.15s ease-in-out;
+ width: 170px;
+}
+footer .fbOpenSource:hover {
+ opacity: 1.0;
+}
+footer .copyright {
+ color: rgba(255, 255, 255, 0.4);
+ text-align: center;
+}
+
+.entry-share {
+ padding: 36px 0;
+ display: block;
+}
+
+@media screen and (max-width: 735px) {
+ .entry-share {
+ display: none;
+ }
+}
+
+/* your custom css */
+
+@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
+}
+
+@media only screen and (min-width: 1024px) {
+}
+
+@media only screen and (max-width: 1023px) {
+}
+
+@media only screen and (min-width: 1400px) {
+}
+
+@media only screen and (min-width: 1500px) {
+}
+
+/* Footer */
+footer.nav-footer {
+ background-color: #202020;
+}
+
+/* Home */
+.logo {
+ display: flex;
+ justify-content: center;
+}
+
+.logo img {
+ height: 100%;
+ max-height: 250px;
+ margin-bottom: 0px;
+}
+
+.homeContainer .homeWrapper .projectLogo {
+ justify-content: flex-start;
+}
+
+.feature-block .blockImage img {
+ width: 48px;
+}
+
+.buttonWrapper a.button {
+ border-radius: 24px;
+ min-width: 64px;
+}
+
+/* Navigation */
+.navGroup ul {
+ background-color: #f9f9f9;
+}
diff --git a/docs/README.md b/docs/README.md
deleted file mode 100644
index 05da32154..000000000
--- a/docs/README.md
+++ /dev/null
@@ -1,261 +0,0 @@
-# Documentation
-
-## BootstrapTable Props
-
-#### Required
-* [keyField (**required**)](#keyField)
-* [data (**required**)](#data)
-* [columns (**required**)](#columns)
-
-#### Optional
-* [remote](#remote)
-* [loading](#loading)
-* [caption](#caption)
-* [striped](#striped)
-* [bordered](#bordered)
-* [hover](#hover)
-* [condensed](#condensed)
-* [cellEdit](#cellEdit)
-* [selectRow](#selectRow)
-* [rowStyle](#rowStyle)
-* [rowClasses](#rowClasses)
-* [rowEvents](#rowEvents)
-* [defaultSorted](#defaultSorted)
-* [pagination](#pagination)
-* [filter](#filter)
-* [onTableChange](#onTableChange)
-
-### keyField(**required**) - [String]
-Tells `react-bootstrap-table2` which column is unique.
-
-### data(**required**) - [Array]
-Provides data for your table. It accepts a single Array object.
-
-### columns(**required**) - [Object]
-Accepts a single Array object, please see [columns definition](./columns.md) for more detail.
-
-### remote - [Bool | Object]
-Default is `false`, if enable`remote`, you are suppose to handle all the table change events, like: pagination, insert, filtering etc.
-This is a chance that you can connect to your remote server or database to manipulate your data.
-For flexibility reason, you can control what functionality should be handled on remote via a object return:
-
-```js
-remote={ { filter: true } }
-```
-
-In above case, only column filter will be handled on remote.
-
-> Note: when remote is enable, you are suppose to give [`onTableChange`](#onTableChange) prop on `BootstrapTable`
-> It's the only way to communicate to your remote server and update table states.
-
-A special case for remote pagination:
-```js
-remote={ { pagination: true, filter: false, sort: false } }
-```
-
-In pagination case, even you only specified the paignation need to handle as remote, `react-bootstrap-table2` will handle all the table changes(`filter`, `sort` etc) as remote mode, because `react-bootstrap-table` only know the data of current page, but filtering, searching or sort need to work on overall datas.
-
-### loading - [Bool]
-Telling if table is loading or not, for example: waiting data loading, filtering etc. It's **only** valid when [`remote`](#remote) is enabled.
-When `loading` is `true`, `react-bootstrap-table` will attend to render a overlay on table via [`overlay`](#overlay) prop, if [`overlay`](#overlay) prop is not given, `react-bootstrap-table` will ignore the overlay rendering.
-
-### overlay - [Function]
-`overlay` accept a factory funtion which should returning a higher order component. By default, `react-bootstrap-table-overlay` can be a good option for you:
-
-```sh
-$ npm install react-bootstrap-table-overlay
-```
-```js
-import overlayFactory from 'react-bootstrap-table-overlay';
-
-
-```
-
-Actually, `react-bootstrap-table-overlay` is depends on [`react-loading-overlay`](https://github.com/derrickpelletier/react-loading-overlay) and `overlayFactory` just a factory function and you can pass any props which available for `react-loading-overlay`:
-
-```js
-overlay={ overlayFactory({ spinner: true, background: 'rgba(192,192,192,0.3)' }) }
-```
-
-### caption - [String | Node]
-Same as HTML [caption tag](https://www.w3schools.com/TAgs/tag_caption.asp), you can set it as String or a React JSX.
-
-### striped - [Bool]
-Same as bootstrap `.table-striped` class for adding zebra-stripes to a table.
-### bordered - [Bool]
-Same as bootstrap `.table-bordered` class for adding borders to a table and table cells.
-### hover - [Bool]
-Same as bootstrap `.table-hover` class for adding mouse hover effect (grey background color) on table rows.
-### condensed - [Bool]
-Same as bootstrap `.table-condensed` class for making a table more compact by cutting cell padding in half.
-
-### cellEdit - [Object]
-Makes table cells editable, please see [cellEdit definition](./cell-edit.md) for more detail.
-
-### selectRow - [Object]
-Makes table rows selectable, please see [selectRow definition](./row-selection.md) for more detail.
-
-### rowStyle = [Object | Function]
-Custom the style of table rows:
-
-```js
-
-```
-
-This prop also accept a callback function for flexible to custom row style:
-
-```js
-const rowStyle = (row, rowIndex) => {
- return { ... };
-};
-
-
-```
-
-### rowClasses = [String | Function]
-Custom the style of table rows:
-
-```js
-
-```
-
-This prop also accept a callback function for flexible to custom row style:
-
-```js
-const rowClasses = (row, rowIndex) => {
- return 'custom-row-class';
-};
-
-
-```
-
-### rowEvents - [Object]
-Custom the events on row:
-
-```js
-const rowEvents = {
- onClick: (e) => {
- ....
- }
-};
-
-```
-
-### defaultSorted - [Array]
-`defaultSorted` accept an object array which allow you to define the default sort columns when first render.
-
-```js
-const defaultSorted = [{
- dataField: 'name', // if dataField is not match to any column you defined, it will be ignored.
- order: 'desc' // desc or asc
-}];
-```
-
-### pagination - [Object]
-`pagination` allow user to render a pagination panel on the bottom of table. But pagination funcitonality is separated from core of `react-bootstrap-table2` so that you are suppose to install `react-bootstrap-table2-paginator` additionaly.
-
-```sh
-$ npm install react-bootstrap-table2-paginator --save
-```
-
-After installation of `react-bootstrap-table2-paginator`, you can enable pagination on `react-bootstrap-table2` easily:
-
-```js
-import paginator from 'react-bootstrap-table2-paginator';
-
-// omit...
-
-
-```
-
-`paginator` is a function actually and allow to pass some pagination options, following we list all the available options:
-
-```js
-paginator({
- page, // Specify the current page. It's necessary when remote is enabled
- sizePerPage, // Specify the size per page. It's necessary when remote is enabled
- totalSize, // Total data size. It's necessary when remote is enabled
- pageStartIndex: 0, // first page will be 0, default is 1
- paginationSize: 3, // the pagination bar size, default is 5
- sizePerPageList: [ {
- text: '5', value: 5
- }, {
- text: '10', value: 10
- }, {
- text: 'All', value: products.length
- } ], // A numeric array is also available: [5, 10]. the purpose of above example is custom the text
- withFirstAndLast: false, // hide the going to first and last page button
- alwaysShowAllBtns: true, // always show the next and previous page button
- firstPageText: 'First', // the text of first page button
- prePageText: 'Prev', // the text of previous page button
- nextPageText: 'Next', // the text of next page button
- lastPageText: 'Last', // the text of last page button
- nextPageTitle: 'Go to next', // the title of next page button
- prePageTitle: 'Go to previous', // the title of previous page button
- firstPageTitle: 'Go to first', // the title of first page button
- lastPageTitle: 'Go to last', // the title of last page button
- hideSizePerPage: true, // hide the size per page dorpdown
- hidePageListOnlyOnePage: true, // hide pagination bar when only one page, default is false
- onPageChange: (page, sizePerPage) => {}, // callback function when page was changing
- onSizePerPageChange: (sizePerPage, page) => {}, // callback function when page size was changing
-})
-```
-
-### filter - [Object]
-`filter` allow user to filter data by column. However, filter funcitonality is separated from core of `react-bootstrap-table2` so that you are suppose to install `react-bootstrap-table2-filter` firstly.
-
-```sh
-$ npm install react-bootstrap-table2-filter --save
-```
-
-After installation of `react-bootstrap-table2-filter`, you can configure filter on `react-bootstrap-table2` easily:
-
-```js
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-// omit...
-const columns = [ {
- dataField: 'id',
- text: 'Production ID'
-}, {
- dataField: 'name',
- text: 'Production Name',
- filter: textFilter() // apply text filter
-}, {
- dataField: 'price',
- text: 'Production Price'
-} ];
-
-```
-
-### onTableChange - [Function]
-This callback function will be called when [`remote`](#remote) enabled only.
-
-```js
-const onTableChange = (type, newState) => {
- // handle any data change here
-}
-
-```
-
-There's only two arguments will be passed to `onTableChange`: `type` and `newState`:
-
-`type` is tell you what kind of functionality to trigger this table's change: available values at the below:
-
-* `filter`
-* `pagination`
-
-Following is a shape of `newState`
-
-```js
-{
- page, // newest page
- sizePerPage, //newest sizePerPage
- filters // an object which have current filter status per column
-}
-```
\ No newline at end of file
diff --git a/docs/about.html b/docs/about.html
new file mode 100644
index 000000000..70cc88717
--- /dev/null
+++ b/docs/about.html
@@ -0,0 +1,21 @@
+react-bootstrap-table2 · react-bootstrap-table2 react-bootstrap-table2
is next generation of react-bootstrap-table
. We rebuilt it to make it better and easier to use. Following is our mission:
+
+Refactor core module and make challenges possible
+More customizable table
+Reduce bugs and bundled size
+Solve performance issues
+Improve the remote
mode
+Improve handling of DOM events
+Support nested data
+Support table footer
+
+
+Due to react-bootstrap-table2
already being taken on npm our npm module name is react-bootstrap-table-next
. Anyway, we still use and mention react-bootstrap-table2
in any of our git repositories, offical website and documents, only the npm name is different!
+
+
\ No newline at end of file
diff --git a/docs/basic-celledit.html b/docs/basic-celledit.html
new file mode 100644
index 000000000..28a578a7c
--- /dev/null
+++ b/docs/basic-celledit.html
@@ -0,0 +1,242 @@
+Cell Edit · react-bootstrap-table2 react-bootstrap-table2
separate the cell edit code base to react-bootstrap-table2-editor
, so there's a little bit different when you use cell edit than react-bootstrap-table
. In the following, we are going to show you how to enable the cell edit
+Live Demo For Cell Edit
+API & Props Definition
+
+ Install
+$ npm install react-bootstrap-table2-editor --save
+
+ How
+We have two ways to trigger a editable cell as editing cell:
+
+That's look into how we enable the cell edit on tabe:
+import cellEditFactory from 'react-bootstrap-table2-editor' ;
+
+
+
+<BootstrapTable
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ cellEdit={ cellEditFactory({ mode : 'click' }) }
+/>
+
+How user save their new editings? We offer two ways:
+
+Press ENTER(default )
+Blur from current editing cell(Need to enable the cellEdit.blurToSave )
+
+ Editable Cell
+react-bootstrap-table2
support you to configure the cell editable on three level:
+
+ Validation
+column.validator
will help you to work on it!
+ Customize Style/Class
+
+ Rich Editors
+react-bootstrap-table2
have following predefined editor:
+
+Text(Default)
+Dropdown
+Date
+Textarea
+Checkbox
+
+In a nutshell, you just only give a column.editor and define the type
:
+import { Type } from 'react-bootstrap-table2-editor' ;
+const columns = [
+ ..., {
+ dataField : 'done' ,
+ text : 'Done' ,
+ editor : {
+ type : Type.SELECT | Type.TEXTAREA | Type.CHECKBOX | Type.DATE,
+ ...
+ }
+ }
+]
+
+In the following, we go though all the predefined editors:
+ Dropdown Editor
+Dropdown editor give a select menu to choose a data from a list. When use dropdown editor, either editor.options
or editor.getOptions
should be required prop.
+ editor.options
+This is most simple case for assign the dropdown options data directly.
+import { Type } from 'react-bootstrap-table2-editor' ;
+const columns = [
+ ..., {
+ dataField : 'type' ,
+ text : 'Job Type' ,
+ editor : {
+ type : Type.SELECT,
+ options : [{
+ value : 'A' ,
+ label : 'A'
+ }, {
+ value : 'B' ,
+ label : 'B'
+ }, {
+ value : 'C' ,
+ label : 'C'
+ }, {
+ value : 'D' ,
+ label : 'D'
+ }, {
+ value : 'E' ,
+ label : 'E'
+ }]
+ }
+}];
+
+ editor.getOptions
+It is much flexible which accept a function and you can assign the dropdown options dynamically.
+There are two case for getOptions
:
+
+Synchronous : Just return the options array in getOptions
callback function
+Asynchronous : Call setOptions
function argument when you get the options from remote.
+
+
+ const columns = [
+ ..., {
+ dataField : 'type' ,
+ text : 'Job Type' ,
+ editor : {
+ type : Type.SELECT,
+ getOptions : () => [.....]
+ }
+}];
+
+
+ const columns = [
+ ..., {
+ dataField : 'type' ,
+ text : 'Job Type' ,
+ editor : {
+ type : Type.SELECT,
+ getOptions : (setOptions ) => {
+ setTimeout(() => setOptions([...]), 1500 );
+ }
+ }
+}];
+
+getOptions
have two arguments:
+
+setOptions
: call it when you are ready to set the options asynchronous.
+params
: An object which have row
and column
for current editing cell.
+
+ Date Editor
+Date editor is use <input type="date">
, the configuration is very simple:
+const columns = [
+ ..., {
+ dataField : 'inStockDate' ,
+ text : 'Stock Date' ,
+ formatter : (cell ) => {
+ let dateObj = cell;
+ if (typeof cell !== 'object' ) {
+ dateObj = new Date (cell);
+ }
+ return `${('0' + dateObj.getUTCDate()).slice(-2 )} /${('0' + (dateObj.getUTCMonth() + 1 )).slice(-2 )} /${dateObj.getUTCFullYear()} ` ;
+ },
+ editor : {
+ type : Type.DATE
+ }
+}];
+
+ Textarea Editor
+Textarea editor is use <input type="textarea">
, user can press ENTER
to change line and in the react-bootstrap-table2
, user allow to save result via press SHIFT
+ ENTER
.
+const columns = [
+ ..., {
+ dataField : 'comment' ,
+ text : 'Product Comments' ,
+ editor : {
+ type : Type.TEXTAREA
+ }
+}];
+
+ Checkbox Editor
+Checkbox editor allow you to have a pair value choice, the editor.value
is required value to represent the actual value for check and uncheck.
+const columns = [
+ ..., {
+ dataField : 'comment' ,
+ text : 'Product Comments' ,
+ editor : {
+ type : Type.CHECKBOX,
+ value : 'Y:N'
+ }
+}];
+
+ Customize Editor
+If you feel above predefined editors are not satisfied to your requirement, you can certainly custom the editor via column.editorRenderer . It accept a function and pass following arguments when function called:
+
+editorProps
: Some useful attributes you can use on DOM editor, like class, style etc.
+value
: Current cell value
+row
: Current row data
+column
: Current column definition
+rowIndex
: Current row index
+columnIndex
: Current column index
+
+
+Note when implement a custom React editor component, this component should have a getValue function which return current value on editor
+
+
+Note when you want to save value, you can call editorProps.onUpdate function
+
+Following is a short example:
+class QualityRanger extends React .Component {
+ static propTypes = {
+ value : PropTypes.number,
+ onUpdate : PropTypes.func.isRequired
+ }
+ static defaultProps = {
+ value : 0
+ }
+ getValue() {
+ return parseInt (this .range.value, 10 );
+ }
+ render() {
+ const { value, onUpdate, ...rest } = this .props;
+ return [
+ <input
+ { ...rest }
+ key="range"
+ ref={ node => this.range = node }
+ type="range"
+ min="0"
+ max="100"
+ />,
+ <button
+ key="submit"
+ className="btn btn-default"
+ onClick={ () => onUpdate(this.getValue()) }
+ >
+ done
+ </button>
+ ];
+ }
+}
+
+const columns = [
+ ..., {
+ dataField: 'quality',
+ text: 'Product Quality',
+ editorRenderer: (editorProps, value, row, column, rowIndex, columnIndex) => (
+ <QualityRanger { ...editorProps } value={ value } />
+ )
+}];
+
+
\ No newline at end of file
diff --git a/docs/basic-column-toggle.html b/docs/basic-column-toggle.html
new file mode 100644
index 000000000..7ca958726
--- /dev/null
+++ b/docs/basic-column-toggle.html
@@ -0,0 +1,108 @@
+Column Toggle · react-bootstrap-table2 react-bootstrap-table2
support a toggle list for user to toggle the column visibility.
+Live Demo For Column Toggle
+
+ Prepare
+Please check How to start with table toolkit
+ Enable Column Toggle
+import ToolkitProvider, { ColumnToggle } from 'react-bootstrap-table2-toolkit' ;
+
+const { ToggleList } = ColumnToggle;
+
+
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ columnToggle
+>
+ {
+ props => (
+ <div >
+ <ToggleList { ...props.columnToggleProps } />
+ <hr />
+ <BootstrapTable
+ { ...props.baseProps }
+ />
+ </div >
+ )
+ }
+</ToolkitProvider >
+
+
+Enable column toggle via columnToggle
prop on ToolkitProvider
.
+ToolkitProvider
is a wrapper of react context, you should wrap the BootstrapTable
and ToggleList
as the child of ToolkitProvider
.
+Rendering ToggleList
with columnToggleProps
. The position of ToggleList
is depends on you.
+
+ Customize ToggleList Component
+So far we only have limited customization on ToggleList
component, following props is available for you:
+
+btnClassName
: Add custom class on toggle button.
+className
: Add custom class on toggle list.
+contextual
: config bootstrap contextual, default is primary
.
+
+However, you can custom the whole thing by yourself like following:
+
+
+const CustomToggleList = ({
+ columns,
+ onColumnToggle,
+ toggles
+}) => (
+ <div className ="btn-group btn-group-toggle btn-group-vertical" data-toggle ="buttons" >
+ {
+ columns
+ .map(column => ({
+ ...column,
+ toggle: toggles[column.dataField]
+ }))
+ .map(column => (
+ <button
+ type ="button"
+ key ={ column.dataField }
+ className ={ `btn btn-warning ${column.toggle ? 'active ' : ''}` }
+ data-toggle ="button"
+ aria-pressed ={ column.toggle ? 'true ' : 'false ' }
+ onClick ={ () => onColumnToggle(column.dataField) }
+ >
+ { column.text }
+ </button >
+ ))
+ }
+ </div >
+);
+
+export const MyTable = () => (
+ <ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columnsdt }
+ columnToggle
+ >
+ {
+ props => (
+ <div>
+ <CustomToggleList { ...props.columnToggleProps } />
+ <hr />
+ <BootstrapTable
+ { ...props.baseProps }
+ />
+ </div>
+ )
+ }
+ </ToolkitProvider>
+);
+
+Following, we just explain how it work:
+ToolkitProvider
will pass a props which have a property called columnToggleProps
. columnToggleProps
have following properties:
+
+columns
: Column list
+toggles
: An object which describe current column visibilities. true
is on and false
is off.
+onColumnToggle
: Call this method when user toggle a column.
+
+
\ No newline at end of file
diff --git a/docs/basic-column.html b/docs/basic-column.html
new file mode 100644
index 000000000..53556d146
--- /dev/null
+++ b/docs/basic-column.html
@@ -0,0 +1,38 @@
+Work on Column · react-bootstrap-table2 Firstly, legacy react-bootstrap-table
is hard to customize the DOM Event, Attributes on column or header column. In the react-bootstrap-table2
, we make those bad design become more easy and flexible.
+Live Demo For Column
+Live Demo For Header Column
+API & Props Definition
+
+ Formatting Table Column
+column.formatter
is a good chance for you to customize the cell. If you just want to add some styling, attributes or DOM event linstener, react-bootstrap-table2
have respective props to handle:
+
+In addition, we also give some useful props to let you have a quickly configuration:
+
+ Formatting Table Header
+Formatting header column is almost same as column formatting, we got column.headerFormatter
to let you customize the content of a header column. Default react-bootstrap-table2
will take column.text
as the content of header column.
+Following, we list some useful props for customization:
+
+
\ No newline at end of file
diff --git a/docs/basic-export-csv.html b/docs/basic-export-csv.html
new file mode 100644
index 000000000..a75e48f21
--- /dev/null
+++ b/docs/basic-export-csv.html
@@ -0,0 +1,90 @@
+Export to CSV · react-bootstrap-table2 react-bootstrap-table2
support export table data to CSV.
+Live Demo For CSV Export
+API & Props Definition
+
+ Prepare
+Please check How to start with table toolkit
+ Enable Export CSV
+import ToolkitProvider, { CSVExport } from 'react-bootstrap-table2-toolkit' ;
+
+const { ExportCSVButton } = CSVExport;
+
+<ToolkitProvider
+ keyField ="id"
+ data ={ products }
+ columns ={ columns }
+ exportCSV
+>
+ {
+ props => (
+ <div >
+ <ExportCSVButton { ...props.csvProps }> Export CSV!!</ExportCSVButton >
+ <hr />
+ <BootstrapTable { ...props.baseProps } />
+ </div >
+ )
+ }
+</ToolkitProvider >
+
+
+Give exportCSV
prop as true
on ToolkitProvider
.
+Render ExportCSVButton
with csvProps
. The position of ExportCSVButton
is depends on you.
+
+ Customize Export CSV Component
+ExportCSVButton
is a independent component, it's free to place this component in anywhere, just make sure it is inside of the ToolkitProvider
.
+You can add any style
and className
prop on ExportCSVButton
for styling it.
+However, if you feel ExportCSVButton
can not fit your requirement or you want more customization, you can create your own button like following:
+
+const MyExportCSV = (props ) => {
+ const handleClick = () => {
+ props.onExport();
+ };
+ return (
+ <div >
+ <button className ="btn btn-success" onClick ={ handleClick }> Click me to export CSV</button >
+ </div >
+ );
+};
+
+export const MyTable = () => (
+ <ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ exportCSV
+ >
+ {
+ props => (
+ <div>
+ <BootstrapTable { ...props.baseProps } />
+ <hr />
+ <MyExportCSV { ...props.csvProps } />
+ </div>
+ )
+ }
+ </ToolkitProvider>
+);
+
+
+Following, we just explain how it work:
+ToolkitProvider
will pass a props which have a property called csvProps
. csvProps
have following properties:
+
+onExport
: Call this method will trigger export CSV.
+
+In the customization case, you just need to pass csvProps
to your component and call csvProps.onExport
when export action trigger.
+ Customize CSV Content
+
+ CSV Configuration
+Please see available exportCSV
props.
+
\ No newline at end of file
diff --git a/docs/basic-filter.html b/docs/basic-filter.html
new file mode 100644
index 000000000..52e374998
--- /dev/null
+++ b/docs/basic-filter.html
@@ -0,0 +1,329 @@
+Column Filter · react-bootstrap-table2 react-bootstrap-table2
separate the filter core code base to react-bootstrap-table2-filter
, so there's a little bit different when you use column filter than react-bootstrap-table
. In the following, we are going to show you how to enable the column filter:
+Live Demo For Column Filter
+API & Props Definition
+
+ Install
+$ npm install react-bootstrap-table2-filter --save
+
+ Add CSS
+
+require ('react-bootstrap-table2-filter/dist/react-bootstrap-table2-filter.min.css' );
+
+
+import 'react-bootstrap-table2-filter/dist/react-bootstrap-table2-filter.min.css' ;
+
+You can get all types of filters via import and these filters are a factory function to create a individual filter instance. Currently, we support following filters:
+
+TextFilter
+SelectFilter
+MultiSelectFilter
+NumberFilter
+DateFilter
+CustomFilter
+Coming soon!
+
+ Text Filter
+Following is a quick demo for enable the column filter on Product Price column!!
+import filterFactory, { textFilter } from 'react-bootstrap-table2-filter' ;
+
+
+const columns = [
+ ..., {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter()
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+In addition, we preserve all of the filter features and functionality in legacy react-bootstrap-table
, but in different way to do it:
+import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+
+const priceFilter = textFilter({
+ placeholder : 'My Custom PlaceHolder' ,
+ className: 'my-custom-text-filter' ,
+ defaultValue: 'test' ,
+ comparator: Comparator.EQ,
+ caseSensitive: true ,
+ style: { ... },
+ delay: 1000 ,
+ getFilter: (f ) => { ... },
+ id: 'id' ,
+});
+
+
+
+ Select Filter
+A quick example:
+import filterFactory, { selectFilter } from 'react-bootstrap-table2-filter' ;
+
+
+const selectOptions = {
+ 0 : 'good' ,
+ 1 : 'Bad' ,
+ 2 : 'unknown'
+};
+
+const columns = [
+ ..., {
+ dataField : 'quality' ,
+ text : 'Product Quailty' ,
+ formatter : cell => selectOptions[cell],
+ filter : selectFilter({
+ options : selectOptions
+ })
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+Following is an example for custom select filter:
+import filterFactory, { selectFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+
+const qualityFilter = selectFilter({
+ options : selectOptions,
+ placeholder : 'My Custom PlaceHolder' ,
+ className: 'my-custom-text-filter' ,
+ defaultValue: '2' ,
+ comparator: Comparator.LIKE,
+ caseSensitive: false ,
+ style: { ... },
+ withoutEmptyOption: true ,
+ getFilter: (f ) => { ... },
+ id: 'id' ,
+});
+
+
+
+
+Note, the selectOptions
can be an array or a function as well:
+
+ Array as options
+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
+ })
+}];
+
+ Function as options
+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
+Multi-select filter is almost same as regular select filterfilter :
+import filterFactory, { multiSelectFilter } from 'react-bootstrap-table2-filter' ;
+
+
+const selectOptions = {
+ 0 : 'good' ,
+ 1 : 'Bad' ,
+ 2 : 'unknown'
+};
+
+const columns = [
+ ..., {
+ dataField : 'quality' ,
+ text : 'Product Quailty' ,
+ formatter : cell => selectOptions[cell],
+ filter : multiSelectFilter({
+ options : selectOptions
+ })
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+Following is an example for custom multi-select filter:
+import filterFactory, { multiSelectFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+
+const qualityFilter = multiSelectFilter({
+ options : selectOptions,
+ placeholder : 'My Custom PlaceHolder' ,
+ className: 'my-custom-text-filter' ,
+ defaultValue: '2' ,
+ comparator: Comparator.LIKE,
+ style: { ... },
+ withoutEmptyOption: true ,
+ id: 'id' ,
+});
+
+
+
+ Number Filter
+import filterFactory, { numberFilter } from 'react-bootstrap-table2-filter' ;
+
+const columns = [..., {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : numberFilter()
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+Numner filter is same as other filter, you can custom the number filter via numberFilter
factory function:
+import filterFactory, { selectFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+
+const numberFilter = numberFilter({
+ options : [2100 , 2103 , 2105 ],
+ delay: 600 ,
+ placeholder: 'custom placeholder' ,
+ withoutEmptyComparatorOption: true ,
+ withoutEmptyNumberOption: true ,
+ comparators: [Comparator.EQ, Comparator.GT, Comparator.LT],
+ style: { display : 'inline-grid' },
+ className: 'custom-numberfilter-class' ,
+ comparatorStyle: { backgroundColor : 'antiquewhite' },
+ comparatorClassName: 'custom-comparator-class' ,
+ numberStyle: { backgroundColor : 'cadetblue' , margin : '0px' },
+ numberClassName: 'custom-number-class' ,
+ defaultValue: { number : 2103 , comparator : Comparator.GT },
+ getFilter: (f ) => { ... },
+ id: 'id' ,
+})
+
+
+
+ Date Filter
+import filterFactory, { dateFilter } from 'react-bootstrap-table2-filter' ;
+
+const columns = [..., {
+ dataField : 'date' ,
+ text : 'Product date' ,
+ filter : dateFilter()
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+
+Notes: date filter accept a Javascript Date object in your raw data and you have to use column.formatter
to make it as your prefer string result.
+
+Date filter is same as other filter, you can custom the date filter via dateFilter
factory function:
+import filterFactory, { selectFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+
+const dateFilter = dateFilter({
+ delay : 600 ,
+ placeholder: 'custom placeholder' ,
+ withoutEmptyComparatorOption: true ,
+ comparators: [Comparator.EQ, Comparator.GT, Comparator.LT],
+ style: { display : 'inline-grid' },
+ className: 'custom-dateFilter-class' ,
+ comparatorStyle: { backgroundColor : 'antiquewhite' },
+ comparatorClassName: 'custom-comparator-class' ,
+ dateStyle: { backgroundColor : 'cadetblue' , margin : '0px' },
+ dateClassName: 'custom-date-class' ,
+ defaultValue: { date : new Date (2018 , 0 , 1 ), comparator : Comparator.GT },
+ id: 'id' ,
+});
+
+
+
+ Custom Filter
+import filterFactory, { customFilter } from 'react-bootstrap-table2-filter' ;
+
+const columns = [..., {
+ dataField : 'date' ,
+ text : 'Product Name' ,
+ filter : customFilter(),
+ filterRenderer : (onFilter, column ) => .....
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+In custom filter case, you are suppose to finish following two steps:
+
+Call customFilter
and pass to column.filter
+Give column.filterRenderer
as a callback function and return your custom filter element.
+
+ column.filterRenderer
+This function will pass two argument to you:
+
+onFilter
: call it to trigger filter when you need.
+column
: Just the column object!
+
+In the end, please remember to return your custom filter element!
+ customFilter
+customFilter
function just same as textFilter
, selectFilter
etc, it is for customization reason. However, in the custom filter case, there're only few props are valid:
+import filterFactory, { FILTER_TYPES, Comparator } from 'react-bootstrap-table2-filter' ;
+
+const customFilter = customFilter({
+ type : FILTER_TYPES.NUMBER,
+ comparator: Comparator.EQ,
+ caseSensitive: false ,
+})
+
+
+ Programmatically Filter
+react-bootstrap-table2
allow you to control filter externally, which means user no need to type something on filter!!
+ How
+All the filters have a getFilter
prop which accept a callback function and pass a filter object to you.
+class Table extends Components {
+ constructor (props) {
+ super (props);
+ this .filterPrice = this .filterPrice.bind(this );
+ const columns = [
+ ..., {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter({
+
+ getFilter: (filter ) => this .priceFilter = filter;
+ })
+ }];
+ }
+
+ filterPrice() {
+
+ this .priceFilter(100 );
+ }
+
+ render() {
+ return (
+ <div >
+ <button onClick ={ this.filterPrice }> Click to filter</button >
+ <BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+ </div >
+ );
+ }
+}
+
+
+ Examples
+
+
\ No newline at end of file
diff --git a/docs/basic-pagination.html b/docs/basic-pagination.html
new file mode 100644
index 000000000..348036b47
--- /dev/null
+++ b/docs/basic-pagination.html
@@ -0,0 +1,220 @@
+Pagination · react-bootstrap-table2 react-bootstrap-table2
separate the pagination code base to react-bootstrap-table2-pagination
, so there's a little bit different when you use pagination. In the following, we are going to show you how to enable and configure the a pagination table
+Live Demo For Pagination
+API & Props Definition
+
+ Install
+$ npm install react-bootstrap-table2-paginator --save
+
+ Add CSS
+
+require ('react-bootstrap-table2-paginator/dist/react-bootstrap-table2-paginator.min.css' );
+
+
+import 'react-bootstrap-table2-paginator/dist/react-bootstrap-table2-paginator.min.css' ;
+
+ How
+Let's enable a pagination on your table:
+import paginationFactory from 'react-bootstrap-table2-paginator' ;
+
+
+<BootstrapTable keyField='id' data={ products } columns={ columns } pagination={ paginationFactory() } />
+
+ Customization
+ Basic Customization
+react-bootstrap-table2
give some simple ways to customize something like text, styling etc, following is all the props we support for basic customization:
+
+You can check this online demo for above props usage.
+ Advance Customization
+Sometime, you may feel above props is not satisfied with your requirement, don't worry, we provide following renderer for each part of pagination:
+
+ Completely Customization
+If you want to customize the pagination component completely, you may get interesting on following solution:
+
+Standalone
+Non-standalone
+
+react-bootstrap-table2-paginator
have a PaginationProvider
which is a react context and you will be easier to customize the pagination components under the scope of PaginationProvider
. Let's introduce it step by step:
+ 1. Import PaginationProvider
+import paginationFactory, { PaginationProvider } from 'react-bootstrap-table2-paginator' ;
+
+
+ 2. Declare custom and totalSize in pagination option:
+const paginationOption = {
+ custom : true ,
+ totalSize : products.length
+};
+
+ 3. Render PaginationProvider
+<PaginationProvider
+ pagination={ paginationFactory(paginationOption) }
+>
+ {
+ ({
+ paginationProps,
+ paginationTableProps
+ }) => (
+ .....
+ )
+ }
+</PaginationProvider>
+
+PaginationProvider
actually is a wrapper for the consumer of react context so that you are able to get the props from context then render to your compoennt and BootstrapTable
:
+
+paginationProps
: this include everything about pagination, you will use it when you render standalone component or your custom component.
+paginationTableProps
: you don't need to know about this, but you have to give it as props when render BootstrapTable
.
+
+So far, your customization pagination should look like it:
+<PaginationProvider
+ pagination={ paginationFactory(paginationOption) }
+>
+ {
+ ({
+ paginationProps,
+ paginationTableProps
+ }) => (
+ <div >
+ <BootstrapTable
+ keyField ="id"
+ data ={ products }
+ columns ={ columns }
+ { ...paginationTableProps }
+ />
+ </div >
+ )
+ }
+</PaginationProvider >
+
+Now, you have two choices
+
+Use Standalone Component
+Customize everything by yourself
+
+ 4.1 Use Standalone Component
+react-bootstrap-table2-paginator
provider three standalone components:
+
+Size Per Page Dropdown Standalone
+Pagination List Standalone
+Pagination Total Standalone
+
+When render each standalone, you just need to pass the paginationProps
props to standalone component:
+import paginationFactory, {
+ PaginationProvider,
+ PaginationListStandalone,
+ PaginationTotalStandalone,
+ SizePerPageDropdownStandalone
+} from 'react-bootstrap-table2-paginator' ;
+
+<PaginationProvider
+ pagination={ paginationFactory(options) }
+>
+ {
+ ({
+ paginationProps,
+ paginationTableProps
+ }) => (
+ <div>
+ <SizePerPageDropdownStandalone
+ { ...paginationProps }
+ />
+ <PaginationTotalStandalone
+ { ...paginationProps }
+ />
+ <BootstrapTable
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ { ...paginationTableProps }
+ />
+ <PaginationListStandalone
+ { ...paginationProps }
+ />
+ </div>
+ )
+ }
+</PaginationProvider>
+
+That's it!! The benifit for using standalone is you can much easier to render the standalone component in any posistion. In the future, we will implement more featue like applying style
, className
etc on standalone components.
+
Customizable props on PaginationListStandalone
+
+
Customizable props on SizePerPageDropdownStandalone
+
+open
: true to make dropdown show.
+hidden
: true to hide the size per page dropdown.
+btnContextual
: Set the button contextual.
+variation
: Variation for dropdown, available value is dropdown
and dropup
.
+className
: Custom the class on size per page dropdown
+
+
Customizable props on SizePerPageDropdownStandalone
+
+ 4.2 Customization Everything
+If you choose to custom the pagination component by yourself, the paginationProps
will be important for you. Becasue you have to know for example how to change page or what's the current page etc. Therefore, following is all the props in paginationProps
object:
+page,
+sizePerPage,
+pageStartIndex,
+hidePageListOnlyOnePage,
+hideSizePerPage,
+alwaysShowAllBtns,
+withFirstAndLast,
+dataSize,
+sizePerPageList,
+paginationSize,
+showTotal,
+pageListRenderer,
+pageButtonRenderer,
+sizePerPageRenderer,
+paginationTotalRenderer,
+sizePerPageOptionRenderer,
+firstPageText,
+prePageText,
+nextPageText,
+lastPageText,
+prePageTitle,
+nextPageTitle,
+firstPageTitle,
+lastPageTitle,
+disablePageTitle,
+onPageChange,
+onSizePerPageChange
+
+In most of case, page
, sizePerPage
, onPageChange
and onSizePerPageChange
are most important properties for you:
+
+page
: Current page.
+sizePerPage
: Current size per page.
+onPageChange
: Call it when you nede to change page. This function accept one number argument which indicate the new page
+onSizePerPageChange
: Call it when you nede to change size per page. This function accept two number argument which indicate the new sizePerPage and new page
+
+This is a online example for showing how to custom pagination completely.
+
\ No newline at end of file
diff --git a/docs/basic-remote.html b/docs/basic-remote.html
new file mode 100644
index 000000000..27fb861f8
--- /dev/null
+++ b/docs/basic-remote.html
@@ -0,0 +1,26 @@
+Remote Table · react-bootstrap-table2 What is Remote
+By default, react-bootstrap-table2
always handle the data changes internally, such as sorting, paging, filtering etc. However, you may want to handle those logic or sync up to backend or Redux store so that remote
can help you on it as well.
+Live Demo for Remote Table
+
+ How
+Make sure you already see remote
props on BootstrapTable
firstly. In the beginning, you can assign true
to enable the remote mode on table but few people doing like that, because it will enable all the functionalities(sort, filter etc) become remote
mode.
+In the most of case, you probably only need some functionalites handled on the remote, so remote
allow you to pass an object to control it.
+ Table/Data Change
+It's the key point that you need to know something changed so that you can handle your data or logic externally. In the remote
mode, you are supposed to give onTableChange
on BootstrapTable
and it will being called when table have any changes if you enable the remote
mode.
+
+All the changes are go though onTableChange
listener,
+it's only way that table give fully control to you
+
+Please read onTableChange
docs to understand how to leverage it.
+ Remote Pagination
+Pagination remote is a particular case in react-bootstrap-table2
. If you enable the pagination remote mode, react-bootstrap-table2
will not handle sort and filter internally, instead your application is supposed to handle it in the remote way.
+Because, sort and filter need to work on overall data. In the remote pagination, react-bootstrap-table2
doesn't know all the data, only have the data on current page. So that's why you need to handle the remote filtering or sorting also.
+You can see this example to see how it work for above case.
+A good news is we are consider to easing this limitation through partial sorting/filtering on current page.
+
\ No newline at end of file
diff --git a/docs/basic-row-expand.html b/docs/basic-row-expand.html
new file mode 100644
index 000000000..a75b38b2b
--- /dev/null
+++ b/docs/basic-row-expand.html
@@ -0,0 +1,56 @@
+Expandable Row · react-bootstrap-table2 Live Demo For Row Expand
+API & Props Definition
+
+ Expand Mode
+react-bootstrap-table2
allow support click to expand or collapse a row. When you enable row expandable functionality, you have to give expandRow.renderer
to tell what kind of context you want to render in the expanding content, for example:
+const expandRow = {
+ renderer : row => (
+ <div > ....</div >
+ )
+};
+
+
+
+<BootstrapTable
+ keyField='id'
+ data={ products }
+ columns={ columns }
+ expandRow={ expandRow }
+/>
+
+
+ Expand Management
+Please check expandRow.expanded
, it's used for default expanding usually but also can be used as a external expandation control.
+This is an example for manage on expands
+ Customization
+ Style/Class
+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:
+
+In addition, the way to custom the class/style on expanding row element:
+
+ 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
+In addition, we allow you to custom the expand columns in following ways:
+
+You can render expand column at the right side of table via expandRow.expandColumnPosition
.
+ Event Listening
+
+
\ No newline at end of file
diff --git a/docs/basic-row-select.html b/docs/basic-row-select.html
new file mode 100644
index 000000000..dddabaf3f
--- /dev/null
+++ b/docs/basic-row-select.html
@@ -0,0 +1,48 @@
+Row Selection · react-bootstrap-table2 For the table row selection functionality, the usage is almost same as react-bootstrap-table
. If you are a user from legacy react-bootstrap-table
, you can consider to skip this part.
+Live Demo For Row Selection
+API & Props Definition
+
+ Selection Mode
+We support the single and multiple selection on table, config the selectRow.mode
on BootstrapTable
will enable the selection on the table.
+By default behavior, user need to click on the selection column or the checkbox/radio to select/unselect a row, for a user experience perspective, we have selectoRow.clickToSelect
to allow user to select/unselect row by clicking on the row.
+ Selection Management
+Please check selectoRow.selected
, it's used for default selection usually but also can be used as a external selection control.
+This is an example for selection management .
+In addition, this is another example for selection management
+ Customization
+ Style/Class
+Like column, we support to custom the style, class on the selecting row easily via following selectRow
props:
+
+If you configure some specific rows as non-selectable, you can also custom them via:
+
+ Selection Column
+
+ Position
+Default we render selection column in the left side of table, you can use selectRow.selectColumnPosition
to make it on the right.
+
+In addition, react-bootstrap-table2
offer below props to hide selection column:
+
+ Event Listening
+selectRow.onSelect
allow you to listen a row is select or unselect. For the multiple selection, we also have selectRow.onSelectAll
to listen the select/unselect all event.
+
\ No newline at end of file
diff --git a/docs/basic-row.html b/docs/basic-row.html
new file mode 100644
index 000000000..33defccc0
--- /dev/null
+++ b/docs/basic-row.html
@@ -0,0 +1,38 @@
+Work on Row · react-bootstrap-table2 react-bootstrap-table2
allow you to custom the row style/class/attributes and event on row(tr
)
+Live Demo For Rows
+
+ Row Style/Class
+
+ Row Events
+
+Currently, react-bootstrap-table2
only wrapped up the following events to allow its callback to receive row
and rowIndex
, for example:
+
+onClick
+onDoubleClick
+onMouseEnter
+onMouseLeave
+onContextMenu
+onAuxClick
+
+const rowEvents = {
+ onClick : (e, row, rowIndex ) => {
+ ....
+ }
+};
+<BootstrapTable data ={ data } columns ={ columns } rowEvents ={ rowEvents } />
+
+Anyway, it's welcome to ask us to add more wrapped events.
+ Row Attributes
+Coming Soon!
+
\ No newline at end of file
diff --git a/docs/basic-search.html b/docs/basic-search.html
new file mode 100644
index 000000000..66fadefe7
--- /dev/null
+++ b/docs/basic-search.html
@@ -0,0 +1,151 @@
+Table Search · react-bootstrap-table2 react-bootstrap-table2
support a table search function just like legacy search in react-bootstrap-table
. However, new way will be more easier to custom.
+Live Demo For Table Search
+API & Props Definition
+
+ Prepare
+Please check How to start with table toolkit
+ Enable Search
+import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit' ;
+
+const { SearchBar } = Search;
+
+
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search
+>
+ {
+ props => (
+ <div >
+ <h3 > Input something at below input field:</h3 >
+ <SearchBar { ...props.searchProps } />
+ <hr />
+ <BootstrapTable
+ { ...props.baseProps }
+ />
+ </div >
+ )
+ }
+</ToolkitProvider >
+
+
+Enable search via search
prop on ToolkitProvider
.
+ToolkitProvider
is a wrapper of react context, you are supposed to wrap the BootstrapTable
and SearchBar
as the child of ToolkitProvider
.
+You should render SearchBar
with searchProps
as well. The SearchBar
position is depends on you.
+
+SearchBar
Props
+ className - [string]
+Custom the class on input element.
+ placeholder - [string]
+Custom the placeholder on input element.
+ style - [object]
+Custom the style on input element.
+ delay - [number]
+milionsecond for debounce user input.
+ srText - [string]
+Customize the screen reader text for the search input. (Default: "Search this table")
+ Customize Search Component
+SearchBar
is a independent component, it's free to place this component in anywhere, just make sure it is inside of the ToolkitProvider
.
+You can add any style
and className
prop on SearchBar
for component styling
+In addition, following is some valid props on SearchBar
component:
+
+delay
: How long should trigger search after user enter the search text, default is 250
ms.
+placeholder: The placeholder on the input field, default is Search
.
+
+However, if you feel SearchBar
can not fit your requirement or you want more customization, you can create your own search bar like following:
+
+const MySearch = (props ) => {
+ let input;
+ const handleClick = () => {
+ props.onSearch(input.value);
+ };
+ return (
+ <div>
+ <input
+ className="form-control"
+ style={ { backgroundColor: 'pink' } }
+ ref={ n => input = n }
+ type="text"
+ />
+ <button className="btn btn-warning" onClick={ handleClick }>Click to Search!!</button>
+ </div>
+ );
+};
+
+export const MyTable = () => (
+ <ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search
+ >
+ {
+ props => (
+ <div>
+ <BootstrapTable
+ { ...props.baseProps }
+ />
+ <MySearch { ...props.searchProps } />
+ <br />
+ </div>
+ )
+ }
+ </ToolkitProvider>
+);
+
+Following, we just explain how it work:
+ToolkitProvider
will pass a props which have a property called searchProps
. searchProps
have following properties:
+
+onSearch
: Call this method with search text when you want to do the search.
+
+In the customization case, you just need to pass searchProps
to your component and call searchProps.onSearch
when search trigger.
+ Search on Formatted Data
+react-bootstrap-table2
default is search on your raw data. If you define a column.formatter
on a column, sometime that will cause
+the search can't be performed accurately.
+Therefore, we support searchFormatted
to let search can work on the formatted data.
+ Customize the Search Value
+Sometime, you hope react-bootstrap-table2
to search another value instead of raw data, you can use column.filterValue
.
+When table search on a specified column, will use the return value from column.filterValue
for searching.
+..., {
+ dataField : 'type' ,
+ text : 'Job Type' ,
+ formatter : (cell, row ) => types[cell],
+ filterValue : (cell, row ) => types[cell]
+}
+
+ Clear Search Button
+We have a built-in clear search function which allow user to clear search status via clicking button:
+import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit' ;
+
+const { SearchBar, ClearSearchButton } = Search;
+
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search
+>
+ {
+ props => (
+ <div>
+ <SearchBar { ...props.searchProps } />
+ <ClearSearchButton { ...props.searchProps } />
+ ....
+ </div>
+ )
+ }
+</ToolkitProvider>
+
+ Props
+
+className
: Add custom class name on clear search button.
+
+
\ No newline at end of file
diff --git a/docs/basic-sort.html b/docs/basic-sort.html
new file mode 100644
index 000000000..5b900bf3a
--- /dev/null
+++ b/docs/basic-sort.html
@@ -0,0 +1,66 @@
+Table Sort · react-bootstrap-table2 react-bootstrap-table2
allow you to configure columns to be sortable. Currently, we don't support the multi-column sort, but it will be implemented in the future.
+Live Demo For Table Sort
+
+ Enable Sort on Column
+Firstly, you need to know what column you allow user to sort and give the sort
as true
in the column definition.
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID' ,
+ sort : true
+}, {
+ dataField : 'name' ,
+ text : 'Product Name' ,
+ sort : true
+}, {
+ dataField : 'price' ,
+ text : 'Product Price'
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } />
+
+After table rendered, you can see the Product ID and Product Name will have a caret icon beside the column name:
+
+ Control Sorting
+ Default Sort
+react-bootstrap-table2
will only apply the default sort at first time rendering, you can achieve the default sorting on table easily via defaultSorted
.
+ Sort Event Listener
+Defined onSort
on target column:
+{
+ dataField : 'id' ,
+ text : 'Product ID' ,
+ sort : true ,
+ onSort : (field, order ) => {
+
+ }
+}
+
+ Manage Sorting Externally
+You can configure sort
props and give dataField
and order
on BootstrapTable
component to set the sorting state:
+Please refer this docs.
+Usually you will need it when you want to control the sorting state externally, like clicking on a button outside the table to force to sort a specified column.
+ Custom the Sorting Algorithm
+It's simple!! configure sortFunc
on column definition.
+{
+ dataField : 'id' ,
+ text : 'Product ID' ,
+ sort : true
+
+ sortFunc: (a, b, order, dataField, rowA, rowB ) => {
+ if (order === 'asc' ) {
+ return b - a;
+ }
+ return a - b;
+ }
+}
+
+ Custom the Sorting Style
+There're two way you can change or prettify the header when sorting: headerSortingClasses
and headerSortingStyle
+ Custom the Sort Caret
+See column.sortCaret
.
+
\ No newline at end of file
diff --git a/docs/bootstrap4.html b/docs/bootstrap4.html
new file mode 100644
index 000000000..93edea53d
--- /dev/null
+++ b/docs/bootstrap4.html
@@ -0,0 +1,11 @@
+Bootstrap 4 · react-bootstrap-table2 Bootstrap 3
+react-bootstrap-table2
default support bootstrap 3.
+ Bootstrap 4
+Add bootstrap4
prop on BootstrapTable
or ToolkitProvider
to enable the Bootstrap 4.
+
\ No newline at end of file
diff --git a/docs/cell-edit-props.html b/docs/cell-edit-props.html
new file mode 100644
index 000000000..610506f83
--- /dev/null
+++ b/docs/cell-edit-props.html
@@ -0,0 +1,87 @@
+Cell Editing Props · react-bootstrap-table2 Following we list all props for cellEditFactory
from react-bootstrap-table2-editor
.
+import cellEditFactory from 'react-bootstrap-table2-editor' ;
+
+const cellEdit = cellEditFactory({
+ mode : 'click' ,
+ ...
+});
+
+<BootstrapTable cellEdit ={ cellEdit } ... />
+
+ Required
+
+ Optional
+
+
+ cellEdit.mode - [String]
+cellEdit.mode
possible value is click
and dbclick
. It's required value that tell react-bootstrap-table2
how to trigger the cell editing.
+ cellEdit.blurToSave - [Bool]
+Default is false
, enable it will be able to save the cell automatically when blur from the cell editor.
+ 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.timeToCloseMessage - [Function]
+If a column.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.
+ 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.beforeSaveCell - [Function]
+This callback function will be called before triggering cell update.
+const cellEdit = {
+
+ beforeSaveCell: (oldValue, newValue, row, column ) => { ... }
+}
+
+If you want to perform a async beforeSaveCell
, you can do it like that:
+const cellEdit: {
+
+ beforeSaveCell(oldValue, newValue, row, column, done) {
+ setTimeout(() => {
+ if (confirm('Do you want to accep this change?' )) {
+ done();
+ } else {
+ done(false );
+ }
+ }, 0 );
+ return { async : true };
+ }
+};
+
+ cellEdit.afterSaveCell - [Function]
+This callback function will be called after updating cell.
+const cellEdit = {
+
+ afterSaveCell: (oldValue, newValue, row, column ) => { ... }
+};
+
+ cellEdit.onStartEdit - [Function]
+This callback function will be called after editor component mounted
+const cellEdit = {
+
+ onStartEdit: (row, column, rowIndex, columnIndex ) => { ... }
+};
+
+ cellEdit.errorMessage - [String]
+This prop is not often used. Only used when you want to keep the error message in your application state and also handle the cell editing on remote
mode.
+ cellEdit.onErrorMessageDisappear - [Function]
+This callback function will be called when error message discard so that you can sync the newest error message to your state if you have.
+
\ No newline at end of file
diff --git a/docs/cell-edit.md b/docs/cell-edit.md
deleted file mode 100644
index 328a94e92..000000000
--- a/docs/cell-edit.md
+++ /dev/null
@@ -1,136 +0,0 @@
-# Properties on cellEdit prop
-* [mode (**required**)](#mode)
-* [blurToSave](#blurToSave)
-* [nonEditableRows](#nonEditableRows)
-* [timeToCloseMessage](#timeToCloseMessage)
-* [beforeSaveCell](#beforeSaveCell)
-* [afterSaveCell](#afterSaveCell)
-* [onUpdate](#onUpdate)
-* [editing](#editing)
-* [errorMessage](#errorMessage)
-* [onErrorMessageDisappear](#onErrorMessageDisappear)
-
-## cellEdit - [Object]
-Assign a valid `cellEdit` object can enable the cell editing on the cell. The default usage is click/dbclick to trigger cell editing and press `ENTER` to save cell or press `ESC` to cancel editing.
-
-> Note: The `keyField` column can't be edited
-
-Following is the shape of `cellEdit` object:
-```js
-{
- mode: 'click',
- blurToSave: true,
- timeToCloseMessage: 2500,
- editing: false|true,
- errorMessage: '',
- onUpdate: (rowId, dataField, newValue) => { ... },
- beforeSaveCell: (oldValue, newValue, row, column) => { ... },
- afterSaveCell: (oldValue, newValue, row, column) => { ... },
- onErrorMessageDisappear: () => { ... },
- nonEditableRows: () => { ... }
-}
-```
-
-### cellEdit.mode - [String]
-`cellEdit.mode` possible value is `click` and `dbclick`. **It's required value** that tell `react-bootstrap-table2` how to trigger the cell editing.
-
-### cellEdit.blurToSave - [Bool]
-Default is `false`, enable it will be able to save the cell automatically when blur from the cell editor.
-
-### 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.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.
-
-### cellEdit.beforeSaveCell - [Function]
-This callback function will be called before triggering cell update.
-
-```js
-const cellEdit = {
- // omit...
- beforeSaveCell: (oldValue, newValue, row, column) => { ... }
-}
-```
-
-### cellEdit.afterSaveCell - [Function]
-This callback function will be called after updating cell.
-
-```js
-const cellEdit = {
- // omit...
- afterSaveCell: (oldValue, newValue, row, column) => { ... }
-};
-```
-
-### cellEdit.onUpdate - [Function]
-If you want to control the cell updating process by yourself, for example, connect with `Redux` or saving data to backend database, `cellEdit.onUpdate` is a great chance you can work on it.
-
-Firsylt, `react-bootstrap-table2` allow `cellEdit.onUpdate` to return a promise:
-
-```js
-const cellEdit = {
- // omit...
- onUpdate: (rowId, dataField, newValue) => {
- return apiCall().then(response => {
- console.log('update cell to backend successfully');
- // Actually, you dont do any thing here, we will update the new value when resolve your promise
- })
- .catch(err => throw new Error(err.message));
- }
-};
-```
-
-If your promise is resolved successfully, `react-bootstrap-table2` will default help you to update the new cell value.
-If your promise is resolved failure, you can throw an `Error` instance, `react-bootstrap-table2` will show up the error message (Same behavior like [`column.validator`](./columns.md#validator)).
-
-In some case, backend will return a new value to client side and you want to apply this new value instead of the value that user input. In this situation, you can return an object which contain a `value` property:
-
-```js
-const cellEdit = {
- // omit...
- onUpdate: (rowId, dataField, newValue) => {
- return apiCall().then(response => {
- return { value: response.value }; // response.value is from your backend api
- })
- .catch(err => throw new Error(err.message));
- }
-};
-```
-
-If your application integgrate with `Redux`, you may need to dispatch an action in `cellEdit.onUpdate` callback. In this circumstances, you need to return `false` explicity which `react-bootstrap-table2` will stop any operation internally and wait rerender by your application.
-
-In a simple redux application, you probably need to handle those props by your application:
-
-* [`cellEdit.editing`](#editing): Is cell still on editing or not? This value should always be `true` when saving cell failure.
-* [`cellEdit.errorMessage`](#errorMessage): Error message when save the cell failure.
-* [`cellEdit.onErrorMessageDisappear`](#onErrorMessageDisappear): This callback will be called when error message alert closed automatically.
-* `cellEdit.onUpdate`
-
-```js
-const cellEdit = {
- editing: this.props.editing,
- errorMessage: this.props.errorMessage,
- onErrorMessageDisappear: () => {
- // cleanErrorMessage is an action creator
- this.props.dispatch(cleanErrorMessage());
- },
- onUpdate: (rowId, dataField, newValue) => {
- // updateCell is an action creator
- this.props.dispatch(updateCell(rowId, dataField, newValue)));
- return false; // Have to return false here
- }
-};
-```
-
-Please check [this](https://github.com/react-bootstrap-table/react-bootstrap-table2/blob/develop/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-redux-table.js) exmaple to learn how use `cellEdit` with a redux application
-
-### cellEdit.editing - [Bool]
-This only used when you want to control cell saving externally, `cellEdit.editing` will be a flag to tell `react-bootstrap-table2` whether currecnt editing cell is still editing or not. Because, it's possible that some error happen when you saving cell, in this situation, you need to configre this value as `false` to keep the cell as edtiable and show up an error message.
-
-### cellEdit.errorMessage - [String]
-Same as [`cellEdit.editing`](#editing). This prop is not often used. Only used when you keep the error message in your application state.
-
-### cellEdit.onErrorMessageDisappear - [Function]
-This callback function will be called when error message discard.
-
diff --git a/docs/column-props.html b/docs/column-props.html
new file mode 100644
index 000000000..d9a3e7850
--- /dev/null
+++ b/docs/column-props.html
@@ -0,0 +1,778 @@
+Columns Props · react-bootstrap-table2 Definition of columns props on BootstrapTable
+ Required
+
+ Optional
+
+
+ column.dataField (required ) - [String]
+Use dataField
to specify what field should be apply on this column. If your raw data is nested, for example:
+const row = {
+ id : 'A001' ,
+ address : {
+ postal : '1234-12335' ,
+ city : 'Chicago'
+ }
+}
+
+You can use dataField
with dot(.
) to describe nested object:
+dataField: 'address.postal'
+dataField: 'address.city'
+
+ column.text (required ) - [String]
+text
will be the column text in header column by default, if your header is not only text or you want to customize the header column, please check column.headerFormatter
+ column.type - [String]
+Specify the data type on column. Available value so far is string
, number
, bool
and date
. Default is string
.
+column.type
can be used when you enable the cell editing and want to save your cell data with correct data type.
+ column.isDummyField - [Bool]
+Sometime, you just want to have a column which is not perform any data but just some action components. In this situation, we suggest you to use isDummyField
. If column is dummy, the column.dataField
can be any string value, cause of it's meaningless. However, please keep dataField
as unique as possible.
+There's only one different for dummy column than normal column, which is dummy column will compare the whole row value instead of cell value when call shouldComponentUpdate
.
+ column.hidden - [Bool]
+hidden
allow you to hide column when true
given.
+ column.formatter - [Function]
+formatter
allow you to customize the table column and only accept a callback function which take four arguments and a JSX/String are expected for return.
+
+
+Attention:
+Don't use any state data or any external data in formatter function, please pass them via formatExtraData
.
+In addition, please make formatter function as pure function as possible as you can.
+
+ column.headerFormatter - [Function]
+headerFormatter
allow you to customize the header column and only accept a callback function which take three arguments and a JSX/String are expected for return.
+
+column
: current column object itself
+colIndex
: index of current column
+components
: an object which contain all of other react element, like sort caret or filter etc.
+
+The third argument: components
have following specified properties:
+{
+ sortElement,
+ filterElement
+}
+
+ column.formatExtraData - [Any]
+It's only used for column.formatter
, you can define any value for it and will be passed as fourth argument for column.formatter
callback function.
+ column.sort - [Bool]
+Enable the column sort via a true
value given.
+ column.sortValue - [Function]
+column.sortValue
only work when column.sort
enabled. This prop allow you to replace the value when table sorting.
+For example, consider following data:
+const types = ['Cloud Service' , 'Message Service' , 'Add Service' , 'Edit Service' , 'Money' ];
+const data = [{id : 1 , type : 2 }, {id : 2 , type : 1 }, {id : 3 , type :0 }];
+const columns = [{
+ dataField : 'id' ,
+ text : 'Job ID'
+}, {
+ dataField : 'type' ,
+ text : 'Job Type'
+ sort: true ,
+ formatter : (cell, row ) => types[cell]
+}]
+
+In above case, when user try to sort Job Type column which will sort the original value: 0, 1, 2 but we display the type name via column.formatter
, which will lead confuse because we are sorting by type value instead of type name. So sortValue
is a way for you to decide what kind of value should be adopted when sorting on a specify column:
+const columns = [{
+ dataField : 'id' ,
+ text : 'Job ID'
+}, {
+ dataField : 'type' ,
+ text : 'Job Type'
+ sort: true ,
+ formatter : (cell, row ) => types[cell],
+ sortValue : (cell, row ) => types[cell]
+}]
+
+ column.sortFunc - [Function]
+column.sortFunc
only work when column.sort
is enable. sortFunc
allow you to define your sorting algorithm. This callback function accept six arguments:
+{
+
+ sort: true ,
+ sortFunc : (a, b, order, dataField, rowA, rowB ) => {
+ if (order === 'asc' ) return a - b;
+ else return b - a;
+ }
+}
+
+
+The possible value of order
argument is asc
and desc
.
+
+ column.sortCaret - [Function]
+Usecolumn.sortCaret
to custom the sort caret. This callback function accept two arguments: order
and column
+{
+
+ sort: true ,
+ sortCaret : (order, column ) => {
+ return
+ }
+}
+
+
+The possible value of order
argument is asc
, desc
and undefined
.
+
+ column.onSort - [Function]
+column.onSort
is an event listener for subscribing the event of sort:
+{
+
+ sort: true ,
+ onSort : (field, order ) => {
+
+ }
+}
+
+ column.classes - [String | Function]
+It's available to have custom class on table column:
+{
+
+ classes: 'id-custom-cell'
+}
+
+In addition, classes
also accept a callback function which have more power to custom the css class on each columns. This callback function take 4 arguments and a String
is expected to return:
+{
+ classes : function callback (cell, row, rowIndex, colIndex ) { ... }
+}
+
+Parameters
+
+cell
: The value of current cell.
+row
: The value of row
being processed in the BootstrapTable
.
+rowIndex
: The index of the current row
being processed in the BootstrapTable
.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new String
will be the result as element class.
+ column.headerClasses - [String | Function]
+It's similar to column.classes
, headerClasses
is available to have customized class on table header column:
+{
+
+ headerClasses: 'id-custom-cell'
+}
+
+Furthermore, it also accept a callback function which takes 2 arguments and a String
is expect to return:
+{
+ headerClasses : function callback (column, colIndex ) { ... }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new String
will be the result of element headerClasses.
+ column.style - [Object | Function]
+It's available to have custom style on table column:
+{
+
+ style: { backgroundColor : 'green' }
+}
+
+In addition, similar to column.classes
, style
also accept a callback function which have more power to customize the inline style
on each columns. This callback function takes 4 arguments and an Object
is expect to return:
+{
+ style : function callback (cell, row, rowIndex, colIndex ) { ... }
+}
+
+Parameters
+
+cell
: The value of current cell.
+row
: The value of row
being processed in the BootstrapTable
.
+rowIndex
: The index of the current row
being processed in the BootstrapTable
.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new Object
will be the result of element style.
+ column.headerStyle - [Object | Function]
+It's available to have customized inline-style on table header column:
+{
+
+ headerStyle: { backgroundColor : 'green' }
+}
+
+Moreover, it also accept a callback function which takes 2 arguments and an Object
is expect to return:
+{
+ headerStyle : function callback (column, colIndex ) { ... }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new Object
will be the result of element headerStyle.
+ column.title - [Bool | Function]
+react-bootstrap-table2
is disable HTML title
as default. You can assign title
as true
to enable the HTML title on table column and take cell content
as default value. Additionally, you could customize title via a callback. It takes 4 arguments and a String
is expect to return:
+{
+
+ title: function callback (cell, row, rowIndex, colIndex ) { ... }
+
+}
+
+Parameters
+
+cell
: The value of current cell.
+row
: The value of row
being processed in the BootstrapTable
.
+rowIndex
: The index of the current row
being processed in the BootstrapTable
.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new String
will be the result of element title.
+ column.headerTitle - [Bool | Function]
+headerTitle
is only for the title on header column, default is disable. The usage almost same as column.title
,
+{
+
+ headerTitle: true
+}
+
+It's also available to custom via a callback function:
+{
+ headerTitle : function callback (column, colIndex ) { ... }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new String
will be the result of element headerTitle.
+ column.align - [String | Function]
+You can configure the CSS text-align for table column by align
property.
+Besides, align
also accept a callback function for dynamically setting text align. It takes 4 arguments and a String
is expect to return:
+{
+
+ align: function callback (cell, row, rowIndex, colIndex ) { ... }
+}
+
+Parameters
+
+cell
: The value of current cell.
+row
: The value of row
being processed in the BootstrapTable
.
+rowIndex
: The index of the current row
being processed in the BootstrapTable
.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new String
will be the result of element text alignment.
+ column.headerAlign - [String | Function]
+It's almost same as column.align
, but it's for the CSS text-align on header column.
+{
+
+ headerAlign: 'center'
+}
+
+Also, you can custom the align by a callback function:
+{
+
+ headerAlign: (column, colIndex ) => {
+
+
+ }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new String
will be the result of element headerAlign.
+ column.events - [Object]
+You can assign any HTML Event on table column via events
property.
+react-bootstrap-table2
currently only support following events which will receive some specific information:
+
+onClick
+onDoubleClick
+onMouseEnter
+onMouseLeave
+onContextMenu
+
+{
+
+ events: {
+ onClick : (e, column, columnIndex, row, rowIndex ) => { ... },
+ }
+}
+
+If the events is not listed above, the callback function will only receive the event
object.
+ column.headerEvents - [Object]
+headerEvents
same as column.events
but this is for header column.
+{
+
+ headerEvents: {
+ onClick : (e, column, columnIndex ) => { ... }
+ }
+}
+
+ column.attrs - [Object | Function]
+Via attrs
property, You can customize table column HTML attribute which allow user to configure the elements or adjust their behavior.
+{
+
+ attrs: {
+ title : 'bar' ,
+ 'data-test' : 'foo'
+ }
+}
+
+Not only Object
, callback function
is also acceptable. It takes 4 arguments and an Object
is expect to return:
+{
+ attrs : function callback (cell, row, rowIndex, colIndex ) { ... }
+}
+
+Parameters
+
+cell
: The value of current cell.
+row
: The value of row
being processed in the BootstrapTable
.
+rowIndex
: The index of the current row
being processed in the BootstrapTable
.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new Object
will be the result of element HTML attributes.
+
+Caution:
+If column.classes
, column.style
, column.title
, column.hidden
or column.align
was given at the same time, property attrs
has lower priority and it will be overwritten:
+
+{
+
+ title: true ,
+ attrs: { title : 'test' }
+}
+
+ column.headerAttrs - [Object | Function]
+headerAttrs
is similar to column.attrs
but it works for header column.
+{
+
+ headerAttrs: {
+ title : 'bar' ,
+ 'data-test' : 'foo'
+ }
+}
+
+Additionally, customize the header attributes by a 2 arguments callback function:
+{
+
+ headerAttrs: (column, colIndex ) => ({
+
+ })
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+Return value
+A new Object
will be the result of element headerAttrs.
+
+Caution:
+Same as column.attrs , it has lower priority and will be
+overwrited when other props related to HTML attributes were given.
+
+ headerSortingClasses - [String | Function]
+headerSortingClasses
allows to customize class
for header cell when this column is sorting.
+const headerSortingClasses = 'demo-sorting' ;
+
+Furthermore, it also accepts a callback which takes 4 arguments and String
is expected to return:
+const headerSortingClasses = (column, sortOrder, isLastSorting, colIndex ) => { ... }
+
+
+column
: The value of current column.
+sortOrder
: The order of current sorting
+isLastSorting
: Is the last one of sorted columns.
+colIndex
: The index of the current column being processed in BootstrapTable.
+
+ headerSortingStyle - [Object | Function]
+It's similiar to headerSortingClasses . It allows to customize the style of header cell when this column is sorting. A style Object
and callback
are acceptable. callback
takes 4 arguments and an Object
is expected to return:
+const sortingHeaderStyle = {
+ backgroundColor : 'red'
+};
+
+ column.footer - [String | Function]
+Give a string to render the string value on the footer column.
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID' ,
+ footerAlign : 'center' ,
+ footer : 'Footer 1'
+}, .....];
+
+This prop also accept a function:
+{
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ footer : (columnData, column, columnIndex ) => columnData.reduce((acc, item ) => acc + item, 0 )
+}
+
+ column.footerFormatter - [Function]
+footerFormatter
allow you to customize the table footer column and only accept a callback function which take two arguments and a JSX/String are expected for return.
+
+ column.footerClasses - [String | Function]
+It's similar to column.classes
, footerClasses
is available to have customized class on table footer column:
+{
+
+ footerClasses: 'id-custom-cell'
+}
+
+Furthermore, it also accept a callback function which takes 2 arguments and a String
is expect to return:
+{
+ footerClasses : function callback (column, colIndex ) { ... }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+ column.footerStyle - [Object | Function]
+Customized the inline-style on table footer column:
+{
+
+ footerStyle: { backgroundColor : 'green' }
+}
+
+Moreover, it also accept a callback function which takes 2 arguments and an Object
is expect to return:
+{
+ footerStyle : function callback (column, colIndex ) { ... }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+ column.footerTitle - [Bool | Function]
+Configure the title on footer column, default is disable. The usage is almost same as column.title
,
+{
+
+ footerTitle: true
+}
+
+It's also available to custom via a callback function:
+{
+ footerTitle : function callback (column, colIndex ) { ... }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+ column.footerEvents - [Object]
+footerEvents
same as column.events
but it is for footer column:
+{
+
+ footerEvents: {
+ onClick : (e, column, columnIndex ) => { ... }
+ }
+}
+
+ column.footerAlign - [String | Function]
+It's almost same as column.align
, but it's for the CSS text-align on footer column.
+{
+
+ footerAlign: 'center'
+}
+
+Also, you can custom the align by a callback function:
+{
+
+ footerAlign: (column, colIndex ) => {
+
+
+ }
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+ column.footerAttrs - [Object | Function]
+footerAttrs
is similar to column.attrs
but it works for footer column.
+{
+
+ footerAttrs: {
+ title : 'bar' ,
+ 'data-test' : 'foo'
+ }
+}
+
+Additionally, customize the header attributes by a 2 arguments callback function:
+{
+
+ footerAttrs: (column, colIndex ) => ({
+
+ })
+}
+
+Parameters
+
+column
: The value of current column.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+ column.editable - [Bool | Function]
+column.editable
default is true, means every column is editable if you configure cellEdit
. But you can disable some columns editable via setting false
.
+If a callback function given, you can control the editable level as cell level:
+{
+
+ editable: (cell, row, rowIndex, colIndex ) => {
+
+ }
+}
+
+ column.validator - [Function]
+column.validator
used for validate the data when cell on updating. it's should accept a callback function with following argument:
+newValue
, row
and column
:
+{
+
+ validator: (newValue, row, column ) => {
+ return ...;
+ }
+}
+
+The return value can be a bool or an object. If your validation is pass, return true
explicitly. If your validation is invalid, return following object instead:
+{
+ valid : false ,
+ message : 'SOME_REASON_HERE'
+}
+
+If you want to perform a asycn validation, you can do it like this:
+{
+
+ validator: (newValue, row, column, done ) => {
+ settimeout(() => {
+
+ return done();
+
+
+ return done({
+ valid : false ,
+ message : 'SOME_REASON_HERE'
+ });
+
+ }, 2000 );
+ return { async : true };
+ }
+}
+
+ column.editCellStyle - [Object | Function]
+You can use column.editCellStyle
to custom the style of <td>
when cell editing. It like most of customizable functionality, it also accept a callback function with following params:
+Parameters
+
+cell
: The value of current cell.
+row
: The object of row
being processed in the BootstrapTable
.
+rowIndex
: The index of the current row
being processed in the BootstrapTable
.
+colIndex
: The index of the current column
being processed in BootstrapTable
.
+
+{
+ editCellStyle : { ... }
+}
+
+Or take a callback function
+{
+ editCellStyle : (cell, row, rowIndex, colIndex ) => {
+
+ }
+}
+
+ column.editCellClasses - [String | Function]
+You can use column.editCellClasses
to add custom class on <td>
when cell editing. It's same as column.editCellStyle
which also accept a callback function to able to custom your class more flexible. Following is the arguments of this callback function: cell
, row
, rowIndex
, colIndex
.
+{
+ editCellClasses : 'custom-class'
+}
+
+Or take a callback function
+{
+ editCellClasses : (cell, row, rowIndex, colIndex ) => {
+
+ }
+}
+
+ column.editorStyle - [Object | Function]
+This is almost same as column.editCellStyle
, but column.editorStyle
is for custom the style on editor instead of cell(td
).
+ column.editorClasses - [String | Function]
+This is almost same as column.editCellClasses
, but column.editorClasses
is for custom the class on editor instead of cell(td
).
+ column.editor - [Object]
+column.editor
allow you to custom the type of cell editor by following predefined type:
+
+Text(Default)
+Dropdown
+Date
+Textarea
+Checkbox
+
+Following is a quite example:
+import cellEditFactory, { Type } from 'react-bootstrap-table2-editor' ;
+
+const columns = [
+
+ , {
+ dataField : 'done' ,
+ text : 'Done' ,
+ editor : {
+ type : Type.CHECKBOX,
+ value : 'Y:N'
+ }
+ }
+];
+
+Please check here for more detail about rich editors.
+ column.editorRenderer - [Function]
+If you feel above predefined editors are not satisfied to your requirement, you can totally custom the editor via column.editorRenderer
:
+import cellEditFactory, { Type } from 'react-bootstrap-table2-editor' ;
+
+
+class QualityRanger extends React .Component {
+ static propTypes = {
+ value : PropTypes.number,
+ onUpdate : PropTypes.func.isRequired
+ }
+ static defaultProps = {
+ value : 0
+ }
+ getValue() {
+ return parseInt (this .range.value, 10 );
+ }
+ render() {
+ const { value, onUpdate, ...rest } = this .props;
+ return [
+ <input
+ { ...rest }
+ key="range"
+ ref={ node => this.range = node }
+ type="range"
+ min="0"
+ max="100"
+ />,
+ <button
+ key="submit"
+ className="btn btn-default"
+ onClick={ () => onUpdate(this.getValue()) }
+ >
+ done
+ </button>
+ ];
+ }
+}
+
+
+const columns = [
+ //...
+ , {
+ dataField: 'done',
+ text: 'Done',
+ editorRenderer: (editorProps, value, row, column, rowIndex, columnIndex) =>
+ <QualityRanger { ...editorProps } value={ value } />;
+ }
+];
+
+Please check here for more detail.
+ column.filter - [Object]
+Configure column.filter
will able to setup a column level filter on the header column. Currently, react-bootstrap-table2
support following filters:
+
+Text Filter
+Select Filter
+Number Filter
+Date Filter
+
+We have a quick example to show you how to use column.filter
:
+import { textFilter } from 'react-bootstrap-table2-filter' ;
+
+
+{
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter()
+}
+
+For some reason of simple customization, react-bootstrap-table2
allow you to pass some props to filter factory function. Please check here for more detail tutorial.
+ column.filterValue - [Function]
+Sometimes, if the cell/column value that you don't want to filter on them, you can define filterValue
to return a actual value you wanna be filtered:
+Parameters
+
+cell
: The value of current cell.
+row
: The value of current row.
+
+Return value
+A final String
value you want to be filtered.
+
+{
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter(),
+ filterValue : (cell, row ) => owners[cell]
+}
+
+ 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.
+ column.csvFormatter - [Function]
+This is same as column.formatter
. But csvFormatter
only for CSV export and called when export CSV.
+ column.csvText - [String]
+Custom the CSV header cell, Default is column.text
.
+ column.csvExport - [Bool]
+Default is true
, false
will hide this column when export CSV.
+
\ No newline at end of file
diff --git a/docs/columns.md b/docs/columns.md
deleted file mode 100644
index 73fdc966c..000000000
--- a/docs/columns.md
+++ /dev/null
@@ -1,559 +0,0 @@
-# Definition of columns props on BootstrapTable
-
-Available properties in a column object:
-
-#### Required
-* [dataField (**required**)](#dataField)
-* [text (**required**)](#text)
-
-#### Optional
-* [hidden](#hidden)
-* [formatter](#formatter)
-* [formatExtraData](#formatExtraData)
-* [sort](#sort)
-* [sortFunc](#sortFunc)
-* [classes](#classes)
-* [style](#style)
-* [title](#title)
-* [events](#events)
-* [align](#align)
-* [attrs](#attrs)
-* [headerFormatter](#headerFormatter)
-* [headerClasses](#headerClasses)
-* [headerStyle](#headerStyle)
-* [headerTitle](#headerTitle)
-* [headerEvents](#headerEvents)
-* [headerAlign](#headerAlign)
-* [headerAttrs](#headerAttrs)
-* [headerSortingClasses](#headerSortingClasses)
-* [headerSortingStyle](#headerSortingStyle)
-* [editable](#editable)
-* [validator](#validator)
-* [editCellStyle](#editCellStyle)
-* [editCellClasses](#editCellClasses)
-* [filter](#filter)
-* [filterValue](#filterValue)
-
-Following is a most simplest and basic usage:
-
-```js
-const rows = [ { id: 1, name: '...', price: '102' } ];
-const columns = [ {
- dataField: 'id',
- text: 'Production ID'
- }, {
- dataField: 'name',
- text: 'Production Name'
- }, {
- dataField: 'price',
- text: 'Production Price'
- }
-];
-```
-
-Let's introduce the definition of column object
-
-## column.dataField (**required**) - [String]
-Use `dataField` to specify what field should be apply on this column. If your raw data is nested, for example:
-
-```js
-const row = {
- id: 'A001',
- address: {
- postal: '1234-12335',
- city: 'Chicago'
- }
-}
-```
-You can use `dataField` with dot(`.`) to describe nested object:
-
-```js
-dataField: 'address.postal'
-dataField: 'address.city'
-```
-
-## column.text (**required**) - [String]
-`text` will be apply as the column text in header column, if your header is not only text and you want to customize your header column, please check [`column.headerFormatter`](#headerFormatter)
-
-## column.hidden - [Bool]
-`hidden` allow you to hide column when `true` given.
-
-## column.formatter - [Function]
-`formatter` allow you to customize the table column and only accept a callback function which take four arguments and a JSX/String are expected for return.
-
-* `cell`
-* `row`
-* `rowIndex`
-* [`formatExtraData`](#formatExtraData)
-
-## column.headerFormatter - [Function]
-`headerFormatter` allow you to customize the header column and only accept a callback function which take three arguments and a JSX/String are expected for return.
-
-* `column`: column object itself
-* `colIndex`
-* `components`: it's an object which contain all of other react element, like sort caret or filter etc.
-
-The third argument: `components` have following specified properties:
-```js
-{
- sortElement, // sort caret element, it will not be undefined when you enable sort on this column
- filterElement // filter element, it will not be undefined when you enable column.filter on this column
-}
-```
-
-## column.formatExtraData - [Any]
-It's only used for [`column.formatter`](#formatter), you can define any value for it and will be passed as fourth argument for [`column.formatter`](#formatter) callback function.
-
-## column.sort - [Bool]
-Enable the column sort via a `true` value given.
-
-## column.sortFunc - [Function]
-`column.sortFunc` only work when `column.sort` is enable. `sortFunc` allow you to define your sorting algorithm. This callback function accept four arguments:
-
-```js
-{
- // omit...
- sort: true,
- sortFunc: (a, b, order, dataField) => {
- if (order === 'asc') return a - b;
- else return b - a;
- }
-}
-```
-> The possible value of `order` argument is **`asc`** and **`desc`**.
-
-## column.classes - [String | Function]
-It's availabe to have custom class on table column:
-
-```js
-{
- // omit...
- classes: 'id-custom-cell'
-}
-```
-In addition, `classes` also accept a callback function which have more power to custom the css class on each columns. This callback function take `4` arguments and a `string` is expect to return:
-
-
-```js
-{
- classes: function callback(cell, row, rowIndex, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `cell`: The value of current cell.
-* `row`: The value of `row` being processed in the `BootstrapTable`.
-* `rowIndex`: The index of the current `row` being processed in the `BootstrapTable`.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `String` will be the result of element class.
-
-## column.headerClasses - [String | Function]
-It's similar to [`column.classes`](#classes), `headerClasses` is availabe to have customized class on table header column:
-
-```js
-{
- // omit...
- headerClasses: 'id-custom-cell'
-}
-```
-Furthermore, it also accept a callback function which takes 2 arguments and a `String` is expect to return:
-
-```js
-{
- headerClasses: function callback(column, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `column`: The value of current column.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `String` will be the result of element headerClasses.
-
-## column.style - [Object | Function]
-It's availabe to have custom style on table column:
-
-```js
-{
- // omit...
- style: { backgroundColor: 'green' }
-}
-```
-
-In addition, similar to [`column.classes`](#classes), `style` also accept a callback function which have more power to customize the `inline style` on each columns. This callback function takes `4` arguments and an `Object` is expect to return:
-
-
-```js
-{
- style: function callback(cell, row, rowIndex, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `cell`: The value of current cell.
-* `row`: The value of `row` being processed in the `BootstrapTable`.
-* `rowIndex`: The index of the current `row` being processed in the `BootstrapTable`.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `Object` will be the result of element style.
-
-
-## column.headerStyle - [Object | Function]
-It's availabe to have customized inline-style on table header column:
-
-```js
-{
- // omit...
- headerStyle: { backgroundColor: 'green' }
-}
-```
-
-Moreover, it also accept a callback function which takes 2 arguments and an `Object` is expect to return:
-
-```js
-{
- headerStyle: function callback(column, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `column`: The value of current column.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `Object` will be the result of element headerStyle.
-
-
-## column.title - [Bool | Function]
-`react-bootstrap-table2` is disable [`HTML title`](https://www.w3schools.com/tags/tag_title.asp) as default. You can assign `title` as `true` to enable the HTML title on table column and take `cell content` as default value. Additionally, you could customize title via a callback. It takes `4` arguments and a `String` is expect to return:
-
-
-```js
-{
- // omit...
- title: function callback(cell, row, rowIndex, colIndex) { ... }
- // return custom title here
-}
-```
-
-**Parameters**
-* `cell`: The value of current cell.
-* `row`: The value of `row` being processed in the `BootstrapTable`.
-* `rowIndex`: The index of the current `row` being processed in the `BootstrapTable`.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `String` will be the result of element title.
-
-## column.headerTitle - [Bool | Function]
-`headerTitle` is only for the title on header column, default is disable. The usage almost same as [`column.title`](#title),
-
-```js
-{
- // omit...
- headerTitle: true
-}
-```
-
-It's also availabe to custom via a callback function:
-```js
-{
- headerTitle: function callback(column, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `column`: The value of current column.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `String` will be the result of element headerTitle.
-
-## column.align - [String | Function]
-You can configure the [CSS text-align](https://www.w3schools.com/cssref/pr_text_text-align.asp) for table column by `align` property.
-
-Besides, `align` also accept a callback function for dynamically setting text align. It takes `4` arguments and a `String` is expect to return:
-
-```js
-{
- // omit...
- align: function callback(cell, row, rowIndex, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `cell`: The value of current cell.
-* `row`: The value of `row` being processed in the `BootstrapTable`.
-* `rowIndex`: The index of the current `row` being processed in the `BootstrapTable`.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `String` will be the result of element text alignment.
-
-## column.headerAlign - [String | Function]
-It's almost same as [`column.align`](#align), but it's for the [CSS text-align](https://www.w3schools.com/cssref/pr_text_text-align.asp) on header column.
-
-```js
-{
- // omit...
- headerAlign: 'center'
-}
-```
-
-Also, you can custom the align by a callback function:
-
-```js
-{
- // omit...
- headerAlign: (column, colIndex) => {
- // column is an object and perform itself
- // return custom title here
- }
-}
-```
-**Parameters**
-* `column`: The value of current column.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `String` will be the result of element headerAlign.
-
-
-## column.events - [Object]
-You can assign any [HTML Event](https://www.w3schools.com/tags/ref_eventattributes.asp) on table column via event property:
-
-```js
-{
- // omit...
- events: {
- onClick: e => { ... }
- }
-}
-```
-
-## column.headerEvents - [Object]
-`headerEvents` same as [`column.events`](#events) but this is for header column.
-
-```js
-{
- // omit...
- headerEvents: {
- onClick: e => { ... }
- }
-}
-```
-
-## column.attrs - [Object | Function]
-Via `attrs` property, You can customize table column [HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) which allow user to configure the elements or adjust their behavior.
-
-```js
-{
- // omit...
- attrs: {
- title: 'bar',
- 'data-test': 'foo'
- }
-}
-```
-Not only `Object`, `callback function` is also acceptable. It takes `4` arguments and an `Object` is expect to return:
-
-```js
-{
- attrs: function callback(cell, row, rowIndex, colIndex) { ... }
-}
-```
-
-**Parameters**
-* `cell`: The value of current cell.
-* `row`: The value of `row` being processed in the `BootstrapTable`.
-* `rowIndex`: The index of the current `row` being processed in the `BootstrapTable`.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `Object` will be the result of element HTML attributes.
-
-#### * Caution
-
-If `column.classes`, `column.style`, `column.title`, `column.hidden` or `column.align` was given at the same time, property `attrs` has lower priorty and it will be overwrited.
-
-```js
-{
- // omit...
- title: true, // it will be chosen.
- attrs: { title: 'test' }
-}
-```
-
-## column.headerAttrs - [Object | Function]
-`headerAttrs` is similiar to [`column.attrs`](#attrs) but it works for header column.
-```js
-{
- // omit...
- headerAttrs: {
- title: 'bar',
- 'data-test': 'foo'
- }
-}
-```
-
-Additionally, customize the header attributes by a `2-arguments` callback function:
-
-```js
-{
- // omit...
- headerAttrs: (column, colIndex) => ({
- // return customized HTML attribute here
- })
-}
-```
-
-**Parameters**
-* `column`: The value of current column.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-**Return value**
-
-A new `Object` will be the result of element headerAttrs.
-
-> Caution:
-> Same as [column.attrs](#attrs), it has lower priority and will be
-> overwrited when other props related to HTML attributes were given.
-
-### headerSortingClasses - [String | Function]
-
-`headerSortingClasses` allows to customize `class` for header cell when this column is sorting.
-
-```js
-const headerSortingClasses = 'demo-sorting';
-```
-
-Furthermore, it also accepts a callback which takes **4** arguments and `String` is expected to return:
-
-```js
-const headerSortingClasses = (column, sortOrder, isLastSorting, colIndex) => { ... }
-```
-
-* `column`: The value of current column.
-* `sortOrder`: The order of current sorting
-* `isLastSorting`: Is the last one of sorted columns.
-* `colIndex`: The index of the current column being processed in BootstrapTable.
-
-### headerSortingStyle - [Object | Function]
-
-It's similiar to [headerSortingClasses](#headerSortingClasses). It allows to customize the style of header cell when this column is sorting. A style `Object` and `callback` are acceptable. `callback` takes **4** arguments and an `Object` is expected to return:
-
-```js
-const sortingHeaderStyle = {
- backgroundColor: 'red'
-};
-```
-
-## column.editable - [Bool | Function]
-`column.editable` default is true, means every column is editable if you configure [`cellEdit`](./README.md#cellEdit). But you can disable some columns editable via setting `false`.
-
-If a callback function given, you can control the editable level as cell level:
-
-```js
-{
- // omit...
- editable: (cell, row, rowIndex, colIndex) => {
- // return true or false;
- }
-}
-```
-
-## column.validator - [Function]
-`column.validator` used for validate the data when cell on updating. it's should accept a callback function with following argument:
-`newValue`, `row` and `column`:
-
-```js
-{
- // omit...
- validator: (newValue, row, column) => {
- return ...;
- }
-}
-```
-
-The return value can be a bool or an object. If your valiation is pass, return `true` explicitly. If your valiation is invalid, return following object instead:
-```js
-{
- valid: false,
- message: 'SOME_REASON_HERE'
-}
-```
-
-## column.editCellStyle - [Object | Function]
-You can use `column.editCellStyle` to custom the style of `` when cell editing. It like most of customizable functionality, it also accept a callback function with following params:
-
-**Parameters**
-* `cell`: The value of current cell.
-* `row`: The object of `row` being processed in the `BootstrapTable`.
-* `rowIndex`: The index of the current `row` being processed in the `BootstrapTable`.
-* `colIndex`: The index of the current `column` being processed in `BootstrapTable`.
-
-```js
-{
- editCellStyle: { ... }
-}
-```
-Or take a callback function
-
-```js
-{
- editCellStyle: (cell, row, rowIndex, colIndex) => {
- // it is suppose to return an object
- }
-}
-```
-
-## column.editCellClasses - [String | Function]
-You can use `column.editCellClasses` to add custom class on ` ` when cell editing. It's same as [`column.editCellStyle`](#editCellStyle) which also accept a callback function to able to custom your class more flexible. Following is the arguments of this callback function: `cell`, `row`, `rowIndex`, `colIndex`.
-
-```js
-{
- editCellClasses: 'custom-class'
-}
-```
-Or take a callback function
-
-```js
-{
- editCellClasses: (cell, row, rowIndex, colIndex) => {
- // it is suppose to return a string
- }
-}
-```
-
-## column.filter - [Object]
-Configure `column.filter` will able to setup a column level filter on the header column. Currently, `react-bootstrap-table2` support following filters:
-
-* Text(`textFilter`)
-
-We have a quick example to show you how to use `column.filter`:
-
-```
-import { textFilter } from 'react-bootstrap-table2-filter';
-
-// omit...
-{
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}
-```
-
-For some reason of simple customization, `react-bootstrap-table2` allow you to pass some props to filter factory function. Please check [here](https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/master/packages/react-bootstrap-table2-filter/README.md) for more detail tutorial.
\ No newline at end of file
diff --git a/docs/development.md b/docs/development.md
deleted file mode 100644
index 372bfa901..000000000
--- a/docs/development.md
+++ /dev/null
@@ -1,28 +0,0 @@
-## Development Guide
-
-### Setup
-```bash
-$ git clone https://github.com/react-bootstrap-table/react-bootstrap-table2.git
-$ cd react-bootstrap-table
-$ npm install
-$ lerna bootstrap # ./node_modules/.bin/lerna bootstrap
-```
-### Development
-```bash
-$ npm start
-```
-
-### Launch StoryBook
-We use [storybook](https://storybook.js.org/) to list our examples and it also has hot reload from source code. Sometimes, it is also a good entry point to development.
-
-```bash
-$ cd packages/react-bootstrap-table2-example
-$ npm run storybook
-```
-
-### Testing
-```bash
-$ npm test
-$ npm run test:watch # for watch mode
-$ npm run test:coverage # generate coverage report
-```
\ No newline at end of file
diff --git a/docs/export-csv-props.html b/docs/export-csv-props.html
new file mode 100644
index 000000000..db9a0be0a
--- /dev/null
+++ b/docs/export-csv-props.html
@@ -0,0 +1,61 @@
+Export CSV Props · react-bootstrap-table2
› Export to CSV Definition Export CSV in one of features supported by react-bootstrap-table2-toolkit
. By passing exportCSV
prop to ToolkitProvider
for enabling this functionality.
+ Required
+N/A
+ Optional
+
+ Example
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ exportCSV={ {
+ fileName: 'custom.csv',
+ separator: '|',
+ ignoreHeader: true,
+ noAutoBOM: false
+ } }
+>
+ //...
+</ToolkitProvider>
+
+
+ exportCSV.fileName - [Bool]
+Custom the csv file name.
+ exportCSV.separator - [String]
+Custom the csv file separator.
+ exportCSV.ignoreHeader - [bool]
+Default is false
. Give true to avoid to attach the csv header.
+ exportCSV.ignoreFooter - [bool]
+Default is true
. Give false
to attach the table footer if enabled.
+ exportCSV.noAutoBOM - [bool]
+Default is true
.
+ exportCSV.blobType - [string]
+Default is text/plain;charset=utf-8
. Change to update the blob type of the exported file.
+ exportCSV.exportAll - [bool]
+Default is true
. false
will only export current display data on table.
+ exportCSV.onlyExportSelection - [bool]
+Default is false
. true
will only export the data which is selected
+ exportCSV.onlyExportFiltered - [bool]
+Default is false
. true
will only export the data which is filtered/searched.
+
+
+Note: When you configure this prop as true, you must turn off exportAll
.
+
+
+
\ No newline at end of file
diff --git a/docs/exposed-api.html b/docs/exposed-api.html
new file mode 100644
index 000000000..2f7af62ca
--- /dev/null
+++ b/docs/exposed-api.html
@@ -0,0 +1,34 @@
+Introduction Exposed API · react-bootstrap-table2 react-bootstrap-table2
support some hooks function that you can use to know what state changes, for example: a row is select or unselect.
+In addition, we also allow you use React
Refs
to directly access the components so that you can easier to get some table states.
+Live Demo
+ Add a Refs on BootstrapTable
+<BootstrapTable
+ ref={ n => this .node = n }
+ ...
+/>
+
+ Get Current Display Rows
+this.node.table.props.data
+ Get Current Selected Rows
+this.node.selectionContext.selected
+ Get Current Expanded Rows
+this.node.rowExpandContext.state.expanded
+ Get Current Page
+this.node.paginationContext.currPage
+ Get Current Size Per Page
+this.node.paginationContext.currSizePerPage
+ Get Current Sorting Column
+this.node.sortContext.state.sortColumn
+ Get Current Sorting Order
+this.node.sortContext.state.sortOrder
+ Get Current Filters
+this.node.filterContext.currFilters
+ Trigger Cell Editing:
+this.node.cellEditContext.startEditing(0, 1); // rowindex, columnindex
+
\ No newline at end of file
diff --git a/docs/filter-props.html b/docs/filter-props.html
new file mode 100644
index 000000000..cbcc1753f
--- /dev/null
+++ b/docs/filter-props.html
@@ -0,0 +1,576 @@
+Column Filter Props · react-bootstrap-table2
› Column Filter Definition react-bootstrap-table2
separate the filter core code base to react-bootstrap-table2-filter . The following are guideline about how to use and the details of props of filterFactory and filters . For more information, please take refer to the samples as link here.
+Content Table
+
+Getting Started
+Please check Getting Started Guide
+How to use
+You should apply following two props to enable filter functionality:
+
+Give filter
prop on BootstrapTable
which value is the return value from calling filterFactory
function
+Add filter
property on column
object:
+
+textFilter
+selectFilter
+multiSelectFilter
+numberFilter
+dateFilter
+customFilter
+
+
+For example:
+import BootstrapTable from 'react-bootstrap-table-next' ;
+import filterFactory, { textFilter } from 'react-bootstrap-table2-filter' ;
+
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID'
+}, {
+ dataField : 'name' ,
+ text : 'Product Name'
+}, {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter()
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+Props of FilterFactory
+No Any Available Props Yet
+Props of Filters
+ textFilter
+Required : NONE
+Optional :
+ textFilter.id - [String]
+
+custom element HTML id for filter
+
+ textFilter.placeholder - [String]
+
+custom the input placeholder
+
+ textFilter.className - [String]
+
+custom class name on input
+
+ textFilter.defaultValue - [String]
+
+default filtering value
+
+ textFilter.comparator - [Comparator]
+
+Specify what kind of comparator to compare. Default is Comparator.LIKE
+
+ textFilter.caseSensitive - [Boolean]
+
+default is false
, and true
will only work when comparator is LIKE
.
+
+ textFilter.style - [Object]
+
+your custom inline styles on input
+
+ textFilter.delay - [Number]
+
+Debounce time, which means how long will trigger filtering after user typing. Default is 500ms
.
+
+ textFilter.getFilter - [Function]
+
+export filter
function to allow users to access. For textFilter, filter(value)
to filter columns dynamically.
+
+ textFilter.onFilter - [Function]
+
+Register a listener which will be called when column filter being triggered. If you return an array value, react-bootstrap-table2
will adopt this value as final filted result.
+
+Example
+import BootstrapTable from 'react-bootstrap-table-next' ;
+import filterFactory, { textFilter } from 'react-bootstrap-table2-filter' ;
+
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID' ,
+}, {
+ dataField : 'name' ,
+ text : 'Product Name' ,
+ filter : textFilter({
+ placeholder : 'My Custom PlaceHolder' ,
+ className: 'my-custom-text-filter' ,
+ defaultValue: 'test' ,
+ comparator: Comparator.EQ,
+ caseSensitive: true ,
+ style: { backgroundColor : 'yellow' },
+ delay: 1000 ,
+ onClick: e => console .log(e),
+ getFilter : (filter ) => {
+ nameFilter = filter;
+ },
+ onFilter : (filterValue ) => { filter listener
+
+ }
+ })
+}, {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter()
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+ selectFilter
+Required :
+ selectFilter.options - [Object | Array | Function]
+
+(Required) the options for the list of drop down.
+
+Optional :
+ selectFilter.id - [String]
+
+custom element HTML id for filter
+
+ selectFilter.className - [String]
+
+custom class name on input
+
+ selectFilter.withoutEmptyOption - [Boolean]
+
+When it was set to true
, the drop down list would hide the default selection.
+
+ selectFilter.defaultValue - [String]
+
+default filtering value
+
+ selectFilter.comparator - [Comparator]
+
+Specify what kind of comparator to compare. Default is Comparator.EQ
+
+ selectFilter.style - [Object]
+
+your custom inline styles on input
+
+ selectFilter.getFilter - [Function]
+
+export filter
function to allow users to access. For selectFilter, filter(value)
to filter columns dynamically.
+
+ selectFilter.onFilter - [Function]
+
+Register a listener which will be called when column filter being triggered. If you return an array value, react-bootstrap-table2
will adopt this value as final filted result.
+
+Example
+import BootstrapTable from 'react-bootstrap-table-next';
+import filterFactory, { selectFilter } from 'react-bootstrap-table2-filter';
+
+// options as Object
+const selectOptions = {
+ 0: 'good',
+ 1: 'Bad',
+ 2: 'unknown'
+};
+
+// options as Array
+const selectOptions = [
+ { value: 0, label: 'good' },
+ { value: 1, label: 'Bad' },
+ { value: 2, label: 'unknown' }
+];
+
+// options as Function
+function selectOptions = (column) => [
+ { value: 0, label: 'good' },
+ { value: 1, label: 'Bad' },
+ { value: 2, label: 'unknown' }
+];
+
+
+const columns = [
+ { ... }, { ... }, {
+ dataField: 'quality',
+ text: 'Product Quailty',
+ formatter: cell => selectOptions[cell],
+ filter: selectFilter({
+ options: selectOptions,
+ className: 'test-classname',
+ withoutEmptyOption: true,
+ defaultValue: 2,
+ comparator: Comparator.LIKE, // default is Comparator.EQ
+ style: { backgroundColor: 'pink' },
+ getFilter: (filter) => { // qualityFilter was assigned once the component has been mounted.
+ qualityFilter = filter;
+ },
+ onFilter: (filterValue) => { filter listener
+ //...
+ }
+ })
+}];
+
+<BootstrapTable keyField='id' data={ products } columns={ columns } filter={ filterFactory() } />
+
+ multiSelectFilter
+Required :
+ multiSelectFilter.options - [Object]
+
+(Required) the options for the list of drop down.
+
+Optional :
+ multiSelectFilter.id - [String]
+
+custom element HTML id for filter
+
+ multiSelectFilter.className - [String]
+
+custom class name on input
+
+ multiSelectFilter.withoutEmptyOption - [Boolean]
+
+When it was set to true
, the drop down list would hide the default selection.
+
+ multiSelectFilter.defaultValue - [Array]
+
+default filtering value
+
+ multiSelectFilter.comparator - [Comparator]
+
+Specify what kind of comparator to compare. Default is Comparator.EQ
+
+ multiSelectFilter.style - [Object]
+
+your custom inline styles on input
+
+ multiSelectFilter.getFilter - [Function]
+
+export filter
function to allow users to access. For multiSelectFilter, filter(value)
to filter columns dynamically.
+
+ multiSelectFilter.onFilter - [Function]
+
+Register a listener which will be called when column filter being triggered. If you return an array value, react-bootstrap-table2
will adopt this value as final filted result.
+
+Example
+import BootstrapTable from 'react-bootstrap-table-next' ;
+import filterFactory, { multiSelectFilter } from 'react-bootstrap-table2-filter' ;
+
+const selectOptions = {
+ 0 : 'good' ,
+ 1 : 'Bad' ,
+ 2 : 'unknown'
+};
+
+const columns = [
+ { ... }, { ... }, {
+ dataField : 'quality' ,
+ text : 'Product Quailty' ,
+ formatter : cell => selectOptions[cell],
+ filter : multiSelectFilter({
+ options : selectOptions,
+ className : 'test-classname' ,
+ withoutEmptyOption : true ,
+ defaultValue : [0 , 2 ],
+ comparator : Comparator.LIKE,
+ style: { backgroundColor : 'pink' },
+ getFilter : (filter ) => {
+ qualityFilter = filter;
+ },
+ onFilter : (filterValue ) => { filter listener
+
+ }
+ })
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+ numberFilter
+Required : NONE
+Optional :
+ numberFilter.id - [String]
+
+custom element HTML id for filter
+
+ numberFilter.options - [Array]
+
+Once the options
has been defined, it will render number select
drop down instead of number input field.
+
+ numberFilter.delay - [Number]
+
+Debounce time, which means how long will trigger filtering after user typing. Default is 500ms
.
+
+ numberFilter.placeholder - [String]
+
+customized placeholder for number input.
+
+ numberFilter.withoutEmptyComparatorOption - [Boolean]
+
+When it was set to true
, the drop down list of comparator
would hide the default selection.
+
+ numberFilter.withoutEmptyNumberOption - [Boolean]
+
+When it was set to true
, the drop down list of number
would hide the default selection. Besides, before picking up this prop, please make sure that you've defined the props.options
correctly.
+
+ numberFilter.defaultValue - [Object]
+
+It is the default filtering value. Furthermore, it accepts 2 attributes:
+
+number: filter value
+comparator: what kind of comparator to compare
+
+
+ numberFilter.comparator - [[Comparator]]
+
+Specify what kind of comparator to compare. Default is to list all
of comparators.
+
+ numberFilter.className - [String]
+
+custom class name on the wrapper
of number input and comparator drop down.
+
+ numberFilter.comparatorClassName - [String]
+
+custom class name on the comparator
drop down.
+
+ numberFilter.numberClassName - [String]
+
+custom class name on the number input
.
+
+ numberFilter.style - [Object]
+
+custom inline styles on the wrapper
of number input and comparator drop down.
+
+ numberFilter.comparatorStyle - [Object]
+
+custom inline styles on the comparator
drop down.
+
+ numberFilter.numberStyle - [Object]
+
+custom inline styles on the number input
.
+
+ numberFilter.getFilter - [Function]
+
+export filter
function to allow users to access. For numberFilter,filter({ number, comparator })
to filter columns dynamically.
+
+ numberFilter.onFilter - [Function]
+
+Register a listener which will be called when column filter being triggered. If you return an array value, react-bootstrap-table2
will adopt this value as final filted result.
+
+Example :
+import BootstrapTable from 'react-bootstrap-table-next' ;
+import filterFactory, { numberFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+const columns = [{ ... }, { ... }, {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : numberFilter({
+ options : [2100 , 2103 , 2105 ],
+ delay: 600 ,
+ placeholder: 'custom placeholder' ,
+ withoutEmptyComparatorOption: true ,
+ withoutEmptyNumberOption: true ,
+ comparators: [Comparator.EQ, Comparator.GT, Comparator.LT],
+ style: { display : 'inline-grid' },
+ className: 'custom-numberfilter-class' ,
+ comparatorStyle: { backgroundColor : 'antiquewhite' },
+ comparatorClassName: 'custom-comparator-class' ,
+ numberStyle: { backgroundColor : 'cadetblue' , margin : '0px' },
+ numberClassName: 'custom-number-class' ,
+ defaultValue: { number : 2103 , comparator : Comparator.GT },
+ getFilter: (filter ) => {
+ priceFilter = filter;
+ },
+ onFilter : (filterValue ) => { filter listener
+
+ }
+ })
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+ dateFilter
+Required : NONE
+Optional :
+ dateFilter.id - [String]
+
+custom element HTML id for filter
+
+ dateFilter.delay - [Number]
+
+Debounce time, which means how long will trigger filtering after user typing. Default is 0.
+
+ dateFilter.placeholder - [String]
+
+customized placeholder for date input.
+
+ dateFilter.withoutEmptyComparatorOption - [Boolean]
+
+When it was set to true
, the drop down list of comparator
would hide the default selection.
+
+ dateFilter.defaultValue - [Object]
+
+It is the default filtering value. Furthermore, it accepts 2 attributes:
+
+date: a date object which need to be filtered
+comparator: what kind of comparator to compare
+
+
+ dateFilter.comparator - [[Comparator]]
+
+Specify what kind of comparator to compare. Default is to list all
of comparators.
+
+ dateFilter.className - [String]
+
+custom class name on the wrapper
of date input and comparator drop down.
+
+ dateFilter.comparatorClassName - [String]
+
+custom class name on the comparator
drop down.
+
+ dateFilter.dateClassName - [String]
+
+custom class name on the date input
.
+
+ dateFilter.style - [Object]
+
+custom inline styles on the wrapper
of date input and comparator drop down.
+
+ dateFilter.comparatorStyle - [Object]
+
+custom inline styles on the comparator
drop down.
+
+ dateFilter.dateStyle - [Object]
+
+custom inline styles on the date input
.
+
+ dateFilter.getFilter - [Function]
+
+export filter
function to allow users to access. For dateFilter,filter({ date, comparator })
to filter columns dynamically.
+
+ dateFilter.onFilter - [Function]
+
+Register a listener which will be called when column filter being triggered. If you return an array value, react-bootstrap-table2
will adopt this value as final filted result.
+
+Example :
+import BootstrapTable from 'react-bootstrap-table-next' ;
+import filterFactory, { dateFilter, Comparator } from 'react-bootstrap-table2-filter' ;
+
+const columns = [{ ... }, { ... }, {
+ dataField : 'date' ,
+ text : 'Product Date' ,
+ filter : dateFilter({
+ delay : 600 ,
+ placeholder: 'custom placeholder' ,
+ withoutEmptyComparatorOption: true ,
+ comparators: [Comparator.EQ, Comparator.GT, Comparator.LT],
+ style: { display : 'inline-grid' },
+ className: 'custom-dateFilter-class' ,
+ comparatorStyle: { backgroundColor : 'antiquewhite' },
+ comparatorClassName: 'custom-comparator-class' ,
+ dateStyle: { backgroundColor : 'cadetblue' , margin : '0px' },
+ dateClassName: 'custom-date-class' ,
+ defaultValue: { date : new Date (2018 , 0 , 1 ), comparator : Comparator.GT },
+ getFilter: (filter ) => {
+ prodDateFilter = filter;
+ },
+ onFilter : (filterValue ) => { filter listener
+
+ }
+ });
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+ customFilter
+Required : NONE
+Optional :
+ customFilter.type - [String]
+
+Assign the filter mode when react-bootstrap-table
filering your data, please check FILTER_TYPES for available values.
+
+ customFilter.comparator - [Comparator]
+
+Specify what kind of comparator to compare. Default is Comparator.LIKE
. But if customFilter.type
is FILTER_TYPES.SELECT
, this default value will be Comparator.EQ
+
+ customFilter.caseSensitive - [Boolean]
+
+default is false
, and true
will only work when comparator is LIKE
.
+
+Comparator
+We support the following ways to do the comparison. Each filter
has its default comparator. For more information, please take refer to the introduction of props above.
+
+
+Comparator Symbol description
+
+
+1 Comparator.LIKE N/A To include filter value
+2 Comparator.EQ =
+3 Comparator.NE !=
+4 Comparator.GT >
+5 Comparator.GE >=
+6 Comparator.LT <
+7 Comparator.LE <=
+
+
+FILTER_TYPES
+Following properties is valid in FILTER_TYPES
:
+
+TEXT
+SELECT
+MULTISELECT
+NUMBER
+DATE
+
+You will only need the FILTER_TYPES
when you are customize the filter component and you want to assign a specify filter mode.
+Position
+Default filter is rendered inside the table column header, but you can choose to render them as a row by filterPosition
:
+ Render in the top of table body
+<BootstrapTable
+ keyField='id'
+ data={ products }
+ columns={ columns }
+ filter={ filterFactory() }
+ filterPosition="top"
+/>
+
+ Render in the bottom of table body
+<BootstrapTable
+ keyField='id'
+ data={ products }
+ columns={ columns }
+ filter={ filterFactory() }
+ filterPosition="bottom"
+/>
+
+ Configuration
+filterFactory
is a factory function for initializing some internal config. Below is available options for filterFactory
:
+ afterFilter
+This hook function will be called with two arguments(new filter result and filter object) when filtering completed.
+function afterFilter (newResult, newFilters ) {
+ console .log(newResult);
+ console .log(newFilters);
+}
+export default () => (
+ <div >
+ <BootstrapTable
+ keyField ="id"
+ data ={ products }
+ columns ={ columns }
+ filter ={ filterFactory ({ afterFilter }) }
+ />
+ </div >
+);
+
+
\ No newline at end of file
diff --git a/docs/getting-started.html b/docs/getting-started.html
new file mode 100644
index 000000000..9e87e3588
--- /dev/null
+++ b/docs/getting-started.html
@@ -0,0 +1,64 @@
+Getting Started · react-bootstrap-table2 Installation
+
+Due to react-bootstrap-table2
already taken on npm our module is called react-bootstrap-table-next
. We still use react-bootstrap-table2
in any our git repository, official website and documentation - only the npm name is different!
+
+$ npm install react-bootstrap-table-next --save
+
+ Add CSS
+
+You first need to add bootstrap css in your application. After v1.0.0 , we start to suport bootstrap@4
.
+
+Finish above step, then add the react-bootstrap-table2
styles:
+
+require ('react-bootstrap-table-next/dist/react-bootstrap-table2.min.css' );
+
+
+import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css' ;
+
+ Your First Table
+import BootstrapTable from 'react-bootstrap-table-next' ;
+
+const products = [ ... ];
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID'
+}, {
+ dataField : 'name' ,
+ text : 'Product Name'
+}, {
+ dataField : 'price' ,
+ text : 'Product Price'
+}];
+
+export default () =>
+ <BootstrapTable keyField ='id' data ={ products } columns ={ columns } />
+
+
+ UMD
+ Namespace
+
+The namespace of react-bootstrap-table-next
is ReactBootstrapTable2
+The namespace of react-bootstrap-table2-editor
is ReactBootstrapTable2Editor
+The namespace of react-bootstrap-table2-filter
is ReactBootstrapTable2Filter
+The namespace of react-bootstrap-table2-paginator
is ReactBootstrapTable2Paginator
+The namespace of react-bootstrap-table2-overlay
is ReactBootstrapTable2Overlay
+The namespace of react-bootstrap-table2-toolkit
is ReactBootstrapTable2Toolkit
+
+ npm
+After install from npm, your can get UMD module from the dist
.
+ unpkg
+
+Downloadreact-bootstrap-table-next
from here
+Download react-bootstrap-table2-editor
from here
+Download react-bootstrap-table2-filter
from here
+Download react-bootstrap-table2-paginator
from here
+Download react-bootstrap-table2-overlay
from here
+Download react-bootstrap-table2-toolkit
from here
+
+
\ No newline at end of file
diff --git a/docs/migration.html b/docs/migration.html
new file mode 100644
index 000000000..5e2bcdbd6
--- /dev/null
+++ b/docs/migration.html
@@ -0,0 +1,146 @@
+Migration · react-bootstrap-table2 Migration Guide
+
+Please see the CHANGELOG for react-bootstrap-table2
first drop.
+Feel free to see the official docs , we list all the basic usage here!!
+
+ Preface
+Currently, I still can't implement all the mainly features in legacy react-bootstrap-table
, so please watch our github repo or blog to make sure the legacy features you wanted are already implemented on react-bootstrap-table2
. Anyway, ask me by open issue is ok.
+
+react-bootstrap-table2
separate some functionalities from core modules to other modules like following:
+
+This can help your application with less bundled size and also help react-bootstrap-table2
have clean design to avoid handling to much logic in kernel module(SRP). Hence, which means you probably need to install above addons when you need specific features.
+ Core Table Migration
+There is a big change is that there's no TableHeaderColumn
in the react-bootstrap-table2
, instead you are supposed to be define the columns
prop on BootstrapTable
:
+import BootstrapTable from 'react-bootstrap-table-next' ;
+
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID'
+}, {
+ dataField : 'name' ,
+ text : 'Product Name'
+}, {
+ dataField : 'price' ,
+ text : 'Product Price'
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } />
+
+The text
property is just same as the children for the TableHeaderColumn
, if you want to custom the header, there's a new property is: headerFormatter
.
+
+ Table Sort
+Please see Work with table sort .
+
+[v] Basic sorting
+[v] Custom sort function
+[v] Default Sort
+[v] Remote mode
+[v] Custom the sorting header
+[v] Sort event listener
+[v] Custom the sort caret
+[v] Sort management
+[ ] Multi sort
+
+Due to no TableHeaderColumn
so that no dataSort
here, please add sort
property on column definition.
+ Row Selection
+Please see Work with selection .
+Please see available selectRow configurations .
+No huge changes in row selection.
+ Column Filter
+Please see Work with column filter .
+Please see available filter configuration .
+
+[v] Text Filter
+[v] Remote Filter
+[v] Custom Filter Component
+[ ] Regex Filter
+[v] Select Filter
+[v] Number Filter
+[v] Date Filter
+[v] Array Filter
+[v] Programmatically Filter
+
+Remember to install react-bootstrap-table2-filter
firstly.
+Due to no TableHeaderColumn
so that no filter
here, please add filter
property on column definition and filter
prop on BootstrapTable
.
+ Cell Edit
+Please see Work with cell edit .
+Please see available cell edit configurations .
+Remember to install react-bootstrap-table2-editor
firstly.
+No big changes for cell editing, validator
will not support the async call(Promise).
+ Pagination
+Please see Work with pagination .
+Please see available pagination configurations .
+Remember to install react-bootstrap-table2-paginator
firstly.
+In newest react-bootstrap-table2-paginator@2.0.0
, we allow you to custom any part of pagination component more flexible.
+ Table Search
+Please see Work with table search .
+Please see Search configurations .
+The usage of search functionality is a little bit different from legacy search. The mainly different thing is developer have to render the search input field, we do believe it will be very flexible for all the developers who want to custom the search position or search field itself.
+
+[v] Custom search component and position
+[v] Custom search value
+[v] Clear search
+[ ] Multiple search
+[ ] Strict search
+
+ Row Expand
+Please see Work with expandable row .
+Please see Row expand configurations .
+
+[v] Expand Row Events
+[v] Expand Row Indicator
+[v] Expand Row Management
+[v] Custom Expand Row Indicators
+[v] Compatiable with Row Selection
+[v] Expand Column position
+[v] Expand Column Style/Class
+
+ Export CSV
+Please see Work with export to CSV .
+Please see Export CSV configurations .
+Export CSV functionality is like search, which is one of functionality in the react-bootstrap-table2-toolkit
. All of the legacy functions we already implemented.
+ Remote
+
+It's totally different in react-bootstrap-table2
. Please see .
+
+ Row insert/Delete
+Not support yet
+ Keyboard Navigation
+Not support yet
+
\ No newline at end of file
diff --git a/docs/overlay.html b/docs/overlay.html
new file mode 100644
index 000000000..0fb6c8d31
--- /dev/null
+++ b/docs/overlay.html
@@ -0,0 +1,15 @@
+Remote Loading/Overlay · react-bootstrap-table2 In react-bootstrap-table2
, you will be easier to custom the loading or overlay on table no matter if remote enabled or not. In the following, we have two way to do it:
+
+ Empty Table
+noDataIndication
is a simple case you can take it, if current data size is empty, react-bootstrap-table2
will call the noDataIndication
prop and get the result to display on the table.
+Here is a quick exmaple for noDataIndication
.
+ Loading Table
+In the most of case for remote mode, you need the loading animation to tell the user the table is loading or doing some action in the background. Hence, you can lervarge overlay
prop.
+Here is also a example for overlay
+
\ No newline at end of file
diff --git a/docs/pagination-props.html b/docs/pagination-props.html
new file mode 100644
index 000000000..c85b79139
--- /dev/null
+++ b/docs/pagination-props.html
@@ -0,0 +1,274 @@
+Pagination Props · react-bootstrap-table2 Following we list all props for paginationFactory
from react-bootstrap-table2-paginator
.
+import paginationFactory from 'react-bootstrap-table2-paginator' ;
+
+const pagination = paginationFactory({
+ page : 2 ,
+ ...
+});
+
+<BootstrapTable pagination ={ pagination } ... />
+
+ Required
+NONE
+ Optional
+
+
+ pagination.custom - [Bool]
+Default is false, you will enable it only when you need to implement a customization completely .
+ pagination.page - [Number]
+Use pagination.page
specify the current page when table render.
+
+It's necessary value when remote pagination is enabled.
+
+ pagination.sizePerPage - [Number]
+Use pagination.sizePerPage
specify the current size per page when table render.
+
+It's necessary value when remote pagination is enabled.
+
+ pagination.totalSize - [Number]
+This props will be necessary value for below two cases:
+ remote mode
+Because react-bootstrap-table2
will never know the totally data size actually. Remeber to assign totalSize
when you enable the remote pagination.
+ Customization
+When you need to implement a customization completely . You have to give props.
+ pagination.pageStartIndex - [Number]
+Default is 1 , which means the first page index is start from 1. If your first page want to start from 0 , you can control it via pageStartIndex
.
+ pagination.paginationSize - [Number]
+Default is 5 , which means the size of pagination.
+ pagination.sizePerPageList - [Array]
+Default size per page have 10 , 25 , 30 , 50 . You can assign a number of array to replace this default list. However, sizePerPageList
is flexible to let you decide the text display on the dropdown list:
+[ {
+ text : '5th' , value : 5
+}, {
+ text : '10th' , value : 10
+}, {
+ text : 'All' , value : data.length
+} ]
+
+ pagination.withFirstAndLast - [Bool]
+Default is true
, you can disable it if you don't want to show the "Go to first" and "Go to last" page buttons.
+ pagination.alwaysShowAllBtns - [Bool]
+Default is false
, which means react-bootstrap-table2
will hide the next or previouse page button if unnecessary. Anyway, you can still show them always via alwaysShowAllBtns
prop.
+If you also enable withFirstAndLast
, this prop also keep to show first and last page when you enable it.
+ pagination.firstPageText - [Any]
+A quick way to specify the text on the first page button.
+ pagination.prePageText - [Any]
+A quick way to specify the text on the previous page button.
+ pagination.nextPageText - [Any]
+A quick way to specify the text on the next page button.
+ pagination.lastPageText - [Any]
+A quick way to specify the text on the last page button.
+ pagination.firstPageTitle - [Any]
+A quick way to specify the title on the first page button.
+ pagination.prePageTitle - [Any]
+A quick way to specify the title on the previous page button.
+ pagination.nextPageTitle - [Any]
+A quick way to specify the title on the next page button.
+ pagination.lastPageTitle - [Any]
+A quick way to specify the title on the last page button.
+ pagination.hideSizePerPage - [Bool]
+You can hide the size per page dropdown.
+ pagination.hidePageListOnlyOnePage - [Bool]
+You can hide the pagination when there's only one page in table. Default is false
.
+ pagination.showTotal - [Bool]
+Default is false
, if enable will display a text to indicate the row range of current page.
+ pagination.disablePageTitle - [Bool]
+Default is false
, if enable will remove the title
attribute from each page button.
+ pagination.pageButtonRenderer - [Function]
+Custom the page button inside the pagination list. This callback function have one argument which is an object and contain following props:
+
+page
: Page number
+active
: If this page is current page or not.
+disabled
: If this page is disabled or not.
+title
: Page title
+onPageChange
: Call it when you need to change page
+
+Following is a minimal example:
+const pageButtonRenderer = ({
+ page,
+ active,
+ disabled,
+ title,
+ onPageChange
+}) => {
+ const handleClick = (e ) => {
+ e.preventDefault();
+ onPageChange(page);
+ };
+
+ return (
+ <li className ="page-item" >
+ <a href ="#" onClick ={ handleClick } .... > { page }</a >
+ </li >
+ );
+};
+
+const options = {
+ pageButtonRenderer
+};
+
+<BootstrapTable keyField ="id" data ={ products } columns ={ columns } pagination ={ paginationFactory (options ) } />
+
+ pagination.pageListRenderer - [Function]
+Custom the pagination list component, this callback function have one argument which is an object and contain following props:
+
+pages
: Current page
+onPageChange
: Call it when you need to change page
+
+Below is a minimal example:
+const pageListRenderer = ({
+ pages,
+ onPageChange
+}) => {
+
+ const pageWithoutIndication = pages.filter(p => typeof p.page !== 'string' );
+ return (
+ <div >
+ {
+ pageWithoutIndication.map(p => (
+ <button className ="btn btn-success" onClick ={ () => onPageChange(p.page) }>{ p.page }</button >
+ ))
+ }
+ </div >
+ );
+};
+
+const options = {
+ pageListRenderer
+};
+
+<BootstrapTable keyField ="id" data ={ products } columns ={ columns } pagination ={ paginationFactory (options ) } />
+
+ pagination.sizePerPageRenderer - [Function]
+Custom the size per page dropdown component, this callback function have one argument which is an object and contain following props:
+
+options
: Dropdown option.
+currSizePerPage
: Current size per page.
+onSizePerPageChange
: Call it when you need to change size per page.
+
+Below is a minimal example:
+const sizePerPageRenderer = ({
+ options,
+ currSizePerPage,
+ onSizePerPageChange
+}) => (
+ <div className ="btn-group" role ="group" >
+ {
+ options.map(option => (
+ <button
+ key ={ option.text }
+ type ="button"
+ onClick ={ () => onSizePerPageChange(option.page) }
+ className={ `btn ${currSizePerPage === `${option.page}` ? 'btn-secondary' : 'btn-warning'}` }
+ >
+ { option.text }
+ </button >
+ ))
+ }
+ </div >
+);
+
+const options = {
+ sizePerPageRenderer
+};
+
+<BootstrapTable keyField ="id" data ={ products } columns ={ columns } pagination ={ paginationFactory (options ) } />
+
+ pagination.sizePerPageOptionRenderer - [Function]
+Custom the option of size per page dropdown component, this callback function have one argument which is an object and contain following props:
+
+text
: The text of option.
+page
: The size per page of option.
+onSizePerPageChange
: Call it when you need to change size per page.
+
+Below is a minimal example:
+const sizePerPageOptionRenderer = ({
+ text,
+ page,
+ onSizePerPageChange
+}) => (
+ <li
+ key ={ text }
+ role ="presentation"
+ className ="dropdown-item"
+ >
+ <a
+ href ="#"
+ tabIndex ="-1"
+ role ="menuitem"
+ data-page ={ page }
+ onMouseDown ={ (e ) => {
+ e.preventDefault();
+ onSizePerPageChange(page);
+ } }
+ style={ { color: 'red' } }
+ >
+ { text }
+ </a >
+ </li >
+);
+
+const options = {
+ sizePerPageOptionRenderer
+};
+
+<BootstrapTable keyField ="id" data ={ products } columns ={ columns } pagination ={ paginationFactory (options ) } />
+
+ pagination.paginationTotalRenderer - [Function]
+Custom the total information, this callbacok function have three arguments: from
, to
and size
. Following is an example:
+const customTotal = (from , to, size ) => (
+ <span className ="react-bootstrap-table-pagination-total" >
+ Showing { from } to { to } of { size } Results
+ </span >
+);
+
+ pagination.onPageChange - [Function]
+Accept a callback function and will be called when page changed. This callback function get below arguments:
+Arguments
+
+ pagination.onSizePerPageChange - [Function]
+Accept a callback function and will be called when size per page changed. This callback function get below arguments:
+Arguments
+
+
\ No newline at end of file
diff --git a/docs/row-expand-props.html b/docs/row-expand-props.html
new file mode 100644
index 000000000..c6f356897
--- /dev/null
+++ b/docs/row-expand-props.html
@@ -0,0 +1,184 @@
+Row Expand Props · react-bootstrap-table2 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
+
+ Optional
+
+
+ expandRow.renderer - [Function]
+Specify the content of expand row, react-bootstrap-table2
will pass the two arguments and expect to return a react element:
+
+row
: Currnet row data.
+rowIndex
: Currnet row index.
+
+const expandRow = {
+ renderer : (row, rowIndex ) => (
+ <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 }
+/>
+
+ expandRow.expanded - [Array]
+expandRow.expanded
is useful to manage the row expand on table, for example: you can use it to perform the default expands.
+const expandRow = {
+ renderer : (row ) => ...
+ expanded: [1 , 3 ]
+};
+
+ expandRow.nonExpandable - [Array]
+This prop allow you to restrict some rows which can not be expanded by user. expandRow.nonExpandable
accept an rowkeys array.
+const expandRow = {
+ renderer : (row ) => ...
+ nonExpandable: [1 , 3 ,5 ]
+};
+
+ expandRow.onExpand - [Function]
+This prop accept a callback function which will be called when a row is expand/collapse and pass following four arguments:
+row
, isExpand
, rowIndex
and e
.
+const expandRow = {
+ renderer : (row ) => ...
+ onExpand: (row, isExpand, rowIndex, e ) => {
+
+ }
+};
+
+ expandRow.onExpandAll - [Function]
+This prop accept a callback function which will be called when expand/collapse all. It only work when you configure expandRow.showExpandColumn
as true
.
+const expandRow = {
+ renderer : (row ) => ...,
+ showExpandColumn : true ,
+ onExpandAll : (isExpandAll, results, e ) => {
+
+ }
+};
+
+ expandRow.showExpandColumn - [Bool]
+Default is false
, if you want to have a expand indicator, give this prop as true
.
+const expandRow = {
+ renderer : (row ) => ...
+ showExpandColumn: true
+};
+
+ expandRow.onlyOneExpanding - [Bool]
+Default is false
. Enable this will only allow one row get expand at the same time.
+const expandRow = {
+ renderer : (row ) => ...
+ onlyOneExpanding: true
+};
+
+ expandRow.expandByColumnOnly - [Bool]
+Default is false
. If you want to restrict user to expand/collapse row via clicking the expand column only, you can enable it.
+const expandRow = {
+ renderer : (row ) => ...,
+ showExpandColumn : true ,
+ expandByColumnOnly : true
+};
+
+ expandRow.expandColumnPosition - [String]
+Default is left
. You can give this as right
for rendering expand column in the right side.
+const expandRow = {
+ renderer: (row) => ...,
+ showExpandColumn: true,
+ expandColumnPosition: 'right'
+};
+
+## expandRow.expandByColumnOnly - [Bool]
+Default is `false`. If you want to restrict user to expand/collapse row via clicking the expand column only, you can enable it.
+
+```js
+const expandRow = {
+ renderer: (row) => ...,
+ showExpandColumn: true,
+ expandByColumnOnly: true
+};
+
+ expandRow.expandColumnRenderer - [Function]
+Provide a callback function which allow you to custom the expand indicator. This callback only have one argument which is an object and contain these properties:
+
+expanded
: If current row is expanded or not
+rowKey
: Current row key
+expandable
: If currnet row is expandable or not
+
+const expandRow = {
+ renderer : (row ) => ...
+ expandColumnRenderer: ({ expanded, rowKey, expandable } ) => (
+
+ )
+};
+
+ expandRow.expandHeaderColumnRenderer - [Function]
+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
to indicate if there are any expanded rows:
+const expandRow = {
+ renderer : (row ) => ...,
+ showExpandColumn : true ,
+ expandHeaderColumnRenderer : ({ isAnyExpands } ) => (
+
+ )
+};
+
+ expandRow.className - [String | Function]
+Apply the custom class name on the expanding row. For example:
+const expandRow = {
+ renderer : (row ) => ...,
+ className : 'foo'
+};
+
+Following case is more flexible way to custom the class name:
+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:
+const expandRow = {
+ renderer : (row ) => ...,
+ parentClassName : 'foo'
+};
+
+Below case is more flexible way to custom the class name:
+const expandRow = {
+ renderer : (row ) => ...,
+ parentClassName : (isExpanded, row, rowIndex ) => {
+ if (rowIndex > 2 ) return 'foo' ;
+ return 'bar' ;
+ }
+};
+
+
\ No newline at end of file
diff --git a/docs/row-select-props.html b/docs/row-select-props.html
new file mode 100644
index 000000000..50b55c414
--- /dev/null
+++ b/docs/row-select-props.html
@@ -0,0 +1,305 @@
+Row Selection Props · react-bootstrap-table2 Following we list all props for selectRow
props
+const selectRow = {
+ mode : 'checkbox' ,
+ ...
+});
+
+<BootstrapTable selectRow ={ selectRow } ... />
+
+ Required
+
+ Optional
+
+
+ selectRow.mode - [String]
+Specifying the selection way for single(radio)
or multiple(checkbox)
. If radio
was assigned, there will be a radio button in the selection column; otherwise, the checkbox
instead.
+ Available values
+
+Following is a quick example for single selection:
+const selectRow = {
+ mode : 'radio'
+};
+
+<BootstrapTable
+ keyField ='id'
+ data ={ products }
+ columns ={ columns }
+ selectRow ={ selectRowProp }
+/>
+
+ selectRow.selected - [Array]
+selectRow.selected
allow you have default selections on table.
+const selectRow = {
+ mode : 'checkbox' ,
+ selected : [1 , 3 ]
+};
+
+ selectRow.style - [Object | Function]
+selectRow.style
allow you to have custom style on selected rows:
+const selectRow = {
+ mode : 'checkbox' ,
+ style : { background : 'red' }
+};
+
+If you wanna more flexible customization, selectRow.style
also accept a function:
+const selectRow = {
+ mode : 'checkbox' ,
+ style : (row, rowIndex ) => { return ...; }
+};
+
+ selectRow.classes - [String | Function]
+selectRow.classes
allow you to add css class on selected rows:
+const selectRow = {
+ mode : 'checkbox' ,
+ classes : 'custom-class'
+};
+
+If you wanna more flexible customization, selectRow.classes
also accept a function:
+const selectRow = {
+ mode : 'checkbox' ,
+ classes : (row, rowIndex ) => { return ...; }
+};
+
+ selectRow.bgColor - [String | Function]
+A quick way to specify the background color when row is selected
+const selectRow = {
+ mode : 'checkbox' ,
+ bgColor : 'red'
+};
+
+There's also a more good way to custom it:
+const selectRow = {
+ mode : 'checkbox' ,
+ bgColor : (row, rowIndex ) => {
+ return ....;
+ }
+};
+
+ selectRow.nonSelectable - [Array]
+This prop allow you to restrict some rows which can not be selected by user. selectRow.nonSelectable
accept an rowkeys array.
+const selectRow = {
+ mode : 'checkbox' ,
+ nonSelectable : [1 , 3 ,5 ]
+};
+
+ selectRow.nonSelectableStyle - [Object | Function]
+This prop allow you to customize the non selectable rows. selectRow.nonSelectableStyle
accepts an style object
+and a callback function for more flexible customization.
+ Style Object
+const selectRow = {
+ mode : 'checkbox' ,
+ nonSelectable : [1 , 3 ,5 ],
+ nonSelectableStyle : { backgroundColor : 'gray' }
+};
+
+ Callback Function
+const selectRow = {
+ mode : 'checkbox' ,
+ nonSelectable : [1 , 3 ,5 ],
+ nonSelectableStyle : (row, rowIndex ) => { return ...; }
+};
+
+ selectRow.nonSelectableClasses - [String | Function]
+This prop allow you to set a custom class for the non selectable rows, or use a callback function for more
+flexible customization
+ String
+const selectRow = {
+ mode : 'checkbox' ,
+ nonSelectable : [1 , 3 ,5 ],
+ nonSelectableClasses : 'my-class'
+};
+
+ Callback Function
+const selectRow = {
+ mode : 'checkbox' ,
+ nonSelectable : [1 , 3 ,5 ],
+ nonSelectableClasses : (row, rowIndex ) => { return ...; }
+};
+
+ selectRow.clickToSelect - [Bool]
+Allow user to select row by clicking on the row.
+const selectRow = {
+ mode : 'checkbox' ,
+ clickToSelect : true
+};
+
+
+Note: When you also enable cellEdit , the selectRow.clickToSelect
will deactivate the functionality of cell editing. If you want to click on row to select row and edit cell simultaneously, you are suppose to enable selectRow.clickToEdit
+
+ selectRow.clickToExpand - [Bool]
+Default is false, enable it will let user able to expand and select row when user clicking on the row.
+const selectRow = {
+ mode : 'checkbox' ,
+ clickToExpand : true
+};
+
+ selectRow.clickToEdit - [Bool]
+Able to click to edit cell and select row at the same time.
+const selectRow = {
+ mode : 'checkbox' ,
+ clickToSelect : true
+ clickToEdit: true
+};
+
+ selectRow.onSelect - [Function]
+This callback function will be called when a row is select/unselect and pass following four arguments:
+row
, isSelect
, rowIndex
and e
.
+const selectRow = {
+ mode : 'checkbox' ,
+ onSelect : (row, isSelect, rowIndex, e ) => {
+
+ }
+};
+
+
+If you want to reject current select action, just return false
:
+
+const selectRow = {
+ mode : 'checkbox' ,
+ onSelect : (row, isSelect, rowIndex, e ) => {
+ if (SOME_CONDITION) {
+ return false ;
+ }
+ }
+};
+
+ selectRow.onSelectAll - [Function]
+This callback function will be called when select/unselect all and it only work when you configure selectRow.mode
as checkbox
.
+const selectRow = {
+ mode : 'checkbox' ,
+ onSelectAll : (isSelect, rows, e ) => {
+
+ }
+};
+
+
+If you want to control the final selection result, just return a row key array:
+
+const selectRow = {
+ mode : 'checkbox' ,
+ onSelectAll : (isSelect, rows, e ) => {
+ if (isSelect && SOME_CONDITION) {
+ return [1 , 3 , 4 ];
+ }
+ }
+};
+
+ selectRow.selectColumnPosition - [String]
+Default is left
. You can give this as right
for rendering selection column in the right side.
+const selectRow = {
+ mode : 'checkbox' ,
+ selectColumnPosition : 'right'
+};
+
+ selectRow.hideSelectColumn - [Bool]
+Default is false
, if you don't want to have a selection column, give this prop as true
+const selectRow = {
+ mode : 'radio' ,
+ hideSelectColumn : true ,
+ clickToSelect : true ,
+ bgColor : 'red'
+};
+
+ selectRow.hideSelectAll - [Bool]
+Default is false
, if you don't want to render the select all checkbox ine the header of selection column, give this prop as true
!
+const selectRow = {
+ mode : 'checkbox' ,
+ hideSelectAll : true
+};
+
+ selectRow.selectionRenderer - [Function]
+Provide a callback function which allow you to custom the checkbox/radio box. This callback only have one argument which is an object and contain following properties:
+const selectRow = {
+ mode : 'checkbox' ,
+ selectionRenderer : ({ mode, checked, disabled } ) => (
+
+ )
+};
+
+ selectRow.selectionHeaderRenderer - [Function]
+Provide a callback function which allow you to custom the checkbox/radio box in the selection header column. This callback only have one argument which is an object and contain following properties:
+const selectRow = {
+ mode : 'checkbox' ,
+ selectionHeaderRenderer : ({ mode, checked, indeterminate } ) => (
+
+ )
+};
+
+ selectRow.headerColumnStyle - [Object | Function]
+A way to custome the selection header cell. headerColumnStyle
not only accept a simple style object but also a callback function for more flexible customization:
+ Style Object
+const selectRow = {
+ mode : 'checkbox' ,
+ headerColumnStyle : { backgroundColor : 'blue' }
+};
+
+ Callback Function
+const selectRow = {
+ mode : 'checkbox' ,
+ headerColumnStyle : (status ) => (
+
+ return { backgroundColor : 'blue' };
+ )
+};
+
+ selectRow.selectColumnStyle - [Object | Function]
+A way to custome the selection cell. selectColumnStyle
not only accept a simple style object but also a callback function for more flexible customization:
+ Style Object
+const selectRow = {
+ mode : 'checkbox' ,
+ selectColumnStyle : { backgroundColor : 'blue' }
+};
+
+ Callback Function
+If a callback function present, you can get below information to custom the selection cell:
+
+checked
: Whether current row is seleccted or not
+disabled
: Whether current row is disabled or not
+rowIndex
: Current row index
+rowKey
: Current row key
+
+const selectRow = {
+ mode : 'checkbox' ,
+ selectColumnStyle : ({
+ checked,
+ disabled,
+ rowIndex,
+ rowKey
+ }) => (
+
+ return { backgroundColor : 'blue' };
+ )
+};
+
+
\ No newline at end of file
diff --git a/docs/row-selection.md b/docs/row-selection.md
deleted file mode 100644
index 6262be47c..000000000
--- a/docs/row-selection.md
+++ /dev/null
@@ -1,187 +0,0 @@
-
-# Row selection
-`react-bootstrap-table2` supports the row selection feature. By passing prop `selectRow` to enable row selection. When you enable this feature, `react-bootstrap-table2` will append a new selection column at first.
-
-
-## Available properties
-
-The following are available properties in `selectRow`:
-
-#### Required
-* [mode (**required**)](#mode)
-* [style](#style)
-* [classes)](#classes)
-* [bgColor](#bgColor)
-* [nonSelectable)](#nonSelectable)
-* [clickToSelect)](#clickToSelect)
-* [clickToEdit](#clickToEdit)
-* [onSelect](#onSelect)
-* [onSelectAll](#onSelectAll)
-* [hideSelectColumn](#hideSelectColumn)
-
-#### Optional
-
-## selectRow.mode - [String]
-
-Specifying the selection way for `single(radio)` or `multiple(checkbox)`. If `radio` was assigned, there will be a radio button in the selection column; otherwise, the `checkbox` instead.
-
-#### values
-* `radio`
-* `checkbox`
-
-#### examples
-
-```js
-const selectRow = {
- mode: 'radio' // single row selection
-};
-
-```
-
-```js
-const selectRow = {
- mode: 'checkbox' // multiple row selection
-};
-
-
-```
-
-## selectRow.style - [Object | Function]
-`selectRow.style` allow you to have custom style on selected rows:
-
-```js
-const selectRow = {
- mode: 'checkbox',
- style: { background: 'red' }
-};
-```
-
-If you wanna more flexible customization, `selectRow.style` also accept a function:
-
-```js
-const selectRow = {
- mode: 'checkbox',
- style: (row, rowIndex) => { return ...; }
-};
-```
-
-## selectRow.classes - [String | Function]
-`selectRow.classes` allow you to add css class on selected rows:
-
-```js
-const selectRow = {
- mode: 'checkbox',
- classes: 'custom-class'
-};
-```
-
-If you wanna more flexible customization, `selectRow.classes` also accept a function:
-
-```js
-const selectRow = {
- mode: 'checkbox',
- classes: (row, rowIndex) => { return ...; }
-};
-```
-
-## selectRow.bgColor - [String | Function]
-The backgroud color when row is selected
-
-```js
-const selectRow = {
- mode: 'checkbox',
- bgColor: 'red'
-};
-```
-
-There's also a more good way to custom it:
-
-```js
-const selectRow = {
- mode: 'checkbox',
- bgColor: (row, rowIndex) => {
- return ....; // return a color code
- }
-};
-```
-
-## selectRow.nonSelectable - [Array]
-This prop allow you to restrict some rows which can not be selected by user. `selectRow.nonSelectable` accept an rowkeys array.
-
-```js
-const selectRow = {
- mode: 'checkbox',
- nonSelectable: [1, 3 ,5]
-};
-```
-
-## selectRow.clickToSelect - [Bool]
-Able to select row when clicking on row.
-
-```js
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
-};
-```
-
-> Note: if you also enable [cellEdit](./cell-edit.md), the `selectRow.clickToSelect` will deactivate the functionality of cell editing
-> If you want to click on row to select row and edit cell simultaneously, you are suppose to enable [`selectRow.clickToEdit`](#clickToEdit)
-
-## selectRow.clickToEdit - [Bool]
-Able to click to edit cell and select row
-
-```js
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
- clickToEdit: true
-};
-```
-
-## selectRow.onSelect - [Function]
-This callback function will be called when a row is select/unselect and pass following three arguments:
-`row`, `isSelect` and `rowIndex`.
-
-```js
-const selectRow = {
- mode: 'checkbox',
- onSelect: (row, isSelect, rowIndex) => {
- // ...
- }
-};
-```
-
-## selectRow.onSelectAll - [Function]
-This callback function will be called when select/unselect all and it only work when you configure [`selectRow.mode`](#mode) as `checkbox`.
-
-```js
-const selectRow = {
- mode: 'checkbox',
- onSelectAll: (isSelect, results) => {
- // ...
- }
-};
-```
-
-## selectRow.hideSelectColumn - [Bool]
-Default is `false`, if you don't want to have a selection column, give this prop as `true`
-
-```js
-const selectRow = {
- mode: 'radio',
- hideSelectColumn: true,
- clickToSelect: true,
- bgColor: 'red'
-};
-```
diff --git a/docs/search-props.html b/docs/search-props.html
new file mode 100644
index 000000000..59c1487c9
--- /dev/null
+++ b/docs/search-props.html
@@ -0,0 +1,81 @@
+Search Props · react-bootstrap-table2 Table search in one of features supported by react-bootstrap-table2-toolkit
. By passing search
prop to ToolkitProvider
for enabling this functionality.
+ Required
+N/A
+ Optional
+
+
+ search.searchFormatted - [Bool]
+If you want to search on the formatted data, you are supposed to enable this prop. react-bootstrap-table2
will check if you define the column.formatter when doing search.
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search={ {
+ searchFormatted: true
+ } }
+>
+ // ...
+</ToolkitProvider>
+
+ search.defaultSearch - [String]
+Accept a string that will be used for default searching when first time table render.
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search={ {
+ defaultSearch: 'search something here'
+ } }
+>
+ // ...
+</ToolkitProvider>
+
+ search.onColumnMatch - [Function]
+Acccpt a function which will be called when table try to match every cells when search happening. This function accept an object like below example:
+function onColumnMatch({
+ searchText,
+ value,
+ column,
+ row
+}) {
+ // implement your custom match logic on every cell value
+}
+ <ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search={ {
+ onColumnMatch
+ } }
+>
+ // ...
+</ToolkitProvider>
+
+
+Notes: You have to return true
when your match logic is positive and vice versa.
+
+ search.afterSearch - [Function]
+After search done, this callback function will be called with newest result.
+<ToolkitProvider
+ keyField="id"
+ data={ products }
+ columns={ columns }
+ search={ {
+ afterSearch: (newResult) => console.log(newResult)
+ } }
+>
+ // ...
+</ToolkitProvider>
+
+
\ No newline at end of file
diff --git a/docs/table-props.html b/docs/table-props.html
new file mode 100644
index 000000000..d77dc8da8
--- /dev/null
+++ b/docs/table-props.html
@@ -0,0 +1,314 @@
+BootstrapTable Props · react-bootstrap-table2 Required
+
+ Optional
+
+
+ keyField(required ) - [String]
+Tells react-bootstrap-table2
which column of the data is unique. This should be the name of a property that is unique for each item in your dataset
+ data(required ) - [Array]
+Provides data for your table. It accepts a single Array object.
+Each item in this array is an object that represents a row in the table. Each "Row" object should have a key-value pair for each column in the table, whose key matches that column's dataField value.
+For example, if your column definitions look like:
+columns = [
+ { dataField : 'id' , text : 'Id' },
+ { dataField : 'name' , text : 'Name' },
+ { dataField : 'animal' , text : 'Animal' },
+]
+
+Then your data might look like:
+data = [
+ { id : 1 , name : 'George' , animal : 'Monkey' }
+ { id : 2 , name : 'Jeffrey' , animal : 'Giraffe' }
+ { id : 3 , name : 'Alice' , animal : 'Giraffe' }
+ { id : 4 , name : 'Alice' , animal : 'Tiger' }
+]
+
+And your "keyField" would be id
+ columns(required ) - [Object]
+Accepts a single Array object, please see columns definition for more detail.
+ remote - [Bool | Object]
+Default is false
, if enable remote
, you are supposed to be handle all the table change events, like: pagination, insert, filtering etc.
+This is a chance that you can connect to your remote server or database to manipulate your data.
+For flexibility reason, you can control what functionality should be handled on remote via a object return:
+remote={ {
+ filter : true ,
+ pagination : false ,
+ sort : false ,
+ cellEdit : false
+} }
+
+In above case, only column filter will be handled on remote because we enable it by giving true
.
+
+Note: when remote is enable, you are suppose to give onTableChange
prop on BootstrapTable
+It's the only way to communicate to your remote server and update table states.
+
+A special case for remote pagination:
+remote={ { pagination : true , filter : false , sort : false } }
+
+There is a special case for remote pagination, even you only specified the pagination need to handle as remote, react-bootstrap-table2
will handle all the table changes(filter, sort etc) as remote mode, because react-bootstrap-table2
only know the data of current page, but filtering, searching or sort need to work on overall data.
+ bootstrap4 - [Bool]
+true
to indicate your bootstrap version is 4. Default version is 3.
+ noDataIndication - [Function]
+noDataIndication
should be a callback function which return anything that will be showed in the table when data is empty .
+ loading - [Bool]
+Telling if table is loading or not, for example: waiting data loading, filtering etc. It's only valid when remote
is enabled.
+When loading
is true
, react-bootstrap-table2
will attend to render a overlay on table via overlay
prop, if overlay
prop is not given, react-bootstrap-table2
will ignore the overlay rendering.
+ overlay - [Function]
+overlay
accept a factory function which should returning a higher order component. By default, react-bootstrap-table2-overlay
can be a good option for you:
+$ npm install react-bootstrap-table2-overlay
+
+import overlayFactory from 'react-bootstrap-table2-overlay' ;
+
+<BootstrapTable
+ data ={ data }
+ columns ={ columns }
+ loading ={ true } //only loading is true , react-bootstrap-table will render overlay
+ overlay ={ overlayFactory () }
+/>
+
+Actually, react-bootstrap-table2-overlay
is depends on react-loading-overlay
and overlayFactory
just a factory function and you can pass any props which available for react-loading-overlay
:
+overlay={ overlayFactory({ spinner : true , background : 'rgba(192,192,192,0.3)' }) }
+
+ caption - [String | Node]
+Same as HTML caption tag , you can set it as String or a React JSX.
+ striped - [Bool]
+Same as bootstrap .table-striped
class for adding zebra-stripes to a table.
+ bordered - [Bool]
+Same as bootstrap .table-bordered
class for adding borders to a table and table cells.
+ hover - [Bool]
+Same as bootstrap .table-hover
class for adding mouse hover effect (grey background color) on table rows.
+ condensed - [Bool]
+Same as bootstrap .table-condensed
class for making a table more compact by cutting cell padding in half.
+ id - [String]
+Customize id on table
element.
+ tabIndexCell - [Bool]
+Enable the tabIndex
attribute on <td>
element.
+ classes - [String]
+Customize class on table
element.
+ wrapperClasses - [String]
+Customize class on the outer element which wrap up the table
element.
+ headerClasses - [String]
+Customize class on the header row(tr
).
+ headerWrapperClasses - [String]
+Customize class on thead
.
+ bodyClasses - [String]
+Customize class on tbody
.
+ cellEdit - [Object]
+Makes table cells editable, please see cellEdit definition for more detail.
+ selectRow - [Object]
+Makes table rows selectable, please see selectRow definition for more detail.
+ rowStyle - [Object | Function]
+Custom the style of table rows:
+<BootstrapTable data={ data } columns={ columns } rowStyle={ { backgroundColor : 'red' } } />
+
+This prop also accept a callback function for flexible to custom row style:
+const rowStyle = (row, rowIndex ) => {
+ return { ... };
+};
+
+<BootstrapTable data ={ data } columns ={ columns } rowStyle ={ rowStyle } />
+
+ rowClasses - [String | Function]
+Custom the style of table rows:
+<BootstrapTable data={ data } columns={ columns } rowClasses="custom-row-class" />
+
+This prop also accept a callback function for flexible to custom row style:
+const rowClasses = (row, rowIndex ) => {
+ return 'custom-row-class' ;
+};
+
+<BootstrapTable data ={ data } columns ={ columns } rowClasses ={ rowClasses } />
+
+ rowEvents - [Object]
+Custom the events on row:
+const rowEvents = {
+ onClick : (e, row, rowIndex ) => {
+ ....
+ }
+};
+<BootstrapTable data ={ data } columns ={ columns } rowEvents ={ rowEvents } />
+
+ hiddenRows - [Array]
+Hide rows, this props accept an array of row keys:
+const hiddenRows = [1 , 4 ];
+<BootstrapTable data ={ data } columns ={ columns } hiddenRows ={ hiddenRows } />
+
+ sort - [Object]
+Two cases you probably need to configure sort
prop:
+ Manage sorting state
+You can give dataField
and order
to specify the sorting state in table, For example
+<BootstrapTable sort={ { dataField : 'price' , order : 'asc' } }>
+
+ One-time sorting configuration
+In earily version, we only can configure sortCaret
and sortFunc
per column. But they are same in most of cases.
+So here we give you a chance to just setup these props in one time.
+<BootstrapTable sort={ {
+ sortCaret : ...
+ sortFunc: ...
+} }>
+
+ defaultSorted - [Array]
+defaultSorted
accept an object array which allow you to define the default sort columns when first render.
+const defaultSorted = [{
+ dataField : 'name' ,
+ order: 'desc'
+}];
+
+ defaultSortDirection - [String]
+Default sort direction when user click on header column at first time, available value is asc
and desc
. Default is desc
.
+ pagination - [Object]
+pagination
allow user to render a pagination panel on the bottom of table. But pagination functionality is separated from core of react-bootstrap-table2
so that you are suppose to install react-bootstrap-table2-paginator
additionally.
+$ npm install react-bootstrap-table2-paginator --save
+
+After installation of react-bootstrap-table2-paginator
, you can enable pagination on react-bootstrap-table2
easily:
+import paginationFactory from 'react-bootstrap-table2-paginator' ;
+
+
+
+<BootstrapTable data={ data } columns={ columns } pagination={ paginationFactory() } />
+
+paginationFactory
is a function actually and allow to pass some pagination options, following we list all the available options:
+paginationFactory({
+ page,
+ sizePerPage,
+ totalSize,
+ pageStartIndex: 0 ,
+ paginationSize: 3 ,
+ showTotal: true ,
+ sizePerPageList: [ {
+ text : '5' , value : 5
+ }, {
+ text : '10' , value : 10
+ }, {
+ text : 'All' , value : products.length
+ } ],
+ withFirstAndLast: false ,
+ alwaysShowAllBtns: true ,
+ firstPageText: 'First' ,
+ prePageText: 'Prev' ,
+ nextPageText: 'Next' ,
+ lastPageText: 'Last' ,
+ nextPageTitle: 'Go to next' ,
+ prePageTitle: 'Go to previous' ,
+ firstPageTitle: 'Go to first' ,
+ lastPageTitle: 'Go to last' ,
+ hideSizePerPage: true ,
+ hidePageListOnlyOnePage: true ,
+ onPageChange: (page, sizePerPage ) => {},
+ onSizePerPageChange: (sizePerPage, page ) => {},
+ paginationTotalRenderer: (from , to, size ) => { ... }
+})
+
+ filter - [Object]
+filter
allows users to filter data by columns. For more information, please navigate to filter-props .
+Getting Started
+$ npm install react-bootstrap-table2-filter
+
+After installing react-bootstrap-table2-filter
, you could easily enable the functionality of filter
.
+Example
+import BootstrapTable from 'react-bootstrap-table-next' ;
+import filterFactory, { textFilter } from 'react-bootstrap-table2-filter' ;
+
+const columns = [{
+ dataField : 'id' ,
+ text : 'Product ID'
+}, {
+ dataField : 'name' ,
+ text : 'Product Name'
+}, {
+ dataField : 'price' ,
+ text : 'Product Price' ,
+ filter : textFilter()
+}];
+
+<BootstrapTable keyField ='id' data ={ products } columns ={ columns } filter ={ filterFactory () } />
+
+ filterPosition - [String]
+Available value is inline
, top
and bottom
, default is inline
. This prop decide where react-bootstrap-table
render column filter.
+ onTableChange - [Function]
+This callback function will be called when remote
enabled only.
+const onTableChange = (type, newState ) => {
+
+}
+<BootstrapTable data={ data } columns={ columns } onTableChange={ onTableChange } />
+
+There's only two arguments will be passed to onTableChange
: type
and newState
:
+type
is tell you what kind of functionality to trigger this table's change: available values at the below:
+
+filter
+pagination
+sort
+cellEdit
+
+Following is a all available properties in newState
object:
+{
+ page,
+ sizePerPage,
+ sortField,
+ sortOrder,
+ filters,
+ data,
+ cellEdit: {
+ rowId,
+ dataField,
+ newValue
+ }
+}
+
+ onDataSizeChange - [Function]
+This callback function will be called only when data size change by search/filter etc. This function have one argument which is an object contains below props:
+
+dataSize
: The new data size
+
+handleDataChange = ({ dataSize } ) => {
+ this .setState({ rowCount : dataSize });
+}
+
+<BootstrapTable
+ onDataSizeChange={ handleDataChange }
+ ....
+/>
+
+
\ No newline at end of file
diff --git a/docs/toolkits-getting-started.html b/docs/toolkits-getting-started.html
new file mode 100644
index 000000000..0fbd8c97d
--- /dev/null
+++ b/docs/toolkits-getting-started.html
@@ -0,0 +1,61 @@
+Getting Started · react-bootstrap-table2 Introduction
+react-bootstrap-table2
support following features in react-bootstrap-table2-toolkit
package:
+
+Export CSV
+Table Search
+Column Toggle
+
+ Installation
+$ npm install react-bootstrap-table2-toolkit --save
+
+ Add CSS
+
+require ('react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css' );
+
+
+import 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css' ;
+
+ Usage
+react-bootstrap-table2-toolkit
default give you a react context wrapper: ToolkitProvider
. When you use any toolkit functionalities, you are supposed to render toolkit component and BootstrapTable
as the children of ToolkitProvider
:
+import ToolkitProvider from 'react-bootstrap-table2-toolkit' ;
+
+
+<ToolkitProvider
+ keyField ="id"
+ data ={ products }
+ columns ={ columns }
+>
+ {
+ props =>
+ <BootstrapTable { ...props.baseProps } />
+ }
+</ToolkitProvider >
+
+In addition, You have to move following required props from BootstraTable
to ToolkitProvider
and inject them to BootstrapTable
from the baseProps
provided by ToolkitProvider
:
+
+ Additional props on ToolkitProvider
+
+search : For enabling search.
+exportCSV : For enabling export CSV.
+columnToggle : For enabling column toggle.
+
+ Available children props
+ToolkitProvider
will pass following props to the childrens:
+
+baseProps
: It have the basic props from ToolkitProvider
and also contain few internal data.
+searchProps
: props for search component.
+csvProps
: props for export csv component.
+columnToggleProps
: props for column toggle component.
+
+
\ No newline at end of file
diff --git a/docs/usage.html b/docs/usage.html
new file mode 100644
index 000000000..d059745ab
--- /dev/null
+++ b/docs/usage.html
@@ -0,0 +1,3 @@
+document number 2 · react-bootstrap-table2
\ No newline at end of file
diff --git a/en/help.html b/en/help.html
new file mode 100644
index 000000000..58ca55ad7
--- /dev/null
+++ b/en/help.html
@@ -0,0 +1,7 @@
+react-bootstrap-table2 · Next Generation of react-bootstrap-table This project is maintained by a dedicated group of people .
\ No newline at end of file
diff --git a/en/index.html b/en/index.html
new file mode 100644
index 000000000..f9140b595
--- /dev/null
+++ b/en/index.html
@@ -0,0 +1,9 @@
+react-bootstrap-table2 · Next Generation of react-bootstrap-table react-bootstrap-table2Next Generation of react-bootstrap-table Sortable, Row Selection, Cell Editor, Row Expand, Column Filter Pagination etc.
+Configurable and customizable table
+Satisfy for Redux/Mobx or any other state management tool.
+Intuitive to use. Compatible for Bootstrap 3 and 4. Better than legacy react-bootstrap-table!!
+
\ No newline at end of file
diff --git a/en/users.html b/en/users.html
new file mode 100644
index 000000000..8a39542b2
--- /dev/null
+++ b/en/users.html
@@ -0,0 +1 @@
+react-bootstrap-table2 · Next Generation of react-bootstrap-table Who's Using This? This project is used by many folks
Are you using this project?
Add your company
\ No newline at end of file
diff --git a/enzyme-setup.js b/enzyme-setup.js
deleted file mode 100644
index e952b30e8..000000000
--- a/enzyme-setup.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import Adapter from 'enzyme-adapter-react-16';
-import { configure } from 'enzyme';
-
-const configureEnzyme = () => {
- configure({ adapter: new Adapter() });
-};
-
-configureEnzyme();
diff --git a/help.html b/help.html
new file mode 100644
index 000000000..14a53414a
--- /dev/null
+++ b/help.html
@@ -0,0 +1,7 @@
+react-bootstrap-table2 · Next Generation of react-bootstrap-table This project is maintained by a dedicated group of people .
\ No newline at end of file
diff --git a/img/.DS_Store b/img/.DS_Store
new file mode 100644
index 000000000..6baf03686
Binary files /dev/null and b/img/.DS_Store differ
diff --git a/img/docs/basic-sort-caret.png b/img/docs/basic-sort-caret.png
new file mode 100644
index 000000000..246f97d2e
Binary files /dev/null and b/img/docs/basic-sort-caret.png differ
diff --git a/img/favicon.ico b/img/favicon.ico
new file mode 100644
index 000000000..8fc5cecac
Binary files /dev/null and b/img/favicon.ico differ
diff --git a/img/icon/bulb.svg b/img/icon/bulb.svg
new file mode 100644
index 000000000..3861a547d
--- /dev/null
+++ b/img/icon/bulb.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/img/icon/store.svg b/img/icon/store.svg
new file mode 100644
index 000000000..cecd62e71
--- /dev/null
+++ b/img/icon/store.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/img/icon/tool.svg b/img/icon/tool.svg
new file mode 100644
index 000000000..1ee229783
--- /dev/null
+++ b/img/icon/tool.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/img/language.svg b/img/language.svg
new file mode 100644
index 000000000..66195932a
--- /dev/null
+++ b/img/language.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/img/logo/hybrid-white-large.svg b/img/logo/hybrid-white-large.svg
new file mode 100644
index 000000000..e63f010b1
--- /dev/null
+++ b/img/logo/hybrid-white-large.svg
@@ -0,0 +1 @@
+logo color
\ No newline at end of file
diff --git a/img/logo/pure-color-square.svg b/img/logo/pure-color-square.svg
new file mode 100644
index 000000000..bc897b9e8
--- /dev/null
+++ b/img/logo/pure-color-square.svg
@@ -0,0 +1 @@
+logo square
\ No newline at end of file
diff --git a/img/react-bootstrap-table2-sample.png b/img/react-bootstrap-table2-sample.png
new file mode 100644
index 000000000..c3de25d36
Binary files /dev/null and b/img/react-bootstrap-table2-sample.png differ
diff --git a/index.html b/index.html
new file mode 100644
index 000000000..7b1841d14
--- /dev/null
+++ b/index.html
@@ -0,0 +1,9 @@
+react-bootstrap-table2 · Next Generation of react-bootstrap-table react-bootstrap-table2Next Generation of react-bootstrap-table Sortable, Row Selection, Cell Editor, Row Expand, Column Filter Pagination etc.
+Configurable and customizable table
+Satisfy for Redux/Mobx or any other state management tool.
+Intuitive to use. Compatible for Bootstrap 3 and 4. Better than legacy react-bootstrap-table!!
+
\ No newline at end of file
diff --git a/lerna.json b/lerna.json
deleted file mode 100644
index b34dd47c1..000000000
--- a/lerna.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "lerna": "2.0.0",
- "packages": [
- "packages/*"
- ],
- "version": "0.0.0"
-}
diff --git a/package.json b/package.json
deleted file mode 100644
index c4eb89916..000000000
--- a/package.json
+++ /dev/null
@@ -1,86 +0,0 @@
-{
- "name": "react-bootstrap-table2",
- "version": "0.0.1",
- "description": "Rebuilt for react-bootstrap-table",
- "main": "index.js",
- "scripts": {
- "postinstall": "lerna bootstrap",
- "start": "node -r babel-register ./node_modules/.bin/webpack-dev-server --config webpack.config.babel.js",
- "lint": "eslint ./packages --ext .js --ext .jsx --ignore-path .gitignore",
- "pretest": "yarn lint --cache",
- "test": "jest",
- "test:coverage": "jest --coverage",
- "test:watch": "jest --watch",
- "storybook": "cd ./packages/react-bootstrap-table2-example && yarn storybook"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/react-bootstrap-table/react-bootstrap-table2.git"
- },
- "author": "",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/react-bootstrap-table/react-bootstrap-table2/issues"
- },
- "homepage": "https://github.com/react-bootstrap-table/react-bootstrap-table2#readme",
- "devDependencies": {
- "babel-core": "6.25.0",
- "babel-eslint": "7.2.3",
- "babel-jest": "20.0.3",
- "babel-loader": "7.1.1",
- "babel-preset-es2015": "6.24.1",
- "babel-preset-react": "6.24.1",
- "babel-preset-stage-0": "6.24.1",
- "babel-register": "6.24.1",
- "css-loader": "0.28.1",
- "enzyme": "3.1.1",
- "enzyme-adapter-react-16": "1.0.4",
- "eslint": "4.5.0",
- "eslint-config-airbnb": "15.1.0",
- "eslint-loader": "1.9.0",
- "eslint-plugin-import": "2.7.0",
- "eslint-plugin-jsx-a11y": "5.1.1",
- "eslint-plugin-react": "7.2.1",
- "html-webpack-plugin": "2.30.1",
- "jest": "20.0.4",
- "jsdom": "11.2.0",
- "jsdom-global": "3.0.2",
- "lerna": "2.0.0",
- "node-sass": "4.5.3",
- "react-test-renderer": "16.0.0",
- "sass-loader": "6.0.6",
- "sinon": "3.2.1",
- "style-loader": "0.17.0",
- "webpack": "3.5.4",
- "webpack-dev-server": "2.7.1"
- },
- "dependencies": {
- "classnames": "2.2.5",
- "prop-types": "15.5.10",
- "react": "16.0.0",
- "react-dom": "16.0.0"
- },
- "peerDependencies": {
- "prop-types": "^15.0.0",
- "react": "^16.0.0",
- "react-dom": "^16.0.0"
- },
- "jest": {
- "collectCoverageFrom": [
- "packages/**/*.js"
- ],
- "roots": [
- "/packages"
- ],
- "setupFiles": [
- "/enzyme-setup.js"
- ],
- "modulePaths": [
- "/packages/react-bootstrap-table2"
- ],
- "testEnvironment": "node",
- "testMatch": [
- "**/test/**/*.test.js"
- ]
- }
-}
diff --git a/packages/react-bootstrap-table2-example/.storybook/addons.js b/packages/react-bootstrap-table2-example/.storybook/addons.js
deleted file mode 100644
index afebf4721..000000000
--- a/packages/react-bootstrap-table2-example/.storybook/addons.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
-
-import '@storybook/addon-actions/register';
-import '@storybook/addon-links/register';
-import '@storybook/addon-console';
diff --git a/packages/react-bootstrap-table2-example/.storybook/config.js b/packages/react-bootstrap-table2-example/.storybook/config.js
deleted file mode 100644
index f50d2461d..000000000
--- a/packages/react-bootstrap-table2-example/.storybook/config.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
-import React from 'react';
-import { configure, addDecorator } from '@storybook/react';
-import { withConsole } from '@storybook/addon-console';
-
-function loadStories() {
- require('stories');
-}
-
-const styles = {
- margin: '15px',
-};
-
-const componentDecorator = (story) => (
-
- { story() }
-
-);
-
-
-// prepend the story name to log messages
-addDecorator((storyFn, context) => withConsole()(storyFn)(context));
-
-addDecorator(componentDecorator);
-
-configure(loadStories, module);
diff --git a/packages/react-bootstrap-table2-example/.storybook/preview-head.html b/packages/react-bootstrap-table2-example/.storybook/preview-head.html
deleted file mode 100644
index edb92313b..000000000
--- a/packages/react-bootstrap-table2-example/.storybook/preview-head.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-example/.storybook/webpack.config.js b/packages/react-bootstrap-table2-example/.storybook/webpack.config.js
deleted file mode 100644
index 25f09d8fe..000000000
--- a/packages/react-bootstrap-table2-example/.storybook/webpack.config.js
+++ /dev/null
@@ -1,59 +0,0 @@
-const path = require('path');
-
-const sourcePath = path.join(__dirname, '../../react-bootstrap-table2/src');
-const paginationSourcePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/src');
-const overlaySourcePath = path.join(__dirname, '../../react-bootstrap-table2-overlay/src');
-const filterSourcePath = path.join(__dirname, '../../react-bootstrap-table2-filter/src');
-const sourceStylePath = path.join(__dirname, '../../react-bootstrap-table2/style');
-const paginationStylePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/style');
-const storyPath = path.join(__dirname, '../stories');
-const examplesPath = path.join(__dirname, '../examples');
-const srcPath = path.join(__dirname, '../src');
-const aliasPath = {
- examples: examplesPath,
- stories: storyPath,
- src: srcPath,
- components: path.join(srcPath, 'components'),
- utils: path.join(srcPath, 'utils'),
-};
-
-const loaders = [{
- enforce: 'pre',
- test: /\.js?$/,
- exclude: /node_modules/,
- include: [examplesPath, storyPath],
- loader: 'eslint-loader',
-}, {
- test: /\.js?$/,
- use: ['babel-loader'],
- exclude: /node_modules/,
- include: [sourcePath, paginationSourcePath, overlaySourcePath, filterSourcePath, storyPath],
-}, {
- test: /\.css$/,
- use: ['style-loader', 'css-loader'],
-}, {
- test: /\.scss$/,
- use: ['style-loader', 'css-loader', 'sass-loader'],
- include: [storyPath, sourceStylePath, paginationStylePath],
-}, {
- test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/,
- loader: 'url-loader?limit=100000',
-}];
-
-// Export a function. Accept the base config as the only param.
-module.exports = (storybookBaseConfig, configType) => {
- // configType has a value of 'DEVELOPMENT' or 'PRODUCTION'
- // You can change the configuration based on that.
- // 'PRODUCTION' is used when building the static version of storybook.
-
- // loaders
- loaders.forEach(value => {
- storybookBaseConfig.module.rules.push(value);
- })
-
- // alias
- storybookBaseConfig.resolve.alias = aliasPath;
-
- // Return the altered config
- return storybookBaseConfig;
-};
diff --git a/packages/react-bootstrap-table2-example/examples/basic/borderless-table.js b/packages/react-bootstrap-table2-example/examples/basic/borderless-table.js
deleted file mode 100644
index 5c424e891..000000000
--- a/packages/react-bootstrap-table2-example/examples/basic/borderless-table.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/basic/caption-table.js b/packages/react-bootstrap-table2-example/examples/basic/caption-table.js
deleted file mode 100644
index 7f84142c8..000000000
--- a/packages/react-bootstrap-table2-example/examples/basic/caption-table.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const CaptionElement = () => Component as Header ;
-
-
-
- } columns={ columns } />
-`;
-
-const Caption = () => Component as Header ;
-
-export default () => (
-
-
- } columns={ columns } />
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/basic/index.js b/packages/react-bootstrap-table2-example/examples/basic/index.js
deleted file mode 100644
index 91a658801..000000000
--- a/packages/react-bootstrap-table2-example/examples/basic/index.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js b/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js
deleted file mode 100644
index 44d8662f6..000000000
--- a/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-
-
-// Following is more customizable example
-
-function indication() {
- // return something here
-}
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/basic/striped-hover-condensed-table.js b/packages/react-bootstrap-table2-example/examples/basic/striped-hover-condensed-table.js
deleted file mode 100644
index 97b4879fc..000000000
--- a/packages/react-bootstrap-table2-example/examples/basic/striped-hover-condensed-table.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/blur-to-save-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/blur-to-save-table.js
deleted file mode 100644
index db6818c18..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/blur-to-save-table.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-class-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-class-table.js
deleted file mode 100644
index 34867004f..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-class-table.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- editCellClasses: 'editing-name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- editCellClasses: (cell, row, rowIndex, colIndex) =>
- (cell > 2101 ? 'editing-price-bigger-than-2101' : 'editing-price-small-than-2101')
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- editCellClasses: 'editing-name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- editCellClasses: (cell, row, rowIndex, colIndex) =>
- (cell > 2101 ? 'editing-price-bigger-than-2101' : 'editing-price-small-than-2101')
-}];
-
-const cellEdit = {
- mode: 'click'
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click'
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-hooks-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-hooks-table.js
deleted file mode 100644
index 24779fc9e..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-hooks-table.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint no-console: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const cellEdit = {
- mode: 'click',
- beforeSaveCell: (oldValue, newValue, row, column) => { console.log('Before Saving Cell!!'); },
- afterSaveCell: (oldValue, newValue, row, column) => { console.log('After Saving Cell!!'); }
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click',
- beforeSaveCell: (oldValue, newValue, row, column) => { console.log('Before Saving Cell!!'); },
- afterSaveCell: (oldValue, newValue, row, column) => { console.log('After Saving Cell!!'); }
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-style-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-style-table.js
deleted file mode 100644
index 2101bd33f..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-style-table.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- editCellStyle: {
- backgroundColor: '#20B2AA'
- }
-}, {
- dataField: 'price',
- text: 'Product Price',
- editCellStyle: (cell, row, rowIndex, colIndex) => {
- const backgroundColor = cell > 2101 ? '#00BFFF' : '#00FFFF';
- return { backgroundColor };
- }
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- editCellStyle: {
- backgroundColor: '#20B2AA'
- }
-}, {
- dataField: 'price',
- text: 'Product Price',
- editCellStyle: (cell, row, rowIndex, colIndex) => {
- const backgroundColor = cell > 2101 ? '#00BFFF' : '#00FFFF';
- return { backgroundColor };
- }
-}];
-
-const cellEdit = {
- mode: 'click'
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click'
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-validator-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-validator-table.js
deleted file mode 100644
index 6b31c5d5b..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-validator-table.js
+++ /dev/null
@@ -1,85 +0,0 @@
-import React from 'react';
-/* eslint no-unused-vars: 0 */
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- validator: (newValue, row, column) => {
- if (isNaN(newValue)) {
- return {
- valid: false,
- message: 'Price should be numeric'
- };
- }
- if (newValue < 2000) {
- return {
- valid: false,
- message: 'Price should bigger than 2000'
- };
- }
- return true;
- }
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- validator: (newValue, row, column) => {
- if (isNaN(newValue)) {
- return {
- valid: false,
- message: 'Price should be numeric'
- };
- }
- if (newValue < 2000) {
- return {
- valid: false,
- message: 'Price should bigger than 2000'
- };
- }
- return true;
- }
-}];
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true
-};
-export default () => (
-
-
Product Price should bigger than $2000
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-promise-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-promise-table.js
deleted file mode 100644
index c66e3bd97..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-promise-table.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint arrow-body-style: 0 */
-import React, { Component } from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator, sleep } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-class CellEditWithPromise extends Component {
- handleCellEditing = (rowId, dataField, newValue) => {
- return sleep(1000).then(() => {
- if (dataField === 'price' && (newValue < 2000 || isNaN(newValue))) {
- throw new Error('Product Price should bigger than $2000');
- }
- });
- }
-
- render() {
- const cellEdit = {
- mode: 'click',
- blurToSave: true,
- onUpdate: this.handleCellEditing
- };
-
- return (
-
-
- { sourceCode }
-
- );
- }
-}
-`;
-
-class CellEditWithPromise extends Component {
- handleCellEditing = (rowId, dataField, newValue) => {
- return sleep(1000).then(() => {
- if (dataField === 'price' && (newValue < 2000 || isNaN(newValue))) {
- throw new Error('Product Price should bigger than $2000');
- }
- });
- }
-
- render() {
- const cellEdit = {
- mode: 'click',
- blurToSave: true,
- onUpdate: this.handleCellEditing
- };
-
- return (
-
-
- { sourceCode }
-
- );
- }
-}
-
-export default CellEditWithPromise;
-
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-redux-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-redux-table.js
deleted file mode 100644
index 760c6d979..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-edit-with-redux-table.js
+++ /dev/null
@@ -1,212 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint react/prop-types: 0 */
-/* eslint arrow-body-style: 0 */
-/* eslint consistent-return: 0 */
-/* eslint no-class-assign: 0 */
-import React, { Component } from 'react';
-import thunk from 'redux-thunk';
-import { Provider, connect } from 'react-redux';
-import { createStore, applyMiddleware } from 'redux';
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-/////////////////////// Action Creator ///////////////////////
-const setErrorMessage = (errorMessage = null) => {
- return { type: 'SET_ERR_MESSAGE', errorMessage };
-};
-
-// Async Action, using redux-thunk
-const cellEditingAsync = (rowId, dataField, newValue) => {
- return (dispatch) => {
- setTimeout(() => {
- if (dataField === 'price' && (newValue < 2000 || isNaN(newValue))) {
- dispatch(setErrorMessage('Product Price should bigger than $2000'));
- } else {
- dispatch({ type: 'ADD_SUCCESS', rowId, dataField, newValue });
- }
- }, 1200);
- };
-};
-
-/////////////////////// Component ///////////////////////
-class CellEditWithRedux extends Component {
- // dispatch a async action
- handleCellEditing = (rowId, dataField, newValue) => {
- this.props.dispatch(cellEditingAsync(rowId, dataField, newValue));
- return false;
- }
-
- handleErrorMsgDisappear = () => {
- this.props.dispatch(setErrorMessage());
- }
-
- render() {
- const cellEdit = {
- mode: 'click',
- editing: this.props.cellEditing,
- errorMessage: this.props.errorMessage,
- onUpdate: this.handleCellEditing,
- onErrorMessageDisappear: this.handleErrorMsgDisappear
- };
-
- return (
-
-
- { sourceCode }
-
- );
- }
-}
-// connect
-CellEditWithRedux = connect(state => state)(CellEditWithRedux);
-
-/////////////////////// Reducer ///////////////////////
-// initial state object and simple reducers
-const initialState = {
- data: productsGenerator(),
- cellEditing: false,
- errorMessage: null
-};
-
-const reducers = (state, action) => {
- switch (action.type) {
- case 'ADD_SUCCESS': {
- const { rowId, dataField, newValue } = action;
- const data = [...state.data];
- const rowIndex = data.findIndex(r => r.id === rowId);
- data[rowIndex][dataField] = newValue;
- return {
- data,
- cellEditing: false,
- errorMessage: null
- };
- }
- case 'SET_ERR_MESSAGE': {
- const { errorMessage } = action;
- return {
- ...state,
- cellEditing: true,
- errorMessage
- };
- }
- default: {
- return { ...state };
- }
- }
-};
-
-/////////////////////// Index ///////////////////////
-const store = createStore(reducers, initialState, applyMiddleware(thunk));
-
-const Index = () => (
-
-
-
-);
-`;
-
-const setErrorMessage = (errorMessage = null) => {
- return { type: 'SET_ERR_MESSAGE', errorMessage };
-};
-
-// Async Action, using redux-thunk
-const cellEditingAsync = (rowId, dataField, newValue) => {
- return (dispatch) => {
- setTimeout(() => {
- if (dataField === 'price' && (newValue < 2000 || isNaN(newValue))) {
- dispatch(setErrorMessage('Product Price should bigger than $2000'));
- } else {
- dispatch({ type: 'ADD_SUCCESS', rowId, dataField, newValue });
- }
- }, 1200);
- };
-};
-
-class CellEditWithRedux extends Component {
- // dispatch a async action
- handleCellEditing = (rowId, dataField, newValue) => {
- this.props.dispatch(cellEditingAsync(rowId, dataField, newValue));
- return false;
- }
-
- handleErrorMsgDisappear = () => {
- this.props.dispatch(setErrorMessage());
- }
-
- render() {
- const cellEdit = {
- mode: 'click',
- editing: this.props.cellEditing,
- errorMessage: this.props.errorMessage,
- onUpdate: this.handleCellEditing,
- onErrorMessageDisappear: this.handleErrorMsgDisappear
- };
-
- return (
-
-
- { sourceCode }
-
- );
- }
-}
-// connect
-CellEditWithRedux = connect(state => state)(CellEditWithRedux);
-
-// initial state object and simple reducers
-const initialState = {
- data: productsGenerator(),
- cellEditing: false,
- errorMessage: null
-};
-
-const reducers = (state, action) => {
- switch (action.type) {
- case 'ADD_SUCCESS': {
- const { rowId, dataField, newValue } = action;
- const data = JSON.parse(JSON.stringify(state.data));
- const rowIndex = data.findIndex(r => r.id === rowId);
- data[rowIndex][dataField] = newValue;
- return {
- data,
- cellEditing: false,
- errorMessage: null
- };
- }
- case 'SET_ERR_MESSAGE': {
- const { errorMessage } = action;
- return {
- ...state,
- cellEditing: true,
- errorMessage
- };
- }
- default: {
- return { ...state };
- }
- }
-};
-
-const store = createStore(reducers, initialState, applyMiddleware(thunk));
-
-const Index = () => (
-
-
-
-);
-
-export default Index;
-
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-level-editable-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/cell-level-editable-table.js
deleted file mode 100644
index 331792a83..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/cell-level-editable-table.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- editable: (content, row, rowIndex, columnIndex) => content > 2101
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- editable: (content, row, rowIndex, columnIndex) => content > 2101
-}];
-
-const cellEdit = {
- mode: 'click'
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click'
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/click-to-edit-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/click-to-edit-table.js
deleted file mode 100644
index f48e6e4fa..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/click-to-edit-table.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const cellEdit = {
- mode: 'click'
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click'
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/column-level-editable-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/column-level-editable-table.js
deleted file mode 100644
index 02429114d..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/column-level-editable-table.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- editable: false
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
- // Product Name column can't be edit anymore
- editable: false
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/dbclick-to-edit-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/dbclick-to-edit-table.js
deleted file mode 100644
index c51a15575..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/dbclick-to-edit-table.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const cellEdit = {
- mode: 'dbclick'
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'dbclick'
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/cell-edit/row-level-editable-table.js b/packages/react-bootstrap-table2-example/examples/cell-edit/row-level-editable-table.js
deleted file mode 100644
index 99f177a70..000000000
--- a/packages/react-bootstrap-table2-example/examples/cell-edit/row-level-editable-table.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true,
- // Product ID: 0, 3 will be non-editable
- nonEditableRows: () => [0, 3]
-};
-
-
-`;
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true,
- nonEditableRows: () => [0, 3]
-};
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/column-filter/custom-filter-value.js b/packages/react-bootstrap-table2-example/examples/column-filter/custom-filter-value.js
deleted file mode 100644
index 55158e0ab..000000000
--- a/packages/react-bootstrap-table2-example/examples/column-filter/custom-filter-value.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { jobsGenerator } from 'utils/common';
-
-const jobs = jobsGenerator(5);
-
-const owners = ['Allen', 'Bob', 'Cat'];
-const types = ['Cloud Service', 'Message Service', 'Add Service', 'Edit Service', 'Money'];
-
-const columns = [{
- dataField: 'id',
- text: 'Job ID'
-}, {
- dataField: 'name',
- text: 'Job Name',
- filter: textFilter()
-}, {
- dataField: 'owner',
- text: 'Job Owner',
- filter: textFilter(),
- formatter: (cell, row) => owners[cell],
- filterValue: (cell, row) => owners[cell]
-}, {
- dataField: 'type',
- text: 'Job Type',
- filter: textFilter(),
- formatter: (cell, row) => types[cell],
- filterValue: (cell, row) => types[cell]
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-const owners = ['Allen', 'Bob', 'Cat'];
-const types = ['Cloud Service', 'Message Service', 'Add Service', 'Edit Service', 'Money'];
-const columns = [{
- dataField: 'id',
- text: 'Job ID'
-}, {
- dataField: 'name',
- text: 'Job Name',
- filter: textFilter()
-}, {
- dataField: 'owner',
- text: 'Job Owner',
- filter: textFilter(),
- formatter: (cell, row) => owners[cell],
- filterValue: (cell, row) => owners[cell]
-}, {
- dataField: 'type',
- text: 'Job Type',
- filter: textFilter(),
- filterValue: (cell, row) => types[cell]
-}];
-
-// shape of job: { id: 0, name: 'Job name 0', owner: 1, type: 3 }
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/column-filter/custom-text-filter.js b/packages/react-bootstrap-table2-example/examples/column-filter/custom-text-filter.js
deleted file mode 100644
index 84edd0be8..000000000
--- a/packages/react-bootstrap-table2-example/examples/column-filter/custom-text-filter.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* eslint no-console: 0 */
-import React from 'react';
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(8);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter({
- delay: 1000, // default is 500ms
- style: {
- backgroundColor: 'yellow'
- },
- className: 'test-classname',
- placeholder: 'Custom PlaceHolder',
- onClick: e => console.log(e)
- })
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter({
- delay: 1000, // default is 500ms
- style: {
- backgroundColor: 'yellow'
- },
- className: 'test-classname',
- placeholder: 'Custom PlaceHolder',
- onClick: e => console.log(e)
- })
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/column-filter/text-filter-default-value.js b/packages/react-bootstrap-table2-example/examples/column-filter/text-filter-default-value.js
deleted file mode 100644
index edbf0b7a8..000000000
--- a/packages/react-bootstrap-table2-example/examples/column-filter/text-filter-default-value.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react';
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(8);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter({
- defaultValue: '2103'
- })
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter({
- defaultValue: '2103'
- })
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/column-filter/text-filter-eq-comparator.js b/packages/react-bootstrap-table2-example/examples/column-filter/text-filter-eq-comparator.js
deleted file mode 100644
index d06217820..000000000
--- a/packages/react-bootstrap-table2-example/examples/column-filter/text-filter-eq-comparator.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from 'react';
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(8);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter({
- comparator: Comparator.EQ // default is Comparator.LIKE
- })
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter({
- comparator: Comparator.EQ
- })
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-
-`;
-
-export default () => (
-
-
Product Name filter apply Equal Comparator
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/column-filter/text-filter.js b/packages/react-bootstrap-table2-example/examples/column-filter/text-filter.js
deleted file mode 100644
index 03de391a6..000000000
--- a/packages/react-bootstrap-table2-example/examples/column-filter/text-filter.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import React from 'react';
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(8);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-align-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-align-table.js
deleted file mode 100644
index 3385a6ea7..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-align-table.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- align: 'center'
-}, {
- dataField: 'name',
- text: 'Product Name',
- align: (cell, row, rowIndex, colIndex) => {
- if (rowIndex % 2 === 0) return 'right';
- return 'left';
- }
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- align: 'center'
-}, {
- dataField: 'name',
- text: 'Product Name',
- align: (cell, row, rowIndex, colIndex) => {
- if (rowIndex % 2 === 0) return 'right';
- return 'left';
- }
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-attrs-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-attrs-table.js
deleted file mode 100644
index 044622595..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-attrs-table.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- attrs: { title: 'id column' }
-}, {
- dataField: 'name',
- text: 'Product Name',
- attrs: (cell, row, rowIndex, colIndex) => ({ 'data-test': `customized data ${rowIndex}` })
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- attrs: { title: 'id column' }
-}, {
- dataField: 'name',
- text: 'Product Name',
- attrs: (cell, row, rowIndex, colIndex) => ({ 'data-test': \`customized data \${rowIndex}\` })
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-class-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-class-table.js
deleted file mode 100644
index d1c6057e9..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-class-table.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- classes: 'demo-key-row'
-}, {
- dataField: 'name',
- text: 'Product Name',
- classes: (cell, row, rowIndex, colIndex) => {
- if (rowIndex % 2 === 0) return 'demo-row-even';
- return 'demo-row-odd';
- }
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- classes: 'demo-key-row'
-}, {
- dataField: 'name',
- text: 'Product Name',
- classes: (cell, row, rowIndex, colIndex) => {
- if (rowIndex % 2 === 0) return 'demo-row-even';
- return 'demo-row-odd';
- }
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-event-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-event-table.js
deleted file mode 100644
index 3403a21c7..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-event-table.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint no-alert: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- events: {
- onClick: () => alert('Click on Product ID field')
- }
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- events: {
- onClick: () => alert('Click on Product ID field')
- }
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
Try to Click on Product ID columns
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-format-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-format-table.js
deleted file mode 100644
index 6542af324..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-format-table.js
+++ /dev/null
@@ -1,72 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-function priceFormatter(cell, row) {
- if (row.onSale) {
- return (
- $ { cell } NTD(Sales!!)
- );
- }
-
- return (
- $ { cell } NTD
- );
-}
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- formatter: priceFormatter
-}];
-
-const sourceCode = `\
-function priceFormatter(cell, row) {
- if (row.onSale) {
- return (
-
- $ { cell } NTD(Sales!!)
-
- );
- }
-
- return (
- $ { cell } NTD
- );
-}
-
-const columns = [
-// omit...
-{
- dataField: 'price',
- text: 'Product Price',
- formatter: priceFormatter
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-format-with-extra-data-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-format-with-extra-data-table.js
deleted file mode 100644
index ba902f0b1..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-format-with-extra-data-table.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* eslint no-console: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(5, (value, index) => ({
- id: index,
- name: `User Name ${index}`,
- rank: Math.random() < 0.5 ? 'down' : 'up'
-}));
-
-function rankFormatter(cell, row, rowIndex, formatExtraData) {
- return (
-
- );
-}
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'rank',
- text: 'Rank',
- formatter: rankFormatter,
- formatExtraData: {
- up: 'glyphicon glyphicon-chevron-up',
- down: 'glyphicon glyphicon-chevron-down'
- }
-}];
-
-const sourceCode = `\
-function rankFormatter(cell, row, rowIndex, formatExtraData) {
- return (
-
- );
-}
-
-const columns = [
-// omit...
-{
- dataField: 'rank',
- text: 'Rank',
- formatter: rankFormatter,
- formatExtraData: {
- up: 'glyphicon glyphicon-chevron-up',
- down: 'glyphicon glyphicon-chevron-down'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-hidden-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-hidden-table.js
deleted file mode 100644
index 57f72d37a..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-hidden-table.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- hidden: true
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- hidden: true
-},
-// omit...
-];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-style-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-style-table.js
deleted file mode 100644
index c559317bd..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-style-table.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- style: {
- fontWeight: 'bold',
- fontSize: '18px'
- }
-}, {
- dataField: 'name',
- text: 'Product Name',
- style: (cell, row, rowIndex, colIndex) => {
- if (rowIndex % 2 === 0) {
- return {
- backgroundColor: '#81c784'
- };
- }
- return {
- backgroundColor: '#c8e6c9'
- };
- }
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- style: {
- fontWeight: 'bold',
- fontSize: '18px'
- }
-}, {
- dataField: 'name',
- text: 'Product Name',
- style: (cell, row, rowIndex, colIndex) => {
- if (rowIndex % 2 === 0) {
- return {
- backgroundColor: '#81c784'
- };
- }
- return {
- backgroundColor: '#c8e6c9'
- };
- }
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/column-title-table.js b/packages/react-bootstrap-table2-example/examples/columns/column-title-table.js
deleted file mode 100644
index e92d3df65..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/column-title-table.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- title: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- title: (cell, row, rowIndex, colIndex) => `this is custom title for ${cell}`
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- title: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- title: (cell, row, rowIndex, colIndex) => \`this is custom title for \${cell}\`
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/columns/nested-data-table.js b/packages/react-bootstrap-table2-example/examples/columns/nested-data-table.js
deleted file mode 100644
index 8876d0692..000000000
--- a/packages/react-bootstrap-table2-example/examples/columns/nested-data-table.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(5, (value, index) => ({
- id: index,
- name: `User Name ${index}`,
- phone: 21009831 + index,
- address: {
- city: 'New York',
- postCode: '1111-4512'
- }
-}));
-
-const columns = [{
- dataField: 'id',
- text: 'User ID'
-}, {
- dataField: 'name',
- text: 'User Name'
-}, {
- dataField: 'phone',
- text: 'Phone'
-}, {
- dataField: 'address.city',
- text: 'City'
-}, {
- dataField: 'address.postCode',
- text: 'PostCode'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'User ID'
-}, {
- dataField: 'name',
- text: 'User Name'
-}, {
- dataField: 'phone',
- text: 'Phone'
-}, {
- dataField: 'address.city',
- text: 'City'
-}, {
- dataField: 'address.postCode',
- text: 'PostCode'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-align-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-align-table.js
deleted file mode 100644
index 013a44385..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-align-table.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerAlign: 'center'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerAlign: (column, colIndex) => 'right'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerAlign: 'center'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerAlign: (column, colIndex) => 'right'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-attrs-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-attrs-table.js
deleted file mode 100644
index 4318fb6f7..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-attrs-table.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerAttrs: { title: 'ID header column' }
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerAttrs: (column, colIndex) => ({ 'data-test': `customized data ${colIndex}` })
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerAttrs: { title: 'ID header column' }
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerAttrs: (column, colIndex) => ({ 'data-test': \`customized data \${colIndex}\` })
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-class-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-class-table.js
deleted file mode 100644
index 031e2392b..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-class-table.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerClasses: 'demo-row-odd'
-}, {
- dataField: 'price',
- text: 'Product Price',
- headerClasses: (column, colIndex) => {
- if (colIndex % 2 === 0) return 'demo-row-even';
- return 'demo-row-odd';
- }
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerClasses: 'demo-row-odd'
-}, {
- dataField: 'price',
- text: 'Product Price',
- headerClasses: (column, colIndex) => {
- if (colIndex % 2 === 0) return 'demo-row-even';
- return 'demo-row-odd';
- }
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-event-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-event-table.js
deleted file mode 100644
index ca547ac5d..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-event-table.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint no-alert: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerEvents: {
- onClick: () => alert('Click on Product ID header column')
- }
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- events: {
- onClick: () => alert('Click on Product ID header column')
- }
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
Try to Click on Product ID header column
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-format-filter-sort-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-format-filter-sort-table.js
deleted file mode 100644
index 5acb1435b..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-format-filter-sort-table.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint react/prefer-stateless-function: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-function priceFormatter(column, colIndex, { sortElement, filterElement }) {
- return (
-
- { filterElement }
- { column.text }
- { sortElement }
-
- );
-}
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price',
- sort: true,
- filter: textFilter(),
- headerFormatter: priceFormatter
-}];
-
-const defaultSorted = [{
- dataField: 'name',
- order: 'desc'
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-// ...
-function priceFormatter(column, colIndex, { sortElement, filterElement }) {
- return (
-
- { filterElement }
- { column.text }
- { sortElement }
-
- );
-}
-
-const columns = [
-// omit...
-{
- dataField: 'price',
- text: 'Product Price',
- sort: true,
- filter: textFilter(),
- headerFormatter: priceFormatter
-}];
-
-
-`;
-
-export default class DefaultSortTable extends React.PureComponent {
- render() {
- return (
-
-
- { sourceCode }
-
- );
- }
-}
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-format-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-format-table.js
deleted file mode 100644
index ddc554bd1..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-format-table.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-function priceFormatter(column, colIndex) {
- return (
- $$ { column.text } $$
- );
-}
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price',
- headerFormatter: priceFormatter
-}];
-
-const sourceCode = `\
-function priceFormatter(column, colIndex) {
- return (
- $$ { column.text } $$
- );
-}
-
-const columns = [
-// omit...
-{
- dataField: 'price',
- text: 'Product Price',
- headerFormatter: priceFormatter
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-style-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-style-table.js
deleted file mode 100644
index 91e4b56bf..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-style-table.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerStyle: {
- backgroundColor: '#c8e6c9'
- }
-}, {
- dataField: 'price',
- text: 'Product Price',
- headerStyle: (column, colIndex) => {
- if (colIndex % 2 === 0) {
- return {
- backgroundColor: '#81c784'
- };
- }
- return {
- backgroundColor: '#c8e6c9'
- };
- }
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerStyle: {
- backgroundColor: '#c8e6c9'
- }
-}, {
- dataField: 'price',
- text: 'Product Price',
- headerStyle: (column, colIndex) => {
- if (colIndex % 2 === 0) {
- return {
- backgroundColor: '#81c784'
- };
- }
- return {
- backgroundColor: '#c8e6c9'
- };
- }
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/header-columns/column-title-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-title-table.js
deleted file mode 100644
index ac2b9b91b..000000000
--- a/packages/react-bootstrap-table2-example/examples/header-columns/column-title-table.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerTitle: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerTitle: (column, colIndex) => `this is custom title for ${column.text}`
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- headerTitle: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerTitle: (column, colIndex) => \`this is custom title for \${column.text}\`
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/loading-overlay/empty-table-overlay.js b/packages/react-bootstrap-table2-example/examples/loading-overlay/empty-table-overlay.js
deleted file mode 100644
index 6366f16d2..000000000
--- a/packages/react-bootstrap-table2-example/examples/loading-overlay/empty-table-overlay.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* eslint react/no-multi-comp: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-// ...
-const RemotePagination = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
- { sourceCode }
-
-);
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- data: products.slice(0, 10),
- sizePerPage: 10
- };
- }
-
- handleTableChange = ({ page, sizePerPage }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- this.setState(() => ({
- page,
- data: products.slice(currentIndex, currentIndex + sizePerPage),
- sizePerPage
- }));
- }, 2000);
- }
-
- render() {
- const { data, sizePerPage, page } = this.state;
- return (
-
- );
- }
-}
-`;
-
-const NoDataIndication = () => (
-
-);
-
-const Table = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
-
- }
- />
- { sourceCode }
-
-);
-
-Table.propTypes = {
- data: PropTypes.array.isRequired,
- page: PropTypes.number.isRequired,
- totalSize: PropTypes.number.isRequired,
- sizePerPage: PropTypes.number.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class EmptyTableOverlay extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- data: products.slice(0, 10),
- sizePerPage: 10
- };
- }
-
- handleTableChange = ({ page, sizePerPage }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- this.setState(() => ({
- page,
- data: products.slice(currentIndex, currentIndex + sizePerPage),
- sizePerPage
- }));
- }, 3000);
- this.setState(() => ({ data: [] }));
- }
-
- render() {
- const { data, sizePerPage, page } = this.state;
- return (
-
- );
- }
-}
-
-export default EmptyTableOverlay;
diff --git a/packages/react-bootstrap-table2-example/examples/loading-overlay/table-overlay.js b/packages/react-bootstrap-table2-example/examples/loading-overlay/table-overlay.js
deleted file mode 100644
index b0dca0482..000000000
--- a/packages/react-bootstrap-table2-example/examples/loading-overlay/table-overlay.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/* eslint react/no-multi-comp: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import overlayFactory from 'react-bootstrap-table2-overlay';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import overlayFactory from 'react-bootstrap-table2-overlay';
-
-// ...
-const RemotePagination = ({ loading, data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
- { sourceCode }
-
-);
-
-RemotePagination.propTypes = {
- data: PropTypes.array.isRequired,
- page: PropTypes.number.isRequired,
- loading: PropTypes.bool.isRequired,
- totalSize: PropTypes.number.isRequired,
- sizePerPage: PropTypes.number.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- loading: false,
- data: products.slice(0, 10),
- sizePerPage: 10
- };
- }
-
- handleTableChange = ({ page, sizePerPage }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- this.setState(() => ({
- page,
- loading: false,
- data: products.slice(currentIndex, currentIndex + sizePerPage),
- sizePerPage
- }));
- }, 3000);
- this.setState(() => ({ loading: true }));
- }
-
- render() {
- const { data, sizePerPage, page, loading } = this.state;
- return (
-
- );
- }
-}
-`;
-
-const RemotePagination = ({ loading, data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
- { sourceCode }
-
-);
-
-RemotePagination.propTypes = {
- data: PropTypes.array.isRequired,
- page: PropTypes.number.isRequired,
- loading: PropTypes.bool.isRequired,
- totalSize: PropTypes.number.isRequired,
- sizePerPage: PropTypes.number.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- loading: false,
- data: products.slice(0, 10),
- sizePerPage: 10
- };
- }
-
- handleTableChange = ({ page, sizePerPage }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- this.setState(() => ({
- page,
- loading: false,
- data: products.slice(currentIndex, currentIndex + sizePerPage),
- sizePerPage
- }));
- }, 3000);
- this.setState(() => ({ loading: true }));
- }
-
- render() {
- const { data, sizePerPage, page, loading } = this.state;
- return (
-
- );
- }
-}
-
-export default Container;
diff --git a/packages/react-bootstrap-table2-example/examples/pagination/custom-pagination.js b/packages/react-bootstrap-table2-example/examples/pagination/custom-pagination.js
deleted file mode 100644
index b9b2fdb6c..000000000
--- a/packages/react-bootstrap-table2-example/examples/pagination/custom-pagination.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/* eslint react/prefer-stateless-function: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-// ...
-
-const options = {
- paginationSize: 4,
- pageStartIndex: 0,
- // alwaysShowAllBtns: true, // Always show next and previous button
- // withFirstAndLast: false, // Hide the going to First and Last page button
- // hideSizePerPage: true, // Hide the sizePerPage dropdown always
- // hidePageListOnlyOnePage: true, // Hide the pagination list when only one page
- firstPageText: 'First',
- prePageText: 'Back',
- nextPageText: 'Next',
- lastPageText: 'Last',
- nextPageTitle: 'First page',
- prePageTitle: 'Pre page',
- firstPageTitle: 'Next page',
- lastPageTitle: 'Last page',
- sizePerPageList: [{
- text: '5', value: 5
- }, {
- text: '10', value: 10
- }, {
- text: 'All', value: products.length
- }] // A numeric array is also available. the purpose of above example is custom the text
-};
-
-
-`;
-const options = {
- paginationSize: 4,
- pageStartIndex: 0,
- // alwaysShowAllBtns: true // Always show next and previous button
- // withFirstAndLast: false // Hide the going to First and Last page button
- // hideSizePerPage: true, // Hide the sizePerPage dropdown always
- // hidePageListOnlyOnePage: true, // Hide the pagination list when only one page
- firstPageText: 'First',
- prePageText: 'Back',
- nextPageText: 'Next',
- lastPageText: 'Last',
- nextPageTitle: 'First page',
- prePageTitle: 'Pre page',
- firstPageTitle: 'Next page',
- lastPageTitle: 'Last page',
- sizePerPageList: [{
- text: '5', value: 5
- }, {
- text: '10', value: 10
- }, {
- text: 'All', value: products.length
- }] // A numeric array is also available. the purpose of above example is custom the text
-};
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/pagination/index.js b/packages/react-bootstrap-table2-example/examples/pagination/index.js
deleted file mode 100644
index 979d59baa..000000000
--- a/packages/react-bootstrap-table2-example/examples/pagination/index.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint react/prefer-stateless-function: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-// ...
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/pagination/pagination-hooks.js b/packages/react-bootstrap-table2-example/examples/pagination/pagination-hooks.js
deleted file mode 100644
index 3ff1b15f3..000000000
--- a/packages/react-bootstrap-table2-example/examples/pagination/pagination-hooks.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/* eslint react/prefer-stateless-function: 0 */
-/* eslint no-console: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-// ...
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const options = {
- onSizePerPageChange: (sizePerPage, page) => {
- console.log('Size per page change!!!');
- console.log('Newest size per page:' + sizePerPage);
- console.log('Newest page:' + page);
- },
- onPageChange: (page, sizePerPage) => {
- console.log('Page change!!!');
- console.log('Newest size per page:' + sizePerPage);
- console.log('Newest page:' + page);
- }
-};
-
-
-`;
-
-const options = {
- onSizePerPageChange: (sizePerPage, page) => {
- console.log('Size per page change!!!');
- console.log(`Newest size per page: ${sizePerPage}`);
- console.log(`Newest page: ${page}`);
- },
- onPageChange: (page, sizePerPage) => {
- console.log('Page change!!!');
- console.log(`Newest size per page: ${sizePerPage}`);
- console.log(`Newest page: ${page}`);
- }
-};
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/remote/remote-all.js b/packages/react-bootstrap-table2-example/examples/remote/remote-all.js
deleted file mode 100644
index c23d690e5..000000000
--- a/packages/react-bootstrap-table2-example/examples/remote/remote-all.js
+++ /dev/null
@@ -1,202 +0,0 @@
-/* eslint guard-for-in: 0 */
-/* eslint no-restricted-syntax: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter';
-// ...
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-const RemoteAll = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
- { sourceCode }
-
-);
-
-RemoteAll.propTypes = {
- data: PropTypes.array.isRequired,
- page: PropTypes.number.isRequired,
- totalSize: PropTypes.number.isRequired,
- sizePerPage: PropTypes.number.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- data: products.slice(0, 10),
- totalSize: products.length,
- sizePerPage: 10
- };
- this.handleTableChange = this.handleTableChange.bind(this);
- }
-
- handleTableChange = (type, { page, sizePerPage, filters }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- const result = products.filter((row) => {
- let valid = true;
- for (const dataField in filters) {
- const { filterVal, filterType, comparator } = filters[dataField];
-
- if (filterType === 'TEXT') {
- if (comparator === Comparator.LIKE) {
- valid = row[dataField].toString().indexOf(filterVal) > -1;
- } else {
- valid = row[dataField] === filterVal;
- }
- }
- if (!valid) break;
- }
- return valid;
- });
- this.setState(() => ({
- page,
- data: result.slice(currentIndex, currentIndex + sizePerPage),
- totalSize: result.length,
- sizePerPage
- }));
- }, 2000);
- }
-
- render() {
- const { data, sizePerPage, page } = this.state;
- return (
-
- );
- }
-}
-`;
-
-const RemoteAll = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
When remote.pagination
is enabled, the filtering,
- sorting and searching will also change to remote mode automatically
-
- { sourceCode }
-
-);
-
-RemoteAll.propTypes = {
- data: PropTypes.array.isRequired,
- page: PropTypes.number.isRequired,
- totalSize: PropTypes.number.isRequired,
- sizePerPage: PropTypes.number.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- data: products.slice(0, 10),
- totalSize: products.length,
- sizePerPage: 10
- };
- this.handleTableChange = this.handleTableChange.bind(this);
- }
-
- handleTableChange = (type, { page, sizePerPage, filters }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- const result = products.filter((row) => {
- let valid = true;
- for (const dataField in filters) {
- const { filterVal, filterType, comparator } = filters[dataField];
-
- if (filterType === 'TEXT') {
- if (comparator === Comparator.LIKE) {
- valid = row[dataField].toString().indexOf(filterVal) > -1;
- } else {
- valid = row[dataField] === filterVal;
- }
- }
- if (!valid) break;
- }
- return valid;
- });
- this.setState(() => ({
- page,
- data: result.slice(currentIndex, currentIndex + sizePerPage),
- totalSize: result.length,
- sizePerPage
- }));
- }, 2000);
- }
-
- render() {
- const { data, sizePerPage, page } = this.state;
- return (
-
- );
- }
-}
-
-export default Container;
diff --git a/packages/react-bootstrap-table2-example/examples/remote/remote-filter.js b/packages/react-bootstrap-table2-example/examples/remote/remote-filter.js
deleted file mode 100644
index d2b37b69b..000000000
--- a/packages/react-bootstrap-table2-example/examples/remote/remote-filter.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* eslint guard-for-in: 0 */
-/* eslint no-restricted-syntax: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-import BootstrapTable from 'react-bootstrap-table2';
-import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(17);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-const sourceCode = `\
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
-}, {
- dataField: 'name',
- text: 'Product Name',
- filter: textFilter()
-}, {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-
-`;
-
-const RemoteFilter = props => (
-
-
- { sourceCode }
-
-);
-
-RemoteFilter.propTypes = {
- data: PropTypes.array.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- data: products
- };
- }
-
- handleTableChange = (type, { filters }) => {
- setTimeout(() => {
- const result = products.filter((row) => {
- let valid = true;
- for (const dataField in filters) {
- const { filterVal, filterType, comparator } = filters[dataField];
-
- if (filterType === 'TEXT') {
- if (comparator === Comparator.LIKE) {
- valid = row[dataField].toString().indexOf(filterVal) > -1;
- } else {
- valid = row[dataField] === filterVal;
- }
- }
- if (!valid) break;
- }
- return valid;
- });
- this.setState(() => ({
- data: result
- }));
- }, 2000);
- }
-
- render() {
- return (
-
- );
- }
-}
-
-export default Container;
diff --git a/packages/react-bootstrap-table2-example/examples/remote/remote-pagination.js b/packages/react-bootstrap-table2-example/examples/remote/remote-pagination.js
deleted file mode 100644
index 050dc4d58..000000000
--- a/packages/react-bootstrap-table2-example/examples/remote/remote-pagination.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/* eslint react/no-multi-comp: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator(87);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-import BootstrapTable from 'react-bootstrap-table2';
-import paginator from 'react-bootstrap-table2-paginator';
-// ...
-const RemotePagination = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
- { sourceCode }
-
-);
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- data: products.slice(0, 10),
- sizePerPage: 10
- };
- }
-
- handleTableChange = ({ page, sizePerPage }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- this.setState(() => ({
- page,
- data: products.slice(currentIndex, currentIndex + sizePerPage),
- sizePerPage
- }));
- }, 2000);
- }
-
- render() {
- const { data, sizePerPage, page } = this.state;
- return (
-
- );
- }
-}
-`;
-
-const RemotePagination = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
-
-
- { sourceCode }
-
-);
-
-RemotePagination.propTypes = {
- data: PropTypes.array.isRequired,
- page: PropTypes.number.isRequired,
- totalSize: PropTypes.number.isRequired,
- sizePerPage: PropTypes.number.isRequired,
- onTableChange: PropTypes.func.isRequired
-};
-
-class Container extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- data: products.slice(0, 10),
- sizePerPage: 10
- };
- }
-
- handleTableChange = (type, { page, sizePerPage }) => {
- const currentIndex = (page - 1) * sizePerPage;
- setTimeout(() => {
- this.setState(() => ({
- page,
- data: products.slice(currentIndex, currentIndex + sizePerPage),
- sizePerPage
- }));
- }, 2000);
- }
-
- render() {
- const { data, sizePerPage, page } = this.state;
- return (
-
- );
- }
-}
-
-export default Container;
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/click-to-select-with-cell-edit.js b/packages/react-bootstrap-table2-example/examples/row-selection/click-to-select-with-cell-edit.js
deleted file mode 100644
index cc0c1fe5e..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/click-to-select-with-cell-edit.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- clickToEdit: true
-};
-
-const cellEdit = {
- mode: 'click'
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- clickToEdit: true // Click to edit cell also
-};
-
-const cellEdit = {
- mode: 'click'
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/click-to-select.js b/packages/react-bootstrap-table2-example/examples/row-selection/click-to-select.js
deleted file mode 100644
index b792b43d5..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/click-to-select.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/hide-selection-column.js b/packages/react-bootstrap-table2-example/examples/row-selection/hide-selection-column.js
deleted file mode 100644
index b6544114d..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/hide-selection-column.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- hideSelectColumn: true,
- bgColor: '#00BFFF'
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- hideSelectColumn: true,
- bgColor: '#00BFFF'
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/multiple-selection.js b/packages/react-bootstrap-table2-example/examples/row-selection/multiple-selection.js
deleted file mode 100644
index b792b43d5..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/multiple-selection.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/non-selectable-rows.js b/packages/react-bootstrap-table2-example/examples/row-selection/non-selectable-rows.js
deleted file mode 100644
index 69fbf0a2e..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/non-selectable-rows.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- nonSelectable: [0, 2, 4]
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- nonSelectable: [0, 2, 4]
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/selection-bgcolor.js b/packages/react-bootstrap-table2-example/examples/row-selection/selection-bgcolor.js
deleted file mode 100644
index ede13e06b..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/selection-bgcolor.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow1 = {
- mode: 'checkbox',
- clickToSelect: true,
- bgColor: '#00BFFF'
-};
-
-const selectRow2 = {
- mode: 'checkbox',
- clickToSelect: true,
- bgColor: (row, rowIndex) => (rowIndex > 1 ? '#00BFFF' : '#00FFFF')
-};
-
-const sourceCode1 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- bgColor: '#00BFFF'
-};
-
-
-`;
-
-const sourceCode2 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- bgColor: (row, rowIndex) => (rowIndex > 1 ? '#00BFFF' : '#00FFFF')
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode1 }
-
- { sourceCode2 }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/selection-class.js b/packages/react-bootstrap-table2-example/examples/row-selection/selection-class.js
deleted file mode 100644
index 4c6b79478..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/selection-class.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow1 = {
- mode: 'checkbox',
- clickToSelect: true,
- classes: 'selection-row'
-};
-
-const selectRow2 = {
- mode: 'checkbox',
- clickToSelect: true,
- classes: (row, rowIndex) =>
- (rowIndex > 1 ? 'row-index-bigger-than-2101' : 'row-index-small-than-2101')
-};
-
-const sourceCode1 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- classes: 'selection-row'
-};
-
-
-`;
-
-const sourceCode2 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- classes: (row, rowIndex) =>
- (rowIndex > 1 ? 'row-index-bigger-than-2101' : 'row-index-small-than-2101')
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode1 }
-
- { sourceCode2 }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/selection-hooks.js b/packages/react-bootstrap-table2-example/examples/row-selection/selection-hooks.js
deleted file mode 100644
index fd94d6ba9..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/selection-hooks.js
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* eslint no-console: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- onSelect: (row, isSelect, rowIndex) => {
- console.log(row.id);
- console.log(isSelect);
- console.log(rowIndex);
- },
- onSelectAll: (isSelect, rows) => {
- console.log(isSelect);
- console.log(rows);
- }
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/selection-style.js b/packages/react-bootstrap-table2-example/examples/row-selection/selection-style.js
deleted file mode 100644
index e347c1e75..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/selection-style.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow1 = {
- mode: 'checkbox',
- clickToSelect: true,
- style: { backgroundColor: '#c8e6c9' }
-};
-
-const selectRow2 = {
- mode: 'checkbox',
- clickToSelect: true,
- style: (row, rowIndex) => {
- const backgroundColor = rowIndex > 1 ? '#00BFFF' : '#00FFFF';
- return { backgroundColor };
- }
-};
-
-const sourceCode1 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- style: { backgroundColor: '#c8e6c9' }
-};
-
-
-`;
-
-const sourceCode2 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'checkbox',
- clickToSelect: true,
- style: (row, rowIndex) => {
- const backgroundColor = rowIndex > 1 ? '#00BFFF' : '#00FFFF';
- return { backgroundColor };
- }
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode1 }
-
- { sourceCode2 }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/row-selection/single-selection.js b/packages/react-bootstrap-table2-example/examples/row-selection/single-selection.js
deleted file mode 100644
index 936dde49b..000000000
--- a/packages/react-bootstrap-table2-example/examples/row-selection/single-selection.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'radio',
- clickToSelect: true
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const selectRow = {
- mode: 'radio',
- clickToSelect: true
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/rows/row-class.js b/packages/react-bootstrap-table2-example/examples/rows/row-class.js
deleted file mode 100644
index b17f6b141..000000000
--- a/packages/react-bootstrap-table2-example/examples/rows/row-class.js
+++ /dev/null
@@ -1,81 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowClasses1 = 'custom-row-class';
-
-const sourceCode1 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowClasses = 'custom-row-class';
-
-
-`;
-
-const rowClasses2 = (row, rowIndex) => {
- let classes = null;
-
- if (rowIndex > 2) {
- classes = 'index-bigger-than-two';
- }
-
- return classes;
-};
-
-const sourceCode2 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowClasses = (row, rowIndex) => {
- let classes = null;
-
- if (rowIndex > 2) {
- classes = 'index-bigger-than-two';
- }
-
- return classes;
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode1 }
-
- { sourceCode2 }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/rows/row-event.js b/packages/react-bootstrap-table2-example/examples/rows/row-event.js
deleted file mode 100644
index 1ec5022bb..000000000
--- a/packages/react-bootstrap-table2-example/examples/rows/row-event.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint no-console: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowEvents = {
- onClick: (e) => {
- console.log('click on row');
- }
-};
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowEvents = {
- onClick: (e) => {
- console.log('click on row');
- }
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/rows/row-style.js b/packages/react-bootstrap-table2-example/examples/rows/row-style.js
deleted file mode 100644
index 76de2eac1..000000000
--- a/packages/react-bootstrap-table2-example/examples/rows/row-style.js
+++ /dev/null
@@ -1,93 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowStyle1 = { backgroundColor: '#c8e6c9' };
-
-const sourceCode1 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowStyle = { backgroundColor: '#c8e6c9' };
-
-
-`;
-
-const rowStyle2 = (row, rowIndex) => {
- const style = {};
- if (row.id > 3) {
- style.backgroundColor = '#c8e6c9';
- } else {
- style.backgroundColor = '#00BFFF';
- }
-
- if (rowIndex > 2) {
- style.fontWeight = 'bold';
- style.color = 'white';
- }
-
- return style;
-};
-
-const sourceCode2 = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID'
-}, {
- dataField: 'name',
- text: 'Product Name'
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const rowStyle2 = (row, rowIndex) => {
- const style = {};
- if (row.id > 3) {
- style.backgroundColor = '#c8e6c9';
- } else {
- style.backgroundColor = '#00BFFF';
- }
-
- if (rowIndex > 2) {
- style.fontWeight = 'bold';
- style.color = 'white';
- }
-
- return style;
-};
-
-
-`;
-
-export default () => (
-
-
- { sourceCode1 }
-
- { sourceCode2 }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/sort/custom-sort-table.js b/packages/react-bootstrap-table2-example/examples/sort/custom-sort-table.js
deleted file mode 100644
index 1763a3e57..000000000
--- a/packages/react-bootstrap-table2-example/examples/sort/custom-sort-table.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* eslint no-unused-vars: 0 */
-
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true,
- // here, we implement a custom sort which perform a reverse sorting
- sortFunc: (a, b, order, dataField) => {
- if (order === 'asc') {
- return b - a;
- }
- return a - b; // desc
- }
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true,
- // here, we implement a custom sort which perform a reverse sorting
- sortFunc: (a, b, order, dataField) => {
- if (order === 'asc') {
- return b - a;
- }
- return a - b; // desc
- }
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/sort/default-sort-table.js b/packages/react-bootstrap-table2-example/examples/sort/default-sort-table.js
deleted file mode 100644
index 9cda0a41e..000000000
--- a/packages/react-bootstrap-table2-example/examples/sort/default-sort-table.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* eslint react/prefer-stateless-function: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price',
- sort: true
-}];
-
-const defaultSorted = [{
- dataField: 'name',
- order: 'desc'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price',
- sort: true
-}];
-
-const defaultSorted = [{
- dataField: 'name',
- order: 'desc'
-}];
-
-
-`;
-
-
-class DefaultSortTable extends React.PureComponent {
- render() {
- return (
-
-
- { sourceCode }
-
- );
- }
-}
-
-export default DefaultSortTable;
diff --git a/packages/react-bootstrap-table2-example/examples/sort/enable-sort-table.js b/packages/react-bootstrap-table2-example/examples/sort/enable-sort-table.js
deleted file mode 100644
index 45c7ff45d..000000000
--- a/packages/react-bootstrap-table2-example/examples/sort/enable-sort-table.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/sort/header-sorting-classes.js b/packages/react-bootstrap-table2-example/examples/sort/header-sorting-classes.js
deleted file mode 100644
index d70bdd752..000000000
--- a/packages/react-bootstrap-table2-example/examples/sort/header-sorting-classes.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* eslint
- no-unused-vars: 0
- arrow-body-style: 0
-*/
-
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const headerSortingClasses = (column, sortOrder, isLastSorting, colIndex) => (
- sortOrder === 'asc' ? 'demo-sorting-asc' : 'demo-sorting-desc'
-);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true,
- headerSortingClasses
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true,
- headerSortingClasses
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-const sourceCode = `\
-const headerSortingClasses = (column, sortOrder, isLastSorting, colIndex) => (
- sortOrder === 'asc' ? 'demo-sorting-asc' : 'demo-sorting-desc'
-);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true,
- headerSortingClasses
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true,
- headerSortingClasses
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/sort/header-sorting-style.js b/packages/react-bootstrap-table2-example/examples/sort/header-sorting-style.js
deleted file mode 100644
index c39096542..000000000
--- a/packages/react-bootstrap-table2-example/examples/sort/header-sorting-style.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* eslint no-unused-vars: 0 */
-import React from 'react';
-
-import BootstrapTable from 'react-bootstrap-table2';
-import Code from 'components/common/code-block';
-import { productsGenerator } from 'utils/common';
-
-const products = productsGenerator();
-
-const headerSortingStyle = { backgroundColor: '#c8e6c9' };
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true,
- headerSortingStyle
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true,
- headerSortingStyle
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-const sourceCode = `\
-const headerSortingStyle = { backgroundColor: '#c8e6c9' };
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- sort: true,
- headerSortingStyle
-}, {
- dataField: 'name',
- text: 'Product Name',
- sort: true,
- headerSortingStyle
-}, {
- dataField: 'price',
- text: 'Product Price'
-}];
-
-
-`;
-
-export default () => (
-
-
- { sourceCode }
-
-);
diff --git a/packages/react-bootstrap-table2-example/examples/welcome.js b/packages/react-bootstrap-table2-example/examples/welcome.js
deleted file mode 100644
index 41f3547a8..000000000
--- a/packages/react-bootstrap-table2-example/examples/welcome.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import React from 'react';
-import Typed from 'typed.js';
-
-export default class Welcome extends React.Component {
- componentDidMount() {
- // type.js config
- const options = {
- strings: ['It\'s a bootstrap table rebuilt for React.js ♥ '],
- typeSpeed: 50,
- backSpeed: 50
- };
- this.typed = new Typed(this.el, options);
- }
-
- componentWillUnmount() {
- // Make sure to destroy Typed instance on unmounting to prevent memory leaks
- this.typed.destroy();
- }
-
- render() {
- return (
-
-
-
react-bootstrap-table2
- { this.el = el; } }
- />
-
-
-
-
-
-
-
-
-
- );
- }
-}
diff --git a/packages/react-bootstrap-table2-example/package.json b/packages/react-bootstrap-table2-example/package.json
deleted file mode 100644
index 419f8845c..000000000
--- a/packages/react-bootstrap-table2-example/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "react-bootstrap-table2-example",
- "version": "0.0.1",
- "description": "",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "storybook": "start-storybook -p 6006",
- "build-storybook": "build-storybook"
- },
- "author": "",
- "license": "ISC",
- "peerDependencies": {
- "prop-types": "^15.0.0",
- "react": "^15.0.0",
- "react-dom": "^15.0.0"
- },
- "dependencies": {
- "bootstrap": "^3.3.7",
- "react-bootstrap-table2": "0.0.1",
- "react-bootstrap-table2-paginator": "0.0.1",
- "react-bootstrap-table2-overlay": "0.0.1",
- "react-bootstrap-table2-filter": "0.0.1"
- },
- "devDependencies": {
- "@storybook/addon-console": "^1.0.0",
- "@storybook/react": "^3.2.8",
- "react-redux": "^5.0.6",
- "redux": "^3.7.2",
- "redux-thunk": "^2.2.0",
- "typed.js": "^2.0.5"
- }
-}
diff --git a/packages/react-bootstrap-table2-example/src/components/common/code-block.js b/packages/react-bootstrap-table2-example/src/components/common/code-block.js
deleted file mode 100644
index c1be07d64..000000000
--- a/packages/react-bootstrap-table2-example/src/components/common/code-block.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-export default class extends Component {
- static propTypes = {
- children: PropTypes.string
- }
- static defaultProps = {
- children: ''
- }
- componentDidMount() {
- // code-prettify
- // run the PR.prettyPrint() function once your page has finished loading
- if (typeof (PR) !== 'undefined') PR.prettyPrint(); // eslint-disable-line no-undef
- }
-
- render() {
- return (
-
-
- { this.props.children }
-
-
- );
- }
-}
diff --git a/packages/react-bootstrap-table2-example/src/index.html b/packages/react-bootstrap-table2-example/src/index.html
deleted file mode 100644
index 810cd7cce..000000000
--- a/packages/react-bootstrap-table2-example/src/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- react-bootstrap-table demo
-
-
-
-
-
-
-
-
-
diff --git a/packages/react-bootstrap-table2-example/src/index.js b/packages/react-bootstrap-table2-example/src/index.js
deleted file mode 100644
index 10b6085c4..000000000
--- a/packages/react-bootstrap-table2-example/src/index.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/* eslint no-unused-vars: 0 */
-/* eslint no-debugger: 0 */
-/* eslint arrow-body-style: 0 */
-import React from 'react';
-import ReactDom from 'react-dom';
-
-import BootstrapTable from 'react-bootstrap-table2';
-
-require('react-bootstrap-table2/style/react-bootstrap-table.scss');
-
-const products = [];
-
-function addProducts(quantity) {
- const startId = products.length;
- for (let i = 0; i < quantity; i += 1) {
- const id = startId + i;
- products.push({
- id,
- name: `Item name ${id}`,
- price: 2100 + i,
- nest: {
- address: 'Address 1',
- postcal: '0922-1234'
- }
- });
- }
-}
-
-addProducts(5);
-
-const columns = [{
- dataField: 'id',
- text: 'Product ID',
- style: {
- backgroundColor: 'red'
- },
- classes: 'my-xxx'
-}, {
- dataField: 'name',
- text: 'Product Name',
- headerTitle: true,
- formatter: (cell, row) =>
- ({ cell }::: ${ row.price } ),
- validator: (newValue, row, column) => {
- const validationForm = {
- valid: true,
- message: null
- };
- validationForm.valid = false;
- validationForm.message = 'Invalid message';
- return validationForm;
- }
-}, {
- dataField: 'price',
- text: 'Product Price',
- validator: (newValue, row, column) => {
- if (newValue < 2000) {
- return {
- valid: false,
- message: 'Price should bigger than 2000'
- };
- }
- return true;
- }
-}, {
- dataField: 'nest.address',
- text: 'Address'
-}, {
- dataField: 'nest.postcal',
- text: 'Postal',
- editable: true,
- validator: (newValue, row, column) => true
-}];
-
-const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
-
-const cellEdit = {
- mode: 'click',
- blurToSave: true,
- // beforeSaveCell: (oldValue, newValue, row, column) => {
- // console.log('beforeSavecell');
- // // console.log(oldValue);
- // // console.log(newValue);
- // // console.log(row);
- // // console.log(column);
- // },
- // afterSaveCell: (oldValue, newValue, row, column) => {
- // console.log('aftersavecell');
- // // console.log(oldValue);
- // // console.log(newValue);
- // // console.log(row);
- // // console.log(column);
- // }
- onUpdate: (rowId, dataField, newValue) => {
- return sleep(1000).then(() => {
- // return { forceUpdate: true };
- throw new Error('test is not successfully');
- });
- }
- // nonEditableRows: () => [1, 3, 7]
-};
-
-
-// let Table = withCellEdit({
-// mode: 'click',
-// blurToSave: true,
-// onEditing: (rowId, dataField, newValue) => {
-// return sleep(1000).then(() => {
-// // return { forceUpdate: true };
-// throw new Error('test is not successfully');
-// });
-// }
-// })(BootstrapTable);
-// Table = createTable(Table);
-
-ReactDom.render(
- ,
- document.getElementById('example'));
diff --git a/packages/react-bootstrap-table2-example/src/utils/common.js b/packages/react-bootstrap-table2-example/src/utils/common.js
deleted file mode 100644
index 0d5ad841d..000000000
--- a/packages/react-bootstrap-table2-example/src/utils/common.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * products generator for stories
- *
- * @param {Number} quantity - quantity of products
- * @param {Function} callback - callback func which is similiar to 'mapFunction'
- * aims to customize product format
- *
- * @return {Array} - products array
- */
-export const productsGenerator = (quantity = 5, callback) => {
- if (callback) return Array.from({ length: quantity }, callback);
-
- // if no given callback, retrun default product format.
- return (
- Array.from({ length: quantity }, (value, index) => ({
- id: index,
- name: `Item name ${index}`,
- price: 2100 + index
- }))
- );
-};
-
-export const jobsGenerator = (quantity = 5) =>
- Array.from({ length: quantity }, (value, index) => ({
- id: index,
- name: `Job name ${index}`,
- owner: Math.floor(Math.random() * 3),
- type: Math.floor(Math.random() * 5)
- }));
-
-export const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
diff --git a/packages/react-bootstrap-table2-example/stories/index.js b/packages/react-bootstrap-table2-example/stories/index.js
deleted file mode 100644
index 36abbb037..000000000
--- a/packages/react-bootstrap-table2-example/stories/index.js
+++ /dev/null
@@ -1,195 +0,0 @@
-/* eslint import/no-unresolved: 0 */
-import React from 'react';
-import { storiesOf } from '@storybook/react';
-
-// welcome
-import Welcome from 'examples/welcome';
-// basic
-import BasicTable from 'examples/basic';
-import BorderlessTable from 'examples/basic/borderless-table';
-import StripHoverCondensedTable from 'examples/basic/striped-hover-condensed-table';
-import NoDataTable from 'examples/basic/no-data-table';
-import CaptionTable from 'examples/basic/caption-table';
-
-// work on columns
-import NestedDataTable from 'examples/columns/nested-data-table';
-import ColumnFormatTable from 'examples/columns/column-format-table';
-import ColumnFormatExtraDataTable from 'examples/columns/column-format-with-extra-data-table';
-import ColumnClassTable from 'examples/columns/column-class-table';
-import ColumnStyleTable from 'examples/columns/column-style-table';
-import ColumnAlignTable from 'examples/columns/column-align-table';
-import ColumnTitleTable from 'examples/columns/column-title-table';
-import ColumnEventTable from 'examples/columns/column-event-table';
-import ColumnHiddenTable from 'examples/columns/column-hidden-table';
-import ColumnAttrsTable from 'examples/columns/column-attrs-table';
-
-// work on header columns
-import HeaderColumnFormatTable from 'examples/header-columns/column-format-table';
-import HeaderColumnFormatWithSortFilterTable from 'examples/header-columns/column-format-filter-sort-table.js';
-import HeaderColumnAlignTable from 'examples/header-columns/column-align-table';
-import HeaderColumnTitleTable from 'examples/header-columns/column-title-table';
-import HeaderColumnEventTable from 'examples/header-columns/column-event-table';
-import HeaderColumnClassTable from 'examples/header-columns/column-class-table';
-import HeaderColumnStyleTable from 'examples/header-columns/column-style-table';
-import HeaderColumnAttrsTable from 'examples/header-columns/column-attrs-table';
-
-// column filter
-import TextFilter from 'examples/column-filter/text-filter';
-import TextFilterWithDefaultValue from 'examples/column-filter/text-filter-default-value';
-import TextFilterComparator from 'examples/column-filter/text-filter-eq-comparator';
-import CustomTextFilter from 'examples/column-filter/custom-text-filter';
-import CustomFilterValue from 'examples/column-filter/custom-filter-value';
-
-// work on rows
-import RowStyleTable from 'examples/rows/row-style';
-import RowClassTable from 'examples/rows/row-class';
-import RowEventTable from 'examples/rows/row-event';
-
-// table sort
-import EnableSortTable from 'examples/sort/enable-sort-table';
-import DefaultSortTable from 'examples/sort/default-sort-table';
-import CustomSortTable from 'examples/sort/custom-sort-table';
-import HeaderSortingClassesTable from 'examples/sort/header-sorting-classes';
-import HeaderSortingStyleTable from 'examples/sort/header-sorting-style';
-
-// cell editing
-import ClickToEditTable from 'examples/cell-edit/click-to-edit-table';
-import DoubleClickToEditTable from 'examples/cell-edit/dbclick-to-edit-table';
-import BlurToSaveTable from 'examples/cell-edit/blur-to-save-table';
-import RowLevelEditableTable from 'examples/cell-edit/row-level-editable-table';
-import ColumnLevelEditableTable from 'examples/cell-edit/column-level-editable-table';
-import CellLevelEditable from 'examples/cell-edit/cell-level-editable-table';
-import CellEditHooks from 'examples/cell-edit/cell-edit-hooks-table';
-import CellEditValidator from 'examples/cell-edit/cell-edit-validator-table';
-import CellEditStyleTable from 'examples/cell-edit/cell-edit-style-table';
-import CellEditClassTable from 'examples/cell-edit/cell-edit-class-table';
-import CellEditWithPromise from 'examples/cell-edit/cell-edit-with-promise-table';
-import CellEditWithRedux from 'examples/cell-edit/cell-edit-with-redux-table';
-
-// work on row selection
-import SingleSelectionTable from 'examples/row-selection/single-selection';
-import MultipleSelectionTable from 'examples/row-selection/multiple-selection';
-import ClickToSelectTable from 'examples/row-selection/click-to-select';
-import ClickToSelectWithCellEditTable from 'examples/row-selection/click-to-select-with-cell-edit';
-import SelectionStyleTable from 'examples/row-selection/selection-style';
-import SelectionClassTable from 'examples/row-selection/selection-class';
-import NonSelectableRowsTable from 'examples/row-selection/non-selectable-rows';
-import SelectionBgColorTable from 'examples/row-selection/selection-bgcolor';
-import SelectionHooks from 'examples/row-selection/selection-hooks';
-import HideSelectionColumnTable from 'examples/row-selection/hide-selection-column';
-
-// pagination
-import PaginationTable from 'examples/pagination';
-import PaginationHooksTable from 'examples/pagination/pagination-hooks';
-import CustomPaginationTable from 'examples/pagination/custom-pagination';
-
-// loading overlay
-import EmptyTableOverlay from 'examples/loading-overlay/empty-table-overlay';
-import TableOverlay from 'examples/loading-overlay/table-overlay';
-
-// remote
-import RemoteFilter from 'examples/remote/remote-filter';
-import RemotePaginationTable from 'examples/remote/remote-pagination';
-import RemoteAll from 'examples/remote/remote-all';
-
-// css style
-import 'bootstrap/dist/css/bootstrap.min.css';
-import 'stories/stylesheet/tomorrow.min.css';
-import 'stories/stylesheet/storybook.scss';
-import 'react-bootstrap-table2/style/react-bootstrap-table.scss';
-import 'react-bootstrap-table2-paginator/style/react-bootstrap-table-paginator.scss';
-
-// import { action } from '@storybook/addon-actions';
-
-// action('hello');
-storiesOf('Welcome', module)
- .add('react bootstrap table 2 ', () => );
-
-storiesOf('Basic Table', module)
- .add('basic table', () => )
- .add('striped, hover, condensed table', () => )
- .add('borderless table', () => )
- .add('Indication For Empty Table', () => )
- .add('Table with caption', () => );
-
-storiesOf('Work on Columns', module)
- .add('Display Nested Data', () => )
- .add('Column Formatter', () => )
- .add('Column Formatter with Custom Data', () => )
- .add('Column Align', () => )
- .add('Column Title', () => )
- .add('Column Hidden', () => )
- .add('Column Event', () => )
- .add('Customize Column Class', () => )
- .add('Customize Column Style', () => )
- .add('Customize Column HTML attribute', () => );
-
-storiesOf('Work on Header Columns', module)
- .add('Column Formatter', () => )
- .add('Column Format with Filter and Sort', () => )
- .add('Column Align', () => )
- .add('Column Title', () => )
- .add('Column Event', () => )
- .add('Customize Column Class', () => )
- .add('Customize Column Style', () => )
- .add('Customize Column HTML attribute', () => );
-
-storiesOf('Column Filter', module)
- .add('Text Filter', () => )
- .add('Text Filter with Default Value', () => )
- .add('Text Filter with Comparator', () => )
- .add('Custom Text Filter', () => )
- // add another filter type example right here.
- .add('Custom Filter Value', () => );
-
-storiesOf('Work on Rows', module)
- .add('Customize Row Style', () => )
- .add('Customize Row Class', () => )
- .add('Row Event', () => );
-
-storiesOf('Sort Table', module)
- .add('Enable Sort', () => )
- .add('Default Sort Table', () => )
- .add('Custom Sort Fuction', () => )
- .add('Custom Classes on Sorting Header Column', () => )
- .add('Custom Style on Sorting Header Column', () => );
-
-storiesOf('Cell Editing', module)
- .add('Click to Edit', () => )
- .add('DoubleClick to Edit', () => )
- .add('Blur to Save Cell', () => )
- .add('Row Level Editable', () => )
- .add('Column Level Editable', () => )
- .add('Cell Level Editable', () => )
- .add('Rich Hook Functions', () => )
- .add('Validation', () => )
- .add('Custom Cell Style When Editing', () => )
- .add('Custom Cell Classes When Editing', () => )
- .add('Async Cell Editing(Promise)', () => )
- .add('Async Cell Editing(Redux)', () => );
-
-storiesOf('Row Selection', module)
- .add('Single Selection', () => )
- .add('Multiple Selection', () => )
- .add('Click to Select', () => )
- .add('Click to Select and Edit Cell', () => )
- .add('Selection Style', () => )
- .add('Selection Class', () => )
- .add('Selection Background Color', () => )
- .add('Not Selectabled Rows', () => )
- .add('Selection Hooks', () => )
- .add('Hide Selection Column', () => );
-
-storiesOf('Pagination', module)
- .add('Basic Pagination Table', () => )
- .add('Pagination Hooks', () => )
- .add('Custom Pagination', () => );
-
-storiesOf('EmptyTableOverlay', module)
- .add('Empty Table Overlay', () => )
- .add('Table Overlay', () => );
-
-storiesOf('Remote', module)
- .add('Remote Filter', () => )
- .add('Remote Pagination', () => )
- .add('Remote All', () => );
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/base/_base.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/base/_base.scss
deleted file mode 100644
index 5ee5a54bb..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/base/_base.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-
-body {
- font-family: "Roboto", Arial, "Helvetica Neue", Helvetica, sans-serif;
- font-weight: 300;
-}
-
-// font color
-$grey-500: #9E9E9E;
-$grey-900: #212121;
-$pink-500: #E91E63;
-$green-lighten-2: #81c784;
-$green-lighten-4: #c8e6c9;
-$light-blue: #00BFFF;
-$markdown-color: #f6f8fa;
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/base/_code-block.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/base/_code-block.scss
deleted file mode 100644
index 48b205247..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/base/_code-block.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-.highlight-text-html-basic {
- margin-bottom: 16px;
-
- pre {
- background-color: $markdown-color;
- padding: 16px;
- border-radius: 3px;
- }
-}
-
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/base/_github-corner.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/base/_github-corner.scss
deleted file mode 100644
index a00c5806f..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/base/_github-corner.scss
+++ /dev/null
@@ -1,27 +0,0 @@
-.github-corner:hover .octo-arm {
- animation: octocat-wave 560ms ease-in-out;
-}
-
-@keyframes octocat-wave {
- 0%,
- 100% {
- transform: rotate(0)
- }
- 20%,
- 60% {
- transform: rotate(-25deg)
- }
- 40%,
- 80% {
- transform: rotate(10deg)
- }
-}
-
-@media (max-width:500px) {
- .github-corner:hover .octo-arm {
- animation: none
- }
- .github-corner .octo-arm {
- animation: octocat-wave 560ms ease-in-out
- }
-}
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/cell-edit/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/cell-edit/_index.scss
deleted file mode 100644
index 23f543ab9..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/cell-edit/_index.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-.editing-name {
- background-color: #20B2AA;
-}
-
-.editing-price-bigger-than-2101 {
- background-color: #00BFFF;
-}
-
-.editing-price-small-than-2101 {
- background-color: #00FFFF;
-}
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/columns/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/columns/_index.scss
deleted file mode 100644
index 3468c7041..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/columns/_index.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-.demo-key-row {
- font-weight: bold;
- font-size: 18px;
-}
-
-.demo-row-even {
- background-color: $green-lighten-2;
-}
-
-.demo-row-odd {
- background-color: $green-lighten-4;
-}
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/loading-overlay/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/loading-overlay/_index.scss
deleted file mode 100644
index 982c07fb8..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/loading-overlay/_index.scss
+++ /dev/null
@@ -1,52 +0,0 @@
-.spinner {
- margin: 100px auto;
- width: 50px;
- height: 40px;
- text-align: center;
- font-size: 10px;
-}
-
-.spinner > div {
- background-color: #333;
- height: 100%;
- width: 6px;
- display: inline-block;
-
- -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
- animation: sk-stretchdelay 1.2s infinite ease-in-out;
-}
-
-.spinner .rect2 {
- -webkit-animation-delay: -1.1s;
- animation-delay: -1.1s;
-}
-
-.spinner .rect3 {
- -webkit-animation-delay: -1.0s;
- animation-delay: -1.0s;
-}
-
-.spinner .rect4 {
- -webkit-animation-delay: -0.9s;
- animation-delay: -0.9s;
-}
-
-.spinner .rect5 {
- -webkit-animation-delay: -0.8s;
- animation-delay: -0.8s;
-}
-
-@-webkit-keyframes sk-stretchdelay {
- 0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
- 20% { -webkit-transform: scaleY(1.0) }
-}
-
-@keyframes sk-stretchdelay {
- 0%, 40%, 100% {
- transform: scaleY(0.4);
- -webkit-transform: scaleY(0.4);
- } 20% {
- transform: scaleY(1.0);
- -webkit-transform: scaleY(1.0);
- }
-}
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/row-selection/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/row-selection/_index.scss
deleted file mode 100644
index 91cfc67e4..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/row-selection/_index.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-.selection-row {
- background-color: #c8e6c9;
-}
-
-.row-index-bigger-than-2101 {
- background-color: #00BFFF;
-}
-
-.row-index-small-than-2101 {
- background-color: #00FFFF;
-}
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/rows/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/rows/_index.scss
deleted file mode 100644
index 16da83d00..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/rows/_index.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-.custom-row-class {
- background-color: #c8e6c9;
-}
-
-.index-bigger-than-two {
- background-color: #00BFFF;
-}
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/sort/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/sort/_index.scss
deleted file mode 100644
index bb8b1e889..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/sort/_index.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.demo-sorting,
-.demo-sorting-asc {
- background-color: $green-lighten-2;
-}
-
-.demo-sorting-desc {
- background-color: $light-blue;
-}
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/storybook.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/storybook.scss
deleted file mode 100644
index cf0a024e4..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/storybook.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-/* customized style for storybook*/
-@import "base/base";
-@import "base/github-corner";
-@import "base/code-block";
-
-@import "welcome/index";
-@import "columns/index";
-@import "cell-edit/index";
-@import "row-selection/index";
-@import "rows/index";
-@import "sort/index";
-@import "loading-overlay/index";
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/tomorrow.min.css b/packages/react-bootstrap-table2-example/stories/stylesheet/tomorrow.min.css
deleted file mode 100644
index 3638ea978..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/tomorrow.min.css
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */
-.prettyprint{background:#fff;font-family:Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Consolas,monospace;border:0!important}.pln{color:#4d4d4c}ol.linenums{margin-top:0;margin-bottom:0;color:#8e908c}li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8,li.L9{padding-left:1em;background-color:#fff;list-style-type:decimal}@media screen{.str{color:#718c00}.kwd{color:#8959a8}.com{color:#8e908c}.typ{color:#4271ae}.lit{color:#f5871f}.pun{color:#4d4d4c}.opn{color:#4d4d4c}.clo{color:#4d4d4c}.tag{color:#c82829}.atn{color:#f5871f}.atv{color:#3e999f}.dec{color:#f5871f}.var{color:#c82829}.fun{color:#4271ae}}
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-example/stories/stylesheet/welcome/_index.scss b/packages/react-bootstrap-table2-example/stories/stylesheet/welcome/_index.scss
deleted file mode 100644
index 1d7949c91..000000000
--- a/packages/react-bootstrap-table2-example/stories/stylesheet/welcome/_index.scss
+++ /dev/null
@@ -1,38 +0,0 @@
-.welcome {
- margin-top: 70px;
- text-align: center;
- padding: 30px 30px;
-
- &-title {
- color: $grey-900;
- }
- &-sub-title {
- font-size: 30px;
- color: $grey-500;
- }
-}
-
-span.love-icon {
- color: $pink-500;
-}
-
-/* Adding cursor blinking animation */
-.typed-cursor{
- font-size: 30px;
- color: $grey-500;
- opacity: 1;
- animation: typedjsBlink 0.7s infinite;
-}
-@keyframes typedjsBlink{
- 50% { opacity: 0.0; }
-}
-@-webkit-keyframes typedjsBlink{
- 0% { opacity: 1; }
- 50% { opacity: 0.0; }
- 100% { opacity: 1; }
-}
-.typed-fade-out{
- opacity: 0;
- transition: opacity .25s;
- animation: 0;
-}
diff --git a/packages/react-bootstrap-table2-example/test/utils/common.test.js b/packages/react-bootstrap-table2-example/test/utils/common.test.js
deleted file mode 100644
index ca8ecab92..000000000
--- a/packages/react-bootstrap-table2-example/test/utils/common.test.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import { productsGenerator } from '../../src/utils/common';
-
-describe('Utils', () => {
- describe('productsGenerator', () => {
- const quantity = 2;
-
- it('should return an array', () => {
- expect(Array.isArray(productsGenerator())).toBe(true);
- });
-
- it('should return 5 products without params', () => {
- expect(productsGenerator().length).toEqual(5);
- });
-
- it('should return an array with given quntity', () => {
- expect(productsGenerator(quantity).length).toEqual(quantity);
- });
-
- describe('when callback is defined', () => {
- const callback = (value, index) => ({
- id: index,
- name: 'react-bootstrap-table-2'
- });
-
- it('should return customized products format', () => {
- const products = productsGenerator(quantity, callback);
- const product = products[0];
-
- expect(Array.isArray(products)).toBe(true);
- expect(products.length).toBe(quantity);
- expect(product).toHaveProperty('id', 0);
- expect(product).toHaveProperty('name', 'react-bootstrap-table-2');
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-filter/README.md b/packages/react-bootstrap-table2-filter/README.md
deleted file mode 100644
index 8cef968b8..000000000
--- a/packages/react-bootstrap-table2-filter/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# react-bootstrap-table2-filter
-
-## Filters
-
-* Text (`textFilter`)
-
-You can get all of above filters via import and these filters are a factory function to create a individual filter instance.
-In addition, for some simple customization reasons, these factory function allow to pass some props.
-
-### Text Filter
-
-```js
-import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
-
-// omit...
-const columns = [
- ..., {
- dataField: 'price',
- text: 'Product Price',
- filter: textFilter()
-}];
-
-
-```
-
-Following we list all the availabe props for `textFilter` function:
-
-```js
-import { Comparator } from 'react-bootstrap-table2-filter';
-// omit...
-
-const customTextFilter = textFilter({
- placeholder: 'My Custom PlaceHolder', // custom the input placeholder
- style: { ... }, // your custom styles on input
- className: 'my-custom-text-filter', // custom classname on input
- defaultValue: 'test', // default filtering value
- delay: 1000, // how long will trigger filtering after user typing, default is 500 ms
- comparator: Comparator.EQ // default is Comparator.LIKE
-});
-```
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2-filter/package.json b/packages/react-bootstrap-table2-filter/package.json
deleted file mode 100644
index 826efa7a6..000000000
--- a/packages/react-bootstrap-table2-filter/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "react-bootstrap-table2-filter",
- "version": "0.0.1",
- "description": "it's the column filter addon for react-bootstrap-table2",
- "main": "src/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "ISC"
-}
diff --git a/packages/react-bootstrap-table2-filter/src/comparison.js b/packages/react-bootstrap-table2-filter/src/comparison.js
deleted file mode 100644
index cc242141a..000000000
--- a/packages/react-bootstrap-table2-filter/src/comparison.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export const LIKE = 'LIKE';
-export const EQ = '=';
diff --git a/packages/react-bootstrap-table2-filter/src/components/text.js b/packages/react-bootstrap-table2-filter/src/components/text.js
deleted file mode 100644
index 1c102c323..000000000
--- a/packages/react-bootstrap-table2-filter/src/components/text.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/* eslint react/require-default-props: 0 */
-/* eslint react/prop-types: 0 */
-/* eslint no-return-assign: 0 */
-import React, { Component } from 'react';
-import { PropTypes } from 'prop-types';
-
-import { LIKE, EQ } from '../comparison';
-import { FILTER_TYPE, FILTER_DELAY } from '../const';
-
-class TextFilter extends Component {
- constructor(props) {
- super(props);
- this.filter = this.filter.bind(this);
- this.handleClick = this.handleClick.bind(this);
- this.timeout = null;
- this.state = {
- value: props.defaultValue
- };
- }
- componentDidMount() {
- const defaultValue = this.input.value;
- if (defaultValue) {
- this.props.onFilter(this.props.column, defaultValue, FILTER_TYPE.TEXT);
- }
- }
-
- componentWillReceiveProps(nextProps) {
- if (nextProps.defaultValue !== this.props.defaultValue) {
- this.applyFilter(nextProps.defaultValue);
- }
- }
-
- componentWillUnmount() {
- this.cleanTimer();
- }
-
- filter(e) {
- e.stopPropagation();
- this.cleanTimer();
- const filterValue = e.target.value;
- this.setState(() => ({ value: filterValue }));
- this.timeout = setTimeout(() => {
- this.props.onFilter(this.props.column, filterValue, FILTER_TYPE.TEXT);
- }, this.props.delay);
- }
-
- cleanTimer() {
- if (this.timeout) {
- clearTimeout(this.timeout);
- }
- }
-
- cleanFiltered() {
- const value = this.props.defaultValue;
- this.setState(() => ({ value }));
- this.props.onFilter(this.props.column, value, FILTER_TYPE.TEXT);
- }
-
- applyFilter(filterText) {
- this.setState(() => ({ value: filterText }));
- this.props.onFilter(this.props.column, filterText, FILTER_TYPE.TEXT);
- }
-
- handleClick(e) {
- e.stopPropagation();
- if (this.props.onClick) {
- this.props.onClick(e);
- }
- }
-
- render() {
- const { placeholder, column: { text }, style, className, onFilter, ...rest } = this.props;
- // stopPropagation for onClick event is try to prevent sort was triggered.
- return (
- this.input = n }
- type="text"
- className={ `filter text-filter form-control ${className}` }
- style={ style }
- onChange={ this.filter }
- onClick={ this.handleClick }
- placeholder={ placeholder || `Enter ${text}...` }
- value={ this.state.value }
- />
- );
- }
-}
-
-TextFilter.propTypes = {
- onFilter: PropTypes.func.isRequired,
- column: PropTypes.object.isRequired,
- comparator: PropTypes.oneOf([LIKE, EQ]),
- defaultValue: PropTypes.string,
- delay: PropTypes.number,
- placeholder: PropTypes.string,
- style: PropTypes.object,
- className: PropTypes.string
-};
-
-TextFilter.defaultProps = {
- delay: FILTER_DELAY,
- defaultValue: ''
-};
-
-
-export default TextFilter;
diff --git a/packages/react-bootstrap-table2-filter/src/const.js b/packages/react-bootstrap-table2-filter/src/const.js
deleted file mode 100644
index 25faae05f..000000000
--- a/packages/react-bootstrap-table2-filter/src/const.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export const FILTER_TYPE = {
- TEXT: 'TEXT'
-};
-
-export const FILTER_DELAY = 500;
diff --git a/packages/react-bootstrap-table2-filter/src/filter.js b/packages/react-bootstrap-table2-filter/src/filter.js
deleted file mode 100644
index 03914a86f..000000000
--- a/packages/react-bootstrap-table2-filter/src/filter.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import { FILTER_TYPE } from './const';
-import { LIKE, EQ } from './comparison';
-
-export const filterByText = _ => (
- data,
- dataField,
- { filterVal, comparator = LIKE },
- customFilterValue
-) =>
- data.filter((row) => {
- let cell = _.get(row, dataField);
- if (customFilterValue) {
- cell = customFilterValue(cell, row);
- }
- const cellStr = _.isDefined(cell) ? cell.toString() : '';
- if (comparator === EQ) {
- return cellStr === filterVal;
- }
- return cellStr.indexOf(filterVal) > -1;
- });
-
-export const filterFactory = _ => (filterType) => {
- let filterFn;
- switch (filterType) {
- case FILTER_TYPE.TEXT:
- filterFn = filterByText(_);
- break;
- default:
- filterFn = filterByText(_);
- }
- return filterFn;
-};
-
-export const filters = (store, columns, _) => (currFilters) => {
- const factory = filterFactory(_);
- let result = store.getAllData();
- let filterFn;
- Object.keys(currFilters).forEach((dataField) => {
- const filterObj = currFilters[dataField];
- filterFn = factory(filterObj.filterType);
- const { filterValue } = columns.find(col => col.dataField === dataField);
- result = filterFn(result, dataField, filterObj, filterValue);
- });
- return result;
-};
diff --git a/packages/react-bootstrap-table2-filter/src/index.js b/packages/react-bootstrap-table2-filter/src/index.js
deleted file mode 100644
index 4bba49df0..000000000
--- a/packages/react-bootstrap-table2-filter/src/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import TextFilter from './components/text';
-import FilterWrapper from './wrapper';
-import * as Comparison from './comparison';
-
-export default (options = {}) => ({
- FilterWrapper,
- options
-});
-
-export const Comparator = Comparison;
-
-export const textFilter = (props = {}) => ({
- Filter: TextFilter,
- props
-});
diff --git a/packages/react-bootstrap-table2-filter/src/wrapper.js b/packages/react-bootstrap-table2-filter/src/wrapper.js
deleted file mode 100644
index 48e4d7343..000000000
--- a/packages/react-bootstrap-table2-filter/src/wrapper.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* eslint react/prop-types: 0 */
-import { Component } from 'react';
-import PropTypes from 'prop-types';
-import { filters } from './filter';
-import { LIKE } from './comparison';
-
-export default class FilterWrapper extends Component {
- static propTypes = {
- store: PropTypes.object.isRequired,
- columns: PropTypes.array.isRequired,
- baseElement: PropTypes.func.isRequired,
- onRemoteFilterChange: PropTypes.func.isRequired,
- // refactoring later
- _: PropTypes.object.isRequired
- }
-
- constructor(props) {
- super(props);
- this.state = { currFilters: {}, isDataChanged: false };
- this.onFilter = this.onFilter.bind(this);
- }
-
- componentWillReceiveProps(nextProps) {
- // consider to use lodash.isEqual
- if (JSON.stringify(this.state.currFilters) !== JSON.stringify(nextProps.store.filters)) {
- this.setState(() => ({ isDataChanged: true, currFilters: nextProps.store.filters }));
- } else {
- this.setState(() => ({ isDataChanged: false }));
- }
- }
-
- onFilter(column, filterVal, filterType) {
- const { store, columns, _, onRemoteFilterChange } = this.props;
- const currFilters = Object.assign({}, this.state.currFilters);
- const { dataField, filter } = column;
-
- if (!_.isDefined(filterVal) || filterVal === '') {
- delete currFilters[dataField];
- } else {
- const { comparator = LIKE } = filter.props;
- currFilters[dataField] = { filterVal, filterType, comparator };
- }
- store.filters = currFilters;
-
- if (this.isRemote() || this.isPaginationRemote()) {
- onRemoteFilterChange(this.isPaginationRemote());
- // when remote filtering is enable, dont set currFilters state
- // in the componentWillReceiveProps, it's the key point that we can know the filter is changed
- return;
- }
-
- store.filteredData = filters(store, columns, _)(currFilters);
- this.setState(() => ({ currFilters, isDataChanged: true }));
- }
-
- // refactoring later
- isRemote() {
- const { remote } = this.props;
- return remote === true || (typeof remote === 'object' && remote.filter);
- }
-
- // refactoring later
- isPaginationRemote() {
- const { remote } = this.props;
- return remote === true || (typeof remote === 'object' && remote.pagination);
- }
-
- render() {
- return this.props.baseElement({
- ...this.props,
- key: 'table',
- onFilter: this.onFilter,
- isDataChanged: this.state.isDataChanged
- });
- }
-}
diff --git a/packages/react-bootstrap-table2-filter/test/components/text.test.js b/packages/react-bootstrap-table2-filter/test/components/text.test.js
deleted file mode 100644
index 4a9c28253..000000000
--- a/packages/react-bootstrap-table2-filter/test/components/text.test.js
+++ /dev/null
@@ -1,190 +0,0 @@
-import 'jsdom-global/register';
-import React from 'react';
-import sinon from 'sinon';
-import { mount } from 'enzyme';
-import TextFilter from '../../src/components/text';
-import { FILTER_TYPE } from '../../src/const';
-
-jest.useFakeTimers();
-describe('Text Filter', () => {
- let wrapper;
- let instance;
- const onFilter = sinon.stub();
- const column = {
- dataField: 'price',
- text: 'Price'
- };
-
- afterEach(() => {
- onFilter.reset();
- });
-
- describe('initialization', () => {
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- });
-
- it('should have correct state', () => {
- expect(instance.state.value).toEqual(instance.props.defaultValue);
- });
-
- it('should rendering component successfully', () => {
- expect(wrapper).toHaveLength(1);
- expect(wrapper.find('input[type="text"]')).toHaveLength(1);
- expect(instance.input.getAttribute('placeholder')).toEqual(`Enter ${column.text}...`);
- });
- });
-
- describe('when defaultValue is defined', () => {
- const defaultValue = '123';
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- });
-
- it('should have correct state', () => {
- expect(instance.state.value).toEqual(defaultValue);
- });
-
- it('should rendering component successfully', () => {
- expect(wrapper).toHaveLength(1);
- expect(instance.input.value).toEqual(defaultValue);
- });
-
- it('should calling onFilter on componentDidMount', () => {
- expect(onFilter.calledOnce).toBeTruthy();
- expect(onFilter.calledWith(column, defaultValue, FILTER_TYPE.TEXT)).toBeTruthy();
- });
- });
-
- describe('when placeholder is defined', () => {
- const placeholder = 'test';
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- });
-
- it('should rendering component successfully', () => {
- expect(wrapper).toHaveLength(1);
- expect(instance.input.getAttribute('placeholder')).toEqual(placeholder);
- });
- });
-
- describe('when style is defined', () => {
- const style = { backgroundColor: 'red' };
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- });
-
- it('should rendering component successfully', () => {
- expect(wrapper).toHaveLength(1);
- expect(wrapper.find('input').prop('style')).toEqual(style);
- });
- });
-
- describe('componentWillReceiveProps', () => {
- const nextDefaultValue = 'tester';
- const nextProps = {
- onFilter,
- column,
- defaultValue: nextDefaultValue
- };
-
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting state correctly when props.defaultValue is changed', () => {
- expect(instance.state.value).toEqual(nextDefaultValue);
- });
-
- it('should calling onFilter correctly when props.defaultValue is changed', () => {
- expect(onFilter.calledOnce).toBeTruthy();
- expect(onFilter.calledWith(column, nextDefaultValue, FILTER_TYPE.TEXT)).toBeTruthy();
- });
- });
-
- describe('cleanFiltered', () => {
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- instance.cleanFiltered();
- });
-
- it('should setting state correctly', () => {
- expect(instance.state.value).toEqual(instance.props.defaultValue);
- });
-
- it('should calling onFilter correctly', () => {
- expect(onFilter.calledOnce).toBeTruthy();
- expect(onFilter.calledWith(
- column, instance.props.defaultValue, FILTER_TYPE.TEXT)).toBeTruthy();
- });
- });
-
- describe('applyFilter', () => {
- const filterText = 'test';
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- instance.applyFilter(filterText);
- });
-
- it('should setting state correctly', () => {
- expect(instance.state.value).toEqual(filterText);
- });
-
- it('should calling onFilter correctly', () => {
- expect(onFilter.calledOnce).toBeTruthy();
- expect(onFilter.calledWith(column, filterText, FILTER_TYPE.TEXT)).toBeTruthy();
- });
- });
-
- describe('filter', () => {
- const event = { stopPropagation: sinon.stub(), target: { value: 'tester' } };
-
- beforeEach(() => {
- wrapper = mount(
-
- );
- instance = wrapper.instance();
- instance.filter(event);
- });
-
- afterEach(() => {
- setTimeout.mockClear();
- });
-
- it('should calling e.stopPropagation', () => {
- expect(event.stopPropagation.calledOnce).toBeTruthy();
- });
-
- it('should setting state correctly', () => {
- expect(instance.state.value).toEqual(event.target.value);
- });
-
- it('should calling setTimeout correctly', () => {
- expect(setTimeout.mock.calls).toHaveLength(1);
- expect(setTimeout.mock.calls[0]).toHaveLength(2);
- expect(setTimeout.mock.calls[0][1]).toEqual(instance.props.delay);
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-filter/test/filter.test.js b/packages/react-bootstrap-table2-filter/test/filter.test.js
deleted file mode 100644
index 508c25f52..000000000
--- a/packages/react-bootstrap-table2-filter/test/filter.test.js
+++ /dev/null
@@ -1,94 +0,0 @@
-import sinon from 'sinon';
-import _ from 'react-bootstrap-table2/src/utils';
-import Store from 'react-bootstrap-table2/src/store';
-
-import { filters } from '../src/filter';
-import { FILTER_TYPE } from '../src/const';
-import { LIKE, EQ } from '../src/comparison';
-
-const data = [];
-for (let i = 0; i < 20; i += 1) {
- data.push({
- id: i,
- name: `itme name ${i}`,
- price: 200 + i
- });
-}
-
-describe('filter', () => {
- let store;
- let filterFn;
- let currFilters;
- let columns;
-
- beforeEach(() => {
- store = new Store('id');
- store.data = data;
- currFilters = {};
- columns = [{
- dataField: 'id',
- text: 'ID'
- }, {
- dataField: 'name',
- text: 'Name'
- }, {
- dataField: 'price',
- text: 'Price'
- }];
- });
-
- describe('text filter', () => {
- beforeEach(() => {
- filterFn = filters(store, columns, _);
- });
-
- describe(`when default comparator is ${LIKE}`, () => {
- it('should returning correct result', () => {
- currFilters.name = {
- filterVal: '3',
- filterType: FILTER_TYPE.TEXT
- };
-
- const result = filterFn(currFilters);
- expect(result).toBeDefined();
- expect(result).toHaveLength(2);
- });
- });
-
- describe(`when default comparator is ${EQ}`, () => {
- it('should returning correct result', () => {
- currFilters.name = {
- filterVal: 'itme name 3',
- filterType: FILTER_TYPE.TEXT,
- comparator: EQ
- };
-
- const result = filterFn(currFilters);
- expect(result).toBeDefined();
- expect(result).toHaveLength(1);
- });
- });
-
- describe('column.filterValue is defined', () => {
- beforeEach(() => {
- columns[1].filterValue = sinon.stub();
- filterFn = filters(store, columns, _);
- });
-
- it('should calling custom filterValue callback correctly', () => {
- currFilters.name = {
- filterVal: '3',
- filterType: FILTER_TYPE.TEXT
- };
-
- const result = filterFn(currFilters);
- expect(result).toBeDefined();
- expect(columns[1].filterValue.callCount).toBe(data.length);
- const calls = columns[1].filterValue.getCalls();
- calls.forEach((call, i) => {
- expect(call.calledWith(data[i].name, data[i])).toBeTruthy();
- });
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-filter/test/wrapper.test.js b/packages/react-bootstrap-table2-filter/test/wrapper.test.js
deleted file mode 100644
index 9541c8dbd..000000000
--- a/packages/react-bootstrap-table2-filter/test/wrapper.test.js
+++ /dev/null
@@ -1,213 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import _ from 'react-bootstrap-table2/src/utils';
-import BootstrapTable from 'react-bootstrap-table2/src/bootstrap-table';
-import Store from 'react-bootstrap-table2/src/store';
-import filter, { textFilter } from '../src';
-import FilterWrapper from '../src/wrapper';
-import { FILTER_TYPE } from '../src/const';
-
-const data = [];
-for (let i = 0; i < 20; i += 1) {
- data.push({
- id: i,
- name: `itme name ${i}`,
- price: 200 + i
- });
-}
-
-describe('Wrapper', () => {
- let wrapper;
- let instance;
- const onRemoteFilterChangeCB = sinon.stub();
-
- afterEach(() => {
- onRemoteFilterChangeCB.reset();
- });
-
- const createTableProps = () => {
- const tableProps = {
- keyField: 'id',
- columns: [{
- dataField: 'id',
- text: 'ID'
- }, {
- dataField: 'name',
- text: 'Name',
- filter: textFilter()
- }, {
- dataField: 'price',
- text: 'Price',
- filter: textFilter()
- }],
- data,
- filter: filter(),
- _,
- store: new Store('id'),
- onRemoteFilterChange: onRemoteFilterChangeCB
- };
- tableProps.store.data = data;
- return tableProps;
- };
-
- const pureTable = props => ( );
-
- const createFilterWrapper = (props, renderFragment = true) => {
- wrapper = shallow( );
- instance = wrapper.instance();
- if (renderFragment) {
- const fragment = instance.render();
- wrapper = shallow({ fragment }
);
- }
- };
-
- describe('default filter wrapper', () => {
- const props = createTableProps();
-
- beforeEach(() => {
- createFilterWrapper(props);
- });
-
- it('should rendering correctly', () => {
- expect(wrapper.length).toBe(1);
- });
-
- it('should initializing state correctly', () => {
- expect(instance.state.isDataChanged).toBeFalsy();
- expect(instance.state.currFilters).toEqual({});
- });
-
- it('should rendering BootstraTable correctly', () => {
- const table = wrapper.find(BootstrapTable);
- expect(table.length).toBe(1);
- expect(table.prop('onFilter')).toBeDefined();
- expect(table.prop('isDataChanged')).toEqual(instance.state.isDataChanged);
- });
- });
-
- describe('componentWillReceiveProps', () => {
- let nextProps;
-
- describe('when props.store.filters is same as current state.currFilters', () => {
- beforeEach(() => {
- nextProps = createTableProps();
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting isDataChanged as false (Temporary solution)', () => {
- expect(instance.state.isDataChanged).toBeFalsy();
- });
- });
-
- describe('when props.store.filters is different from current state.currFilters', () => {
- beforeEach(() => {
- nextProps = createTableProps();
- nextProps.store.filters = { price: { filterVal: 20, filterType: FILTER_TYPE.TEXT } };
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting states correctly', () => {
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(instance.state.currFilters).toBe(nextProps.store.filters);
- });
- });
- });
-
- describe('onFilter', () => {
- let props;
-
- beforeEach(() => {
- props = createTableProps();
- createFilterWrapper(props);
- });
-
- describe('when filterVal is empty or undefined', () => {
- const filterVals = ['', undefined];
-
- it('should setting store object correctly', () => {
- filterVals.forEach((filterVal) => {
- instance.onFilter(props.columns[1], filterVal, FILTER_TYPE.TEXT);
- expect(props.store.filtering).toBeFalsy();
- });
- });
-
- it('should setting state correctly', () => {
- filterVals.forEach((filterVal) => {
- instance.onFilter(props.columns[1], filterVal, FILTER_TYPE.TEXT);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(0);
- });
- });
- });
-
- describe('when filterVal is existing', () => {
- const filterVal = '3';
-
- it('should setting store object correctly', () => {
- instance.onFilter(props.columns[1], filterVal, FILTER_TYPE.TEXT);
- expect(props.store.filters).toEqual(instance.state.currFilters);
- });
-
- it('should setting state correctly', () => {
- instance.onFilter(props.columns[1], filterVal, FILTER_TYPE.TEXT);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(1);
- });
- });
-
- describe('when remote filter is enabled', () => {
- const filterVal = '3';
-
- beforeEach(() => {
- props = createTableProps();
- props.remote = { filter: true };
- createFilterWrapper(props);
- instance.onFilter(props.columns[1], filterVal, FILTER_TYPE.TEXT);
- });
-
- it('should not setting store object correctly', () => {
- expect(props.store.filters).not.toEqual(instance.state.currFilters);
- });
-
- it('should not setting state', () => {
- expect(instance.state.isDataChanged).toBeFalsy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(0);
- });
-
- it('should calling props.onRemoteFilterChange correctly', () => {
- expect(onRemoteFilterChangeCB.calledOnce).toBeTruthy();
- });
- });
-
- describe('combination', () => {
- it('should setting store object correctly', () => {
- instance.onFilter(props.columns[1], '3', FILTER_TYPE.TEXT);
- expect(props.store.filters).toEqual(instance.state.currFilters);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(1);
-
- instance.onFilter(props.columns[1], '2', FILTER_TYPE.TEXT);
- expect(props.store.filters).toEqual(instance.state.currFilters);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(1);
-
- instance.onFilter(props.columns[2], '2', FILTER_TYPE.TEXT);
- expect(props.store.filters).toEqual(instance.state.currFilters);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(2);
-
- instance.onFilter(props.columns[2], '', FILTER_TYPE.TEXT);
- expect(props.store.filters).toEqual(instance.state.currFilters);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(1);
-
- instance.onFilter(props.columns[1], '', FILTER_TYPE.TEXT);
- expect(props.store.filters).toEqual(instance.state.currFilters);
- expect(instance.state.isDataChanged).toBeTruthy();
- expect(Object.keys(instance.state.currFilters)).toHaveLength(0);
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-overlay/package.json b/packages/react-bootstrap-table2-overlay/package.json
deleted file mode 100644
index d1cd57360..000000000
--- a/packages/react-bootstrap-table2-overlay/package.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "react-bootstrap-table2-overlay",
- "version": "0.0.1",
- "description": "it's a loading overlay component for react-bootstrap-table2",
- "main": "src/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "ISC",
- "dependencies": {
- "react-loading-overlay": "0.2.8"
- }
-}
diff --git a/packages/react-bootstrap-table2-overlay/src/index.js b/packages/react-bootstrap-table2-overlay/src/index.js
deleted file mode 100644
index a5db87267..000000000
--- a/packages/react-bootstrap-table2-overlay/src/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* eslint no-return-assign: 0 */
-import React from 'react';
-import LoadingOverlay from 'react-loading-overlay';
-
-export default options => (element, loading) =>
- class TableLoadingOverlayWrapper extends React.Component {
- componentDidMount() {
- if (loading) {
- const { wrapper } = this.overlay;
- const masker = wrapper.firstChild;
- const headerDOM = wrapper.parentElement.querySelector('thead');
- const bodyDOM = wrapper.parentElement.querySelector('tbody');
- masker.style.marginTop = window.getComputedStyle(headerDOM).height;
- masker.style.height = window.getComputedStyle(bodyDOM).height;
- }
- }
-
- render() {
- return (
- this.overlay = n }
- { ...options }
- active={ loading }
- >
- { element }
-
- );
- }
- };
diff --git a/packages/react-bootstrap-table2-overlay/test/index.test.js b/packages/react-bootstrap-table2-overlay/test/index.test.js
deleted file mode 100644
index a8fdacbb2..000000000
--- a/packages/react-bootstrap-table2-overlay/test/index.test.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import React from 'react';
-import { shallow, render } from 'enzyme';
-import LoadingOverlay from 'react-loading-overlay';
-
-import overlayFactory from '../src';
-
-describe('overlayFactory', () => {
- let wrapper;
- // let instance;
-
- const createTable = () => (
-
-
-
- column1
- column2
-
-
-
- { [1, 2].map(row => (
- { row } test
- ))}
-
-
- );
-
- describe('when loading is false', () => {
- beforeEach(() => {
- const tableElm = createTable();
- const Overlay = overlayFactory()(tableElm, false);
- wrapper = shallow( );
- });
-
- it('should rendering Overlay component correctly', () => {
- const overlay = wrapper.find(LoadingOverlay);
- expect(wrapper.length).toBe(1);
- expect(overlay.length).toBe(1);
- expect(overlay.prop('active')).toBeFalsy();
- });
- });
-
- describe('when loading is true', () => {
- beforeEach(() => {
- const tableElm = createTable();
- const Overlay = overlayFactory()(tableElm, true);
- wrapper = render( );
- });
-
- it('should rendering Overlay component correctly', () => {
- const overlay = wrapper.find(LoadingOverlay);
- expect(wrapper.length).toBe(1);
- expect(overlay.length).toBe(0);
- });
- });
-
- describe('when options is given', () => {
- const options = {
- spinner: true,
- background: 'red'
- };
- beforeEach(() => {
- const tableElm = createTable();
- const Overlay = overlayFactory(options)(tableElm, false);
- wrapper = shallow( );
- });
-
- it('should rendering Overlay component with options correctly', () => {
- const overlay = wrapper.find(LoadingOverlay);
- expect(wrapper.length).toBe(1);
- expect(overlay.length).toBe(1);
- expect(overlay.prop('active')).toBeFalsy();
- Object.keys(options).forEach((key) => {
- expect(overlay.prop(key)).toEqual(options[key]);
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-overlay/yarn.lock b/packages/react-bootstrap-table2-overlay/yarn.lock
deleted file mode 100644
index f40152b2c..000000000
--- a/packages/react-bootstrap-table2-overlay/yarn.lock
+++ /dev/null
@@ -1,200 +0,0 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-
-asap@~2.0.3:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
-
-base64-js@^1.0.2:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886"
-
-buffer@^5.0.3:
- version "5.0.8"
- resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.8.tgz#84daa52e7cf2fa8ce4195bc5cf0f7809e0930b24"
- dependencies:
- base64-js "^1.0.2"
- ieee754 "^1.1.4"
-
-chain-function@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"
-
-core-js@^1.0.0:
- version "1.2.7"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
-
-css-color-keywords@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05"
-
-css-to-react-native@^2.0.3:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.0.4.tgz#cf4cc407558b3474d4ba8be1a2cd3b6ce713101b"
- dependencies:
- css-color-keywords "^1.0.0"
- fbjs "^0.8.5"
- postcss-value-parser "^3.3.0"
-
-dom-helpers@^3.2.0:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.2.1.tgz#3203e07fed217bd1f424b019735582fc37b2825a"
-
-encoding@^0.1.11:
- version "0.1.12"
- resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
- dependencies:
- iconv-lite "~0.4.13"
-
-fbjs@^0.8.16, fbjs@^0.8.5, fbjs@^0.8.9:
- version "0.8.16"
- resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
- dependencies:
- core-js "^1.0.0"
- isomorphic-fetch "^2.1.1"
- loose-envify "^1.0.0"
- object-assign "^4.1.0"
- promise "^7.1.1"
- setimmediate "^1.0.5"
- ua-parser-js "^0.7.9"
-
-has-flag@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
-
-hoist-non-react-statics@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
-
-iconv-lite@~0.4.13:
- version "0.4.19"
- resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
-
-ieee754@^1.1.4:
- version "1.1.8"
- resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
-
-is-function@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5"
-
-is-plain-object@^2.0.1:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
- dependencies:
- isobject "^3.0.1"
-
-is-stream@^1.0.1:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
-
-isobject@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
-
-isomorphic-fetch@^2.1.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
- dependencies:
- node-fetch "^1.0.1"
- whatwg-fetch ">=0.10.0"
-
-js-tokens@^3.0.0:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
-
-loose-envify@^1.0.0, loose-envify@^1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
- dependencies:
- js-tokens "^3.0.0"
-
-node-fetch@^1.0.1:
- version "1.7.3"
- resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
- dependencies:
- encoding "^0.1.11"
- is-stream "^1.0.1"
-
-object-assign@^4.1.0, object-assign@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
-
-postcss-value-parser@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15"
-
-promise@^7.1.1:
- version "7.3.1"
- resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
- dependencies:
- asap "~2.0.3"
-
-prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6:
- version "15.6.0"
- resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
- dependencies:
- fbjs "^0.8.16"
- loose-envify "^1.3.1"
- object-assign "^4.1.1"
-
-react-loading-overlay@0.2.8:
- version "0.2.8"
- resolved "https://registry.yarnpkg.com/react-loading-overlay/-/react-loading-overlay-0.2.8.tgz#c1c5531c9cfa4be6caca6b9aa0c1eb19e22b03fe"
- dependencies:
- prop-types "^15.5.10"
- react-transition-group "^1.2.1"
- styled-components "^2.1.2"
-
-react-transition-group@^1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-1.2.1.tgz#e11f72b257f921b213229a774df46612346c7ca6"
- dependencies:
- chain-function "^1.0.0"
- dom-helpers "^3.2.0"
- loose-envify "^1.3.1"
- prop-types "^15.5.6"
- warning "^3.0.0"
-
-setimmediate@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
-
-styled-components@^2.1.2:
- version "2.2.4"
- resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-2.2.4.tgz#dd87fd3dafd359e7a0d570aec1bd07d691c0b5a2"
- dependencies:
- buffer "^5.0.3"
- css-to-react-native "^2.0.3"
- fbjs "^0.8.9"
- hoist-non-react-statics "^1.2.0"
- is-function "^1.0.1"
- is-plain-object "^2.0.1"
- prop-types "^15.5.4"
- stylis "^3.4.0"
- supports-color "^3.2.3"
-
-stylis@^3.4.0:
- version "3.4.5"
- resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.4.5.tgz#d7b9595fc18e7b9c8775eca8270a9a1d3e59806e"
-
-supports-color@^3.2.3:
- version "3.2.3"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
- dependencies:
- has-flag "^1.0.0"
-
-ua-parser-js@^0.7.9:
- version "0.7.17"
- resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
-
-warning@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c"
- dependencies:
- loose-envify "^1.0.0"
-
-whatwg-fetch@>=0.10.0:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
diff --git a/packages/react-bootstrap-table2-paginator/package.json b/packages/react-bootstrap-table2-paginator/package.json
deleted file mode 100644
index bb30b4bb8..000000000
--- a/packages/react-bootstrap-table2-paginator/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "react-bootstrap-table2-paginator",
- "version": "0.0.1",
- "description": "it's the pagination addon for react-bootstrap-table2",
- "main": "src/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "ISC"
-}
diff --git a/packages/react-bootstrap-table2-paginator/src/const.js b/packages/react-bootstrap-table2-paginator/src/const.js
deleted file mode 100644
index eaa1bac43..000000000
--- a/packages/react-bootstrap-table2-paginator/src/const.js
+++ /dev/null
@@ -1,17 +0,0 @@
-export default {
- PAGINATION_SIZE: 5,
- PAGE_START_INDEX: 1,
- With_FIRST_AND_LAST: true,
- SHOW_ALL_PAGE_BTNS: false,
- FIRST_PAGE_TEXT: '<<',
- PRE_PAGE_TEXT: '<',
- NEXT_PAGE_TEXT: '>',
- LAST_PAGE_TEXT: '>>',
- NEXT_PAGE_TITLE: 'next page',
- LAST_PAGE_TITLE: 'last page',
- PRE_PAGE_TITLE: 'previous page',
- FIRST_PAGE_TITLE: 'first page',
- SIZE_PER_PAGE_LIST: [10, 25, 30, 50],
- HIDE_SIZE_PER_PAGE: false,
- HIDE_PAGE_LIST_ONLY_ONE_PAGE: false
-};
diff --git a/packages/react-bootstrap-table2-paginator/src/index.js b/packages/react-bootstrap-table2-paginator/src/index.js
deleted file mode 100644
index 375f1fabc..000000000
--- a/packages/react-bootstrap-table2-paginator/src/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import PaginationWrapper from './wrapper';
-
-export default (options = {}) => ({
- PaginationWrapper,
- options
-});
diff --git a/packages/react-bootstrap-table2-paginator/src/page-button.js b/packages/react-bootstrap-table2-paginator/src/page-button.js
deleted file mode 100644
index 272fa19b4..000000000
--- a/packages/react-bootstrap-table2-paginator/src/page-button.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* eslint react/require-default-props: 0 */
-/* eslint jsx-a11y/href-no-hash: 0 */
-import cs from 'classnames';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-class PageButton extends Component {
- constructor(props) {
- super(props);
- this.handleClick = this.handleClick.bind(this);
- }
-
- handleClick(e) {
- e.preventDefault();
- this.props.onPageChange(this.props.page);
- }
-
- render() {
- const {
- page,
- title,
- active,
- disabled
- } = this.props;
- const classes = cs({
- active,
- disabled,
- 'page-item': true
- });
-
- return (
-
- { page }
-
- );
- }
-}
-
-PageButton.propTypes = {
- onPageChange: PropTypes.func.isRequired,
- page: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
- active: PropTypes.bool.isRequired,
- disabled: PropTypes.bool.isRequired,
- title: PropTypes.string
-};
-
-export default PageButton;
diff --git a/packages/react-bootstrap-table2-paginator/src/page-resolver.js b/packages/react-bootstrap-table2-paginator/src/page-resolver.js
deleted file mode 100644
index 931595f4a..000000000
--- a/packages/react-bootstrap-table2-paginator/src/page-resolver.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/* eslint no-mixed-operators: 0 */
-export default ExtendBase =>
- class PageResolver extends ExtendBase {
- backToPrevPage() {
- const { currPage, pageStartIndex } = this.props;
- return (currPage - 1) < pageStartIndex ? pageStartIndex : currPage - 1;
- }
-
- goToNextPage() {
- const { currPage } = this.props;
- const { lastPage } = this.state;
- return (currPage + 1) > lastPage ? lastPage : currPage + 1;
- }
-
- initialState() {
- const totalPages = this.calculateTotalPage();
- const lastPage = this.calculateLastPage(totalPages);
- return { totalPages, lastPage, dropdownOpen: false };
- }
-
- calculateTotalPage(sizePerPage = this.props.currSizePerPage, dataSize = this.props.dataSize) {
- return Math.ceil(dataSize / sizePerPage);
- }
-
- calculateLastPage(totalPages) {
- const { pageStartIndex } = this.props;
- return pageStartIndex + totalPages - 1;
- }
-
- calculatePages(
- totalPages = this.state.totalPages,
- lastPage = this.state.lastPage) {
- const {
- currPage,
- paginationSize,
- pageStartIndex,
- withFirstAndLast,
- firstPageText,
- prePageText,
- nextPageText,
- lastPageText,
- alwaysShowAllBtns
- } = this.props;
-
- let pages;
- let endPage = totalPages;
- if (endPage <= 0) return [];
-
- let startPage = Math.max(currPage - Math.floor(paginationSize / 2), pageStartIndex);
- endPage = startPage + paginationSize - 1;
-
- if (endPage > lastPage) {
- endPage = lastPage;
- startPage = endPage - paginationSize + 1;
- }
-
- if (startPage !== pageStartIndex && totalPages > paginationSize && withFirstAndLast) {
- pages = [firstPageText, prePageText];
- } else if (totalPages > 1 || alwaysShowAllBtns) {
- pages = [prePageText];
- } else {
- pages = [];
- }
-
- for (let i = startPage; i <= endPage; i += 1) {
- if (i >= pageStartIndex) pages.push(i);
- }
-
- if (endPage <= lastPage && pages.length > 1) {
- pages.push(nextPageText);
- }
- if (endPage !== lastPage && withFirstAndLast) {
- pages.push(lastPageText);
- }
- return pages;
- }
-
- calculatePageStatus(pages = [], lastPage = this.state.lastPage) {
- const {
- currPage,
- pageStartIndex,
- firstPageText,
- prePageText,
- nextPageText,
- lastPageText,
- alwaysShowAllBtns
- } = this.props;
- const isStart = page =>
- (currPage === pageStartIndex && (page === firstPageText || page === prePageText));
- const isEnd = page =>
- (currPage === lastPage && (page === nextPageText || page === lastPageText));
-
- return pages
- .filter((page) => {
- if (alwaysShowAllBtns) {
- return true;
- }
- return !(isStart(page) || isEnd(page));
- })
- .map((page) => {
- let title;
- const active = page === currPage;
- const disabled = (isStart(page) || isEnd(page));
-
- if (page === nextPageText) {
- title = this.props.nextPageTitle;
- } else if (page === prePageText) {
- title = this.props.prePageTitle;
- } else if (page === firstPageText) {
- title = this.props.firstPageTitle;
- } else if (page === lastPageText) {
- title = this.props.lastPageTitle;
- } else {
- title = `${page}`;
- }
-
- return { page, active, disabled, title };
- });
- }
-
- calculateSizePerPageStatus() {
- const { sizePerPageList } = this.props;
- return sizePerPageList.map((_sizePerPage) => {
- const pageText = _sizePerPage.text || _sizePerPage;
- const pageNumber = _sizePerPage.value || _sizePerPage;
- return {
- text: `${pageText}`,
- page: pageNumber
- };
- });
- }
- };
-
diff --git a/packages/react-bootstrap-table2-paginator/src/page.js b/packages/react-bootstrap-table2-paginator/src/page.js
deleted file mode 100644
index 1ea54e571..000000000
--- a/packages/react-bootstrap-table2-paginator/src/page.js
+++ /dev/null
@@ -1,17 +0,0 @@
-export const getByCurrPage = store => (page, sizePerPage, pageStartIndex) => {
- const dataSize = store.data.length;
- if (!dataSize) return [];
- const getNormalizedPage = () => {
- const offset = Math.abs(1 - pageStartIndex);
- return page + offset;
- };
- const end = (getNormalizedPage() * sizePerPage) - 1;
- const start = end - (sizePerPage - 1);
-
- const result = [];
- for (let i = start; i <= end; i += 1) {
- result.push(store.data[i]);
- if (i + 1 === dataSize) break;
- }
- return result;
-};
diff --git a/packages/react-bootstrap-table2-paginator/src/pagination-list.js b/packages/react-bootstrap-table2-paginator/src/pagination-list.js
deleted file mode 100644
index 805af5323..000000000
--- a/packages/react-bootstrap-table2-paginator/src/pagination-list.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import PageButton from './page-button';
-
-const PaginatonList = props => (
-
- {
- props.pages.map(pageProps => (
-
- ))
- }
-
-);
-
-PaginatonList.propTypes = {
- pages: PropTypes.arrayOf(PropTypes.shape({
- page: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
- active: PropTypes.bool,
- disable: PropTypes.bool,
- title: PropTypes.string
- })).isRequired,
- onPageChange: PropTypes.func.isRequired
-};
-
-export default PaginatonList;
diff --git a/packages/react-bootstrap-table2-paginator/src/pagination.js b/packages/react-bootstrap-table2-paginator/src/pagination.js
deleted file mode 100644
index d103e4bca..000000000
--- a/packages/react-bootstrap-table2-paginator/src/pagination.js
+++ /dev/null
@@ -1,170 +0,0 @@
-/* eslint react/require-default-props: 0 */
-/* eslint arrow-body-style: 0 */
-import cs from 'classnames';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import pageResolver from './page-resolver';
-import SizePerPageDropDown from './size-per-page-dropdown';
-import PaginationList from './pagination-list';
-import Const from './const';
-
-class Pagination extends pageResolver(Component) {
- constructor(props) {
- super(props);
- this.closeDropDown = this.closeDropDown.bind(this);
- this.toggleDropDown = this.toggleDropDown.bind(this);
- this.handleChangePage = this.handleChangePage.bind(this);
- this.handleChangeSizePerPage = this.handleChangeSizePerPage.bind(this);
- this.state = this.initialState();
- }
-
- componentWillReceiveProps(nextProps) {
- const { dataSize, currSizePerPage } = nextProps;
- if (currSizePerPage !== this.props.currSizePerPage || dataSize !== this.props.dataSize) {
- const totalPages = this.calculateTotalPage(currSizePerPage, dataSize);
- const lastPage = this.calculateLastPage(totalPages);
- this.setState({ totalPages, lastPage });
- }
- }
-
- toggleDropDown() {
- const dropdownOpen = !this.state.dropdownOpen;
- this.setState(() => {
- return { dropdownOpen };
- });
- }
-
- closeDropDown() {
- this.setState(() => {
- return { dropdownOpen: false };
- });
- }
-
- handleChangeSizePerPage(sizePerPage) {
- const { currSizePerPage, onSizePerPageChange } = this.props;
- const selectedSize = typeof sizePerPage === 'string' ? parseInt(sizePerPage, 10) : sizePerPage;
- let { currPage } = this.props;
- if (selectedSize !== currSizePerPage) {
- const newTotalPages = this.calculateTotalPage(selectedSize);
- const newLastPage = this.calculateLastPage(newTotalPages);
- if (currPage > newLastPage) currPage = newLastPage;
- onSizePerPageChange(selectedSize, currPage);
- }
- this.closeDropDown();
- }
-
- handleChangePage(newPage) {
- let page;
- const {
- currPage,
- pageStartIndex,
- prePageText,
- nextPageText,
- lastPageText,
- firstPageText,
- onPageChange
- // keepSizePerPageState
- } = this.props;
- const { lastPage } = this.state;
-
- if (newPage === prePageText) {
- page = this.backToPrevPage();
- } else if (newPage === nextPageText) {
- page = (currPage + 1) > lastPage ? lastPage : currPage + 1;
- } else if (newPage === lastPageText) {
- page = lastPage;
- } else if (newPage === firstPageText) {
- page = pageStartIndex;
- } else {
- page = parseInt(newPage, 10);
- }
-
- // if (keepSizePerPageState) { this.closeDropDown(); }
-
- if (page !== currPage) {
- onPageChange(page);
- }
- }
-
- render() {
- const { totalPages, lastPage, dropdownOpen: open } = this.state;
- const {
- sizePerPageList,
- currSizePerPage,
- hideSizePerPage,
- hidePageListOnlyOnePage
- } = this.props;
- const pages = this.calculatePageStatus(this.calculatePages(totalPages), lastPage);
-
- const pageListClass = cs(
- 'react-bootstrap-table-pagination-list',
- 'col-md-6 col-xs-6 col-sm-6 col-lg-6', {
- 'react-bootstrap-table-pagination-list-hidden': (hidePageListOnlyOnePage && totalPages === 1)
- });
- return (
-
-
- {
- sizePerPageList.length > 1 && !hideSizePerPage ?
- (
-
- ) : null
- }
-
-
-
- );
- }
-}
-
-Pagination.propTypes = {
- dataSize: PropTypes.number.isRequired,
- sizePerPageList: PropTypes.array.isRequired,
- currPage: PropTypes.number.isRequired,
- currSizePerPage: PropTypes.number.isRequired,
- onPageChange: PropTypes.func.isRequired,
- onSizePerPageChange: PropTypes.func.isRequired,
- pageStartIndex: PropTypes.number,
- paginationSize: PropTypes.number,
- firstPageText: PropTypes.string,
- prePageText: PropTypes.string,
- nextPageText: PropTypes.string,
- lastPageText: PropTypes.string,
- nextPageTitle: PropTypes.string,
- prePageTitle: PropTypes.string,
- firstPageTitle: PropTypes.string,
- lastPageTitle: PropTypes.string,
- withFirstAndLast: PropTypes.bool,
- alwaysShowAllBtns: PropTypes.bool,
- hideSizePerPage: PropTypes.bool,
- hidePageListOnlyOnePage: PropTypes.bool
-};
-
-Pagination.defaultProps = {
- pageStartIndex: Const.PAGE_START_INDEX,
- paginationSize: Const.PAGINATION_SIZE,
- withFirstAndLast: Const.With_FIRST_AND_LAST,
- alwaysShowAllBtns: Const.SHOW_ALL_PAGE_BTNS,
- firstPageText: Const.FIRST_PAGE_TEXT,
- prePageText: Const.PRE_PAGE_TEXT,
- nextPageText: Const.NEXT_PAGE_TEXT,
- lastPageText: Const.LAST_PAGE_TEXT,
- sizePerPageList: Const.SIZE_PER_PAGE_LIST,
- nextPageTitle: Const.NEXT_PAGE_TITLE,
- prePageTitle: Const.PRE_PAGE_TITLE,
- firstPageTitle: Const.FIRST_PAGE_TITLE,
- lastPageTitle: Const.LAST_PAGE_TITLE,
- hideSizePerPage: Const.HIDE_SIZE_PER_PAGE,
- hidePageListOnlyOnePage: Const.HIDE_PAGE_LIST_ONLY_ONE_PAGE
-};
-
-export default Pagination;
diff --git a/packages/react-bootstrap-table2-paginator/src/size-per-page-dropdown.js b/packages/react-bootstrap-table2-paginator/src/size-per-page-dropdown.js
deleted file mode 100644
index 5ae42980e..000000000
--- a/packages/react-bootstrap-table2-paginator/src/size-per-page-dropdown.js
+++ /dev/null
@@ -1,85 +0,0 @@
-import React from 'react';
-import cs from 'classnames';
-import PropTypes from 'prop-types';
-import SizePerPageOption from './size-per-page-option';
-
-const sizePerPageDefaultClass = 'react-bs-table-sizePerPage-dropdown';
-
-const SizePerPageDropDown = (props) => {
- const {
- open,
- hidden,
- onClick,
- onBlur,
- options,
- className,
- variation,
- btnContextual,
- currSizePerPage,
- onSizePerPageChange
- } = props;
-
- const dropDownStyle = { visibility: hidden ? 'hidden' : 'visible' };
- const dropdownClasses = cs(
- open ? 'open show' : '',
- sizePerPageDefaultClass,
- variation,
- className,
- );
-
- return (
-
-
- { currSizePerPage }
-
- { ' ' }
-
-
-
-
- {
- options.map(option => (
-
- ))
- }
-
-
- );
-};
-
-SizePerPageDropDown.propTypes = {
- currSizePerPage: PropTypes.string.isRequired,
- options: PropTypes.array.isRequired,
- onClick: PropTypes.func.isRequired,
- onBlur: PropTypes.func.isRequired,
- onSizePerPageChange: PropTypes.func.isRequired,
- open: PropTypes.bool,
- hidden: PropTypes.bool,
- btnContextual: PropTypes.string,
- variation: PropTypes.oneOf(['dropdown', 'dropup']),
- className: PropTypes.string
-};
-SizePerPageDropDown.defaultProps = {
- open: false,
- hidden: false,
- btnContextual: 'btn-default btn-secondary',
- variation: 'dropdown',
- className: ''
-};
-
-
-export default SizePerPageDropDown;
diff --git a/packages/react-bootstrap-table2-paginator/src/size-per-page-option.js b/packages/react-bootstrap-table2-paginator/src/size-per-page-option.js
deleted file mode 100644
index eba6ca629..000000000
--- a/packages/react-bootstrap-table2-paginator/src/size-per-page-option.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* eslint jsx-a11y/href-no-hash: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-
-const SizePerPageOption = ({
- text,
- page,
- onSizePerPageChange
-}) => (
-
- {
- e.preventDefault();
- onSizePerPageChange(page);
- } }
- >
- { text }
-
-
-);
-
-SizePerPageOption.propTypes = {
- text: PropTypes.string.isRequired,
- page: PropTypes.number.isRequired,
- onSizePerPageChange: PropTypes.func.isRequired
-};
-
-export default SizePerPageOption;
diff --git a/packages/react-bootstrap-table2-paginator/src/wrapper.js b/packages/react-bootstrap-table2-paginator/src/wrapper.js
deleted file mode 100644
index e01cd516b..000000000
--- a/packages/react-bootstrap-table2-paginator/src/wrapper.js
+++ /dev/null
@@ -1,179 +0,0 @@
-/* eslint react/prop-types: 0 */
-/* eslint arrow-body-style: 0 */
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Const from './const';
-import Pagination from './pagination';
-import { getByCurrPage } from './page';
-
-class PaginationWrapper extends Component {
- static propTypes = {
- store: PropTypes.object.isRequired,
- baseElement: PropTypes.func.isRequired,
- onRemotePageChange: PropTypes.func.isRequired
- }
-
- constructor(props) {
- super(props);
- this.handleChangePage = this.handleChangePage.bind(this);
- this.handleChangeSizePerPage = this.handleChangeSizePerPage.bind(this);
-
- let currPage;
- let currSizePerPage;
- const { options } = props.pagination;
- const sizePerPageList = options.sizePerPageList || Const.SIZE_PER_PAGE_LIST;
-
- // initialize current page
- if (typeof options.page !== 'undefined') {
- currPage = options.page;
- } else if (typeof options.pageStartIndex !== 'undefined') {
- currPage = options.pageStartIndex;
- } else {
- currPage = Const.PAGE_START_INDEX;
- }
-
- // initialize current sizePerPage
- if (typeof options.sizePerPage !== 'undefined') {
- currSizePerPage = options.sizePerPage;
- } else if (typeof sizePerPageList[0] === 'object') {
- currSizePerPage = sizePerPageList[0].value;
- } else {
- currSizePerPage = sizePerPageList[0];
- }
-
- this.state = { currPage, currSizePerPage };
- this.saveToStore(currPage, currSizePerPage);
- }
-
- componentWillReceiveProps(nextProps) {
- let needNewState = false;
- let { currPage, currSizePerPage } = this.state;
- const { page, sizePerPage, pageStartIndex, onPageChange } = nextProps.pagination.options;
-
- if (typeof page !== 'undefined' && currPage !== page) { // user defined page
- currPage = page;
- needNewState = true;
- } else if (nextProps.isDataChanged) { // user didn't defined page but data change
- currPage = typeof pageStartIndex !== 'undefined' ? pageStartIndex : Const.PAGE_START_INDEX;
- needNewState = true;
- }
-
- if (typeof sizePerPage !== 'undefined') {
- currSizePerPage = sizePerPage;
- needNewState = true;
- }
-
- this.saveToStore(currPage, currSizePerPage);
-
- if (needNewState) {
- if (onPageChange) {
- onPageChange(currPage, currSizePerPage);
- }
- this.setState(() => ({ currPage, currSizePerPage }));
- }
- }
-
- saveToStore(page, sizePerPage) {
- this.props.store.page = page;
- this.props.store.sizePerPage = sizePerPage;
- }
-
- isRemote() {
- const { remote } = this.props;
- return remote === true || (typeof remote === 'object' && remote.pagination);
- }
-
- handleChangePage(currPage) {
- const { currSizePerPage } = this.state;
- const { pagination: { options }, onRemotePageChange } = this.props;
- this.saveToStore(currPage, currSizePerPage);
-
- if (options.onPageChange) {
- options.onPageChange(currPage, currSizePerPage);
- }
- if (this.isRemote()) {
- onRemotePageChange();
- return;
- }
- this.setState(() => {
- return {
- currPage
- };
- });
- }
-
- handleChangeSizePerPage(currSizePerPage, currPage) {
- const { pagination: { options }, onRemotePageChange } = this.props;
- this.saveToStore(currPage, currSizePerPage);
-
- if (options.onSizePerPageChange) {
- options.onSizePerPageChange(currSizePerPage, currPage);
- }
- if (this.isRemote()) {
- onRemotePageChange();
- return;
- }
- this.setState(() => {
- return {
- currPage,
- currSizePerPage
- };
- });
- }
-
- render() {
- const { pagination: { options }, store, baseElement } = this.props;
- const { currPage, currSizePerPage } = this.state;
- const withFirstAndLast = typeof options.withFirstAndLast === 'undefined' ?
- Const.With_FIRST_AND_LAST : options.withFirstAndLast;
- const alwaysShowAllBtns = typeof options.alwaysShowAllBtns === 'undefined' ?
- Const.SHOW_ALL_PAGE_BTNS : options.alwaysShowAllBtns;
- const hideSizePerPage = typeof options.hideSizePerPage === 'undefined' ?
- Const.HIDE_SIZE_PER_PAGE : options.hideSizePerPage;
- const hidePageListOnlyOnePage = typeof options.hidePageListOnlyOnePage === 'undefined' ?
- Const.HIDE_PAGE_LIST_ONLY_ONE_PAGE : options.hidePageListOnlyOnePage;
- const pageStartIndex = typeof options.pageStartIndex === 'undefined' ?
- Const.PAGE_START_INDEX : options.pageStartIndex;
-
- const data = this.isRemote() ?
- this.props.data :
- getByCurrPage(store)(currPage, currSizePerPage, pageStartIndex);
-
- const base = baseElement({
- ...this.props,
- key: 'table',
- data
- });
-
- return [
- base,
-
- ];
- }
-}
-
-export default PaginationWrapper;
diff --git a/packages/react-bootstrap-table2-paginator/style/react-bootstrap-table-paginator.scss b/packages/react-bootstrap-table2-paginator/style/react-bootstrap-table-paginator.scss
deleted file mode 100644
index a99007e6b..000000000
--- a/packages/react-bootstrap-table2-paginator/style/react-bootstrap-table-paginator.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.react-bootstrap-table-page-btns-ul {
- float: right;
- margin-top: 0px;
-}
-
-.react-bootstrap-table-pagination-list-hidden {
- display: none;
-}
diff --git a/packages/react-bootstrap-table2-paginator/test/page-button.test.js b/packages/react-bootstrap-table2-paginator/test/page-button.test.js
deleted file mode 100644
index 4e3d800ba..000000000
--- a/packages/react-bootstrap-table2-paginator/test/page-button.test.js
+++ /dev/null
@@ -1,117 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import PageButton from '../src/page-button';
-
-describe('PageButton', () => {
- let wrapper;
- const onPageChangeCallback = sinon.stub();
- const props = {
- onPageChange: onPageChangeCallback,
- page: 2
- };
-
- describe('default PageButton', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering PageButton correctly', () => {
- expect(wrapper.find('a.page-link').length).toBe(1);
- expect(wrapper.text()).toEqual(`${props.page}`);
- });
-
- describe('when clicking', () => {
- let preventDefault;
- beforeEach(() => {
- preventDefault = sinon.stub();
- wrapper.find('a.page-link').simulate('click', { preventDefault });
- });
-
- afterEach(() => {
- onPageChangeCallback.reset();
- });
-
- it('should calling e.preventDefault', () => {
- expect(preventDefault.calledOnce).toBeTruthy();
- });
-
- it('should calling onPageChange prop', () => {
- expect(onPageChangeCallback.calledOnce).toBeTruthy();
- });
-
- it('should calling onPageChange prop with correct argument', () => {
- expect(onPageChangeCallback.calledWith(props.page)).toBeTruthy();
- });
- });
- });
-
- describe('when active prop is true', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should render PageButton correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.hasClass('active')).toBeTruthy();
- });
- });
-
- describe('when active prop is false', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should render PageButton correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.hasClass('active')).toBeFalsy();
- });
- });
-
- describe('when disabled prop is true', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should render PageButton correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.hasClass('disabled')).toBeTruthy();
- });
- });
-
- describe('when disabled prop is false', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should render PageButton correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.hasClass('disabled')).toBeFalsy();
- });
- });
-
- describe('when title prop is defined', () => {
- const title = 'aTitle';
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should render PageButton correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.prop('title')).toEqual(title);
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/page-resolver.test.js b/packages/react-bootstrap-table2-paginator/test/page-resolver.test.js
deleted file mode 100644
index cb5d5cf6f..000000000
--- a/packages/react-bootstrap-table2-paginator/test/page-resolver.test.js
+++ /dev/null
@@ -1,416 +0,0 @@
-import React, { Component } from 'react';
-import { shallow } from 'enzyme';
-
-import pageResolver from '../src/page-resolver';
-
-const extendTo = Base =>
- class MockComponent extends Base {
- constructor(props) {
- super(props);
- this.state = this.initialState();
- }
- render() { return null; }
- };
-
-describe('PageResolver', () => {
- const ExtendBase = pageResolver(Component);
- const MockComponent = extendTo(ExtendBase);
-
- const createMockProps = () => ({
- dataSize: 100,
- sizePerPageList: [10, 20, 30, 50],
- currPage: 1,
- currSizePerPage: 10,
- pageStartIndex: 1,
- paginationSize: 5,
- withFirstAndLast: true,
- firstPageText: '<<',
- prePageText: '<',
- nextPageText: '>',
- lastPageText: '>>',
- alwaysShowAllBtns: false
- });
-
- let wrapper;
-
- describe('initialize', () => {
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, createMockProps(), null);
- wrapper = shallow(mockElement);
- });
-
- it('should creating initial state correctly', () => {
- const instance = wrapper.instance();
- expect(instance.state.totalPages).toBeDefined();
- expect(instance.state.totalPages).toEqual(instance.calculateTotalPage());
- expect(instance.state.lastPage).toBeDefined();
- expect(instance.state.lastPage).toEqual(
- instance.calculateLastPage(instance.state.totalPages));
- expect(instance.state.dropdownOpen).toBeDefined();
- expect(instance.state.dropdownOpen).toBeFalsy();
- });
- });
-
- describe('backToPrevPage', () => {
- const props = createMockProps();
-
- describe('when props.currPage is not hitting props.pageStartIndex', () => {
- beforeEach(() => {
- props.currPage = 2;
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting previous page correctly', () => {
- const instance = wrapper.instance();
- expect(instance.backToPrevPage()).toEqual(props.currPage - 1);
- });
- });
-
- describe('when props.currPage is hitting props.pageStartIndex', () => {
- beforeEach(() => {
- props.currPage = props.pageStartIndex;
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should always getting page which must eq props.pageStartIndex', () => {
- const instance = wrapper.instance();
- expect(instance.backToPrevPage()).toEqual(props.pageStartIndex);
- });
- });
- });
-
- describe('goToNextPage', () => {
- const props = createMockProps();
-
- describe('when props.currPage is not hitting state.lastPage', () => {
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting previous page correctly', () => {
- const instance = wrapper.instance();
- expect(instance.goToNextPage()).toEqual(props.currPage + 1);
- });
- });
-
- describe('when props.currPage is hitting state.lastpage', () => {
- beforeEach(() => {
- props.currPage = 10;
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should always getting page which must eq props.pageStartIndex', () => {
- const instance = wrapper.instance();
- expect(instance.goToNextPage()).toEqual(instance.state.lastPage);
- });
- });
- });
-
- describe('calculateTotalPage', () => {
- const props = createMockProps();
-
- describe('when missing sizePerPage argument', () => {
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting total pages correctly by default props.currSizePerPage', () => {
- const instance = wrapper.instance();
- expect(instance.calculateTotalPage()).toEqual(10);
- });
- });
-
- describe('when sizePerPage argument given', () => {
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting total pages correctly by sizePerPage argument', () => {
- const instance = wrapper.instance();
- expect(instance.calculateTotalPage(25)).toEqual(4);
- });
- });
- });
-
- describe('calculateLastPage', () => {
- beforeEach(() => {
- const props = createMockProps();
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting last page correctly', () => {
- const instance = wrapper.instance();
- expect(instance.calculateLastPage(instance.state.totalPages)).toEqual(10);
- });
- });
-
- describe('calculatePages', () => {
- describe('calculate by state.totalPages and state.lastPage', () => {
- const props = createMockProps();
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting pages list correctly', () => {
- const instance = wrapper.instance();
- expect(instance.calculatePages()).toEqual(
- [props.prePageText, 1, 2, 3, 4, 5, props.nextPageText, props.lastPageText]);
-
- expect(instance.calculatePages(4, 4)).toEqual(
- [props.prePageText, 1, 2, 3, 4, props.nextPageText]);
- });
- });
-
- describe('calculate by props.currPage', () => {
- const props = createMockProps();
- const { firstPageText, prePageText, nextPageText, lastPageText } = props;
-
- it('should getting pages list correctly', () => {
- const currPages = Array.from(Array(10).keys());
- currPages.forEach((currPage) => {
- props.currPage = currPage + 1;
- wrapper = shallow( );
- const pageList = wrapper.instance().calculatePages();
-
- if (props.currPage < 4) {
- expect(pageList).toEqual(
- [prePageText, 1, 2, 3, 4, 5, nextPageText, lastPageText]);
- } else if (props.currPage > 7) {
- expect(pageList).toEqual(
- [firstPageText, prePageText, 6, 7, 8, 9, 10, nextPageText]);
- } else if (props.currPage === 4) {
- expect(pageList).toEqual(
- [firstPageText, prePageText, 2, 3, 4, 5, 6, nextPageText, lastPageText]);
- } else if (props.currPage === 5) {
- expect(pageList).toEqual(
- [firstPageText, prePageText, 3, 4, 5, 6, 7, nextPageText, lastPageText]);
- } else if (props.currPage === 6) {
- expect(pageList).toEqual(
- [firstPageText, prePageText, 4, 5, 6, 7, 8, nextPageText, lastPageText]);
- } else {
- expect(pageList).toEqual(
- [firstPageText, prePageText, 5, 6, 7, 8, 9, nextPageText, lastPageText]);
- }
- });
- });
- });
-
- describe('the quantity of pages is calculated by props.paginationSize', () => {
- const props = createMockProps();
- const indicators = [
- props.firstPageText, props.prePageText, props.lastPageText, props.nextPageText
- ];
-
- it('should getting pages list correctly', () => {
- [1, 3, 5, 8, 10].forEach((paginationSize) => {
- props.paginationSize = paginationSize;
- wrapper = shallow( );
- const pageList = wrapper.instance().calculatePages();
- const result = pageList.filter(p => indicators.indexOf(p) === -1);
- expect(result.length).toEqual(props.paginationSize);
- });
- });
- });
-
- describe('when props.withFirstAndLast is true', () => {
- const props = createMockProps();
- describe('and last page is not visible by props.currPage', () => {
- it('should getting pages list which contain last page indication', () => {
- [1, 2, 3, 4, 5, 6, 7].forEach((currPage) => {
- props.currPage = currPage;
- wrapper = shallow( );
- const pageList = wrapper.instance().calculatePages();
- expect(pageList.indexOf(props.lastPageText) > -1).toBeTruthy();
- });
- });
- });
-
- describe('and first page is not visible by props.currPage', () => {
- it('should getting pages list which contain first page indication', () => {
- [10, 9, 8, 7, 6, 5, 4].forEach((currPage) => {
- props.currPage = currPage;
- wrapper = shallow( );
- const pageList = wrapper.instance().calculatePages();
- expect(pageList.indexOf(props.firstPageText) > -1).toBeTruthy();
- });
- });
- });
- });
-
- describe('when props.withFirstAndLast is false', () => {
- const props = createMockProps();
- it('should not contain first and last page indication always', () => {
- const currPages = Array.from(Array(10).keys());
- currPages.forEach((currPage) => {
- props.currPage = currPage + 1;
- props.withFirstAndLast = false;
- wrapper = shallow( );
- const pageList = wrapper.instance().calculatePages();
- expect(pageList.indexOf(props.lastPageText) > -1).toBeFalsy();
- expect(pageList.indexOf(props.firstPageText) > -1).toBeFalsy();
- });
- });
- });
-
- describe('when props.pageStartIndex is negative number', () => {
- const props = createMockProps();
- props.pageStartIndex = -2;
- props.currPage = -2;
-
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting last page correctly', () => {
- const pageList = wrapper.instance().calculatePages();
- expect(pageList).toEqual(
- [props.prePageText, -2, -1, 0, 1, 2, props.nextPageText, props.lastPageText]);
- });
- });
-
- describe('when props.alwaysShowAllBtns is true', () => {
- const props = createMockProps();
- props.alwaysShowAllBtns = true;
- props.currPage = 1;
- props.dataSize = 11;
-
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should always having next and previous page indication', () => {
- const pageList = wrapper.instance().calculatePages();
- expect(pageList.indexOf(props.nextPageText) > -1).toBeTruthy();
- expect(pageList.indexOf(props.prePageText) > -1).toBeTruthy();
- });
- });
-
- describe('when state.totalPages is zero', () => {
- const props = createMockProps();
- props.dataSize = 0;
-
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting empty array', () => {
- expect(wrapper.instance().calculatePages()).toEqual([]);
- });
- });
- });
-
- describe('calculatePageStatus', () => {
- let instance;
- let pageStatus;
-
- describe('default case', () => {
- const props = createMockProps();
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- instance = wrapper.instance();
- pageStatus = instance.calculatePageStatus(instance.calculatePages());
- });
-
- it('should returning correct format for page status', () => {
- pageStatus.forEach((p) => {
- expect(Object.prototype.hasOwnProperty.call(p, 'page')).toBeTruthy();
- expect(Object.prototype.hasOwnProperty.call(p, 'active')).toBeTruthy();
- expect(Object.prototype.hasOwnProperty.call(p, 'disabled')).toBeTruthy();
- expect(Object.prototype.hasOwnProperty.call(p, 'title')).toBeTruthy();
- });
- });
-
- it('should mark active status as true when it is props.currPage', () => {
- expect(pageStatus.find(p => p.page === props.currPage).active).toBeTruthy();
- });
-
- it('only have one page\'s active status is true', () => {
- expect(pageStatus.filter(p => p.page === props.currPage).length).toEqual(1);
- });
- });
-
- describe('when alwaysShowAllBtns is false', () => {
- const props = createMockProps();
- describe('and props.currPage is on first page', () => {
- it('should filter out previous page indication', () => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- instance = wrapper.instance();
- const pageList = instance.calculatePages();
- pageStatus = instance.calculatePageStatus(pageList);
-
- expect(pageStatus.find(p => p.page === props.prePageText)).not.toBeDefined();
- });
- });
-
- describe('and props.currPage is on last page', () => {
- it('should filter out next page indication', () => {
- props.currPage = 10;
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- instance = wrapper.instance();
- const pageList = instance.calculatePages();
- pageStatus = instance.calculatePageStatus(pageList);
-
- expect(pageStatus.find(p => p.page === props.nextPageText)).not.toBeDefined();
- });
- });
- });
- });
-
- describe('calculateSizePerPageStatus', () => {
- describe('when props.sizePerPageList is an number array', () => {
- const props = createMockProps();
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting correctly sizePerPage status', () => {
- const instance = wrapper.instance();
- const result = instance.calculateSizePerPageStatus();
- expect(result.length).toEqual(props.sizePerPageList.length);
- result.forEach((sizePerPage, i) => {
- expect(sizePerPage.text).toEqual(`${props.sizePerPageList[i]}`);
- expect(sizePerPage.page).toEqual(props.sizePerPageList[i]);
- });
- });
- });
-
- describe('when props.sizePerPageList is an object array', () => {
- const props = createMockProps();
- props.sizePerPageList = [{
- text: 'ten', value: 10
- }, {
- text: 'thirty', value: 30
- }];
-
- beforeEach(() => {
- const mockElement = React.createElement(MockComponent, props, null);
- wrapper = shallow(mockElement);
- });
-
- it('should getting correctly sizePerPage status', () => {
- const instance = wrapper.instance();
- const result = instance.calculateSizePerPageStatus();
- expect(result.length).toEqual(props.sizePerPageList.length);
- result.forEach((sizePerPage, i) => {
- expect(sizePerPage.text).toEqual(props.sizePerPageList[i].text);
- expect(sizePerPage.page).toEqual(props.sizePerPageList[i].value);
- });
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/page.test.js b/packages/react-bootstrap-table2-paginator/test/page.test.js
deleted file mode 100644
index f073c865d..000000000
--- a/packages/react-bootstrap-table2-paginator/test/page.test.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import Store from 'react-bootstrap-table2/src/store';
-import { getByCurrPage } from '../src/page';
-
-describe('Page Functions', () => {
- let data;
- let store;
- const params = [
- // [page, sizePerPage, pageStartIndex]
- [1, 10, 1],
- [1, 25, 1],
- [1, 30, 1],
- [3, 30, 1],
- [4, 30, 1],
- [10, 10, 1],
- [0, 10, 0],
- [1, 10, 0],
- [9, 10, 0]
- ];
-
- describe('getByCurrPage', () => {
- beforeEach(() => {
- data = [];
- for (let i = 0; i < 100; i += 1) {
- data.push({ id: i, name: `test_name${i}` });
- }
- store = new Store('id');
- store.data = data;
- });
-
- it('should always return correct data', () => {
- params.forEach(([page, sizePerPage, pageStartIndex]) => {
- const rows = getByCurrPage(store)(page, sizePerPage, pageStartIndex);
- expect(rows).toBeDefined();
- expect(Array.isArray(rows)).toBeTruthy();
- expect(rows.every(row => !!row)).toBeTruthy();
- });
- });
-
- it('should return empty array when store.data is empty', () => {
- store.data = [];
- params.forEach(([page, sizePerPage, pageStartIndex]) => {
- const rows = getByCurrPage(store)(page, sizePerPage, pageStartIndex);
- expect(rows).toHaveLength(0);
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/pagination-list.test.js b/packages/react-bootstrap-table2-paginator/test/pagination-list.test.js
deleted file mode 100644
index 054500635..000000000
--- a/packages/react-bootstrap-table2-paginator/test/pagination-list.test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import PageButton from '../src/page-button';
-import PaginationList from '../src/pagination-list';
-
-describe('PaginationList', () => {
- let wrapper;
- const onPageChange = sinon.stub();
- const pages = [{
- page: 1,
- active: false,
- disabled: false,
- title: '1'
- }, {
- page: 2,
- active: true,
- disabled: false,
- title: '2'
- }, {
- page: 3,
- active: false,
- disabled: false,
- title: '3'
- }];
-
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering PaginatonList correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('ul.react-bootstrap-table-page-btns-ul').length).toBe(1);
- expect(wrapper.find(PageButton).length).toBe(pages.length);
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/pagination.test.js b/packages/react-bootstrap-table2-paginator/test/pagination.test.js
deleted file mode 100644
index a9e5d35f8..000000000
--- a/packages/react-bootstrap-table2-paginator/test/pagination.test.js
+++ /dev/null
@@ -1,288 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import SizePerPageDropDown from '../src/size-per-page-dropdown';
-import PaginationList from '../src/pagination-list';
-import Pagination from '../src/pagination';
-
-describe('Pagination', () => {
- let wrapper;
- let instance;
-
- const createMockProps = props => ({
- dataSize: 100,
- sizePerPageList: [10, 20, 30, 50],
- currPage: 1,
- currSizePerPage: 10,
- pageStartIndex: 1,
- paginationSize: 5,
- withFirstAndLast: true,
- firstPageText: '<<',
- prePageText: '<',
- nextPageText: '>',
- lastPageText: '>>',
- alwaysShowAllBtns: false,
- onPageChange: sinon.stub(),
- onSizePerPageChange: sinon.stub(),
- hidePageListOnlyOnePage: false,
- hideSizePerPage: false,
- ...props
- });
-
- describe('default pagiantion', () => {
- const props = createMockProps();
-
- beforeEach(() => {
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should rendering correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.hasClass('react-bootstrap-table-pagination')).toBeTruthy();
- expect(wrapper.find('.react-bootstrap-table-pagination-list-hidden').length).toBe(0);
- });
-
- it('should having correct state', () => {
- expect(instance.state).toBeDefined();
- expect(instance.state.totalPages).toEqual(instance.calculateTotalPage());
- expect(instance.state.lastPage).toEqual(
- instance.calculateLastPage(instance.state.totalPages));
- expect(instance.state.dropdownOpen).toBeFalsy();
- });
-
- it('should rendering PaginationList component successfully', () => {
- const paginationList = wrapper.find(PaginationList);
- expect(paginationList.length).toBe(1);
- expect(paginationList.prop('pages')).toEqual(instance.calculatePageStatus(instance.calculatePages()));
- expect(paginationList.prop('onPageChange')).toEqual(instance.handleChangePage);
- });
-
- it('should rendering SizePerPageDropDown component successfully', () => {
- const sizePerPageDropDown = wrapper.find(SizePerPageDropDown);
- expect(sizePerPageDropDown.length).toBe(1);
-
- expect(sizePerPageDropDown.prop('currSizePerPage')).toEqual(`${props.currSizePerPage}`);
- expect(sizePerPageDropDown.prop('options')).toEqual(instance.calculateSizePerPageStatus());
- expect(sizePerPageDropDown.prop('onSizePerPageChange')).toEqual(instance.handleChangeSizePerPage);
- expect(sizePerPageDropDown.prop('onClick')).toEqual(instance.toggleDropDown);
- expect(sizePerPageDropDown.prop('open')).toEqual(instance.state.dropdownOpen);
- });
- });
-
- describe('when props.sizePerPageList is empty array', () => {
- beforeEach(() => {
- const props = createMockProps({ sizePerPageList: [] });
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should not rendering SizePerPageDropDown component', () => {
- const sizePerPageDropDown = wrapper.find(SizePerPageDropDown);
- expect(sizePerPageDropDown.length).toBe(0);
- });
- });
-
- describe('when props.hideSizePerPage is true', () => {
- beforeEach(() => {
- const props = createMockProps({ hideSizePerPage: true });
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should not rendering SizePerPageDropDown component', () => {
- const sizePerPageDropDown = wrapper.find(SizePerPageDropDown);
- expect(sizePerPageDropDown.length).toBe(0);
- });
- });
-
- describe('when props.hidePageListOnlyOnePage is true', () => {
- beforeEach(() => {
- const props = createMockProps({ hidePageListOnlyOnePage: true, dataSize: 7 });
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should find react-bootstrap-table-pagination-list-hidden class when only one page', () => {
- expect(wrapper.find('.react-bootstrap-table-pagination-list-hidden').length).toBe(1);
- });
- });
-
- describe('componentWillReceiveProps', () => {
- describe('when next props.currSizePerPage is diff than current one', () => {
- const nextProps = createMockProps({ currSizePerPage: 20 });
-
- beforeEach(() => {
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should setting correct state.totalPages', () => {
- instance.componentWillReceiveProps(nextProps);
- expect(instance.state.totalPages).toEqual(
- instance.calculateTotalPage(nextProps.currSizePerPage));
- });
-
- it('should setting correct state.lastPage', () => {
- instance.componentWillReceiveProps(nextProps);
- const totalPages = instance.calculateTotalPage(nextProps.currSizePerPage);
- expect(instance.state.lastPage).toEqual(
- instance.calculateLastPage(totalPages));
- });
- });
-
- describe('when next props.dataSize is diff than current one', () => {
- const nextProps = createMockProps({ dataSize: 33 });
-
- beforeEach(() => {
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should setting correct state.totalPages', () => {
- instance.componentWillReceiveProps(nextProps);
- expect(instance.state.totalPages).toEqual(
- instance.calculateTotalPage(nextProps.currSizePerPage, nextProps.dataSize));
- });
-
- it('should setting correct state.lastPage', () => {
- instance.componentWillReceiveProps(nextProps);
- const totalPages = instance.calculateTotalPage(
- nextProps.currSizePerPage, nextProps.dataSize);
- expect(instance.state.lastPage).toEqual(
- instance.calculateLastPage(totalPages));
- });
- });
- });
-
- describe('toggleDropDown', () => {
- beforeEach(() => {
- const props = createMockProps();
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should setting state.dropdownOpen as true when it is false', () => {
- instance.toggleDropDown();
- expect(instance.state.dropdownOpen).toBeTruthy();
- });
-
- it('should setting state.dropdownOpen as false when it is true', () => {
- instance.toggleDropDown();
- instance.toggleDropDown();
- expect(instance.state.dropdownOpen).toBeFalsy();
- });
- });
-
- describe('closeDropDown', () => {
- beforeEach(() => {
- const props = createMockProps();
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should always setting state.dropdownOpen as false', () => {
- instance.closeDropDown();
- expect(instance.state.dropdownOpen).toBeFalsy();
- instance.closeDropDown();
- expect(instance.state.dropdownOpen).toBeFalsy();
- });
- });
-
- describe('handleChangeSizePerPage', () => {
- const props = createMockProps();
-
- beforeEach(() => {
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should always setting state.dropdownOpen to false', () => {
- instance.handleChangeSizePerPage(10);
- expect(instance.state.dropdownOpen).toBeFalsy();
- });
-
- describe('when new sizePerPage is same as current one', () => {
- it('should not calling props.onSizePerPageChange callback', () => {
- instance.handleChangeSizePerPage(10);
- expect(props.onSizePerPageChange.callCount).toBe(0);
- });
- });
-
- describe('when new sizePerPage is diff than current one', () => {
- it('should not calling props.onSizePerPageChange callback', () => {
- instance.handleChangeSizePerPage(30);
- expect(props.onSizePerPageChange.callCount).toBe(1);
- });
-
- describe('and new current page is still in the new lagination list', () => {
- it('should calling props.onSizePerPageChange with correct argument', () => {
- expect(props.onSizePerPageChange.calledWith(30, props.currPage));
- });
- });
-
- describe('and new current page is still in the new lagination list', () => {
- beforeEach(() => {
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- it('should calling props.onSizePerPageChange with correct argument', () => {
- expect(props.onSizePerPageChange.calledWith(30, 4));
- });
- });
- });
- });
-
- describe('handleChangePage', () => {
- const props = createMockProps();
-
- beforeEach(() => {
- props.currPage = 6;
- wrapper = shallow( );
- instance = wrapper.instance();
- });
-
- afterEach(() => {
- props.onPageChange.reset();
- });
-
- it('should calling props.onPageChange correctly when new page is eq props.prePageText', () => {
- instance.handleChangePage(props.prePageText);
- expect(props.onPageChange.callCount).toBe(1);
- expect(props.onPageChange.calledWith(5)).toBeTruthy();
- });
-
- it('should calling props.onPageChange correctly when new page is eq props.nextPageText', () => {
- instance.handleChangePage(props.nextPageText);
- expect(props.onPageChange.callCount).toBe(1);
- expect(props.onPageChange.calledWith(7)).toBeTruthy();
- });
-
- it('should calling props.onPageChange correctly when new page is eq props.lastPageText', () => {
- instance.handleChangePage(props.lastPageText);
- expect(props.onPageChange.callCount).toBe(1);
- expect(props.onPageChange.calledWith(10)).toBeTruthy();
- });
-
- it('should calling props.onPageChange correctly when new page is eq props.firstPageText', () => {
- instance.handleChangePage(props.firstPageText);
- expect(props.onPageChange.callCount).toBe(1);
- expect(props.onPageChange.calledWith(props.pageStartIndex)).toBeTruthy();
- });
-
- it('should calling props.onPageChange correctly when new page is a numeric page', () => {
- const newPage = '8';
- instance.handleChangePage(newPage);
- expect(props.onPageChange.callCount).toBe(1);
- expect(props.onPageChange.calledWith(parseInt(newPage, 10))).toBeTruthy();
- });
-
- it('should not calling props.onPageChange correctly when page is not changed', () => {
- const newPage = props.currPage;
- instance.handleChangePage(newPage);
- expect(props.onPageChange.callCount).toBe(0);
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/size-per-page-dropdown.test.js b/packages/react-bootstrap-table2-paginator/test/size-per-page-dropdown.test.js
deleted file mode 100644
index 21e11cc53..000000000
--- a/packages/react-bootstrap-table2-paginator/test/size-per-page-dropdown.test.js
+++ /dev/null
@@ -1,127 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import SizePerPageOption from '../src/size-per-page-option';
-import SizePerPageDropDown from '../src/size-per-page-dropdown';
-
-describe('SizePerPageDropDown', () => {
- let wrapper;
- const currSizePerPage = '25';
- const options = [{
- text: '10',
- page: 10
- }, {
- text: '25',
- page: 25
- }];
- const onClick = sinon.stub();
- const onBlur = sinon.stub();
- const onSizePerPageChange = sinon.stub();
- const props = {
- currSizePerPage,
- options,
- onClick,
- onBlur,
- onSizePerPageChange
- };
-
- describe('default SizePerPageDropDown component', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering SizePerPageDropDown correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('button').length).toBe(1);
- expect(wrapper.find('button').text()).toEqual(`${currSizePerPage} `);
- });
-
- it('should rendering SizePerPageOption successfully', () => {
- expect(wrapper.find('ul.dropdown-menu').length).toBe(1);
- const sizePerPageOptions = wrapper.find(SizePerPageOption);
- expect(sizePerPageOptions.length).toBe(options.length);
- sizePerPageOptions.forEach((sizePerPage, i) => {
- const option = options[i];
- expect(sizePerPage.prop('text')).toEqual(option.text);
- expect(sizePerPage.prop('page')).toEqual(option.page);
- expect(sizePerPage.prop('onSizePerPageChange')).toEqual(onSizePerPageChange);
- });
- });
-
- it('default variation is dropdown', () => {
- expect(wrapper.hasClass('dropdown')).toBeTruthy();
- });
-
- it('default dropdown is not open', () => {
- expect(wrapper.hasClass('open show')).toBeFalsy();
- expect(wrapper.find('[aria-expanded=false]').length).toBe(1);
- });
- });
-
- describe('when open prop is true', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering SizePerPageDropDown correctly', () => {
- expect(wrapper.hasClass('open show')).toBeTruthy();
- expect(wrapper.find('[aria-expanded=true]').length).toBe(1);
- });
- });
-
- describe('when hidden prop is true', () => {
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering SizePerPageDropDown correctly', () => {
- expect(wrapper.prop('style')).toEqual({ visibility: 'hidden' });
- });
- });
-
- describe('when btnContextual prop is defined', () => {
- const contextual = 'btn-warning';
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering SizePerPageDropDown correctly', () => {
- expect(wrapper.find(`button.${contextual}`).length).toBe(1);
- });
- });
-
- describe('when variation prop is defined', () => {
- const variation = 'dropup';
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering SizePerPageDropDown correctly', () => {
- expect(wrapper.hasClass(variation)).toBeTruthy();
- });
- });
-
- describe('when className prop is defined', () => {
- const className = 'custom-class';
- beforeEach(() => {
- wrapper = shallow(
-
- );
- });
-
- it('should rendering SizePerPageDropDown correctly', () => {
- expect(wrapper.hasClass(className)).toBeTruthy();
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/size-per-page-option.test.js b/packages/react-bootstrap-table2-paginator/test/size-per-page-option.test.js
deleted file mode 100644
index 8e4daeb0e..000000000
--- a/packages/react-bootstrap-table2-paginator/test/size-per-page-option.test.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import SizePerPageOption from '../src/size-per-page-option';
-
-describe('SizePerPageOption', () => {
- let wrapper;
- const text = 'page1';
- const page = 1;
- const onSizePerPageChange = sinon.stub();
-
- beforeEach(() => {
- const props = { text, page, onSizePerPageChange };
- wrapper = shallow(
-
- );
- });
-
- it('should render SizePerPageOption correctly', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('.dropdown-item').length).toBe(1);
- expect(wrapper.find(`[data-page=${page}]`).length).toBe(1);
- expect(wrapper.text()).toEqual(text);
- });
-
- describe('when MouseDown event happen', () => {
- const preventDefault = sinon.stub();
- beforeEach(() => {
- wrapper.find('a').simulate('mousedown', { preventDefault });
- });
-
- it('should calling props.onSizePerPageChange correctly', () => {
- expect(preventDefault.calledOnce).toBeTruthy();
- expect(onSizePerPageChange.calledOnce).toBeTruthy();
- expect(onSizePerPageChange.calledWith(page)).toBeTruthy();
- });
- });
-});
diff --git a/packages/react-bootstrap-table2-paginator/test/wrapper.test.js b/packages/react-bootstrap-table2-paginator/test/wrapper.test.js
deleted file mode 100644
index 947971da0..000000000
--- a/packages/react-bootstrap-table2-paginator/test/wrapper.test.js
+++ /dev/null
@@ -1,629 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-
-import BootstrapTable from 'react-bootstrap-table2/src/bootstrap-table';
-import Store from 'react-bootstrap-table2/src/store';
-import paginator from '../src';
-import PaginationWrapper from '../src/wrapper';
-import Pagination from '../src/pagination';
-import Const from '../src/const';
-
-const data = [];
-for (let i = 0; i < 100; i += 1) {
- data.push({
- id: i,
- name: `itme name ${i}`
- });
-}
-
-describe('Wrapper', () => {
- let wrapper;
- let instance;
- const onRemotePageChangeCB = sinon.stub();
-
- afterEach(() => {
- onRemotePageChangeCB.reset();
- });
-
- const createTableProps = (props = {}) => {
- const tableProps = {
- keyField: 'id',
- columns: [{
- dataField: 'id',
- text: 'ID'
- }, {
- dataField: 'name',
- text: 'Name'
- }],
- data,
- pagination: paginator(props.options),
- store: new Store('id'),
- onRemotePageChange: onRemotePageChangeCB
- };
- tableProps.store.data = data;
- return tableProps;
- };
-
- const pureTable = props => ( );
-
- const createPaginationWrapper = (props, renderFragment = true) => {
- wrapper = shallow( );
- instance = wrapper.instance();
- if (renderFragment) {
- const fragment = instance.render();
- wrapper = shallow({ fragment }
);
- }
- };
-
- describe('default pagination', () => {
- const props = createTableProps();
-
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering correctly', () => {
- expect(wrapper.length).toBe(1);
- });
-
- it('should initializing state correctly', () => {
- expect(instance.state.currPage).toBeDefined();
- expect(instance.state.currPage).toEqual(Const.PAGE_START_INDEX);
- expect(instance.state.currSizePerPage).toBeDefined();
- expect(instance.state.currSizePerPage).toEqual(Const.SIZE_PER_PAGE_LIST[0]);
- });
-
- it('should saving page and sizePerPage to store correctly', () => {
- expect(props.store.page).toBe(instance.state.currPage);
- expect(props.store.sizePerPage).toBe(instance.state.currSizePerPage);
- });
-
- it('should rendering BootstraTable correctly', () => {
- const table = wrapper.find(BootstrapTable);
- expect(table.length).toBe(1);
- expect(table.prop('data').length).toEqual(instance.state.currSizePerPage);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('dataSize')).toEqual(props.store.data.length);
- expect(pagination.prop('currPage')).toEqual(instance.state.currPage);
- expect(pagination.prop('currSizePerPage')).toEqual(instance.state.currSizePerPage);
- expect(pagination.prop('onPageChange')).toEqual(instance.handleChangePage);
- expect(pagination.prop('onSizePerPageChange')).toEqual(instance.handleChangeSizePerPage);
- expect(pagination.prop('sizePerPageList')).toEqual(Const.SIZE_PER_PAGE_LIST);
- expect(pagination.prop('paginationSize')).toEqual(Const.PAGINATION_SIZE);
- expect(pagination.prop('pageStartIndex')).toEqual(Const.PAGE_START_INDEX);
- expect(pagination.prop('withFirstAndLast')).toEqual(Const.With_FIRST_AND_LAST);
- expect(pagination.prop('alwaysShowAllBtns')).toEqual(Const.SHOW_ALL_PAGE_BTNS);
- expect(pagination.prop('firstPageText')).toEqual(Const.FIRST_PAGE_TEXT);
- expect(pagination.prop('prePageText')).toEqual(Const.PRE_PAGE_TEXT);
- expect(pagination.prop('nextPageText')).toEqual(Const.NEXT_PAGE_TEXT);
- expect(pagination.prop('lastPageText')).toEqual(Const.LAST_PAGE_TEXT);
- expect(pagination.prop('firstPageTitle')).toEqual(Const.FIRST_PAGE_TITLE);
- expect(pagination.prop('prePageTitle')).toEqual(Const.PRE_PAGE_TITLE);
- expect(pagination.prop('nextPageTitle')).toEqual(Const.NEXT_PAGE_TITLE);
- expect(pagination.prop('lastPageTitle')).toEqual(Const.LAST_PAGE_TITLE);
- expect(pagination.prop('hideSizePerPage')).toEqual(Const.HIDE_SIZE_PER_PAGE);
- });
-
- describe('componentWillReceiveProps', () => {
- let nextProps;
- beforeEach(() => {
- nextProps = createTableProps();
- });
-
- describe('when options.page is existing', () => {
- beforeEach(() => {
- nextProps.pagination.options.page = 2;
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting currPage state correctly', () => {
- expect(instance.state.currPage).toEqual(nextProps.pagination.options.page);
- });
-
- it('should saving store.page correctly', () => {
- expect(props.store.page).toEqual(instance.state.currPage);
- });
- });
-
- it('should not setting currPage state if options.page not existing', () => {
- const { currPage } = instance.state;
- instance.componentWillReceiveProps(nextProps);
- expect(instance.state.currPage).toBe(currPage);
- });
-
- describe('when options.sizePerPage is existing', () => {
- beforeEach(() => {
- nextProps.pagination.options.sizePerPage = 20;
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting currSizePerPage state correctly', () => {
- expect(instance.state.currSizePerPage).toEqual(nextProps.pagination.options.sizePerPage);
- });
-
- it('should saving store.sizePerPage correctly', () => {
- expect(props.store.sizePerPage).toEqual(instance.state.currSizePerPage);
- });
- });
-
- it('should not setting currSizePerPage state if options.sizePerPage not existing', () => {
- const { currSizePerPage } = instance.state;
- instance.componentWillReceiveProps(nextProps);
- expect(instance.state.currSizePerPage).toBe(currSizePerPage);
- });
-
- describe('when nextProps.isDataChanged is true', () => {
- beforeEach(() => {
- nextProps.isDataChanged = true;
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting currPage state correctly', () => {
- expect(instance.state.currPage).toBe(Const.PAGE_START_INDEX);
- });
-
- it('should saving store.page correctly', () => {
- expect(props.store.page).toEqual(instance.state.currPage);
- });
- });
-
- describe('when nextProps.isDataChanged is true and options.pageStartIndex is existing', () => {
- beforeEach(() => {
- nextProps.isDataChanged = true;
- nextProps.pagination.options.pageStartIndex = 0;
- instance.componentWillReceiveProps(nextProps);
- });
-
- it('should setting currPage state correctly', () => {
- expect(instance.state.currPage).toBe(nextProps.pagination.options.pageStartIndex);
- });
-
- it('should saving store.page correctly', () => {
- expect(props.store.page).toEqual(instance.state.currPage);
- });
- });
- });
- });
-
- describe('when options.page is defined', () => {
- const page = 3;
- const props = createTableProps({ options: { page } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should setting correct state.currPage', () => {
- expect(instance.state.currPage).toEqual(page);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('currPage')).toEqual(page);
- });
- });
-
- describe('when options.sizePerPage is defined', () => {
- const sizePerPage = 30;
- const props = createTableProps({ options: { sizePerPage } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should setting correct state.currPage', () => {
- expect(instance.state.currSizePerPage).toEqual(sizePerPage);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('currSizePerPage')).toEqual(sizePerPage);
- });
- });
-
- describe('when options.totalSize is defined', () => {
- const totalSize = 100;
- const props = createTableProps({ options: { totalSize } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('dataSize')).toEqual(totalSize);
- });
- });
-
- describe('when options.pageStartIndex is defined', () => {
- const pageStartIndex = -1;
- const props = createTableProps({ options: { pageStartIndex } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should setting correct state.currPage', () => {
- expect(instance.state.currPage).toEqual(pageStartIndex);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('pageStartIndex')).toEqual(pageStartIndex);
- });
- });
-
- describe('when options.sizePerPageList is defined', () => {
- const sizePerPageList = [10, 40];
- const props = createTableProps({ options: { sizePerPageList } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('sizePerPageList')).toEqual(sizePerPageList);
- });
- });
-
- describe('when options.paginationSize is defined', () => {
- const paginationSize = 10;
- const props = createTableProps({ options: { paginationSize } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('paginationSize')).toEqual(paginationSize);
- });
- });
-
- describe('when options.withFirstAndLast is defined', () => {
- const withFirstAndLast = false;
- const props = createTableProps({ options: { withFirstAndLast } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('withFirstAndLast')).toEqual(withFirstAndLast);
- });
- });
-
- describe('when options.alwaysShowAllBtns is defined', () => {
- const alwaysShowAllBtns = true;
- const props = createTableProps({ options: { alwaysShowAllBtns } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('alwaysShowAllBtns')).toEqual(alwaysShowAllBtns);
- });
- });
-
- describe('when options.firstPageText is defined', () => {
- const firstPageText = '1st';
- const props = createTableProps({ options: { firstPageText } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('firstPageText')).toEqual(firstPageText);
- });
- });
-
- describe('when options.prePageText is defined', () => {
- const prePageText = 'PRE';
- const props = createTableProps({ options: { prePageText } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('prePageText')).toEqual(prePageText);
- });
- });
-
- describe('when options.nextPageText is defined', () => {
- const nextPageText = 'NEXT';
- const props = createTableProps({ options: { nextPageText } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('nextPageText')).toEqual(nextPageText);
- });
- });
-
- describe('when options.lastPageText is defined', () => {
- const lastPageText = 'nth';
- const props = createTableProps({ options: { lastPageText } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('lastPageText')).toEqual(lastPageText);
- });
- });
-
- describe('when options.firstPageTitle is defined', () => {
- const firstPageTitle = '1st';
- const props = createTableProps({ options: { firstPageTitle } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('firstPageTitle')).toEqual(firstPageTitle);
- });
- });
-
- describe('when options.prePageTitle is defined', () => {
- const prePageTitle = 'PRE';
- const props = createTableProps({ options: { prePageTitle } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('prePageTitle')).toEqual(prePageTitle);
- });
- });
-
- describe('when options.nextPageTitle is defined', () => {
- const nextPageTitle = 'NEXT';
- const props = createTableProps({ options: { nextPageTitle } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('nextPageTitle')).toEqual(nextPageTitle);
- });
- });
-
- describe('when options.lastPageTitle is defined', () => {
- const lastPageTitle = 'nth';
- const props = createTableProps({ options: { lastPageTitle } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('lastPageTitle')).toEqual(lastPageTitle);
- });
- });
-
- describe('when options.hideSizePerPage is defined', () => {
- const hideSizePerPage = true;
- const props = createTableProps({ options: { hideSizePerPage } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('hideSizePerPage')).toEqual(hideSizePerPage);
- });
- });
-
- describe('when options.hidePageListOnlyOnePage is defined', () => {
- const hidePageListOnlyOnePage = true;
- const props = createTableProps({ options: { hidePageListOnlyOnePage } });
- beforeEach(() => {
- createPaginationWrapper(props);
- });
-
- it('should rendering Pagination correctly', () => {
- const pagination = wrapper.find(Pagination);
- expect(wrapper.length).toBe(1);
- expect(pagination.length).toBe(1);
- expect(pagination.prop('hidePageListOnlyOnePage')).toEqual(hidePageListOnlyOnePage);
- });
- });
-
- describe('handleChangePage', () => {
- const newPage = 3;
- const props = createTableProps({ options: { onPageChange: sinon.stub() } });
- beforeEach(() => {
- createPaginationWrapper(props, false);
- instance.handleChangePage(newPage);
- });
-
- afterEach(() => {
- props.pagination.options.onPageChange.reset();
- });
-
- it('should setting state.currPage correctly', () => {
- expect(instance.state.currPage).toEqual(newPage);
- });
-
- it('should calling options.onPageChange correctly when it is defined', () => {
- const { onPageChange } = props.pagination.options;
- expect(onPageChange.calledOnce).toBeTruthy();
- expect(onPageChange.calledWith(newPage, instance.state.currSizePerPage)).toBeTruthy();
- });
-
- it('should saving page and sizePerPage to store correctly', () => {
- expect(props.store.page).toBe(newPage);
- expect(props.store.sizePerPage).toBe(instance.state.currSizePerPage);
- });
-
- describe('when pagination remote is enable', () => {
- beforeEach(() => {
- props.remote = true;
- createPaginationWrapper(props, false);
- onRemotePageChangeCB.reset();
- instance.handleChangePage(newPage);
- });
-
- it('should not setting state.currPage', () => {
- expect(instance.state.currPage).not.toEqual(newPage);
- });
-
- it('should calling props.onRemotePageChange correctly', () => {
- expect(onRemotePageChangeCB.calledOnce).toBeTruthy();
- });
- });
- });
-
- describe('handleChangeSizePerPage', () => {
- const newPage = 2;
- const newSizePerPage = 30;
- const props = createTableProps({ options: { onSizePerPageChange: sinon.stub() } });
- beforeEach(() => {
- createPaginationWrapper(props, false);
- instance.handleChangeSizePerPage(newSizePerPage, newPage);
- });
-
- afterEach(() => {
- props.pagination.options.onSizePerPageChange.reset();
- });
-
- it('should setting state.currPage and state.currSizePerPage correctly', () => {
- expect(instance.state.currPage).toEqual(newPage);
- expect(instance.state.currSizePerPage).toEqual(newSizePerPage);
- });
-
- it('should calling options.onSizePerPageChange correctly when it is defined', () => {
- const { onSizePerPageChange } = props.pagination.options;
- expect(onSizePerPageChange.calledOnce).toBeTruthy();
- expect(onSizePerPageChange.calledWith(newSizePerPage, newPage)).toBeTruthy();
- });
-
- it('should saving page and sizePerPage to store correctly', () => {
- expect(props.store.page).toBe(newPage);
- expect(props.store.sizePerPage).toBe(newSizePerPage);
- });
-
- describe('when pagination remote is enable', () => {
- beforeEach(() => {
- props.remote = true;
- createPaginationWrapper(props, false);
- onRemotePageChangeCB.reset();
- instance.handleChangeSizePerPage(newSizePerPage, newPage);
- });
-
- it('should not setting state.currPage', () => {
- expect(instance.state.currPage).not.toEqual(newPage);
- expect(instance.state.currSizePerPage).not.toEqual(newSizePerPage);
- });
-
- it('should calling props.onRemotePageChange correctly', () => {
- expect(onRemotePageChangeCB.calledOnce).toBeTruthy();
- });
- });
- });
-
- describe('isRemote', () => {
- let result;
- describe('when options.remote is true', () => {
- const props = createTableProps();
- props.remote = true;
-
- beforeEach(() => {
- createPaginationWrapper(props, false);
- result = instance.isRemote();
- });
-
- it('should return true', () => {
- expect(result).toBeTruthy();
- });
- });
-
- describe('when options.remote is false', () => {
- const props = createTableProps();
- props.remote = false;
-
- beforeEach(() => {
- createPaginationWrapper(props, false);
- result = instance.isRemote();
- });
-
- it('should return false', () => {
- expect(result).toBeFalsy();
- });
- });
-
- describe('when options.remote.pagination is defined as true', () => {
- const props = createTableProps();
- props.remote = {};
- props.remote.pagination = true;
-
- beforeEach(() => {
- createPaginationWrapper(props, false);
- result = instance.isRemote();
- });
-
- it('should return true', () => {
- expect(result).toBeTruthy();
- });
- });
-
- describe('when options.remote.pagination is defined as false', () => {
- const props = createTableProps();
- props.remote = {};
- props.remote.pagination = false;
-
- beforeEach(() => {
- createPaginationWrapper(props, false);
- result = instance.isRemote();
- });
-
- it('should return false', () => {
- expect(result).toBeFalsy();
- });
- });
- });
-});
diff --git a/packages/react-bootstrap-table2/package.json b/packages/react-bootstrap-table2/package.json
deleted file mode 100644
index f3e6f0643..000000000
--- a/packages/react-bootstrap-table2/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "react-bootstrap-table2",
- "version": "0.0.1",
- "description": "Rebuilt for react-bootstrap-table",
- "main": "src/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "ISC"
-}
diff --git a/packages/react-bootstrap-table2/src/body.js b/packages/react-bootstrap-table2/src/body.js
deleted file mode 100644
index b0182da0c..000000000
--- a/packages/react-bootstrap-table2/src/body.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/* eslint react/prop-types: 0 */
-/* eslint react/require-default-props: 0 */
-
-import React from 'react';
-import PropTypes from 'prop-types';
-import cs from 'classnames';
-
-import _ from './utils';
-import Row from './row';
-import RowSection from './row-section';
-import Const from './const';
-
-const Body = (props) => {
- const {
- columns,
- data,
- keyField,
- isEmpty,
- noDataIndication,
- visibleColumnSize,
- cellEdit,
- selectRow,
- selectedRowKeys,
- rowStyle,
- rowClasses,
- rowEvents
- } = props;
-
- const {
- bgColor,
- nonSelectable
- } = selectRow;
-
- let content;
-
- if (isEmpty) {
- const indication = _.isFunction(noDataIndication) ? noDataIndication() : noDataIndication;
- content = ;
- } else {
- content = data.map((row, index) => {
- const key = _.get(row, keyField);
- const editable = !(cellEdit.mode !== Const.UNABLE_TO_CELL_EDIT &&
- cellEdit.nonEditableRows.indexOf(key) > -1);
-
- const selected = selectRow.mode !== Const.ROW_SELECT_DISABLED
- ? selectedRowKeys.includes(key)
- : null;
-
- const attrs = rowEvents || {};
- let style = _.isFunction(rowStyle) ? rowStyle(row, index) : rowStyle;
- let classes = (_.isFunction(rowClasses) ? rowClasses(row, index) : rowClasses);
- if (selected) {
- const selectedStyle = _.isFunction(selectRow.style)
- ? selectRow.style(row, index)
- : selectRow.style;
-
- const selectedClasses = _.isFunction(selectRow.classes)
- ? selectRow.classes(row, index)
- : selectRow.classes;
-
- style = {
- ...style,
- ...selectedStyle
- };
- classes = cs(classes, selectedClasses);
-
- if (bgColor) {
- style = style || {};
- style.backgroundColor = _.isFunction(bgColor) ? bgColor(row, index) : bgColor;
- }
- }
-
- const selectable = !nonSelectable || !nonSelectable.includes(key);
-
- return (
-
- );
- });
- }
-
- return (
- { content }
- );
-};
-
-Body.propTypes = {
- keyField: PropTypes.string.isRequired,
- data: PropTypes.array.isRequired,
- columns: PropTypes.array.isRequired,
- selectRow: PropTypes.object,
- selectedRowKeys: PropTypes.array
-};
-
-export default Body;
diff --git a/packages/react-bootstrap-table2/src/bootstrap-table.js b/packages/react-bootstrap-table2/src/bootstrap-table.js
deleted file mode 100644
index 19e7afa02..000000000
--- a/packages/react-bootstrap-table2/src/bootstrap-table.js
+++ /dev/null
@@ -1,188 +0,0 @@
-/* eslint arrow-body-style: 0 */
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import cs from 'classnames';
-
-import Header from './header';
-import Caption from './caption';
-import Body from './body';
-import PropsBaseResolver from './props-resolver';
-import Const from './const';
-import { isSelectedAll } from './store/selection';
-
-class BootstrapTable extends PropsBaseResolver(Component) {
- constructor(props) {
- super(props);
- this.validateProps();
-
- this.state = {
- data: props.data
- };
- }
-
- componentWillReceiveProps(nextProps) {
- this.setState({
- data: nextProps.data
- });
- }
-
- render() {
- const { loading, overlay } = this.props;
- const table = this.renderTable();
- if (loading && overlay) {
- const LoadingOverlay = overlay(table, loading);
- return ;
- }
- return table;
- }
-
- renderTable() {
- const {
- store,
- columns,
- keyField,
- striped,
- hover,
- bordered,
- condensed,
- noDataIndication,
- caption,
- rowStyle,
- rowClasses,
- rowEvents
- } = this.props;
-
- const tableClass = cs('table', {
- 'table-striped': striped,
- 'table-hover': hover,
- 'table-bordered': bordered,
- 'table-condensed': condensed
- });
-
- const cellEditInfo = this.resolveCellEditProps({
- onStart: this.props.onStartEditing,
- onEscape: this.props.onEscapeEditing,
- onUpdate: this.props.onCellUpdate,
- currEditCell: this.props.currEditCell
- });
-
- const cellSelectionInfo = this.resolveSelectRowProps({
- onRowSelect: this.props.onRowSelect
- });
-
- const headerCellSelectionInfo = this.resolveSelectRowPropsForHeader({
- onAllRowsSelect: this.props.onAllRowsSelect,
- selected: store.selected,
- allRowsSelected: isSelectedAll(store)
- });
-
- return (
-
- );
- }
-}
-
-BootstrapTable.propTypes = {
- keyField: PropTypes.string.isRequired,
- data: PropTypes.array.isRequired,
- columns: PropTypes.array.isRequired,
- remote: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
- pagination: PropTypes.bool
- })]),
- store: PropTypes.object,
- noDataIndication: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- striped: PropTypes.bool,
- bordered: PropTypes.bool,
- hover: PropTypes.bool,
- condensed: PropTypes.bool,
- caption: PropTypes.oneOfType([
- PropTypes.node,
- PropTypes.string
- ]),
- pagination: PropTypes.object,
- filter: PropTypes.object,
- cellEdit: PropTypes.shape({
- mode: PropTypes.oneOf([Const.CLICK_TO_CELL_EDIT, Const.DBCLICK_TO_CELL_EDIT]).isRequired,
- onUpdate: PropTypes.func,
- onErrorMessageDisappear: PropTypes.func,
- blurToSave: PropTypes.bool,
- beforeSaveCell: PropTypes.func,
- afterSaveCell: PropTypes.func,
- nonEditableRows: PropTypes.func,
- editing: PropTypes.bool,
- timeToCloseMessage: PropTypes.number,
- errorMessage: PropTypes.string
- }),
- onCellUpdate: PropTypes.func,
- onStartEditing: PropTypes.func,
- onEscapeEditing: PropTypes.func,
- currEditCell: PropTypes.shape({
- ridx: PropTypes.number,
- cidx: PropTypes.number,
- message: PropTypes.string,
- editing: PropTypes.bool
- }),
- selectRow: PropTypes.shape({
- mode: PropTypes.oneOf([Const.ROW_SELECT_SINGLE, Const.ROW_SELECT_MULTIPLE]).isRequired,
- clickToSelect: PropTypes.bool,
- clickToEdit: PropTypes.bool,
- onSelect: PropTypes.func,
- onSelectAll: PropTypes.func,
- style: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- classes: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- nonSelectable: PropTypes.array,
- bgColor: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- hideSelectColumn: PropTypes.bool
- }),
- onRowSelect: PropTypes.func,
- onAllRowsSelect: PropTypes.func,
- rowStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- rowEvents: PropTypes.object,
- rowClasses: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- defaultSorted: PropTypes.arrayOf(PropTypes.shape({
- dataField: PropTypes.string.isRequired,
- order: PropTypes.oneOf([Const.SORT_DESC, Const.SORT_ASC]).isRequired
- })),
- overlay: PropTypes.func,
- onTableChange: PropTypes.func,
- onSort: PropTypes.func,
- onFilter: PropTypes.func
-};
-
-BootstrapTable.defaultProps = {
- remote: false,
- striped: false,
- bordered: true,
- hover: false,
- condensed: false,
- noDataIndication: null
-};
-
-export default BootstrapTable;
diff --git a/packages/react-bootstrap-table2/src/caption.js b/packages/react-bootstrap-table2/src/caption.js
deleted file mode 100644
index 972d9298d..000000000
--- a/packages/react-bootstrap-table2/src/caption.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* eslint react/require-default-props: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-
-const Caption = (props) => {
- if (!props.children) return null;
- return (
- { props.children }
- );
-};
-
-Caption.propTypes = {
- children: PropTypes.oneOfType([
- PropTypes.node,
- PropTypes.string
- ])
-};
-
-export default Caption;
diff --git a/packages/react-bootstrap-table2/src/cell-edit/editing-cell.js b/packages/react-bootstrap-table2/src/cell-edit/editing-cell.js
deleted file mode 100644
index d35396027..000000000
--- a/packages/react-bootstrap-table2/src/cell-edit/editing-cell.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/* eslint arrow-body-style: 0 */
-/* eslint react/prop-types: 0 */
-/* eslint no-return-assign: 0 */
-/* eslint class-methods-use-this: 0 */
-/* eslint jsx-a11y/no-noninteractive-element-interactions: 0 */
-import React, { Component } from 'react';
-import cs from 'classnames';
-import PropTypes from 'prop-types';
-
-import _ from '../utils';
-import Const from '../const';
-import TextEditor from './text-editor';
-import EditorIndicator from './editor-indicator';
-
-class EditingCell extends Component {
- constructor(props) {
- super(props);
- this.indicatorTimer = null;
- this.clearTimer = this.clearTimer.bind(this);
- this.handleBlur = this.handleBlur.bind(this);
- this.handleClick = this.handleClick.bind(this);
- this.handleKeyDown = this.handleKeyDown.bind(this);
- this.beforeComplete = this.beforeComplete.bind(this);
- this.state = {
- invalidMessage: null
- };
- }
-
- componentWillReceiveProps({ message }) {
- if (_.isDefined(message)) {
- this.createTimer();
- this.setState(() => {
- return { invalidMessage: message };
- });
- }
- }
-
- componentWillUnmount() {
- this.clearTimer();
- }
-
- clearTimer() {
- if (this.indicatorTimer) {
- clearTimeout(this.indicatorTimer);
- }
- }
-
- createTimer() {
- this.clearTimer();
- const { timeToCloseMessage, onErrorMessageDisappear } = this.props;
- this.indicatorTimer = _.sleep(() => {
- this.setState(() => {
- return { invalidMessage: null };
- });
- if (_.isFunction(onErrorMessageDisappear)) onErrorMessageDisappear();
- }, timeToCloseMessage);
- }
-
- beforeComplete(row, column, newValue) {
- const { onUpdate } = this.props;
- if (_.isFunction(column.validator)) {
- const validateForm = column.validator(newValue, row, column);
- if (_.isObject(validateForm) && !validateForm.valid) {
- this.setState(() => {
- return { invalidMessage: validateForm.message };
- });
- this.createTimer();
- return;
- }
- }
- onUpdate(row, column, newValue);
- }
-
- handleBlur() {
- const { onEscape, blurToSave, row, column } = this.props;
- if (blurToSave) {
- const value = this.editor.text.value;
- if (!_.isDefined(value)) {
- // TODO: for other custom or embed editor
- }
- this.beforeComplete(row, column, value);
- } else {
- onEscape();
- }
- }
-
- handleKeyDown(e) {
- const { onEscape, row, column } = this.props;
- if (e.keyCode === 27) { // ESC
- onEscape();
- } else if (e.keyCode === 13) { // ENTER
- const value = e.currentTarget.value;
- if (!_.isDefined(value)) {
- // TODO: for other custom or embed editor
- }
- this.beforeComplete(row, column, value);
- }
- }
-
- handleClick(e) {
- if (e.target.tagName !== 'TD') {
- // To avoid the row selection event be triggered,
- // When user define selectRow.clickToSelect and selectRow.clickToEdit
- // We shouldn't trigger selection event even if user click on the cell editor(input)
- e.stopPropagation();
- }
- }
-
- render() {
- const { invalidMessage } = this.state;
- const { row, column, className, style } = this.props;
- const { dataField } = column;
-
- const value = _.get(row, dataField);
- const editorAttrs = {
- onKeyDown: this.handleKeyDown,
- onBlur: this.handleBlur
- };
-
- const hasError = _.isDefined(invalidMessage);
- const editorClass = hasError ? cs('animated', 'shake') : null;
- return (
-
- this.editor = node }
- defaultValue={ value }
- className={ editorClass }
- { ...editorAttrs }
- />
- { hasError ? : null }
-
- );
- }
-}
-
-EditingCell.propTypes = {
- row: PropTypes.object.isRequired,
- column: PropTypes.object.isRequired,
- onUpdate: PropTypes.func.isRequired,
- onEscape: PropTypes.func.isRequired,
- timeToCloseMessage: PropTypes.number,
- className: PropTypes.string,
- style: PropTypes.object
-};
-
-EditingCell.defaultProps = {
- timeToCloseMessage: Const.TIME_TO_CLOSE_MESSAGE,
- className: null,
- style: {}
-};
-
-export default EditingCell;
diff --git a/packages/react-bootstrap-table2/src/cell-edit/editor-indicator.js b/packages/react-bootstrap-table2/src/cell-edit/editor-indicator.js
deleted file mode 100644
index c19819d64..000000000
--- a/packages/react-bootstrap-table2/src/cell-edit/editor-indicator.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* eslint no-return-assign: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-
-const EditorIndicator = ({ invalidMessage }) =>
- (
-
- { invalidMessage }
-
- );
-
-EditorIndicator.propTypes = {
- invalidMessage: PropTypes.string
-};
-
-EditorIndicator.defaultProps = {
- invalidMessage: null
-};
-export default EditorIndicator;
diff --git a/packages/react-bootstrap-table2/src/cell-edit/text-editor.js b/packages/react-bootstrap-table2/src/cell-edit/text-editor.js
deleted file mode 100644
index 52233e7f4..000000000
--- a/packages/react-bootstrap-table2/src/cell-edit/text-editor.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* eslint no-return-assign: 0 */
-import React, { Component } from 'react';
-import cs from 'classnames';
-import PropTypes from 'prop-types';
-
-class TextEditor extends Component {
- componentDidMount() {
- const { defaultValue } = this.props;
- this.text.value = defaultValue;
- this.text.focus();
- }
-
- render() {
- const { defaultValue, className, ...rest } = this.props;
- const editorClass = cs('form-control editor edit-text', className);
- return (
- this.text = node }
- type="text"
- className={ editorClass }
- { ...rest }
- />
- );
- }
-}
-
-TextEditor.propTypes = {
- className: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object
- ]),
- defaultValue: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]).isRequired
-};
-TextEditor.defaultProps = {
- className: null
-};
-export default TextEditor;
diff --git a/packages/react-bootstrap-table2/src/cell-edit/wrapper.js b/packages/react-bootstrap-table2/src/cell-edit/wrapper.js
deleted file mode 100644
index 60e313487..000000000
--- a/packages/react-bootstrap-table2/src/cell-edit/wrapper.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* eslint arrow-body-style: 0 */
-/* eslint react/prop-types: 0 */
-import { Component } from 'react';
-import PropTypes from 'prop-types';
-import _ from '../utils';
-
-import { cellEditElement } from '../table-factory';
-
-class CellEditWrapper extends Component {
- constructor(props) {
- super(props);
- this.startEditing = this.startEditing.bind(this);
- this.escapeEditing = this.escapeEditing.bind(this);
- this.completeEditing = this.completeEditing.bind(this);
- this.handleCellUpdate = this.handleCellUpdate.bind(this);
- this.updateEditingWithErr = this.updateEditingWithErr.bind(this);
- this.state = {
- ridx: null,
- cidx: null,
- message: null,
- editing: false
- };
- }
-
- componentWillReceiveProps(nextProps) {
- if (nextProps.cellEdit) {
- if (nextProps.cellEdit.editing) {
- this.setState(() => {
- return {
- ...this.state,
- message: nextProps.cellEdit.errorMessage
- };
- });
- } else {
- this.escapeEditing();
- }
- }
- }
-
- handleCellUpdate(row, column, newValue) {
- const { keyField, cellEdit, onUpdateCell } = this.props;
- const { beforeSaveCell, afterSaveCell } = cellEdit;
- const oldValue = _.get(row, column.dataField);
- const rowId = _.get(row, keyField);
- if (_.isFunction(beforeSaveCell)) beforeSaveCell(oldValue, newValue, row, column);
- if (onUpdateCell(rowId, column.dataField, newValue)) {
- if (_.isFunction(afterSaveCell)) afterSaveCell(oldValue, newValue, row, column);
- this.completeEditing();
- }
- }
-
- completeEditing() {
- this.setState(() => {
- return {
- ridx: null,
- cidx: null,
- message: null,
- editing: false
- };
- });
- }
-
- startEditing(ridx, cidx) {
- const editing = () => {
- this.setState(() => {
- return {
- ridx,
- cidx,
- editing: true
- };
- });
- };
-
- const { selectRow } = this.props;
- if (!selectRow || (selectRow.clickToEdit || !selectRow.clickToSelect)) editing();
- }
-
- escapeEditing() {
- this.setState(() => {
- return {
- ridx: null,
- cidx: null,
- editing: false
- };
- });
- }
-
- updateEditingWithErr(message) {
- this.setState(() => {
- return {
- ...this.state,
- message
- };
- });
- }
-
- render() {
- return cellEditElement({
- ...this.props,
- onCellUpdate: this.handleCellUpdate,
- onStartEditing: this.startEditing,
- onEscapeEditing: this.escapeEditing,
- currEditCell: { ...this.state }
- });
- }
-}
-
-CellEditWrapper.propTypes = {
- onUpdateCell: PropTypes.func.isRequired
-};
-
-export default CellEditWrapper;
diff --git a/packages/react-bootstrap-table2/src/cell.js b/packages/react-bootstrap-table2/src/cell.js
deleted file mode 100644
index add0f58ac..000000000
--- a/packages/react-bootstrap-table2/src/cell.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/* eslint react/prop-types: 0 */
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Const from './const';
-import _ from './utils';
-
-class Cell extends Component {
- constructor(props) {
- super(props);
- this.handleEditingCell = this.handleEditingCell.bind(this);
- }
-
- handleEditingCell(e) {
- const { editMode, column, onStart, rowIndex, columnIndex } = this.props;
- const { events } = column;
- if (events) {
- if (editMode === Const.CLICK_TO_CELL_EDIT) {
- const customClick = events.onClick;
- if (_.isFunction(customClick)) customClick(e);
- } else {
- const customDbClick = events.onDoubleClick;
- if (_.isFunction(customDbClick)) customDbClick(e);
- }
- }
- onStart(rowIndex, columnIndex);
- }
-
- render() {
- const {
- row,
- rowIndex,
- column,
- columnIndex,
- editMode,
- editable
- } = this.props;
- const {
- dataField,
- hidden,
- formatter,
- formatExtraData,
- style,
- classes,
- title,
- events,
- align,
- attrs
- } = column;
- let cellTitle;
- let cellStyle = {};
- let content = _.get(row, dataField);
-
- const cellAttrs = {
- ..._.isFunction(attrs) ? attrs(content, row, rowIndex, columnIndex) : attrs,
- ...events
- };
-
- const cellClasses = _.isFunction(classes)
- ? classes(content, row, rowIndex, columnIndex)
- : classes;
-
- if (style) {
- cellStyle = _.isFunction(style) ? style(content, row, rowIndex, columnIndex) : style;
- }
-
- if (title) {
- cellTitle = _.isFunction(title) ? title(content, row, rowIndex, columnIndex) : content;
- cellAttrs.title = cellTitle;
- }
-
- if (formatter) {
- content = column.formatter(content, row, rowIndex, formatExtraData);
- }
-
- if (align) {
- cellStyle.textAlign =
- _.isFunction(align) ? align(content, row, rowIndex, columnIndex) : align;
- }
-
- if (hidden) {
- cellStyle.display = 'none';
- }
-
- if (cellClasses) cellAttrs.className = cellClasses;
-
- if (!_.isEmptyObject(cellStyle)) cellAttrs.style = cellStyle;
- if (editable && editMode !== Const.UNABLE_TO_CELL_EDIT) {
- if (editMode === Const.CLICK_TO_CELL_EDIT) {
- cellAttrs.onClick = this.handleEditingCell;
- } else {
- cellAttrs.onDoubleClick = this.handleEditingCell;
- }
- }
- return (
- { content }
- );
- }
-}
-
-Cell.propTypes = {
- row: PropTypes.object.isRequired,
- rowIndex: PropTypes.number.isRequired,
- column: PropTypes.object.isRequired,
- columnIndex: PropTypes.number.isRequired
-};
-
-export default Cell;
diff --git a/packages/react-bootstrap-table2/src/const.js b/packages/react-bootstrap-table2/src/const.js
deleted file mode 100644
index e9ebaa640..000000000
--- a/packages/react-bootstrap-table2/src/const.js
+++ /dev/null
@@ -1,15 +0,0 @@
-export default {
- SORT_ASC: 'asc',
- SORT_DESC: 'desc',
- UNABLE_TO_CELL_EDIT: 'none',
- CLICK_TO_CELL_EDIT: 'click',
- DBCLICK_TO_CELL_EDIT: 'dbclick',
- TIME_TO_CLOSE_MESSAGE: 3000,
- ROW_SELECT_SINGLE: 'radio',
- ROW_SELECT_MULTIPLE: 'checkbox',
- ROW_SELECT_DISABLED: 'ROW_SELECT_DISABLED',
- CHECKBOX_STATUS_CHECKED: 'checked',
- CHECKBOX_STATUS_INDETERMINATE: 'indeterminate',
- CHECKBOX_STATUS_UNCHECKED: 'unchecked',
- DELAY_FOR_DBCLICK: 200
-};
diff --git a/packages/react-bootstrap-table2/src/container.js b/packages/react-bootstrap-table2/src/container.js
deleted file mode 100644
index 8fb7959cf..000000000
--- a/packages/react-bootstrap-table2/src/container.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* eslint no-return-assign: 0 */
-/* eslint react/prop-types: 0 */
-import React, { Component } from 'react';
-import Store from './store';
-
-import {
- wrapWithCellEdit,
- wrapWithSelection,
- wrapWithFilter,
- wrapWithSort,
- wrapWithPagination
-} from './table-factory';
-
-import _ from './utils';
-
-const withDataStore = Base =>
- class BootstrapTableContainer extends Component {
- constructor(props) {
- super(props);
- this.store = new Store(props.keyField);
- this.store.data = props.data;
- this.handleUpdateCell = this.handleUpdateCell.bind(this);
- this.handleRemotePageChange = this.handleRemotePageChange.bind(this);
- this.handleRemoteFilterChange = this.handleRemoteFilterChange.bind(this);
- }
-
- componentWillReceiveProps(nextProps) {
- this.store.data = nextProps.data;
- }
-
- getNewestState(state = {}) {
- return {
- page: this.store.page,
- sizePerPage: this.store.sizePerPage,
- filters: this.store.filters,
- ...state
- };
- }
-
- handleRemotePageChange() {
- this.props.onTableChange('pagination', this.getNewestState());
- }
-
- // refactoring later for isRemotePagination
- handleRemoteFilterChange(isRemotePagination) {
- const newState = {};
- if (isRemotePagination) {
- const options = this.props.pagination.options || {};
- newState.page = _.isDefined(options.pageStartIndex) ? options.pageStartIndex : 1;
- }
- this.props.onTableChange('filter', this.getNewestState(newState));
- }
-
- handleUpdateCell(rowId, dataField, newValue) {
- const { cellEdit } = this.props;
- // handle cell editing internal
- if (!cellEdit.onUpdate) {
- this.store.edit(rowId, dataField, newValue);
- return true;
- }
-
- // handle cell editing external
- const aPromise = cellEdit.onUpdate(rowId, dataField, newValue);
- if (_.isDefined(aPromise) && aPromise !== false) { // TODO: should be a promise here
- aPromise.then((result = true) => {
- const response = result === true ? {} : result;
- if (_.isObject(response)) {
- const { value } = response;
- this.store.edit(rowId, dataField, value || newValue);
- this.cellEditWrapper.completeEditing();
- }
- }).catch((e) => {
- this.cellEditWrapper.updateEditingWithErr(e.message);
- });
- }
- return false;
- }
-
- render() {
- const baseProps = {
- ...this.props,
- store: this.store
- };
-
- if (this.props.cellEdit) {
- return wrapWithCellEdit({
- ref: node => this.cellEditWrapper = node,
- onUpdateCell: this.handleUpdateCell,
- ...baseProps
- });
- } else if (this.props.selectRow) {
- return wrapWithSelection(baseProps);
- } else if (this.props.filter) {
- return wrapWithFilter({
- ...baseProps,
- onRemoteFilterChange: this.handleRemoteFilterChange,
- onRemotePageChange: this.handleRemotePageChange
- });
- } else if (this.props.columns.filter(col => col.sort).length > 0) {
- return wrapWithSort(baseProps);
- } else if (this.props.pagination) {
- return wrapWithPagination({
- ...baseProps,
- onRemotePageChange: this.handleRemotePageChange
- });
- }
-
- return React.createElement(Base, baseProps);
- }
- };
-
-export default withDataStore;
diff --git a/packages/react-bootstrap-table2/src/header-cell.js b/packages/react-bootstrap-table2/src/header-cell.js
deleted file mode 100644
index d5dd47b92..000000000
--- a/packages/react-bootstrap-table2/src/header-cell.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/* eslint react/require-default-props: 0 */
-import React from 'react';
-import cs from 'classnames';
-import PropTypes from 'prop-types';
-
-import Const from './const';
-import SortSymbol from './sort/symbol';
-import SortCaret from './sort/caret';
-import _ from './utils';
-
-
-const HeaderCell = (props) => {
- const {
- column,
- index,
- onSort,
- sorting,
- sortOrder,
- isLastSorting,
- onFilter
- } = props;
-
- const {
- text,
- sort,
- filter,
- hidden,
- headerTitle,
- headerAlign,
- headerFormatter,
- headerEvents,
- headerClasses,
- headerStyle,
- headerAttrs,
- headerSortingClasses,
- headerSortingStyle
- } = column;
-
- const cellAttrs = {
- ..._.isFunction(headerAttrs) ? headerAttrs(column, index) : headerAttrs,
- ...headerEvents
- };
-
- let sortSymbol;
- let filterElm;
- let cellStyle = {};
- let cellClasses = _.isFunction(headerClasses) ? headerClasses(column, index) : headerClasses;
-
- if (headerStyle) {
- cellStyle = _.isFunction(headerStyle) ? headerStyle(column, index) : headerStyle;
- }
-
- if (headerTitle) {
- cellAttrs.title = _.isFunction(headerTitle) ? headerTitle(column, index) : text;
- }
-
- if (headerAlign) {
- cellStyle.textAlign = _.isFunction(headerAlign) ? headerAlign(column, index) : headerAlign;
- }
-
- if (hidden) {
- cellStyle.display = 'none';
- }
-
- if (sort) {
- const customClick = cellAttrs.onClick;
- cellAttrs.onClick = (e) => {
- onSort(column);
- if (_.isFunction(customClick)) customClick(e);
- };
- cellAttrs.className = cs(cellAttrs.className, 'sortable');
-
- if (sorting) {
- sortSymbol = ;
-
- // append customized classes or style if table was sorting based on the current column.
- cellClasses = cs(
- cellClasses,
- _.isFunction(headerSortingClasses)
- ? headerSortingClasses(column, sortOrder, isLastSorting, index)
- : headerSortingClasses
- );
-
- cellStyle = {
- ...cellStyle,
- ..._.isFunction(headerSortingStyle)
- ? headerSortingStyle(column, sortOrder, isLastSorting, index)
- : headerSortingStyle
- };
- } else {
- sortSymbol = ;
- }
- }
-
- if (cellClasses) cellAttrs.className = cs(cellAttrs.className, cellClasses);
- if (!_.isEmptyObject(cellStyle)) cellAttrs.style = cellStyle;
- if (filter) {
- filterElm = ;
- }
-
- const children = headerFormatter ?
- headerFormatter(column, index, { sortElement: sortSymbol, filterElement: filterElm }) :
- text;
-
- if (headerFormatter) {
- return React.createElement('th', cellAttrs, children);
- }
-
- return React.createElement('th', cellAttrs, children, sortSymbol, filterElm);
-};
-
-HeaderCell.propTypes = {
- column: PropTypes.shape({
- dataField: PropTypes.string.isRequired,
- text: PropTypes.string.isRequired,
- hidden: PropTypes.bool,
- headerFormatter: PropTypes.func,
- formatter: PropTypes.func,
- formatExtraData: PropTypes.any,
- headerClasses: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- classes: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- headerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- style: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- headerTitle: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
- title: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
- headerEvents: PropTypes.object,
- events: PropTypes.object,
- headerAlign: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- align: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- headerAttrs: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- attrs: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- sort: PropTypes.bool,
- sortFunc: PropTypes.func,
- editable: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
- editCellStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
- editCellClasses: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
- validator: PropTypes.func,
- filter: PropTypes.object,
- filterValue: PropTypes.func
- }).isRequired,
- index: PropTypes.number.isRequired,
- onSort: PropTypes.func,
- sorting: PropTypes.bool,
- sortOrder: PropTypes.oneOf([Const.SORT_ASC, Const.SORT_DESC]),
- isLastSorting: PropTypes.bool,
- onFilter: PropTypes.func
-};
-
-export default HeaderCell;
diff --git a/packages/react-bootstrap-table2/src/header.js b/packages/react-bootstrap-table2/src/header.js
deleted file mode 100644
index ddbc7bfa4..000000000
--- a/packages/react-bootstrap-table2/src/header.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* eslint react/require-default-props: 0 */
-import React from 'react';
-import PropTypes from 'prop-types';
-import Const from './const';
-
-import HeaderCell from './header-cell';
-import SelectionHeaderCell from './row-selection/selection-header-cell';
-
-const Header = (props) => {
- const { ROW_SELECT_DISABLED } = Const;
-
- const {
- columns,
- onSort,
- onFilter,
- sortField,
- sortOrder,
- selectRow
- } = props;
-
- return (
-
-
- {
- (selectRow.mode !== ROW_SELECT_DISABLED && !selectRow.hideSelectColumn)
- ? : null
- }
- {
- columns.map((column, i) => {
- const currSort = column.dataField === sortField;
- const isLastSorting = column.dataField === sortField;
-
- return (
- );
- })
- }
-
-
- );
-};
-
-Header.propTypes = {
- columns: PropTypes.array.isRequired,
- onSort: PropTypes.func,
- onFilter: PropTypes.func,
- sortField: PropTypes.string,
- sortOrder: PropTypes.string,
- selectRow: PropTypes.object
-};
-
-export default Header;
diff --git a/packages/react-bootstrap-table2/src/index.js b/packages/react-bootstrap-table2/src/index.js
deleted file mode 100644
index db955bdea..000000000
--- a/packages/react-bootstrap-table2/src/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import BootstrapTable from './bootstrap-table';
-import withDataStore from './container';
-
-export default withDataStore(BootstrapTable);
-
diff --git a/packages/react-bootstrap-table2/src/props-resolver/column-resolver.js b/packages/react-bootstrap-table2/src/props-resolver/column-resolver.js
deleted file mode 100644
index e963f5117..000000000
--- a/packages/react-bootstrap-table2/src/props-resolver/column-resolver.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default ExtendBase =>
- class ColumnResolver extends ExtendBase {
- visibleColumnSize() {
- return this.props.columns.length;
- }
- };
diff --git a/packages/react-bootstrap-table2/src/props-resolver/index.js b/packages/react-bootstrap-table2/src/props-resolver/index.js
deleted file mode 100644
index 1aedc64f9..000000000
--- a/packages/react-bootstrap-table2/src/props-resolver/index.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import ColumnResolver from './column-resolver';
-import Const from '../const';
-import _ from '../utils';
-
-export default ExtendBase =>
- class TableResolver extends ColumnResolver(ExtendBase) {
- validateProps() {
- const { columns, keyField } = this.props;
- if (!keyField) {
- throw new Error('Please specify a field as key via keyField');
- }
- if (this.visibleColumnSize(columns) <= 0) {
- throw new Error('No any visible columns detect');
- }
- }
-
- isEmpty() {
- return this.props.data.length === 0;
- }
-
- resolveCellEditProps(options = { currEditCell: null }) {
- const { cellEdit } = this.props;
- const nonEditableRows =
- (cellEdit && _.isFunction(cellEdit.nonEditableRows)) ? cellEdit.nonEditableRows() : [];
- const cellEditInfo = {
- ...options.currEditCell,
- nonEditableRows
- };
-
- if (_.isDefined(cellEdit)) {
- return {
- ...cellEdit,
- ...cellEditInfo,
- ...options
- };
- }
- return {
- mode: Const.UNABLE_TO_CELL_EDIT,
- ...cellEditInfo
- };
- }
-
- /**
- * props resolver for cell selection
- * @param {Object} options - addtional options like callback which are about to merge into props
- *
- * @returns {Object} result - props for cell selections
- * @returns {String} result.mode - input type of row selection or disabled.
- */
- resolveSelectRowProps(options) {
- const { selectRow } = this.props;
- const { ROW_SELECT_DISABLED } = Const;
-
- if (_.isDefined(selectRow)) {
- return {
- ...selectRow,
- ...options
- };
- }
-
- return {
- mode: ROW_SELECT_DISABLED
- };
- }
-
- /**
- * props resolver for header cell selection
- * @param {Object} options - addtional options like callback which are about to merge into props
- *
- * @returns {Object} result - props for cell selections
- * @returns {String} result.mode - input type of row selection or disabled.
- * @returns {String} result.checkedStatus - checkbox status depending on selected rows counts
- */
- resolveSelectRowPropsForHeader(options = {}) {
- const { selectRow } = this.props;
- const { allRowsSelected, selected = [], ...rest } = options;
- const {
- ROW_SELECT_DISABLED, CHECKBOX_STATUS_CHECKED,
- CHECKBOX_STATUS_INDETERMINATE, CHECKBOX_STATUS_UNCHECKED
- } = Const;
-
- if (_.isDefined(selectRow)) {
- let checkedStatus;
-
- // checkbox status depending on selected rows counts
- if (allRowsSelected) checkedStatus = CHECKBOX_STATUS_CHECKED;
- else if (selected.length === 0) checkedStatus = CHECKBOX_STATUS_UNCHECKED;
- else checkedStatus = CHECKBOX_STATUS_INDETERMINATE;
-
- return {
- ...selectRow,
- ...rest,
- checkedStatus
- };
- }
-
- return {
- mode: ROW_SELECT_DISABLED
- };
- }
- };
diff --git a/packages/react-bootstrap-table2/src/row-section.js b/packages/react-bootstrap-table2/src/row-section.js
deleted file mode 100644
index f0c6efd92..000000000
--- a/packages/react-bootstrap-table2/src/row-section.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-
-const RowSection = ({ content, colSpan }) => (
-
-
- { content }
-
-
-);
-
-RowSection.propTypes = {
- content: PropTypes.any,
- colSpan: PropTypes.number
-};
-
-RowSection.defaultProps = {
- content: null,
- colSpan: 1
-};
-
-export default RowSection;
diff --git a/packages/react-bootstrap-table2/src/row-selection/selection-cell.js b/packages/react-bootstrap-table2/src/row-selection/selection-cell.js
deleted file mode 100644
index bc7e0c522..000000000
--- a/packages/react-bootstrap-table2/src/row-selection/selection-cell.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* eslint
- react/require-default-props: 0
- jsx-a11y/no-noninteractive-element-interactions: 0
-*/
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import Const from '../const';
-
-export default class SelectionCell extends Component {
- static propTypes = {
- mode: PropTypes.string.isRequired,
- rowKey: PropTypes.any,
- selected: PropTypes.bool,
- onRowSelect: PropTypes.func,
- disabled: PropTypes.bool,
- rowIndex: PropTypes.number
- }
-
- constructor() {
- super();
- this.handleRowClick = this.handleRowClick.bind(this);
- }
-
- shouldComponentUpdate(nextProps) {
- const { selected } = this.props;
-
- return nextProps.selected !== selected;
- }
-
- handleRowClick() {
- const {
- mode: inputType,
- rowKey,
- selected,
- onRowSelect,
- disabled,
- rowIndex
- } = this.props;
-
- if (disabled) return;
-
- const checked = inputType === Const.ROW_SELECT_SINGLE
- ? true
- : !selected;
-
- onRowSelect(rowKey, checked, rowIndex);
- }
-
- render() {
- const {
- mode: inputType,
- selected,
- disabled
- } = this.props;
-
- return (
-
-
-
- );
- }
-}
diff --git a/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js b/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js
deleted file mode 100644
index a2c695626..000000000
--- a/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* eslint react/require-default-props: 0 */
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import Const from '../const';
-
-export const CheckBox = ({ checked, indeterminate }) => (
- {
- if (input) input.indeterminate = indeterminate; // eslint-disable-line no-param-reassign
- } }
- />
-);
-
-CheckBox.propTypes = {
- checked: PropTypes.bool.isRequired,
- indeterminate: PropTypes.bool.isRequired
-};
-
-export default class SelectionHeaderCell extends Component {
- static propTypes = {
- mode: PropTypes.string.isRequired,
- checkedStatus: PropTypes.string,
- onAllRowsSelect: PropTypes.func
- }
-
- constructor() {
- super();
- this.handleCheckBoxClick = this.handleCheckBoxClick.bind(this);
- }
-
- /**
- * avoid updating if button is
- * 1. radio
- * 2. status was not changed.
- */
- shouldComponentUpdate(nextProps) {
- const { ROW_SELECT_SINGLE } = Const;
- const { mode, checkedStatus } = this.props;
-
- if (mode === ROW_SELECT_SINGLE) return false;
-
- return nextProps.checkedStatus !== checkedStatus;
- }
-
- handleCheckBoxClick() {
- const { onAllRowsSelect } = this.props;
-
- onAllRowsSelect();
- }
-
- render() {
- const {
- CHECKBOX_STATUS_CHECKED, CHECKBOX_STATUS_INDETERMINATE, ROW_SELECT_SINGLE
- } = Const;
-
- const { mode, checkedStatus } = this.props;
-
- const checked = checkedStatus === CHECKBOX_STATUS_CHECKED;
-
- const indeterminate = checkedStatus === CHECKBOX_STATUS_INDETERMINATE;
-
- return mode === ROW_SELECT_SINGLE
- ?
- : (
-
-
-
- );
- }
-}
diff --git a/packages/react-bootstrap-table2/src/row-selection/wrapper.js b/packages/react-bootstrap-table2/src/row-selection/wrapper.js
deleted file mode 100644
index 3a73e9582..000000000
--- a/packages/react-bootstrap-table2/src/row-selection/wrapper.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/* eslint arrow-body-style: 0 */
-/* eslint react/prop-types: 0 */
-import { Component } from 'react';
-import PropTypes from 'prop-types';
-import { selectionElement } from '../table-factory';
-
-import Const from '../const';
-import {
- isAnySelectedRow,
- selectableKeys,
- unSelectableKeys,
- getSelectedRows
-} from '../store/selection';
-import { getRowByRowId } from '../store/rows';
-
-class RowSelectionWrapper extends Component {
- constructor(props) {
- super(props);
- this.handleRowSelect = this.handleRowSelect.bind(this);
- this.handleAllRowsSelect = this.handleAllRowsSelect.bind(this);
- this.state = {
- selectedRowKeys: props.store.selected
- };
- }
-
- /**
- * row selection handler
- * @param {String} rowKey - row key of what was selected.
- * @param {Boolean} checked - next checked status of input button.
- */
- handleRowSelect(rowKey, checked, rowIndex) {
- const { selectRow: { mode, onSelect }, store } = this.props;
- const { ROW_SELECT_SINGLE } = Const;
-
- let currSelected = [...store.selected];
-
- if (mode === ROW_SELECT_SINGLE) { // when select mode is radio
- currSelected = [rowKey];
- } else if (checked) { // when select mode is checkbox
- currSelected.push(rowKey);
- } else {
- currSelected = currSelected.filter(value => value !== rowKey);
- }
-
- store.selected = currSelected;
-
- if (onSelect) {
- const row = getRowByRowId(store)(rowKey);
- onSelect(row, checked, rowIndex);
- }
-
- this.setState(() => ({
- selectedRowKeys: currSelected
- }));
- }
-
- /**
- * handle all rows selection on header cell by store.selected or given specific result.
- * @param {Boolean} option - customized result for all rows selection
- */
- handleAllRowsSelect(option) {
- const { store, selectRow: {
- onSelectAll,
- nonSelectable
- } } = this.props;
- const selected = isAnySelectedRow(store)(nonSelectable);
-
- // set next status of all row selected by store.selected or customizing by user.
- const result = option || !selected;
-
- const currSelected = result ?
- selectableKeys(store)(nonSelectable) :
- unSelectableKeys(store)(nonSelectable);
-
-
- store.selected = currSelected;
-
- if (onSelectAll) {
- onSelectAll(result, getSelectedRows(store));
- }
-
- this.setState(() => ({
- selectedRowKeys: currSelected
- }));
- }
-
- render() {
- return selectionElement({
- ...this.props,
- onRowSelect: this.handleRowSelect,
- onAllRowsSelect: this.handleAllRowsSelect
- });
- }
-}
-
-RowSelectionWrapper.propTypes = {
- store: PropTypes.object.isRequired
-};
-
-export default RowSelectionWrapper;
diff --git a/packages/react-bootstrap-table2/src/row.js b/packages/react-bootstrap-table2/src/row.js
deleted file mode 100644
index b1dea9c06..000000000
--- a/packages/react-bootstrap-table2/src/row.js
+++ /dev/null
@@ -1,167 +0,0 @@
-/* eslint react/prop-types: 0 */
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import _ from './utils';
-import Cell from './cell';
-import SelectionCell from './row-selection/selection-cell';
-import EditingCell from './cell-edit/editing-cell';
-import Const from './const';
-
-class Row extends Component {
- constructor(props) {
- super(props);
- this.clickNum = 0;
- this.handleRowClick = this.handleRowClick.bind(this);
- }
-
- handleRowClick(e) {
- const {
- row,
- selected,
- keyField,
- selectable,
- rowIndex,
- selectRow: {
- onRowSelect,
- clickToEdit
- },
- cellEdit: { mode },
- attrs
- } = this.props;
-
- const clickFn = () => {
- if (attrs.onClick) {
- attrs.onClick(e);
- }
- if (selectable) {
- const key = _.get(row, keyField);
- onRowSelect(key, !selected, rowIndex);
- }
- };
-
- if (mode === Const.DBCLICK_TO_CELL_EDIT && clickToEdit) {
- this.clickNum += 1;
- _.debounce(() => {
- if (this.clickNum === 1) {
- clickFn();
- }
- this.clickNum = 0;
- }, Const.DELAY_FOR_DBCLICK)();
- } else {
- clickFn();
- }
- }
-
- render() {
- const {
- row,
- columns,
- keyField,
- rowIndex,
- className,
- style,
- attrs,
- cellEdit,
- selected,
- selectRow,
- selectable,
- editable: editableRow
- } = this.props;
-
- const {
- mode,
- onStart,
- ridx: editingRowIdx,
- cidx: editingColIdx,
- ...rest
- } = cellEdit;
-
- const key = _.get(row, keyField);
- const { clickToSelect, hideSelectColumn } = selectRow;
-
- const trAttrs = { ...attrs };
- if (clickToSelect) {
- trAttrs.onClick = this.handleRowClick;
- }
-
- return (
-
- {
- (selectRow.mode !== Const.ROW_SELECT_DISABLED && !hideSelectColumn)
- ? (
-
- )
- : null
- }
- {
- columns.map((column, index) => {
- const { dataField } = column;
- const content = _.get(row, dataField);
- let editable = _.isDefined(column.editable) ? column.editable : true;
- if (dataField === keyField || !editableRow) editable = false;
- if (_.isFunction(column.editable)) {
- editable = column.editable(content, row, rowIndex, index);
- }
- if (rowIndex === editingRowIdx && index === editingColIdx) {
- let editCellstyle = column.editCellStyle || {};
- let editCellclasses = column.editCellClasses;
- if (_.isFunction(column.editCellStyle)) {
- editCellstyle = column.editCellStyle(content, row, rowIndex, index);
- }
- if (_.isFunction(column.editCellClasses)) {
- editCellclasses = column.editCellClasses(content, row, rowIndex, index);
- }
- return (
-
- );
- }
- return (
- |
- );
- })
- }
-
- );
- }
-}
-
-Row.propTypes = {
- row: PropTypes.object.isRequired,
- rowIndex: PropTypes.number.isRequired,
- columns: PropTypes.array.isRequired,
- style: PropTypes.object,
- className: PropTypes.string,
- attrs: PropTypes.object
-};
-
-Row.defaultProps = {
- editable: true,
- style: {},
- className: null,
- attrs: {}
-};
-
-export default Row;
diff --git a/packages/react-bootstrap-table2/src/sort/caret.js b/packages/react-bootstrap-table2/src/sort/caret.js
deleted file mode 100644
index cc64f9d48..000000000
--- a/packages/react-bootstrap-table2/src/sort/caret.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import cs from 'classnames';
-import PropTypes from 'prop-types';
-
-import Const from '../const';
-
-const SortCaret = ({ order }) => {
- const orderClass = cs('react-bootstrap-table-sort-order', {
- dropup: order === Const.SORT_ASC
- });
- return (
-
-
-
- );
-};
-
-SortCaret.propTypes = {
- order: PropTypes.oneOf([Const.SORT_ASC, Const.SORT_DESC]).isRequired
-};
-export default SortCaret;
diff --git a/packages/react-bootstrap-table2/src/sort/symbol.js b/packages/react-bootstrap-table2/src/sort/symbol.js
deleted file mode 100644
index ecaf3243c..000000000
--- a/packages/react-bootstrap-table2/src/sort/symbol.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import React from 'react';
-
-const SortSymbol = () => (
-
-
-
-
-
-
-
- );
-
-export default SortSymbol;
diff --git a/packages/react-bootstrap-table2/src/sort/wrapper.js b/packages/react-bootstrap-table2/src/sort/wrapper.js
deleted file mode 100644
index 82f00b208..000000000
--- a/packages/react-bootstrap-table2/src/sort/wrapper.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* eslint arrow-body-style: 0 */
-/* eslint react/prop-types: 0 */
-/* eslint no-return-assign: 0 */
-import { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { sortableElement } from '../table-factory';
-
-class SortWrapper extends Component {
- constructor(props) {
- super(props);
- this.handleSort = this.handleSort.bind(this);
- }
-
- componentWillMount() {
- const { columns, defaultSorted, store } = this.props;
- // defaultSorted is an array, it's ready to use as multi / single sort
- // when we start to support multi sort, please update following code to use array.forEach
- if (defaultSorted && defaultSorted.length > 0) {
- const dataField = defaultSorted[0].dataField;
- const order = defaultSorted[0].order;
- const column = columns.filter(col => col.dataField === dataField);
- if (column.length > 0) {
- store.sortBy(column[0], order);
- }
- }
- }
-
- componentWillReceiveProps(nextProps) {
- if (nextProps.isDataChanged) {
- const sortedColumn = nextProps.columns.find(
- column => column.dataField === nextProps.store.sortField);
- if (sortedColumn) {
- nextProps.store.sortBy(sortedColumn, nextProps.store.sortOrder);
- }
- }
- }
-
- handleSort(column) {
- const { store } = this.props;
- store.sortBy(column);
-
- this.table.setState({ data: store.data });
- }
-
- render() {
- return sortableElement({
- ...this.props,
- ref: node => this.table = node,
- onSort: this.handleSort,
- data: this.props.store.data
- });
- }
-}
-
-SortWrapper.propTypes = {
- store: PropTypes.object.isRequired
-};
-
-export default SortWrapper;
diff --git a/packages/react-bootstrap-table2/src/store/index.js b/packages/react-bootstrap-table2/src/store/index.js
deleted file mode 100644
index b735f86f6..000000000
--- a/packages/react-bootstrap-table2/src/store/index.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* eslint no-underscore-dangle: 0 */
-import _ from '../utils';
-import { sort, nextOrder } from './sort';
-import { getRowByRowId } from './rows';
-
-export default class Store {
- constructor(keyField) {
- this._data = [];
- this._filteredData = [];
- this._keyField = keyField;
- this._sortOrder = undefined;
- this._sortField = undefined;
- this._selected = [];
- this._filters = {};
- this._page = undefined;
- this._sizePerPage = undefined;
- }
-
- edit(rowId, dataField, newValue) {
- const row = getRowByRowId(this)(rowId);
- if (row) _.set(row, dataField, newValue);
- }
-
- sortBy({ dataField, sortFunc }, order) {
- this.sortOrder = nextOrder(this)(dataField, order);
- this.sortField = dataField;
- this.data = sort(this)(sortFunc);
- }
-
- getAllData() {
- return this._data;
- }
-
- get data() {
- if (Object.keys(this._filters).length > 0) {
- return this._filteredData;
- }
- return this._data;
- }
- set data(data) {
- if (Object.keys(this._filters).length > 0) {
- this._filteredData = data;
- } else {
- this._data = (data ? JSON.parse(JSON.stringify(data)) : []);
- }
- }
-
- get filteredData() { return this._filteredData; }
- set filteredData(filteredData) { this._filteredData = filteredData; }
-
- get keyField() { return this._keyField; }
- set keyField(keyField) { this._keyField = keyField; }
-
- get sortOrder() { return this._sortOrder; }
- set sortOrder(sortOrder) { this._sortOrder = sortOrder; }
-
- get page() { return this._page; }
- set page(page) { this._page = page; }
-
- get sizePerPage() { return this._sizePerPage; }
- set sizePerPage(sizePerPage) { this._sizePerPage = sizePerPage; }
-
- get sortField() { return this._sortField; }
- set sortField(sortField) { this._sortField = sortField; }
-
- get selected() { return this._selected; }
- set selected(selected) { this._selected = selected; }
-
- get filters() { return this._filters; }
- set filters(filters) { this._filters = filters; }
-}
diff --git a/packages/react-bootstrap-table2/src/store/rows.js b/packages/react-bootstrap-table2/src/store/rows.js
deleted file mode 100644
index 411512289..000000000
--- a/packages/react-bootstrap-table2/src/store/rows.js
+++ /dev/null
@@ -1,4 +0,0 @@
-
-export const matchRow = (keyField, id) => row => row[keyField] === id;
-
-export const getRowByRowId = ({ data, keyField }) => id => data.find(matchRow(keyField, id));
diff --git a/packages/react-bootstrap-table2/src/store/selection.js b/packages/react-bootstrap-table2/src/store/selection.js
deleted file mode 100644
index 4c6c10a76..000000000
--- a/packages/react-bootstrap-table2/src/store/selection.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import _ from '../utils';
-import { getRowByRowId } from './rows';
-
-export const isSelectedAll = ({ data, selected }) => data.length === selected.length;
-
-export const isAnySelectedRow = ({ selected }) => (skips = []) => {
- if (skips.length === 0) {
- return selected.length > 0;
- }
- return selected.filter(x => !skips.includes(x)).length;
-};
-
-export const selectableKeys = ({ data, keyField }) => (skips = []) => {
- if (skips.length === 0) {
- return data.map(row => _.get(row, keyField));
- }
- return data
- .filter(row => !skips.includes(_.get(row, keyField)))
- .map(row => _.get(row, keyField));
-};
-
-export const unSelectableKeys = ({ selected }) => (skips = []) => {
- if (skips.length === 0) {
- return [];
- }
- return selected.filter(x => skips.includes(x));
-};
-
-export const getSelectedRows = (store) => {
- const getRow = getRowByRowId(store);
- return store.selected.map(k => getRow(k));
-};
-
diff --git a/packages/react-bootstrap-table2/src/store/sort.js b/packages/react-bootstrap-table2/src/store/sort.js
deleted file mode 100644
index a2228bb1e..000000000
--- a/packages/react-bootstrap-table2/src/store/sort.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* eslint no-nested-ternary: 0 */
-/* eslint no-lonely-if: 0 */
-/* eslint no-underscore-dangle: 0 */
-import _ from '../utils';
-import Const from '../const';
-
-function comparator(a, b) {
- let result;
- if (typeof b === 'string') {
- result = b.localeCompare(a);
- } else {
- result = a > b ? -1 : ((a < b) ? 1 : 0);
- }
- return result;
-}
-
-export const sort = ({ data, sortOrder, sortField }) => (sortFunc) => {
- const _data = [...data];
- _data.sort((a, b) => {
- let result;
- let valueA = _.get(a, sortField);
- let valueB = _.get(b, sortField);
- valueA = _.isDefined(valueA) ? valueA : '';
- valueB = _.isDefined(valueB) ? valueB : '';
-
- if (sortFunc) {
- result = sortFunc(valueA, valueB, sortOrder, sortField);
- } else {
- if (sortOrder === Const.SORT_DESC) {
- result = comparator(valueA, valueB);
- } else {
- result = comparator(valueB, valueA);
- }
- }
- return result;
- });
- return _data;
-};
-
-export const nextOrder = store => (field, order) => {
- if (order) return order;
-
- if (field !== store.sortField) {
- return Const.SORT_DESC;
- }
- return store.sortOrder === Const.SORT_DESC ? Const.SORT_ASC : Const.SORT_DESC;
-};
diff --git a/packages/react-bootstrap-table2/src/table-factory.js b/packages/react-bootstrap-table2/src/table-factory.js
deleted file mode 100644
index 10ff86ee9..000000000
--- a/packages/react-bootstrap-table2/src/table-factory.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* eslint react/prop-types: 0 */
-import React from 'react';
-
-import _ from './utils';
-import BootstrapTable from './bootstrap-table';
-import SortWrapper from './sort/wrapper';
-import RowSelectionWrapper from './row-selection/wrapper';
-import CellEditWrapper from './cell-edit/wrapper';
-
-
-export const wrapWithCellEdit = props =>
- React.createElement(CellEditWrapper, { ...props });
-
-export const wrapWithSelection = props =>
- React.createElement(RowSelectionWrapper, { ...props });
-
-export const wrapWithSort = props =>
- React.createElement(SortWrapper, { ...props });
-
-export const pureTable = props =>
- React.createElement(BootstrapTable, { ...props });
-
-export const wrapWithFilter = (props) => {
- if (props.filter) {
- const { FilterWrapper } = props.filter;
- return React.createElement(FilterWrapper, { ...props, baseElement: wrapWithSort, _ });
- }
- return wrapWithSort(props);
-};
-
-export const wrapWithPagination = (props) => {
- if (props.pagination) {
- const { PaginationWrapper } = props.pagination;
- return React.createElement(PaginationWrapper, { ...props, baseElement: pureTable });
- }
- return pureTable(props);
-};
-
-export const sortableElement = props => wrapWithPagination(props);
-
-export const selectionElement = props => wrapWithFilter(props);
-
-export const cellEditElement = props => wrapWithSelection(props);
diff --git a/packages/react-bootstrap-table2/src/utils.js b/packages/react-bootstrap-table2/src/utils.js
deleted file mode 100644
index 16572b2e1..000000000
--- a/packages/react-bootstrap-table2/src/utils.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/* eslint no-empty: 0 */
-/* eslint no-param-reassign: 0 */
-/* eslint prefer-rest-params: 0 */
-
-function splitNested(str) {
- return [str]
- .join('.')
- .replace(/\[/g, '.')
- .replace(/\]/g, '')
- .split('.');
-}
-
-function get(target, field) {
- const pathArray = splitNested(field);
- let result;
- try {
- result = pathArray.reduce((curr, path) => curr[path], target);
- } catch (e) {}
- return result;
-}
-
-function set(target, field, value, safe = false) {
- const pathArray = splitNested(field);
- let level = 0;
- pathArray.reduce((a, b) => {
- level += 1;
- if (typeof a[b] === 'undefined') {
- if (!safe) throw new Error(`${a}.${b} is undefined`);
- a[b] = {};
- return a[b];
- }
-
- if (level === pathArray.length) {
- a[b] = value;
- return value;
- }
- return a[b];
- }, target);
-}
-
-function isFunction(obj) {
- return obj && (typeof obj === 'function');
-}
-
-/**
- * Checks if `value` is the Object. the `Object` except `Function` and `Array.`
- *
- * @param {*} obj - The value gonna check
- */
-function isObject(obj) {
- const type = typeof obj;
- return obj !== null && type === 'object' && obj.constructor === Object;
-}
-
-function isEmptyObject(obj) {
- if (!isObject(obj)) return false;
-
- const hasOwnProperty = Object.prototype.hasOwnProperty;
- const keys = Object.keys(obj);
-
- for (let i = 0; i < keys.length; i += 1) {
- if (hasOwnProperty.call(obj, keys[i])) return false;
- }
-
- return true;
-}
-
-function isDefined(value) {
- return typeof value !== 'undefined' && value !== null;
-}
-
-function sleep(fn, ms) {
- return setTimeout(() => fn(), ms);
-}
-
-function debounce(func, wait, immediate) {
- let timeout;
-
- return () => {
- const later = () => {
- timeout = null;
-
- if (!immediate) {
- func.apply(this, arguments);
- }
- };
-
- const callNow = immediate && !timeout;
-
- clearTimeout(timeout);
- timeout = setTimeout(later, wait || 0);
-
- if (callNow) {
- func.appy(this, arguments);
- }
- };
-}
-
-export default {
- get,
- set,
- isFunction,
- isObject,
- isEmptyObject,
- isDefined,
- sleep,
- debounce
-};
diff --git a/packages/react-bootstrap-table2/style/react-bootstrap-table.scss b/packages/react-bootstrap-table2/style/react-bootstrap-table.scss
deleted file mode 100644
index 2476781e0..000000000
--- a/packages/react-bootstrap-table2/style/react-bootstrap-table.scss
+++ /dev/null
@@ -1,122 +0,0 @@
-.react-bootstrap-table {
-
- table {
- table-layout: fixed;
- }
-
- th.sortable {
- cursor: pointer;
- }
-
- th .order > .dropdown > .caret {
- margin: 10px 0 10px 5px;
- color: #cccccc;
- }
-
- th .order > .dropup > .caret {
- margin: 10px 0;
- color: #cccccc;
- }
-
- th > .react-bootstrap-table-sort-order > .caret {
- margin: 10px 6.5px;
- }
-
- th[data-row-selection] {
- width: 30px;
- }
-
- td.react-bs-table-no-data {
- text-align: center;
- }
-
- td.react-bootstrap-table-editing-cell {
- .animated {
- animation-fill-mode: both;
- }
-
- .animated.bounceIn,
- .animated.bounceOut{
- animation-duration: .75s;
- }
-
- .animated.shake{
- animation-duration: .3s;
- }
-
- @keyframes shake {
- from, to {
- transform: translate3d(0, 0, 0);
- }
-
- 10%, 50%, 90% {
- transform: translate3d(-10px, 0, 0);
- }
-
- 30%, 70%{
- transform: translate3d(10px, 0, 0);
- }
- }
-
- .shake {
- animation-name: shake;
- }
-
- @keyframes bounceIn {
- from, 20%, 40%, 60%, 80%, to {
- animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
- }
-
- 0% {
- opacity: 0;
- transform: scale3d(.3, .3, .3);
- }
-
- 20% {
- transform: scale3d(1.1, 1.1, 1.1);
- }
-
- 40% {
- transform: scale3d(.9, .9, .9);
- }
-
- 60% {
- opacity: 1;
- transform: scale3d(1.03, 1.03, 1.03);
- }
-
- 80% {
- transform: scale3d(.97, .97, .97);
- }
-
- to {
- opacity: 1;
- transform: scale3d(1, 1, 1);
- }
- }
-
- .bounceIn {
- animation-name: bounceIn;
- }
-
- @keyframes bounceOut {
- 20% {
- transform: scale3d(.9, .9, .9);
- }
-
- 50%, 55% {
- opacity: 1;
- transform: scale3d(1.1, 1.1, 1.1);
- }
-
- to {
- opacity: 0;
- transform: scale3d(.3, .3, .3);
- }
- }
-
- .bounceOut {
- animation-name: bounceOut;
- }
- }
-}
\ No newline at end of file
diff --git a/packages/react-bootstrap-table2/test/body.test.js b/packages/react-bootstrap-table2/test/body.test.js
deleted file mode 100644
index 5674b83fe..000000000
--- a/packages/react-bootstrap-table2/test/body.test.js
+++ /dev/null
@@ -1,639 +0,0 @@
-import React from 'react';
-import sinon from 'sinon';
-import { shallow } from 'enzyme';
-
-import Body from '../src/body';
-import Row from '../src/row';
-import Const from '../src/const';
-import RowSection from '../src/row-section';
-import mockBodyResolvedProps from './test-helpers/mock/body-resolved-props';
-
-describe('Body', () => {
- let wrapper;
- const columns = [{
- dataField: 'id',
- text: 'ID'
- }, {
- dataField: 'name',
- text: 'Name'
- }];
-
- const data = [{
- id: 1,
- name: 'A'
- }, {
- id: 2,
- name: 'B'
- }];
-
- const keyField = 'id';
-
- describe('simplest body', () => {
- beforeEach(() => {
- wrapper = shallow( );
- });
-
- it('should render successfully', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('tbody').length).toBe(1);
- expect(wrapper.find(Row).length).toBe(data.length);
- });
- });
-
- describe('when data is empty', () => {
- beforeEach(() => {
- wrapper = shallow(
- );
- });
-
- it('should render successfully', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('tbody').length).toBe(1);
- expect(wrapper.find(RowSection).length).toBe(1);
- expect(wrapper.find(RowSection).prop('colSpan')).toBe(columns.length);
- expect(wrapper.find(RowSection).prop('content')).toBe(null);
- });
-
- describe('when noDataIndication props is defined', () => {
- let emptyIndication;
-
- describe('and it is not a function', () => {
- beforeEach(() => {
- emptyIndication = 'Table is empty';
- wrapper = shallow(
- );
- });
-
- it('should render successfully', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('tbody').length).toBe(1);
- expect(wrapper.find(RowSection).length).toBe(1);
- expect(wrapper.find(RowSection).prop('content')).toEqual(emptyIndication);
- });
- });
-
- describe('and it is a function', () => {
- const content = 'Table is empty';
- let emptyIndicationCallBack;
-
- beforeEach(() => {
- emptyIndicationCallBack = sinon.stub().returns(content);
- wrapper = shallow(
- );
- });
-
- it('should render successfully', () => {
- expect(wrapper.length).toBe(1);
- expect(wrapper.find('tbody').length).toBe(1);
- expect(wrapper.find(RowSection).length).toBe(1);
- expect(wrapper.find(RowSection).prop('content')).toEqual(emptyIndication);
- });
-
- it('should call custom noDataIndication function correctly', () => {
- expect(emptyIndicationCallBack.callCount).toBe(1);
- });
- });
- });
- });
-
- describe('when rowStyle prop is defined', () => {
- const rowStyle = { backgroundColor: 'red', color: 'white' };
-
- describe('and it is a style object', () => {
- beforeEach(() => {
- wrapper = shallow(
-