File size: 853 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script>import { melt } from "@melt-ui/svelte";
import { setCtx } from "../ctx.js";
import { styleToString } from "../../../internal/style.js";
export let type = "hover";
export let dir = "ltr";
export let hideDelay = 600;
export let asChild = false;
export let el = void 0;
const {
  elements: { root },
  updateOption,
  getAttrs
} = setCtx({
  type,
  dir,
  hideDelay
});
$:
  builder = $root;
$:
  updateOption("type", type);
$:
  updateOption("dir", dir);
$:
  updateOption("hideDelay", hideDelay);
const bitsAttrs = getAttrs("root");
const style = styleToString({
  overflow: "hidden"
});
$:
  attrs = {
    ...$$restProps,
    ...bitsAttrs,
    style
  };
$:
  Object.assign(builder, attrs);
</script>

{#if asChild}
	<slot {builder} />
{:else}
	<div bind:this={el} {...builder} use:builder.action {...attrs}>
		<slot {builder} />
	</div>
{/if}