2.3.15-beta.7
This commit is contained in:
parent
f1dfb9c85f
commit
f1c585a850
|
@ -525,11 +525,16 @@ var Table = function (_Component) {
|
|||
this.isShowScrollY();
|
||||
if (this.bodyTable) {
|
||||
var currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX;
|
||||
if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX !== 'hidden') {
|
||||
if (!this.props.scroll.x && currentOverflowX === 'scroll') {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
if (this.props.scroll.x && this.props.scroll.x !== '100%' && currentOverflowX !== 'scroll') {
|
||||
if (this.props.scroll.x && currentOverflowX !== 'scroll') {
|
||||
// 此处应该对比一下实际的
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
this.bodyTable.style.overflowX = 'scroll';
|
||||
} else {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.bodyTableOuter) {
|
||||
|
@ -1226,7 +1231,7 @@ var Table = function (_Component) {
|
|||
if (this.props.data.length == 0 && this.props.headerScroll) {
|
||||
bodyStyle.overflowX = 'hidden';
|
||||
}
|
||||
if (!footerScroll && scroll.x !== '100%') {
|
||||
if (!footerScroll && this.computeWidth > this.contentDomWidth) {
|
||||
bodyStyle.overflowX = bodyStyle.overflowX || 'auto';
|
||||
}
|
||||
}
|
||||
|
@ -1238,11 +1243,13 @@ var Table = function (_Component) {
|
|||
// bodyStyle.height = bodyStyle.height || scroll.y;
|
||||
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
|
||||
if (scroll.x && scroll.x !== '100%') {
|
||||
if (scroll.x) {
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
innerBodyStyle.overflowX = 'scroll';
|
||||
} else {
|
||||
innerBodyStyle.overflowX = 'hidden';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
}
|
||||
|
@ -1276,8 +1283,10 @@ var Table = function (_Component) {
|
|||
headStyle.overflow = 'hidden';
|
||||
innerBodyStyle.overflowX = 'auto'; //兼容expand场景、子表格含有固定列的场景
|
||||
} else {
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
bodyStyle.marginBottom = '-' + scrollbarWidth + 'px';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有数据时,表头滚动条隐藏问题
|
||||
if (data.length == 0 && this.domWidthDiff < 0) {
|
||||
|
@ -1375,9 +1384,6 @@ var Table = function (_Component) {
|
|||
}
|
||||
delete bodyStyle.overflowX;
|
||||
delete bodyStyle.overflowY;
|
||||
if (scroll.x === '100%') {
|
||||
delete bodyStyle.marginBottom;
|
||||
}
|
||||
BodyTable = _react2["default"].createElement(
|
||||
'div',
|
||||
{
|
||||
|
|
|
@ -48434,11 +48434,16 @@
|
|||
this.isShowScrollY();
|
||||
if (this.bodyTable) {
|
||||
var currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX;
|
||||
if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX !== 'hidden') {
|
||||
if (!this.props.scroll.x && currentOverflowX === 'scroll') {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
if (this.props.scroll.x && this.props.scroll.x !== '100%' && currentOverflowX !== 'scroll') {
|
||||
if (this.props.scroll.x && currentOverflowX !== 'scroll') {
|
||||
// 此处应该对比一下实际的
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
this.bodyTable.style.overflowX = 'scroll';
|
||||
} else {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.bodyTableOuter) {
|
||||
|
@ -49135,7 +49140,7 @@
|
|||
if (this.props.data.length == 0 && this.props.headerScroll) {
|
||||
bodyStyle.overflowX = 'hidden';
|
||||
}
|
||||
if (!footerScroll && scroll.x !== '100%') {
|
||||
if (!footerScroll && this.computeWidth > this.contentDomWidth) {
|
||||
bodyStyle.overflowX = bodyStyle.overflowX || 'auto';
|
||||
}
|
||||
}
|
||||
|
@ -49147,11 +49152,13 @@
|
|||
// bodyStyle.height = bodyStyle.height || scroll.y;
|
||||
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
|
||||
if (scroll.x && scroll.x !== '100%') {
|
||||
if (scroll.x) {
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
innerBodyStyle.overflowX = 'scroll';
|
||||
} else {
|
||||
innerBodyStyle.overflowX = 'hidden';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
}
|
||||
|
@ -49185,8 +49192,10 @@
|
|||
headStyle.overflow = 'hidden';
|
||||
innerBodyStyle.overflowX = 'auto'; //兼容expand场景、子表格含有固定列的场景
|
||||
} else {
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
bodyStyle.marginBottom = '-' + scrollbarWidth + 'px';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有数据时,表头滚动条隐藏问题
|
||||
if (data.length == 0 && this.domWidthDiff < 0) {
|
||||
|
@ -49284,9 +49293,6 @@
|
|||
}
|
||||
delete bodyStyle.overflowX;
|
||||
delete bodyStyle.overflowY;
|
||||
if (scroll.x === '100%') {
|
||||
delete bodyStyle.marginBottom;
|
||||
}
|
||||
BodyTable = _react2['default'].createElement(
|
||||
'div',
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-table",
|
||||
"version": "2.3.15-beta.6",
|
||||
"version": "2.3.15-beta.7",
|
||||
"description": "Table ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
24
src/Table.js
24
src/Table.js
|
@ -297,12 +297,17 @@ class Table extends Component {
|
|||
// 是否传入 scroll中的y属性,如果传入判断是否是整数,如果是则进行比较 。bodyTable 的clientHeight进行判断
|
||||
this.isShowScrollY();
|
||||
if (this.bodyTable) {
|
||||
const currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX
|
||||
if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX !== 'hidden') {
|
||||
const currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX;
|
||||
if (!this.props.scroll.x && currentOverflowX === 'scroll') {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
if ((this.props.scroll.x && this.props.scroll.x !== '100%') && currentOverflowX !== 'scroll') {
|
||||
if (this.props.scroll.x && currentOverflowX !== 'scroll') {
|
||||
// 此处应该对比一下实际的
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
this.bodyTable.style.overflowX = 'scroll';
|
||||
} else {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.bodyTableOuter) { // 隐藏几个不需要真正滚动的父元素的滚动条
|
||||
|
@ -1024,7 +1029,7 @@ class Table extends Component {
|
|||
if(this.props.data.length == 0 && this.props.headerScroll ){
|
||||
bodyStyle.overflowX = 'hidden';
|
||||
}
|
||||
if (!footerScroll && scroll.x !== '100%') {
|
||||
if (!footerScroll && this.computeWidth > this.contentDomWidth) {
|
||||
bodyStyle.overflowX = bodyStyle.overflowX || 'auto';
|
||||
}
|
||||
}
|
||||
|
@ -1036,11 +1041,13 @@ class Table extends Component {
|
|||
// bodyStyle.height = bodyStyle.height || scroll.y;
|
||||
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
|
||||
if (scroll.x && scroll.x !== '100%') {
|
||||
if (scroll.x) {
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
innerBodyStyle.overflowX = 'scroll';
|
||||
} else {
|
||||
innerBodyStyle.overflowX = 'hidden';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
}
|
||||
|
@ -1074,7 +1081,9 @@ class Table extends Component {
|
|||
headStyle.overflow = 'hidden';
|
||||
innerBodyStyle.overflowX = 'auto'; //兼容expand场景、子表格含有固定列的场景
|
||||
}else{
|
||||
bodyStyle.marginBottom = `-${scrollbarWidth}px`;
|
||||
if (this.computeWidth > this.contentDomWidth) {
|
||||
bodyStyle.marginBottom = '-' + scrollbarWidth + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
|
@ -1166,9 +1175,6 @@ class Table extends Component {
|
|||
}
|
||||
delete bodyStyle.overflowX;
|
||||
delete bodyStyle.overflowY;
|
||||
if (scroll.x === '100%') {
|
||||
delete bodyStyle.marginBottom
|
||||
}
|
||||
BodyTable = (
|
||||
<div
|
||||
className={`${clsPrefix}-body-outer`}
|
||||
|
|
Loading…
Reference in New Issue