sprintify-ui 0.5.9 → 0.5.10
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/dist/sprintify-ui.es.js +3239 -3236
- package/dist/types/src/types/Notification.d.ts +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/BaseLayoutNotificationDropdown.vue +7 -2
- package/src/components/BaseLayoutNotificationItemContent.vue +14 -3
- package/src/components/BaseLayoutStackedConfigurable.stories.js +9 -0
- package/src/types/Notification.ts +1 -0
- package/src/types/index.ts +1 -0
package/package.json
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
:class="[iconClasses]"
|
|
20
20
|
/>
|
|
21
21
|
<BaseCounter
|
|
22
|
-
v-if="
|
|
22
|
+
v-if="unreadNotifications.length"
|
|
23
23
|
class="absolute top-0 right-0"
|
|
24
24
|
:size="counterSize"
|
|
25
|
-
:count="
|
|
25
|
+
:count="unreadNotifications.length"
|
|
26
26
|
/>
|
|
27
27
|
</div>
|
|
28
28
|
</template>
|
|
@@ -104,6 +104,11 @@ const props = defineProps({
|
|
|
104
104
|
},
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
+
const unreadNotifications = computed(() => {
|
|
108
|
+
return props.notificationsConfig.items
|
|
109
|
+
.filter(i => !i.read);
|
|
110
|
+
});
|
|
111
|
+
|
|
107
112
|
const breakpoints = useBreakpoints();
|
|
108
113
|
|
|
109
114
|
const mobile = computed((): boolean => {
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
:class="[active ? 'bg-slate-100' : '']"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
|
-
class="text-sm leading-tight
|
|
7
|
+
class="text-sm leading-tight"
|
|
8
|
+
:class="textClasses"
|
|
8
9
|
v-html="notification.text"
|
|
9
10
|
/>
|
|
10
11
|
<BaseDisplayRelativeTime
|
|
@@ -12,7 +13,10 @@
|
|
|
12
13
|
v-slot="{ readableDate }"
|
|
13
14
|
:value="notification.created_at"
|
|
14
15
|
>
|
|
15
|
-
<p
|
|
16
|
+
<p
|
|
17
|
+
class="mt-1 text-xs text-slate-400"
|
|
18
|
+
:class="[notification.read ? 'opacity-70' : 'opacity-100']"
|
|
19
|
+
>
|
|
16
20
|
{{ readableDate }}
|
|
17
21
|
</p>
|
|
18
22
|
</BaseDisplayRelativeTime>
|
|
@@ -23,8 +27,15 @@
|
|
|
23
27
|
import { Notification } from '@/types/Notification';
|
|
24
28
|
import BaseDisplayRelativeTime from './BaseDisplayRelativeTime.vue';
|
|
25
29
|
|
|
26
|
-
defineProps<{
|
|
30
|
+
const props = defineProps<{
|
|
27
31
|
active: boolean;
|
|
28
32
|
notification: Notification;
|
|
29
33
|
}>();
|
|
34
|
+
|
|
35
|
+
const textClasses = computed(() => {
|
|
36
|
+
return props.notification.read ?
|
|
37
|
+
'text-slate-500' :
|
|
38
|
+
"text-black font-medium before:bg-red-500 before:inline-block before:rounded-full before:mr-1 before:relative before:-top-px before:h-2 before:w-2 before:content-['']";
|
|
39
|
+
});
|
|
40
|
+
|
|
30
41
|
</script>
|
|
@@ -91,12 +91,21 @@ export default {
|
|
|
91
91
|
id: '1',
|
|
92
92
|
text: 'You have a new message',
|
|
93
93
|
to: '/',
|
|
94
|
+
read: false,
|
|
94
95
|
created_at: '2022-12-08T19:16:10Z',
|
|
95
96
|
},
|
|
96
97
|
{
|
|
97
98
|
id: '2',
|
|
98
99
|
text: 'Your inbox is now full. Please empty your inbox before it goes bang.',
|
|
99
100
|
to: '/',
|
|
101
|
+
read: true,
|
|
102
|
+
created_at: '2022-01-01T00:00:00',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: '3',
|
|
106
|
+
text: 'You are running out of credits. Please top up your account.',
|
|
107
|
+
to: '/',
|
|
108
|
+
read: true,
|
|
100
109
|
created_at: '2022-01-01T00:00:00',
|
|
101
110
|
},
|
|
102
111
|
],
|