import { createEffect, For } from "solid-js"; import { useDatepickerContext } from "."; export function Cell (props: any) { const ctx: any = useDatepickerContext(); const onClick = (num: number, disabled: boolean) => { if (disabled) { return; } props.onSelect && props.onSelect(props.type, num); } let wrap: any; createEffect(() => { if (wrap && ctx?.visible()) { const start = props.data[0] const v = props.value ? props.value : (props.type === 'year' ? new Date().getFullYear() : new Date().getMonth() + 1); wrap.scrollTop = 26 * (v - start); } }); return
; }