npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-renderless-calendar

v2.4.1

Published

Zero dependency Vue renderless calendar with scoped-slots API

Downloads

5,216

Readme

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

| Prop | Required | Type | Default | Description | | -------------------- | -------- | ---------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | viewMode | false | String | | 'single', 'double', 'infinite' | | mode | false | String | | 'single', 'range' | | locale | false | Object or String | navigator.language | Locale string (e.g. 'ru'), it will automatically generate locale object using Date.prototype.toLocaleString, otherwise you can provide this object manually | | minDate | false | String | '' | Minimal valid date (YYYY-MM-DDD) | | maxDate | false | String | '' | Maximal valid date (YYYY-MM-DDD) | | preventOutOfRange | false | Boolean | true | Prevent user go out of valid dates range | | dateSelectStrategy | false | Function | null | If you want custom behaviour for handling date select, you can implement this function | | defaultSelectedDates | false | Array | [] | Array of date strings with YYYY-MM-DDD format | | captureHover | false | Boolean | true | captureHover prop is used for computing dates which are between selected date and current hovered date | | captureThirdDate | false | Boolean | false | captureThirdDate prop is used for capturing dates between in case when 2 dates already selected and you have third element hovered | | disabledDates | false | Array | [] | Array of YYYY-MM-DDD strings containing dates that can't be selected | | markedDates | false | Array | [] | Array of YYYY-MM-DDD strings with special meaning, that later will be accessed via isMarked modifier | | firstDayOfWeek | false | number | 1 | Index of the weekday to start the week from. From 0 to 6. 0 is Sunday, 6 is Saturday |

Scoped-slots properties

| Property | Type | Description | | ---------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | weekDayNames | Array | List of week days with short and full titles from locale object | | monthNames | Array | List of months with short and full titles from locale object | | monthsList | Array | List of months which can be used for rendering months with possibility for changing current month view of calendar using setMonth method | | calendar | Array | Array of months with month, year number and array of dates | | selectedDates | Array<CalendarDate> | Array of current selected dates | | currentMonth | Number | | | currentYear | Number | | | canGoToPrevMonth | Boolean | | | canGoToNextMonth | Boolean | |

Scoped-slots Methods

| Property | Arguments | Description | | --------------- | ------------- | -------------------------------------------------------------------------- | | prevPage | - | Go to previous view iteration | | nextPage | - | Go to next view iteration | | resetDates | - | Set selectedDates to [] | | setMonth | monthListItem | Update views current active month | | onDateMouseOut | - | Reset current hovered date | | onDateMouseOver | CalendarDate | Set current hovered date | | onDateSelect | CalendarDate | Append selected date to selectedDates array using "date select strategy" | | getModifiers | CalendarDate | Returns |

Events

| Event name | Payload | | ------------ | --------------------- | | onDateChange | Array<CalendarDate> |

Modifiers

Object containing boolean properties that can be useful for computing styles

| Property | Type | Description | | ------------------- | ------- | -------------------------------- | | isSelected | Boolean | | isBetween | Boolean | | isDisabled | Boolean | | isMarked | Boolean | | isFirst | Boolean | is first selected date | | isLast | Boolean | is last selected date | | isOneDayAfter | Boolean | is one day after selected date | | isOneDayBefore | Boolean | is one date before selected date | | isOneDayBeforeFirst | Boolean | | isOneDayAfterFirst | Boolean | | isOneDayBeforeLast | Boolean | | isOneDayAfterLast | Boolean |

CalendarDate

Class representing information about date

Properties

| Property | Type | Description | | ----------------- | ------- | ------------------------------------------------------------------------------------ | | year | Number | | | month | Number | 0-11 | | day | Number | 1-31 | | actualMonthNumber | Number | Number of month with index correction | | formatted | String | YYYY-MM-DD | | isWeekend | Boolean | | | isToday | Boolean | | | isOtherMonthDay | Boolean | This field can be used to find out that this is the date from previous or next month |