Calendar API

This page provides an overview of the Calendar component API, detailing its props, emits, slots, and exposed methods/states.

Props

The Calendar component accepts the following props:

PropDefaultTypeDescription
paramsDatePickerundefinedPartial<IParamsDatePicker> or undefinedAdditional parameters for date picker behavior and formatting.
autoFocusundefinedboolean or undefinedAutomatically focuses the calendar input on mount.
isNotCloseOnDateChangeundefinedboolean or undefinedPrevents the calendar from closing when a date is selected.
classDataPickerundefinedStyleClass or undefinedCustom CSS class for the data picker.
classPickerundefinedStyleClass or undefinedCustom CSS class for the calendar picker.
classDateTextundefinedStyleClass or undefinedCustom CSS class for the displayed date text.
paramsFixWindowundefinedFixWindowProps or undefinedConfiguration for fixing the calendar window's position.
idundefinedstring or undefinedUnique identifier for the calendar component.
modelValueundefinedDateValueCalendar or Partial<IRangeValue>The current value of the calendar, can be a single date or a date range.

Emits

The Calendar component emits the following events:

EmitPayloadDescription
update:isInvalidCalendarProps["isInvalid"]Emitted when the invalid state of the calendar is updated.
update:modelValueCalendarProps["modelValue"]Emitted when the modelValue is updated.
change:modelValueCalendarProps["modelValue"]Emitted when the modelValue changes.
getCalendarICalendarPickerEmitted when the calendar data is retrieved.
isActivebooleanEmitted when the calendar's active state changes.

Slots

The Calendar component provides the following slots:

SlotPayloadDescription
defaultVNode[]Default slot for custom content inside the calendar component.
beforeVNode[]Slot for content to be displayed before the calendar.
afterVNode[]Slot for content to be displayed after the calendar.
footerPickerVNode[]Slot for custom content in the footer of the date picker.

Expose

The Calendar component exposes the following methods and states via ref:

ExposeValueDescription
layoutInputLayoutExpose or undefinedReference to the layout state of the input field.
inputLayoutOmit<InputLayoutProps, "value">Reference to the input layout properties.
dataPickerHTMLElement or undefinedReference to the data picker HTML element.
pickerHTMLElement or undefinedReference to the calendar picker HTML element.
calendarPickerICalendarPicker or undefinedInstance of the calendar picker.
isFocusbooleanIndicates if the calendar input is focused.
isOpenPickerbooleanIndicates if the calendar picker is open.
datePickerPartial<IParamsDatePicker>Parameters for the date picker.
valueCalendarProps["modelValue"]Current value of the calendar.
visibleDateICalendarPicker["inputValue"] or undefinedThe currently visible date in the picker.
idCalendarProps["id"]Current id value for the calendar component.
isValuebooleanIndicates whether the calendar has a value.
autoFocusCalendarProps["autoFocus"]Indicates if autofocus is enabled.
isNotCloseOnDateChangeCalendarProps["isNotCloseOnDateChange"]Indicates if the calendar remains open on date selection.
modeStyleModeThe current styling mode of the editor.
placeholderIParamsDatePicker["placeholder"] or undefinedPlaceholder text for the input field.
isLoadingCalendarProps["loading"]Indicates if the calendar is in a loading state.
isDisabledCalendarProps["disabled"]Indicates if the calendar is disabled.
isInvalidCalendarProps["isInvalid"]Indicates if the calendar is invalid.
messageInvalidCalendarProps["messageInvalid"]Validation message for the calendar input.
separatorIParamsDatePicker["separator"] or undefinedSeparator character for date ranges.
valueLayoutstringCurrent layout value.
paramsFixWindowCalendarProps["paramsFixWindow"]Configuration for fixing the calendar window.
classLayoutCalendarProps["class"]CSS class for the layout container.
classDataPickerCalendarProps["classDataPicker"]CSS class for the data picker.
classDateTextCalendarProps["classDateText"]CSS class for the date text display.
classPickerCalendarProps["classPicker"]CSS class for the calendar picker.

Methods:

  • openCalendar(): void - Opens the calendar picker.
  • closeCalendar(event?: MouseEvent): void - Closes the calendar picker.
  • changeDate(date: ICalendarPicker["inputValue"]): void - Changes the selected date in the calendar.
  • focus(focus: boolean): void - Sets the focus state for the calendar.
  • clearDataPicker(): void - Clears the selected date in the calendar.
© 2025 FishtVue by Egoka