@burh/nuxt-core 1.1.23 → 1.1.26

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.
@@ -1,73 +1,73 @@
1
- <template>
2
- <img
3
- :src="(this.src) ? this.src : getAvatarUrl()"
4
- :alt="this.alt"
5
- @error="img => getImageFallback(img)"
6
- >
7
- </template>
8
-
9
- <script>
10
- export default {
11
- name: 'image-with-fallback',
12
- props: {
13
- src: {
14
- type: [String, Boolean],
15
- default: null
16
- },
17
- alt: {
18
- type: String,
19
- required: true
20
- },
21
- fallbackSize: {
22
- type: String,
23
- default: '512'
24
- },
25
- fallbackBackground: {
26
- type: [String, Boolean],
27
- default: null
28
- },
29
- fallbackText: {
30
- type: String,
31
- required: true
32
- },
33
- fallbackSingle: {
34
- type: Boolean,
35
- default: true
36
- }
37
- },
38
- methods: {
39
- getAvatarUrl() {
40
- let size = this.fallbackSize;
41
- let text = this.getNameInitials();
42
- // let background = this.fallbackBackground;
43
-
44
- const url = new URL('https://api.dicebear.com/7.x/initials/svg');
45
-
46
- url.searchParams.append('seed', text);
47
- url.searchParams.append('backgroundColor', '8DA2B5');
48
- url.searchParams.append('size', size);
49
- url.searchParams.append('fontSize', '40');
50
-
51
- return url.toString();
52
- },
53
- getImageFallback(img) {
54
- img.target.src = this.getAvatarUrl();
55
- },
56
- getNameInitials() {
57
- let userAvatarName;
58
-
59
- if (this.fallbackText) {
60
- if (this.fallbackSingle) {
61
- userAvatarName = this.fallbackText.slice(0, 1).toUpperCase();
62
- } else {
63
- userAvatarName = this.fallbackText;
64
- }
65
- } else {
66
- userAvatarName = 'BURH';
67
- }
68
-
69
- return userAvatarName;
70
- },
71
- }
72
- };
73
- </script>
1
+ <template>
2
+ <img
3
+ :src="(this.src) ? this.src : getAvatarUrl()"
4
+ :alt="this.alt"
5
+ @error="img => getImageFallback(img)"
6
+ >
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ name: 'image-with-fallback',
12
+ props: {
13
+ src: {
14
+ type: [String, Boolean],
15
+ default: null
16
+ },
17
+ alt: {
18
+ type: String,
19
+ required: true
20
+ },
21
+ fallbackSize: {
22
+ type: String,
23
+ default: '512'
24
+ },
25
+ fallbackBackground: {
26
+ type: [String, Boolean],
27
+ default: null
28
+ },
29
+ fallbackText: {
30
+ type: String,
31
+ required: true
32
+ },
33
+ fallbackSingle: {
34
+ type: Boolean,
35
+ default: true
36
+ }
37
+ },
38
+ methods: {
39
+ getAvatarUrl() {
40
+ let size = this.fallbackSize;
41
+ let text = this.getNameInitials();
42
+ // let background = this.fallbackBackground;
43
+
44
+ const url = new URL('https://api.dicebear.com/7.x/initials/svg');
45
+
46
+ url.searchParams.append('seed', text);
47
+ url.searchParams.append('backgroundColor', '8DA2B5');
48
+ url.searchParams.append('size', size);
49
+ url.searchParams.append('fontSize', '40');
50
+
51
+ return url.toString();
52
+ },
53
+ getImageFallback(img) {
54
+ img.target.src = this.getAvatarUrl();
55
+ },
56
+ getNameInitials() {
57
+ let userAvatarName;
58
+
59
+ if (this.fallbackText) {
60
+ if (this.fallbackSingle) {
61
+ userAvatarName = this.fallbackText.slice(0, 1).toUpperCase();
62
+ } else {
63
+ userAvatarName = this.fallbackText;
64
+ }
65
+ } else {
66
+ userAvatarName = 'BURH';
67
+ }
68
+
69
+ return userAvatarName;
70
+ },
71
+ }
72
+ };
73
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.1.23",
3
+ "version": "1.1.26",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "private": false,