@marianmeres/stuic 1.75.0 → 1.76.0
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.
|
@@ -131,66 +131,63 @@ const _isFn = (v) => typeof v === "function";
|
|
|
131
131
|
</script>
|
|
132
132
|
|
|
133
133
|
{#if $notifications.length}
|
|
134
|
-
<
|
|
135
|
-
<div class={
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<!-- svelte-ignore
|
|
134
|
+
<div class={_wrapClass} aria-live="assertive">
|
|
135
|
+
<div class={_wrapInnerClass}>
|
|
136
|
+
{#each $notifications as n}
|
|
137
|
+
{@const iconFn = _iconFn(n)}
|
|
138
|
+
<!-- use your own component -->
|
|
139
|
+
{#if n?.component}
|
|
140
|
+
<svelte:component
|
|
141
|
+
this={n.component.component || n.component}
|
|
142
|
+
{...n.component.props || {}}
|
|
143
|
+
notification={n}
|
|
144
|
+
{notifications}
|
|
145
|
+
/>
|
|
146
|
+
{:else}
|
|
147
|
+
<!-- svelte-ignore
|
|
149
148
|
a11y-click-events-have-key-events
|
|
150
149
|
a11y-no-noninteractive-element-interactions
|
|
151
150
|
a11y-mouse-events-have-key-events -->
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
>
|
|
164
|
-
{
|
|
165
|
-
|
|
166
|
-
{n.count}
|
|
167
|
-
</div>
|
|
168
|
-
{/if}
|
|
169
|
-
|
|
170
|
-
{#if _isFn(iconFn)}
|
|
171
|
-
<div class={_iconClass(n)}>{@html iconFn()}</div>
|
|
172
|
-
{/if}
|
|
173
|
-
|
|
174
|
-
<div class={_contentClass(n)}>
|
|
175
|
-
<Thc
|
|
176
|
-
thc={n.content}
|
|
177
|
-
forceAsHtml={n.forceAsHtml ?? forceAsHtml}
|
|
178
|
-
notification={n}
|
|
179
|
-
{notifications}
|
|
180
|
-
/>
|
|
151
|
+
<div
|
|
152
|
+
transition:fade|global={{ duration: 200 }}
|
|
153
|
+
class={_boxClass(n)}
|
|
154
|
+
class:cursor-pointer={typeof n.onClick === 'function'}
|
|
155
|
+
data-notification-type={n.type}
|
|
156
|
+
data-notification-multiple={n.count > 1 ? true : undefined}
|
|
157
|
+
role="alert"
|
|
158
|
+
on:mouseover={() => notifications.event(n.id, notifications.EVENT.MOUSEOVER)}
|
|
159
|
+
on:mouseout={() => notifications.event(n.id, notifications.EVENT.MOUSEOUT)}
|
|
160
|
+
on:click={() => notifications.event(n.id, notifications.EVENT.CLICK)}
|
|
161
|
+
>
|
|
162
|
+
{#if n.count > 1}
|
|
163
|
+
<div class={_countClass(n)}>
|
|
164
|
+
{n.count}
|
|
181
165
|
</div>
|
|
166
|
+
{/if}
|
|
182
167
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
168
|
+
{#if _isFn(iconFn)}
|
|
169
|
+
<div class={_iconClass(n)}>{@html iconFn()}</div>
|
|
170
|
+
{/if}
|
|
171
|
+
|
|
172
|
+
<div class={_contentClass(n)}>
|
|
173
|
+
<Thc
|
|
174
|
+
thc={n.content}
|
|
175
|
+
forceAsHtml={n.forceAsHtml ?? forceAsHtml}
|
|
176
|
+
notification={n}
|
|
177
|
+
{notifications}
|
|
178
|
+
/>
|
|
190
179
|
</div>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
180
|
+
|
|
181
|
+
<button
|
|
182
|
+
class={_buttonClass(n)}
|
|
183
|
+
aria-label={ariaCloseLabel}
|
|
184
|
+
on:click|preventDefault|stopPropagation={() => notifications.remove(n.id)}
|
|
185
|
+
>
|
|
186
|
+
<X class={_xClass(n)} />
|
|
187
|
+
</button>
|
|
188
|
+
</div>
|
|
189
|
+
{/if}
|
|
190
|
+
{/each}
|
|
194
191
|
</div>
|
|
195
|
-
</
|
|
192
|
+
</div>
|
|
196
193
|
{/if}
|