This commit is contained in:
wanghaoo 2019-03-11 09:53:34 +08:00
parent c813b5a132
commit ac56add061
7 changed files with 125 additions and 118 deletions

BIN
build.zip

Binary file not shown.

View File

@ -430,6 +430,10 @@ var Table = function (_Component) {
if (index !== -1) { if (index !== -1) {
expandedRows.splice(index, 1); expandedRows.splice(index, 1);
} }
//
if (this.currentHoverKey == rowKey && this.hoverDom) {
this.hoverDom.style.display = 'none';
}
this.onExpandedRowsChange(expandedRows); this.onExpandedRowsChange(expandedRows);
}; };
@ -1278,19 +1282,21 @@ var Table = function (_Component) {
currentHoverKey: isHover ? key : null currentHoverKey: isHover ? key : null
}); });
} }
if (this.hoverDom && isHover) { if (this.hoverDom) {
this.currentHoverKey = key; if (isHover) {
var td = (0, _utils.closest)(event.target, 'td'); this.currentHoverKey = key;
if (td) { var td = (0, _utils.closest)(event.target, 'td');
var scrollTop = this.lastScrollTop ? this.lastScrollTop : 0; if (td) {
var top = td.offsetTop - scrollTop; var scrollTop = this.lastScrollTop ? this.lastScrollTop : 0;
if (this.refs.headTable) { var top = td.offsetTop - scrollTop;
top = top + this.refs.headTable.clientHeight; if (this.refs.headTable) {
top = top + this.refs.headTable.clientHeight;
}
this.hoverDom.style.top = top + 'px';
this.hoverDom.style.height = td.offsetHeight + 'px';
this.hoverDom.style.lineHeight = td.offsetHeight + 'px';
this.hoverDom.style.display = 'block';
} }
this.hoverDom.style.top = top + 'px';
this.hoverDom.style.height = td.offsetHeight + 'px';
this.hoverDom.style.lineHeight = td.offsetHeight + 'px';
this.hoverDom.style.display = 'block';
} }
} }

54
dist/demo.css vendored
View File

