feat(table.js && table.scss): 修改固定表头的滚动条默认样式为auto

This commit is contained in:
huyueb 2017-11-29 16:51:07 +08:00
parent d02af6c829
commit e8bc09f6ab
8 changed files with 93 additions and 85 deletions

View File

@ -24,7 +24,8 @@
.u-table tr.tr-row-hover {
background: rgb(227,242,253); }
.u-table th, .u-table td {
padding: 16px 8px; }
padding: 16px 8px;
word-break: break-all; }
.u-table-scroll {
overflow: auto; }
.u-table-header {
@ -40,7 +41,7 @@
overflow-x: scroll;
padding-bottom: 20px;
margin-bottom: -20px;
overflow-y: scroll;
overflow-y: auto;
box-sizing: border-box; }
.u-table-title {
padding: 16px 8px;

View File

@ -539,7 +539,7 @@ var Table = function (_Component) {
} else {
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
}
bodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
bodyStyle.overflowY = bodyStyle.overflowY || 'auto';
useFixedHeader = true;
// Add negative margin bottom for scroll bar overflow bug

View File

@ -1,7 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = multiSelect;
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
@ -28,7 +34,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* getSelectedDataFunc--function能获取到选中的数据
* 使用全选时得注意data中的key值一定要是唯一值
*/
module.exports = function multiSelect(Table) {
function multiSelect(Table) {
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
@ -106,7 +112,7 @@ module.exports = function multiSelect(Table) {
checkedObj: checkedObj,
selIds: selIds
});
if (typeof getSelectedDataFunc === 'function') {
if (typeof getSelectedDataFunc === "function") {
getSelectedDataFunc(selIds);
}
};
@ -172,4 +178,5 @@ module.exports = function multiSelect(Table) {
return BookLoader;
}(_react.Component);
};
}
module.exports = exports["default"];

View File

@ -28,7 +28,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
/**
* 参数prefixCls默认bee-table,用于设置图标的样式
* @param {*} Table
* @param {*} Table
*/
function sort(Table) {
return function (_Component) {

View File

@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = sum;
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
@ -29,7 +31,7 @@ var columns2 = {
dataIndex: "showSum"
};
var sum = function sum(Table) {
function sum(Table) {
return function (_React$Component) {
_inherits(SumTable, _React$Component);
@ -96,6 +98,4 @@ var sum = function sum(Table) {
return SumTable;
}(_react2["default"].Component);
};
exports["default"] = sum;
module.exports = exports["default"];

View File

@ -1,75 +1,75 @@
{
"name": "bee-table",
"version": "1.0.5",
"description": "Table ui component for react",
"keywords": [
"react",
"react-component",
"bee-table",
"iuap-design",
"tinper-bee",
"Table"
],
"engines": {
"node": ">=4.0.0"
},
"homepage": "https://github.com/tinper-bee/bee-table.git",
"author": "Yonyou FED",
"repository": "http://github.com/tinper-bee/bee-table",
"bugs": "https://github.com/tinper-bee/bee-table.git/issues",
"license": "MIT",
"main": "./build/index.js",
"config": {
"port": 3000,
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"scripts": {
"dev": "bee-tools run start",
"build": "bee-tools run build",
"lint": "bee-tools run lint",
"test": "bee-tools run test",
"chrome": "bee-tools run chrome",
"coveralls": "bee-tools run coverage",
"browsers": "bee-tools run browsers",
"pub": "bee-tools run pub",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
},
"dependencies": {
"classnames": "^2.2.5",
"object-path": "^0.11.3",
"tinper-bee-core": "latest",
"warning": "^3.0.0"
},
"peerDependencies": {
"react": "^15.3.0 || ^16.0",
"react-dom": "^15.3.0 || ^16.0",
"prop-types": "15.6.0"
},
"devDependencies": {
"bee-animate": "latest",
"bee-button": "latest",
"bee-checkbox": "latest",
"bee-datepicker": "latest",
"bee-form": "^1.0.8",
"bee-form-control": "latest",
"bee-icon": "latest",
"bee-input-group": "latest",
"bee-layout": "latest",
"bee-pagination": "latest",
"bee-panel": "latest",
"bee-popconfirm": "^1.0.1",
"bee-select": "latest",
"bee-tools": "latest",
"bee-tooltip": "^1.0.2",
"chai": "^3.5.0",
"console-polyfill": "~0.2.1",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^2.4.1",
"es5-shim": "~4.1.10",
"react": "^15.5.0",
"react-addons-test-utils": "^15.5.0",
"react-dom": "^15.5.0"
"name": "bee-table",
"version": "1.0.6",
"description": "Table ui component for react",
"keywords": [
"react",
"react-component",
"bee-table",
"iuap-design",
"tinper-bee",
"Table"
],
"engines": {
"node": ">=4.0.0"
},
"homepage": "https://github.com/tinper-bee/bee-table.git",
"author": "Yonyou FED",
"repository": "http://github.com/tinper-bee/bee-table",
"bugs": "https://github.com/tinper-bee/bee-table.git/issues",
"license": "MIT",
"main": "./build/index.js",
"config": {
"port": 3000,
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
},
"scripts": {
"dev": "bee-tools run start",
"build": "bee-tools run build",
"lint": "bee-tools run lint",
"test": "bee-tools run test",
"chrome": "bee-tools run chrome",
"coveralls": "bee-tools run coverage",
"browsers": "bee-tools run browsers",
"pub": "bee-tools run pub",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
},
"dependencies": {
"classnames": "^2.2.5",
"object-path": "^0.11.3",
"tinper-bee-core": "latest",
"warning": "^3.0.0"
},
"peerDependencies": {
"react": "^15.3.0 || ^16.0",
"react-dom": "^15.3.0 || ^16.0",
"prop-types": "15.6.0"
},
"devDependencies": {
"bee-animate": "latest",
"bee-button": "latest",
"bee-checkbox": "latest",
"bee-datepicker": "latest",
"bee-form": "^1.0.8",
"bee-form-control": "latest",
"bee-icon": "latest",
"bee-input-group": "latest",
"bee-layout": "latest",
"bee-pagination": "latest",
"bee-panel": "latest",
"bee-popconfirm": "^1.0.1",
"bee-select": "latest",
"bee-tools": "latest",
"bee-tooltip": "^1.0.2",
"chai": "^3.5.0",
"console-polyfill": "~0.2.1",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^2.4.1",
"es5-shim": "~4.1.10",
"react": "^15.5.0",
"react-addons-test-utils": "^15.5.0",
"react-dom": "^15.5.0"
}
}

View File

@ -465,7 +465,7 @@ class Table extends Component{
} else {
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
}
bodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
bodyStyle.overflowY = bodyStyle.overflowY || 'auto';
useFixedHeader = true;
// Add negative margin bottom for scroll bar overflow bug

View File

@ -80,7 +80,7 @@ $table-move-in-color: $bg-color-base;
overflow-x: scroll;
padding-bottom: 20px;
margin-bottom: -20px;
overflow-y: scroll;
overflow-y: auto;
box-sizing: border-box;
}