mirror of https://github.com/ElemeFE/element
Table: add chalk theme (#7059)
* Table: add chalk theme * Table: add group header & other * Table: del package.lock * Table: del single test trace * Table: fix border problem * Table: fix boder problem * Table: clean css * Table: footer border right - -|pull/7169/head
parent
cb1d6bebe4
commit
1ba90b9534
|
@ -561,7 +561,6 @@ When there are too many rows, you can use a fixed header.
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
height="250"
|
height="250"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="date"
|
prop="date"
|
||||||
|
@ -629,7 +628,6 @@ When there are too many columns, you can fix some of them.
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
fixed
|
fixed
|
||||||
|
@ -732,7 +730,6 @@ When you have huge chunks of data to put in a table, you can fix the header and
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
border
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
height="250">
|
height="250">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -839,7 +836,6 @@ When the the data is dynamically changed, you might want the table to have a max
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData4"
|
:data="tableData4"
|
||||||
border
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
max-height="250">
|
max-height="250">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -964,7 +960,6 @@ When the data structure is complex, you can use group header to show the data hi
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="date"
|
prop="date"
|
||||||
|
@ -1150,7 +1145,6 @@ You can also select multiple rows.
|
||||||
<el-table
|
<el-table
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
border
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -1244,7 +1238,6 @@ Sort the data to find or compare data quickly.
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
:default-sort = "{prop: 'date', order: 'descending'}"
|
:default-sort = "{prop: 'date', order: 'descending'}"
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -1308,7 +1301,6 @@ Filter the table to find desired data.
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="date"
|
prop="date"
|
||||||
|
@ -1390,7 +1382,6 @@ Customize table column so it can be integrated with other components.
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="Date"
|
label="Date"
|
||||||
|
|
|
@ -769,7 +769,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
border
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
height="250">
|
height="250">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -876,7 +875,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData4"
|
:data="tableData4"
|
||||||
border
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
max-height="250">
|
max-height="250">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -1001,7 +999,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="date"
|
prop="date"
|
||||||
|
@ -1187,7 +1184,6 @@
|
||||||
<el-table
|
<el-table
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
:data="tableData3"
|
:data="tableData3"
|
||||||
border
|
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
|
@ -1282,7 +1278,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:default-sort = "{prop: 'date', order: 'descending'}"
|
:default-sort = "{prop: 'date', order: 'descending'}"
|
||||||
>
|
>
|
||||||
|
@ -1348,7 +1343,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="date"
|
prop="date"
|
||||||
|
@ -1430,7 +1424,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="日期"
|
label="日期"
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<tbody>
|
<tbody class={ [{ 'has-gutter': this.hasGutter }] }>
|
||||||
<tr>
|
<tr>
|
||||||
{
|
{
|
||||||
this._l(this.columns, (column, cellIndex) =>
|
this._l(this.columns, (column, cellIndex) =>
|
||||||
|
@ -70,7 +70,7 @@ export default {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
!this.fixed && this.layout.gutterWidth
|
this.hasGutter
|
||||||
? <td class="gutter" style={{ width: this.layout.scrollY ? this.layout.gutterWidth + 'px' : '0' }}></td>
|
? <td class="gutter" style={{ width: this.layout.scrollY ? this.layout.gutterWidth + 'px' : '0' }}></td>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,10 @@ export default {
|
||||||
|
|
||||||
columns() {
|
columns() {
|
||||||
return this.store.states.columns;
|
return this.store.states.columns;
|
||||||
|
},
|
||||||
|
|
||||||
|
hasGutter() {
|
||||||
|
return !this.fixed && this.layout.gutterWidth;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,9 @@ export default {
|
||||||
render(h) {
|
render(h) {
|
||||||
const originColumns = this.store.states.originColumns;
|
const originColumns = this.store.states.originColumns;
|
||||||
const columnRows = convertToRows(originColumns, this.columns);
|
const columnRows = convertToRows(originColumns, this.columns);
|
||||||
|
// 是否拥有多级表头
|
||||||
|
const isGroup = columnRows.length > 1;
|
||||||
|
if (isGroup) this.$parent.isGroup = true;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<table
|
<table
|
||||||
|
@ -89,7 +92,7 @@ export default {
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead class={ [{ 'is-group': isGroup, 'has-gutter': this.hasGutter }] }>
|
||||||
{
|
{
|
||||||
this._l(columnRows, (columns, rowIndex) =>
|
this._l(columnRows, (columns, rowIndex) =>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -112,8 +115,12 @@ export default {
|
||||||
{
|
{
|
||||||
column.sortable
|
column.sortable
|
||||||
? <span class="caret-wrapper" on-click={ ($event) => this.handleSortClick($event, column) }>
|
? <span class="caret-wrapper" on-click={ ($event) => this.handleSortClick($event, column) }>
|
||||||
<i class="sort-caret ascending" on-click={ ($event) => this.handleSortClick($event, column, 'ascending') }></i>
|
<span class="sort-caret ascending" on-click={ ($event) => this.handleSortClick($event, column, 'ascending') }>
|
||||||
<i class="sort-caret descending" on-click={ ($event) => this.handleSortClick($event, column, 'descending') }></i>
|
<i class="el-icon-sort-up"></i>
|
||||||
|
</span>
|
||||||
|
<span class="sort-caret descending" on-click={ ($event) => this.handleSortClick($event, column, 'descending') }>
|
||||||
|
<i class="el-icon-sort-down"></i>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
@ -127,7 +134,7 @@ export default {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
!this.fixed && this.layout.gutterWidth
|
this.hasGutter
|
||||||
? <th class="gutter" style={{ width: this.layout.scrollY ? this.layout.gutterWidth + 'px' : '0' }}></th>
|
? <th class="gutter" style={{ width: this.layout.scrollY ? this.layout.gutterWidth + 'px' : '0' }}></th>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
@ -183,6 +190,10 @@ export default {
|
||||||
|
|
||||||
columns() {
|
columns() {
|
||||||
return this.store.states.columns;
|
return this.store.states.columns;
|
||||||
|
},
|
||||||
|
|
||||||
|
hasGutter() {
|
||||||
|
return !this.fixed && this.layout.gutterWidth;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
:class="{
|
:class="{
|
||||||
'el-table--fit': fit,
|
'el-table--fit': fit,
|
||||||
'el-table--striped': stripe,
|
'el-table--striped': stripe,
|
||||||
'el-table--border': border,
|
'el-table--border': border || isGroup,
|
||||||
'el-table--hidden': isHidden,
|
'el-table--hidden': isHidden,
|
||||||
|
'el-table--group': isGroup,
|
||||||
'el-table--fluid-height': maxHeight,
|
'el-table--fluid-height': maxHeight,
|
||||||
'el-table--enable-row-hover': !store.states.isComplex,
|
'el-table--enable-row-hover': !store.states.isComplex,
|
||||||
'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
|
'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
<div
|
<div
|
||||||
class="el-table__body-wrapper"
|
class="el-table__body-wrapper"
|
||||||
ref="bodyWrapper"
|
ref="bodyWrapper"
|
||||||
|
:class="[`is-scroll-${scrollPosition}`]"
|
||||||
:style="[bodyHeight]">
|
:style="[bodyHeight]">
|
||||||
<table-body
|
<table-body
|
||||||
:context="context"
|
:context="context"
|
||||||
|
@ -63,7 +65,9 @@
|
||||||
:layout="layout"
|
:layout="layout"
|
||||||
:style="{ width: layout.fixedWidth ? layout.fixedWidth + 'px' : '' }"></table-header>
|
:style="{ width: layout.fixedWidth ? layout.fixedWidth + 'px' : '' }"></table-header>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table__fixed-body-wrapper" ref="fixedBodyWrapper"
|
<div
|
||||||
|
class="el-table__fixed-body-wrapper"
|
||||||
|
ref="fixedBodyWrapper"
|
||||||
:style="[
|
:style="[
|
||||||
{ top: layout.headerHeight + 'px' },
|
{ top: layout.headerHeight + 'px' },
|
||||||
fixedBodyHeight
|
fixedBodyHeight
|
||||||
|
@ -94,7 +98,7 @@
|
||||||
v-if="rightFixedColumns.length > 0"
|
v-if="rightFixedColumns.length > 0"
|
||||||
:style="[
|
:style="[
|
||||||
{ width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '' },
|
{ width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '' },
|
||||||
{ right: layout.scrollY ? (border ? layout.gutterWidth : (layout.gutterWidth || 1)) + 'px' : '' },
|
{ right: layout.scrollY ? (border ? layout.gutterWidth : (layout.gutterWidth || 0)) + 'px' : '' },
|
||||||
fixedHeight
|
fixedHeight
|
||||||
]">
|
]">
|
||||||
<div class="el-table__fixed-header-wrapper" ref="rightFixedHeaderWrapper" v-if="showHeader">
|
<div class="el-table__fixed-header-wrapper" ref="rightFixedHeaderWrapper" v-if="showHeader">
|
||||||
|
@ -249,11 +253,21 @@
|
||||||
bindEvents() {
|
bindEvents() {
|
||||||
const { headerWrapper, footerWrapper } = this.$refs;
|
const { headerWrapper, footerWrapper } = this.$refs;
|
||||||
const refs = this.$refs;
|
const refs = this.$refs;
|
||||||
|
let self = this;
|
||||||
this.bodyWrapper.addEventListener('scroll', function() {
|
this.bodyWrapper.addEventListener('scroll', function() {
|
||||||
if (headerWrapper) headerWrapper.scrollLeft = this.scrollLeft;
|
if (headerWrapper) headerWrapper.scrollLeft = this.scrollLeft;
|
||||||
if (footerWrapper) footerWrapper.scrollLeft = this.scrollLeft;
|
if (footerWrapper) footerWrapper.scrollLeft = this.scrollLeft;
|
||||||
if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
|
if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
|
||||||
if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
|
if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
|
||||||
|
const maxScrollLeftPosition = this.scrollWidth - this.offsetWidth - 1;
|
||||||
|
const scrollLeft = this.scrollLeft;
|
||||||
|
if (scrollLeft >= maxScrollLeftPosition) {
|
||||||
|
self.scrollPosition = 'right';
|
||||||
|
} else if (scrollLeft === 0) {
|
||||||
|
self.scrollPosition = 'left';
|
||||||
|
} else {
|
||||||
|
self.scrollPosition = 'middle';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const scrollBodyWrapper = event => {
|
const scrollBodyWrapper = event => {
|
||||||
|
@ -459,7 +473,10 @@
|
||||||
layout,
|
layout,
|
||||||
isHidden: false,
|
isHidden: false,
|
||||||
renderExpanded: null,
|
renderExpanded: null,
|
||||||
resizeProxyVisible: false
|
resizeProxyVisible: false,
|
||||||
|
// 是否拥有多级表头
|
||||||
|
isGroup: false,
|
||||||
|
scrollPosition: 'left'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -467,13 +467,14 @@ $--dialog-padding-primary: 15px;
|
||||||
|
|
||||||
/* Table
|
/* Table
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
$--table-border-color: $--border-color-lighter;
|
$--table-border: 1px solid $--border-color-lighter;
|
||||||
$--table-text-color: $--color-text-regular;
|
$--table-text-color: $--color-text-regular;
|
||||||
$--table-header-color: $--color-text-secondary;
|
$--table-header-color: $--color-text-secondary;
|
||||||
$--table-row-hover-background: $--background-color-base;
|
$--table-row-hover-background: $--background-color-base;
|
||||||
$--table-current-row-background: $--background-color-base;
|
$--table-current-row-background: $--color-primary-light-9;
|
||||||
$--table-header-background: $--color-text-secondary;
|
$--table-header-background: $--color-text-secondary;
|
||||||
$--table-footer-background: $--color-text-placeholder;
|
$--table-footer-background: $--color-text-placeholder;
|
||||||
|
$--table-fixed-box-shadow: 0 0 10px rgba(0, 0, 0, .12);
|
||||||
|
|
||||||
/* Pagination
|
/* Pagination
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'element-icons';
|
font-family: 'element-icons';
|
||||||
src: url('fonts/element-icons.woff?t=1504667669908') format('woff'), /* chrome, firefox */
|
src: url('fonts/element-icons.woff?t=1505459769526') format('woff'), /* chrome, firefox */
|
||||||
url('fonts/element-icons.ttf?t=1504667669908') format('truetype'); /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
url('fonts/element-icons.ttf?t=1505459769526') format('truetype'); /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal
|
||||||
}
|
}
|
||||||
|
|
||||||
[class^="el-icon-"], [class*=" el-icon-"] {
|
[class^="el-icon-"], [class*=" el-icon-"] {
|
||||||
|
@ -70,6 +70,8 @@
|
||||||
.el-icon-error:before { content: "\e62c"; }
|
.el-icon-error:before { content: "\e62c"; }
|
||||||
.el-icon-success:before { content: "\e62d"; }
|
.el-icon-success:before { content: "\e62d"; }
|
||||||
.el-icon-warning:before { content: "\e62e"; }
|
.el-icon-warning:before { content: "\e62e"; }
|
||||||
|
.el-icon-sort-down:before { content: "\e630"; }
|
||||||
|
.el-icon-sort-up:before { content: "\e631"; }
|
||||||
|
|
||||||
.el-icon-loading {
|
.el-icon-loading {
|
||||||
animation: rotating 1s linear infinite;
|
animation: rotating 1s linear infinite;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
@mixin scroll-bar {
|
@mixin scroll-bar {
|
||||||
$--scrollbar-thumb-background: #b4bccc;
|
$--scrollbar-thumb-background: #b4bccc;
|
||||||
$--scrollbar-track-background: #edeff5;
|
$--scrollbar-track-background: #fff;
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
z-index: 11;
|
z-index: 11;
|
||||||
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
&-thumb {
|
&-thumb {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
width: 6px;
|
||||||
background: $--scrollbar-thumb-background;
|
background: $--scrollbar-thumb-background;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +40,11 @@
|
||||||
|
|
||||||
&-track {
|
&-track {
|
||||||
background: $--scrollbar-track-background;
|
background: $--scrollbar-track-background;
|
||||||
|
|
||||||
|
&-piece {
|
||||||
|
background: $--scrollbar-track-background;
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@include b(table-filter) {
|
@include b(table-filter) {
|
||||||
border: solid 1px $--color-black;
|
border: solid 1px $--border-color-lighter;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
background-color: $--color-white;
|
background-color: $--color-white;
|
||||||
box-shadow: $--dropdown-menu-box-shadow;
|
box-shadow: $--dropdown-menu-box-shadow;
|
||||||
|
@ -50,15 +50,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e(bottom) {
|
@include e(bottom) {
|
||||||
border-top: 1px solid $--color-black;
|
border-top: 1px solid $--border-color-lighter;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
color: $--color-black;
|
color: $--color-text-regular;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: $--font-size-base;
|
font-size: $--font-size-small;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.is-disabled {
|
&.is-disabled {
|
||||||
color: $--color-black;
|
color: $--disabled-color-base;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,37 +10,10 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-color: $--color-white;
|
background-color: $--color-white;
|
||||||
border: 1px solid $--table-border-color;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: $--table-text-color;
|
color: $--table-text-color;
|
||||||
|
|
||||||
&::before {
|
// 数据为空
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
background-color: $--table-border-color;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
width: 1px;
|
|
||||||
height: 100%;
|
|
||||||
background-color: $--table-border-color;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tooltip.cell {
|
|
||||||
white-space: nowrap;
|
|
||||||
min-width: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include e(empty-block) {
|
@include e(empty-block) {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 60px;
|
min-height: 60px;
|
||||||
|
@ -57,6 +30,7 @@
|
||||||
color: color($--color-primary s(16%) l(44%));
|
color: color($--color-primary s(16%) l(44%));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 展开行
|
||||||
@include e(expand-column) {
|
@include e(expand-column) {
|
||||||
.cell {
|
.cell {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -86,12 +60,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e(expanded-cell) {
|
@include e(expanded-cell) {
|
||||||
|
background-color: $--color-white;
|
||||||
|
|
||||||
|
// 纯属为了增加权重
|
||||||
|
&[class*=cell] {
|
||||||
padding: 20px 50px;
|
padding: 20px 50px;
|
||||||
background-color: $--color-black;
|
}
|
||||||
box-shadow: inset 0 2px 0 #f4f4f4;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: $--color-black !important;
|
background-color: $--table-row-hover-background !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,18 +76,24 @@
|
||||||
border-right: 0;
|
border-right: 0;
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
|
|
||||||
& th.gutter, td.gutter {
|
th.gutter, td.gutter {
|
||||||
border-right-width: 1px;
|
border-right-width: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& th {
|
thead {
|
||||||
white-space: nowrap;
|
color: $--table-header-color;
|
||||||
overflow: hidden;
|
font-weight: 500;
|
||||||
|
|
||||||
|
&.is-group {
|
||||||
|
th {
|
||||||
|
background: $--background-color-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& th, td {
|
th, td {
|
||||||
height: 40px;
|
padding: 12px 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -128,35 +111,43 @@
|
||||||
@include when(right) {
|
@include when(right) {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.gutter {
|
||||||
|
width: 15px;
|
||||||
|
border-right-width: 0;
|
||||||
|
border-bottom-width: 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
& th.is-leaf, td {
|
&.is-hidden {
|
||||||
border-bottom: 1px solid $--table-border-color;
|
> * {
|
||||||
}
|
|
||||||
|
|
||||||
@include m(border) {
|
|
||||||
& th, td {
|
|
||||||
border-right: 1px solid $--table-border-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
& th {
|
|
||||||
border-bottom: 1px solid $--table-border-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include m(hidden) {
|
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
& th {
|
|
||||||
background-color: $--table-header-background;
|
|
||||||
text-align: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
& th > div {
|
tr {
|
||||||
|
background-color: $--color-white;
|
||||||
|
|
||||||
|
input[type="checkbox"] {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
th.is-leaf, td {
|
||||||
|
border-bottom: $--table-border;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
user-select: none;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
div {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-left: 18px;
|
padding-left: 10px;
|
||||||
padding-right: 18px;
|
padding-right: 10px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -164,16 +155,123 @@
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
& td > div {
|
> .cell {
|
||||||
|
position: relative;
|
||||||
|
word-wrap: normal;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&.highlight {
|
||||||
|
color: $--color-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.required > div::before {
|
||||||
|
display: inline-block;
|
||||||
|
content: "";
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #ff4d51;
|
||||||
|
margin-right: 5px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
div {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.gutter {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell {
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: normal;
|
||||||
|
word-break: break-all;
|
||||||
|
line-height: 23px;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
|
||||||
|
&.el-tooltip {
|
||||||
|
white-space: nowrap;
|
||||||
|
min-width: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拥有多级表头
|
||||||
|
@include m((group, border)) {
|
||||||
|
border: $--table-border;
|
||||||
|
|
||||||
|
@include share-rule(border-pseudo) {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
background-color: $--border-color-lighter;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表格右部伪 border
|
||||||
|
&::after {
|
||||||
|
@include extend-rule(border-pseudo);
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 1px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表格底部伪 border,总是有的
|
||||||
|
&::before {
|
||||||
|
@include extend-rule(border-pseudo);
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// table--border
|
||||||
|
@include m(border) {
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: none;
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
border-right: $--table-border;
|
||||||
|
}
|
||||||
|
|
||||||
|
.has-gutter {
|
||||||
|
th:nth-last-of-type(2), td:nth-last-of-type(2) {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
th.gutter:last-of-type {
|
||||||
|
border-bottom: $--table-border;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
& th {
|
||||||
|
border-bottom: $--table-border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include m(hidden) {
|
||||||
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e((fixed, fixed-right)) {
|
@include e((fixed, fixed-right)) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
box-shadow: 1px 0 8px #d3d4d6;
|
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
box-shadow: $--table-fixed-box-shadow;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: '';
|
content: '';
|
||||||
|
@ -182,7 +280,7 @@
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background-color: $--table-border-color;
|
background-color: $--border-color-lighter;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,8 +289,8 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -1px;
|
top: -1px;
|
||||||
right: 0;
|
right: 0;
|
||||||
background-color: $--table-header-background;
|
background-color: $--color-white;
|
||||||
border-bottom: 1px solid $--table-border-color;
|
border-bottom: $--table-border;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e(fixed-right) {
|
@include e(fixed-right) {
|
||||||
|
@ -200,8 +298,6 @@
|
||||||
left: auto;
|
left: auto;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
||||||
box-shadow: -1px 0 8px #d3d4d6;
|
|
||||||
|
|
||||||
.el-table__fixed-header-wrapper,
|
.el-table__fixed-header-wrapper,
|
||||||
.el-table__fixed-body-wrapper,
|
.el-table__fixed-body-wrapper,
|
||||||
.el-table__fixed-footer-wrapper {
|
.el-table__fixed-footer-wrapper {
|
||||||
|
@ -215,11 +311,6 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|
||||||
& thead div {
|
|
||||||
background-color: $--table-header-background;
|
|
||||||
color: $--table-text-color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e(fixed-footer-wrapper) {
|
@include e(fixed-footer-wrapper) {
|
||||||
|
@ -229,8 +320,8 @@
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|
||||||
& tbody td {
|
& tbody td {
|
||||||
border-top: 1px solid $--table-border-color;
|
border-top: $--table-border;
|
||||||
background-color: $--table-footer-background;
|
background-color: $--table-row-hover-background;
|
||||||
color: $--table-text-color;
|
color: $--table-text-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,7 +341,7 @@
|
||||||
@include e(footer-wrapper) {
|
@include e(footer-wrapper) {
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
td {
|
td {
|
||||||
border-top: 1px solid $--table-border-color;
|
border-top: $--table-border;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,13 +352,8 @@
|
||||||
@include e((header-wrapper, footer-wrapper)) {
|
@include e((header-wrapper, footer-wrapper)) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
& thead div {
|
|
||||||
background-color: $--table-header-background;
|
|
||||||
color: $--table-text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
& tbody td {
|
& tbody td {
|
||||||
background-color: $--table-footer-background;
|
background-color: $--table-row-hover-background;
|
||||||
color: $--table-text-color;
|
color: $--table-text-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,115 +361,63 @@
|
||||||
@include e(body-wrapper) {
|
@include e(body-wrapper) {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@include when(scroll-left) {
|
||||||
|
~ .el-table__fixed {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& th.required > div::before {
|
@include when(scroll-right) {
|
||||||
display: inline-block;
|
~ .el-table__fixed-right {
|
||||||
content: "";
|
box-shadow: none;
|
||||||
width: 8px;
|
}
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #ff4d51;
|
|
||||||
margin-right: 5px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
& th > .cell {
|
.el-table--border {
|
||||||
position: relative;
|
@include when(scroll-right) {
|
||||||
word-wrap: normal;
|
~ .el-table__fixed-right {
|
||||||
text-overflow: ellipsis;
|
border-left: $--table-border;
|
||||||
display: inline-block;
|
}
|
||||||
line-height: 30px;
|
}
|
||||||
vertical-align: middle;
|
|
||||||
width: 100%;
|
@include when(scroll-left) {
|
||||||
box-sizing: border-box;
|
~ .el-table__fixed {
|
||||||
|
border-right: $--table-border;
|
||||||
&.highlight {
|
}
|
||||||
color: $--color-primary;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .caret-wrapper {
|
.caret-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 13px;
|
||||||
|
width: 24px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-top: -2px;
|
|
||||||
width: 16px;
|
|
||||||
height: 30px;
|
|
||||||
overflow: initial;
|
overflow: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
& .sort-caret {
|
.sort-caret {
|
||||||
display: inline-block;
|
color: $--icon-color-base;
|
||||||
width: 0;
|
width: 14px;
|
||||||
height: 0;
|
|
||||||
border: 0;
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 3px;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
&.ascending {
|
|
||||||
top: 9px;
|
|
||||||
border-top: none;
|
|
||||||
border-right: 5px solid transparent;
|
|
||||||
border-bottom: 5px solid $--color-black;
|
|
||||||
border-left: 5px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.descending {
|
|
||||||
bottom: 9px;
|
|
||||||
border-top: 5px solid $--color-black;
|
|
||||||
border-right: 5px solid transparent;
|
|
||||||
border-bottom: none;
|
|
||||||
border-left: 5px solid transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& .ascending .sort-caret.ascending {
|
|
||||||
border-bottom-color: $--color-black;
|
|
||||||
}
|
|
||||||
|
|
||||||
& .descending .sort-caret.descending {
|
|
||||||
border-top-color: $--color-black;
|
|
||||||
}
|
|
||||||
|
|
||||||
& th.gutter, td.gutter {
|
|
||||||
width: 15px;
|
|
||||||
border-right-width: 0;
|
|
||||||
border-bottom-width: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
& td.gutter {
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
& td.is-hidden, th.is-hidden {
|
|
||||||
> * {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& .cell {
|
|
||||||
box-sizing: border-box;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
font-size: 13px;
|
||||||
white-space: normal;
|
|
||||||
word-break: break-all;
|
|
||||||
line-height: 24px;
|
|
||||||
padding-left: 18px;
|
|
||||||
padding-right: 18px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
& tr input[type="checkbox"] {
|
.ascending .sort-caret.ascending {
|
||||||
margin: 0;
|
color: $--color-primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
& tr {
|
.descending .sort-caret.descending {
|
||||||
background-color: $--color-white;
|
color: $--color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden-columns {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include m(striped) {
|
@include m(striped) {
|
||||||
|
@ -391,11 +425,10 @@
|
||||||
& tr.el-table__row--striped {
|
& tr.el-table__row--striped {
|
||||||
td {
|
td {
|
||||||
background: #FAFAFA;
|
background: #FAFAFA;
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.current-row td {
|
&.current-row td {
|
||||||
background: color($--color-primary tint(92%));
|
background-color: $--table-current-row-background;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,14 +439,14 @@
|
||||||
&, &.el-table__row--striped {
|
&, &.el-table__row--striped {
|
||||||
&, &.current-row {
|
&, &.current-row {
|
||||||
> td {
|
> td {
|
||||||
background-color: $--color-black;
|
background-color: $--table-current-row-background;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.current-row > td {
|
tr.current-row > td {
|
||||||
background: color($--color-primary tint(92%));
|
background-color: $--table-current-row-background;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,24 +456,19 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
border-left: 1px solid $--table-border-color;
|
border-left: $--table-border;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
& .hidden-columns {
|
|
||||||
visibility: hidden;
|
|
||||||
position: absolute;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include e(column-filter-trigger) {
|
@include e(column-filter-trigger) {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
margin-left: 5px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
& i {
|
& i {
|
||||||
color: $--color-black;
|
color: $--color-info;
|
||||||
|
font-size: 12px;
|
||||||
|
transform: scale(.75);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,8 +480,7 @@
|
||||||
|
|
||||||
@include m(enable-row-hover) {
|
@include m(enable-row-hover) {
|
||||||
.el-table__body tr:hover > td {
|
.el-table__body tr:hover > td {
|
||||||
background-color: $--color-black;
|
background-color: $--table-row-hover-background;
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue