Merge branch 'master' of github.com:tinper-bee/bee-table

This commit is contained in:
“jonyshi” 2018-12-07 10:20:09 +08:00
commit f8d52f44f5
12 changed files with 20384 additions and 15913 deletions

View File

@ -1,3 +1,8 @@
<a name="1.6.11"></a>
## [1.6.11](https://github.com/tinper-bee/bee-table/compare/v1.6.9...v1.6.11) (2018-12-06)
<a name="1.6.9"></a> <a name="1.6.9"></a>
## [1.6.9](https://github.com/tinper-bee/bee-table/compare/v1.6.8...v1.6.9) (2018-12-05) ## [1.6.9](https://github.com/tinper-bee/bee-table/compare/v1.6.8...v1.6.9) (2018-12-05)
@ -139,7 +144,7 @@
<a name="1.5.1"></a> <a name="1.5.1"></a>
## [1.5.1](https://github.com/tinper-bee/bee-table/compare/v1.5.0...v1.5.1) (2018-11-19) ## [1.5.1](https://github.com/tinper-bee/bee-table/compare/v1.5.0...v1.5.1) (2018-11-18)

View File

@ -63,21 +63,19 @@ var FilterDropDown = function (_Component) {
filterDropdownType = _this$props.filterDropdownType; filterDropdownType = _this$props.filterDropdownType;
if (onSelectDropdown) { if (onSelectDropdown) {
if (dataText != "") { if (filterDropdownType == 'string') {
if (filterDropdownType == 'string') { _this.setState({
_this.setState({ selectValue: [item.key]
selectValue: [item.key] }, function () {
}, function () { onSelectDropdown(item);
onSelectDropdown(item); });
}); }
} if (filterDropdownType == 'number') {
if (filterDropdownType == 'number') { _this.setState({
_this.setState({ selectNumberValue: [item.key]
selectNumberValue: [item.key] }, function () {
}, function () { onSelectDropdown(item);
onSelectDropdown(item); });
});
}
} }
} }
}; };
@ -87,8 +85,8 @@ var FilterDropDown = function (_Component) {
if (onClickClear) { if (onClickClear) {
_this.setState({ _this.setState({
selectValue: [], // selectValue: [],
selectNumberValue: [] // selectNumberValue: []
}, function () { }, function () {
onClickClear(); onClickClear();
}); });

View File

@ -914,10 +914,15 @@ var Table = function (_Component) {
) )
); );
} }
var leftFixedWidth = this.columnManager.getLeftColumnsWidth();
var rightFixedWidth = this.columnManager.getRightColumnsWidth();
var parStyle = {};
if (!fixed) {
parStyle = { 'marginLeft': leftFixedWidth, 'marginRight': rightFixedWidth };
}
return _react2["default"].createElement( return _react2["default"].createElement(
'span', 'div',
null, { style: parStyle },
headTable, headTable,
BodyTable BodyTable
); );
@ -1124,7 +1129,7 @@ var Table = function (_Component) {
{ className: clsPrefix + '-content' }, { className: clsPrefix + '-content' },
_react2["default"].createElement( _react2["default"].createElement(
'div', 'div',
{ className: isTableScroll ? clsPrefix + '-scroll' : '', style: { 'marginLeft': leftFixedWidth } }, { className: isTableScroll ? clsPrefix + '-scroll' : '' },
this.getTable({ columns: this.columnManager.groupedColumns() }), this.getTable({ columns: this.columnManager.groupedColumns() }),
this.getEmptyText(), this.getEmptyText(),
this.getFooter() this.getFooter()

View File

@ -583,7 +583,8 @@ var TableHeader = function (_Component) {
delete da.drgHover; delete da.drgHover;
var fixedStyle = ""; var fixedStyle = "";
var canDotDrag = ""; var canDotDrag = "";
if (!fixed && (da.fixed || rows[0][columIndex].fixed)) { //主表格下、固定列或者是过滤行中含有固定列时添加该属性
if (!fixed && (da.fixed || filterable && index == rows.length - 1 && rows[0][columIndex].fixed)) {
fixedStyle = clsPrefix + "-row-fixed-columns-in-body"; fixedStyle = clsPrefix + "-row-fixed-columns-in-body";
} }
@ -607,8 +608,8 @@ var TableHeader = function (_Component) {
if (!da.fixed) { if (!da.fixed) {
return _react2["default"].createElement( return _react2["default"].createElement(
"th", "th",
{ key: 'table-header-th-' + da.dataindex, className: thClassName, "data-th-fixed": da.fixed, _extends({}, da, { key: 'table-header-th-' + da.dataindex, className: thClassName, "data-th-fixed": da.fixed,
"data-line-key": da.key, "data-line-index": columIndex, "data-th-width": da.width }, "data-line-key": da.key, "data-line-index": columIndex, "data-th-width": da.width }),
da.children, da.children,
dragborder ? _react2["default"].createElement( dragborder ? _react2["default"].createElement(
"div", "div",

57
dist/demo.css vendored
View File

@ -2421,9 +2421,6 @@ i.uf {
/* /*
* 选择时删除文本阴影及设置默认选中颜色 * 选择时删除文本阴影及设置默认选中颜色
*/ */
::-moz-selection {
background: rgb(187,222,251);
text-shadow: none; }
::selection { ::selection {
background: rgb(187,222,251); background: rgb(187,222,251);
text-shadow: none; } text-shadow: none; }
@ -5287,7 +5284,7 @@ a, .mdl-accordion, .mdl-button, .mdl-card, .mdl-checkbox, .mdl-dropdown-menu,
.u-panel .u-panel-body { .u-panel .u-panel-body {
padding: 15px 15px; padding: 15px 15px;
position: relative; } position: relative; }
.u-panel .u-panel-body .uf { .u-panel .u-panel-body .u-panel-copy {
position: absolute; position: absolute;
right: 25px; right: 25px;
top: 30px; top: 30px;
@ -5297,7 +5294,7 @@ a, .mdl-accordion, .mdl-button, .mdl-card, .mdl-checkbox, .mdl-dropdown-menu,
margin: 8px; margin: 8px;
border-radius: 4px; border-radius: 4px;
cursor: pointer; } cursor: pointer; }
.u-panel .u-panel-body .uf:hover { .u-panel .u-panel-body .u-panel-copy:hover {
color: #a8a7a7; } color: #a8a7a7; }
.u-panel-default { .u-panel-default {
@ -6673,7 +6670,8 @@ input.u-button[type="submit"] {
border-radius: 0 500px 500px 0; } border-radius: 0 500px 500px 0; }
.u-pagination { .u-pagination {
font-size: 14px; } font-size: 14px;
position: relative; }
.u-pagination-list { .u-pagination-list {
float: left; float: left;
margin: 5px; } margin: 5px; }
@ -6811,6 +6809,15 @@ input.u-button[type="submit"] {
margin: 5px; } margin: 5px; }
.u-pagination-total span { .u-pagination-total span {
padding: 0 5px; } padding: 0 5px; }
.u-pagination.u-pagination-disabled .u-pagination-disabled-mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 46px;
background: rgba(255, 255, 255, 0.6);
z-index: 2;
cursor: not-allowed; }
.pagination-state { .pagination-state {
float: left; float: left;
@ -6917,15 +6924,29 @@ input.u-button[type="submit"] {
margin: 0 5px; margin: 0 5px;
height: 18px; height: 18px;
line-height: 18px; line-height: 18px;
font-size: 14px; } font-size: 14px;
white-space: nowrap;
cursor: pointer;
outline: none;
position: relative;
line-height: 1;
vertical-align: middle; }
.u-checkbox.disabled .u-checkbox-label { .u-checkbox.disabled .u-checkbox-label {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.5; } opacity: 0.5; }
.u-checkbox input[type='checkbox'] { .u-checkbox input[type='checkbox'] {
display: none; position: absolute;
cursor: pointer; } z-index: 3;
cursor: pointer;
opacity: 0;
box-sizing: border-box;
padding: 0;
width: 100%;
height: 100%; }
.u-checkbox input[disabled] { .u-checkbox input[disabled] {
cursor: not-allowed; } cursor: not-allowed; }
.u-checkbox input[type='checkbox']:focus + .u-checkbox-label:before {
border-color: #1e88e5; }
.u-checkbox.is-checked .u-checkbox-label:before { .u-checkbox.is-checked .u-checkbox-label:before {
box-shadow: inset 0 0 0 10px rgb(30,136,229); box-shadow: inset 0 0 0 10px rgb(30,136,229);
border-color: rgb(30,136,229); } border-color: rgb(30,136,229); }
@ -6977,22 +6998,37 @@ input.u-button[type="submit"] {
box-shadow: inset 0 0 0 10px rgb(76,175,80); box-shadow: inset 0 0 0 10px rgb(76,175,80);
border-color: rgb(76,175,80); } border-color: rgb(76,175,80); }
.u-checkbox.u-checkbox-success input[type='checkbox']:focus + .u-checkbox-label:before {
border-color: rgb(76,175,80); }
.u-checkbox.u-checkbox-warning.is-checked .u-checkbox-label:before { .u-checkbox.u-checkbox-warning.is-checked .u-checkbox-label:before {
box-shadow: inset 0 0 0 10px rgb(255,152,0); box-shadow: inset 0 0 0 10px rgb(255,152,0);
border-color: rgb(255,152,0); } border-color: rgb(255,152,0); }
.u-checkbox.u-checkbox-warning input[type='checkbox']:focus + .u-checkbox-label:before {
border-color: rgb(255,152,0); }
.u-checkbox.u-checkbox-danger.is-checked .u-checkbox-label:before { .u-checkbox.u-checkbox-danger.is-checked .u-checkbox-label:before {
box-shadow: inset 0 0 0 10px rgb(244,67,54); box-shadow: inset 0 0 0 10px rgb(244,67,54);
border-color: rgb(244,67,54); } border-color: rgb(244,67,54); }
.u-checkbox.u-checkbox-danger input[type='checkbox']:focus + .u-checkbox-label:before {
border-color: rgb(244,67,54); }
.u-checkbox.u-checkbox-dark.is-checked .u-checkbox-label:before { .u-checkbox.u-checkbox-dark.is-checked .u-checkbox-label:before {
box-shadow: inset 0 0 0 10px rgb(97,97,97); box-shadow: inset 0 0 0 10px rgb(97,97,97);
border-color: rgb(97,97,97); } border-color: rgb(97,97,97); }
.u-checkbox.u-checkbox-dark input[type='checkbox']:focus + .u-checkbox-label:before {
border-color: rgb(97,97,97); }
.u-checkbox.u-checkbox-info.is-checked .u-checkbox-label:before { .u-checkbox.u-checkbox-info.is-checked .u-checkbox-label:before {
box-shadow: inset 0 0 0 10px rgb(0,188,212); box-shadow: inset 0 0 0 10px rgb(0,188,212);
border-color: rgb(0,188,212); } border-color: rgb(0,188,212); }
.u-checkbox.u-checkbox-info input[type='checkbox']:focus + .u-checkbox-label:before {
border-color: rgb(0,188,212); }
/* FormGroup */ /* FormGroup */
/* Navlayout */ /* Navlayout */
/* keyframes 定义 */ /* keyframes 定义 */
@ -7530,7 +7566,8 @@ ul {
zoom: 1; zoom: 1;
position: absolute; position: absolute;
right: 4px; right: 4px;
padding: 0 0 0 8px; } padding: 0 0 0 8px;
top: -3px; }
.u-select-selection--multiple .u-select-selection-choice-remove:before { .u-select-selection--multiple .u-select-selection-choice-remove:before {
display: block; display: block;
font-family: "uf"; } font-family: "uf"; }

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

36158
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

@ -53,8 +53,7 @@ import 'bee-table/build/Table.css';
| onFilterChange | 触发过滤输入操作以及下拉条件的回调 | function | (field,value,condition) => () | onFilterChange | 触发过滤输入操作以及下拉条件的回调 | function | (field,value,condition) => ()
| onFilterClear | 清除过滤条件的回调函数,回调参数为清空的字段 | function | (field) => () | onFilterClear | 清除过滤条件的回调函数,回调参数为清空的字段 | function | (field) => ()
| headerScroll | 表头下是否显示滚动条 | bool| false | headerScroll | 表头下是否显示滚动条 | bool| false
| sort | 排序的属性 | object| { mode:'single'//单列排序, backSource:false //默认是前端排序值为true为后端排序 } mode:multiple-多列排序
*注意: data参数中的key值必需否则会导致部分功能出现问题建议使用唯一的值如id* *注意: data参数中的key值必需否则会导致部分功能出现问题建议使用唯一的值如id*
@ -69,6 +68,8 @@ import 'bee-table/build/Table.css';
|dataIndex| 显示数据记录的字段|String|-| |dataIndex| 显示数据记录的字段|String|-|
|width|宽度的特定比例根据列的宽度计算|String/Number|-| |width|宽度的特定比例根据列的宽度计算|String/Number|-|
|fixed| 当表水平滚动时此列将被固定true或'left'或'right'| true/'left'/'right'|-| |fixed| 当表水平滚动时此列将被固定true或'left'或'right'| true/'left'/'right'|-|
|sorter|前端列排序方法,只要列上有此属性就说明这列可排序。**注:默认是前端排序**| function|-|
|sorterClick|排序的回调函数|function|-|
|render|cell的render函数有三个参数这个单元格的文本这行的记录这行的索引它返回一个对象{childrenvalueprops{colSpan1rowSpan1}} ==>'children'是这个单元格的文本props是这个单元格的一些设置可以设置单元格行/列合并|-| |render|cell的render函数有三个参数这个单元格的文本这行的记录这行的索引它返回一个对象{childrenvalueprops{colSpan1rowSpan1}} ==>'children'是这个单元格的文本props是这个单元格的一些设置可以设置单元格行/列合并|-|
|onCellClick|单击列的单元格时调用|Function(row, event)|-| |onCellClick|单击列的单元格时调用|Function(row, event)|-|
| order | 设置排序 | string"descend"、"ascend" | -| | order | 设置排序 | string"descend"、"ascend" | -|

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "1.6.10-beta.1", "version": "1.6.11",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",

View File

@ -29,7 +29,6 @@ class FilterDropDown extends Component {
onSelectDropdown = (item) => { onSelectDropdown = (item) => {
let { onSelectDropdown, dataText, filterDropdownType } = this.props; let { onSelectDropdown, dataText, filterDropdownType } = this.props;
if (onSelectDropdown) { if (onSelectDropdown) {
if (dataText != "") {
if (filterDropdownType == 'string') { if (filterDropdownType == 'string') {
this.setState({ this.setState({
selectValue: [item.key] selectValue: [item.key]
@ -44,8 +43,6 @@ class FilterDropDown extends Component {
onSelectDropdown(item); onSelectDropdown(item);
}); });
} }
}
} }
} }
@ -57,8 +54,8 @@ class FilterDropDown extends Component {
let { onClickClear } = this.props; let { onClickClear } = this.props;
if (onClickClear) { if (onClickClear) {
this.setState({ this.setState({
selectValue: [], // selectValue: [],
selectNumberValue: [] // selectNumberValue: []
}, () => { }, () => {
onClickClear(); onClickClear();
}); });

View File

@ -523,7 +523,8 @@ class TableHeader extends Component {
delete da.drgHover; delete da.drgHover;
let fixedStyle = ""; let fixedStyle = "";
let canDotDrag = ""; let canDotDrag = "";
if (!fixed && (da.fixed || rows[0][columIndex].fixed) ) { //主表格下、固定列或者是过滤行中含有固定列时添加该属性
if (!fixed && (da.fixed || (filterable && index == rows.length - 1 && rows[0][columIndex].fixed)) ) {
fixedStyle = `${clsPrefix}-row-fixed-columns-in-body`; fixedStyle = `${clsPrefix}-row-fixed-columns-in-body`;
} }
@ -549,7 +550,7 @@ class TableHeader extends Component {
} }
thClassName += ` ${fixedStyle}`; thClassName += ` ${fixedStyle}`;
if(!da.fixed){ if(!da.fixed){
return (<th key={'table-header-th-'+da.dataindex} className={thClassName} data-th-fixed={da.fixed} return (<th {...da} key={'table-header-th-'+da.dataindex} className={thClassName} data-th-fixed={da.fixed}
data-line-key={da.key} data-line-index={columIndex} data-th-width={da.width} > data-line-key={da.key} data-line-index={columIndex} data-th-width={da.width} >
{da.children} {da.children}
{ {