iview/src/styles/components/table.less

309 lines
6.3 KiB
Text
Raw Normal View History

@table-prefix-cls: ~"@{css-prefix}table";
2016-11-29 11:04:48 +08:00
@table-select-item-prefix-cls: ~"@{table-prefix-cls}-filter-select-item";
.@{table-prefix-cls} {
2016-11-29 13:25:25 +08:00
&-wrapper{
position: relative;
border: 1px solid @border-color-base;
border-bottom: 0;
border-right: 0;
}
2016-11-29 18:42:34 +08:00
width: inherit;
height: 100%;
max-width: 100%;
2016-11-24 15:27:46 +08:00
overflow: hidden;
color: @text-color;
font-size: @font-size-small;
2016-11-24 15:27:46 +08:00
background-color: #fff;
2016-11-29 13:25:25 +08:00
2016-11-24 15:27:46 +08:00
box-sizing: border-box;
2016-11-29 13:25:25 +08:00
//position: relative;
2016-11-29 11:04:48 +08:00
&-hide{
opacity: 0;
}
2016-11-25 15:47:28 +08:00
&:before{
content: '';
width: 100%;
height: 1px;
position: absolute;
left: 0;
bottom: 0;
background-color: @border-color-base;
z-index: 1;
}
&:after{
content: '';
width: 1px;
height: 100%;
position: absolute;
top: 0;
right: 0;
background-color: @border-color-base;
2016-11-27 20:43:54 +08:00
z-index: 3;
2016-11-25 15:47:28 +08:00
}
2016-11-24 17:32:43 +08:00
&-with-header{
2016-12-02 15:15:54 +08:00
//border-radius: @border-radius-base @border-radius-base 0 0;
2016-11-24 17:32:43 +08:00
}
&-with-footer{
2016-12-02 15:15:54 +08:00
//border: 1px solid @border-color-base;
//border-radius: 0 0 @border-radius-base @border-radius-base;
2016-11-24 17:32:43 +08:00
}
&-with-header&-with-footer{
2016-12-02 15:15:54 +08:00
//border-radius: @border-radius-base;
2016-11-24 17:32:43 +08:00
}
&-title, &-footer{
height: 48px;
line-height: 48px;
border-bottom: 1px solid @border-color-split;
}
&-footer{
border-bottom: none;
}
2016-11-25 17:01:27 +08:00
&-header{
overflow: hidden;
}
2016-11-24 17:32:43 +08:00
&-body{
2016-11-25 15:47:28 +08:00
overflow: auto;
2016-12-13 11:45:16 +08:00
//position: relative;
2016-11-24 17:32:43 +08:00
}
&-with-fixed-top&-with-footer{
.@{table-prefix-cls}-footer{
border-top: 1px solid @border-color-base;
}
tbody tr:last-child td{
border-bottom: none;
}
}
2016-11-24 15:27:46 +08:00
th, td
{
min-width: 0;
height: 48px;
box-sizing: border-box;
text-align: left;
text-overflow: ellipsis;
vertical-align: middle;
2016-11-28 21:30:59 +08:00
//position: relative;
2016-11-24 15:27:46 +08:00
border-bottom: 1px solid @border-color-split;
}
2016-11-24 15:27:46 +08:00
th {
height: 40px;
white-space: nowrap;
overflow: hidden;
2016-11-24 15:27:46 +08:00
background-color: @table-thead-bg;
}
td{
background-color: #fff;
transition: background-color @transition-time @ease-in-out;
}
2016-11-24 15:27:46 +08:00
th&-column,
td&-column
{
2016-11-24 15:27:46 +08:00
&-left{
text-align: left;
}
&-center{
text-align: center;
}
&-right{
text-align: right;
}
}
& table{
2016-11-25 15:47:28 +08:00
//width: 100%;
table-layout: fixed;
2016-11-24 15:27:46 +08:00
}
&-border{
th,td{
border-right: 1px solid @border-color-split;
}
}
&-cell{
padding-left: 18px;
padding-right: 18px;
overflow: hidden;
text-overflow: ellipsis;
2016-11-24 15:27:46 +08:00
white-space: normal;
word-break: break-all;
box-sizing: border-box;
&-ellipsis {
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
2016-11-24 15:27:46 +08:00
}
2016-11-25 22:51:50 +08:00
&-hidden{
visibility: hidden;
}
2016-11-24 15:27:46 +08:00
th &-cell{
display: inline-block;
2016-11-28 21:30:59 +08:00
//position: relative;
2016-11-24 15:27:46 +08:00
word-wrap: normal;
vertical-align: middle;
}
2016-11-27 20:43:54 +08:00
&-stripe &-body,
&-stripe &-fixed-body
{
2016-11-24 15:27:46 +08:00
tr:nth-child(2n) {
td{
background-color: @table-td-stripe-bg;
}
}
}
2016-11-25 08:50:06 +08:00
tr&-row-hover{
2016-11-24 15:27:46 +08:00
td{
background-color: @table-td-hover-bg;
}
}
&-large {
font-size: @font-size-base;
th{
height: 48px;
}
td{
height: 60px;
}
2016-11-24 17:32:43 +08:00
&-title, &-footer{
height: 60px;
line-height: 60px;
}
2016-11-24 15:27:46 +08:00
}
&-small{
th{
height: 32px;
}
td{
height: 40px;
}
2016-11-24 17:32:43 +08:00
&-title, &-footer{
height: 40px;
line-height: 40px;
}
2016-11-24 15:27:46 +08:00
}
&-row-highlight,
2016-11-25 08:50:06 +08:00
tr&-row-highlight&-row-hover,
2016-11-27 20:43:54 +08:00
&-stripe &-body tr&-row-highlight:nth-child(2n),
&-stripe &-fixed-body tr&-row-highlight:nth-child(2n)
2016-11-24 15:27:46 +08:00
{
td{
background-color: @table-td-highlight-bg;
}
}
2016-11-26 08:57:09 +08:00
&-fixed, &-fixed-right{
position: absolute;
top: 0;
left: 0;
2016-11-29 18:42:34 +08:00
box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.2);
2016-11-26 08:57:09 +08:00
&::before {
content: '';
width: 100%;
height: 1px;
background-color: @border-color-base;
position: absolute;
left: 0;
bottom: 0;
z-index: 4;
}
}
&-fixed-right{
top: 0;
left: auto;
right: 0;
2016-11-29 18:42:34 +08:00
box-shadow: -2px 0 6px -2px rgba(0, 0, 0, 0.2);
2016-11-26 08:57:09 +08:00
}
2016-11-27 20:43:54 +08:00
&-fixed-header{
overflow: hidden;
}
&-fixed-body{
overflow: hidden;
position: relative;
z-index: 3;
}
2016-11-27 22:56:05 +08:00
2016-11-29 18:42:34 +08:00
&-fixed-shadow {
width: 1px;
height: 100%;
position: absolute;
top: 0;
right: 0;
box-shadow: @shadow-right;
overflow: hidden;
z-index: 1;
}
2016-11-27 22:56:05 +08:00
&-sort{
.sortable();
}
2016-11-28 21:30:59 +08:00
&-filter{
display: inline-block;
cursor: pointer;
position: relative;
i{
color: @btn-disable-color;
transition: color @transition-time @ease-in-out;
&:hover{
color: inherit;
}
2016-11-29 08:43:47 +08:00
&.on{
color: @primary-color;
}
}
&-list{
padding: 8px 0 0;
&-item{
padding: 0 12px 8px;
.ivu-checkbox-wrapper + .ivu-checkbox-wrapper{
margin: 0;
}
label {
display: block;
margin-bottom: 4px;
& > span{
margin-right: 4px;
}
}
}
2016-11-29 11:04:48 +08:00
ul{
padding-bottom: 8px;
}
.select-item(@table-prefix-cls, @table-select-item-prefix-cls);
2016-11-29 08:43:47 +08:00
}
&-footer{
padding: 4px;
border-top: 1px solid @border-color-split;
2016-11-28 21:30:59 +08:00
}
}
.ivu-poptip-popper{
min-width: 0;
text-align: left;
2016-11-29 08:43:47 +08:00
.ivu-poptip-body{
padding: 0;
}
2016-11-28 21:30:59 +08:00
}
}