@functionalcms/svelte-components 4.12.5 → 4.12.7
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.
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
onUpload,
|
|
13
13
|
onFileRejected,
|
|
14
14
|
accept,
|
|
15
|
-
|
|
15
|
+
css,
|
|
16
16
|
...rest
|
|
17
|
-
}: FileDropZoneProps = $props();
|
|
17
|
+
}: Partial<FileDropZoneProps> = $props();
|
|
18
18
|
|
|
19
19
|
if (maxFiles !== undefined && fileCount === undefined) {
|
|
20
20
|
console.warn(
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
aria-disabled={!canUploadFiles}
|
|
125
125
|
class={cn(
|
|
126
126
|
'flex h-48 w-full place-items-center justify-center rounded-lg border-2 border-dashed border-border p-6 transition-all hover:cursor-pointer hover:bg-accent/25 aria-disabled:opacity-50 aria-disabled:hover:cursor-not-allowed',
|
|
127
|
-
|
|
127
|
+
css ?? ''
|
|
128
128
|
)}
|
|
129
129
|
>
|
|
130
130
|
{#if children}
|
|
@@ -174,6 +174,7 @@
|
|
|
174
174
|
{...rest}
|
|
175
175
|
disabled={!canUploadFiles}
|
|
176
176
|
{id}
|
|
177
|
+
name={id}
|
|
177
178
|
{accept}
|
|
178
179
|
multiple={maxFiles === undefined || maxFiles - (fileCount ?? 0) > 1}
|
|
179
180
|
type="file"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FileDropZoneProps } from './dropzone.js';
|
|
2
|
-
declare const Dropzone: import("svelte").Component<FileDropZoneProps
|
|
2
|
+
declare const Dropzone: import("svelte").Component<Partial<FileDropZoneProps>, {}, "">;
|
|
3
3
|
type Dropzone = ReturnType<typeof Dropzone>;
|
|
4
4
|
export default Dropzone;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
translate = translator({})
|
|
36
36
|
}: Partial<Props> = $props();
|
|
37
37
|
|
|
38
|
-
const { form, enhance } = superForm(superform);
|
|
38
|
+
const { form, errors, enhance } = superForm(superform);
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
{#snippet renderButtons()}
|
|
@@ -92,6 +92,9 @@
|
|
|
92
92
|
value={$form[field.name]}
|
|
93
93
|
/>
|
|
94
94
|
{/if}
|
|
95
|
+
{#if $errors[field.name]}
|
|
96
|
+
<span class="error">{$errors[field.name]}</span>
|
|
97
|
+
{/if}
|
|
95
98
|
{/each}
|
|
96
99
|
</div>
|
|
97
100
|
|