sdxc

Type to search, or start from one of these:

[ @sdxc/ui/mixins ]

rangePreview

Hover-and-focus range preview for a RangeCalendar grid.

import { rangePreview } from "@sdxc/ui/mixins";

Usage

Adds hover/focus range-preview behavior to a RangeCalendar grid, extending model's pending range toward the hovered or focused day cell once an anchor is set, and mirroring the result onto every day cell as attributes.

Signature

rangePreview(model: CalendarModel): MixinDescriptor<HTMLElement>

Parameters

ParameterTypeDescription
modelCalendarModelCalendar model already constructed by the consumer, shared with any calendarKeys() mixin applied to the same grid.

Examples

let model = new CalendarModel();
<div role="grid" mix={[calendarKeys(model), rangePreview(model)]} />

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.