@r2digisolutions/components 0.21.15 → 0.21.16
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.
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
{:else}
|
|
206
206
|
{#if check === 'box'}
|
|
207
207
|
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
|
|
208
|
-
<div class="shrink-0" onclick={(e) => e.stopPropagation()}>
|
|
208
|
+
<div class="flex shrink-0 items-center" onclick={(e) => e.stopPropagation()}>
|
|
209
209
|
<SelectionBox
|
|
210
210
|
checked={selected}
|
|
211
211
|
size="md"
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
{/if}
|
|
229
229
|
|
|
230
230
|
{#if image || leading}
|
|
231
|
-
<div class="shrink-0">
|
|
231
|
+
<div class="flex shrink-0 items-center">
|
|
232
232
|
{#if image}
|
|
233
233
|
<img src={image} alt={imageAlt} class="h-11 w-11 rounded-lg object-cover" />
|
|
234
234
|
{:else if leading}
|
|
@@ -237,15 +237,22 @@
|
|
|
237
237
|
</div>
|
|
238
238
|
{/if}
|
|
239
239
|
|
|
240
|
-
<div class="min-w-0 flex-1">
|
|
240
|
+
<div class="flex min-w-0 flex-1 flex-col justify-center">
|
|
241
241
|
{#if children}
|
|
242
242
|
{@render children()}
|
|
243
243
|
{:else}
|
|
244
244
|
{#if title}
|
|
245
|
-
<p
|
|
245
|
+
<p
|
|
246
|
+
class={[
|
|
247
|
+
'truncate text-sm font-medium text-primary',
|
|
248
|
+
!description && 'leading-none'
|
|
249
|
+
]}
|
|
250
|
+
>
|
|
251
|
+
{title}
|
|
252
|
+
</p>
|
|
246
253
|
{/if}
|
|
247
254
|
{#if description}
|
|
248
|
-
<p class="mt-0.5 truncate text-xs text-muted">{description}</p>
|
|
255
|
+
<p class="mt-0.5 truncate text-xs leading-snug text-muted">{description}</p>
|
|
249
256
|
{/if}
|
|
250
257
|
{/if}
|
|
251
258
|
</div>
|
|
@@ -25,14 +25,16 @@
|
|
|
25
25
|
|
|
26
26
|
function addMany(raw: string) {
|
|
27
27
|
if (disabled) return;
|
|
28
|
+
// Comma / semicolon / newline — keep spaces so multi-word tags work (e.g. keywords).
|
|
28
29
|
const parts = raw
|
|
29
|
-
.split(/[
|
|
30
|
+
.split(/[,;\n]+/)
|
|
30
31
|
.map((p) => p.trim())
|
|
31
32
|
.filter(Boolean);
|
|
32
33
|
if (!parts.length) return;
|
|
33
34
|
let next = [...value];
|
|
34
35
|
for (const part of parts) {
|
|
35
|
-
|
|
36
|
+
const exists = next.some((t) => t.toLowerCase() === part.toLowerCase());
|
|
37
|
+
if (exists) continue;
|
|
36
38
|
if (max !== undefined && next.length >= max) break;
|
|
37
39
|
next.push(part);
|
|
38
40
|
}
|
|
@@ -61,9 +63,10 @@
|
|
|
61
63
|
|
|
62
64
|
function onPaste(e: ClipboardEvent) {
|
|
63
65
|
const text = e.clipboardData?.getData('text') ?? '';
|
|
64
|
-
if (!/[,;\
|
|
66
|
+
if (!/[,;\n]/.test(text)) return;
|
|
65
67
|
e.preventDefault();
|
|
66
|
-
|
|
68
|
+
const prefix = draft.trim() ? `${draft.trim()}, ` : '';
|
|
69
|
+
addMany(`${prefix}${text}`);
|
|
67
70
|
}
|
|
68
71
|
</script>
|
|
69
72
|
|