@enso-ui/notifications 2.0.9 → 2.0.13

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/notifications",
3
- "version": "2.0.9",
3
+ "version": "2.0.13",
4
4
  "description": "Basic notifications package",
5
5
  "main": "src/bulma/pages/Index.vue",
6
6
  "scripts": {
@@ -25,10 +25,10 @@
25
25
  "@enso-ui/dropdown": "^3.0",
26
26
  "@enso-ui/toastr": "^3.0",
27
27
  "@enso-ui/ui": "^5.0",
28
+ "@enso-ui/transitions": "^2.0",
28
29
  "@fortawesome/fontawesome-svg-core": "^1.2.2",
29
30
  "@fortawesome/free-solid-svg-icons": "^5.2.0",
30
31
  "@fortawesome/vue-fontawesome": "3.0.0-5",
31
- "animate.css": "^4.0.0",
32
32
  "favico.js": "^0.3.10",
33
33
  "lodash": "^4.17.20",
34
34
  "vue": "^3.0",
@@ -1,14 +1,14 @@
1
1
  <template>
2
- <core-toastr-position>
3
- <template #default="{ positions, toastrPosition, update }">
4
- <div class="level is-mobile">
5
- <div class="level-left">
6
- <div class="level-item is-marginless">
7
- {{ i18n('Notifications') }}
8
- </div>
9
- </div>
10
- <div class="level-right">
11
- <div class="level-item toastr-position">
2
+ <div class="level is-mobile">
3
+ <div class="level-left">
4
+ <div class="level-item is-marginless">
5
+ {{ i18n('Notifications') }}
6
+ </div>
7
+ </div>
8
+ <div class="level-right">
9
+ <div class="level-item toastr-position">
10
+ <core-toastr-position>
11
+ <template #default="{ positions, toastrPosition, update }">
12
12
  <dropdown>
13
13
  <template #label>
14
14
  <figure class="image is-16x16 ml-1">
@@ -26,11 +26,11 @@
26
26
  </dropdown-item>
27
27
  </template>
28
28
  </dropdown>
29
- </div>
30
- </div>
29
+ </template>
30
+ </core-toastr-position>
31
31
  </div>
32
- </template>
33
- </core-toastr-position>
32
+ </div>
33
+ </div>
34
34
  </template>
35
35
 
36
36
  <script>
@@ -4,7 +4,7 @@
4
4
  <div class="level is-mobile">
5
5
  <div class="level-item"
6
6
  v-if="notifications.length">
7
- <a class="button is-success is-outlined"
7
+ <a class="button is-success"
8
8
  @click="readAll">
9
9
  <span>{{ i18n("Mark all read") }}</span>
10
10
  <span class="icon is-small">
@@ -13,17 +13,19 @@
13
13
  </a>
14
14
  </div>
15
15
  <div class="level-item">
16
- <a :class="['button animate__animated animate__fadeIn', {'is-loading': loading}]"
17
- @click="fetch">
18
- <span>{{ i18n('Reload') }}</span>
19
- <span class="icon is-small">
20
- <fa icon="sync"/>
21
- </span>
22
- </a>
16
+ <fade>
17
+ <a :class="['button', {'is-loading': loading}]"
18
+ @click="fetch">
19
+ <span>{{ i18n('Reload') }}</span>
20
+ <span class="icon is-small">
21
+ <fa icon="sync"/>
22
+ </span>
23
+ </a>
24
+ </fade>
23
25
  </div>
24
26
  <div class="level-item is-marginless"
25
27
  v-if="notifications.length">
26
- <a class="button is-warning is-outlined ml-1"
28
+ <a class="button is-warning ml-1"
27
29
  @click="destroyAll">
28
30
  <span>{{ i18n("Clear all") }}</span>
29
31
  <span class="icon is-small">
@@ -74,7 +76,7 @@
74
76
  </template>
75
77
 
76
78
  <script>
77
- import 'animate.css';
79
+ import { Fade } from '@enso-ui/transitions';
78
80
  import debounce from 'lodash/debounce';
79
81
  import { mapState } from 'vuex';
80
82
  import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
@@ -93,7 +95,12 @@ export default {
93
95
 
94
96
  inject: ['errorHandler', 'i18n', 'route', 'routerErrorHandler'],
95
97
 
96
- components: { Fa },
98
+ emits: [
99
+ 'read-notification', 'read-all-notifications',
100
+ 'destroy-notification', 'destroy-all-notification',
101
+ ],
102
+
103
+ components: { Fa, Fade },
97
104
 
98
105
  data: () => ({
99
106
  paginate: 200,
@@ -147,7 +154,7 @@ export default {
147
154
  },
148
155
  updateAll() {
149
156
  this.notifications.forEach(notification => {
150
- notification.read_at = notification.read_at || format(new Date(), 'Y-MM-DD H:mm:s');
157
+ notification.read_at = notification.read_at || format(new Date(), 'Y-M-D H:i:s');
151
158
  });
152
159
 
153
160
  this.unreadCount = 0;