From 6887c12d11710727801d19cadc8573a494779331 Mon Sep 17 00:00:00 2001 From: Allen Date: Tue, 17 Oct 2017 04:30:23 -0500 Subject: [PATCH] no need BootstrapTableful anymore * refine BootstrapTableful -> BootstrapTable * refine stateful-layer as container --- docs/row-selection.md | 4 ++-- .../examples/basic/borderless-table.js | 6 +++--- .../examples/basic/caption-table.js | 10 +++++----- .../examples/basic/index.js | 6 +++--- .../examples/basic/no-data-table.js | 8 ++++---- .../examples/basic/striped-hover-condensed-table.js | 6 +++--- .../examples/cell-edit/blur-to-save-table.js | 6 +++--- .../examples/cell-edit/cell-edit-hooks-table.js | 6 +++--- .../examples/cell-edit/cell-edit-validator-table.js | 6 +++--- .../cell-edit/cell-edit-with-promise-table.js | 6 +++--- .../cell-edit/cell-edit-with-redux-table.js | 6 +++--- .../examples/cell-edit/cell-level-editable-table.js | 6 +++--- .../examples/cell-edit/click-to-edit-table.js | 6 +++--- .../cell-edit/column-level-editable-table.js | 6 +++--- .../examples/cell-edit/dbclick-to-edit-table.js | 6 +++--- .../examples/cell-edit/row-level-editable-table.js | 6 +++--- .../examples/columns/column-align-table.js | 6 +++--- .../examples/columns/column-attrs-table.js | 6 +++--- .../examples/columns/column-class-table.js | 6 +++--- .../examples/columns/column-event-table.js | 6 +++--- .../examples/columns/column-format-table.js | 6 +++--- .../columns/column-format-with-extra-data-table.js | 6 +++--- .../examples/columns/column-hidden-table.js | 6 +++--- .../examples/columns/column-style-table.js | 6 +++--- .../examples/columns/column-title-table.js | 6 +++--- .../examples/columns/nested-data-table.js | 6 +++--- .../examples/header-columns/column-align-table.js | 6 +++--- .../examples/header-columns/column-attrs-table.js | 6 +++--- .../examples/header-columns/column-class-table.js | 6 +++--- .../examples/header-columns/column-event-table.js | 6 +++--- .../examples/header-columns/column-format-table.js | 6 +++--- .../examples/header-columns/column-style-table.js | 6 +++--- .../examples/header-columns/column-title-table.js | 6 +++--- .../examples/row-selection/multiple-selection.js | 6 +++--- .../examples/row-selection/single-selection.js | 6 +++--- .../examples/sort/custom-sort-table.js | 6 +++--- .../examples/sort/enable-sort-table.js | 6 +++--- .../react-bootstrap-table2-example/src/index.js | 4 ++-- .../src/{stateful-layer.js => container.js} | 9 ++++----- packages/react-bootstrap-table2/src/index.js | 8 ++------ .../{stateful-layer.test.js => container.test.js} | 13 ++++++------- 41 files changed, 127 insertions(+), 133 deletions(-) rename packages/react-bootstrap-table2/src/{stateful-layer.js => container.js} (93%) rename packages/react-bootstrap-table2/test/{stateful-layer.test.js => container.test.js} (90%) diff --git a/docs/row-selection.md b/docs/row-selection.md index 3671093..b9a31c9 100644 --- a/docs/row-selection.md +++ b/docs/row-selection.md @@ -26,7 +26,7 @@ Specifying the selection way for `single(radio)` or `multiple(checkbox)`. If `ra const selectRowProp = { mode: 'radio' // single row selection }; - (
-

Component as Header

; - + -} columns={ columns } /> +} columns={ columns } /> `; const Caption = () =>

Component as Header

