Files
smart-table/lib/index.scss
2020-01-30 20:59:37 +08:00

204 lines
5.2 KiB
SCSS

.smart-table {
position: relative;
overflow: hidden;
box-sizing: border-box;
width: 100%;
max-width: 100%;
background-color: #fff;
color: #606266;
border: 1px solid #EBEEF5;
border-right: none;
border-bottom: none;
&:after,
&:before {
content: "";
position: absolute;
background-color: #ebeef5;
z-index: 1;
}
&:before {
left: 0;
bottom: 0;
width: 100%;
height: 1px;
}
&:after {
top: 0;
right: 0;
width: 1px;
height: 100%;
}
table {
border-spacing: 0;
border: 0;
}
tr {
transition: background-color .25s ease;
}
thead {
color: #909399;
font-weight: 500;
background: #F5F7FA;
tr {
background: #F5F7FA;
}
}
tbody.stripe {
tr:nth-child(2n) {
background-color: #F5F7FA;
}
}
th {
user-select: none;
overflow: hidden;
&[sort] {
cursor: pointer;
:after {
margin-left: 5px;
content: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAAAXNSR0IArs4c6QAAAR5JREFUKBVjYKA7+P//P/OBo2dmHzx6rgab5YzIgseOPeb8/e/Vyv8M/33B4owM0+2tjHMYGRn/wdTBNRw7dlXo9/8fm4E2WMEkQTQjA+N6OWmhKEVFxR8QPpA8eOqyLMPvXzuBijVBgugAaMNhPi4mP0NDww8sIMn/f35aMP1nnA00DV0thP+fgeHz93/mQM5O7ArwiIKNPHDkjCMTEwM/HnUM//4zvXSwNjoOdhIzK9O7f7//LQXaLIlNE9DUW+zMjO4gObijjx8/r/Dr79+dQE1qyJoYGRlOcbMzeJuYmLwBiTPBJC0tDR9wczBYgxTAxIDsbUDFjjDFIHG4DTBFFy9e5P7w+c/q/4wML+2tjFKBQfoHJoeTBiUPXJIAbjheeFXAZxsAAAAASUVORK5CYII=');
}
&.desc {
:after {
content: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAAAXNSR0IArs4c6QAAASdJREFUKBVjYKA7+P//P/OBo2dmHzx6rgab5YzIgseOPeb8/e/Vyv8M/33B4owM0+2tjHMYGRn/wdTBNRw7dlXo9/8fm4E2WMEkQTQjA+N6OWmhKEVFxR8QPpA8eOqyLMPvXzuBijVBgugAaMNhPi4mP0NDww8sIMn/f35aMP1nnA00DV0thP+fgeHz93/mQM5O7ArwiIKNdF7435HhHwM/HnUMDEwML/fGMx4HO+kfE8O7//8YljL8Z5DEpomRkeEW+z8Gd5AcE4jYH8t4kYOBwQokAeIjA6DYKR52BusdiYwPQOIovvRd9l/ky0+Grf//M5iBJRkZtvGIMIRu9mX8BuKDAIoGkIDbov/cv/4wrAbKvHRQYEhtcGT8AxLHC0JX/WfGpQAAJIlcYMXwsAoAAAAASUVORK5CYII=');
}
}
&.asc {
:after {
content: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAAAXNSR0IArs4c6QAAARlJREFUKBVjYKA7aPj/n8lx/v+pQFyFzXJGZEHPbf/Zf7xkWPr/P0MwSJyRkWGqfQJDXgMj4z+YOrgGl1X/+f9+Ydj4n4HBHiYJ1bSWQ5whersX408wH0S4Lv8v9ecHw3agyXogPjoAmnqQmYfBf08Y40cWkOSfnww2DIwMS4FOWIquGMb/+5XBGsjeBuMTTYP9cODIGUcmJgZ+fLr+/Wd66WBtdBzsJGZWpnf/fv9bCvSwJDZNQFNvsTMzuoPk4KF0/Ph5hV9//+4EalJD1gT01yludgZvExOTNyBxJpikpaXhA24OBmuQApgYkL0NqNgRphgkDrcBpujixYvcHz7/Wf2fkeGlvZVRKiMj4x+YHE76////zLgkATPDVMggLp6aAAAAAElFTkSuQmCC');
}
}
}
}
td,
th {
padding: 6px 0;
min-width: 50px;
box-sizing: border-box;
text-overflow: ellipsis;
vertical-align: middle;
position: relative;
text-align: left;
border-bottom: 1px solid #EBEEF5;
border-right: 1px solid #EBEEF5;
text-align: center;
&.is-hidden>* {
visibility: hidden;
}
}
&.smart-table-custom-large {
td,
th {
padding: 12px 0;
}
}
&.smart-table-custom-middle {
td,
th {
padding: 10px 0;
}
}
&.smart-table-custom-left {
td,
th {
text-align: left;
}
}
&.smart-table-custom-right {
td,
th {
text-align: right;
}
}
.smart-table_cell {
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
word-break: break-all;
line-height: 23px;
padding-left: 4px;
padding-right: 4px;
}
th>.smart-table_cell {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
vertical-align: middle;
padding-left: 4px;
padding-right: 4px;
width: 100%;
}
.smart-table_body,
.smart-table_footer,
.smart-table_header {
table-layout: fixed;
border-collapse: separate;
background: #fff;
}
.smart-table_header-wrapper {
overflow: hidden;
}
.smart-table_body-wrapper {
overflow: auto;
}
.smart-table_fixed,
.smart-table_fixed-right {
position: absolute;
top: 0;
left: 0;
overflow-x: hidden;
overflow-y: hidden;
box-shadow: 0 -1px 8px rgba(0, 0, 0, .08);
}
.smart-table_fixed-right {
top: 0;
left: auto;
right: 0;
box-shadow: -1px 0 8px rgba(0, 0, 0, .08);
.smart-table_fixed-body-wrapper,
.smart-table_fixed-footer-wrapper,
.smart-table_fixed-header-wrapper {
left: auto;
right: 0;
}
}
.smart-table_fixed-right-patch {
position: absolute;
top: -1px;
right: 0;
background-color: #F5F7FA;
}
.smart-table_fixed-header-wrapper {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.smart-table_fixed-body-wrapper {
position: absolute;
left: 0;
top: 37px;
overflow: hidden;
z-index: 3;
}
.smart-table_hover-tr {
background-color: #f0f5fd !important;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
background-color: #e9edf4;
}
::-webkit-scrollbar-thumb {
background-color: #ccc;
border-radius: 2em;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
-o-border-radius: 2em;
}
::-webkit-scrollbar-thumb:hover {
background-color: #9bbbfa;
}
}