mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
breaking(types): type arrays as read-only (#1335)
Closes #1259 * breaking(types): type arrays as read-only * Run "yarn build:docs" * test: assert read-only arrays
This commit is contained in:
parent
1a904dda36
commit
260bf4e040
34 changed files with 257 additions and 192 deletions
|
@ -6,8 +6,15 @@
|
|||
FileUploaderItem,
|
||||
FileUploaderSkeleton,
|
||||
} from "../types";
|
||||
import type { FileUploaderProps } from "../types/FileUploader/FileUploader.svelte";
|
||||
|
||||
let fileUploader: FileUploader;
|
||||
let files: FileUploaderProps["files"] = [];
|
||||
|
||||
$: {
|
||||
// @ts-expect-error
|
||||
files[0] = null;
|
||||
}
|
||||
|
||||
$: fileUploader?.clearFiles();
|
||||
</script>
|
||||
|
@ -27,6 +34,7 @@
|
|||
labelDescription="Only JPEG files are accepted."
|
||||
accept="{['.jpg', '.jpeg']}"
|
||||
status="complete"
|
||||
bind:files
|
||||
on:add="{(e) => {
|
||||
console.log(e.detail); // File[]
|
||||
}}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue