This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<script lang="ts">
import { boxWith, mergeProps } from "svelte-toolbelt";
import { CalendarDayState } from "../calendar.svelte.js";
import type { CalendarDayProps } from "../types.js";
import { createId } from "../../../internal/create-id.js";
const uid = $props.id();
let {
children,
child,
ref = $bindable(null),
id = createId(uid),
...restProps
}: CalendarDayProps = $props();
const dayState = CalendarDayState.create({
id: boxWith(() => id),
ref: boxWith(
() => ref,
(v) => (ref = v)
),
});
const mergedProps = $derived(mergeProps(restProps, dayState.props));
</script>
{#if child}
{@render child({
props: mergedProps,
...dayState.snippetProps,
})}
{:else}
<div {...mergedProps}>
{#if children}
{@render children?.(dayState.snippetProps)}
{:else}
{dayState.cell.opts.date.current.day}
{/if}
</div>
{/if}