; export default () => (
- - } columns={ columns } /> + + } 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 index 096eb77..91a6588 100644 --- a/packages/react-bootstrap-table2-example/examples/basic/index.js +++ b/packages/react-bootstrap-table2-example/examples/basic/index.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -29,12 +29,12 @@ const columns = [{ 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 index 8c341d2..44d8662 100644 --- a/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js +++ b/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; const columns = [{ @@ -15,7 +15,7 @@ const columns = [{ }]; const sourceCode = `\ - + // Following is more customizable example @@ -23,12 +23,12 @@ 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 index bd1aa90..97b4879 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -18,7 +18,7 @@ const columns = [{ }]; const sourceCode = `\ - (
- (
- + { 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 index 0238ec5..24779fc 100644 --- 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 @@ -2,7 +2,7 @@ /* eslint no-console: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -37,7 +37,7 @@ const cellEdit = { afterSaveCell: (oldValue, newValue, row, column) => { console.log('After Saving Cell!!'); } }; - (
- + { 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 index d3dcffb..6b31c5d 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; /* eslint no-unused-vars: 0 */ -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -64,7 +64,7 @@ const cellEdit = { blurToSave: true }; - (

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 index c9e6874..c66e3bd 100644 --- 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 @@ -2,7 +2,7 @@ /* eslint arrow-body-style: 0 */ import React, { Component } from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator, sleep } from 'utils/common'; @@ -38,7 +38,7 @@ class CellEditWithPromise extends Component { return (
- + { sourceCode }
); @@ -64,7 +64,7 @@ class CellEditWithPromise extends Component { return (
- + { sourceCode }
); 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 index d961ad1..ebd0e3c 100644 --- 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 @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import thunk from 'redux-thunk'; import { Provider, connect } from 'react-redux'; import { createStore, applyMiddleware } from 'redux'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -64,7 +64,7 @@ class CellEditWithRedux extends Component { return (
- + { sourceCode }
); @@ -157,7 +157,7 @@ class CellEditWithRedux extends Component { return (
- + { sourceCode }
); 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 index da825d1..331792a 100644 --- 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 @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -36,7 +36,7 @@ const cellEdit = { mode: 'click' }; - (
- + { 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 index 0030936..f48e6e4 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -33,7 +33,7 @@ const cellEdit = { mode: 'click' }; - (
- + { 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 index b777486..0242911 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -37,7 +37,7 @@ const cellEdit = { blurToSave: true }; - (
- + { 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 index 37a1061..c51a155 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -33,7 +33,7 @@ const cellEdit = { mode: 'dbclick' }; - (
- + { 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 index 4033f75..99f177a 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -36,7 +36,7 @@ const cellEdit = { nonEditableRows: () => [0, 3] }; - (
- + { 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 index 37b510f..3385a6e 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-align-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-align-table.js @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -40,12 +40,12 @@ const columns = [{ 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 index 43c377a..0446225 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-attrs-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-attrs-table.js @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -34,12 +34,12 @@ const columns = [{ 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 index 3a1e6fc..d1c6057 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-class-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-class-table.js @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -40,12 +40,12 @@ const columns = [{ 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 index 2ffc74a..3403a21 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-event-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-event-table.js @@ -2,7 +2,7 @@ /* eslint no-alert: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -37,13 +37,13 @@ const columns = [{ 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 index 1d6ece6..6542af3 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-format-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-format-table.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -53,7 +53,7 @@ const columns = [ formatter: priceFormatter }]; - (
- (
- + `; 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 index 4dae9bc..c559317 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-style-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-style-table.js @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -58,12 +58,12 @@ const columns = [{ 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 index f75455a..e92d3df 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/column-title-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/column-title-table.js @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -34,12 +34,12 @@ const columns = [{ 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 index 2852c7c..8876d06 100644 --- a/packages/react-bootstrap-table2-example/examples/columns/nested-data-table.js +++ b/packages/react-bootstrap-table2-example/examples/columns/nested-data-table.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -49,12 +49,12 @@ const columns = [{ 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 index cbdfcdd..013a443 100644 --- 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 @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -34,12 +34,12 @@ const columns = [{ 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 index ad2c5d9..4318fb6 100644 --- 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 @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -34,12 +34,12 @@ const columns = [{ 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 index a317da1..031e239 100644 --- 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 @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -40,12 +40,12 @@ const columns = [{ } }]; - + `; 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 index 3e892ef..ca547ac 100644 --- 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 @@ -2,7 +2,7 @@ /* eslint no-alert: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -37,13 +37,13 @@ const columns = [{ 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-table.js b/packages/react-bootstrap-table2-example/examples/header-columns/column-format-table.js index b9d6373..ddc554b 100644 --- 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 @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -40,7 +40,7 @@ const columns = [ headerFormatter: priceFormatter }]; - (
- + `; 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 index 41884ab..ac2b9b9 100644 --- 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 @@ -1,7 +1,7 @@ /* eslint no-unused-vars: 0 */ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -34,12 +34,12 @@ const columns = [{ text: 'Product Price' }]; - + `; 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 index 46f2453..8228902 100644 --- a/packages/react-bootstrap-table2-example/examples/row-selection/multiple-selection.js +++ b/packages/react-bootstrap-table2-example/examples/row-selection/multiple-selection.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -37,7 +37,7 @@ const selectRowProp = { mode: 'checkbox' }; - (
- + { sourceCode }
); 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 index b02f058..15827b9 100644 --- a/packages/react-bootstrap-table2-example/examples/row-selection/single-selection.js +++ b/packages/react-bootstrap-table2-example/examples/row-selection/single-selection.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -37,7 +37,7 @@ const selectRowProp = { mode: 'radio' }; - (
- + { sourceCode }
); 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 index d362e8d..1763a3e 100644 --- a/packages/react-bootstrap-table2-example/examples/sort/custom-sort-table.js +++ b/packages/react-bootstrap-table2-example/examples/sort/custom-sort-table.js @@ -2,7 +2,7 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -49,12 +49,12 @@ const columns = [{ text: 'Product Price' }]; - + `; export default () => (
- + { sourceCode }
); 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 index 255414b..45c7ff4 100644 --- a/packages/react-bootstrap-table2-example/examples/sort/enable-sort-table.js +++ b/packages/react-bootstrap-table2-example/examples/sort/enable-sort-table.js @@ -1,6 +1,6 @@ import React from 'react'; -import { BootstrapTableful } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -33,12 +33,12 @@ const columns = [{ text: 'Product Price' }]; - + `; export default () => (
- + { sourceCode }
); diff --git a/packages/react-bootstrap-table2-example/src/index.js b/packages/react-bootstrap-table2-example/src/index.js index a1af3b3..10b6085 100644 --- a/packages/react-bootstrap-table2-example/src/index.js +++ b/packages/react-bootstrap-table2-example/src/index.js @@ -4,7 +4,7 @@ import React from 'react'; import ReactDom from 'react-dom'; -import { BootstrapTableful, createTable } from 'react-bootstrap-table2'; +import BootstrapTable from 'react-bootstrap-table2'; require('react-bootstrap-table2/style/react-bootstrap-table.scss'); @@ -114,5 +114,5 @@ const cellEdit = { // Table = createTable(Table); ReactDom.render( - , + , document.getElementById('example')); diff --git a/packages/react-bootstrap-table2/src/stateful-layer.js b/packages/react-bootstrap-table2/src/container.js similarity index 93% rename from packages/react-bootstrap-table2/src/stateful-layer.js rename to packages/react-bootstrap-table2/src/container.js index e7432fc..f635789 100644 --- a/packages/react-bootstrap-table2/src/stateful-layer.js +++ b/packages/react-bootstrap-table2/src/container.js @@ -7,8 +7,8 @@ import Store from './store/base'; import CellEditWrapper from './cell-edit/wrapper'; import _ from './utils'; -const withStateful = (Base) => { - class StatefulComponent extends Component { +const withDataStore = (Base) => { + return class BootstrapTableContainer extends Component { constructor(props) { super(props); this.store = new Store(props); @@ -68,8 +68,7 @@ const withStateful = (Base) => { } return element; } - } - return StatefulComponent; + }; }; -export default withStateful; +export default withDataStore; diff --git a/packages/react-bootstrap-table2/src/index.js b/packages/react-bootstrap-table2/src/index.js index c787801..db955bd 100644 --- a/packages/react-bootstrap-table2/src/index.js +++ b/packages/react-bootstrap-table2/src/index.js @@ -1,9 +1,5 @@ import BootstrapTable from './bootstrap-table'; -import withStateful from './stateful-layer'; +import withDataStore from './container'; -const BootstrapTableful = withStateful(BootstrapTable); +export default withDataStore(BootstrapTable); -export { - BootstrapTable, - BootstrapTableful -}; diff --git a/packages/react-bootstrap-table2/test/stateful-layer.test.js b/packages/react-bootstrap-table2/test/container.test.js similarity index 90% rename from packages/react-bootstrap-table2/test/stateful-layer.test.js rename to packages/react-bootstrap-table2/test/container.test.js index 23bc888..371441f 100644 --- a/packages/react-bootstrap-table2/test/stateful-layer.test.js +++ b/packages/react-bootstrap-table2/test/container.test.js @@ -2,9 +2,9 @@ import React from 'react'; import sinon from 'sinon'; import { shallow } from 'enzyme'; -import { BootstrapTable, BootstrapTableful } from '../src'; +import BootstrapTable from '../src'; -describe('withStateful', () => { +describe('withDataStore', () => { let wrapper; const keyField = 'id'; @@ -28,13 +28,12 @@ describe('withStateful', () => { describe('initialization', () => { beforeEach(() => { wrapper = shallow( - + ); }); it('should render BootstrapTable successfully', () => { expect(wrapper.length).toBe(1); - expect(wrapper.find(BootstrapTable).length).toBe(1); }); it('should creating store successfully', () => { @@ -46,14 +45,14 @@ describe('withStateful', () => { }); describe('when cellEdit is defined', () => { - const spy = jest.spyOn(BootstrapTableful.prototype, 'renderCellEdit'); + const spy = jest.spyOn(BootstrapTable.prototype, 'renderCellEdit'); const cellEdit = { mode: 'click' }; beforeEach(() => { wrapper = shallow( - { beforeEach(() => { cellEdit.onUpdate = sinon.stub().returns(false); wrapper = shallow( -