SelectionEngine

class SelectionEngine(mode: SelectionMode, bounds: ClosedRange<LocalDate>? = null, disabled: DisabledDates = DisabledDates.None)

Pure selection state machine. click never mutates; it returns the new Selection plus any violation events. Bounds and disabled dates are checked before mode-specific handling, matching the original library's out-of-range and OnCalendarInterceptListener behavior.

Constructors

Link copied to clipboard
constructor(mode: SelectionMode, bounds: ClosedRange<LocalDate>? = null, disabled: DisabledDates = DisabledDates.None)

Functions

Link copied to clipboard
fun click(current: Selection, date: LocalDate): SelectionResult
Link copied to clipboard
fun replace(current: Selection, proposed: Selection): SelectionResult

Validates proposed the way clicks are validated and returns either the proposed selection (no events) or current plus the first violation. The proposal's shape must match the mode (Selection.Empty matches every mode); a mismatch throws IllegalArgumentException.