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