Files
Stackq/node_modules/bits-ui/dist/bits/calendar/components/calendar-grid-head.svelte
T
eewing cf73cd3b4c INIT
2026-02-17 14:10:16 -06:00

35 lines
769 B
Svelte

<script lang="ts">
import { boxWith, mergeProps } from "svelte-toolbelt";
import { CalendarGridHeadState } from "../calendar.svelte.js";
import type { CalendarGridHeadProps } from "../types.js";
import { createId } from "../../../internal/create-id.js";
const uid = $props.id();
let {
children,
child,
ref = $bindable(null),
id = createId(uid),
...restProps
}: CalendarGridHeadProps = $props();
const gridHeadState = CalendarGridHeadState.create({
id: boxWith(() => id),
ref: boxWith(
() => ref,
(v) => (ref = v)
),
});
const mergedProps = $derived(mergeProps(restProps, gridHeadState.props));
</script>
{#if child}
{@render child({ props: mergedProps })}
{:else}
<thead {...mergedProps}>
{@render children?.()}
</thead>
{/if}