mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-06-29 13:40:07 +00:00
Compare commits
17 Commits
react-boot
...
bugfix/979
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31724fec7f | ||
|
|
4cf6e65abc | ||
|
|
40c5ae7459 | ||
|
|
3747c36039 | ||
|
|
0d0d1a8913 | ||
|
|
db612eaa99 | ||
|
|
4d76d88e9a | ||
|
|
1cd31dc54c | ||
|
|
4ec02b294a | ||
|
|
60eb47dc9e | ||
|
|
d74ecb63b4 | ||
|
|
2c6cc915f0 | ||
|
|
a1457dfe59 | ||
|
|
036c3fdc32 | ||
|
|
55eea6f337 | ||
|
|
7c259cd1ee | ||
|
|
1e164bb3f4 |
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# Row selection
|
# 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.
|
`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 prepend a new selection column.
|
||||||
|
|
||||||
## Required
|
## Required
|
||||||
* [mode (**required**)](#mode)
|
* [mode (**required**)](#mode)
|
||||||
@@ -16,11 +16,13 @@
|
|||||||
* [clickToEdit](#clickToEdit)
|
* [clickToEdit](#clickToEdit)
|
||||||
* [onSelect](#onSelect)
|
* [onSelect](#onSelect)
|
||||||
* [onSelectAll](#onSelectAll)
|
* [onSelectAll](#onSelectAll)
|
||||||
|
* [selectColumnPosition](#selectColumnPosition)
|
||||||
* [hideSelectColumn](#hideSelectColumn)
|
* [hideSelectColumn](#hideSelectColumn)
|
||||||
* [hideSelectAll](#hideSelectAll)
|
* [hideSelectAll](#hideSelectAll)
|
||||||
* [selectionRenderer](#selectionRenderer)
|
* [selectionRenderer](#selectionRenderer)
|
||||||
* [selectionHeaderRenderer](#selectionHeaderRenderer)
|
* [selectionHeaderRenderer](#selectionHeaderRenderer)
|
||||||
* [headerColumnStyle](#headerColumnStyle)
|
* [headerColumnStyle](#headerColumnStyle)
|
||||||
|
* [selectColumnStyle](#selectColumnStyle)
|
||||||
|
|
||||||
### <a name="mode">selectRow.mode - [String]</a>
|
### <a name="mode">selectRow.mode - [String]</a>
|
||||||
|
|
||||||
@@ -224,6 +226,42 @@ const selectRow = {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### <a name='selectColumnStyle'>selectRow.selectColumnStyle - [Object | Function]</a>
|
||||||
|
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
|
||||||
|
|
||||||
|
```js
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
const selectRow = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
selectColumnStyle: ({
|
||||||
|
checked,
|
||||||
|
disabled,
|
||||||
|
rowIndex,
|
||||||
|
rowKey
|
||||||
|
}) => (
|
||||||
|
// ....
|
||||||
|
return { backgroundColor: 'blue' };
|
||||||
|
)
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
### <a name='onSelect'>selectRow.onSelect - [Function]</a>
|
### <a name='onSelect'>selectRow.onSelect - [Function]</a>
|
||||||
This callback function will be called when a row is select/unselect and pass following three arguments:
|
This callback function will be called when a row is select/unselect and pass following three arguments:
|
||||||
`row`, `isSelect`, `rowIndex` and `e`.
|
`row`, `isSelect`, `rowIndex` and `e`.
|
||||||
@@ -275,6 +313,16 @@ const selectRow = {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### <a name='selectColumnPosition'>selectRow.selectColumnPosition - [String]</a>
|
||||||
|
Default is `left`. You can give this as `right` for rendering selection column in the right side.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const selectRow = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
selectColumnPosition: 'right'
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
### <a name='hideSelectColumn'>selectRow.hideSelectColumn - [Bool]</a>
|
### <a name='hideSelectColumn'>selectRow.hideSelectColumn - [Bool]</a>
|
||||||
Default is `false`, if you don't want to have a selection column, give this prop as `true`
|
Default is `false`, if you don't want to have a selection column, give this prop as `true`
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,10 @@ const columns = [
|
|||||||
In the following, we go though all the predefined editors:
|
In the following, we go though all the predefined editors:
|
||||||
|
|
||||||
### Dropdown Editor
|
### Dropdown Editor
|
||||||
Dropdown editor give a select menu to choose a data from a list, the `editor.options` is required property for 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.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Type } from 'react-bootstrap-table2-editor';
|
import { Type } from 'react-bootstrap-table2-editor';
|
||||||
@@ -119,6 +122,46 @@ const columns = [
|
|||||||
}];
|
}];
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 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.
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Synchronous
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
..., {
|
||||||
|
dataField: 'type',
|
||||||
|
text: 'Job Type',
|
||||||
|
editor: {
|
||||||
|
type: Type.SELECT,
|
||||||
|
getOptions: () => [.....]
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
// Asynchronous
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
..., {
|
||||||
|
dataField: 'type',
|
||||||
|
text: 'Job Type',
|
||||||
|
editor: {
|
||||||
|
type: Type.SELECT,
|
||||||
|
getOptions: (setOptions) => {
|
||||||
|
setTimeout(() => setOptions([...]), 1500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
[here](https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=Cell%20Editing&selectedStory=Dropdown%20Editor%20with%20Dynamic%20Options) is an online example.
|
||||||
|
|
||||||
### Date Editor
|
### Date Editor
|
||||||
Date editor is use `<input type="date">`, the configuration is very simple:
|
Date editor is use `<input type="date">`, the configuration is very simple:
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-bootstrap-table2-editor",
|
"name": "react-bootstrap-table2-editor",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"description": "it's the editor addon for react-bootstrap-table2",
|
"description": "it's the editor addon for react-bootstrap-table2",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ import cs from 'classnames';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
class DropDownEditor extends Component {
|
class DropDownEditor extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
let options = props.options;
|
||||||
|
if (props.getOptions) {
|
||||||
|
options = props.getOptions(this.setOptions.bind(this)) || [];
|
||||||
|
}
|
||||||
|
this.state = { options };
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { defaultValue, didMount } = this.props;
|
const { defaultValue, didMount } = this.props;
|
||||||
this.select.value = defaultValue;
|
this.select.value = defaultValue;
|
||||||
@@ -11,12 +20,16 @@ class DropDownEditor extends Component {
|
|||||||
if (didMount) didMount();
|
if (didMount) didMount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setOptions(options) {
|
||||||
|
this.setState({ options });
|
||||||
|
}
|
||||||
|
|
||||||
getValue() {
|
getValue() {
|
||||||
return this.select.value;
|
return this.select.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { defaultValue, didMount, className, options, ...rest } = this.props;
|
const { defaultValue, didMount, getOptions, className, ...rest } = this.props;
|
||||||
const editorClass = cs('form-control editor edit-select', className);
|
const editorClass = cs('form-control editor edit-select', className);
|
||||||
|
|
||||||
const attr = {
|
const attr = {
|
||||||
@@ -31,7 +44,7 @@ class DropDownEditor extends Component {
|
|||||||
defaultValue={ defaultValue }
|
defaultValue={ defaultValue }
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
options.map(({ label, value }) => (
|
this.state.options.map(({ label, value }) => (
|
||||||
<option key={ value } value={ value }>{ label }</option>
|
<option key={ value } value={ value }>{ label }</option>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@@ -52,13 +65,16 @@ DropDownEditor.propTypes = {
|
|||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
value: PropTypes.any
|
value: PropTypes.any
|
||||||
}))
|
}))
|
||||||
]).isRequired,
|
]),
|
||||||
didMount: PropTypes.func
|
didMount: PropTypes.func,
|
||||||
|
getOptions: PropTypes.func
|
||||||
};
|
};
|
||||||
DropDownEditor.defaultProps = {
|
DropDownEditor.defaultProps = {
|
||||||
className: '',
|
className: '',
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
style: {},
|
style: {},
|
||||||
didMount: undefined
|
options: [],
|
||||||
|
didMount: undefined,
|
||||||
|
getOptions: undefined
|
||||||
};
|
};
|
||||||
export default DropDownEditor;
|
export default DropDownEditor;
|
||||||
|
|||||||
@@ -0,0 +1,155 @@
|
|||||||
|
/* eslint react/prefer-stateless-function: 0 */
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
import cellEditFactory, { Type } from 'react-bootstrap-table2-editor';
|
||||||
|
import Code from 'components/common/code-block';
|
||||||
|
import { jobsGenerator } from 'utils/common';
|
||||||
|
|
||||||
|
const jobs = jobsGenerator().map(j => ({
|
||||||
|
...j,
|
||||||
|
type2: j.type
|
||||||
|
}));
|
||||||
|
|
||||||
|
const columns = [{
|
||||||
|
dataField: 'id',
|
||||||
|
text: 'Job ID'
|
||||||
|
}, {
|
||||||
|
dataField: 'name',
|
||||||
|
text: 'Job Name'
|
||||||
|
}, {
|
||||||
|
dataField: 'owner',
|
||||||
|
text: 'Job Owner'
|
||||||
|
}, {
|
||||||
|
dataField: 'type',
|
||||||
|
text: 'Job Type1',
|
||||||
|
editor: {
|
||||||
|
type: Type.SELECT,
|
||||||
|
getOptions: () => [{
|
||||||
|
value: 'A',
|
||||||
|
label: 'A'
|
||||||
|
}, {
|
||||||
|
value: 'B',
|
||||||
|
label: 'B'
|
||||||
|
}, {
|
||||||
|
value: 'C',
|
||||||
|
label: 'C'
|
||||||
|
}, {
|
||||||
|
value: 'D',
|
||||||
|
label: 'D'
|
||||||
|
}, {
|
||||||
|
value: 'E',
|
||||||
|
label: 'E'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
dataField: 'type2',
|
||||||
|
text: 'Job Type2',
|
||||||
|
editor: {
|
||||||
|
type: Type.SELECT,
|
||||||
|
getOptions: (setOptions) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
setOptions([{
|
||||||
|
value: 'A',
|
||||||
|
label: 'A'
|
||||||
|
}, {
|
||||||
|
value: 'B',
|
||||||
|
label: 'B'
|
||||||
|
}, {
|
||||||
|
value: 'C',
|
||||||
|
label: 'C'
|
||||||
|
}, {
|
||||||
|
value: 'D',
|
||||||
|
label: 'D'
|
||||||
|
}, {
|
||||||
|
value: 'E',
|
||||||
|
label: 'E'
|
||||||
|
}]);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
const sourceCode = `\
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
import cellEditFactory, { Type } from 'react-bootstrap-table2-editor';
|
||||||
|
|
||||||
|
const columns = [{
|
||||||
|
dataField: 'id',
|
||||||
|
text: 'Job ID'
|
||||||
|
}, {
|
||||||
|
dataField: 'name',
|
||||||
|
text: 'Job Name'
|
||||||
|
}, {
|
||||||
|
dataField: 'owner',
|
||||||
|
text: 'Job Owner'
|
||||||
|
}, {
|
||||||
|
dataField: 'type',
|
||||||
|
text: 'Job Type1',
|
||||||
|
editor: {
|
||||||
|
type: Type.SELECT,
|
||||||
|
getOptions: () => [{
|
||||||
|
value: 'A',
|
||||||
|
label: 'A'
|
||||||
|
}, {
|
||||||
|
value: 'B',
|
||||||
|
label: 'B'
|
||||||
|
}, {
|
||||||
|
value: 'C',
|
||||||
|
label: 'C'
|
||||||
|
}, {
|
||||||
|
value: 'D',
|
||||||
|
label: 'D'
|
||||||
|
}, {
|
||||||
|
value: 'E',
|
||||||
|
label: 'E'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
dataField: 'type2',
|
||||||
|
text: 'Job Type2',
|
||||||
|
editor: {
|
||||||
|
type: Type.SELECT,
|
||||||
|
getOptions: (setOptions) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
setOptions([{
|
||||||
|
value: 'A',
|
||||||
|
label: 'A'
|
||||||
|
}, {
|
||||||
|
value: 'B',
|
||||||
|
label: 'B'
|
||||||
|
}, {
|
||||||
|
value: 'C',
|
||||||
|
label: 'C'
|
||||||
|
}, {
|
||||||
|
value: 'D',
|
||||||
|
label: 'D'
|
||||||
|
}, {
|
||||||
|
value: 'E',
|
||||||
|
label: 'E'
|
||||||
|
}]);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
<BootstrapTable
|
||||||
|
keyField="id"
|
||||||
|
data={ jobs }
|
||||||
|
columns={ columns }
|
||||||
|
cellEdit={ cellEditFactory({ mode: 'click', blurToSave: true }) }
|
||||||
|
/>
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default () => (
|
||||||
|
<div>
|
||||||
|
<h3>Dropdown Editor with Dynamic Options</h3>
|
||||||
|
<BootstrapTable
|
||||||
|
keyField="id"
|
||||||
|
data={ jobs }
|
||||||
|
columns={ columns }
|
||||||
|
cellEdit={ cellEditFactory({ mode: 'click', blurToSave: true }) }
|
||||||
|
/>
|
||||||
|
<Code>{ sourceCode }</Code>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
188
packages/react-bootstrap-table2-example/examples/columns/row-expand-with-formatted-dummy-column.js
vendored
Normal file
188
packages/react-bootstrap-table2-example/examples/columns/row-expand-with-formatted-dummy-column.js
vendored
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
/* eslint no-param-reassign: 0 */
|
||||||
|
import React from 'react';
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
import Code from 'components/common/code-block';
|
||||||
|
import { productsGenerator } from 'utils/common';
|
||||||
|
|
||||||
|
const products = productsGenerator();
|
||||||
|
|
||||||
|
const sourceCode = `\
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
|
||||||
|
class DummyColumnWithRowExpand extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
hoverIdx: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
expandRow = {
|
||||||
|
renderer: () => (
|
||||||
|
<div style={ { width: '100%', height: '20px' } }>Content</div>
|
||||||
|
),
|
||||||
|
showExpandColumn: true,
|
||||||
|
expandByColumnOnly: true
|
||||||
|
};
|
||||||
|
|
||||||
|
actionFormater = (cell, row, rowIndex, { hoverIdx }) => {
|
||||||
|
if ((hoverIdx !== null || hoverIdx !== undefined) && hoverIdx === rowIndex) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={ { width: '20px', height: '20px', backgroundColor: 'orange' } }
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={ { width: '20px', height: '20px' } }
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
rowEvents = {
|
||||||
|
onMouseEnter: (e, row, rowIndex) => {
|
||||||
|
this.setState({ hoverIdx: rowIndex });
|
||||||
|
},
|
||||||
|
onMouseLeave: () => {
|
||||||
|
this.setState({ hoverIdx: null });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rowStyle = (row, rowIndex) => {
|
||||||
|
row.index = rowIndex;
|
||||||
|
const style = {};
|
||||||
|
if (rowIndex % 2 === 0) {
|
||||||
|
style.backgroundColor = 'transparent';
|
||||||
|
} else {
|
||||||
|
style.backgroundColor = 'rgba(54, 163, 173, .10)';
|
||||||
|
}
|
||||||
|
style.borderTop = 'none';
|
||||||
|
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const columns = [{
|
||||||
|
dataField: 'id',
|
||||||
|
text: 'Product ID'
|
||||||
|
}, {
|
||||||
|
dataField: 'name',
|
||||||
|
text: 'Product Name'
|
||||||
|
}, {
|
||||||
|
dataField: 'price',
|
||||||
|
text: 'Product Price'
|
||||||
|
}, {
|
||||||
|
text: '',
|
||||||
|
isDummyField: true,
|
||||||
|
formatter: this.actionFormater,
|
||||||
|
formatExtraData: { hoverIdx: this.state.hoverIdx },
|
||||||
|
headerStyle: { width: '50px' },
|
||||||
|
style: { height: '30px' }
|
||||||
|
}];
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<BootstrapTable
|
||||||
|
keyField="id"
|
||||||
|
data={ products }
|
||||||
|
columns={ columns }
|
||||||
|
noDataIndication="There is no data"
|
||||||
|
classes="table"
|
||||||
|
rowStyle={ this.rowStyle }
|
||||||
|
rowEvents={ this.rowEvents }
|
||||||
|
expandRow={ this.expandRow }
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default class DummyColumnWithRowExpand extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
hoverIdx: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
expandRow = {
|
||||||
|
renderer: () => (
|
||||||
|
<div style={ { width: '100%', height: '20px' } }>Content</div>
|
||||||
|
),
|
||||||
|
showExpandColumn: true,
|
||||||
|
expandByColumnOnly: true
|
||||||
|
};
|
||||||
|
|
||||||
|
actionFormater = (cell, row, rowIndex, { hoverIdx }) => {
|
||||||
|
if ((hoverIdx !== null || hoverIdx !== undefined) && hoverIdx === rowIndex) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={ { width: '20px', height: '20px', backgroundColor: 'orange' } }
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={ { width: '20px', height: '20px' } }
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
rowEvents = {
|
||||||
|
onMouseEnter: (e, row, rowIndex) => {
|
||||||
|
this.setState({ hoverIdx: rowIndex });
|
||||||
|
},
|
||||||
|
onMouseLeave: () => {
|
||||||
|
this.setState({ hoverIdx: null });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rowStyle = (row, rowIndex) => {
|
||||||
|
row.index = rowIndex;
|
||||||
|
const style = {};
|
||||||
|
if (rowIndex % 2 === 0) {
|
||||||
|
style.backgroundColor = 'transparent';
|
||||||
|
} else {
|
||||||
|
style.backgroundColor = 'rgba(54, 163, 173, .10)';
|
||||||
|
}
|
||||||
|
style.borderTop = 'none';
|
||||||
|
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const columns = [{
|
||||||
|
dataField: 'id',
|
||||||
|
text: 'Product ID'
|
||||||
|
}, {
|
||||||
|
dataField: 'name',
|
||||||
|
text: 'Product Name'
|
||||||
|
}, {
|
||||||
|
dataField: 'price',
|
||||||
|
text: 'Product Price'
|
||||||
|
}, {
|
||||||
|
isDummyField: true,
|
||||||
|
text: '',
|
||||||
|
formatter: this.actionFormater,
|
||||||
|
formatExtraData: { hoverIdx: this.state.hoverIdx },
|
||||||
|
headerStyle: { width: '50px' },
|
||||||
|
style: { height: '30px' }
|
||||||
|
}];
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<BootstrapTable
|
||||||
|
keyField="id"
|
||||||
|
data={ products }
|
||||||
|
columns={ columns }
|
||||||
|
rowStyle={ this.rowStyle }
|
||||||
|
rowEvents={ this.rowEvents }
|
||||||
|
expandRow={ this.expandRow }
|
||||||
|
/>
|
||||||
|
<Code>{ sourceCode }</Code>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
110
packages/react-bootstrap-table2-example/examples/row-selection/select-column-style.js
vendored
Normal file
110
packages/react-bootstrap-table2-example/examples/row-selection/select-column-style.js
vendored
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/* eslint no-unused-vars: 0 */
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
import Code from 'components/common/code-block';
|
||||||
|
import { productsGenerator } from 'utils/common';
|
||||||
|
|
||||||
|
const products = productsGenerator(2);
|
||||||
|
|
||||||
|
const columns = [{
|
||||||
|
dataField: 'id',
|
||||||
|
text: 'Product ID'
|
||||||
|
}, {
|
||||||
|
dataField: 'name',
|
||||||
|
text: 'Product Name'
|
||||||
|
}, {
|
||||||
|
dataField: 'price',
|
||||||
|
text: 'Product Price'
|
||||||
|
}];
|
||||||
|
|
||||||
|
const selectRow1 = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
clickToSelect: true,
|
||||||
|
selectColumnStyle: {
|
||||||
|
backgroundColor: 'grey'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const sourceCode1 = `\
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
|
||||||
|
const columns = ...
|
||||||
|
|
||||||
|
const selectRow = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
clickToSelect: true,
|
||||||
|
selectColumnStyle: {
|
||||||
|
backgroundColor: 'grey'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
<BootstrapTable
|
||||||
|
keyField='id'
|
||||||
|
data={ products }
|
||||||
|
columns={ columns }
|
||||||
|
selectRow={ selectRow }
|
||||||
|
/>
|
||||||
|
`;
|
||||||
|
|
||||||
|
const selectRow2 = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
clickToSelect: true,
|
||||||
|
selectColumnStyle: ({
|
||||||
|
checked,
|
||||||
|
disabled,
|
||||||
|
rowIndex,
|
||||||
|
rowKey
|
||||||
|
}) => {
|
||||||
|
if (checked) {
|
||||||
|
return {
|
||||||
|
backgroundColor: 'yellow'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
backgroundColor: 'pink'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const sourceCode2 = `\
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
|
||||||
|
const columns = ...
|
||||||
|
|
||||||
|
const selectRow = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
clickToSelect: true,
|
||||||
|
selectColumnStyle: ({
|
||||||
|
checked,
|
||||||
|
disabled,
|
||||||
|
rowIndex,
|
||||||
|
rowKey
|
||||||
|
}) => {
|
||||||
|
if (checked) {
|
||||||
|
return {
|
||||||
|
backgroundColor: 'yellow'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
backgroundColor: 'pink'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
<BootstrapTable
|
||||||
|
keyField='id'
|
||||||
|
data={ products }
|
||||||
|
columns={ columns }
|
||||||
|
selectRow={ selectRow }
|
||||||
|
/>
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default () => (
|
||||||
|
<div>
|
||||||
|
<BootstrapTable keyField="id" data={ products } columns={ columns } selectRow={ selectRow1 } />
|
||||||
|
<Code>{ sourceCode1 }</Code>
|
||||||
|
<BootstrapTable keyField="id" data={ products } columns={ columns } selectRow={ selectRow2 } />
|
||||||
|
<Code>{ sourceCode2 }</Code>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
59
packages/react-bootstrap-table2-example/examples/row-selection/selection-column-position.js
vendored
Normal file
59
packages/react-bootstrap-table2-example/examples/row-selection/selection-column-position.js
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
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,
|
||||||
|
selectColumnPosition: 'right'
|
||||||
|
};
|
||||||
|
|
||||||
|
const sourceCode = `\
|
||||||
|
import BootstrapTable from 'react-bootstrap-table-next';
|
||||||
|
|
||||||
|
const columns = [{
|
||||||
|
dataField: 'id',
|
||||||
|
text: 'Product ID'
|
||||||
|
}, {
|
||||||
|
dataField: 'name',
|
||||||
|
text: 'Product Name'
|
||||||
|
}, {
|
||||||
|
dataField: 'price',
|
||||||
|
text: 'Product Price'
|
||||||
|
}];
|
||||||
|
|
||||||
|
const selectRow = {
|
||||||
|
mode: 'checkbox',
|
||||||
|
clickToSelect: true,
|
||||||
|
selectColumnPosition: 'right'
|
||||||
|
};
|
||||||
|
|
||||||
|
<BootstrapTable
|
||||||
|
keyField='id'
|
||||||
|
data={ products }
|
||||||
|
columns={ columns }
|
||||||
|
selectRow={ selectRow }
|
||||||
|
/>
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default () => (
|
||||||
|
<div>
|
||||||
|
<BootstrapTable keyField="id" data={ products } columns={ columns } selectRow={ selectRow } />
|
||||||
|
<Code>{ sourceCode }</Code>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-bootstrap-table2-example",
|
"name": "react-bootstrap-table2-example",
|
||||||
"version": "1.0.25",
|
"version": "1.0.26",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import ColumnEventTable from 'examples/columns/column-event-table';
|
|||||||
import ColumnHiddenTable from 'examples/columns/column-hidden-table';
|
import ColumnHiddenTable from 'examples/columns/column-hidden-table';
|
||||||
import ColumnAttrsTable from 'examples/columns/column-attrs-table';
|
import ColumnAttrsTable from 'examples/columns/column-attrs-table';
|
||||||
import DummyColumnTable from 'examples/columns/dummy-column-table';
|
import DummyColumnTable from 'examples/columns/dummy-column-table';
|
||||||
|
import RowExpandWithFormattedDummyColumn from 'examples/columns/row-expand-with-formatted-dummy-column.js';
|
||||||
|
|
||||||
// work on header columns
|
// work on header columns
|
||||||
import HeaderColumnFormatTable from 'examples/header-columns/column-format-table';
|
import HeaderColumnFormatTable from 'examples/header-columns/column-format-table';
|
||||||
@@ -125,6 +126,7 @@ import EditorStyleTable from 'examples/cell-edit/editor-style-table';
|
|||||||
import EditorClassTable from 'examples/cell-edit/editor-class-table';
|
import EditorClassTable from 'examples/cell-edit/editor-class-table';
|
||||||
import DBClickEditWithSelection from 'examples/cell-edit/dbclick-to-edit-with-selection-table';
|
import DBClickEditWithSelection from 'examples/cell-edit/dbclick-to-edit-with-selection-table';
|
||||||
import DropdownEditorTable from 'examples/cell-edit/dropdown-editor-table';
|
import DropdownEditorTable from 'examples/cell-edit/dropdown-editor-table';
|
||||||
|
import DropdownEditorWithDynamicOptionsTable from 'examples/cell-edit/dropdown-editor-with-dynamic-options-table';
|
||||||
import TextareaEditorTable from 'examples/cell-edit/textarea-editor-table';
|
import TextareaEditorTable from 'examples/cell-edit/textarea-editor-table';
|
||||||
import CheckboxEditorTable from 'examples/cell-edit/checkbox-editor-table';
|
import CheckboxEditorTable from 'examples/cell-edit/checkbox-editor-table';
|
||||||
import DateEditorTable from 'examples/cell-edit/date-editor-table';
|
import DateEditorTable from 'examples/cell-edit/date-editor-table';
|
||||||
@@ -149,6 +151,8 @@ import NonSelectableRowsTable from 'examples/row-selection/non-selectable-rows';
|
|||||||
import SelectionBgColorTable from 'examples/row-selection/selection-bgcolor';
|
import SelectionBgColorTable from 'examples/row-selection/selection-bgcolor';
|
||||||
import SelectionHooks from 'examples/row-selection/selection-hooks';
|
import SelectionHooks from 'examples/row-selection/selection-hooks';
|
||||||
import HideSelectionColumnTable from 'examples/row-selection/hide-selection-column';
|
import HideSelectionColumnTable from 'examples/row-selection/hide-selection-column';
|
||||||
|
import SelectionColumnStyleTable from 'examples/row-selection/select-column-style';
|
||||||
|
import SelectionColumnPositionTable from 'examples/row-selection/selection-column-position';
|
||||||
|
|
||||||
// work on row expand
|
// work on row expand
|
||||||
import BasicRowExpand from 'examples/row-expand';
|
import BasicRowExpand from 'examples/row-expand';
|
||||||
@@ -270,7 +274,8 @@ storiesOf('Work on Columns', module)
|
|||||||
.add('Customize Column Class', () => <ColumnClassTable />)
|
.add('Customize Column Class', () => <ColumnClassTable />)
|
||||||
.add('Customize Column Style', () => <ColumnStyleTable />)
|
.add('Customize Column Style', () => <ColumnStyleTable />)
|
||||||
.add('Customize Column HTML attribute', () => <ColumnAttrsTable />)
|
.add('Customize Column HTML attribute', () => <ColumnAttrsTable />)
|
||||||
.add('Dummy Column', () => <DummyColumnTable />);
|
.add('Dummy Column', () => <DummyColumnTable />)
|
||||||
|
.add('Row Expand with Dummy Column Formatter', () => <RowExpandWithFormattedDummyColumn />);
|
||||||
|
|
||||||
storiesOf('Work on Header Columns', module)
|
storiesOf('Work on Header Columns', module)
|
||||||
.addDecorator(bootstrapStyle())
|
.addDecorator(bootstrapStyle())
|
||||||
@@ -368,6 +373,7 @@ storiesOf('Cell Editing', module)
|
|||||||
.add('Custom Editor Style', () => <EditorStyleTable />)
|
.add('Custom Editor Style', () => <EditorStyleTable />)
|
||||||
.add('DoubleClick to Edit with Selection', () => <DBClickEditWithSelection />)
|
.add('DoubleClick to Edit with Selection', () => <DBClickEditWithSelection />)
|
||||||
.add('Dropdown Editor', () => <DropdownEditorTable />)
|
.add('Dropdown Editor', () => <DropdownEditorTable />)
|
||||||
|
.add('Dropdown Editor with Dynamic Options', () => <DropdownEditorWithDynamicOptionsTable />)
|
||||||
.add('Textarea Editor', () => <TextareaEditorTable />)
|
.add('Textarea Editor', () => <TextareaEditorTable />)
|
||||||
.add('Checkbox Editor', () => <CheckboxEditorTable />)
|
.add('Checkbox Editor', () => <CheckboxEditorTable />)
|
||||||
.add('Date Editor', () => <DateEditorTable />)
|
.add('Date Editor', () => <DateEditorTable />)
|
||||||
@@ -392,7 +398,9 @@ storiesOf('Row Selection', module)
|
|||||||
.add('Selection Background Color', () => <SelectionBgColorTable />)
|
.add('Selection Background Color', () => <SelectionBgColorTable />)
|
||||||
.add('Not Selectabled Rows', () => <NonSelectableRowsTable />)
|
.add('Not Selectabled Rows', () => <NonSelectableRowsTable />)
|
||||||
.add('Selection Hooks', () => <SelectionHooks />)
|
.add('Selection Hooks', () => <SelectionHooks />)
|
||||||
.add('Hide Selection Column', () => <HideSelectionColumnTable />);
|
.add('Hide Selection Column', () => <HideSelectionColumnTable />)
|
||||||
|
.add('Custom Selection Column Style', () => <SelectionColumnStyleTable />)
|
||||||
|
.add('Selection Column Position', () => <SelectionColumnPositionTable />);
|
||||||
|
|
||||||
storiesOf('Row Expand', module)
|
storiesOf('Row Expand', module)
|
||||||
.addDecorator(bootstrapStyle())
|
.addDecorator(bootstrapStyle())
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ export default options => loading =>
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
const { wrapper } = this.overlay;
|
const { wrapper } = this.overlay;
|
||||||
const masker = wrapper.firstChild;
|
const masker = wrapper.current.firstChild;
|
||||||
const headerDOM = wrapper.parentElement.querySelector('thead');
|
const headerDOM = wrapper.current.parentElement.querySelector('thead');
|
||||||
const bodyDOM = wrapper.parentElement.querySelector('tbody');
|
const bodyDOM = wrapper.current.parentElement.querySelector('tbody');
|
||||||
const captionDOM = wrapper.parentElement.querySelector('caption');
|
const captionDOM = wrapper.current.parentElement.querySelector('caption');
|
||||||
|
|
||||||
let marginTop = window.getComputedStyle(headerDOM).height;
|
let marginTop = window.getComputedStyle(headerDOM).height;
|
||||||
if (captionDOM) {
|
if (captionDOM) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-bootstrap-table2-overlay",
|
"name": "react-bootstrap-table2-overlay",
|
||||||
"version": "1.0.0",
|
"version": "2.0.0",
|
||||||
"description": "it's a loading overlay addons for react-bootstrap-table2",
|
"description": "it's a loading overlay addons for react-bootstrap-table2",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-loading-overlay": "0.2.8"
|
"react-loading-overlay": "1.0.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"prop-types": "^15.0.0",
|
"prop-types": "^15.0.0",
|
||||||
|
|||||||
@@ -2,199 +2,351 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
asap@~2.0.3:
|
"@babel/helper-module-imports@^7.0.0":
|
||||||
version "2.0.6"
|
version "7.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
|
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d"
|
||||||
|
integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==
|
||||||
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:
|
dependencies:
|
||||||
base64-js "^1.0.2"
|
"@babel/types" "^7.0.0"
|
||||||
ieee754 "^1.1.4"
|
|
||||||
|
|
||||||
chain-function@^1.0.0:
|
"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.2":
|
||||||
version "1.0.0"
|
version "7.4.4"
|
||||||
resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"
|
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.4.tgz#dc2e34982eb236803aa27a07fea6857af1b9171d"
|
||||||
|
integrity sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==
|
||||||
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:
|
dependencies:
|
||||||
css-color-keywords "^1.0.0"
|
regenerator-runtime "^0.13.2"
|
||||||
fbjs "^0.8.5"
|
|
||||||
postcss-value-parser "^3.3.0"
|
|
||||||
|
|
||||||
dom-helpers@^3.2.0:
|
"@babel/types@^7.0.0":
|
||||||
version "3.2.1"
|
version "7.4.4"
|
||||||
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.2.1.tgz#3203e07fed217bd1f424b019735582fc37b2825a"
|
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0"
|
||||||
|
integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==
|
||||||
encoding@^0.1.11:
|
|
||||||
version "0.1.12"
|
|
||||||
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
iconv-lite "~0.4.13"
|
esutils "^2.0.2"
|
||||||
|
lodash "^4.17.11"
|
||||||
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
fbjs@^0.8.16, fbjs@^0.8.5, fbjs@^0.8.9:
|
"@emotion/cache@^10.0.9":
|
||||||
version "0.8.16"
|
version "10.0.9"
|
||||||
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
|
resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.9.tgz#e0c7b7a289f7530edcfad4dcf3858bd2e5700a6f"
|
||||||
|
integrity sha512-f7MblpE2xoimC4fCMZ9pivmsIn7hyWRIvY75owMDi8pdOSeh+w5tH3r4hBJv/LLrwiMM7cTQURqTPcYoL5pWnw==
|
||||||
dependencies:
|
dependencies:
|
||||||
core-js "^1.0.0"
|
"@emotion/sheet" "0.9.2"
|
||||||
isomorphic-fetch "^2.1.1"
|
"@emotion/stylis" "0.8.3"
|
||||||
loose-envify "^1.0.0"
|
"@emotion/utils" "0.11.1"
|
||||||
object-assign "^4.1.0"
|
"@emotion/weak-memoize" "0.2.2"
|
||||||
promise "^7.1.1"
|
|
||||||
setimmediate "^1.0.5"
|
|
||||||
ua-parser-js "^0.7.9"
|
|
||||||
|
|
||||||
has-flag@^1.0.0:
|
"@emotion/hash@0.7.1":
|
||||||
version "1.0.0"
|
version "0.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
|
resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.7.1.tgz#9833722341379fb7d67f06a4b00ab3c37913da53"
|
||||||
|
integrity sha512-OYpa/Sg+2GDX+jibUfpZVn1YqSVRpYmTLF2eyAfrFTIJSbwyIrc+YscayoykvaOME/wV4BV0Sa0yqdMrgse6mA==
|
||||||
|
|
||||||
hoist-non-react-statics@^1.2.0:
|
"@emotion/memoize@0.7.1":
|
||||||
version "1.2.0"
|
version "0.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
|
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.1.tgz#e93c13942592cf5ef01aa8297444dc192beee52f"
|
||||||
|
integrity sha512-Qv4LTqO11jepd5Qmlp3M1YEjBumoTHcHFdgPTQ+sFlIL5myi/7xu/POwP7IRu6odBdmLXdtIs1D6TuW6kbwbbg==
|
||||||
|
|
||||||
iconv-lite@~0.4.13:
|
"@emotion/serialize@^0.11.6":
|
||||||
version "0.4.19"
|
version "0.11.6"
|
||||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
|
resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.11.6.tgz#78be8b9ee9ff49e0196233ba6ec1c1768ba1e1fc"
|
||||||
|
integrity sha512-n4zVv2qGLmspF99jaEUwnMV0fnEGsyUMsC/8KZKUSUTZMYljHE+j+B6rSD8PIFtaUIhHaxCG2JawN6L+OgLN0Q==
|
||||||
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:
|
dependencies:
|
||||||
isobject "^3.0.1"
|
"@emotion/hash" "0.7.1"
|
||||||
|
"@emotion/memoize" "0.7.1"
|
||||||
|
"@emotion/unitless" "0.7.3"
|
||||||
|
"@emotion/utils" "0.11.1"
|
||||||
|
csstype "^2.5.7"
|
||||||
|
|
||||||
is-stream@^1.0.1:
|
"@emotion/sheet@0.9.2":
|
||||||
|
version "0.9.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-0.9.2.tgz#74e5c6b5e489a1ba30ab246ab5eedd96916487c4"
|
||||||
|
integrity sha512-pVBLzIbC/QCHDKJF2E82V2H/W/B004mDFQZiyo/MSR+VC4pV5JLG0TF/zgQDFvP3fZL/5RTPGEmXlYJBMUuJ+A==
|
||||||
|
|
||||||
|
"@emotion/stylis@0.8.3":
|
||||||
|
version "0.8.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.8.3.tgz#3ca7e9bcb31b3cb4afbaeb66156d86ee85e23246"
|
||||||
|
integrity sha512-M3nMfJ6ndJMYloSIbYEBq6G3eqoYD41BpDOxreE8j0cb4fzz/5qvmqU9Mb2hzsXcCnIlGlWhS03PCzVGvTAe0Q==
|
||||||
|
|
||||||
|
"@emotion/unitless@0.7.3":
|
||||||
|
version "0.7.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.3.tgz#6310a047f12d21a1036fb031317219892440416f"
|
||||||
|
integrity sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg==
|
||||||
|
|
||||||
|
"@emotion/utils@0.11.1":
|
||||||
|
version "0.11.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.11.1.tgz#8529b7412a6eb4b48bdf6e720cc1b8e6e1e17628"
|
||||||
|
integrity sha512-8M3VN0hetwhsJ8dH8VkVy7xo5/1VoBsDOk/T4SJOeXwTO1c4uIqVNx2qyecLFnnUWD5vvUqHQ1gASSeUN6zcTg==
|
||||||
|
|
||||||
|
"@emotion/weak-memoize@0.2.2":
|
||||||
|
version "0.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.2.tgz#63985d3d8b02530e0869962f4da09142ee8e200e"
|
||||||
|
integrity sha512-n/VQ4mbfr81aqkx/XmVicOLjviMuy02eenSdJY33SVA7S2J42EU0P1H0mOogfYedb3wXA0d/LVtBrgTSm04WEA==
|
||||||
|
|
||||||
|
argparse@^1.0.7:
|
||||||
|
version "1.0.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||||
|
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||||
|
dependencies:
|
||||||
|
sprintf-js "~1.0.2"
|
||||||
|
|
||||||
|
babel-plugin-emotion@^10.0.9:
|
||||||
|
version "10.0.9"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.9.tgz#04a0404d5a4084d5296357a393d344c0f8303ae4"
|
||||||
|
integrity sha512-IfWP12e9/wHtWHxVTzD692Nbcmrmcz2tip7acp6YUqtrP7slAyr5B+69hyZ8jd55GsyNSZwryNnmuDEVe0j+7w==
|
||||||
|
dependencies:
|
||||||
|
"@babel/helper-module-imports" "^7.0.0"
|
||||||
|
"@emotion/hash" "0.7.1"
|
||||||
|
"@emotion/memoize" "0.7.1"
|
||||||
|
"@emotion/serialize" "^0.11.6"
|
||||||
|
babel-plugin-macros "^2.0.0"
|
||||||
|
babel-plugin-syntax-jsx "^6.18.0"
|
||||||
|
convert-source-map "^1.5.0"
|
||||||
|
escape-string-regexp "^1.0.5"
|
||||||
|
find-root "^1.1.0"
|
||||||
|
source-map "^0.5.7"
|
||||||
|
|
||||||
|
babel-plugin-macros@^2.0.0:
|
||||||
|
version "2.5.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.5.1.tgz#4a119ac2c2e19b458c259b9accd7ee34fd57ec6f"
|
||||||
|
integrity sha512-xN3KhAxPzsJ6OQTktCanNpIFnnMsCV+t8OloKxIL72D6+SUZYFn9qfklPgef5HyyDtzYZqqb+fs1S12+gQY82Q==
|
||||||
|
dependencies:
|
||||||
|
"@babel/runtime" "^7.4.2"
|
||||||
|
cosmiconfig "^5.2.0"
|
||||||
|
resolve "^1.10.0"
|
||||||
|
|
||||||
|
babel-plugin-syntax-jsx@^6.18.0:
|
||||||
|
version "6.18.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
|
||||||
|
integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=
|
||||||
|
|
||||||
|
caller-callsite@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
|
||||||
|
integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=
|
||||||
|
dependencies:
|
||||||
|
callsites "^2.0.0"
|
||||||
|
|
||||||
|
caller-path@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4"
|
||||||
|
integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=
|
||||||
|
dependencies:
|
||||||
|
caller-callsite "^2.0.0"
|
||||||
|
|
||||||
|
callsites@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
|
||||||
|
integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=
|
||||||
|
|
||||||
|
convert-source-map@^1.5.0:
|
||||||
|
version "1.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20"
|
||||||
|
integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==
|
||||||
|
dependencies:
|
||||||
|
safe-buffer "~5.1.1"
|
||||||
|
|
||||||
|
cosmiconfig@^5.2.0:
|
||||||
|
version "5.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a"
|
||||||
|
integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==
|
||||||
|
dependencies:
|
||||||
|
import-fresh "^2.0.0"
|
||||||
|
is-directory "^0.3.1"
|
||||||
|
js-yaml "^3.13.1"
|
||||||
|
parse-json "^4.0.0"
|
||||||
|
|
||||||
|
create-emotion@^10.0.9:
|
||||||
|
version "10.0.9"
|
||||||
|
resolved "https://registry.yarnpkg.com/create-emotion/-/create-emotion-10.0.9.tgz#290c2036126171c9566fa24f49c9241d54625138"
|
||||||
|
integrity sha512-sLKD4bIiTs8PpEqr5vlCoV5lsYE4QOBYEUWaD0R+VGRMCvBKHmYlvLJXsL99Kdc4YEFAFwipi2bbncnvv6UxRg==
|
||||||
|
dependencies:
|
||||||
|
"@emotion/cache" "^10.0.9"
|
||||||
|
"@emotion/serialize" "^0.11.6"
|
||||||
|
"@emotion/sheet" "0.9.2"
|
||||||
|
"@emotion/utils" "0.11.1"
|
||||||
|
|
||||||
|
csstype@^2.5.7:
|
||||||
|
version "2.6.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.4.tgz#d585a6062096e324e7187f80e04f92bd0f00e37f"
|
||||||
|
integrity sha512-lAJUJP3M6HxFXbqtGRc0iZrdyeN+WzOWeY0q/VnFzI+kqVrYIzC7bWlKqCW7oCIdzoPkvfp82EVvrTlQ8zsWQg==
|
||||||
|
|
||||||
|
dom-helpers@^3.4.0:
|
||||||
|
version "3.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8"
|
||||||
|
integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==
|
||||||
|
dependencies:
|
||||||
|
"@babel/runtime" "^7.1.2"
|
||||||
|
|
||||||
|
emotion@^10.0.1:
|
||||||
|
version "10.0.9"
|
||||||
|
resolved "https://registry.yarnpkg.com/emotion/-/emotion-10.0.9.tgz#2c37598af13df31dcd35a1957eaa8830f368c066"
|
||||||
|
integrity sha512-IMFwwWlU2TDt7eh4v6dm58E8VHAYOitqRbVoazQdxIu9/0CAH4a3UrTMnZSlWQAo09MrRRlKfgQFHswnj40meQ==
|
||||||
|
dependencies:
|
||||||
|
babel-plugin-emotion "^10.0.9"
|
||||||
|
create-emotion "^10.0.9"
|
||||||
|
|
||||||
|
error-ex@^1.3.1:
|
||||||
|
version "1.3.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
|
||||||
|
integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
|
||||||
|
dependencies:
|
||||||
|
is-arrayish "^0.2.1"
|
||||||
|
|
||||||
|
escape-string-regexp@^1.0.5:
|
||||||
|
version "1.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
|
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||||
|
|
||||||
|
esprima@^4.0.0:
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||||
|
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||||
|
|
||||||
|
esutils@^2.0.2:
|
||||||
|
version "2.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
|
||||||
|
integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=
|
||||||
|
|
||||||
|
find-root@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4"
|
||||||
|
integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==
|
||||||
|
|
||||||
isobject@^3.0.1:
|
import-fresh@^2.0.0:
|
||||||
version "3.0.1"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
|
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
|
||||||
|
integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY=
|
||||||
isomorphic-fetch@^2.1.1:
|
|
||||||
version "2.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
node-fetch "^1.0.1"
|
caller-path "^2.0.0"
|
||||||
whatwg-fetch ">=0.10.0"
|
resolve-from "^3.0.0"
|
||||||
|
|
||||||
js-tokens@^3.0.0:
|
is-arrayish@^0.2.1:
|
||||||
version "3.0.2"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
||||||
|
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
||||||
|
|
||||||
loose-envify@^1.0.0, loose-envify@^1.3.1:
|
is-directory@^0.3.1:
|
||||||
version "1.3.1"
|
version "0.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
|
resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1"
|
||||||
|
integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=
|
||||||
|
|
||||||
|
"js-tokens@^3.0.0 || ^4.0.0":
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||||
|
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||||
|
|
||||||
|
js-yaml@^3.13.1:
|
||||||
|
version "3.13.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
|
||||||
|
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
|
||||||
dependencies:
|
dependencies:
|
||||||
js-tokens "^3.0.0"
|
argparse "^1.0.7"
|
||||||
|
esprima "^4.0.0"
|
||||||
|
|
||||||
node-fetch@^1.0.1:
|
json-parse-better-errors@^1.0.1:
|
||||||
version "1.7.3"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
|
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
|
||||||
|
integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
|
||||||
|
|
||||||
|
lodash@^4.17.11:
|
||||||
|
version "4.17.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|
||||||
|
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
|
||||||
|
|
||||||
|
loose-envify@^1.4.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||||
|
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
encoding "^0.1.11"
|
js-tokens "^3.0.0 || ^4.0.0"
|
||||||
is-stream "^1.0.1"
|
|
||||||
|
|
||||||
object-assign@^4.1.0, object-assign@^4.1.1:
|
object-assign@^4.1.1:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||||
|
|
||||||
postcss-value-parser@^3.3.0:
|
parse-json@^4.0.0:
|
||||||
version "3.3.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15"
|
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
|
||||||
|
integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=
|
||||||
promise@^7.1.1:
|
|
||||||
version "7.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
asap "~2.0.3"
|
error-ex "^1.3.1"
|
||||||
|
json-parse-better-errors "^1.0.1"
|
||||||
|
|
||||||
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6:
|
path-parse@^1.0.6:
|
||||||
version "15.6.0"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
|
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
|
||||||
|
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
|
||||||
|
|
||||||
|
prop-types@^15.6.2:
|
||||||
|
version "15.7.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
|
||||||
|
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
fbjs "^0.8.16"
|
loose-envify "^1.4.0"
|
||||||
loose-envify "^1.3.1"
|
|
||||||
object-assign "^4.1.1"
|
object-assign "^4.1.1"
|
||||||
|
react-is "^16.8.1"
|
||||||
|
|
||||||
react-loading-overlay@0.2.8:
|
react-is@^16.8.1:
|
||||||
version "0.2.8"
|
version "16.8.6"
|
||||||
resolved "https://registry.yarnpkg.com/react-loading-overlay/-/react-loading-overlay-0.2.8.tgz#c1c5531c9cfa4be6caca6b9aa0c1eb19e22b03fe"
|
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
|
||||||
|
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
|
||||||
|
|
||||||
|
react-lifecycles-compat@^3.0.4:
|
||||||
|
version "3.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
|
||||||
|
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
|
||||||
|
|
||||||
|
react-loading-overlay@1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-loading-overlay/-/react-loading-overlay-1.0.1.tgz#ee3b1ad56c45bb2f1ba46d4820ba0d06cd319a91"
|
||||||
|
integrity sha512-aUjtZ8tNXBSx+MbD2SQs0boPbeTAGTh+I5U9nWjDzMasKlYr58RJpr57c8W7uApeLpOkAGbInExRi6GamNC2bA==
|
||||||
dependencies:
|
dependencies:
|
||||||
prop-types "^15.5.10"
|
emotion "^10.0.1"
|
||||||
react-transition-group "^1.2.1"
|
prop-types "^15.6.2"
|
||||||
styled-components "^2.1.2"
|
react-transition-group "^2.5.0"
|
||||||
|
|
||||||
react-transition-group@^1.2.1:
|
react-transition-group@^2.5.0:
|
||||||
version "1.2.1"
|
version "2.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-1.2.1.tgz#e11f72b257f921b213229a774df46612346c7ca6"
|
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d"
|
||||||
|
integrity sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg==
|
||||||
dependencies:
|
dependencies:
|
||||||
chain-function "^1.0.0"
|
dom-helpers "^3.4.0"
|
||||||
dom-helpers "^3.2.0"
|
loose-envify "^1.4.0"
|
||||||
loose-envify "^1.3.1"
|
prop-types "^15.6.2"
|
||||||
prop-types "^15.5.6"
|
react-lifecycles-compat "^3.0.4"
|
||||||
warning "^3.0.0"
|
|
||||||
|
|
||||||
setimmediate@^1.0.5:
|
regenerator-runtime@^0.13.2:
|
||||||
version "1.0.5"
|
version "0.13.2"
|
||||||
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
|
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447"
|
||||||
|
integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==
|
||||||
|
|
||||||
styled-components@^2.1.2:
|
resolve-from@^3.0.0:
|
||||||
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"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c"
|
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
|
||||||
dependencies:
|
integrity sha1-six699nWiBvItuZTM17rywoYh0g=
|
||||||
loose-envify "^1.0.0"
|
|
||||||
|
|
||||||
whatwg-fetch@>=0.10.0:
|
resolve@^1.10.0:
|
||||||
version "2.0.3"
|
version "1.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
|
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232"
|
||||||
|
integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==
|
||||||
|
dependencies:
|
||||||
|
path-parse "^1.0.6"
|
||||||
|
|
||||||
|
safe-buffer@~5.1.1:
|
||||||
|
version "5.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||||
|
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||||
|
|
||||||
|
source-map@^0.5.7:
|
||||||
|
version "0.5.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
|
||||||
|
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
|
||||||
|
|
||||||
|
sprintf-js@~1.0.2:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||||
|
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||||
|
|
||||||
|
to-fast-properties@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
|
||||||
|
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
|
||||||
|
|||||||
@@ -185,6 +185,9 @@ Default is `false`. Give true to avoid to attach the csv header.
|
|||||||
#### noAutoBOM - [bool]
|
#### noAutoBOM - [bool]
|
||||||
Default is `true`.
|
Default is `true`.
|
||||||
|
|
||||||
|
#### blobType - [string]
|
||||||
|
Default is `text/plain;charset=utf-8`. Change to update the blob type of the exported file.
|
||||||
|
|
||||||
#### exportAll - [bool]
|
#### exportAll - [bool]
|
||||||
Default is `true`. `false` will only export current data which display on table.
|
Default is `true`. `false` will only export current data which display on table.
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class ToolkitProvider extends statelessDecorator(React.Component) {
|
|||||||
separator: PropTypes.string,
|
separator: PropTypes.string,
|
||||||
ignoreHeader: PropTypes.bool,
|
ignoreHeader: PropTypes.bool,
|
||||||
noAutoBOM: PropTypes.bool,
|
noAutoBOM: PropTypes.bool,
|
||||||
|
blobType: PropTypes.string,
|
||||||
exportAll: PropTypes.bool,
|
exportAll: PropTypes.bool,
|
||||||
onlyExportFiltered: PropTypes.bool,
|
onlyExportFiltered: PropTypes.bool,
|
||||||
onlyExportSelection: PropTypes.bool
|
onlyExportSelection: PropTypes.bool
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-bootstrap-table2-toolkit",
|
"name": "react-bootstrap-table2-toolkit",
|
||||||
"version": "1.4.2",
|
"version": "2.0.1",
|
||||||
"description": "The toolkit for react-bootstrap-table2",
|
"description": "The toolkit for react-bootstrap-table2",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -45,6 +45,6 @@
|
|||||||
"react-dom": "^16.3.0"
|
"react-dom": "^16.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"file-saver": "1.3.8"
|
"file-saver": "2.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,11 +54,12 @@ export const save = (
|
|||||||
content,
|
content,
|
||||||
{
|
{
|
||||||
noAutoBOM,
|
noAutoBOM,
|
||||||
fileName
|
fileName,
|
||||||
|
blobType
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
FileSaver.saveAs(
|
FileSaver.saveAs(
|
||||||
new Blob([content], { type: 'text/plain;charset=utf-8' }),
|
new Blob([content], { type: blobType }),
|
||||||
fileName,
|
fileName,
|
||||||
noAutoBOM
|
noAutoBOM
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const csvDefaultOptions = {
|
|||||||
separator: ',',
|
separator: ',',
|
||||||
ignoreHeader: false,
|
ignoreHeader: false,
|
||||||
noAutoBOM: true,
|
noAutoBOM: true,
|
||||||
|
blobType: 'text/plain;charset=utf-8',
|
||||||
exportAll: true,
|
exportAll: true,
|
||||||
onlyExportSelection: false
|
onlyExportSelection: false
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class SearchBar extends React.Component {
|
|||||||
id={ `search-bar-${tableId}` }
|
id={ `search-bar-${tableId}` }
|
||||||
type="text"
|
type="text"
|
||||||
style={ style }
|
style={ style }
|
||||||
|
aria-label="enter text you want to search"
|
||||||
onKeyUp={ () => this.onKeyup() }
|
onKeyUp={ () => this.onKeyup() }
|
||||||
onChange={ this.onChangeValue }
|
onChange={ this.onChangeValue }
|
||||||
className={ `form-control ${className}` }
|
className={ `form-control ${className}` }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
file-saver@1.3.8:
|
file-saver@2.0.2:
|
||||||
version "1.3.8"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-1.3.8.tgz#e68a30c7cb044e2fb362b428469feb291c2e09d8"
|
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.2.tgz#06d6e728a9ea2df2cce2f8d9e84dfcdc338ec17a"
|
||||||
|
integrity sha512-Wz3c3XQ5xroCxd1G8b7yL0Ehkf0TC9oYC6buPFkNnU9EnaPlifeAFCyCh+iewXTyFRcg0a6j3J7FmJsIhlhBdw==
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-bootstrap-table-next",
|
"name": "react-bootstrap-table-next",
|
||||||
"version": "3.1.2",
|
"version": "3.1.4",
|
||||||
"description": "Next generation of react-bootstrap-table",
|
"description": "Next generation of react-bootstrap-table",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -168,7 +168,12 @@ BootstrapTable.propTypes = {
|
|||||||
hideSelectColumn: PropTypes.bool,
|
hideSelectColumn: PropTypes.bool,
|
||||||
selectionRenderer: PropTypes.func,
|
selectionRenderer: PropTypes.func,
|
||||||
selectionHeaderRenderer: PropTypes.func,
|
selectionHeaderRenderer: PropTypes.func,
|
||||||
headerColumnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func])
|
headerColumnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
||||||
|
selectColumnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
||||||
|
selectColumnPosition: PropTypes.oneOf([
|
||||||
|
Const.INDICATOR_POSITION_LEFT,
|
||||||
|
Const.INDICATOR_POSITION_RIGHT
|
||||||
|
])
|
||||||
}),
|
}),
|
||||||
expandRow: PropTypes.shape({
|
expandRow: PropTypes.shape({
|
||||||
renderer: PropTypes.func,
|
renderer: PropTypes.func,
|
||||||
|
|||||||
14
packages/react-bootstrap-table2/src/footer.js
vendored
14
packages/react-bootstrap-table2/src/footer.js
vendored
@@ -11,9 +11,9 @@ const Footer = (props) => {
|
|||||||
const SelectionFooterCellComp = () => <th />;
|
const SelectionFooterCellComp = () => <th />;
|
||||||
const ExpansionFooterCellComp = () => <th />;
|
const ExpansionFooterCellComp = () => <th />;
|
||||||
|
|
||||||
const isRenderExpandColumnInLeft = (
|
const isRenderFunctionColumnInLeft = (
|
||||||
expandColumnPosition = Const.INDICATOR_POSITION_LEFT
|
position = Const.INDICATOR_POSITION_LEFT
|
||||||
) => expandColumnPosition === Const.INDICATOR_POSITION_LEFT;
|
) => position === Const.INDICATOR_POSITION_LEFT;
|
||||||
|
|
||||||
const childrens = columns.map((column, i) => {
|
const childrens = columns.map((column, i) => {
|
||||||
if (column.footer === undefined || column.footer === null) {
|
if (column.footer === undefined || column.footer === null) {
|
||||||
@@ -33,11 +33,15 @@ const Footer = (props) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (selectRow && selectRow.hideSelectColumn !== true) {
|
if (selectRow && selectRow.hideSelectColumn !== true) {
|
||||||
childrens.unshift(<SelectionFooterCellComp key="selection" />);
|
if (isRenderFunctionColumnInLeft(selectRow.selectColumnPosition)) {
|
||||||
|
childrens.unshift(<SelectionFooterCellComp key="selection" />);
|
||||||
|
} else {
|
||||||
|
childrens.push(<SelectionFooterCellComp key="selection" />);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expandRow.showExpandColumn) {
|
if (expandRow.showExpandColumn) {
|
||||||
if (isRenderExpandColumnInLeft(expandRow.expandColumnPosition)) {
|
if (isRenderFunctionColumnInLeft(expandRow.expandColumnPosition)) {
|
||||||
childrens.unshift(<ExpansionFooterCellComp key="expansion" />);
|
childrens.unshift(<ExpansionFooterCellComp key="expansion" />);
|
||||||
} else {
|
} else {
|
||||||
childrens.push(<ExpansionFooterCellComp key="expansion" />);
|
childrens.push(<ExpansionFooterCellComp key="expansion" />);
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ const HeaderCell = (props) => {
|
|||||||
|
|
||||||
const cellAttrs = {
|
const cellAttrs = {
|
||||||
..._.isFunction(headerAttrs) ? headerAttrs(column, index) : headerAttrs,
|
..._.isFunction(headerAttrs) ? headerAttrs(column, index) : headerAttrs,
|
||||||
...headerEvents
|
...headerEvents,
|
||||||
|
tabIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
let sortSymbol;
|
let sortSymbol;
|
||||||
|
|||||||
14
packages/react-bootstrap-table2/src/header.js
vendored
14
packages/react-bootstrap-table2/src/header.js
vendored
@@ -33,9 +33,9 @@ const Header = (props) => {
|
|||||||
SelectionHeaderCellComp = withHeaderSelection(SelectionHeaderCell);
|
SelectionHeaderCellComp = withHeaderSelection(SelectionHeaderCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRenderExpandColumnInLeft = (
|
const isRenderFunctionColumnInLeft = (
|
||||||
expandColumnPosition = Const.INDICATOR_POSITION_LEFT
|
position = Const.INDICATOR_POSITION_LEFT
|
||||||
) => expandColumnPosition === Const.INDICATOR_POSITION_LEFT;
|
) => position === Const.INDICATOR_POSITION_LEFT;
|
||||||
|
|
||||||
const childrens = [
|
const childrens = [
|
||||||
columns.map((column, i) => {
|
columns.map((column, i) => {
|
||||||
@@ -58,11 +58,15 @@ const Header = (props) => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (!selectRow.hideSelectColumn) {
|
if (!selectRow.hideSelectColumn) {
|
||||||
childrens.unshift(<SelectionHeaderCellComp key="selection" />);
|
if (isRenderFunctionColumnInLeft(selectRow.selectColumnPosition)) {
|
||||||
|
childrens.unshift(<SelectionHeaderCellComp key="selection" />);
|
||||||
|
} else {
|
||||||
|
childrens.push(<SelectionHeaderCellComp key="selection" />);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expandRow.showExpandColumn) {
|
if (expandRow.showExpandColumn) {
|
||||||
if (isRenderExpandColumnInLeft(expandRow.expandColumnPosition)) {
|
if (isRenderFunctionColumnInLeft(expandRow.expandColumnPosition)) {
|
||||||
childrens.unshift(<ExpansionHeaderCellComp key="expansion" />);
|
childrens.unshift(<ExpansionHeaderCellComp key="expansion" />);
|
||||||
} else {
|
} else {
|
||||||
childrens.push(<ExpansionHeaderCellComp key="expansion" />);
|
childrens.push(<ExpansionHeaderCellComp key="expansion" />);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Const from '../const';
|
import Const from '../const';
|
||||||
|
import _ from '../utils';
|
||||||
import { BootstrapContext } from '../contexts/bootstrap';
|
import { BootstrapContext } from '../contexts/bootstrap';
|
||||||
|
|
||||||
export default class SelectionCell extends Component {
|
export default class SelectionCell extends Component {
|
||||||
@@ -17,7 +18,8 @@ export default class SelectionCell extends Component {
|
|||||||
rowIndex: PropTypes.number,
|
rowIndex: PropTypes.number,
|
||||||
tabIndex: PropTypes.number,
|
tabIndex: PropTypes.number,
|
||||||
clickToSelect: PropTypes.bool,
|
clickToSelect: PropTypes.bool,
|
||||||
selectionRenderer: PropTypes.func
|
selectionRenderer: PropTypes.func,
|
||||||
|
selectColumnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func])
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -31,7 +33,8 @@ export default class SelectionCell extends Component {
|
|||||||
this.props.selected !== nextProps.selected ||
|
this.props.selected !== nextProps.selected ||
|
||||||
this.props.disabled !== nextProps.disabled ||
|
this.props.disabled !== nextProps.disabled ||
|
||||||
this.props.rowKey !== nextProps.rowKey ||
|
this.props.rowKey !== nextProps.rowKey ||
|
||||||
this.props.tabIndex !== nextProps.tabIndex;
|
this.props.tabIndex !== nextProps.tabIndex ||
|
||||||
|
this.props.selectColumnStyle !== nextProps.selectColumnStyle;
|
||||||
|
|
||||||
return shouldUpdate;
|
return shouldUpdate;
|
||||||
}
|
}
|
||||||
@@ -43,12 +46,10 @@ export default class SelectionCell extends Component {
|
|||||||
selected,
|
selected,
|
||||||
onRowSelect,
|
onRowSelect,
|
||||||
disabled,
|
disabled,
|
||||||
rowIndex,
|
rowIndex
|
||||||
clickToSelect
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
e.stopPropagation();
|
||||||
if (disabled) return;
|
if (disabled) return;
|
||||||
if (clickToSelect) return;
|
|
||||||
|
|
||||||
const checked = inputType === Const.ROW_SELECT_SINGLE
|
const checked = inputType === Const.ROW_SELECT_SINGLE
|
||||||
? true
|
? true
|
||||||
@@ -59,17 +60,28 @@ export default class SelectionCell extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
rowKey,
|
||||||
mode: inputType,
|
mode: inputType,
|
||||||
selected,
|
selected,
|
||||||
disabled,
|
disabled,
|
||||||
tabIndex,
|
tabIndex,
|
||||||
rowIndex,
|
rowIndex,
|
||||||
selectionRenderer
|
selectionRenderer,
|
||||||
|
selectColumnStyle
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const attrs = {};
|
const attrs = {};
|
||||||
if (tabIndex !== -1) attrs.tabIndex = tabIndex;
|
if (tabIndex !== -1) attrs.tabIndex = tabIndex;
|
||||||
|
|
||||||
|
attrs.style = _.isFunction(selectColumnStyle) ?
|
||||||
|
selectColumnStyle({
|
||||||
|
checked: selected,
|
||||||
|
disabled,
|
||||||
|
rowIndex,
|
||||||
|
rowKey
|
||||||
|
}) :
|
||||||
|
selectColumnStyle;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BootstrapContext.Consumer>
|
<BootstrapContext.Consumer>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,18 +37,18 @@ export default class RowAggregator extends shouldUpdater(eventDelegater(React.Co
|
|||||||
this.props.selectable !== nextProps.selectable ||
|
this.props.selectable !== nextProps.selectable ||
|
||||||
this.shouldUpdatedBySelfProps(nextProps)
|
this.shouldUpdatedBySelfProps(nextProps)
|
||||||
) {
|
) {
|
||||||
this.shouldUpdateRowContent = this.shouldUpdateChild(nextProps);
|
this.shouldUpdateRowContent = this.shouldRowContentUpdate(nextProps);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
this.shouldUpdateRowContent = this.shouldUpdateChild(nextProps);
|
this.shouldUpdateRowContent = this.shouldRowContentUpdate(nextProps);
|
||||||
|
|
||||||
return this.shouldUpdateRowContent;
|
return this.shouldUpdateRowContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
isRenderExpandColumnInLeft(
|
isRenderFunctionColumnInLeft(
|
||||||
expandColumnPosition = Const.INDICATOR_POSITION_LEFT
|
position = Const.INDICATOR_POSITION_LEFT
|
||||||
) {
|
) {
|
||||||
return expandColumnPosition === Const.INDICATOR_POSITION_LEFT;
|
return position === Const.INDICATOR_POSITION_LEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -71,7 +71,7 @@ export default class RowAggregator extends shouldUpdater(eventDelegater(React.Co
|
|||||||
...rest
|
...rest
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const key = _.get(row, keyField);
|
const key = _.get(row, keyField);
|
||||||
const { hideSelectColumn, clickToSelect } = selectRow;
|
const { hideSelectColumn, selectColumnPosition, clickToSelect } = selectRow;
|
||||||
const { showExpandColumn, expandColumnPosition } = expandRow;
|
const { showExpandColumn, expandColumnPosition } = expandRow;
|
||||||
|
|
||||||
const newAttrs = this.delegate({ ...attrs });
|
const newAttrs = this.delegate({ ...attrs });
|
||||||
@@ -95,7 +95,7 @@ export default class RowAggregator extends shouldUpdater(eventDelegater(React.Co
|
|||||||
)];
|
)];
|
||||||
|
|
||||||
if (!hideSelectColumn) {
|
if (!hideSelectColumn) {
|
||||||
childrens.unshift((
|
const selectCell = (
|
||||||
<SelectionCell
|
<SelectionCell
|
||||||
{ ...selectRow }
|
{ ...selectRow }
|
||||||
key="selection-cell"
|
key="selection-cell"
|
||||||
@@ -105,7 +105,12 @@ export default class RowAggregator extends shouldUpdater(eventDelegater(React.Co
|
|||||||
disabled={ !selectable }
|
disabled={ !selectable }
|
||||||
tabIndex={ tabIndexCell ? tabIndexStart++ : -1 }
|
tabIndex={ tabIndexCell ? tabIndexStart++ : -1 }
|
||||||
/>
|
/>
|
||||||
));
|
);
|
||||||
|
if (this.isRenderFunctionColumnInLeft(selectColumnPosition)) {
|
||||||
|
childrens.unshift(selectCell);
|
||||||
|
} else {
|
||||||
|
childrens.push(selectCell);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showExpandColumn) {
|
if (showExpandColumn) {
|
||||||
@@ -120,7 +125,7 @@ export default class RowAggregator extends shouldUpdater(eventDelegater(React.Co
|
|||||||
tabIndex={ tabIndexCell ? tabIndexStart++ : -1 }
|
tabIndex={ tabIndexCell ? tabIndexStart++ : -1 }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
if (this.isRenderExpandColumnInLeft(expandColumnPosition)) {
|
if (this.isRenderFunctionColumnInLeft(expandColumnPosition)) {
|
||||||
childrens.unshift(expandCell);
|
childrens.unshift(expandCell);
|
||||||
} else {
|
} else {
|
||||||
childrens.push(expandCell);
|
childrens.push(expandCell);
|
||||||
|
|||||||
@@ -48,4 +48,9 @@ export default ExtendBase =>
|
|||||||
return this.shouldUpdateByCellEditing(nextProps) ||
|
return this.shouldUpdateByCellEditing(nextProps) ||
|
||||||
this.shouldUpdatedByNormalProps(nextProps);
|
this.shouldUpdatedByNormalProps(nextProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldRowContentUpdate(nextProps) {
|
||||||
|
return this.shouldUpdateChild(nextProps) ||
|
||||||
|
this.shouldUpdateByColumnsForSimpleCheck(nextProps);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ class SimpleRow extends shouldUpdater(eventDelegater(Component)) {
|
|||||||
|
|
||||||
shouldComponentUpdate(nextProps) {
|
shouldComponentUpdate(nextProps) {
|
||||||
this.shouldUpdateRowContent = false;
|
this.shouldUpdateRowContent = false;
|
||||||
this.shouldUpdateRowContent =
|
this.shouldUpdateRowContent = this.shouldRowContentUpdate(nextProps);
|
||||||
this.shouldUpdateChild(nextProps) || this.shouldUpdateByColumnsForSimpleCheck(nextProps);
|
|
||||||
if (this.shouldUpdateRowContent) return true;
|
if (this.shouldUpdateRowContent) return true;
|
||||||
|
|
||||||
return this.shouldUpdatedBySelfProps(nextProps);
|
return this.shouldUpdatedBySelfProps(nextProps);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ describe('<SelectionCell />', () => {
|
|||||||
/>,
|
/>,
|
||||||
{ bootstrap4: false }
|
{ bootstrap4: false }
|
||||||
);
|
);
|
||||||
wrapper.find('td').simulate('click');
|
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calling handleRowClicked', () => {
|
it('should calling handleRowClicked', () => {
|
||||||
@@ -173,7 +173,7 @@ describe('<SelectionCell />', () => {
|
|||||||
/>,
|
/>,
|
||||||
{ bootstrap4: false }
|
{ bootstrap4: false }
|
||||||
);
|
);
|
||||||
wrapper.find('td').simulate('click');
|
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calling handleRowClicked', () => {
|
it('should calling handleRowClicked', () => {
|
||||||
@@ -201,7 +201,7 @@ describe('<SelectionCell />', () => {
|
|||||||
|
|
||||||
it('should be called with correct paramters', () => {
|
it('should be called with correct paramters', () => {
|
||||||
// first click
|
// first click
|
||||||
wrapper.find('td').simulate('click');
|
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||||
expect(mockOnRowSelect.callCount).toBe(1);
|
expect(mockOnRowSelect.callCount).toBe(1);
|
||||||
expect(mockOnRowSelect.calledWith(rowKey, true, rowIndex)).toBe(true);
|
expect(mockOnRowSelect.calledWith(rowKey, true, rowIndex)).toBe(true);
|
||||||
});
|
});
|
||||||
@@ -223,9 +223,9 @@ describe('<SelectionCell />', () => {
|
|||||||
|
|
||||||
it('should be called with correct parameters', () => {
|
it('should be called with correct parameters', () => {
|
||||||
// first click
|
// first click
|
||||||
wrapper.find('td').simulate('click');
|
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||||
expect(mockOnRowSelect.callCount).toBe(1);
|
expect(mockOnRowSelect.callCount).toBe(1);
|
||||||
expect(mockOnRowSelect.calledWith(rowKey, false, rowIndex, undefined)).toBe(true);
|
expect(mockOnRowSelect.calledWith(rowKey, false, rowIndex)).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user