grantthomas-nuxt 1.0.22 → 1.0.24
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/dist/module.json +1 -1
- package/dist/runtime/components/CrudCountLoader.d.vue.ts +1 -1
- package/dist/runtime/components/CrudCountLoader.vue.d.ts +1 -1
- package/dist/runtime/components/CrudListLoader.d.vue.ts +1 -1
- package/dist/runtime/components/CrudListLoader.vue.d.ts +1 -1
- package/dist/runtime/components/CrudPaginatedLoader.d.vue.ts +8 -0
- package/dist/runtime/components/CrudPaginatedLoader.vue +37 -4
- package/dist/runtime/components/CrudPaginatedLoader.vue.d.ts +8 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -4,8 +4,8 @@ type __VLS_WithSlots<T, S> = T & (new () => {
|
|
|
4
4
|
$slots: S;
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
|
-
debounced: boolean;
|
|
8
7
|
path: string;
|
|
8
|
+
debounced: boolean;
|
|
9
9
|
await: boolean;
|
|
10
10
|
listeners: unknown[];
|
|
11
11
|
customFilters?: Record<string, any> | undefined;
|
|
@@ -4,8 +4,8 @@ type __VLS_WithSlots<T, S> = T & (new () => {
|
|
|
4
4
|
$slots: S;
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
|
-
debounced: boolean;
|
|
8
7
|
path: string;
|
|
8
|
+
debounced: boolean;
|
|
9
9
|
await: boolean;
|
|
10
10
|
listeners: unknown[];
|
|
11
11
|
customFilters?: Record<string, any> | undefined;
|
|
@@ -4,10 +4,10 @@ type __VLS_WithSlots<T, S> = T & (new () => {
|
|
|
4
4
|
$slots: S;
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
|
+
path: string;
|
|
7
8
|
page: number;
|
|
8
9
|
debounced: boolean;
|
|
9
10
|
disableNoResults: boolean;
|
|
10
|
-
path: string;
|
|
11
11
|
perPage: number;
|
|
12
12
|
await: boolean;
|
|
13
13
|
listeners: unknown[];
|
|
@@ -4,10 +4,10 @@ type __VLS_WithSlots<T, S> = T & (new () => {
|
|
|
4
4
|
$slots: S;
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
|
+
path: string;
|
|
7
8
|
page: number;
|
|
8
9
|
debounced: boolean;
|
|
9
10
|
disableNoResults: boolean;
|
|
10
|
-
path: string;
|
|
11
11
|
perPage: number;
|
|
12
12
|
await: boolean;
|
|
13
13
|
listeners: unknown[];
|
|
@@ -15,6 +15,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
|
15
15
|
deleteTitle: string;
|
|
16
16
|
allowCreate: boolean;
|
|
17
17
|
hideFilters: boolean;
|
|
18
|
+
hideActionsOnSave: boolean;
|
|
19
|
+
closeOnSave: boolean;
|
|
18
20
|
fullScreenDialog: boolean;
|
|
19
21
|
contentClasses: string;
|
|
20
22
|
showPerPageSelector: boolean;
|
|
@@ -45,6 +47,7 @@ type __VLS_Slots = {
|
|
|
45
47
|
totalItems: any;
|
|
46
48
|
currentPage: any;
|
|
47
49
|
totalPages: any;
|
|
50
|
+
closeAction: any;
|
|
48
51
|
}) => any) | undefined;
|
|
49
52
|
} & {
|
|
50
53
|
filters?: ((props: {
|
|
@@ -68,12 +71,17 @@ type __VLS_Slots = {
|
|
|
68
71
|
totalItems: any;
|
|
69
72
|
currentPage: any;
|
|
70
73
|
totalPages: any;
|
|
74
|
+
closeAction: any;
|
|
71
75
|
}) => any) | undefined;
|
|
72
76
|
} & {
|
|
73
77
|
form?: ((props: {
|
|
74
78
|
action: any;
|
|
75
79
|
item: any;
|
|
80
|
+
closeAction: any;
|
|
76
81
|
originalItem: any;
|
|
77
82
|
errors: any;
|
|
83
|
+
totalItems: any;
|
|
84
|
+
currentPage: any;
|
|
85
|
+
totalPages: any;
|
|
78
86
|
}) => any) | undefined;
|
|
79
87
|
};
|
|
@@ -11,7 +11,18 @@ import CrudFormDialog from "./CrudFormDialog.vue";
|
|
|
11
11
|
import CrudErrorDisplay from "./CrudErrorDisplay.vue";
|
|
12
12
|
const { parseQuery, stringifyQuery, cloneDeep } = useCrudConverters();
|
|
13
13
|
const props = defineProps({
|
|
14
|
+
hideActionsOnSave: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: false,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
closeOnSave: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false,
|
|
22
|
+
default: true
|
|
23
|
+
},
|
|
14
24
|
fullScreenDialog: {
|
|
25
|
+
type: Boolean,
|
|
15
26
|
type: Boolean,
|
|
16
27
|
required: false,
|
|
17
28
|
default: false
|
|
@@ -165,6 +176,7 @@ perPage.value = props.perPage;
|
|
|
165
176
|
const route = useRoute();
|
|
166
177
|
const router = useRouter();
|
|
167
178
|
const previousRoute = usePreviousRoute();
|
|
179
|
+
const hideActions = ref(false);
|
|
168
180
|
const action = computed(() => route.query[(props.loaderKey ?? "") + "action"]);
|
|
169
181
|
const actionId = computed(() => route.query[(props.loaderKey ?? "") + "actionId"]);
|
|
170
182
|
const dialogOpen = computed({
|
|
@@ -196,6 +208,11 @@ const dialogOpen = computed({
|
|
|
196
208
|
}
|
|
197
209
|
}
|
|
198
210
|
});
|
|
211
|
+
watch(dialogOpen, (isOpen) => {
|
|
212
|
+
if (isOpen) {
|
|
213
|
+
hideActions.value = false;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
199
216
|
const page = computed(() => props.loaderKey ? parseQuery(route.query[props.loaderKey])?.page ?? 1 : route.query.page ?? 1);
|
|
200
217
|
const filterValues = props.loaderKey ? ref({ ...props.customFilters, ...parseQuery(route.query[props.loaderKey]) }) : ref({ ...props.customFilters, ...route.query });
|
|
201
218
|
const onQueryChange = (page2) => {
|
|
@@ -308,7 +325,12 @@ const saveAction = async () => {
|
|
|
308
325
|
const savedPath = props.path;
|
|
309
326
|
const savedAction = action.value;
|
|
310
327
|
const savedItem = item.value;
|
|
311
|
-
|
|
328
|
+
if (props.closeOnSave) {
|
|
329
|
+
dialogOpen.value = false;
|
|
330
|
+
}
|
|
331
|
+
if (props.hideActionsOnSave) {
|
|
332
|
+
hideActions.value = true;
|
|
333
|
+
}
|
|
312
334
|
await getItems(Number.parseInt(page.value) ?? null, null, filterValues.value);
|
|
313
335
|
notify(savedPath + ":" + savedAction, savedItem);
|
|
314
336
|
}
|
|
@@ -350,6 +372,9 @@ const exportAction = async () => {
|
|
|
350
372
|
window.open(exportUrl.value, "_blank");
|
|
351
373
|
}
|
|
352
374
|
};
|
|
375
|
+
const closeAction = () => {
|
|
376
|
+
dialogOpen.value = false;
|
|
377
|
+
};
|
|
353
378
|
</script>
|
|
354
379
|
|
|
355
380
|
<template>
|
|
@@ -368,6 +393,7 @@ const exportAction = async () => {
|
|
|
368
393
|
:total-items="totalItems"
|
|
369
394
|
:current-page="currentPage"
|
|
370
395
|
:total-pages="totalPages"
|
|
396
|
+
:close-action="closeAction"
|
|
371
397
|
>
|
|
372
398
|
</slot>
|
|
373
399
|
<div :class="contentClasses">
|
|
@@ -400,6 +426,7 @@ const exportAction = async () => {
|
|
|
400
426
|
:total-items="totalItems"
|
|
401
427
|
:current-page="currentPage"
|
|
402
428
|
:total-pages="totalPages"
|
|
429
|
+
:close-action="closeAction"
|
|
403
430
|
>
|
|
404
431
|
</slot>
|
|
405
432
|
</div>
|
|
@@ -432,6 +459,7 @@ const exportAction = async () => {
|
|
|
432
459
|
<crud-form-dialog
|
|
433
460
|
v-model:dialog="dialogOpen"
|
|
434
461
|
v-model="item"
|
|
462
|
+
:hide-actions="hideActions"
|
|
435
463
|
:original-item="originalItem"
|
|
436
464
|
:action="action"
|
|
437
465
|
:form-errors="formErrors"
|
|
@@ -445,11 +473,16 @@ const exportAction = async () => {
|
|
|
445
473
|
:full-screen="fullScreenDialog"
|
|
446
474
|
>
|
|
447
475
|
<slot
|
|
448
|
-
name="form"
|
|
476
|
+
name="form"
|
|
477
|
+
:action="action"
|
|
449
478
|
:item="item"
|
|
479
|
+
:close-action="closeAction"
|
|
450
480
|
:original-item="originalItem"
|
|
451
|
-
:errors="formErrors"
|
|
452
|
-
|
|
481
|
+
:errors="formErrors"
|
|
482
|
+
:total-items="totalItems"
|
|
483
|
+
:current-page="currentPage"
|
|
484
|
+
:total-pages="totalPages"
|
|
485
|
+
>
|
|
453
486
|
</slot>
|
|
454
487
|
</crud-form-dialog>
|
|
455
488
|
|
|
@@ -15,6 +15,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
|
15
15
|
deleteTitle: string;
|
|
16
16
|
allowCreate: boolean;
|
|
17
17
|
hideFilters: boolean;
|
|
18
|
+
hideActionsOnSave: boolean;
|
|
19
|
+
closeOnSave: boolean;
|
|
18
20
|
fullScreenDialog: boolean;
|
|
19
21
|
contentClasses: string;
|
|
20
22
|
showPerPageSelector: boolean;
|
|
@@ -45,6 +47,7 @@ type __VLS_Slots = {
|
|
|
45
47
|
totalItems: any;
|
|
46
48
|
currentPage: any;
|
|
47
49
|
totalPages: any;
|
|
50
|
+
closeAction: any;
|
|
48
51
|
}) => any) | undefined;
|
|
49
52
|
} & {
|
|
50
53
|
filters?: ((props: {
|
|
@@ -68,12 +71,17 @@ type __VLS_Slots = {
|
|
|
68
71
|
totalItems: any;
|
|
69
72
|
currentPage: any;
|
|
70
73
|
totalPages: any;
|
|
74
|
+
closeAction: any;
|
|
71
75
|
}) => any) | undefined;
|
|
72
76
|
} & {
|
|
73
77
|
form?: ((props: {
|
|
74
78
|
action: any;
|
|
75
79
|
item: any;
|
|
80
|
+
closeAction: any;
|
|
76
81
|
originalItem: any;
|
|
77
82
|
errors: any;
|
|
83
|
+
totalItems: any;
|
|
84
|
+
currentPage: any;
|
|
85
|
+
totalPages: any;
|
|
78
86
|
}) => any) | undefined;
|
|
79
87
|
};
|