bits-ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,6 +27,7 @@ const dispatch = createDispatcher();
|
|
|
27
27
|
{...builder} use:builder.action
|
|
28
28
|
{...$$restProps}
|
|
29
29
|
on:m-pointerleave={dispatch}
|
|
30
|
+
on:keydown
|
|
30
31
|
>
|
|
31
32
|
<slot {builder} />
|
|
32
33
|
</div>
|
|
@@ -38,6 +39,7 @@ const dispatch = createDispatcher();
|
|
|
38
39
|
{...builder} use:builder.action
|
|
39
40
|
{...$$restProps}
|
|
40
41
|
on:m-pointerleave={dispatch}
|
|
42
|
+
on:keydown
|
|
41
43
|
>
|
|
42
44
|
<slot {builder} />
|
|
43
45
|
</div>
|
|
@@ -48,6 +50,7 @@ const dispatch = createDispatcher();
|
|
|
48
50
|
{...builder} use:builder.action
|
|
49
51
|
{...$$restProps}
|
|
50
52
|
on:m-pointerleave={dispatch}
|
|
53
|
+
on:keydown
|
|
51
54
|
>
|
|
52
55
|
<slot {builder} />
|
|
53
56
|
</div>
|
|
@@ -58,12 +61,13 @@ const dispatch = createDispatcher();
|
|
|
58
61
|
{...builder} use:builder.action
|
|
59
62
|
{...$$restProps}
|
|
60
63
|
on:m-pointerleave={dispatch}
|
|
64
|
+
on:keydown
|
|
61
65
|
>
|
|
62
66
|
<slot {builder} />
|
|
63
67
|
</div>
|
|
64
68
|
{:else if $open}
|
|
65
69
|
{@const builder = $menu}
|
|
66
|
-
<div {...builder} use:builder.action {...$$restProps} on:m-pointerleave={dispatch}>
|
|
70
|
+
<div {...builder} use:builder.action {...$$restProps} on:m-pointerleave={dispatch} on:keydown>
|
|
67
71
|
<slot {builder} />
|
|
68
72
|
</div>
|
|
69
73
|
{/if}
|
|
@@ -17,7 +17,16 @@ const dispatch = createDispatcher();
|
|
|
17
17
|
<slot builder={$option({ value, disabled, label })} />
|
|
18
18
|
{:else}
|
|
19
19
|
{@const builder = $option({ value, disabled, label })}
|
|
20
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
{...builder} use:builder.action
|
|
22
|
+
{...$$restProps}
|
|
23
|
+
on:m-click={dispatch}
|
|
24
|
+
on:m-pointermove={dispatch}
|
|
25
|
+
on:focusin
|
|
26
|
+
on:keydown
|
|
27
|
+
on:focusout
|
|
28
|
+
on:pointerleave
|
|
29
|
+
>
|
|
21
30
|
<slot {builder}>
|
|
22
31
|
{label ? label : value}
|
|
23
32
|
</slot>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CreateSelectProps, SelectOptionProps } from "@melt-ui/svelte";
|
|
2
2
|
import type { AsChild, Expand, HTMLDivAttributes, OmitOpen, OnChangeFn, Transition, TransitionProps } from "../../internal/index.js";
|
|
3
|
-
import type { HTMLAttributes, HTMLButtonAttributes, HTMLInputAttributes } from "svelte/elements";
|
|
3
|
+
import type { EventHandler, HTMLAttributes, HTMLButtonAttributes, HTMLInputAttributes } from "svelte/elements";
|
|
4
4
|
import type { CustomEventHandler } from "../../index.js";
|
|
5
5
|
type Props = Expand<OmitOpen<Omit<CreateSelectProps, "selected" | "defaultSelected" | "onSelectedChange">> & {
|
|
6
6
|
selected?: CreateSelectProps["defaultSelected"] & {};
|
|
@@ -24,6 +24,10 @@ type ArrowProps = Expand<{
|
|
|
24
24
|
type ItemEvents<T extends Element = HTMLDivElement> = {
|
|
25
25
|
click: CustomEventHandler<MouseEvent, T>;
|
|
26
26
|
pointermove: CustomEventHandler<PointerEvent, T>;
|
|
27
|
+
focusin: EventHandler<FocusEvent, T>;
|
|
28
|
+
keydown: EventHandler<KeyboardEvent, T>;
|
|
29
|
+
focusout: EventHandler<FocusEvent, T>;
|
|
30
|
+
pointerleave: EventHandler<PointerEvent, T>;
|
|
27
31
|
};
|
|
28
32
|
type TriggerEvents<T extends Element = HTMLButtonElement> = {
|
|
29
33
|
click: CustomEventHandler<MouseEvent, T>;
|
|
@@ -34,5 +38,6 @@ type LabelEvents<T extends Element = HTMLSpanElement> = {
|
|
|
34
38
|
};
|
|
35
39
|
type ContentEvents<T extends Element = HTMLDivElement> = {
|
|
36
40
|
pointerleave: CustomEventHandler<PointerEvent, T>;
|
|
41
|
+
keydown: EventHandler<KeyboardEvent, T>;
|
|
37
42
|
};
|
|
38
43
|
export type { Props, ArrowProps, ContentProps, GroupProps, InputProps, LabelProps, ItemProps, SeparatorProps, TriggerProps, ValueProps, Props as SelectProps, ArrowProps as SelectArrowProps, ContentProps as SelectContentProps, GroupProps as SelectGroupProps, InputProps as SelectInputProps, LabelProps as SelectLabelProps, ItemProps as SelectItemProps, SeparatorProps as SelectSeparatorProps, TriggerProps as SelectTriggerProps, ValueProps as SelectValueProps, ItemEvents, ContentEvents, TriggerEvents, LabelEvents, ItemEvents as SelectItemEvents, ContentEvents as SelectContentEvents, TriggerEvents as SelectTriggerEvents, LabelEvents as SelectLabelEvents };
|