diff --git a/.eslintrc b/.eslintrc index c29b8e9..ca70c65 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,7 +11,7 @@ ], "rules": { "comma-dangle": ["error", "never"], - "react/jsx-curly-spacing": 0, + "react/jsx-curly-spacing": [2, "always"], "react/forbid-prop-types": 0, "react/jsx-filename-extension": 0, "react/jsx-space-before-closing": 0, diff --git a/packages/react-bootstrap-table2-example/examples/basic/caption-table.js b/packages/react-bootstrap-table2-example/examples/basic/caption-table.js index 2315f90..7f84142 100644 --- a/packages/react-bootstrap-table2-example/examples/basic/caption-table.js +++ b/packages/react-bootstrap-table2-example/examples/basic/caption-table.js @@ -36,12 +36,12 @@ const CaptionElement = () =>

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

Component as Header

; +const Caption = () =>

Component as Header

; export default () => (
- } columns={ columns } /> + } columns={ columns } /> { 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 ebd0e3c..760c6d9 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 @@ -203,7 +203,7 @@ const reducers = (state, action) => { const store = createStore(reducers, initialState, applyMiddleware(thunk)); const Index = () => ( - + ); diff --git a/packages/react-bootstrap-table2-example/examples/welcome.js b/packages/react-bootstrap-table2-example/examples/welcome.js index 7438298..41f3547 100644 --- a/packages/react-bootstrap-table2-example/examples/welcome.js +++ b/packages/react-bootstrap-table2-example/examples/welcome.js @@ -24,13 +24,13 @@ export default class Welcome extends React.Component {

react-bootstrap-table2

{ this.el = el; }} + ref={ (el) => { this.el = el; } } /> - diff --git a/packages/react-bootstrap-table2/src/bootstrap-table.js b/packages/react-bootstrap-table2/src/bootstrap-table.js index 834362c..f466618 100644 --- a/packages/react-bootstrap-table2/src/bootstrap-table.js +++ b/packages/react-bootstrap-table2/src/bootstrap-table.js @@ -81,8 +81,8 @@ class BootstrapTable extends PropsBaseResolver(Component) { visibleColumnSize={ this.visibleColumnSize() } noDataIndication={ noDataIndication } cellEdit={ cellEditInfo } - selectRow={cellSelectionInfo} - selectedRowKeys={store.getSelectedRowKeys()} + selectRow={ cellSelectionInfo } + selectedRowKeys={ store.getSelectedRowKeys() } /> diff --git a/packages/react-bootstrap-table2/src/header.js b/packages/react-bootstrap-table2/src/header.js index 8953c63..4730c34 100644 --- a/packages/react-bootstrap-table2/src/header.js +++ b/packages/react-bootstrap-table2/src/header.js @@ -21,7 +21,7 @@ const Header = (props) => { { - selectRow.mode === ROW_SELECT_DISABLED ? null : + selectRow.mode === ROW_SELECT_DISABLED ? null : } { columns.map((column, i) => { diff --git a/packages/react-bootstrap-table2/src/row-selection/selection-cell.js b/packages/react-bootstrap-table2/src/row-selection/selection-cell.js index 73b3e4a..604188b 100644 --- a/packages/react-bootstrap-table2/src/row-selection/selection-cell.js +++ b/packages/react-bootstrap-table2/src/row-selection/selection-cell.js @@ -48,10 +48,10 @@ export default class SelectionCell extends Component { } = 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 index b23e52c..a2c6956 100644 --- a/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js +++ b/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js @@ -6,10 +6,10 @@ import Const from '../const'; export const CheckBox = ({ checked, indeterminate }) => ( { + checked={ checked } + ref={ (input) => { if (input) input.indeterminate = indeterminate; // eslint-disable-line no-param-reassign - }} + } } /> ); @@ -64,11 +64,11 @@ export default class SelectionHeaderCell extends Component { return mode === ROW_SELECT_SINGLE ? : ( - + ); diff --git a/packages/react-bootstrap-table2/src/row.js b/packages/react-bootstrap-table2/src/row.js index fe894fc..b0b99a9 100644 --- a/packages/react-bootstrap-table2/src/row.js +++ b/packages/react-bootstrap-table2/src/row.js @@ -38,8 +38,8 @@ const Row = (props) => { : ( ) } diff --git a/packages/react-bootstrap-table2/test/body.test.js b/packages/react-bootstrap-table2/test/body.test.js index d4dc9b4..c89c35d 100644 --- a/packages/react-bootstrap-table2/test/body.test.js +++ b/packages/react-bootstrap-table2/test/body.test.js @@ -28,7 +28,7 @@ describe('Body', () => { describe('simplest body', () => { beforeEach(() => { - wrapper = shallow(); + wrapper = shallow(); }); it('should render successfully', () => { @@ -42,7 +42,7 @@ describe('Body', () => { beforeEach(() => { wrapper = shallow( { emptyIndication = 'Table is empty'; wrapper = shallow( { emptyIndicationCallBack = sinon.stub().returns(content); wrapper = shallow( { beforeEach(() => { wrapper = shallow( { it('props selected should be true if all rows were selected', () => { wrapper = shallow( ); @@ -171,12 +171,12 @@ describe('Body', () => { it('props selected should be false if all rows were not selected', () => { wrapper = shallow( ); @@ -189,11 +189,11 @@ describe('Body', () => { const keyField = 'id'; wrapper = shallow( ); }); diff --git a/packages/react-bootstrap-table2/test/header.test.js b/packages/react-bootstrap-table2/test/header.test.js index 9d121f4..0b01089 100644 --- a/packages/react-bootstrap-table2/test/header.test.js +++ b/packages/react-bootstrap-table2/test/header.test.js @@ -19,7 +19,7 @@ describe('Header', () => { describe('simplest header', () => { beforeEach(() => { - wrapper = shallow(
); + wrapper = shallow(
); }); it('should render successfully', () => { @@ -35,7 +35,7 @@ describe('Header', () => { beforeEach(() => { wrapper = shallow(
{ describe('when the selectRow.mode is radio(single selection)', () => { beforeEach(() => { - wrapper = shallow(
); + wrapper = shallow(
); }); it('should not render ', () => { @@ -66,9 +66,9 @@ describe('Header', () => { const selectRow = { mode: 'checkbox' }; wrapper = shallow(
); }); diff --git a/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js b/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js index ca64d3b..d443301 100644 --- a/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js +++ b/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js @@ -16,7 +16,7 @@ describe('', () => { it('should not update component', () => { const nextProps = { selected }; - wrapper = shallow(); + wrapper = shallow(); expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(false); }); @@ -26,7 +26,7 @@ describe('', () => { it('should update component', () => { const nextProps = { selected: !selected }; - wrapper = shallow(); + wrapper = shallow(); expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(true); }); @@ -48,9 +48,9 @@ describe('', () => { wrapper = shallow( ); @@ -65,9 +65,9 @@ describe('', () => { wrapper = shallow( ); }); @@ -89,9 +89,9 @@ describe('', () => { beforeEach(() => { wrapper = shallow( ); }); @@ -119,9 +119,9 @@ describe('', () => { beforeEach(() => { wrapper = shallow( ); }); diff --git a/packages/react-bootstrap-table2/test/row-selection/selection-header-cell.test.js b/packages/react-bootstrap-table2/test/row-selection/selection-header-cell.test.js index c877dac..d1e4b03 100644 --- a/packages/react-bootstrap-table2/test/row-selection/selection-header-cell.test.js +++ b/packages/react-bootstrap-table2/test/row-selection/selection-header-cell.test.js @@ -24,7 +24,7 @@ describe('', () => { const nextProps = { checkedStatus }; wrapper = shallow( - ); + ); expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(false); }); @@ -37,7 +37,7 @@ describe('', () => { const nextProps = { checkedStatus }; wrapper = shallow( - ); + ); expect(wrapper.instance().shouldComponentUpdate(nextProps)).toBe(true); }); @@ -60,8 +60,8 @@ describe('', () => { wrapper = shallow( ); }); @@ -78,8 +78,8 @@ describe('', () => { wrapper = shallow( ); }); @@ -98,7 +98,7 @@ describe('', () => { beforeEach(() => { const checkedStatus = Const.CHECKBOX_STATUS_CHECKED; - wrapper = shallow(); + wrapper = shallow(); }); it('should not render checkbox', () => { @@ -112,7 +112,7 @@ describe('', () => { const checkedStatus = Const.CHECKBOX_STATUS_CHECKED; beforeEach(() => { - wrapper = shallow(); + wrapper = shallow(); }); it('should render checkbox', () => { @@ -134,7 +134,7 @@ describe('', () => { it('should render component correctly', () => { const checked = true; const indeterminate = false; - wrapper = shallow(); + wrapper = shallow(); expect(wrapper.find('input').length).toBe(1); expect(wrapper.find('input').prop('checked')).toBe(checked); diff --git a/packages/react-bootstrap-table2/test/row.test.js b/packages/react-bootstrap-table2/test/row.test.js index 1e9d22f..f304dd8 100644 --- a/packages/react-bootstrap-table2/test/row.test.js +++ b/packages/react-bootstrap-table2/test/row.test.js @@ -32,7 +32,7 @@ describe('Row', () => { describe('simplest row', () => { beforeEach(() => { wrapper = shallow( - ); + ); }); it('should render successfully', () => { @@ -55,7 +55,7 @@ describe('Row', () => { }; wrapper = shallow( { columns[nonEditableColIndex].editable = false; wrapper = shallow( { columns[nonEditableColIndex].editable = editableCallBack; wrapper = shallow( { columns[nonEditableColIndex].editable = editableCallBack; wrapper = shallow( { beforeEach(() => { wrapper = shallow( { cellEdit.onUpdate = sinon.stub(); wrapper = shallow( { cellEdit.onEscape = sinon.stub(); wrapper = shallow( { describe('when selectRow.mode is ROW_SELECT_DISABLED (row was un-selectable)', () => { beforeEach(() => { wrapper = shallow( - ); + ); }); it('should not render ', () => { @@ -296,11 +296,11 @@ describe('Row', () => { const selectRow = { mode: 'checkbox' }; wrapper = shallow( ); });