0.1.18 • Published 2 years ago

chronocraft-calendar-vue v0.1.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Chronocraft Calendar for VueJS 3.0 Component

The Chronocraft Calendar is a Vue 3 flexible infinite scrolling calendar component created for Vue3. It includes an events functionality and a smooth infinite scrolling feel with drag and mouse wheel navigation

Features

  • Infinite Calendar
  • Events Functionality
  • Different type of events
  • Add or Remove events
  • Typescript support
  • Smooth scrolling

alt text

Usage of Calendar

Using the Library as a Plugin

import { ChronoCraftCalendar } from 'chronocraft-calendar-vue';
    ...
app.use(ChronoCraftCalendar)

Using seperate components of the library inside you project

When you want to import a specific component from the library into a dedicated place inside your code

import { Calendar } from 'chronocraft-calendar-vue';
...
components:{
Calendar
}

Example of Component

<Calendar @on-scroll="OnScroll" @on-delete-event="RemoveEvent" :events="events" :eventtypes="eventtypes" :weekendcolored="true" class="calendar" :cellheight="180" :cellsquared="false" :height="400"></Calendar>

Example using Slots

<Calendar @on-scroll="OnScroll" @on-delete-event="RemoveEvent" :events="events" :eventtypes="eventtypes" :weekendcolored="true" class="calendar" :cellheight="180" :cellsquared="false" :height="400">
    <template v-slot:header="slotProps">
        <span>{{ slotProps.headerlabel }}</span>
    </template>
    <template v-slot:headercell="slotProps">
        <span>{{ slotProps.daylabel }}</span>
    </template>
</Calendar>

Component properties

NameTypeDescription
dataArrayThe actual data passed into the scroller. These data are reactive by using ref()
heightNumberDefines the height of the calendar
gapNumberDefines the gap between the calendar cells / days
wheelscrollspeedNumberDefines the mouse wheel scroll speed
cellheightNumberDefines the base of the cellheight on the horizontal scroller
hasscrollbarBooleanDefines if the scroller should have a scroll bar
@on-scrollEvent FunctionEvent fired when the user has scrolled
@on-delete-eventEvent FunctionEvent fired when the user has reached at the end of the scroller and new data might be required to load

Component slots

NamehaspropsDescription
headeryesOverrides the calendar's header
headercellyesOverrides the calendar's header cells which now show the day names
cellyesOverrides the calendar's cells which show the days