File size: 657 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script>import { setScrollbarOrientation } from "../ctx.js";
import { writable } from "svelte/store";
import ScrollAreaScrollbarY from "./scroll-area-scrollbar-y.svelte";
import ScrollAreaScrollbarX from "./scroll-area-scrollbar-x.svelte";
export let orientation;
const orientationStore = writable(orientation);
setScrollbarOrientation(orientationStore);
$:
  orientationStore.set(orientation);
</script>

{#if $orientationStore === "vertical"}
	<ScrollAreaScrollbarY {...$$restProps} let:builder>
		<slot {builder} />
	</ScrollAreaScrollbarY>
{:else}
	<ScrollAreaScrollbarX {...$$restProps} let:builder>
		<slot {builder} />
	</ScrollAreaScrollbarX>
{/if}