@enso-ui/notifications 2.0.10 → 2.0.14
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,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<div class="level is-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
<
|
|
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
|
-
</
|
|
30
|
-
</
|
|
29
|
+
</template>
|
|
30
|
+
</core-toastr-position>
|
|
31
31
|
</div>
|
|
32
|
-
</
|
|
33
|
-
</
|
|
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
|
|
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">
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
<div class="level-item is-marginless"
|
|
27
27
|
v-if="notifications.length">
|
|
28
|
-
<a class="button is-warning
|
|
28
|
+
<a class="button is-warning ml-1"
|
|
29
29
|
@click="destroyAll">
|
|
30
30
|
<span>{{ i18n("Clear all") }}</span>
|
|
31
31
|
<span class="icon is-small">
|
|
@@ -95,6 +95,11 @@ export default {
|
|
|
95
95
|
|
|
96
96
|
inject: ['errorHandler', 'i18n', 'route', 'routerErrorHandler'],
|
|
97
97
|
|
|
98
|
+
emits: [
|
|
99
|
+
'read-notification', 'read-all-notifications',
|
|
100
|
+
'destroy-notification', 'destroy-all-notification',
|
|
101
|
+
],
|
|
102
|
+
|
|
98
103
|
components: { Fa, Fade },
|
|
99
104
|
|
|
100
105
|
data: () => ({
|
|
@@ -149,7 +154,7 @@ export default {
|
|
|
149
154
|
},
|
|
150
155
|
updateAll() {
|
|
151
156
|
this.notifications.forEach(notification => {
|
|
152
|
-
notification.read_at = notification.read_at || format(new Date(), 'Y-
|
|
157
|
+
notification.read_at = notification.read_at || format(new Date(), 'Y-M-D H:i:s');
|
|
153
158
|
});
|
|
154
159
|
|
|
155
160
|
this.unreadCount = 0;
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
|
|
18
18
|
created() {
|
|
19
19
|
if (this.toastrPosition) {
|
|
20
|
-
this.toastr.
|
|
20
|
+
this.toastr.position(this.toastrPosition).reset();
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
...mapActions('preferences', ['setToastrPosition']),
|
|
26
26
|
update(position) {
|
|
27
27
|
this.setToastrPosition(position);
|
|
28
|
-
this.toastr.
|
|
28
|
+
this.toastr.position(position).reset();
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
|