70 lines
No EOL
1.5 KiB
JavaScript
70 lines
No EOL
1.5 KiB
JavaScript
import VIcon from '../../VIcon';
|
|
import VSimpleCheckbox from '../../VCheckbox/VSimpleCheckbox';
|
|
import ripple from '../../../directives/ripple';
|
|
import mixins from '../../../util/mixins';
|
|
export default mixins().extend({
|
|
// https://github.com/vuejs/vue/issues/6872
|
|
directives: {
|
|
ripple
|
|
},
|
|
props: {
|
|
headers: {
|
|
type: Array,
|
|
required: true
|
|
},
|
|
options: {
|
|
type: Object,
|
|
default: () => ({
|
|
page: 1,
|
|
itemsPerPage: 10,
|
|
sortBy: [],
|
|
sortDesc: [],
|
|
groupBy: [],
|
|
groupDesc: [],
|
|
multiSort: false,
|
|
mustSort: false
|
|
})
|
|
},
|
|
sortIcon: {
|
|
type: String,
|
|
default: '$vuetify.icons.sort'
|
|
},
|
|
everyItem: Boolean,
|
|
someItems: Boolean,
|
|
showGroupBy: Boolean,
|
|
singleSelect: Boolean,
|
|
disableSort: Boolean
|
|
},
|
|
methods: {
|
|
genSelectAll() {
|
|
const data = {
|
|
props: {
|
|
value: this.everyItem,
|
|
indeterminate: !this.everyItem && this.someItems
|
|
},
|
|
on: {
|
|
input: v => this.$emit('toggle-select-all', v)
|
|
}
|
|
};
|
|
|
|
if (this.$scopedSlots['data-table-select']) {
|
|
return this.$scopedSlots['data-table-select'](data);
|
|
}
|
|
|
|
return this.$createElement(VSimpleCheckbox, {
|
|
staticClass: 'v-data-table__checkbox',
|
|
...data
|
|
});
|
|
},
|
|
|
|
genSortIcon() {
|
|
return this.$createElement(VIcon, {
|
|
props: {
|
|
size: 18
|
|
}
|
|
}, [this.sortIcon]);
|
|
}
|
|
|
|
}
|
|
});
|
|
//# sourceMappingURL=header.js.map
|