@ -6013,12 +6013,18 @@ a, .mdl-accordion, .mdl-button, .mdl-card, .mdl-checkbox, .mdl-dropdown-menu,
.u-button.colored:focus:not(:active) { .u-button.colored:focus:not(:active) {
background-color: rgb(238,238,238); background-color: rgb(238,238,238);
border-color: rgb(189,189,189); } border-color: rgb(189,189,189); }
.u-button.disable { .u-button.disable, .u-button.u-button[disabled] {
-webkit-box-shadow: none;
filter: alpha(opacity=65);
box-shadow: none;
cursor: not-allowed; cursor: not-allowed;
opacity: .65; } background-color: #DFE1E6;
border-color: #DFE1E6;
color: #fff; }
.u-button.disable:hover, .u-button.disable:active, .u-button.disable:focus, .u-button.u-button[disabled]:hover, .u-button.u-button[disabled]:active, .u-button.u-button[disabled]:focus {
background-color: #DFE1E6;
border-color: #DFE1E6;
color: #fff; }
.u-button:not(.u-button-icon) i.uf {
padding-left: 0;
line-height: normal; }
input.u-button[type="submit"] { input.u-button[type="submit"] {
-webkit-appearance: none; } -webkit-appearance: none; }
@ -6046,9 +6052,9 @@ input.u-button[type="submit"] {
.u-button.disabled, .u-button[disabled] { .u-button.disabled, .u-button[disabled] {
cursor: not-allowed; cursor: not-allowed;
opacity: .65; background-color: #DFE1E6;
filter: alpha(opacity=65); border-color: #DFE1E6;
box-shadow: none; } color: #fff; }
.u-button-default { .u-button-default {
color: #333; color: #333;
@ -6609,9 +6615,9 @@ input.u-button[type="submit"] {
.u-pagination-list > li > a, .u-pagination-list > li > span { .u-pagination-list > li > a, .u-pagination-list > li > span {
display: inline-block; display: inline-block;
text-decoration: none; text-decoration: none;
border-top: 1px solid #d7d7d7; border-top: 1px solid rgb(165, 173, 186);
border-bottom: 1px solid #d7d7d7; border-bottom: 1px solid rgb(165, 173, 186);
border-left: 1px solid #d7d7d7; border-left: 1px solid rgb(165, 173, 186);
background-color: transparent; background-color: transparent;
text-align: center; text-align: center;
color: #666666; color: #666666;
@ -6629,14 +6635,14 @@ input.u-button[type="submit"] {
.u-pagination-list > li[role="next"] > a { .u-pagination-list > li[role="next"] > a {
border-top-right-radius: 4px; border-top-right-radius: 4px;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
border-right: 1px solid #d7d7d7; } border-right: 1px solid rgb(165, 173, 186); }
.u-pagination-list > li { .u-pagination-list > li {
float: left; float: left;
list-style-type: none; } list-style-type: none; }
.u-pagination-list > li > a:hover, .u-pagination-list > li > span:hover, .u-pagination-list > li > a:focus, .u-pagination-list > li > span:focus { .u-pagination-list > li > a:hover, .u-pagination-list > li > span:hover, .u-pagination-list > li > a:focus, .u-pagination-list > li > span:focus {
color: #666; color: #666;
background-color: rgb(235, 236, 240); background-color: rgb(235, 236, 240);
border-color: #d7d7d7; border-color: rgb(165, 173, 186);
cursor: pointer; } cursor: pointer; }
.u-pagination-list > li > a > i { .u-pagination-list > li > a > i {
color: #7a869a; } color: #7a869a; }
@ -6650,13 +6656,13 @@ input.u-button[type="submit"] {
color: #777; color: #777;
cursor: not-allowed; cursor: not-allowed;
background-color: transparent; background-color: transparent;
border-color: #ddd; } border-color: rgb(165, 173, 186); }
.u-pagination-list > .disabled > a > i { .u-pagination-list > .disabled > a > i {
color: #C1C7D0; } color: #C1C7D0; }
.u-pagination-list > li[role="gap"] > a { .u-pagination-list > li[role="gap"] > a {
background-color: transparent; background-color: transparent;
border-bottom: 0 solid #d7d7d7; border-bottom: 0 solid rgb(165, 173, 186);
border-top: 0 solid #d7d7d7; border-top: 0 solid rgb(165, 173, 186);
padding: 7px 11px; padding: 7px 11px;
line-height: 1.57142857; } line-height: 1.57142857; }
.u-pagination-list > li[role="gap"] > a:hover, .u-pagination-list > li[role="gap"] > a:focus { .u-pagination-list > li[role="gap"] > a:hover, .u-pagination-list > li[role="gap"] > a:focus {
@ -6671,7 +6677,7 @@ input.u-button[type="submit"] {
padding: 0px; padding: 0px;
font-size: 14px; } font-size: 14px; }
.u-pagination-list > li:last-child > a, .u-pagination-list > li:last-child > span { .u-pagination-list > li:last-child > a, .u-pagination-list > li:last-child > span {
border-right: 1px solid #d7d7d7; } border-right: 1px solid rgb(165, 173, 186); }
.u-pagination .temp-main { .u-pagination .temp-main {
width: 100px; width: 100px;
height: 100px; height: 100px;
@ -6896,16 +6902,16 @@ input.u-button[type="submit"] {
.u-pagination-gap > li > a { .u-pagination-gap > li > a {
margin: 0 5px; margin: 0 5px;
border-radius: 5px; border-radius: 5px;
border: 1px solid #d7d7d7; } border: 1px solid rgb(165, 173, 186); }
.u-pagination-gap > li > a:hover { .u-pagination-gap > li > a:hover {
background-color: transparent; background-color: rgb(235, 236, 240);
border-color: #7A869A; } border-color: rgb(165, 173, 186); }
.u-pagination-gap > li:first-child > a, .u-pagination-gap > li:last-child > a { .u-pagination-gap > li:first-child > a, .u-pagination-gap > li:last-child > a {
border-radius: 5px; } border-radius: 5px; }
.u-pagination-gap > li[role="gap"] > a { .u-pagination-gap > li[role="gap"] > a {
border: 0 solid #d7d7d7; } border: 0 solid rgb(165, 173, 186); }
/* FormGroup */ /* FormGroup */
/* Navlayout */ /* Navlayout */
@ -9132,7 +9138,7 @@ ul {
border-collapse: separate; } border-collapse: separate; }
.u-input-group .u-input-group-btn .u-button { .u-input-group .u-input-group-btn .u-button {
border: 1px solid #ccc; border: 1px solid #ccc;
height: 30px; height: 32px;
line-height: 1.3; } line-height: 1.3; }
.u-input-group .u-form-control { .u-input-group .u-form-control {
position: relative; position: relative;
@ -9152,9 +9158,9 @@ ul {
border-radius: 3px; } border-radius: 3px; }
.u-input-group.simple .u-input-group-btn { .u-input-group.simple .u-input-group-btn {
position: absolute; position: absolute;
top: 2px; top: 4px;
bottom: 0; bottom: 0;
right: 5px; right: 6px;
min-width: 20px; } min-width: 20px; }
.u-input-group.simple .u-form-control:not(:last-child) { .u-input-group.simple .u-form-control:not(:last-child) {
padding-right: 23px; } padding-right: 23px; }

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

147
dist/demo.js vendored

File diff suppressed because one or more lines are too long

6
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.0.4", "version": "2.0.5-beta.0",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",
@ -95,4 +95,4 @@
"react-addons-test-utils": "^15.5.0", "react-addons-test-utils": "^15.5.0",
"react-dom": "^16.6.3" "react-dom": "^16.6.3"
} }
} }