diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8434d..c798707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Event Calendar changelog +## 2.7.0 +May 8, 2024 + +* Added `customButtons` option ([159](https://github.com/vkurko/calendar/issues/159)) + ## 2.6.1 January 29, 2024 diff --git a/README.md b/README.md index 5c15ba7..828b495 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [allDayContent](#alldaycontent) - [allDaySlot](#alldayslot) - [buttonText](#buttontext) + - [customButtons](#custombuttons) - [date](#date) - [dateClick](#dateclick) - [datesAboveResources](#datesaboveresources) @@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [eventDidMount](#eventdidmount) - [eventDragMinDistance](#eventdragmindistance) - [eventDragStart](#eventdragstart) - - [eventDragStop](#eventdragstop) + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) { +### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/docs/index.html b/docs/index.html index 9a29b7d..558f6a9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,8 +12,8 @@ - - + + + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/build/package.json b/packages/build/package.json index af53248..2565e1d 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/build", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -18,10 +18,10 @@ "license": "MIT", "jsdelivr": "event-calendar.min.js", "devDependencies": { - "@event-calendar/day-grid": "~2.6.1", - "@event-calendar/interaction": "~2.6.1", - "@event-calendar/list": "~2.6.1", - "@event-calendar/time-grid": "~2.6.1", - "@event-calendar/resource-time-grid": "~2.6.1" + "@event-calendar/day-grid": "~2.7.0", + "@event-calendar/interaction": "~2.7.0", + "@event-calendar/list": "~2.7.0", + "@event-calendar/time-grid": "~2.7.0", + "@event-calendar/resource-time-grid": "~2.7.0" } } \ No newline at end of file diff --git a/packages/core/README.md b/packages/core/README.md index 5c15ba7..828b495 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [allDayContent](#alldaycontent) - [allDaySlot](#alldayslot) - [buttonText](#buttontext) + - [customButtons](#custombuttons) - [date](#date) - [dateClick](#dateclick) - [datesAboveResources](#datesaboveresources) @@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [eventDidMount](#eventdidmount) - [eventDragMinDistance](#eventdragmindistance) - [eventDragStart](#eventdragstart) - - [eventDragStop](#eventdragstop) + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/core/package.json b/packages/core/package.json index 8294dcb..9677388 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/core", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar Core package", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -27,6 +27,6 @@ "./package.json": "./package.json" }, "dependencies": { - "svelte": "^4.2.8" + "svelte": "^4.2.16" } } \ No newline at end of file diff --git a/packages/core/src/Buttons.svelte b/packages/core/src/Buttons.svelte index 566b3f8..6dd2051 100644 --- a/packages/core/src/Buttons.svelte +++ b/packages/core/src/Buttons.svelte @@ -4,7 +4,7 @@ export let buttons; - let {_currentRange, _viewTitle, buttonText, date, duration, hiddenDays, theme, view} = getContext('state'); + let {_currentRange, _viewTitle, buttonText, customButtons, date, duration, hiddenDays, theme, view} = getContext('state'); let today = setMidnight(createDate()), isToday; @@ -49,6 +49,11 @@ on:click={() => $date = cloneDate(today)} disabled={isToday} >{$buttonText[button]} + {:else if $customButtons[button]} + {:else if button != ''} + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/day-grid/package.json b/packages/day-grid/package.json index df4e52e..198cb94 100644 --- a/packages/day-grid/package.json +++ b/packages/day-grid/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/day-grid", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar DayGrid plugin", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -26,7 +26,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@event-calendar/core": "~2.6.1", - "svelte": "^4.2.8" + "@event-calendar/core": "~2.7.0", + "svelte": "^4.2.16" } } \ No newline at end of file diff --git a/packages/interaction/README.md b/packages/interaction/README.md index 5c15ba7..828b495 100644 --- a/packages/interaction/README.md +++ b/packages/interaction/README.md @@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [allDayContent](#alldaycontent) - [allDaySlot](#alldayslot) - [buttonText](#buttontext) + - [customButtons](#custombuttons) - [date](#date) - [dateClick](#dateclick) - [datesAboveResources](#datesaboveresources) @@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [eventDidMount](#eventdidmount) - [eventDragMinDistance](#eventdragmindistance) - [eventDragStart](#eventdragstart) - - [eventDragStop](#eventdragstop) + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/interaction/package.json b/packages/interaction/package.json index 747ce70..1037fe7 100644 --- a/packages/interaction/package.json +++ b/packages/interaction/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/interaction", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar Interaction plugin", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -26,7 +26,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@event-calendar/core": "~2.6.1", - "svelte": "^4.2.8" + "@event-calendar/core": "~2.7.0", + "svelte": "^4.2.16" } } \ No newline at end of file diff --git a/packages/list/README.md b/packages/list/README.md index 5c15ba7..828b495 100644 --- a/packages/list/README.md +++ b/packages/list/README.md @@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [allDayContent](#alldaycontent) - [allDaySlot](#alldayslot) - [buttonText](#buttontext) + - [customButtons](#custombuttons) - [date](#date) - [dateClick](#dateclick) - [datesAboveResources](#datesaboveresources) @@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [eventDidMount](#eventdidmount) - [eventDragMinDistance](#eventdragmindistance) - [eventDragStart](#eventdragstart) - - [eventDragStop](#eventdragstop) + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/list/package.json b/packages/list/package.json index 66b678a..abe162d 100644 --- a/packages/list/package.json +++ b/packages/list/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/list", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar List plugin", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -26,7 +26,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@event-calendar/core": "~2.6.1", - "svelte": "^4.2.8" + "@event-calendar/core": "~2.7.0", + "svelte": "^4.2.16" } } \ No newline at end of file diff --git a/packages/resource-time-grid/README.md b/packages/resource-time-grid/README.md index 5c15ba7..828b495 100644 --- a/packages/resource-time-grid/README.md +++ b/packages/resource-time-grid/README.md @@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [allDayContent](#alldaycontent) - [allDaySlot](#alldayslot) - [buttonText](#buttontext) + - [customButtons](#custombuttons) - [date](#date) - [dateClick](#dateclick) - [datesAboveResources](#datesaboveresources) @@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [eventDidMount](#eventdidmount) - [eventDragMinDistance](#eventdragmindistance) - [eventDragStart](#eventdragstart) - - [eventDragStop](#eventdragstop) + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/resource-time-grid/package.json b/packages/resource-time-grid/package.json index 0697aef..4ed0003 100644 --- a/packages/resource-time-grid/package.json +++ b/packages/resource-time-grid/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/resource-time-grid", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar ResourceTimeGrid plugin", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -26,8 +26,8 @@ "./package.json": "./package.json" }, "dependencies": { - "@event-calendar/core": "~2.6.1", - "@event-calendar/time-grid": "~2.6.1", - "svelte": "^4.2.8" + "@event-calendar/core": "~2.7.0", + "@event-calendar/time-grid": "~2.7.0", + "svelte": "^4.2.16" } } \ No newline at end of file diff --git a/packages/time-grid/README.md b/packages/time-grid/README.md index 5c15ba7..828b495 100644 --- a/packages/time-grid/README.md +++ b/packages/time-grid/README.md @@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [allDayContent](#alldaycontent) - [allDaySlot](#alldayslot) - [buttonText](#buttontext) + - [customButtons](#custombuttons) - [date](#date) - [dateClick](#dateclick) - [datesAboveResources](#datesaboveresources) @@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [eventDidMount](#eventdidmount) - [eventDragMinDistance](#eventdragmindistance) - [eventDragStart](#eventdragstart) - - [eventDragStop](#eventdragstop) + - [eventDragStop](#eventdragstop) - [eventDrop](#eventdrop) - [eventDurationEditable](#eventdurationeditable) - [eventLongPressDelay](#eventlongpressdelay) @@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options - [locale](#locale) - [longPressDelay](#longpressdelay) - [moreLinkContent](#morelinkcontent) - - [noEventsClick](#noeventsclick) + - [noEventsClick](#noeventsclick) - [noEventsContent](#noeventscontent) - [nowIndicator](#nowindicator) - [pointer](#pointer) @@ -199,8 +200,8 @@ import '@event-calendar/core/index.css'; ### Pre-built browser ready bundle Include the following lines of code in the `` section of your page: ```html - - + + ```
@@ -321,6 +322,54 @@ function (text) {
+### customButtons +- Type `object` +- Default `undefined` + +Defines custom buttons that can be used in the [headerToolbar](#headertoolbar). + +First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option. + +
+ Example + +```js +let options = { + customButtons: { + myCustomButton: { + text: 'custom!', + click: function() { + alert('clicked the custom button!'); + } + } + }, + headerToolbar: { + start: 'title myCustomButton', + center: '', + end: 'today prev,next' + } +}; +``` +
+ +Each `customButton` entry accepts the following properties: + + + + + + + + + +
+ +`text ` +The text to be display on the button itself
+ +`click` +A callback function that is called when the button is clicked. Accepts one argument mouseEvent
+ ### date - Type `Date` or `string` - Default `new Date()` @@ -1288,7 +1337,7 @@ This option is used instead of the `events` option. -A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data +A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
diff --git a/packages/time-grid/package.json b/packages/time-grid/package.json index 55ed787..d8d6afa 100644 --- a/packages/time-grid/package.json +++ b/packages/time-grid/package.json @@ -1,6 +1,6 @@ { "name": "@event-calendar/time-grid", - "version": "2.6.1", + "version": "2.7.0", "title": "Event Calendar TimeGrid plugin", "description": "Full-sized drag & drop event calendar with resource view", "keywords": [ @@ -26,7 +26,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@event-calendar/core": "~2.6.1", - "svelte": "^4.2.8" + "@event-calendar/core": "~2.7.0", + "svelte": "^4.2.16" } } \ No newline at end of file