@functionalcms/svelte-components 5.26.2 → 5.27.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.
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
children: Snippet<[Array<any>]>;
|
|
7
|
+
empty: Snippet;
|
|
7
8
|
buttons: Snippet;
|
|
8
9
|
header: string;
|
|
9
10
|
content: Promise<any>;
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
buttons,
|
|
17
18
|
header,
|
|
18
19
|
content,
|
|
20
|
+
empty,
|
|
19
21
|
loading = 'Loading...',
|
|
20
22
|
error = 'An error occurred'
|
|
21
23
|
}: Props = $props();
|
|
@@ -35,7 +37,13 @@
|
|
|
35
37
|
</ButtonGroup>
|
|
36
38
|
</header>
|
|
37
39
|
<div>
|
|
38
|
-
{
|
|
40
|
+
{#if items.length > 0}
|
|
41
|
+
{@render children?.(items)}
|
|
42
|
+
{:else if empty}
|
|
43
|
+
{@render empty?.()}
|
|
44
|
+
{:else}
|
|
45
|
+
<p class="text-center text-gray-500">No items found</p>
|
|
46
|
+
{/if}
|
|
39
47
|
</div>
|
|
40
48
|
</article>
|
|
41
49
|
{:catch err}
|
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
|
|
174
174
|
{#snippet renderFile(field: FilePickerField)}
|
|
175
175
|
<Label class={field.labelClass}>{field.label}</Label>
|
|
176
|
+
{@const restProps = { }}
|
|
176
177
|
<Fileupload
|
|
177
178
|
id={field.id}
|
|
178
179
|
name={field.id}
|
|
@@ -181,6 +182,8 @@
|
|
|
181
182
|
disabled={field.disabled}
|
|
182
183
|
class={field.class}
|
|
183
184
|
multiple={field.multiple}
|
|
185
|
+
accept={field.isCamera ? 'image/*' : undefined}
|
|
186
|
+
capture={field.isCamera ? 'environment' : undefined}
|
|
184
187
|
/>
|
|
185
188
|
{/snippet}
|
|
186
189
|
|