vuetify 3.0.6 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_settings.scss +1 -0
- package/dist/_component-variables-labs.sass +1 -0
- package/dist/json/attributes.json +460 -12
- package/dist/json/importMap-labs.json +28 -0
- package/dist/json/importMap.json +60 -60
- package/dist/json/tags.json +154 -8
- package/dist/json/web-types.json +1522 -26
- package/dist/vuetify-labs.d.ts +875 -0
- package/dist/vuetify-labs.js +9748 -0
- package/dist/vuetify.css +36 -55
- package/dist/vuetify.d.ts +173 -196
- package/dist/vuetify.esm.js +190 -128
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +189 -127
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +788 -780
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.ts +3 -2
- package/lib/blueprints/md1.d.ts +3 -2
- package/lib/blueprints/md2.d.ts +3 -2
- package/lib/blueprints/md3.d.ts +3 -2
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
- package/lib/components/VAlert/index.d.ts +1 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs +8 -10
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.ts +3 -12
- package/lib/components/VAvatar/VAvatar.mjs +2 -1
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +23 -20
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs +21 -2
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/index.d.ts +4 -15
- package/lib/components/VColorPicker/VColorPicker.mjs +0 -1
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +8 -10
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.ts +3 -12
- package/lib/components/VDivider/VDivider.css +1 -1
- package/lib/components/VDivider/VDivider.sass +1 -0
- package/lib/components/VDivider/_variables.scss +2 -1
- package/lib/components/VIcon/VIcon.mjs +25 -20
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/index.d.ts +4 -8
- package/lib/components/VList/VListItem.css +0 -4
- package/lib/components/VList/VListItem.sass +12 -6
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +10 -2
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/index.d.ts +11 -3
- package/lib/components/VPagination/VPagination.mjs +12 -5
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +3 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.mjs +11 -8
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.mjs +11 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.ts +2 -2
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +12 -3
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.css +2 -0
- package/lib/components/VSlider/VSliderThumb.sass +2 -0
- package/lib/components/VTable/VTable.css +12 -29
- package/lib/components/VTable/VTable.mjs +3 -3
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +10 -17
- package/lib/components/VTable/_variables.scss +4 -2
- package/lib/components/index.d.ts +27 -51
- package/lib/composables/filter.mjs +18 -10
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/icons.mjs +12 -7
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +15 -13
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/fa-svg.d.ts +3 -2
- package/lib/iconsets/fa.d.ts +3 -2
- package/lib/iconsets/fa.mjs +2 -1
- package/lib/iconsets/fa.mjs.map +1 -1
- package/lib/iconsets/fa4.d.ts +3 -2
- package/lib/iconsets/fa4.mjs +2 -1
- package/lib/iconsets/fa4.mjs.map +1 -1
- package/lib/iconsets/md.d.ts +3 -2
- package/lib/iconsets/md.mjs +2 -1
- package/lib/iconsets/md.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.d.ts +3 -2
- package/lib/iconsets/mdi-svg.mjs +2 -1
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/iconsets/mdi.d.ts +3 -2
- package/lib/iconsets/mdi.mjs +2 -1
- package/lib/iconsets/mdi.mjs.map +1 -1
- package/lib/index.d.ts +19 -18
- package/lib/labs/VDataTable/VDataTable.css +119 -0
- package/lib/labs/VDataTable/VDataTable.mjs +146 -0
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTable.sass +106 -0
- package/lib/labs/VDataTable/VDataTableColumn.mjs +37 -0
- package/lib/labs/VDataTable/VDataTableColumn.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableFooter.css +22 -0
- package/lib/labs/VDataTable/VDataTableFooter.mjs +105 -0
- package/lib/labs/VDataTable/VDataTableFooter.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableFooter.sass +23 -0
- package/lib/labs/VDataTable/VDataTableGroupHeaderRow.mjs +88 -0
- package/lib/labs/VDataTable/VDataTableGroupHeaderRow.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableHeaders.mjs +143 -0
- package/lib/labs/VDataTable/VDataTableHeaders.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableRow.mjs +75 -0
- package/lib/labs/VDataTable/VDataTableRow.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableRows.mjs +87 -0
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableServer.mjs +124 -0
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +154 -0
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -0
- package/lib/labs/VDataTable/_variables.scss +6 -0
- package/lib/labs/VDataTable/composables/expand.mjs +51 -0
- package/lib/labs/VDataTable/composables/expand.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/group.mjs +124 -0
- package/lib/labs/VDataTable/composables/group.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/headers.mjs +152 -0
- package/lib/labs/VDataTable/composables/headers.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/items.mjs +30 -0
- package/lib/labs/VDataTable/composables/items.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/options.mjs +44 -0
- package/lib/labs/VDataTable/composables/options.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/paginate.mjs +62 -0
- package/lib/labs/VDataTable/composables/paginate.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/select.mjs +57 -0
- package/lib/labs/VDataTable/composables/select.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/sort.mjs +109 -0
- package/lib/labs/VDataTable/composables/sort.mjs.map +1 -0
- package/lib/labs/VDataTable/composables/virtual.mjs +77 -0
- package/lib/labs/VDataTable/composables/virtual.mjs.map +1 -0
- package/lib/labs/VDataTable/index.d.ts +705 -0
- package/lib/labs/VDataTable/index.mjs +6 -0
- package/lib/labs/VDataTable/index.mjs.map +1 -0
- package/lib/labs/VDataTable/types.mjs +2 -0
- package/lib/labs/VDataTable/types.mjs.map +1 -0
- package/lib/labs/VVirtualScroll/VVirtualScroll.css +11 -0
- package/lib/labs/VVirtualScroll/VVirtualScroll.mjs +118 -0
- package/lib/labs/VVirtualScroll/VVirtualScroll.mjs.map +1 -0
- package/lib/{components → labs}/VVirtualScroll/VVirtualScroll.sass +0 -5
- package/lib/labs/VVirtualScroll/VVirtualScrollItem.mjs +35 -0
- package/lib/labs/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -0
- package/lib/labs/VVirtualScroll/index.d.ts +154 -0
- package/lib/labs/VVirtualScroll/index.mjs +2 -0
- package/lib/labs/VVirtualScroll/index.mjs.map +1 -0
- package/lib/labs/components.d.ts +856 -0
- package/lib/labs/components.mjs +3 -0
- package/lib/labs/components.mjs.map +1 -0
- package/lib/labs/index.mjs +3 -0
- package/lib/labs/index.mjs.map +1 -0
- package/lib/util/defineComponent.mjs +4 -0
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs +0 -38
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +4 -2
- package/lib/components/VDataTable/MobileRow.mjs +0 -63
- package/lib/components/VDataTable/MobileRow.mjs.map +0 -1
- package/lib/components/VDataTable/Row.mjs +0 -57
- package/lib/components/VDataTable/Row.mjs.map +0 -1
- package/lib/components/VDataTable/RowGroup.mjs +0 -48
- package/lib/components/VDataTable/RowGroup.mjs.map +0 -1
- package/lib/components/VDataTable/VDataTable.mjs +0 -577
- package/lib/components/VDataTable/VDataTable.mjs.map +0 -1
- package/lib/components/VDataTable/VDataTable.sass +0 -98
- package/lib/components/VDataTable/VDataTableHeader.mjs +0 -42
- package/lib/components/VDataTable/VDataTableHeader.mjs.map +0 -1
- package/lib/components/VDataTable/VDataTableHeader.sass +0 -80
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs +0 -96
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +0 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs +0 -89
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +0 -1
- package/lib/components/VDataTable/VEditDialog.mjs +0 -127
- package/lib/components/VDataTable/VEditDialog.mjs.map +0 -1
- package/lib/components/VDataTable/VEditDialog.sass +0 -22
- package/lib/components/VDataTable/VVirtualTable.mjs +0 -132
- package/lib/components/VDataTable/VVirtualTable.mjs.map +0 -1
- package/lib/components/VDataTable/VVirtualTable.sass +0 -13
- package/lib/components/VDataTable/_variables.scss +0 -24
- package/lib/components/VDataTable/index.mjs +0 -21
- package/lib/components/VDataTable/index.mjs.map +0 -1
- package/lib/components/VDataTable/mixins/header.mjs +0 -71
- package/lib/components/VDataTable/mixins/header.mjs.map +0 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +0 -108
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +0 -1
- package/lib/components/VVirtualScroll/index.mjs +0 -4
- package/lib/components/VVirtualScroll/index.mjs.map +0 -1
|
@@ -1,577 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
import "./VDataTable.css";
|
|
5
|
-
|
|
6
|
-
// Types
|
|
7
|
-
// Components
|
|
8
|
-
import { VData } from "../VData/index.mjs";
|
|
9
|
-
import { VDataFooter, VDataIterator } from "../VDataIterator/index.mjs";
|
|
10
|
-
import VBtn from "../VBtn/index.mjs";
|
|
11
|
-
import VDataTableHeader from "./VDataTableHeader.mjs"; // import VVirtualTable from './VVirtualTable'
|
|
12
|
-
import VIcon from "../VIcon/index.mjs";
|
|
13
|
-
import Row from "./Row.mjs";
|
|
14
|
-
import RowGroup from "./RowGroup.mjs";
|
|
15
|
-
import VSimpleCheckbox from "../VCheckbox/VSimpleCheckbox.mjs";
|
|
16
|
-
import VSimpleTable from "./VSimpleTable.mjs";
|
|
17
|
-
import MobileRow from "./MobileRow.mjs"; // Mixins
|
|
18
|
-
import Loadable from "../../mixins/loadable.mjs"; // Directives
|
|
19
|
-
import ripple from "../../directives/ripple/index.mjs"; // Helpers
|
|
20
|
-
import mixins from "../../util/mixins.mjs";
|
|
21
|
-
import { deepEqual, getObjectValueByPath, getPrefixedScopedSlots, getSlot, defaultFilter, camelizeObjectKeys, getPropertyFromItem } from "../../util/helpers.mjs";
|
|
22
|
-
import { breaking } from "../../util/console.mjs";
|
|
23
|
-
import { mergeClasses } from "../../util/mergeData.mjs";
|
|
24
|
-
function filterFn(item, search, filter) {
|
|
25
|
-
return header => {
|
|
26
|
-
const value = getObjectValueByPath(item, header.value);
|
|
27
|
-
return header.filter ? header.filter(value, search, item) : filter(value, search, item);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function searchTableItems(items, search, headersWithCustomFilters, headersWithoutCustomFilters, customFilter) {
|
|
31
|
-
search = typeof search === 'string' ? search.trim() : null;
|
|
32
|
-
return items.filter(item => {
|
|
33
|
-
// Headers with custom filters are evaluated whether or not a search term has been provided.
|
|
34
|
-
// We need to match every filter to be included in the results.
|
|
35
|
-
const matchesColumnFilters = headersWithCustomFilters.every(filterFn(item, search, defaultFilter));
|
|
36
|
-
|
|
37
|
-
// Headers without custom filters are only filtered by the `search` property if it is defined.
|
|
38
|
-
// We only need a single column to match the search term to be included in the results.
|
|
39
|
-
const matchesSearchTerm = !search || headersWithoutCustomFilters.some(filterFn(item, search, customFilter));
|
|
40
|
-
return matchesColumnFilters && matchesSearchTerm;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* @vue/component */
|
|
45
|
-
export default mixins(VDataIterator, Loadable).extend({
|
|
46
|
-
name: 'v-data-table',
|
|
47
|
-
// https://github.com/vuejs/vue/issues/6872
|
|
48
|
-
directives: {
|
|
49
|
-
ripple
|
|
50
|
-
},
|
|
51
|
-
props: {
|
|
52
|
-
headers: {
|
|
53
|
-
type: Array,
|
|
54
|
-
default: () => []
|
|
55
|
-
},
|
|
56
|
-
showSelect: Boolean,
|
|
57
|
-
checkboxColor: String,
|
|
58
|
-
showExpand: Boolean,
|
|
59
|
-
showGroupBy: Boolean,
|
|
60
|
-
// TODO: Fix
|
|
61
|
-
// virtualRows: Boolean,
|
|
62
|
-
height: [Number, String],
|
|
63
|
-
hideDefaultHeader: Boolean,
|
|
64
|
-
caption: String,
|
|
65
|
-
dense: Boolean,
|
|
66
|
-
headerProps: Object,
|
|
67
|
-
calculateWidths: Boolean,
|
|
68
|
-
fixedHeader: Boolean,
|
|
69
|
-
headersLength: Number,
|
|
70
|
-
expandIcon: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: '$expand'
|
|
73
|
-
},
|
|
74
|
-
customFilter: {
|
|
75
|
-
type: Function,
|
|
76
|
-
default: defaultFilter
|
|
77
|
-
},
|
|
78
|
-
itemClass: {
|
|
79
|
-
type: [String, Function],
|
|
80
|
-
default: () => ''
|
|
81
|
-
},
|
|
82
|
-
loaderHeight: {
|
|
83
|
-
type: [Number, String],
|
|
84
|
-
default: 4
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
data() {
|
|
88
|
-
return {
|
|
89
|
-
internalGroupBy: [],
|
|
90
|
-
openCache: {},
|
|
91
|
-
widths: []
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
computed: {
|
|
95
|
-
computedHeaders() {
|
|
96
|
-
if (!this.headers) return [];
|
|
97
|
-
const headers = this.headers.filter(h => h.value === undefined || !this.internalGroupBy.find(v => v === h.value));
|
|
98
|
-
const defaultHeader = {
|
|
99
|
-
text: '',
|
|
100
|
-
sortable: false,
|
|
101
|
-
width: '1px'
|
|
102
|
-
};
|
|
103
|
-
if (this.showSelect) {
|
|
104
|
-
const index = headers.findIndex(h => h.value === 'data-table-select');
|
|
105
|
-
if (index < 0) headers.unshift({
|
|
106
|
-
...defaultHeader,
|
|
107
|
-
value: 'data-table-select'
|
|
108
|
-
});else headers.splice(index, 1, {
|
|
109
|
-
...defaultHeader,
|
|
110
|
-
...headers[index]
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
if (this.showExpand) {
|
|
114
|
-
const index = headers.findIndex(h => h.value === 'data-table-expand');
|
|
115
|
-
if (index < 0) headers.unshift({
|
|
116
|
-
...defaultHeader,
|
|
117
|
-
value: 'data-table-expand'
|
|
118
|
-
});else headers.splice(index, 1, {
|
|
119
|
-
...defaultHeader,
|
|
120
|
-
...headers[index]
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
return headers;
|
|
124
|
-
},
|
|
125
|
-
colspanAttrs() {
|
|
126
|
-
return this.isMobile ? undefined : {
|
|
127
|
-
colspan: this.headersLength || this.computedHeaders.length
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
columnSorters() {
|
|
131
|
-
return this.computedHeaders.reduce((acc, header) => {
|
|
132
|
-
if (header.sort) acc[header.value] = header.sort;
|
|
133
|
-
return acc;
|
|
134
|
-
}, {});
|
|
135
|
-
},
|
|
136
|
-
headersWithCustomFilters() {
|
|
137
|
-
return this.headers.filter(header => header.filter && (!header.hasOwnProperty('filterable') || header.filterable === true));
|
|
138
|
-
},
|
|
139
|
-
headersWithoutCustomFilters() {
|
|
140
|
-
return this.headers.filter(header => !header.filter && (!header.hasOwnProperty('filterable') || header.filterable === true));
|
|
141
|
-
},
|
|
142
|
-
sanitizedHeaderProps() {
|
|
143
|
-
return camelizeObjectKeys(this.headerProps);
|
|
144
|
-
},
|
|
145
|
-
computedItemsPerPage() {
|
|
146
|
-
const itemsPerPage = this.options && this.options.itemsPerPage ? this.options.itemsPerPage : this.itemsPerPage;
|
|
147
|
-
const itemsPerPageOptions = this.sanitizedFooterProps.itemsPerPageOptions;
|
|
148
|
-
if (itemsPerPageOptions && !itemsPerPageOptions.find(item => typeof item === 'number' ? item === itemsPerPage : item.value === itemsPerPage)) {
|
|
149
|
-
const firstOption = itemsPerPageOptions[0];
|
|
150
|
-
return typeof firstOption === 'object' ? firstOption.value : firstOption;
|
|
151
|
-
}
|
|
152
|
-
return itemsPerPage;
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
created() {
|
|
156
|
-
const breakingProps = [['sort-icon', 'header-props.sort-icon'], ['hide-headers', 'hide-default-header'], ['select-all', 'show-select']];
|
|
157
|
-
|
|
158
|
-
/* istanbul ignore next */
|
|
159
|
-
breakingProps.forEach(_ref => {
|
|
160
|
-
let [original, replacement] = _ref;
|
|
161
|
-
if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this);
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
mounted() {
|
|
165
|
-
// if ((!this.sortBy || !this.sortBy.length) && (!this.options.sortBy || !this.options.sortBy.length)) {
|
|
166
|
-
// const firstSortable = this.headers.find(h => !('sortable' in h) || !!h.sortable)
|
|
167
|
-
// if (firstSortable) this.updateOptions({ sortBy: [firstSortable.value], sortDesc: [false] })
|
|
168
|
-
// }
|
|
169
|
-
|
|
170
|
-
if (this.calculateWidths) {
|
|
171
|
-
window.addEventListener('resize', this.calcWidths);
|
|
172
|
-
this.calcWidths();
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
beforeDestroy() {
|
|
176
|
-
if (this.calculateWidths) {
|
|
177
|
-
window.removeEventListener('resize', this.calcWidths);
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
methods: {
|
|
181
|
-
calcWidths() {
|
|
182
|
-
this.widths = Array.from(this.$el.querySelectorAll('th')).map(e => e.clientWidth);
|
|
183
|
-
},
|
|
184
|
-
customFilterWithColumns(items, search) {
|
|
185
|
-
return searchTableItems(items, search, this.headersWithCustomFilters, this.headersWithoutCustomFilters, this.customFilter);
|
|
186
|
-
},
|
|
187
|
-
customSortWithHeaders(items, sortBy, sortDesc, locale) {
|
|
188
|
-
return this.customSort(items, sortBy, sortDesc, locale, this.columnSorters);
|
|
189
|
-
},
|
|
190
|
-
createItemProps(item, index) {
|
|
191
|
-
const props = VDataIterator.options.methods.createItemProps.call(this, item, index);
|
|
192
|
-
return Object.assign(props, {
|
|
193
|
-
headers: this.computedHeaders
|
|
194
|
-
});
|
|
195
|
-
},
|
|
196
|
-
genCaption(props) {
|
|
197
|
-
if (this.caption) return [this.$createElement('caption', [this.caption])];
|
|
198
|
-
return getSlot(this, 'caption', props, true);
|
|
199
|
-
},
|
|
200
|
-
genColgroup(props) {
|
|
201
|
-
return this.$createElement('colgroup', this.computedHeaders.map(header => {
|
|
202
|
-
return this.$createElement('col', {
|
|
203
|
-
class: {
|
|
204
|
-
divider: header.divider
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
}));
|
|
208
|
-
},
|
|
209
|
-
genLoading() {
|
|
210
|
-
const th = this.$createElement('th', {
|
|
211
|
-
staticClass: 'column',
|
|
212
|
-
attrs: this.colspanAttrs
|
|
213
|
-
}, [this.genProgress()]);
|
|
214
|
-
const tr = this.$createElement('tr', {
|
|
215
|
-
staticClass: 'v-data-table__progress'
|
|
216
|
-
}, [th]);
|
|
217
|
-
return this.$createElement('thead', [tr]);
|
|
218
|
-
},
|
|
219
|
-
genHeaders(props) {
|
|
220
|
-
const data = {
|
|
221
|
-
props: {
|
|
222
|
-
...this.sanitizedHeaderProps,
|
|
223
|
-
headers: this.computedHeaders,
|
|
224
|
-
options: props.options,
|
|
225
|
-
mobile: this.isMobile,
|
|
226
|
-
showGroupBy: this.showGroupBy,
|
|
227
|
-
checkboxColor: this.checkboxColor,
|
|
228
|
-
someItems: this.someItems,
|
|
229
|
-
everyItem: this.everyItem,
|
|
230
|
-
singleSelect: this.singleSelect,
|
|
231
|
-
disableSort: this.disableSort
|
|
232
|
-
},
|
|
233
|
-
on: {
|
|
234
|
-
sort: props.sort,
|
|
235
|
-
group: props.group,
|
|
236
|
-
'toggle-select-all': this.toggleSelectAll
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
// TODO: rename to 'head'? (thead, tbody, tfoot)
|
|
241
|
-
const children = [getSlot(this, 'header', {
|
|
242
|
-
...data,
|
|
243
|
-
isMobile: this.isMobile
|
|
244
|
-
})];
|
|
245
|
-
if (!this.hideDefaultHeader) {
|
|
246
|
-
const scopedSlots = getPrefixedScopedSlots('header.', this.$scopedSlots);
|
|
247
|
-
children.push(this.$createElement(VDataTableHeader, {
|
|
248
|
-
...data,
|
|
249
|
-
scopedSlots
|
|
250
|
-
}));
|
|
251
|
-
}
|
|
252
|
-
if (this.loading) children.push(this.genLoading());
|
|
253
|
-
return children;
|
|
254
|
-
},
|
|
255
|
-
genEmptyWrapper(content) {
|
|
256
|
-
return this.$createElement('tr', {
|
|
257
|
-
staticClass: 'v-data-table__empty-wrapper'
|
|
258
|
-
}, [this.$createElement('td', {
|
|
259
|
-
attrs: this.colspanAttrs
|
|
260
|
-
}, content)]);
|
|
261
|
-
},
|
|
262
|
-
genItems(items, props) {
|
|
263
|
-
const empty = this.genEmpty(props.originalItemsLength, props.pagination.itemsLength);
|
|
264
|
-
if (empty) return [empty];
|
|
265
|
-
return props.groupedItems ? this.genGroupedRows(props.groupedItems, props) : this.genRows(items, props);
|
|
266
|
-
},
|
|
267
|
-
genGroupedRows(groupedItems, props) {
|
|
268
|
-
return groupedItems.map(group => {
|
|
269
|
-
if (!this.openCache.hasOwnProperty(group.name)) this.$set(this.openCache, group.name, true);
|
|
270
|
-
if (this.$scopedSlots.group) {
|
|
271
|
-
return this.$scopedSlots.group({
|
|
272
|
-
group: group.name,
|
|
273
|
-
options: props.options,
|
|
274
|
-
isMobile: this.isMobile,
|
|
275
|
-
items: group.items,
|
|
276
|
-
headers: this.computedHeaders
|
|
277
|
-
});
|
|
278
|
-
} else {
|
|
279
|
-
return this.genDefaultGroupedRow(group.name, group.items, props);
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
},
|
|
283
|
-
genDefaultGroupedRow(group, items, props) {
|
|
284
|
-
const isOpen = !!this.openCache[group];
|
|
285
|
-
const children = [this.$createElement('template', {
|
|
286
|
-
slot: 'row.content'
|
|
287
|
-
}, this.genRows(items, props))];
|
|
288
|
-
const toggleFn = () => this.$set(this.openCache, group, !this.openCache[group]);
|
|
289
|
-
const removeFn = () => props.updateOptions({
|
|
290
|
-
groupBy: [],
|
|
291
|
-
groupDesc: []
|
|
292
|
-
});
|
|
293
|
-
if (this.$scopedSlots['group.header']) {
|
|
294
|
-
children.unshift(this.$createElement('template', {
|
|
295
|
-
slot: 'column.header'
|
|
296
|
-
}, [this.$scopedSlots['group.header']({
|
|
297
|
-
group,
|
|
298
|
-
groupBy: props.options.groupBy,
|
|
299
|
-
isMobile: this.isMobile,
|
|
300
|
-
items,
|
|
301
|
-
headers: this.computedHeaders,
|
|
302
|
-
isOpen,
|
|
303
|
-
toggle: toggleFn,
|
|
304
|
-
remove: removeFn
|
|
305
|
-
})]));
|
|
306
|
-
} else {
|
|
307
|
-
const toggle = this.$createElement(VBtn, {
|
|
308
|
-
staticClass: 'ma-0',
|
|
309
|
-
props: {
|
|
310
|
-
icon: true,
|
|
311
|
-
small: true
|
|
312
|
-
},
|
|
313
|
-
on: {
|
|
314
|
-
click: toggleFn
|
|
315
|
-
}
|
|
316
|
-
}, [this.$createElement(VIcon, [isOpen ? '$minus' : '$plus'])]);
|
|
317
|
-
const remove = this.$createElement(VBtn, {
|
|
318
|
-
staticClass: 'ma-0',
|
|
319
|
-
props: {
|
|
320
|
-
icon: true,
|
|
321
|
-
small: true
|
|
322
|
-
},
|
|
323
|
-
on: {
|
|
324
|
-
click: removeFn
|
|
325
|
-
}
|
|
326
|
-
}, [this.$createElement(VIcon, ['$close'])]);
|
|
327
|
-
const column = this.$createElement('td', {
|
|
328
|
-
staticClass: 'text-start',
|
|
329
|
-
attrs: this.colspanAttrs
|
|
330
|
-
}, [toggle, `${props.options.groupBy[0]}: ${group}`, remove]);
|
|
331
|
-
children.unshift(this.$createElement('template', {
|
|
332
|
-
slot: 'column.header'
|
|
333
|
-
}, [column]));
|
|
334
|
-
}
|
|
335
|
-
if (this.$scopedSlots['group.summary']) {
|
|
336
|
-
children.push(this.$createElement('template', {
|
|
337
|
-
slot: 'column.summary'
|
|
338
|
-
}, [this.$scopedSlots['group.summary']({
|
|
339
|
-
group,
|
|
340
|
-
groupBy: props.options.groupBy,
|
|
341
|
-
isMobile: this.isMobile,
|
|
342
|
-
items,
|
|
343
|
-
headers: this.computedHeaders,
|
|
344
|
-
isOpen,
|
|
345
|
-
toggle: toggleFn
|
|
346
|
-
})]));
|
|
347
|
-
}
|
|
348
|
-
return this.$createElement(RowGroup, {
|
|
349
|
-
key: group,
|
|
350
|
-
props: {
|
|
351
|
-
value: isOpen
|
|
352
|
-
}
|
|
353
|
-
}, children);
|
|
354
|
-
},
|
|
355
|
-
genRows(items, props) {
|
|
356
|
-
return this.$scopedSlots.item ? this.genScopedRows(items, props) : this.genDefaultRows(items, props);
|
|
357
|
-
},
|
|
358
|
-
genScopedRows(items, props) {
|
|
359
|
-
const rows = [];
|
|
360
|
-
for (let i = 0; i < items.length; i++) {
|
|
361
|
-
const item = items[i];
|
|
362
|
-
rows.push(this.$scopedSlots.item({
|
|
363
|
-
...this.createItemProps(item, i),
|
|
364
|
-
isMobile: this.isMobile
|
|
365
|
-
}));
|
|
366
|
-
if (this.isExpanded(item)) {
|
|
367
|
-
rows.push(this.$scopedSlots['expanded-item']({
|
|
368
|
-
headers: this.computedHeaders,
|
|
369
|
-
isMobile: this.isMobile,
|
|
370
|
-
index: i,
|
|
371
|
-
item
|
|
372
|
-
}));
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return rows;
|
|
376
|
-
},
|
|
377
|
-
genDefaultRows(items, props) {
|
|
378
|
-
return this.$scopedSlots['expanded-item'] ? items.map((item, index) => this.genDefaultExpandedRow(item, index)) : items.map((item, index) => this.genDefaultSimpleRow(item, index));
|
|
379
|
-
},
|
|
380
|
-
genDefaultExpandedRow(item, index) {
|
|
381
|
-
const isExpanded = this.isExpanded(item);
|
|
382
|
-
const classes = {
|
|
383
|
-
'v-data-table__expanded v-data-table__expanded__row': isExpanded
|
|
384
|
-
};
|
|
385
|
-
const headerRow = this.genDefaultSimpleRow(item, index, classes);
|
|
386
|
-
const expandedRow = this.$createElement('tr', {
|
|
387
|
-
staticClass: 'v-data-table__expanded v-data-table__expanded__content'
|
|
388
|
-
}, [this.$scopedSlots['expanded-item']({
|
|
389
|
-
headers: this.computedHeaders,
|
|
390
|
-
isMobile: this.isMobile,
|
|
391
|
-
item
|
|
392
|
-
})]);
|
|
393
|
-
return this.$createElement(RowGroup, {
|
|
394
|
-
props: {
|
|
395
|
-
value: isExpanded
|
|
396
|
-
}
|
|
397
|
-
}, [this.$createElement('template', {
|
|
398
|
-
slot: 'row.header'
|
|
399
|
-
}, [headerRow]), this.$createElement('template', {
|
|
400
|
-
slot: 'row.content'
|
|
401
|
-
}, [expandedRow])]);
|
|
402
|
-
},
|
|
403
|
-
genDefaultSimpleRow(item, index) {
|
|
404
|
-
let classes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
405
|
-
const scopedSlots = getPrefixedScopedSlots('item.', this.$scopedSlots);
|
|
406
|
-
const data = this.createItemProps(item, index);
|
|
407
|
-
if (this.showSelect) {
|
|
408
|
-
const slot = scopedSlots['data-table-select'];
|
|
409
|
-
scopedSlots['data-table-select'] = slot ? () => slot({
|
|
410
|
-
...data,
|
|
411
|
-
isMobile: this.isMobile
|
|
412
|
-
}) : () => this.$createElement(VSimpleCheckbox, {
|
|
413
|
-
staticClass: 'v-data-table__checkbox',
|
|
414
|
-
props: {
|
|
415
|
-
value: data.isSelected,
|
|
416
|
-
disabled: !this.isSelectable(item),
|
|
417
|
-
color: this.checkboxColor ?? ''
|
|
418
|
-
},
|
|
419
|
-
on: {
|
|
420
|
-
input: val => data.select(val)
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
if (this.showExpand) {
|
|
425
|
-
const slot = scopedSlots['data-table-expand'];
|
|
426
|
-
scopedSlots['data-table-expand'] = slot ? () => slot(data) : () => this.$createElement(VIcon, {
|
|
427
|
-
staticClass: 'v-data-table__expand-icon',
|
|
428
|
-
class: {
|
|
429
|
-
'v-data-table__expand-icon--active': data.isExpanded
|
|
430
|
-
},
|
|
431
|
-
on: {
|
|
432
|
-
click: e => {
|
|
433
|
-
e.stopPropagation();
|
|
434
|
-
data.expand(!data.isExpanded);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}, [this.expandIcon]);
|
|
438
|
-
}
|
|
439
|
-
return this.$createElement(this.isMobile ? MobileRow : Row, {
|
|
440
|
-
key: getObjectValueByPath(item, this.itemKey),
|
|
441
|
-
class: mergeClasses({
|
|
442
|
-
...classes,
|
|
443
|
-
'v-data-table__selected': data.isSelected
|
|
444
|
-
}, getPropertyFromItem(item, this.itemClass)),
|
|
445
|
-
props: {
|
|
446
|
-
headers: this.computedHeaders,
|
|
447
|
-
hideDefaultHeader: this.hideDefaultHeader,
|
|
448
|
-
index,
|
|
449
|
-
item,
|
|
450
|
-
rtl: this.$vuetify.rtl
|
|
451
|
-
},
|
|
452
|
-
scopedSlots,
|
|
453
|
-
on: {
|
|
454
|
-
// TODO: for click, the first argument should be the event, and the second argument should be data,
|
|
455
|
-
// but this is a breaking change so it's for v3
|
|
456
|
-
click: () => this.$emit('click:row', item, data),
|
|
457
|
-
contextmenu: event => this.$emit('contextmenu:row', event, data),
|
|
458
|
-
dblclick: event => this.$emit('dblclick:row', event, data)
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
},
|
|
462
|
-
genBody(props) {
|
|
463
|
-
const data = {
|
|
464
|
-
...props,
|
|
465
|
-
expand: this.expand,
|
|
466
|
-
headers: this.computedHeaders,
|
|
467
|
-
isExpanded: this.isExpanded,
|
|
468
|
-
isMobile: this.isMobile,
|
|
469
|
-
isSelected: this.isSelected,
|
|
470
|
-
select: this.select
|
|
471
|
-
};
|
|
472
|
-
if (this.$scopedSlots.body) {
|
|
473
|
-
return this.$scopedSlots.body(data);
|
|
474
|
-
}
|
|
475
|
-
return this.$createElement('tbody', [getSlot(this, 'body.prepend', data, true), this.genItems(props.items, props), getSlot(this, 'body.append', data, true)]);
|
|
476
|
-
},
|
|
477
|
-
genFoot(props) {
|
|
478
|
-
var _this$$scopedSlots$fo, _this$$scopedSlots;
|
|
479
|
-
return (_this$$scopedSlots$fo = (_this$$scopedSlots = this.$scopedSlots).foot) == null ? void 0 : _this$$scopedSlots$fo.call(_this$$scopedSlots, props);
|
|
480
|
-
},
|
|
481
|
-
genFooters(props) {
|
|
482
|
-
const data = {
|
|
483
|
-
props: {
|
|
484
|
-
options: props.options,
|
|
485
|
-
pagination: props.pagination,
|
|
486
|
-
itemsPerPageText: '$vuetify.dataTable.itemsPerPageText',
|
|
487
|
-
...this.sanitizedFooterProps
|
|
488
|
-
},
|
|
489
|
-
on: {
|
|
490
|
-
'update:options': value => props.updateOptions(value)
|
|
491
|
-
},
|
|
492
|
-
widths: this.widths,
|
|
493
|
-
headers: this.computedHeaders
|
|
494
|
-
};
|
|
495
|
-
const children = [getSlot(this, 'footer', data, true)];
|
|
496
|
-
if (!this.hideDefaultFooter) {
|
|
497
|
-
children.push(this.$createElement(VDataFooter, {
|
|
498
|
-
...data,
|
|
499
|
-
scopedSlots: getPrefixedScopedSlots('footer.', this.$scopedSlots)
|
|
500
|
-
}));
|
|
501
|
-
}
|
|
502
|
-
return children;
|
|
503
|
-
},
|
|
504
|
-
genDefaultScopedSlot(props) {
|
|
505
|
-
const simpleProps = {
|
|
506
|
-
height: this.height,
|
|
507
|
-
fixedHeader: this.fixedHeader,
|
|
508
|
-
dense: this.dense
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
// if (this.virtualRows) {
|
|
512
|
-
// return this.$createElement(VVirtualTable, {
|
|
513
|
-
// props: Object.assign(simpleProps, {
|
|
514
|
-
// items: props.items,
|
|
515
|
-
// height: this.height,
|
|
516
|
-
// rowHeight: this.dense ? 24 : 48,
|
|
517
|
-
// headerHeight: this.dense ? 32 : 48,
|
|
518
|
-
// // TODO: expose rest of props from virtual table?
|
|
519
|
-
// }),
|
|
520
|
-
// scopedSlots: {
|
|
521
|
-
// items: ({ items }) => this.genItems(items, props) as any,
|
|
522
|
-
// },
|
|
523
|
-
// }, [
|
|
524
|
-
// this.proxySlot('body.before', [this.genCaption(props), this.genHeaders(props)]),
|
|
525
|
-
// this.proxySlot('bottom', this.genFooters(props)),
|
|
526
|
-
// ])
|
|
527
|
-
// }
|
|
528
|
-
|
|
529
|
-
return this.$createElement(VSimpleTable, {
|
|
530
|
-
props: simpleProps,
|
|
531
|
-
class: {
|
|
532
|
-
'v-data-table--mobile': this.isMobile
|
|
533
|
-
}
|
|
534
|
-
}, [this.proxySlot('top', getSlot(this, 'top', {
|
|
535
|
-
...props,
|
|
536
|
-
isMobile: this.isMobile
|
|
537
|
-
}, true)), this.genCaption(props), this.genColgroup(props), this.genHeaders(props), this.genBody(props), this.genFoot(props), this.proxySlot('bottom', this.genFooters(props))]);
|
|
538
|
-
},
|
|
539
|
-
proxySlot(slot, content) {
|
|
540
|
-
return this.$createElement('template', {
|
|
541
|
-
slot
|
|
542
|
-
}, content);
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
render() {
|
|
546
|
-
return this.$createElement(VData, {
|
|
547
|
-
props: {
|
|
548
|
-
...this.$props,
|
|
549
|
-
customFilter: this.customFilterWithColumns,
|
|
550
|
-
customSort: this.customSortWithHeaders,
|
|
551
|
-
itemsPerPage: this.computedItemsPerPage
|
|
552
|
-
},
|
|
553
|
-
on: {
|
|
554
|
-
'update:options': (v, old) => {
|
|
555
|
-
this.internalGroupBy = v.groupBy || [];
|
|
556
|
-
!deepEqual(v, old) && this.$emit('update:options', v);
|
|
557
|
-
},
|
|
558
|
-
'update:page': v => this.$emit('update:page', v),
|
|
559
|
-
'update:items-per-page': v => this.$emit('update:items-per-page', v),
|
|
560
|
-
'update:sort-by': v => this.$emit('update:sort-by', v),
|
|
561
|
-
'update:sort-desc': v => this.$emit('update:sort-desc', v),
|
|
562
|
-
'update:group-by': v => this.$emit('update:group-by', v),
|
|
563
|
-
'update:group-desc': v => this.$emit('update:group-desc', v),
|
|
564
|
-
pagination: (v, old) => !deepEqual(v, old) && this.$emit('pagination', v),
|
|
565
|
-
'current-items': v => {
|
|
566
|
-
this.internalCurrentItems = v;
|
|
567
|
-
this.$emit('current-items', v);
|
|
568
|
-
},
|
|
569
|
-
'page-count': v => this.$emit('page-count', v)
|
|
570
|
-
},
|
|
571
|
-
scopedSlots: {
|
|
572
|
-
default: this.genDefaultScopedSlot
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
//# sourceMappingURL=VDataTable.mjs.map
|