|
69 | 69 | </tr>
|
70 | 70 |
|
71 | 71 | <tr v-if="filterRow" class="c-table-sm">
|
72 |
| - <th v-if="indexColumn" class="c-pb-2"> |
73 |
| - <i |
| 72 | + <th v-if="indexColumn" class="c-pb-2 c-pl-2"> |
| 73 | + <CIcon |
74 | 74 | v-if="indexColumn !== 'noCleaner'"
|
75 |
| - class="cui-ban c-icons c-text-danger c-font-lg c-text-center c-d-block" |
76 |
| - @click="clear" |
| 75 | + width="18" |
| 76 | + name="ban" |
| 77 | + @click.native="clear" |
| 78 | + :class="isFiltered ? 'c-text-danger' : 'c-text-secondary'" |
77 | 79 | title="clear table"
|
78 |
| - ></i> |
| 80 | + /> |
79 | 81 | </th>
|
80 | 82 | <template v-for="(colName, index) in rawColumnNames" >
|
81 | 83 | <th :class="headerClass(index)">
|
|
145 | 147 | <slot name="empty-table">
|
146 | 148 | <div class="c-text-center c-my-5">
|
147 | 149 | <h2>{{ passedItems.length ? 'No filtering results ' : 'No items'}}
|
148 |
| - <i |
149 |
| - style="font-weight: 1000" |
150 |
| - class="c-text-danger c-icons c-font-2xl cui-ban" |
151 |
| - ></i> |
| 150 | + <CIcon |
| 151 | + width="30" |
| 152 | + name="ban" |
| 153 | + class="c-text-danger c-mb-2" |
| 154 | + /> |
152 | 155 | </h2>
|
153 | 156 | </div>
|
154 | 157 | </slot>
|
|
217 | 220 | import CSpinner from '../Spinner/CSpinner'
|
218 | 221 | import CPagination from '../Pagination/CPagination'
|
219 | 222 | import { CIcon as CIconRaw} from '@coreui/icons/vue'
|
220 |
| -import { arrowTop, arrowBottom } from '@coreui/icons' |
221 |
| -const CIcon = Object.assign({}, CIconRaw, { icons : { arrowTop, arrowBottom }}) |
| 223 | +import { arrowTop, ban } from '@coreui/icons' |
| 224 | +const CIcon = Object.assign({}, CIconRaw, { icons : { arrowTop, ban }}) |
222 | 225 |
|
223 | 226 | export default {
|
224 | 227 | name: 'CTable',
|
@@ -254,7 +257,7 @@ export default {
|
254 | 257 | optionsRow: [Boolean, String],
|
255 | 258 | footer: Boolean,
|
256 | 259 | defaultSorter: {
|
257 |
| - tyep: Array, |
| 260 | + type: Array, |
258 | 261 | default: () => []
|
259 | 262 | },
|
260 | 263 | defaultTableFilter: String,
|
@@ -360,7 +363,11 @@ export default {
|
360 | 363 | const size = this.small ? '1.4rem' : this.currentItems.length === 1 ? '2rem' : '3rem'
|
361 | 364 | return `width:${size};height:${size}`
|
362 | 365 | },
|
363 |
| -
|
| 366 | + isFiltered () { |
| 367 | + return this.tableFilter || Object.keys(this.columnFilter).filter(key => { |
| 368 | + return this.columnFilter[key] |
| 369 | + }).length |
| 370 | + } |
364 | 371 | },
|
365 | 372 | watch: {
|
366 | 373 | items (val, oldVal) {
|
|
0 commit comments