Skip to content

Commit b7a8dc1

Browse files
Fix bugs due to changes in vuetify data-tables updates
1 parent 770bf66 commit b7a8dc1

File tree

13 files changed

+49
-42
lines changed

13 files changed

+49
-42
lines changed

src/documentation/components/FeaturesTable.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,33 @@
4545
>
4646
<template #[`item.name`]="{ item }">
4747
<div
48-
:id="slugifyString(sectionId, item.raw.name)"
48+
:id="slugifyString(sectionId, item.name)"
4949
class="name-item text-mono ml-n2"
5050
>
5151
<span class="text-primary">#</span>
5252
<a
5353
class="text-primary"
5454
:class="classes.appLink"
55-
:href="`#${slugifyString(sectionId, item.raw.name)}`"
56-
>{{ item.raw.name }}</a>
55+
:href="`#${slugifyString(sectionId, item.name)}`"
56+
>{{ item.name }}</a>
5757
</div>
5858
</template>
5959

6060
<template #[`item.type`]="{ item }">
6161
<div class="text-success">
62-
{{ item.raw.type }}
62+
{{ item.type }}
6363
</div>
6464
</template>
6565

6666
<template #[`item.default`]="{ item }">
6767
<div
6868
class="text-accent"
69-
v-html="item.raw.default"
69+
v-html="item.default"
7070
></div>
7171
</template>
7272

7373
<template #[`item.desc`]="{ item }">
74-
<div v-html="item.raw.desc"></div>
74+
<div v-html="item.desc"></div>
7575
</template>
7676
</v-data-table>
7777
</v-card>

