Socket
Socket
Sign inDemoInstall

vue-renderless-calendar

Package Overview
Dependencies
23
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-renderless-calendar

Zero dependency Vue renderless calendar with scoped-slots API


Version published
Weekly downloads
959
decreased by-28.54%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue-renderless-calendar 📆

default workflow npm version

Zero dependency Vue renderless calendar with scoped-slots API

Install

npm i vue-renderless-calendar
yarn add vue-renderless-calendar

RenderlessCalendar

Main wrapper component which contains state of the calendar and other helpful data

Props

PropRequiredTypeDefaultDescription
viewModefalseString'single', 'double', 'infinite'
modefalseString'single', 'range'
localefalseObject or Stringnavigator.languageLocale string (e.g. 'ru'), it will automatically generate locale object using Date.prototype.toLocaleString, otherwise you can provide this object manually
minDatefalseString''Minimal valid date (YYYY-MM-DDD)
maxDatefalseString''Maximal valid date (YYYY-MM-DDD)
preventOutOfRangefalseBooleantruePrevent user go out of valid dates range
dateSelectStrategyfalseFunctionnullIf you want custom behaviour for handling date select, you can implement this function
defaultSelectedDatesfalseArray[]Array of date strings with YYYY-MM-DDD format
captureHoverfalseBooleantruecaptureHover prop is used for computing dates which are between selected date and current hovered date
captureThirdDatefalseBooleanfalsecaptureThirdDate prop is used for capturing dates between in case when 2 dates already selected and you have third element hovered
disabledDatesfalseArray[]Array of YYYY-MM-DDD strings containing dates that can't be selected
markedDatesfalseArray[]Array of YYYY-MM-DDD strings with special meaning, that later will be accessed via isMarked modifier
firstDayOfWeekfalsenumber1Index of the weekday to start the week from. From 0 to 6. 0 is Sunday, 6 is Saturday

Scoped-slots properties

PropertyTypeDescription
weekDayNamesArrayList of week days with short and full titles from locale object
monthNamesArrayList of months with short and full titles from locale object
monthsListArrayList of months which can be used for rendering months with possibility for changing current month view of calendar using setMonth method
calendarArrayArray of months with month, year number and array of dates
selectedDatesArray<CalendarDate>Array of current selected dates
currentMonthNumber
currentYearNumber
canGoToPrevMonthBoolean
canGoToNextMonthBoolean

Scoped-slots Methods

PropertyArgumentsDescription
prevPage-Go to previous view iteration
nextPage-Go to next view iteration
resetDates-Set selectedDates to []
setMonthmonthListItemUpdate views current active month
onDateMouseOut-Reset current hovered date
onDateMouseOverCalendarDateSet current hovered date
onDateSelectCalendarDateAppend selected date to selectedDates array using "date select strategy"
getModifiersCalendarDateReturns

Events

Event namePayload
onDateChangeArray<CalendarDate>

Modifiers

Object containing boolean properties that can be useful for computing styles

PropertyTypeDescription
isSelectedBoolean
isBetweenBoolean
isDisabledBoolean
isMarkedBoolean
isFirstBooleanis first selected date
isLastBooleanis last selected date
isOneDayAfterBooleanis one day after selected date
isOneDayBeforeBooleanis one date before selected date
isOneDayBeforeFirstBoolean
isOneDayAfterFirstBoolean
isOneDayBeforeLastBoolean
isOneDayAfterLastBoolean

CalendarDate

Class representing information about date

Properties

PropertyTypeDescription
yearNumber
monthNumber0-11
dayNumber1-31
actualMonthNumberNumberNumber of month with index correction
formattedStringYYYY-MM-DD
isWeekendBoolean
isTodayBoolean
isOtherMonthDayBooleanThis field can be used to find out that this is the date from previous or next month

Keywords

FAQs

Last updated on 28 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc