@event-calendar/common
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "@event-calendar/common", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"title": "Event Calendar Common package", | ||
@@ -20,4 +20,4 @@ "description": "Full-sized event calendar with resource view", | ||
"dependencies": { | ||
"svelte": "^3.38.3" | ||
"svelte": "^3.42.1" | ||
} | ||
} |
197
README.md
@@ -1,2 +0,2 @@ | ||
# Event Calendar | ||
# Event Calendar [![](https://data.jsdelivr.com/v1/package/npm/@event-calendar/build/badge)](https://www.jsdelivr.com/package/npm/@event-calendar/build) | ||
@@ -7,3 +7,3 @@ See [demo](https://vkurko.github.io/calendar/). | ||
* Lightweight (34kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Lightweight (37.8kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Zero-dependency (pre-built bundle) | ||
@@ -16,4 +16,4 @@ * Used by [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/) | ||
- [Usage](#usage) | ||
- [Svelte component / ES6 module](#svelte-component--es6-module) | ||
- [Pre-built browser ready bundle](#pre-built-browser-ready-bundle) | ||
- [Svelte component / ES6 module](#svelte-component--es6-module) | ||
- [Pre-built browser ready bundle](#pre-built-browser-ready-bundle) | ||
- [Options](#options) | ||
@@ -23,61 +23,63 @@ <table> | ||
- [buttonText](#buttontext) | ||
- [date](#date) | ||
- [dateClick](#dateclick) | ||
- [dayHeaderFormat](#dayheaderformat) | ||
- [displayEventEnd](#displayeventend) | ||
- [duration](#duration) | ||
- [editable](#editable) | ||
- [events](#events) | ||
- [eventBackgroundColor](#eventbackgroundcolor) | ||
- [eventClick](#eventclick) | ||
- [eventColor](#eventcolor) | ||
- [eventContent](#eventcontent) | ||
- [eventDidMount](#eventdidmount) | ||
- [eventDragMinDistance](#eventdragmindistance) | ||
- [eventDragStart](#eventdragstart) | ||
- [eventDragStop](#eventdragstop) | ||
- [buttonText](#buttontext) | ||
- [date](#date) | ||
- [dateClick](#dateclick) | ||
- [datesAboveResources](#datesaboveresources) | ||
- [dayHeaderFormat](#dayheaderformat) | ||
- [displayEventEnd](#displayeventend) | ||
- [duration](#duration) | ||
- [editable](#editable) | ||
- [events](#events) | ||
- [eventBackgroundColor](#eventbackgroundcolor) | ||
- [eventClick](#eventclick) | ||
- [eventColor](#eventcolor) | ||
- [eventContent](#eventcontent) | ||
- [eventDidMount](#eventdidmount) | ||
- [eventDragMinDistance](#eventdragmindistance) | ||
- [eventDragStart](#eventdragstart) | ||
- [eventDragStop](#eventdragstop) | ||
</td><td> | ||
- [eventDrop](#eventdrop) | ||
- [eventMouseEnter](#eventmouseenter) | ||
- [eventMouseLeave](#eventmouseleave) | ||
- [eventSources](#eventsources) | ||
- [eventStartEditable](#eventstarteditable) | ||
- [eventTimeFormat](#eventtimeformat) | ||
- [firstDay](#firstday) | ||
- [flexibleSlotTimeLimits](#flexibleslottimelimits) | ||
- [headerToolbar](#headertoolbar) | ||
- [height](#height) | ||
- [hiddenDays](#hiddendays) | ||
- [hideResourcesWithNoEvents](#hideresourceswithnoevents) | ||
- [highlightedDates](#highlighteddates) | ||
- [lazyFetching](#lazyfetching) | ||
- [listDayFormat](#listdayformat) | ||
- [listDaySideFormat](#listdaysideformat) | ||
- [eventDrop](#eventdrop) | ||
- [eventMouseEnter](#eventmouseenter) | ||
- [eventMouseLeave](#eventmouseleave) | ||
- [eventSources](#eventsources) | ||
- [eventStartEditable](#eventstarteditable) | ||
- [eventTimeFormat](#eventtimeformat) | ||
- [filterResourcesWithEvents](#filterresourceswithevents) | ||
- [firstDay](#firstday) | ||
- [flexibleSlotTimeLimits](#flexibleslottimelimits) | ||
- [headerToolbar](#headertoolbar) | ||
- [height](#height) | ||
- [hiddenDays](#hiddendays) | ||
- [highlightedDates](#highlighteddates) | ||
- [lazyFetching](#lazyfetching) | ||
- [listDayFormat](#listdayformat) | ||
- [listDaySideFormat](#listdaysideformat) | ||
- [loading](#loading) | ||
</td><td> | ||
- [loading](#loading) | ||
- [locale](#locale) | ||
- [monthMode](#monthmode) | ||
- [noEventsClick](#noeventsclick) | ||
- [noEventsContent](#noeventscontent) | ||
- [resources](#resources) | ||
- [scrollTime](#scrolltime) | ||
- [slotDuration](#slotduration) | ||
- [slotLabelFormat](#slotlabelformat) | ||
- [slotMaxTime](#slotmaxtime) | ||
- [slotMinTime](#slotmintime) | ||
- [theme](#theme) | ||
- [view](#view) | ||
- [viewDidMount](#viewdidmount) | ||
- [views](#views) | ||
- [locale](#locale) | ||
- [monthMode](#monthmode) | ||
- [noEventsClick](#noeventsclick) | ||
- [noEventsContent](#noeventscontent) | ||
- [resources](#resources) | ||
- [scrollTime](#scrolltime) | ||
- [slotDuration](#slotduration) | ||
- [slotHeight](#slotheight) | ||
- [slotLabelFormat](#slotlabelformat) | ||
- [slotMaxTime](#slotmaxtime) | ||
- [slotMinTime](#slotmintime) | ||
- [theme](#theme) | ||
- [view](#view) | ||
- [viewDidMount](#viewdidmount) | ||
- [views](#views) | ||
</td></tr> | ||
</table> | ||
- [Event object](#event-object) | ||
- [Parsing event from a plain object](#parsing-event-from-a-plain-object) | ||
- [Parsing event from a plain object](#parsing-event-from-a-plain-object) | ||
- [Duration object](#duration-object) | ||
- [Parsing duration from input values](#parsing-duration-from-input-values) | ||
- [Parsing duration from input values](#parsing-duration-from-input-values) | ||
- [Resource object](#resource-object) | ||
- [Parsing resource from a plain object](#parsing-resource-from-a-plain-object) | ||
- [Parsing resource from a plain object](#parsing-resource-from-a-plain-object) | ||
- [View object](#view-object) | ||
@@ -220,2 +222,8 @@ - [Browser support](#browser-support) | ||
### datesAboveResources | ||
- Type `boolean` | ||
- Default `false` | ||
Determines whether the resource view should render the date headings above the resource headings. | ||
### dayHeaderFormat | ||
@@ -729,3 +737,5 @@ - Type `object` or `function` | ||
`EventSource` should be an object with the following properties: | ||
`EventSource` should be an object with one of the following sets of properties: | ||
#### 1. Fetch events from a URL | ||
<table> | ||
@@ -764,2 +774,43 @@ <tr> | ||
#### 2. Execute custom function | ||
<table> | ||
<tr> | ||
<td> | ||
`events` | ||
</td> | ||
<td> | ||
A custom function that is executed whenever the Event Calendar needs new event data. | ||
```js | ||
function(fetchInfo, successCallback, failureCallback) { } | ||
``` | ||
`fetchInfo` is an object with the following properties: | ||
<table> | ||
<tr> | ||
<td> | ||
`start` | ||
</td> | ||
<td>JavaScript Date object for the beginning of the range the calendar needs events for</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`end` | ||
</td> | ||
<td>JavaScript Date object for the end of the range the calendar needs events for. Note: This value is exclusive</td> | ||
</tr> | ||
</table> | ||
The `successCallback` function must be called by the custom function with an array of parsable [Event](#event-object) objects. | ||
If there is any failure (e.g., if an AJAX request fails), then call the `failureCallback` instead. It accepts an argument with information about the failure. | ||
Instead of calling `successCallback` and `failureCallback`, you may return the resulting array of events or return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) (or [thenable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve)) object instead. | ||
</td> | ||
</tr> | ||
</table> | ||
### eventStartEditable | ||
@@ -794,2 +845,8 @@ - Type `boolean` | ||
### filterResourcesWithEvents | ||
- Type `boolean` | ||
- Default `false` | ||
Determines whether resources with no events for the current range should be hidden in the resource view. | ||
### firstDay | ||
@@ -866,8 +923,2 @@ - Type `integer` | ||
### hideResourcesWithNoEvents | ||
- Type `boolean` | ||
- Default `false` | ||
Determines whether resources with no events for the current range should be hidden in the resource view. | ||
### highlightedDates | ||
@@ -901,3 +952,3 @@ - Type `Array` | ||
function (date) { | ||
// return formatted date string | ||
// return formatted date string | ||
} | ||
@@ -925,3 +976,3 @@ ``` | ||
function (date) { | ||
// return formatted date string | ||
// return formatted date string | ||
} | ||
@@ -1015,3 +1066,3 @@ ``` | ||
function () { | ||
// return string or object | ||
// return string or object | ||
} | ||
@@ -1042,2 +1093,14 @@ ``` | ||
### slotHeight | ||
- Type `integer` | ||
- Default `24` | ||
Defines the time slot height in pixels. When changing the setting, you must additionally override the following CSS styles: | ||
```css | ||
.ec-time, .ec-line { | ||
height: 24px; /* override this value */ | ||
} | ||
``` | ||
### slotLabelFormat | ||
@@ -1053,3 +1116,3 @@ - Type `object` or `function` | ||
function (time) { | ||
// return formatted time string | ||
// return formatted time string | ||
} | ||
@@ -1093,3 +1156,3 @@ ``` | ||
function (theme) { | ||
// return actual theme object | ||
// return actual theme object | ||
} | ||
@@ -1120,3 +1183,3 @@ ``` | ||
function (date) { | ||
// return formatted date string | ||
// return formatted date string | ||
} | ||
@@ -1123,0 +1186,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47501
1552
Updatedsvelte@^3.42.1