|
36 | 36 | <tr>
|
37 | 37 | <th v-if="indexCol" style="width:40px"></th>
|
38 | 38 | <template v-for="(name, index) in columnNames">
|
39 |
| - <th @click="changeSort(rawColumnNames[index], index)" |
40 |
| - :class="headerClass(index)" |
41 |
| - :style="headerStyles(index)" |
| 39 | + <th |
| 40 | + @click="changeSort(rawColumnNames[index], index)" |
| 41 | + :class="[headerClass(index), iconStyles]" |
| 42 | + :style="headerStyles(index)" |
42 | 43 | >
|
43 | 44 | <slot v-if="$slots[`${rawColumnNames[index]}-header`]"
|
44 | 45 | :name="`${rawColumnNames[index]}-header`"
|
45 | 46 | >
|
46 | 47 | </slot>
|
47 | 48 | <div v-else v-html="name" class="d-inline"></div>
|
48 |
| - <slot v-if="!noSorting && sortable(index)" name="sorting-icon" :state="getIconState(index)"> |
49 |
| - <i :class="iconClasses(index)"></i> |
| 49 | + <slot |
| 50 | + v-if="!noSorting && sortable(index)" |
| 51 | + name="sorting-icon" |
| 52 | + :state="getIconState(index)" |
| 53 | + > |
| 54 | + <i style="right:0px;" :class="iconClasses(index)"></i> |
50 | 55 | </slot>
|
51 | 56 | </th>
|
52 | 57 | </template>
|
53 | 58 | </tr>
|
54 | 59 | <tr v-if="filterRow" class="table-sm">
|
55 |
| - <th v-if="indexCol"class="pb-2 "> |
| 60 | + <th v-if="indexCol" class="pb-2"> |
56 | 61 | <i v-if="indexCol !== 'onlyIndexes'" class="cui-ban icons text-danger font-lg text-center d-block" @click="clear" title="clear table"></i>
|
57 | 62 | </th>
|
58 | 63 | <template v-for="(colName, index) in rawColumnNames" >
|
|
125 | 130 | </td>
|
126 | 131 | </tr>
|
127 | 132 | </tbody>
|
128 |
| - <tfoot v-if="footClone && currentItems.length > 3"> |
| 133 | + <tfoot v-if="footer && currentItems.length > 3"> |
129 | 134 | <tr>
|
130 | 135 | <th v-if="indexCol" style="width:40px"></th>
|
131 | 136 | <template v-for="(name, index) in columnNames">
|
132 | 137 | <th @click="changeSort(rawColumnNames[index], index)"
|
133 |
| - :class="headerClass(index)" |
| 138 | + :class="[headerClass(index), iconStyles]" |
134 | 139 | :style="headerStyles(index)"
|
135 | 140 | >
|
136 |
| - <slot :name="`${rawColumnNames[index]}-header`"> |
137 |
| - {{name}} |
138 |
| - </slot> |
139 |
| - <slot v-if="!noSorting && sortable(index)" name="sorting-icon" :state="getIconState(index)"> |
140 |
| - <i :class="iconClasses(index)"></i> |
141 |
| - </slot> |
| 141 | + <slot v-if="$slots[`${rawColumnNames[index]}-header`]" |
| 142 | + :name="`${rawColumnNames[index]}-header`" |
| 143 | + > |
| 144 | + </slot> |
| 145 | + <div v-else v-html="name" class="d-inline"></div> |
| 146 | + <slot |
| 147 | + v-if="!noSorting && sortable(index)" |
| 148 | + name="sorting-icon" |
| 149 | + :state="getIconState(index)" |
| 150 | + > |
| 151 | + <i style="right:0px;" :class="iconClasses(index)"></i> |
| 152 | + </slot> |
142 | 153 | </th>
|
143 | 154 | </template>
|
144 | 155 | </tr>
|
@@ -193,7 +204,7 @@ export default {
|
193 | 204 | border: Boolean,
|
194 | 205 | outlined: Boolean,
|
195 | 206 | optionsRow: [Boolean, String],
|
196 |
| - footClone: Boolean, |
| 207 | + footer: Boolean, |
197 | 208 | defaultSorter: {
|
198 | 209 | type: Object,
|
199 | 210 | default: () => ({ name:'', direction:''})
|
@@ -307,6 +318,9 @@ export default {
|
307 | 318 | const size = this.small ? '1.4rem' : this.currentItems.length === 1 ? '2rem' : '3rem'
|
308 | 319 | return `width:${size};height:${size}`
|
309 | 320 | },
|
| 321 | + iconStyles () { |
| 322 | + return !this.noSorting ? 'position-relative pr-4' : '' |
| 323 | + } |
310 | 324 | // loadingStyles () {
|
311 | 325 | // return !this.loading ? '' :
|
312 | 326 | // `opacity: .4; ${this.loading === 'noEvents' ? 'pointer-events:none' : ''}`
|
@@ -400,7 +414,7 @@ export default {
|
400 | 414 | },
|
401 | 415 | iconClasses (index) {
|
402 | 416 | const state = this.getIconState(index)
|
403 |
| - return [ 'icon-transition float-right icons font-xl cui-arrow-top', |
| 417 | + return [ 'icon-transition float-right icons font-xl cui-arrow-top position-absolute', |
404 | 418 | {
|
405 | 419 | 'transparent': !state,
|
406 | 420 | 'rotate-icon': state === 'desc'
|
|
0 commit comments