merge
This commit is contained in:
commit
9aad873c5a
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -1,3 +1,18 @@
|
||||||
|
<a name="1.4.13"></a>
|
||||||
|
## [1.4.13](https://github.com/tinper-bee/bee-table/compare/v1.4.12...v1.4.13) (2018-10-11)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="1.4.12"></a>
|
||||||
|
## [1.4.12](https://github.com/tinper-bee/bee-table/compare/v1.4.11...v1.4.12) (2018-10-11)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="1.4.11"></a>
|
||||||
|
## [1.4.11](https://github.com/tinper-bee/bee-table/compare/v1.4.10...v1.4.11) (2018-10-11)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="1.4.10"></a>
|
<a name="1.4.10"></a>
|
||||||
## [1.4.10](https://github.com/tinper-bee/bee-table/compare/v1.4.9...v1.4.10) (2018-10-08)
|
## [1.4.10](https://github.com/tinper-bee/bee-table/compare/v1.4.9...v1.4.10) (2018-10-08)
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ var FilterDropDown = function (_Component) {
|
||||||
|
|
||||||
if (onSelectDropdown) {
|
if (onSelectDropdown) {
|
||||||
_this.setState({
|
_this.setState({
|
||||||
selectValue: s.key
|
selectValue: [s.key]
|
||||||
}, function () {
|
}, function () {
|
||||||
onSelectDropdown(s);
|
onSelectDropdown(s);
|
||||||
});
|
});
|
||||||
|
|
|
@ -184,6 +184,8 @@
|
||||||
transition: all 0.3s ease; }
|
transition: all 0.3s ease; }
|
||||||
.u-table tr:hover {
|
.u-table tr:hover {
|
||||||
background: rgb(227,242,253); }
|
background: rgb(227,242,253); }
|
||||||
|
.u-table tr:hover td .uf-eye {
|
||||||
|
visibility: visible !important; }
|
||||||
.u-table tr.tr-row-hover {
|
.u-table tr.tr-row-hover {
|
||||||
background: rgb(227,242,253); }
|
background: rgb(227,242,253); }
|
||||||
.u-table th,
|
.u-table th,
|
||||||
|
@ -371,7 +373,7 @@
|
||||||
.u-table-thead th:hover .bee-table-column-sorter {
|
.u-table-thead th:hover .bee-table-column-sorter {
|
||||||
display: inline-block; }
|
display: inline-block; }
|
||||||
.u-table-thead .th-drag {
|
.u-table-thead .th-drag {
|
||||||
cursor: pointer; }
|
cursor: move; }
|
||||||
.u-table-thead .th-drag-hover {
|
.u-table-thead .th-drag-hover {
|
||||||
background: #ccc; }
|
background: #ccc; }
|
||||||
.u-table-thead-th {
|
.u-table-thead-th {
|
||||||
|
|
|
@ -642,9 +642,9 @@ var Table = function (_Component) {
|
||||||
}
|
}
|
||||||
cols = cols.concat(leafColumns.map(function (c, i, arr) {
|
cols = cols.concat(leafColumns.map(function (c, i, arr) {
|
||||||
var width = c.width;
|
var width = c.width;
|
||||||
if (typeof width == 'string' && width.indexOf('%') > -1) {
|
if (typeof width == 'string' && width.indexOf('%') > -1 && self.contentWidth) {
|
||||||
width = parseInt(self.contentWidth * parseInt(width) / 100);
|
width = parseInt(self.contentWidth * parseInt(width) / 100);
|
||||||
} else {
|
} else if (width) {
|
||||||
width = parseInt(width);
|
width = parseInt(width);
|
||||||
}
|
}
|
||||||
if (lastShowIndex == i) {
|
if (lastShowIndex == i) {
|
||||||
|
@ -732,10 +732,10 @@ var Table = function (_Component) {
|
||||||
tableStyle.width = _this3.contentWidth;
|
tableStyle.width = _this3.contentWidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//自动出现滚动条
|
// 自动出现滚动条
|
||||||
// if(this.contentDomWidth < this.contentWidth){
|
if (_this3.contentDomWidth > _this3.contentWidth) {
|
||||||
// tableStyle.width = this.contentWidth;
|
tableStyle.width = _this3.contentDomWidth;
|
||||||
// }
|
}
|
||||||
var tableBody = hasBody ? getBodyWrapper(_react2["default"].createElement(
|
var tableBody = hasBody ? getBodyWrapper(_react2["default"].createElement(
|
||||||
'tbody',
|
'tbody',
|
||||||
{ className: clsPrefix + '-tbody' },
|
{ className: clsPrefix + '-tbody' },
|
||||||
|
|
|
@ -379,6 +379,9 @@ var TableHeader = function (_Component) {
|
||||||
da.width = parseInt(da.width) + contentWidthDiff;
|
da.width = parseInt(da.width) + contentWidthDiff;
|
||||||
canDotDrag = 'th-can-not-drag';
|
canDotDrag = 'th-can-not-drag';
|
||||||
}
|
}
|
||||||
|
if (filterable && index == rows.length - 1) {
|
||||||
|
da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i);
|
||||||
|
}
|
||||||
if (draggable) {
|
if (draggable) {
|
||||||
return _react2["default"].createElement('th', _extends({}, da, {
|
return _react2["default"].createElement('th', _extends({}, da, {
|
||||||
onDragStart: function onDragStart(event) {
|
onDragStart: function onDragStart(event) {
|
||||||
|
@ -433,14 +436,9 @@ var TableHeader = function (_Component) {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
var th = void 0;
|
var th = void 0;
|
||||||
if (filterable && index == rows.length - 1) {
|
th = da.onClick ? _react2["default"].createElement('th', _extends({}, da, { className: da.className + ' ' + fixedStyle, key: i, onClick: function onClick(event) {
|
||||||
da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i);
|
da.onClick(da, event);
|
||||||
th = _react2["default"].createElement('th', _extends({}, da, { key: i, className: da.className + ' ' + fixedStyle }));
|
} })) : _react2["default"].createElement('th', _extends({}, da, { key: i, className: da.className + ' ' + fixedStyle }));
|
||||||
} else {
|
|
||||||
th = da.onClick ? _react2["default"].createElement('th', _extends({}, da, { className: da.className + ' ' + fixedStyle, key: i, onClick: function onClick(event) {
|
|
||||||
da.onClick(da, event);
|
|
||||||
} })) : _react2["default"].createElement('th', _extends({}, da, { key: i, className: da.className + ' ' + fixedStyle }));
|
|
||||||
}
|
|
||||||
return th;
|
return th;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -128,7 +128,7 @@ function filterColumn(Table, Popover) {
|
||||||
Popover,
|
Popover,
|
||||||
{
|
{
|
||||||
id: "filter_column_popover",
|
id: "filter_column_popover",
|
||||||
placement: "leftTop",
|
placement: "left",
|
||||||
content: content,
|
content: content,
|
||||||
show: showModal },
|
show: showModal },
|
||||||
_react2["default"].createElement(
|
_react2["default"].createElement(
|
||||||
|
|
|
@ -125,7 +125,7 @@ function multiSelect(Table, Checkbox) {
|
||||||
}),
|
}),
|
||||||
key: "checkbox",
|
key: "checkbox",
|
||||||
dataIndex: "checkbox",
|
dataIndex: "checkbox",
|
||||||
width: "100",
|
width: "55",
|
||||||
render: function render(text, record, index) {
|
render: function render(text, record, index) {
|
||||||
var rowKey = record["key"] ? record["key"] : _this2.getRowKey(record, i);
|
var rowKey = record["key"] ? record["key"] : _this2.getRowKey(record, i);
|
||||||
var bool = checkedObj.hasOwnProperty(rowKey);
|
var bool = checkedObj.hasOwnProperty(rowKey);
|
||||||
|
|
|
@ -76,6 +76,19 @@ function sort(Table, Icon) {
|
||||||
_this.setState({ columns: columns });
|
_this.setState({ columns: columns });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_this.getOrderCols = function (columns) {
|
||||||
|
var orderCols = [];
|
||||||
|
columns.forEach(function (item) {
|
||||||
|
if (item.order == 'ascend' || item.order == 'descend') {
|
||||||
|
orderCols.push({ order: item.order,
|
||||||
|
field: item.dataIndex,
|
||||||
|
orderNum: item.orderNum
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return orderCols;
|
||||||
|
};
|
||||||
|
|
||||||
_this._sortBy = function (pre, after, orderCols, orderColslen, currentIndex) {
|
_this._sortBy = function (pre, after, orderCols, orderColslen, currentIndex) {
|
||||||
var preKey = pre[orderCols[currentIndex].key];
|
var preKey = pre[orderCols[currentIndex].key];
|
||||||
var afterKey = after[orderCols[currentIndex].key];
|
var afterKey = after[orderCols[currentIndex].key];
|
||||||
|
@ -137,8 +150,12 @@ function sort(Table, Icon) {
|
||||||
});
|
});
|
||||||
seleObj.order = order;
|
seleObj.order = order;
|
||||||
//通过后端请求
|
//通过后端请求
|
||||||
if (sort.backSource) {
|
if (sort.backSource && typeof sort.sortFun === "function") {
|
||||||
//获取排序的字段和方式
|
//获取排序的字段和方式
|
||||||
|
sort.sortFun([{
|
||||||
|
order: order,
|
||||||
|
field: seleObj.dataIndex
|
||||||
|
}]);
|
||||||
} else {
|
} else {
|
||||||
if (order === "ascend") {
|
if (order === "ascend") {
|
||||||
data = data.sort(function (a, b) {
|
data = data.sort(function (a, b) {
|
||||||
|
@ -163,7 +180,11 @@ function sort(Table, Icon) {
|
||||||
if (!seleObj.orderNum && (order == 'ascend' || order == 'descend')) {
|
if (!seleObj.orderNum && (order == 'ascend' || order == 'descend')) {
|
||||||
seleObj.orderNum = _this.getOrderNum();
|
seleObj.orderNum = _this.getOrderNum();
|
||||||
}
|
}
|
||||||
data = _this.multiSort(columns);
|
if (sort.backSource && typeof sort.sortFun === "function") {
|
||||||
|
sort.sortFun(_this.getOrderCols(columns));
|
||||||
|
} else {
|
||||||
|
data = _this.multiSort(columns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_this.setState({
|
_this.setState({
|
||||||
data: data,
|
data: data,
|
||||||
|
@ -255,6 +276,10 @@ function sort(Table, Icon) {
|
||||||
* 当有的列不排序时,将该列的orderNum置为‘’,并动态的修改其他列的orderNum。
|
* 当有的列不排序时,将该列的orderNum置为‘’,并动态的修改其他列的orderNum。
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取排序字段
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pre:前一条数据
|
* pre:前一条数据
|
||||||
|
|
|
@ -50833,7 +50833,7 @@
|
||||||
|
|
||||||
if (onSelectDropdown) {
|
if (onSelectDropdown) {
|
||||||
_this.setState({
|
_this.setState({
|
||||||
selectValue: s.key
|
selectValue: [s.key]
|
||||||
}, function () {
|
}, function () {
|
||||||
onSelectDropdown(s);
|
onSelectDropdown(s);
|
||||||
});
|
});
|
||||||
|
@ -59394,7 +59394,7 @@
|
||||||
Popover,
|
Popover,
|
||||||
{
|
{
|
||||||
id: "filter_column_popover",
|
id: "filter_column_popover",
|
||||||
placement: "leftTop",
|
placement: "left",
|
||||||
content: content,
|
content: content,
|
||||||
show: showModal },
|
show: showModal },
|
||||||
_react2["default"].createElement(
|
_react2["default"].createElement(
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bee-table",
|
"name": "bee-table",
|
||||||
"version": "1.4.10",
|
"version": "1.4.13",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
|
@ -16,7 +16,7 @@ class FilterDropDown extends Component {
|
||||||
let { onSelectDropdown } = this.props;
|
let { onSelectDropdown } = this.props;
|
||||||
if (onSelectDropdown) {
|
if (onSelectDropdown) {
|
||||||
this.setState({
|
this.setState({
|
||||||
selectValue: s.key
|
selectValue: [s.key]
|
||||||
}, () => {
|
}, () => {
|
||||||
onSelectDropdown(s);
|
onSelectDropdown(s);
|
||||||
});
|
});
|
||||||
|
|
|
@ -152,7 +152,7 @@ export default function filterColumn(Table,Popover) {
|
||||||
<div className={`${prefixCls}-filter-icon`}>
|
<div className={`${prefixCls}-filter-icon`}>
|
||||||
<Popover
|
<Popover
|
||||||
id="filter_column_popover"
|
id="filter_column_popover"
|
||||||
placement="leftTop"
|
placement="left"
|
||||||
content={content}
|
content={content}
|
||||||
show={showModal} >
|
show={showModal} >
|
||||||
<div className={`${prefixCls}-pop-column-filter-cont`}>
|
<div className={`${prefixCls}-pop-column-filter-cont`}>
|
||||||
|
|
Loading…
Reference in New Issue