src/documentation/components/examples/ClientTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ onMounted(() => {
271271
272272
273273
function fetchClientData(drilldown = null) {
274-
const item = drilldown?.item?.raw ?? null;
274+
const item = drilldown?.item ?? null;
275275
276276
let url = 'api/users';
277277
let user = null;

src/documentation/components/examples/ServerTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function getUsers(drilldown = null) {
322322
}
323323
324324
function getUserPosts(drilldown = null, updateCurrentLevel = false) {
325-
const item = drilldown?.item?.raw ?? null;
325+
const item = drilldown?.item ?? null;
326326
327327
const userId = item.id;
328328
const user = tableSettings.value.items.find(
@@ -377,7 +377,7 @@ function getUserPosts(drilldown = null, updateCurrentLevel = false) {
377377
}
378378
379379
function getPostComments(drilldown = null, updateCurrentLevel = false) {
380-
const item = drilldown?.item?.raw ?? null;
380+
const item = drilldown?.item ?? null;
381381
382382
const userId = item.userId;
383383
const user = tableSettings.value.items.find(

src/documentation/layout/AppBar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
>
4343
<template #item="{ item }">
4444
<v-list-item
45-
:key="item.key"
45+
:key="item.raw.key"
4646
density="compact"
4747
:href="item.raw.link"
48-
:prepend-icon="item.raw.icon ? item.raw.icon : 'mdi:mdi-vuetify'"
48+
:prepend-icon="item.raw.icon ? item.raw.icon : '$vuetify'"
4949
target="_blank"
5050
:title="item.raw?.topTitle || item.title"
5151
>

src/documentation/sections/CellRenderingSection.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ const rendererExampleCode = `const headers = [
259259
align: 'start',
260260
key: 'name',
261261
renderer(value, item, column) {
262-
return \`<span class="font-italic">\${item.raw.value}</span> Column\`;
262+
return \`<span class="font-italic">\${item.value}</span> Column\`;
263263
},
264264
sortable: false,
265265
title: 'Name',
@@ -289,7 +289,7 @@ const rendererHeaderExampleCode = `const headers = [
289289
align: 'start',
290290
key: 'cost',
291291
renderHeader(value, item, column) {
292-
return \`<span class="font-italic">\${item.raw.value}</span> Column\`;
292+
return \`<span class="font-italic">\${item.value}</span> Column\`;
293293
},
294294
sortable: false,
295295
title: 'Cost',
@@ -349,7 +349,7 @@ const rendererItemExampleCode = `const headers = [
349349
align: 'start',
350350
key: 'cost',
351351
renderItem(value, item, column) {
352-
return \`$\${item.raw.value}\`;
352+
return \`$\${item.value}\`;
353353
},
354354
sortable: false,
355355
title: 'Cost',

src/playground/configs/templates/ClientTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
</template> -->
159159

160160
<!-- <template #[`item.id`]="{ item }">
161-
[item cell Slot]: {{ item.raw.id }}
161+
[item cell Slot]: {{ item.id }}
162162
</template> -->
163163

164164
<!-- <template #[`item.data-table-select`]>
@@ -396,7 +396,7 @@ onMounted(() => {
396396
397397
398398
function fetchClientData(drilldown = null) {
399-
const item = drilldown?.item?.raw ?? null;
399+
const item = drilldown?.item ?? null;
400400
401401
let url = 'api/users';
402402
let user = null;

src/playground/configs/templates/GroupByClientTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ onMounted(() => {
203203
const users = ref([]);
204204
205205
function fetchClientData(drilldown = null) {
206-
const item = drilldown?.item?.raw ?? null;
206+
const item = drilldown?.item ?? null;
207207
208208
let url = 'api/posts';
209209
let user = null;

src/playground/configs/templates/ServerTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
</template> -->
159159

160160
<!-- <template #[`item.id`]="{ item }">
161-
[item cell Slot]: {{ item.raw.id }}
161+
[item cell Slot]: {{ item.id }}
162162
</template> -->
163163

164164
<!-- <template #[`item.data-table-select`]>
@@ -456,7 +456,7 @@ function getUsers(drilldown = null) {
456456
}
457457
458458
function getUserPosts(drilldown = null, updateCurrentLevel = false) {
459-
const item = drilldown?.item?.raw ?? null;
459+
const item = drilldown?.item ?? null;
460460
461461
const userId = item.id;
462462
const user = tableSettings.value.items.find(
@@ -510,7 +510,7 @@ function getUserPosts(drilldown = null, updateCurrentLevel = false) {
510510
}
511511
512512
function getPostComments(drilldown = null, updateCurrentLevel = false) {
513-
const item = drilldown?.item?.raw ?? null;
513+
const item = drilldown?.item ?? null;
514514
515515
const userId = item.userId;
516516
const user = tableSettings.value.items.find(

src/plugin/VDrilldownTable.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,33 +224,33 @@
224224

225225

226226
<!-- ================================================== Expanded Row Slot -->
227-
<template #expanded-row="{ columns, item }">
228-
<tr :class="showLoadingDrilldownTable(item.raw[itemChildrenKey]?.loading) ? '' : 'd-none'">
227+
<template #expanded-row="{ columns, item, internalItem }">
228+
<tr :class="showLoadingDrilldownTable(item[itemChildrenKey]?.loading) ? '' : 'd-none'">
229229
<td
230230
class="px-0 ma-0"
231231
:colspan="columns.length"
232232
style="vertical-align: top;"
233233
>
234234
<VDrilldownTable
235-
:key="item.raw"
235+
:key="internalItem.key"
236236
:column-widths="loadedDrilldown.columnWidths"
237237
:density="loadedDrilldown.density"
238238
:drilldown="loadedDrilldown"
239-
:headers="item.raw[itemChildrenKey]?.headers"
239+
:headers="item[itemChildrenKey]?.headers"
240240
:is-drilldown="true"
241241
:item="item"
242-
:items-length="item.raw[itemChildrenKey]?.itemsLength"
243-
:items-per-page="item.raw[itemChildrenKey]?.itemsPerPage"
242+
:items-length="item[itemChildrenKey]?.itemsLength"
243+
:items-per-page="item[itemChildrenKey]?.itemsPerPage"
244244
:level="level + 1"
245245
:levels="loadedDrilldown.levels"
246-
:loaderProps="item.raw[itemChildrenKey]?.loaderProps"
247-
:loaderType="item.raw[itemChildrenKey]?.loaderType"
248-
:loading="item.raw[itemChildrenKey]?.loading"
246+
:loaderProps="item[itemChildrenKey]?.loaderProps"
247+
:loaderType="item[itemChildrenKey]?.loaderType"
248+
:loading="item[itemChildrenKey]?.loading"
249249
:loadingText="loadingText"
250250
:match-column-widths="loadedDrilldown.matchColumnWidths"
251-
:multi-sort="item.raw[itemChildrenKey]?.multiSort"
251+
:multi-sort="item[itemChildrenKey]?.multiSort"
252252
:no-data-text="loadedDrilldown.noDataText"
253-
:server="item.raw[itemChildrenKey]?.server"
253+
:server="item[itemChildrenKey]?.server"
254254
:sort-by="loadedDrilldown.sortBy"
255255
:table-type="tableType"
256256
@update:drilldown="emitUpdatedExpanded($event)"
@@ -523,11 +523,11 @@ function setLoadedDrilldown(): void {
523523
if (props.drilldown) {
524524
loadedDrilldown = useSetLoadedDrilldown({
525525
drilldown: props.drilldown,
526+
item: props.item,
526527
level: props.level,
527528
levels: props.levels,
528529
loadedDrilldown,
529530
matchColumnWidths: props.matchColumnWidths,
530-
rawItem: props.item?.raw,
531531
});
532532
return;
533533
}

src/plugin/composables/emits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { UseEmitUpdatedExpanded } from '@/types';
55
export const useEmitUpdatedExpanded: UseEmitUpdatedExpanded = (options) => {
66
const { data, drilldownData, emit } = options;
77

8-
if (data.isExpanded(data.item)) {
8+
if (data.isExpanded(data.internalItem)) {
99
emit('update:drilldown', drilldownData);
1010
}
1111

0 commit comments

Comments
 (0)