@fy-/fws-vue 0.7.2 → 0.7.3
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/components/ui/DefaultNotif.vue +26 -69
- package/package.json +1 -1
|
@@ -55,6 +55,7 @@ const onCall = (data: NotifProps) => {
|
|
|
55
55
|
ctaText: data.ctaText,
|
|
56
56
|
ctaLink: data.ctaLink,
|
|
57
57
|
time: data.time,
|
|
58
|
+
type: data.type,
|
|
58
59
|
ctaAction: data.ctaAction,
|
|
59
60
|
};
|
|
60
61
|
|
|
@@ -77,91 +78,47 @@ onUnmounted(() => {
|
|
|
77
78
|
<template>
|
|
78
79
|
<ScaleTransition>
|
|
79
80
|
<div
|
|
80
|
-
id="
|
|
81
|
-
|
|
82
|
-
class="w-full max-w-xs p-4 text-fv-neutral-500 bg-white rounded-lg shadow dark:bg-fv-neutral-800 dark:text-fv-neutral-400 absolute bottom-4 right-4 z-[16]"
|
|
81
|
+
id="alert-additional-content-1"
|
|
82
|
+
class="p-4 mb-4"
|
|
83
83
|
role="alert"
|
|
84
|
+
:class="{
|
|
85
|
+
'text-fv-neutral-800 border border-fv-neutral-300 rounded-lg bg-fv-neutral-50 dark:bg-gray-800 dark:text-fv-neutral-400 dark:border-fv-neutral-800':
|
|
86
|
+
currentNotif.type === 'info',
|
|
87
|
+
'text-red-800 border border-red-300 rounded-lg bg-red-50 dark:bg-red-800 dark:text-red-300 dark:border-red-800':
|
|
88
|
+
currentNotif.type === 'warning',
|
|
89
|
+
'text-green-800 border border-green-300 rounded-lg bg-green-50 dark:bg-green-800 dark:text-green-300 dark:border-green-800':
|
|
90
|
+
currentNotif.type === 'success',
|
|
91
|
+
}"
|
|
84
92
|
v-if="currentNotif !== null"
|
|
85
93
|
>
|
|
86
|
-
<div class="flex">
|
|
94
|
+
<div class="flex items-center">
|
|
87
95
|
<img
|
|
88
|
-
class="w-
|
|
96
|
+
class="flex-shrink-0 w-4 h-4 me-2"
|
|
89
97
|
:src="currentNotif.imgSrc"
|
|
90
98
|
:alt="currentNotif.title"
|
|
91
99
|
v-if="currentNotif.imgSrc"
|
|
92
100
|
/>
|
|
93
101
|
<component
|
|
94
102
|
:is="currentNotif.imgIcon"
|
|
95
|
-
class="w-
|
|
103
|
+
class="flex-shrink-0 w-4 h-4 me-2"
|
|
96
104
|
v-else
|
|
97
105
|
/>
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}"
|
|
108
|
-
>
|
|
109
|
-
{{ currentNotif.title }}
|
|
110
|
-
</span>
|
|
111
|
-
<div
|
|
112
|
-
class="mb-2 text-sm font-normal"
|
|
113
|
-
v-if="currentNotif.content"
|
|
114
|
-
:class="{
|
|
115
|
-
'text-fv-neutral-900 dark:text-white':
|
|
116
|
-
currentNotif.type === 'info',
|
|
117
|
-
'text-red-900 dark:text-red-300': currentNotif.type === 'warning',
|
|
118
|
-
'text-green-900 dark:text-green-300':
|
|
119
|
-
currentNotif.type === 'success',
|
|
120
|
-
}"
|
|
121
|
-
>
|
|
122
|
-
{{ currentNotif.content }}
|
|
123
|
-
</div>
|
|
124
|
-
<router-link
|
|
125
|
-
v-if="currentNotif.ctaText && currentNotif.ctaLink"
|
|
126
|
-
:to="currentNotif.ctaLink"
|
|
127
|
-
class="btn primary small"
|
|
128
|
-
>{{ currentNotif.ctaText }}</router-link
|
|
129
|
-
>
|
|
130
|
-
<button
|
|
131
|
-
v-else-if="currentNotif.ctaText && currentNotif.ctaAction"
|
|
132
|
-
@click="
|
|
133
|
-
() => {
|
|
134
|
-
// @ts-ignore
|
|
135
|
-
currentNotif.ctaAction();
|
|
136
|
-
hideNotif();
|
|
137
|
-
}
|
|
138
|
-
"
|
|
139
|
-
class="btn primary small"
|
|
140
|
-
>
|
|
141
|
-
{{ currentNotif.ctaText }}
|
|
142
|
-
</button>
|
|
143
|
-
</div>
|
|
106
|
+
<span class="sr-only">Info</span>
|
|
107
|
+
<h3 class="text-lg font-medium" v-text="currentNotif.title" />
|
|
108
|
+
</div>
|
|
109
|
+
<div
|
|
110
|
+
class="mt-2 mb-4 text-sm"
|
|
111
|
+
v-text="currentNotif.content"
|
|
112
|
+
v-if="currentNotif.content"
|
|
113
|
+
/>
|
|
114
|
+
<div class="flex">
|
|
144
115
|
<button
|
|
145
116
|
type="button"
|
|
146
|
-
class="
|
|
117
|
+
class="btn primary small"
|
|
118
|
+
@click="hideNotif"
|
|
147
119
|
aria-label="Close"
|
|
148
120
|
>
|
|
149
|
-
|
|
150
|
-
<svg
|
|
151
|
-
class="w-3 h-3"
|
|
152
|
-
aria-hidden="true"
|
|
153
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
154
|
-
fill="none"
|
|
155
|
-
viewBox="0 0 14 14"
|
|
156
|
-
>
|
|
157
|
-
<path
|
|
158
|
-
stroke="currentColor"
|
|
159
|
-
stroke-linecap="round"
|
|
160
|
-
stroke-linejoin="round"
|
|
161
|
-
stroke-width="2"
|
|
162
|
-
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
|
|
163
|
-
/>
|
|
164
|
-
</svg>
|
|
121
|
+
{{ $t("dismiss_cta") }}
|
|
165
122
|
</button>
|
|
166
123
|
</div>
|
|
167
124
|
</div>
|