Skip to content

Commit bd4cfc3

Browse files
Fixing documentation and examples
1 parent 885fda9 commit bd4cfc3

File tree

7 files changed

+22
-13
lines changed

7 files changed

+22
-13
lines changed

src/documentation/components/examples/ClientTable.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ const props = defineProps({
9090
9191
9292
const classes = inject('classes');
93+
const colorsProp = ref(props.colors);
9394
const tableSettings = ref({ ...props.settings, ...props.colors });
9495
9596
const headers = {
@@ -136,7 +137,7 @@ const headers = {
136137
align: 'start',
137138
key: 'id',
138139
title: 'Post ID',
139-
width: 235,
140+
width: 240,
140141
},
141142
{
142143
align: 'start',
@@ -157,7 +158,7 @@ const headers = {
157158
align: 'start',
158159
key: 'id',
159160
title: 'User ID',
160-
width: 345,
161+
width: 350,
161162
},
162163
{
163164
align: 'start',
@@ -302,7 +303,7 @@ function fetchClientData(drilldown = null) {
302303
user.child = {};
303304
user.child = {
304305
...tableDefaults,
305-
colors: null,
306+
...colorsProp.value,
306307
drilldownKey: 'id',
307308
footers: footers.posts,
308309
headers: headers.posts,
@@ -312,6 +313,7 @@ function fetchClientData(drilldown = null) {
312313
};
313314
}
314315
316+
315317
// Comments Level 3 //
316318
if (drilldown?.level === 2) {
317319
userId = item.userId;
@@ -329,7 +331,7 @@ function fetchClientData(drilldown = null) {
329331
post.child = {};
330332
post.child = {
331333
...tableDefaults,
332-
colors: null,
334+
...colorsProp.value,
333335
drilldownKey: 'id',
334336
footers: footers.comments,
335337
headers: headers.comments,

src/documentation/components/examples/ServerTable.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const headers = {
136136
align: 'start',
137137
key: 'id',
138138
title: 'Post ID',
139-
width: 235,
139+
width: 240,
140140
},
141141
{
142142
align: 'start',
@@ -157,7 +157,7 @@ const headers = {
157157
align: 'start',
158158
key: 'id',
159159
title: 'User ID',
160-
width: 345,
160+
width: 350,
161161
},
162162
{
163163
align: 'start',
@@ -345,6 +345,7 @@ function getUserPosts(drilldown = null, updateCurrentLevel = false) {
345345
itemsPerPage: drilldown?.itemsPerPage ?? 0,
346346
level: 2,
347347
loading: true,
348+
server: true,
348349
sortBy: [],
349350
},
350351
});
@@ -404,6 +405,7 @@ function getPostComments(drilldown = null, updateCurrentLevel = false) {
404405
itemsPerPage: drilldown?.itemsPerPage ?? 0,
405406
level: 3,
406407
loading: true,
408+
server: true,
407409
sortBy: [],
408410
},
409411
});

src/documentation/sections/ExampleSection.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
<ClientTable
27+
:colors="{ colors: null }"
2728
:settings="tableSettings"
2829
title="Client Side Data Table"
2930
/>

src/documentation/sections/PropsSection.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const classes = inject('classes');
124124
const codeBlockSettings = computed(() => props.codeBlockOptions);
125125
const propsStore = usePropsStore();
126126
const store = useCoreStore();
127-
const tableSettings = ref({ ...tableDefaults });
127+
128128
129129
const colorsProp = {
130130
colors: {
@@ -158,6 +158,8 @@ const colorsProp = {
158158
}
159159
};
160160
161+
const tableSettings = ref({ ...tableDefaults, ...{ colors: colorsProp } });
162+
161163
const colorsPropCode = `colors: {
162164
body: {
163165
base: '--v-theme-surface',

src/playground/configs/templates/ClientTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ const headers = {
268268
align: 'start',
269269
key: 'id',
270270
title: 'Post ID',
271-
width: 235,
271+
width: 240,
272272
},
273273
{
274274
align: 'start',
@@ -289,7 +289,7 @@ const headers = {
289289
align: 'start',
290290
key: 'id',
291291
title: 'User ID',
292-
width: 345,
292+
width: 350,
293293
},
294294
{
295295
align: 'start',

src/playground/configs/templates/ServerTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const headers = {
130130
align: 'start',
131131
key: 'id',
132132
title: 'Post ID',
133-
width: 235,
133+
width: 240,
134134
},
135135
{
136136
align: 'start',
@@ -151,7 +151,7 @@ const headers = {
151151
align: 'start',
152152
key: 'id',
153153
title: 'User ID',
154-
width: 345,
154+
width: 350,
155155
},
156156
{
157157
align: 'start',

src/playground/configs/templates/tableDefaults.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default {
22
// color: 'primary', // ? Doesn't seem to work
3+
// colors: null,
34
colors: {
45
body: {
56
base: '--v-theme-surface',
@@ -123,13 +124,14 @@ export default {
123124
variant: 'underlined',
124125
},
125126
selectStrategy: 'page',
127+
separator: 'default',
126128
server: false,
127129
showCurrentPage: false,
128130
showDrilldownWhenLoading: true,
129131
showExpand: false,
130-
showFooterRow: true,
132+
showFooterRow: false,
131133
showSearch: false,
132-
showSelect: false,
134+
showSelect: true,
133135
skeltonType: 'heading@1',
134136
sortAscIcon: '$sortAsc',
135137
sortBy: [],

0 commit comments

Comments
 (0)