@burh/nuxt-core 1.1.24 → 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.
@@ -22,7 +22,7 @@
22
22
  "
23
23
  />
24
24
  <h6
25
- v-if="userData && userData.user_complementary_information && userData.user_complementary_information.birth && getAge() > 0 || false"
25
+ v-if="userHasBirthDate"
26
26
  >
27
27
  {{ getAge() }} {{ $t('user_cv.left_side.years_old') }}
28
28
  </h6>
@@ -273,7 +273,6 @@
273
273
  <script>
274
274
  import getPrefixes from '~/util/getPrefixes.js';
275
275
  import VueQrcode from '@chenfengyuan/vue-qrcode';
276
- import moment from 'moment';
277
276
 
278
277
  import Profile from '../../Aboutme/Profile.vue';
279
278
 
@@ -291,6 +290,9 @@ export default {
291
290
  },
292
291
  currentCompany() {
293
292
  return this.$store.state.company.currentCompany;
293
+ },
294
+ userHasBirthDate() {
295
+ return !!(this.userData && this.userData.user_complementary_information && this.userData.user_complementary_information.birth);
294
296
  }
295
297
  },
296
298
  props: {
@@ -321,7 +323,7 @@ export default {
321
323
  },
322
324
  getAge(){
323
325
  const userAge = this.userData.user_complementary_information.birth;
324
- return moment().diff(userAge, 'years');
326
+ return this.$moment().diff(userAge, 'years');
325
327
  },
326
328
  highlightText(search, text) {
327
329
  if (search.length < 2) return text;
@@ -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.24",
3
+ "version": "1.1.26",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "private": false,