Skip to content

Commit fd78eca

Browse files
committed
Add back a couple element components used in tests
1 parent 35bfb4d commit fd78eca

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/lib/internal/elements/A.svelte

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script lang="ts">
2+
import type { ActionArray } from "$lib/hooks/use-actions";
3+
import { useActions } from "$lib/hooks/use-actions";
4+
import { get_current_component } from "svelte/internal";
5+
import { forwardEventsBuilder } from "../forwardEventsBuilder";
6+
7+
export let use: ActionArray = [];
8+
export let el: HTMLAnchorElement | null = null;
9+
const forwardEvents = forwardEventsBuilder(get_current_component());
10+
11+
export let href = "javascript:void(0);";
12+
</script>
13+
14+
<a
15+
bind:this={el}
16+
use:useActions={use}
17+
use:forwardEvents
18+
{href}
19+
{...$$restProps}
20+
>
21+
<slot />
22+
</a>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script lang="ts">
2+
import type { ActionArray } from "$lib/hooks/use-actions";
3+
import { useActions } from "$lib/hooks/use-actions";
4+
import { get_current_component } from "svelte/internal";
5+
import { forwardEventsBuilder } from "../forwardEventsBuilder";
6+
export let use: ActionArray = [];
7+
export let el: HTMLButtonElement | null = null;
8+
const forwardEvents = forwardEventsBuilder(get_current_component());
9+
</script>
10+
11+
<button bind:this={el} use:useActions={use} use:forwardEvents {...$$restProps}>
12+
<slot />
13+
</button>

0 commit comments

Comments
 (0)