publish 1.4.11

This commit is contained in:
kvkens 2018-10-11 14:12:19 +08:00
parent 24ae6dae46
commit deae4b8d0a
7 changed files with 49 additions and 19 deletions

View File

@ -1,3 +1,8 @@
<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>
## [1.4.10](https://github.com/tinper-bee/bee-table/compare/v1.4.9...v1.4.10) (2018-10-08)

View File

@ -184,6 +184,8 @@
transition: all 0.3s ease; }
.u-table tr:hover {
background: rgb(227,242,253); }
.u-table tr:hover td .uf-eye {
visibility: visible !important; }
.u-table tr.tr-row-hover {
background: rgb(227,242,253); }
.u-table th,
@ -371,7 +373,7 @@
.u-table-thead th:hover .bee-table-column-sorter {
display: inline-block; }
.u-table-thead .th-drag {
cursor: pointer; }
cursor: move; }
.u-table-thead .th-drag-hover {
background: #ccc; }
.u-table-thead-th {

View File

@ -642,9 +642,9 @@ var Table = function (_Component) {
}
cols = cols.concat(leafColumns.map(function (c, i, arr) {
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);
} else {
} else if (width) {
width = parseInt(width);
}
if (lastShowIndex == i) {
@ -732,10 +732,10 @@ var Table = function (_Component) {
tableStyle.width = _this3.contentWidth;
}
}
//自动出现滚动条
// if(this.contentDomWidth < this.contentWidth){
// tableStyle.width = this.contentWidth;
// }
// 自动出现滚动条
if (_this3.contentDomWidth > _this3.contentWidth) {
tableStyle.width = _this3.contentDomWidth;
}
var tableBody = hasBody ? getBodyWrapper(_react2["default"].createElement(
'tbody',
{ className: clsPrefix + '-tbody' },

View File

@ -379,6 +379,9 @@ var TableHeader = function (_Component) {
da.width = parseInt(da.width) + contentWidthDiff;
canDotDrag = 'th-can-not-drag';
}
if (filterable && index == rows.length - 1) {
da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i);
}
if (draggable) {
return _react2["default"].createElement('th', _extends({}, da, {
onDragStart: function onDragStart(event) {
@ -433,14 +436,9 @@ var TableHeader = function (_Component) {
);
} else {
var th = void 0;
if (filterable && index == rows.length - 1) {
da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i);
th = _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 }));
}
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;
}
})

View File

@ -125,7 +125,7 @@ function multiSelect(Table, Checkbox) {
}),
key: "checkbox",
dataIndex: "checkbox",
width: "100",
width: "55",
render: function render(text, record, index) {
var rowKey = record["key"] ? record["key"] : _this2.getRowKey(record, i);
var bool = checkedObj.hasOwnProperty(rowKey);

View File

@ -76,6 +76,19 @@ function sort(Table, Icon) {
_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) {
var preKey = pre[orderCols[currentIndex].key];
var afterKey = after[orderCols[currentIndex].key];
@ -137,8 +150,12 @@ function sort(Table, Icon) {
});
seleObj.order = order;
//通过后端请求
if (sort.backSource) {
if (sort.backSource && typeof sort.sortFun === "function") {
//获取排序的字段和方式
sort.sortFun([{
order: order,
field: seleObj.dataIndex
}]);
} else {
if (order === "ascend") {
data = data.sort(function (a, b) {
@ -163,7 +180,11 @@ function sort(Table, Icon) {
if (!seleObj.orderNum && (order == 'ascend' || order == 'descend')) {
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({
data: data,
@ -255,6 +276,10 @@ function sort(Table, Icon) {
* 当有的列不排序时将该列的orderNum置为并动态的修改其他列的orderNum
*/
/**
* 获取排序字段
*/
/**
* pre前一条数据

View File

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