File tree 10 files changed +32
-23
lines changed
10 files changed +32
-23
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " bits-ui " : patch
3
+ ---
4
+
5
+ Pass ids as slot props to components with managed ids
Original file line number Diff line number Diff line change 86
86
"types" : " ./dist/index.d.ts" ,
87
87
"type" : " module" ,
88
88
"dependencies" : {
89
- "@melt-ui/svelte" : " 0.57.0 " ,
89
+ "@melt-ui/svelte" : " 0.57.1 " ,
90
90
"nanoid" : " ^5.0.2"
91
91
},
92
92
"peerDependencies" : {
Original file line number Diff line number Diff line change 20
20
21
21
const {
22
22
states : { open : localOpen },
23
- updateOption
23
+ updateOption,
24
+ ids
24
25
} = setCtx ({
25
26
closeOnOutsideClick ,
26
27
closeOnEscape ,
60
61
$ : updateOption (" typeahead" , typeahead );
61
62
</script >
62
63
63
- <slot />
64
+ <slot { ids } />
Original file line number Diff line number Diff line change 7
7
export let disabled: $$Props [" disabled" ] = undefined ;
8
8
export let arrowSize: $$Props [" arrowSize" ] = undefined ;
9
9
10
- const { updateOption } = setSubMenuCtx ({
10
+ const { updateOption, ids } = setSubMenuCtx ({
11
11
positioning ,
12
12
disabled ,
13
13
arrowSize
18
18
$ : updateOption (" arrowSize" , arrowSize );
19
19
</script >
20
20
21
- <slot />
21
+ <slot subIds ={ ids } />
Original file line number Diff line number Diff line change 20
20
21
21
const {
22
22
states : { open : localOpen },
23
- updateOption
23
+ updateOption,
24
+ ids
24
25
} = setCtx ({
25
26
closeOnOutsideClick ,
26
27
closeOnEscape ,
59
60
$ : updateOption (" typeahead" , typeahead );
60
61
</script >
61
62
62
- <slot />
63
+ <slot { ids } />
Original file line number Diff line number Diff line change 7
7
export let disabled: $$Props [" disabled" ] = undefined ;
8
8
export let arrowSize: $$Props [" arrowSize" ] = undefined ;
9
9
10
- const { updateOption } = setSubMenuCtx ({
10
+ const { updateOption, ids } = setSubMenuCtx ({
11
11
positioning ,
12
12
disabled ,
13
13
arrowSize
18
18
$ : updateOption (" arrowSize" , arrowSize );
19
19
</script >
20
20
21
- <slot />
21
+ <slot subIds ={ ids } />
Original file line number Diff line number Diff line change 11
11
12
12
const {
13
13
elements : { menubar },
14
- updateOption
14
+ updateOption,
15
+ ids
15
16
} = setCtx ({ loop , closeOnEscape });
16
17
17
18
$ : updateOption (" loop" , loop );
21
22
</script >
22
23
23
24
{#if asChild }
24
- <slot {builder } {attrs } />
25
+ <slot {builder } {attrs } { ids } />
25
26
{:else }
26
27
<div use:melt ={builder } {...$$restProps } {...attrs }>
27
- <slot {builder } {attrs } />
28
+ <slot {builder } {attrs } { ids } />
28
29
</div >
29
30
{/if }
Original file line number Diff line number Diff line change 19
19
20
20
const {
21
21
states : { open : localOpen },
22
- updateOption
22
+ updateOption,
23
+ ids
23
24
} = setMenuCtx ({
24
25
closeOnOutsideClick ,
25
26
closeOnEscape ,
55
56
$ : updateOption (" typeahead" , typeahead );
56
57
</script >
57
58
58
- <slot />
59
+ <slot menuIds ={ ids } />
Original file line number Diff line number Diff line change 7
7
export let disabled: $$Props [" disabled" ] = undefined ;
8
8
export let arrowSize: $$Props [" arrowSize" ] = undefined ;
9
9
10
- const { updateOption } = setSubMenuCtx ({
10
+ const { updateOption, ids } = setSubMenuCtx ({
11
11
positioning ,
12
12
disabled ,
13
13
arrowSize
18
18
$ : updateOption (" arrowSize" , arrowSize );
19
19
</script >
20
20
21
- <slot />
21
+ <slot subIds ={ ids } />
You can’t perform that action at this time.
0 commit comments