@dative-gpi/foundation-shared-components 0.0.75 → 0.0.77
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/components/FSDialog.vue +2 -2
- package/components/FSErrorToast.vue +44 -18
- package/components/FSImage.vue +7 -11
- package/package.json +4 -4
package/components/FSDialog.vue
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
>
|
|
9
9
|
<FSCard
|
|
10
10
|
padding="24px"
|
|
11
|
+
width="100%"
|
|
11
12
|
gap="24px"
|
|
12
13
|
:border="!isExtraSmall"
|
|
13
14
|
:color="$props.color"
|
|
14
15
|
:class="classes"
|
|
15
|
-
:width="width"
|
|
16
16
|
>
|
|
17
17
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
18
18
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -33,11 +33,11 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
33
33
|
|
|
34
34
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
35
35
|
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
36
|
+
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
36
37
|
|
|
37
38
|
import FSButton from "./FSButton.vue";
|
|
38
39
|
import FSCard from "./FSCard.vue";
|
|
39
40
|
import FSCol from "./FSCol.vue";
|
|
40
|
-
import { sizeToVar } from "../utils";
|
|
41
41
|
|
|
42
42
|
export default defineComponent({
|
|
43
43
|
name: "FSDialog",
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSCol
|
|
3
3
|
padding="18px 0 18px 32px"
|
|
4
4
|
class="fs-error-toast"
|
|
5
|
-
align="center-
|
|
5
|
+
align="center-center"
|
|
6
|
+
gap="24px"
|
|
6
7
|
:style="style"
|
|
7
|
-
:wrap="false"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
<slot
|
|
10
|
+
name="body"
|
|
11
|
+
>
|
|
12
|
+
<FSRow
|
|
13
|
+
align="top-center"
|
|
14
|
+
:wrap="false"
|
|
15
|
+
>
|
|
16
|
+
<FSIcon>
|
|
17
|
+
mdi-alert-outline
|
|
18
|
+
</FSIcon>
|
|
19
|
+
<FSSpan>
|
|
20
|
+
{{ $tr(error.code, error.default) }}
|
|
21
|
+
</FSSpan>
|
|
22
|
+
</FSRow>
|
|
23
|
+
</slot>
|
|
24
|
+
<slot
|
|
25
|
+
name="footer"
|
|
26
|
+
/>
|
|
27
|
+
</FSCol>
|
|
16
28
|
</template>
|
|
17
29
|
|
|
18
30
|
<script lang="ts">
|
|
19
|
-
import { computed, defineComponent } from "vue";
|
|
31
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
20
32
|
|
|
21
33
|
import { getError, sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
22
34
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
@@ -25,19 +37,26 @@ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
|
25
37
|
import FSIcon from "./FSIcon.vue";
|
|
26
38
|
import FSSpan from "./FSSpan.vue";
|
|
27
39
|
import FSRow from "./FSRow.vue";
|
|
40
|
+
import FSCol from "./FSCol.vue";
|
|
28
41
|
|
|
29
42
|
export default defineComponent({
|
|
30
43
|
name: "FSErrorToast",
|
|
31
44
|
components: {
|
|
32
45
|
FSIcon,
|
|
33
46
|
FSSpan,
|
|
34
|
-
FSRow
|
|
47
|
+
FSRow,
|
|
48
|
+
FSCol
|
|
35
49
|
},
|
|
36
50
|
props: {
|
|
37
51
|
errorCode: {
|
|
38
52
|
type: String,
|
|
39
53
|
required: true
|
|
40
54
|
},
|
|
55
|
+
variant: {
|
|
56
|
+
type: String as PropType<"standard" | "full">,
|
|
57
|
+
required: false,
|
|
58
|
+
default: "full"
|
|
59
|
+
},
|
|
41
60
|
borderRadius: {
|
|
42
61
|
type: [String, Number],
|
|
43
62
|
required: false,
|
|
@@ -49,12 +68,19 @@ export default defineComponent({
|
|
|
49
68
|
|
|
50
69
|
const errors = getColors(ColorEnum.Error);
|
|
51
70
|
|
|
52
|
-
const style = computed((): { [key: string]
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
71
|
+
const style = computed((): { [key: string]: string | undefined } => {
|
|
72
|
+
switch (props.variant) {
|
|
73
|
+
case "standard": return {
|
|
74
|
+
"--fs-error-toast-border-radius": sizeToVar(props.borderRadius),
|
|
75
|
+
"--fs-error-toast-background-color": errors.light,
|
|
76
|
+
"--fs-error-toast-color": errors.dark
|
|
77
|
+
};
|
|
78
|
+
default: return {
|
|
79
|
+
"--fs-error-toast-border-radius": sizeToVar(props.borderRadius),
|
|
80
|
+
"--fs-error-toast-background-color": errors.base,
|
|
81
|
+
"--fs-error-toast-color": errors.light
|
|
82
|
+
};
|
|
83
|
+
}
|
|
58
84
|
});
|
|
59
85
|
|
|
60
86
|
const error = computed((): { code: string, default: string, status: number } => getError(props.errorCode));
|
package/components/FSImage.vue
CHANGED
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
38
38
|
import { decode, isBlurhashValid } from "blurhash";
|
|
39
39
|
|
|
40
|
-
import {
|
|
40
|
+
import { IMAGE_RAW_EXTENSION_URL, IMAGE_RAW_URL } from "@dative-gpi/foundation-shared-services/config/urls";
|
|
41
|
+
import { useExtensionJwt, useImageBlurHash } from "@dative-gpi/foundation-shared-services/composables";
|
|
41
42
|
import { sizeToVar, varToSize } from "@dative-gpi/foundation-shared-components/utils";
|
|
42
43
|
|
|
43
44
|
import FSLoader from "./FSLoader.vue";
|
|
@@ -86,7 +87,7 @@ export default defineComponent({
|
|
|
86
87
|
},
|
|
87
88
|
setup(props) {
|
|
88
89
|
const { fetch: fetchBlurHash, entity: blurHash } = useImageBlurHash();
|
|
89
|
-
const {
|
|
90
|
+
const { jwt } = useExtensionJwt();
|
|
90
91
|
|
|
91
92
|
const imageRef = ref<HTMLFormElement | null>(null);
|
|
92
93
|
const canvasRef = ref<HTMLCanvasElement | null>(null);
|
|
@@ -150,10 +151,11 @@ export default defineComponent({
|
|
|
150
151
|
return `${imageType.value},${imageData.value}`;
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
if (props.imageId) {
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
154
|
+
else if (props.imageId) {
|
|
155
|
+
if (jwt.value) {
|
|
156
|
+
return IMAGE_RAW_EXTENSION_URL(props.imageId, jwt.value);
|
|
156
157
|
}
|
|
158
|
+
return IMAGE_RAW_URL(props.imageId);
|
|
157
159
|
}
|
|
158
160
|
});
|
|
159
161
|
|
|
@@ -184,12 +186,6 @@ export default defineComponent({
|
|
|
184
186
|
}
|
|
185
187
|
};
|
|
186
188
|
|
|
187
|
-
watch(() => props.imageId, () => {
|
|
188
|
-
if (props.imageId) {
|
|
189
|
-
fetchRawImage(props.imageId);
|
|
190
|
-
}
|
|
191
|
-
}, { immediate: true });
|
|
192
|
-
|
|
193
189
|
watch(() => blurHash.value, () => {
|
|
194
190
|
if (canvasRef.value && imageRef.value) {
|
|
195
191
|
if (blurHash.value && isBlurhashValid(blurHash.value.blurHash).result) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.77",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.77",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.77",
|
|
15
15
|
"@fontsource/montserrat": "^5.0.16",
|
|
16
16
|
"@lexical/clipboard": "^0.12.5",
|
|
17
17
|
"@lexical/history": "^0.12.5",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"sass": "^1.69.5",
|
|
33
33
|
"sass-loader": "^13.3.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6b19cf784bb4bb763d8d437425caf7ace12e6067"
|
|
36
36
|
}
|