mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
Fix TypeScript definitions; function declarations should be typed as accessors, not props (#740)
* chore(deps-dev): upgrade svelte to v0.8.1 * chore: regenerate types to correctly type function declarations * test: fix svelte-check warnings
This commit is contained in:
parent
b6fa25c3e7
commit
18c6f03224
9 changed files with 951 additions and 22 deletions
|
@ -1,7 +1,8 @@
|
|||
<script lang="ts">
|
||||
import { Breakpoint } from "../types";
|
||||
import { BreakpointSize } from "../types/Breakpoint/Breakpoint";
|
||||
|
||||
let size;
|
||||
let size: BreakpointSize;
|
||||
</script>
|
||||
|
||||
<Breakpoint
|
||||
|
|
|
@ -35,7 +35,7 @@ export function subtract(a: number, b: number) {
|
|||
hideCloseButton
|
||||
/>
|
||||
|
||||
<CodeSnippet copy="{(text) => {}}"
|
||||
<CodeSnippet copy="{(text) => text}"
|
||||
>yarn add -D carbon-components-svelte</CodeSnippet
|
||||
>
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
text="text"
|
||||
on:click
|
||||
on:copy
|
||||
copy="{(text) => {}}"
|
||||
copy="{(text) => text}"
|
||||
feedback="Copied to clipboard"
|
||||
/>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
let storage: LocalStorage;
|
||||
let toggled = false;
|
||||
let events = [];
|
||||
|
||||
$: if (storage) storage.clearItem();
|
||||
$: if (storage) storage.clearAll();
|
||||
</script>
|
||||
|
||||
<LocalStorage
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
primaryButtonText="Confirm"
|
||||
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary="{({ detail }) => (open = false)}"
|
||||
on:click:button--secondary="{({ detail }) => {
|
||||
console.log(detail);
|
||||
open = false;
|
||||
}}"
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue