grantthomas-nuxt 1.0.11 → 1.0.12
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.vue +1 -1
- package/dist/runtime/components/CrudErrorDisplay.d.vue.ts +1 -0
- package/dist/runtime/components/CrudErrorDisplay.vue +24 -4
- package/dist/runtime/components/CrudErrorDisplay.vue.d.ts +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -79,7 +79,7 @@ onBeforeUnmount(() => {
|
|
|
79
79
|
<template v-slot:activator="{ props: tooltipProps }">
|
|
80
80
|
<v-icon style="cursor: pointer;" color="error" size="24" v-bind="tooltipProps">mdi-alert-circle</v-icon>
|
|
81
81
|
</template>
|
|
82
|
-
<crud-error-display :errors="countErrors" />
|
|
82
|
+
<crud-error-display :errors="countErrors" :show-all="true" />
|
|
83
83
|
</v-tooltip>
|
|
84
84
|
</slot>
|
|
85
85
|
<slot v-else-if="countPending" name="pending">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
2
|
errorKey: string;
|
|
3
|
+
showAll: boolean;
|
|
3
4
|
errors?: Record<string, any> | undefined;
|
|
4
5
|
$props: any;
|
|
5
6
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -6,14 +6,25 @@ const props = defineProps({
|
|
|
6
6
|
errorKey: {
|
|
7
7
|
type: String,
|
|
8
8
|
default: null
|
|
9
|
+
},
|
|
10
|
+
showAll: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
9
13
|
}
|
|
10
14
|
});
|
|
11
15
|
const random = computed(() => Math.random());
|
|
16
|
+
const hasErrors = computed(() => {
|
|
17
|
+
if (!props.errors) return false;
|
|
18
|
+
if (props.showAll) {
|
|
19
|
+
return Object.keys(props.errors).length > 0;
|
|
20
|
+
}
|
|
21
|
+
return props.errors[props.errorKey ?? "global"] != null;
|
|
22
|
+
});
|
|
12
23
|
</script>
|
|
13
24
|
|
|
14
25
|
<template>
|
|
15
26
|
<v-alert
|
|
16
|
-
v-if="
|
|
27
|
+
v-if="hasErrors"
|
|
17
28
|
density="compact"
|
|
18
29
|
type="error"
|
|
19
30
|
variant="tonal"
|
|
@@ -21,8 +32,17 @@ const random = computed(() => Math.random());
|
|
|
21
32
|
<template #prepend>
|
|
22
33
|
<v-icon color="error" icon="mdi-alert"/>
|
|
23
34
|
</template>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
<template v-if="showAll">
|
|
36
|
+
<div v-for="(errorGroup, groupKey) in errors" :key="`${random}-group-${groupKey}`">
|
|
37
|
+
<div v-for="(error, errorIndex) in errorGroup" :key="`${random}-error-${groupKey}-${errorIndex}`">
|
|
38
|
+
{{ error }}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<template v-else>
|
|
43
|
+
<div v-for="(error, key) in errors[errorKey ?? 'global']" :key="`${random}-error-${key}`">
|
|
44
|
+
{{ error }}
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
27
47
|
</v-alert>
|
|
28
48
|
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
2
|
errorKey: string;
|
|
3
|
+
showAll: boolean;
|
|
3
4
|
errors?: Record<string, any> | undefined;
|
|
4
5
|
$props: any;
|
|
5
6
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|