publish 1.2.5

This commit is contained in:
jonyshi 2018-06-25 09:43:34 +08:00
parent da3be3d87b
commit 20d9185ba8
7 changed files with 44 additions and 14 deletions

View File

@ -52,14 +52,18 @@ function newMultiSelect(Table, Checkbox) {
data = _this$state.data,
checkedAll = _this$state.checkedAll;
var selectList = [];
var check = checkedAll ? false : true;
data.forEach(function (item) {
item.checked = check;
if (item.checked) {
selectList.push(item);
}
});
_this.setState({
checkedAll: check
});
_this.props.getSelectedDataFunc(data);
_this.props.getSelectedDataFunc(selectList);
};
_this.handleClick = function () {};
@ -68,6 +72,7 @@ function newMultiSelect(Table, Checkbox) {
return function () {
var data = _this.state.data;
var selectList = [];
record.checked = record.checked ? false : true;
var checkedAll = true;
for (var i = 0; i < data.length; i++) {
@ -80,7 +85,12 @@ function newMultiSelect(Table, Checkbox) {
_this.setState(_extends({}, _this.state, {
checkedAll: checkedAll
}));
_this.props.getSelectedDataFunc(record);
data.forEach(function (da) {
if (da.checked) {
selectList.push(da);
}
});
_this.props.getSelectedDataFunc(selectList);
};
};

View File

@ -217,8 +217,8 @@ class Demo25 extends Component {
render() {
return <div className="demo25"><DragColumnTable
columns={getCloumns()}
data={dataList}
columns={columns25}
data={data25}
getSelectedDataFunc={this.getSelectedDataFunc}
bordered
dragborder={true}

File diff suppressed because one or more lines are too long

20
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "bee-table",
"version": "1.2.4",
"version": "1.2.5",
"description": "Table ui component for react",
"keywords": [
"react",

View File

@ -40,14 +40,18 @@ export default function newMultiSelect(Table, Checkbox) {
onAllCheckChange=()=>{
let {data,checkedAll} = this.state;
let selectList = [];
let check = checkedAll?false:true;
data.forEach(item => {
item.checked = check;
if(item.checked){
selectList.push(item);
}
});
this.setState({
checkedAll:check
});
this.props.getSelectedDataFunc(data);
this.props.getSelectedDataFunc(selectList);
}
handleClick=()=>{
@ -56,6 +60,7 @@ export default function newMultiSelect(Table, Checkbox) {
onCheckboxChange = (text, record, index) => () => {
let {data} = this.state;
let selectList = [];
record.checked = record.checked?false:true;
let checkedAll = true;
for(let i=0;i<data.length;i++){
@ -69,7 +74,12 @@ export default function newMultiSelect(Table, Checkbox) {
...this.state,
checkedAll
})
this.props.getSelectedDataFunc(record);
data.forEach((da)=>{
if(da.checked){
selectList.push(da);
}
})
this.props.getSelectedDataFunc(selectList);
};