Skip to content

Commit

Permalink
fix(Checkbox): added event forwarding and use directive support (#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Vadim Eliseev <vadim.eliseev@vk.team>
  • Loading branch information
twister55 and Vadim Eliseev committed Nov 18, 2023
1 parent 39ddc9d commit d6700d8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/components/checkbox/Checkbox.svelte
@@ -1,15 +1,21 @@
<script lang="ts">
import { setContext } from 'svelte';
import { twMerge } from 'tailwind-merge';
import { get_current_component } from 'svelte/internal';
import { slide } from 'svelte/transition';
import { twMerge } from 'tailwind-merge';
import { nanoid } from 'nanoid';
import { forwardEventsBuilder, useActions, type ActionArray } from '$lib/actions';
import { exclude } from '$lib/utils/exclude';
export let name: string = nanoid();
export let value: string;
export let indeterminate = false;
export let disabled = false;
export let checked = false;
export let error: string | undefined = undefined;
export let use: ActionArray = [];
const forwardEvents = forwardEventsBuilder(get_current_component());
// TODO: allow checked status color prop
Expand Down Expand Up @@ -47,6 +53,9 @@
{value}
class={finalClass}
style={$$props.style}
use:useActions={use}
use:forwardEvents
{...exclude($$props, ['use', 'class', 'style', 'type', 'value', 'checked', 'disabled', 'name', 'htmlType'])}
/>
</div>
<div class="ml-3 text-sm">
Expand Down

1 comment on commit d6700d8

@vercel
Copy link

@vercel vercel bot commented on d6700d8 Nov 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

stwui – ./

stwui.vercel.app
stwui-git-main-n00nday.vercel.app
stwui-n00nday.vercel.app

Please sign in to comment.