Skip to content

Commit 60514a1

Browse files
committed
fix: use svg CIcons instead of fonts, add filter cleaner modes
1 parent 7db1fc9 commit 60514a1

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/components/Table/CTable.vue

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@
6969
</tr>
7070

7171
<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
7474
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'"
7779
title="clear table"
78-
></i>
80+
/>
7981
</th>
8082
<template v-for="(colName, index) in rawColumnNames" >
8183
<th :class="headerClass(index)">
@@ -145,10 +147,11 @@
145147
<slot name="empty-table">
146148
<div class="c-text-center c-my-5">
147149
<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+
/>
152155
</h2>
153156
</div>
154157
</slot>
@@ -217,8 +220,8 @@
217220
import CSpinner from '../Spinner/CSpinner'
218221
import CPagination from '../Pagination/CPagination'
219222
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 }})
222225
223226
export default {
224227
name: 'CTable',
@@ -254,7 +257,7 @@ export default {
254257
optionsRow: [Boolean, String],
255258
footer: Boolean,
256259
defaultSorter: {
257-
tyep: Array,
260+
type: Array,
258261
default: () => []
259262
},
260263
defaultTableFilter: String,
@@ -360,7 +363,11 @@ export default {
360363
const size = this.small ? '1.4rem' : this.currentItems.length === 1 ? '2rem' : '3rem'
361364
return `width:${size};height:${size}`
362365
},
363-
366+
isFiltered () {
367+
return this.tableFilter || Object.keys(this.columnFilter).filter(key => {
368+
return this.columnFilter[key]
369+
}).length
370+
}
364371
},
365372
watch: {
366373
items (val, oldVal) {

0 commit comments

Comments
 (0)