Add more Dialog tests

This commit is contained in:
Ryan Gossiaux
2021-12-26 18:08:03 -08:00
parent 08021bbf21
commit 9bd9901ef6
3 changed files with 233 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
onClose?: HandlerType;
onFocus?: HandlerType;
onKeydown?: HandlerType;
onSubmit?: HandlerType;
}
type SingleComponent =
| string
@@ -36,12 +37,14 @@
let onClose: HandlerType = () => {};
let onFocus: HandlerType = () => {};
let onKeydown: HandlerType = () => {};
let onSubmit: HandlerType = () => {};
if (allProps && typeof allProps !== "string" && isSingleComponent(allProps)) {
({
onChange = onChange,
onClose = onClose,
onFocus = onFocus,
onKeydown = onKeydown,
onSubmit = onSubmit,
...spreadProps
} = allProps[1] || {});
}
@@ -59,6 +62,7 @@
on:close={onClose}
on:focus={onFocus}
on:keydown={onKeydown}
on:submit={onSubmit}
>
<svelte:self allProps={allProps[2]} />
</svelte:component>