New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-renderless-calendar

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-renderless-calendar

Zero dependency Vue renderless calendar with scoped-slots API

1.2.1
Source
npm
Version published
Weekly downloads
796
-33.72%
Maintainers
1
Weekly downloads
 
Created
Source

vue-renderless-calendar 📆

Zero dependency Vue renderless calendar with scoped-slots API

Install

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

Locale

import enLocale from 'vue-renderless-calendar/dist/locale/en';

Available locales

  • English locale/en
  • Russian locale/ru

RenderlessCalendar

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

Props

PropRequiredTypeDefaultDescription
viewModefalseString'single', 'double', 'infinite'
modefalseString'single', 'range'
localetrueObjectLocale object containing months, days properties
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

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
isBetweenCalendarDateReturning true if date between selected dates or hovered date
onDateMouseOut-Reset current hovered date
onDateMouseOverCalendarDateSet current hovered date
onDateSelectCalendarDateAppend selected date to selectedDates array using "date select strategy"

Events

Event namePayload
onDateChangeArray<CalendarDate>

RenderlessDate

Wrapper component for calendar cell containing usefull modifiers which can be used for computing styles

Props

PropRequiredTypeDefaultDescription
selectedDatestrueArray<CalendarDate>Array of current selected dates
datetrueCalendarDateCalendarDate object containing useful information and methods
minDatefalseString''Minimal valid date (YYYY-MM-DDD)
maxDatefalseString''Maximal valid date (YYYY-MM-DDD)
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 scoped-slots property

Scoped-slots properties

PropertyTypeDescription
isSelectedBoolean
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

vue

FAQs

Package last updated on 10 Jul 2019

Did you know?

Socket

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