@enso-ui/users 2.0.7 → 2.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/users",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Basic users package",
5
5
  "main": "bulma/index.js",
6
6
  "scripts": {
@@ -1,15 +1,10 @@
1
1
  <template>
2
2
  <core-profile-control>
3
- <template #default="{ user, avatarLink, hide, isTouch, visitProfile, toggle, visible }">
3
+ <template #default="{ user, hide, isTouch, visitProfile, toggle, visible }">
4
4
  <a class="navbar-item"
5
5
  @click="visitProfile()"
6
6
  v-if="isTouch">
7
- <img class="is-rounded"
8
- :src="avatarLink">
9
- <span v-if="!isTouch"
10
- class="ml-1">
11
- {{ user.person.appellative || user.person.name }}
12
- </span>
7
+ <avatar :user="user"/>
13
8
  </a>
14
9
  <div v-click-outside="hide"
15
10
  :class="[
@@ -19,15 +14,13 @@
19
14
  ]" v-else>
20
15
  <a class="navbar-link is-arrowless"
21
16
  @click="toggle()">
22
- <img class="is-rounded"
23
- :src="avatarLink">
24
- <span v-if="!isTouch"
25
- class="ml-1">
17
+ <avatar :user="user"/>
18
+ <span class="ml-1">
26
19
  {{ user.person.appellative || user.person.name }}
27
20
  </span>
28
21
  </a>
29
- <div v-if="visible"
30
- class="navbar-dropdown is-right">
22
+ <div class="navbar-dropdown is-right"
23
+ v-if="visible">
31
24
  <div class="user-panel p-2">
32
25
  <avatar class="is-96x96"
33
26
  :user="user"/>
@@ -1,19 +1,15 @@
1
1
  <template>
2
- <figure class="image avatar"
3
- v-tooltip="tooltip">
2
+ <figure class="image avatar">
4
3
  <img class="is-rounded"
5
- :src="route('core.avatars.show', user.avatar.id)">
4
+ :src="link">
6
5
  </figure>
7
6
  </template>
8
7
 
9
8
  <script>
10
- import { VTooltip } from 'v-tooltip';
11
9
 
12
10
  export default {
13
11
  name: 'Avatar',
14
12
 
15
- directives: { tooltip: VTooltip },
16
-
17
13
  inject: ['route'],
18
14
 
19
15
  props: {
@@ -24,11 +20,14 @@ export default {
24
20
  },
25
21
 
26
22
  computed: {
23
+ link() {
24
+ return this.route('core.avatars.show', this.user.avatar.id);
25
+ },
27
26
  tooltip() {
28
27
  return this.user.person?.appellative
29
28
  ?? this.user.person?.name;
30
- }
31
- }
29
+ },
30
+ },
32
31
  };
33
32
  </script>
34
33
 
@@ -35,7 +35,6 @@ export default {
35
35
  user: this.user,
36
36
  isTouch: this.isTouch,
37
37
  visitProfile: this.visitProfile,
38
- avatarLink: this.route('core.avatars.show', this.user.avatar.id),
39
38
  hide: this.hide,
40
39
  toggle: this.toggle,
41
40
  visible: this.visible,