@functionalcms/svelte-components 4.14.1 → 4.14.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.
@@ -24,11 +24,13 @@
24
24
  maxSize = Infinity,
25
25
  minSize = 0,
26
26
  multiple = false,
27
+ dropzoneText = undefined,
27
28
  preventDropOnDocument = true,
28
29
  disableDropzoneClick = false,
29
30
  disableDropzoneKeydown = false,
30
31
  disableDropzoneDrag = false,
31
32
  name = '',
33
+ appendOnDrop = false,
32
34
  inputElement = $bindable(),
33
35
  required = false,
34
36
  dropzoneElement = $bindable(),
@@ -195,6 +197,11 @@
195
197
  const dataTransfer = new DataTransfer();
196
198
  const incomingFiles = acceptedFiles;
197
199
  incomingFiles.forEach((v) => dataTransfer.items.add(v));
200
+ if (appendOnDrop) {
201
+ for(const file of inputElement.files || []) {
202
+ dataTransfer.items.add(file);
203
+ }
204
+ }
198
205
  inputElement.files = dataTransfer.files;
199
206
  }
200
207
  }
@@ -210,9 +217,10 @@
210
217
  );
211
218
 
212
219
  let defaultPlaceholderString = $derived(
213
- multiple
214
- ? "Drag 'n' drop some files here, or click to select files"
215
- : "Drag 'n' drop a file here, or click to select a file"
220
+ dropzoneText ||
221
+ (multiple
222
+ ? "Drag 'n' drop some files here, or click to select files"
223
+ : "Drag 'n' drop a file here, or click to select a file")
216
224
  );
217
225
 
218
226
  // allow the entire document to be a drag target
@@ -41,6 +41,7 @@ export interface DropzoneProps {
41
41
  maxSize?: number;
42
42
  minSize?: number;
43
43
  multiple?: boolean;
44
+ dropzoneText?: string;
44
45
  maxFileCountPerUpload?: number;
45
46
  preventDropOnDocument?: boolean;
46
47
  disableDropzoneClick?: boolean;
@@ -50,6 +51,7 @@ export interface DropzoneProps {
50
51
  required?: boolean;
51
52
  inputElement?: HTMLInputElement;
52
53
  dropzoneElement?: HTMLElement | undefined;
54
+ appendOnDrop: boolean;
53
55
  CustomDropzone?: Snippet<[CustomDropzoneProps]> | undefined;
54
56
  children?: Snippet;
55
57
  onDragenter?: DropzoneEventHandler<DataTransferItem>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.14.1",
3
+ "version": "4.14.3",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [