Files
smart-table/lib/index.scss

305 lines
5.8 KiB
SCSS
Raw Normal View History

2020-01-13 16:25:20 +08:00
.smart-table {
position: relative;
overflow: hidden;
box-sizing: border-box;
width: 100%;
max-width: 100%;
background-color: #fff;
2020-02-04 11:59:05 +08:00
color: #6A6B6F;
border: 1px solid #ECF0F5;
2020-01-13 16:25:20 +08:00
border-right: none;
border-bottom: none;
2020-01-20 11:28:19 +08:00
&:after,
&:before {
content: "";
position: absolute;
2020-02-04 11:59:05 +08:00
background-color: #ECF0F5;
2020-01-20 11:28:19 +08:00
z-index: 1;
}
&:before {
left: 0;
bottom: 0;
width: 100%;
height: 1px;
}
&:after {
top: 0;
right: 0;
width: 1px;
height: 100%;
}
2020-01-13 16:25:20 +08:00
table {
border-spacing: 0;
border: 0;
}
thead {
2020-02-04 11:59:05 +08:00
background: #F5F7FB;
font-size: 13px;
}
tr {
transition: background-color .25s ease;
}
2020-02-04 11:59:05 +08:00
tbody {
font-size: 12px;
tr[expand] {
td:first-child {
cursor: pointer;
:before {
transition: 0.35s ease transform;
transform-origin: 25% 50%;
content: '';
float: left;
width: 0;
height: 0;
border-width: 6px;
border-style: solid;
border-color: transparent transparent transparent #c0c4cc;
margin: 5px 0 0 5px;
}
}
&[expanded]>td:first-child>:before {
transform: rotate(90deg);
}
}
2020-02-04 11:59:05 +08:00
&.stripe {
tr:nth-child(2n) {
background-color: #F9FBFF;
}
2020-01-16 14:25:41 +08:00
}
2020-01-13 16:25:20 +08:00
}
2020-02-04 11:59:05 +08:00
td,
th {
padding: 5px 0;
text-overflow: ellipsis;
vertical-align: middle;
position: relative;
border-bottom: 1px solid #ECF0F5;
border-right: 1px solid #ECF0F5;
text-align: center;
&.is-hidden>* {
visibility: hidden;
2020-01-16 17:17:57 +08:00
}
}
2020-01-13 16:25:20 +08:00
th {
user-select: none;
overflow: hidden;
2020-01-16 17:17:57 +08:00
&[sort] {
2020-01-13 16:25:20 +08:00
cursor: pointer;
:before,
:after {
content: '';
float: right;
width: 0;
height: 0;
border-width: 5px;
border-style: solid;
}
:before {
margin: 1px 0 0 -10px;
border-color: transparent transparent #c0c4cc transparent;
}
:after {
margin: 12px 0 0 4px;
border-color: #c0c4cc transparent transparent transparent;
2020-01-13 16:25:20 +08:00
}
&.desc {
:after {
border-top-color: #409eff;
2020-01-13 16:25:20 +08:00
}
}
&.asc {
:before {
border-bottom-color: #409eff;
2020-01-13 16:25:20 +08:00
}
}
}
}
2020-02-04 11:59:05 +08:00
&.stb-cust-large {
thead {
font-size: 16px;
}
tbody {
font-size: 15px;
2020-01-13 16:25:20 +08:00
}
2020-01-17 15:02:45 +08:00
td,
th {
padding: 12px 0;
}
}
2020-02-04 11:59:05 +08:00
&.stb-cust-middle {
thead {
font-size: 15px;
}
tbody {
font-size: 14px;
}
2020-01-17 15:02:45 +08:00
td,
th {
padding: 10px 0;
}
}
2020-02-04 11:59:05 +08:00
&.stb-cust-left {
2020-01-17 15:02:45 +08:00
td,
th {
text-align: left;
}
}
2020-02-04 11:59:05 +08:00
&.stb-cust-right {
2020-01-17 15:02:45 +08:00
td,
th {
text-align: right;
}
}
2020-02-11 19:59:24 +08:00
th[align="left"],
td[align="left"] {
text-align: left;
}
2020-02-12 11:18:28 +08:00
th[align="center"],
td[align="center"] {
text-align: center;
}
th[align="right"],
td[align="right"] {
text-align: right;
}
2020-02-11 19:59:24 +08:00
th[nowrap],
td[nowrap] {
.stb_cell {
white-space: nowrap;
}
}
2020-02-07 21:13:37 +08:00
.std-checkbox_inner {
display: inline-block;
position: relative;
border: 1px solid #dcdfe6;
border-radius: 2px;
box-sizing: border-box;
width: 14px;
height: 14px;
background-color: #fff;
z-index: 1;
transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
&:after {
box-sizing: content-box;
content: "";
border: 1px solid #fff;
border-left: 0;
border-top: 0;
height: 7px;
left: 4px;
position: absolute;
top: 1px;
transform: rotate(45deg) scaleY(0);
width: 3px;
transition: transform .15s ease-in .05s;
transform-origin: center;
}
}
.std-checkbox_input {
white-space: nowrap;
cursor: pointer;
outline: none;
display: inline-block;
line-height: 1;
position: relative;
vertical-align: middle;
}
.std-checkbox {
color: #606266;
font-weight: 500;
font-size: 14px;
position: relative;
cursor: pointer;
display: inline-block;
white-space: nowrap;
user-select: none;
&[checked]>.std-checkbox_input>.std-checkbox_inner {
background-color: #409eff;
border-color: #409eff;
&:after {
transform: rotate(45deg) scaleY(1);
}
}
}
2020-02-04 11:59:05 +08:00
.stb_cell {
2020-01-13 16:25:20 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
word-break: break-all;
2020-02-04 11:59:05 +08:00
padding: 0 4px;
2020-01-13 16:25:20 +08:00
line-height: 23px;
}
2020-02-04 11:59:05 +08:00
th>.stb_cell {
2020-01-13 16:25:20 +08:00
display: inline-block;
position: relative;
vertical-align: middle;
}
2020-02-04 11:59:05 +08:00
.stb_body,
.stb_footer,
.stb_header {
2020-01-13 16:25:20 +08:00
table-layout: fixed;
border-collapse: separate;
background: #fff;
}
2020-02-04 11:59:05 +08:00
.stb_header-wrapper {
2020-01-13 16:25:20 +08:00
overflow: hidden;
}
2020-02-04 11:59:05 +08:00
.stb_body-wrapper {
2020-01-20 11:28:19 +08:00
overflow: auto;
2020-01-13 16:25:20 +08:00
}
2020-02-04 11:59:05 +08:00
.stb_fixed,
.stb_fixed-right {
2020-01-13 16:25:20 +08:00
position: absolute;
top: 0;
left: 0;
overflow-x: hidden;
overflow-y: hidden;
2020-01-16 17:17:57 +08:00
box-shadow: 0 -1px 8px rgba(0, 0, 0, .08);
2020-01-13 16:25:20 +08:00
}
2020-02-04 11:59:05 +08:00
.stb_fixed-right {
2020-01-13 16:25:20 +08:00
top: 0;
left: auto;
right: 0;
2020-01-20 11:28:19 +08:00
box-shadow: -1px 0 8px rgba(0, 0, 0, .08);
2020-02-04 11:59:05 +08:00
.stb_fixed-body-wrapper,
.stb_fixed-footer-wrapper,
.stb_fixed-header-wrapper {
2020-01-13 16:25:20 +08:00
left: auto;
right: 0;
}
}
2020-02-04 11:59:05 +08:00
.stb_fixed-right-patch {
2020-01-13 16:25:20 +08:00
position: absolute;
top: -1px;
right: 0;
2020-02-04 11:59:05 +08:00
background-color: #F5F7FB;
2020-01-13 16:25:20 +08:00
}
2020-02-04 11:59:05 +08:00
.stb_fixed-header-wrapper {
2020-01-13 16:25:20 +08:00
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
2020-02-04 11:59:05 +08:00
.stb_fixed-body-wrapper {
2020-01-13 16:25:20 +08:00
position: absolute;
left: 0;
top: 37px;
overflow: hidden;
z-index: 3;
2020-01-16 14:25:41 +08:00
}
::-webkit-scrollbar {
2020-01-20 11:28:19 +08:00
width: 8px;
height: 8px;
background-color: #e9edf4;
}
::-webkit-scrollbar-thumb {
2020-01-20 11:28:19 +08:00
background-color: #ccc;
border-radius: 2em;
}
::-webkit-scrollbar-thumb:hover {
2020-02-06 22:27:57 +08:00
background-color: #919191;
2020-01-20 11:28:19 +08:00
}
2020-02-04 11:59:05 +08:00
* {
box-sizing: border-box;
}
2020-01-13 16:25:20 +08:00
}