@event-calendar/interaction
Advanced tools
Comparing version 0.13.4 to 0.14.0
100
index.js
@@ -78,21 +78,21 @@ import { SvelteComponent, init, safe_not_equal, noop, listen, is_function, run_all, component_subscribe, globals, set_store_value, bubble, subscribe, create_component, space, empty, mount_component, insert, transition_in, group_outros, transition_out, check_outros, destroy_component, detach, binding_callbacks, element, attr } from 'svelte/internal'; | ||
dispose = [ | ||
listen(window_1, "pointermove", /*handlePointerMove*/ ctx[31]), | ||
listen(window_1, "pointerup", /*handlePointerUp*/ ctx[32]), | ||
listen(window_1, "pointercancel", /*handlePointerUp*/ ctx[32]), | ||
listen(window_1, "pointermove", /*handlePointerMove*/ ctx[32]), | ||
listen(window_1, "pointerup", /*handlePointerUp*/ ctx[33]), | ||
listen(window_1, "pointercancel", /*handlePointerUp*/ ctx[33]), | ||
listen(window_1, "scroll", /*handleScroll*/ ctx[0]), | ||
listen(window_1, "click", function () { | ||
if (is_function(/*$unselectAuto*/ ctx[4] | ||
? /*handleClick*/ ctx[33] | ||
? /*handleClick*/ ctx[34] | ||
: undefined)) (/*$unselectAuto*/ ctx[4] | ||
? /*handleClick*/ ctx[33] | ||
? /*handleClick*/ ctx[34] | ||
: undefined).apply(this, arguments); | ||
}), | ||
listen(window_1, "selectstart", function () { | ||
if (is_function(createPreventDefaultHandler(/*selectstart_handler*/ ctx[41]))) createPreventDefaultHandler(/*selectstart_handler*/ ctx[41]).apply(this, arguments); | ||
if (is_function(createPreventDefaultHandler(/*selectstart_handler*/ ctx[42]))) createPreventDefaultHandler(/*selectstart_handler*/ ctx[42]).apply(this, arguments); | ||
}), | ||
listen(window_1, "contextmenu", function () { | ||
if (is_function(createPreventDefaultHandler(/*contextmenu_handler*/ ctx[42]))) createPreventDefaultHandler(/*contextmenu_handler*/ ctx[42]).apply(this, arguments); | ||
if (is_function(createPreventDefaultHandler(/*contextmenu_handler*/ ctx[43]))) createPreventDefaultHandler(/*contextmenu_handler*/ ctx[43]).apply(this, arguments); | ||
}), | ||
listen(window_1, "touchstart", /*handleTouchStart*/ ctx[34]), | ||
listen(window_1, "touchmove", /*touchmove_handler*/ ctx[40], { passive: false }) | ||
listen(window_1, "touchstart", /*handleTouchStart*/ ctx[35]), | ||
listen(window_1, "touchmove", /*touchmove_handler*/ ctx[41], { passive: false }) | ||
]; | ||
@@ -140,3 +140,3 @@ | ||
$$unsubscribe__viewResources = noop, | ||
$$subscribe__viewResources = () => ($$unsubscribe__viewResources(), $$unsubscribe__viewResources = subscribe(_viewResources, $$value => $$invalidate(73, $_viewResources = $$value)), _viewResources); | ||
$$subscribe__viewResources = () => ($$unsubscribe__viewResources(), $$unsubscribe__viewResources = subscribe(_viewResources, $$value => $$invalidate(74, $_viewResources = $$value)), _viewResources); | ||
@@ -156,2 +156,3 @@ let $eventDrop; | ||
let $datesAboveResources; | ||
let $_ignoreClick; | ||
let $eventDragMinDistance; | ||
@@ -164,29 +165,30 @@ let $selectMinDistance; | ||
$$self.$$.on_destroy.push(() => $$unsubscribe__viewResources()); | ||
let { _iEvents, _iClass, _events, _viewDates, _view, datesAboveResources, dragScroll, editable, eventStartEditable, eventDragMinDistance, eventDragStart, eventDragStop, eventDrop, eventLongPressDelay, eventResizeStart, eventResizeStop, eventResize, longPressDelay, select, selectBackgroundColor, selectLongPressDelay, selectMinDistance, slotDuration, slotHeight, hiddenDays, unselect: unselectFn, unselectAuto, unselectCancel } = getContext('state'); | ||
component_subscribe($$self, _iEvents, value => $$invalidate(70, $_iEvents = value)); | ||
component_subscribe($$self, _iClass, value => $$invalidate(72, $_iClass = value)); | ||
component_subscribe($$self, _events, value => $$invalidate(69, $_events = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(82, $_viewDates = value)); | ||
component_subscribe($$self, _view, value => $$invalidate(67, $_view = value)); | ||
component_subscribe($$self, datesAboveResources, value => $$invalidate(86, $datesAboveResources = value)); | ||
component_subscribe($$self, dragScroll, value => $$invalidate(79, $dragScroll = value)); | ||
component_subscribe($$self, eventDragMinDistance, value => $$invalidate(87, $eventDragMinDistance = value)); | ||
component_subscribe($$self, eventDragStart, value => $$invalidate(80, $eventDragStart = value)); | ||
component_subscribe($$self, eventDragStop, value => $$invalidate(76, $eventDragStop = value)); | ||
component_subscribe($$self, eventDrop, value => $$invalidate(74, $eventDrop = value)); | ||
component_subscribe($$self, eventLongPressDelay, value => $$invalidate(90, $eventLongPressDelay = value)); | ||
component_subscribe($$self, eventResizeStart, value => $$invalidate(81, $eventResizeStart = value)); | ||
component_subscribe($$self, eventResizeStop, value => $$invalidate(77, $eventResizeStop = value)); | ||
component_subscribe($$self, eventResize, value => $$invalidate(75, $eventResize = value)); | ||
component_subscribe($$self, longPressDelay, value => $$invalidate(89, $longPressDelay = value)); | ||
component_subscribe($$self, select, value => $$invalidate(78, $select = value)); | ||
component_subscribe($$self, selectBackgroundColor, value => $$invalidate(71, $selectBackgroundColor = value)); | ||
component_subscribe($$self, selectLongPressDelay, value => $$invalidate(91, $selectLongPressDelay = value)); | ||
component_subscribe($$self, selectMinDistance, value => $$invalidate(88, $selectMinDistance = value)); | ||
component_subscribe($$self, slotDuration, value => $$invalidate(84, $slotDuration = value)); | ||
component_subscribe($$self, slotHeight, value => $$invalidate(85, $slotHeight = value)); | ||
component_subscribe($$self, hiddenDays, value => $$invalidate(83, $hiddenDays = value)); | ||
component_subscribe($$self, unselectFn, value => $$invalidate(68, $unselectFn = value)); | ||
let { _iEvents, _iClass, _ignoreClick, _events, _viewDates, _view, datesAboveResources, dragScroll, editable, eventStartEditable, eventDragMinDistance, eventDragStart, eventDragStop, eventDrop, eventLongPressDelay, eventResizeStart, eventResizeStop, eventResize, longPressDelay, select, selectBackgroundColor, selectLongPressDelay, selectMinDistance, slotDuration, slotHeight, hiddenDays, unselect: unselectFn, unselectAuto, unselectCancel } = getContext('state'); | ||
component_subscribe($$self, _iEvents, value => $$invalidate(71, $_iEvents = value)); | ||
component_subscribe($$self, _iClass, value => $$invalidate(73, $_iClass = value)); | ||
component_subscribe($$self, _ignoreClick, value => $$invalidate(88, $_ignoreClick = value)); | ||
component_subscribe($$self, _events, value => $$invalidate(70, $_events = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(83, $_viewDates = value)); | ||
component_subscribe($$self, _view, value => $$invalidate(68, $_view = value)); | ||
component_subscribe($$self, datesAboveResources, value => $$invalidate(87, $datesAboveResources = value)); | ||
component_subscribe($$self, dragScroll, value => $$invalidate(80, $dragScroll = value)); | ||
component_subscribe($$self, eventDragMinDistance, value => $$invalidate(89, $eventDragMinDistance = value)); | ||
component_subscribe($$self, eventDragStart, value => $$invalidate(81, $eventDragStart = value)); | ||
component_subscribe($$self, eventDragStop, value => $$invalidate(77, $eventDragStop = value)); | ||
component_subscribe($$self, eventDrop, value => $$invalidate(75, $eventDrop = value)); | ||
component_subscribe($$self, eventLongPressDelay, value => $$invalidate(92, $eventLongPressDelay = value)); | ||
component_subscribe($$self, eventResizeStart, value => $$invalidate(82, $eventResizeStart = value)); | ||
component_subscribe($$self, eventResizeStop, value => $$invalidate(78, $eventResizeStop = value)); | ||
component_subscribe($$self, eventResize, value => $$invalidate(76, $eventResize = value)); | ||
component_subscribe($$self, longPressDelay, value => $$invalidate(91, $longPressDelay = value)); | ||
component_subscribe($$self, select, value => $$invalidate(79, $select = value)); | ||
component_subscribe($$self, selectBackgroundColor, value => $$invalidate(72, $selectBackgroundColor = value)); | ||
component_subscribe($$self, selectLongPressDelay, value => $$invalidate(93, $selectLongPressDelay = value)); | ||
component_subscribe($$self, selectMinDistance, value => $$invalidate(90, $selectMinDistance = value)); | ||
component_subscribe($$self, slotDuration, value => $$invalidate(85, $slotDuration = value)); | ||
component_subscribe($$self, slotHeight, value => $$invalidate(86, $slotHeight = value)); | ||
component_subscribe($$self, hiddenDays, value => $$invalidate(84, $hiddenDays = value)); | ||
component_subscribe($$self, unselectFn, value => $$invalidate(69, $unselectFn = value)); | ||
component_subscribe($$self, unselectAuto, value => $$invalidate(4, $unselectAuto = value)); | ||
component_subscribe($$self, unselectCancel, value => $$invalidate(66, $unselectCancel = value)); | ||
component_subscribe($$self, unselectCancel, value => $$invalidate(67, $unselectCancel = value)); | ||
let action; | ||
@@ -205,3 +207,3 @@ let view; | ||
let resourceCol, newResourceCol; | ||
let isAllDay; | ||
let isAllDay = false; | ||
let iClass; | ||
@@ -367,2 +369,3 @@ let minEnd; // minimum end time when resizing | ||
set_store_value(_iClass, $_iClass = iClass, $_iClass); | ||
set_store_value(_ignoreClick, $_ignoreClick = true, $_ignoreClick); | ||
let newCol = floor(rx / colRect.width); | ||
@@ -672,2 +675,3 @@ | ||
_iClass, | ||
_ignoreClick, | ||
_events, | ||
@@ -723,8 +727,8 @@ _viewDates, | ||
{ | ||
dragTimeGrid: 35, | ||
dragDayGrid: 36, | ||
selectTimeGrid: 37, | ||
selectDayGrid: 38, | ||
dragTimeGrid: 36, | ||
dragDayGrid: 37, | ||
selectTimeGrid: 38, | ||
selectDayGrid: 39, | ||
handleScroll: 0, | ||
unselect: 39 | ||
unselect: 40 | ||
}, | ||
@@ -737,15 +741,15 @@ null, | ||
get dragTimeGrid() { | ||
return this.$$.ctx[35]; | ||
return this.$$.ctx[36]; | ||
} | ||
get dragDayGrid() { | ||
return this.$$.ctx[36]; | ||
return this.$$.ctx[37]; | ||
} | ||
get selectTimeGrid() { | ||
return this.$$.ctx[37]; | ||
return this.$$.ctx[38]; | ||
} | ||
get selectDayGrid() { | ||
return this.$$.ctx[38]; | ||
return this.$$.ctx[39]; | ||
} | ||
@@ -758,3 +762,3 @@ | ||
get unselect() { | ||
return this.$$.ctx[39]; | ||
return this.$$.ctx[40]; | ||
} | ||
@@ -1284,3 +1288,3 @@ } | ||
options.selectLongPressDelay = undefined; | ||
options.selectMinDistance = 0; | ||
options.selectMinDistance = 5; | ||
options.unselect = undefined; | ||
@@ -1287,0 +1291,0 @@ options.unselectAuto = true; |
{ | ||
"name": "@event-calendar/interaction", | ||
"version": "0.13.4", | ||
"version": "0.14.0", | ||
"title": "Event Calendar Interaction plugin", | ||
@@ -36,5 +36,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/common": "~0.13.4", | ||
"@event-calendar/common": "~0.14.0", | ||
"svelte": "^3.51.0" | ||
} | ||
} |
105
README.md
@@ -7,3 +7,3 @@ # Event Calendar [](https://www.jsdelivr.com/package/npm/@event-calendar/build) [](https://www.npmjs.com/package/@event-calendar/core) [](https://www.paypal.me/vkurko/10usd) | ||
* Lightweight (54kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Lightweight (55kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Zero-dependency (pre-built bundle) | ||
@@ -186,2 +186,6 @@ * Used by [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/) | ||
``` | ||
The CSS is located at `@event-calendar/core/index.css`. If your build tool supports CSS processing, you can import it like this: | ||
```js | ||
import '@event-calendar/core/index.css'; | ||
``` | ||
@@ -239,3 +243,3 @@ ### Pre-built browser ready bundle | ||
This value can be either a string containing HTML `'<p>...</p>'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
This value can be either a string containing text `'...'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
@@ -290,5 +294,5 @@ ```js | ||
```js | ||
function (dateClickInfo) {} | ||
function (info) {} | ||
``` | ||
`dateClickInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -312,2 +316,11 @@ <tr> | ||
`allDay` | ||
</td> | ||
<td> | ||
`true` or `false`. Determines if the click has occurred in the `all-day` slot. Clicks in month and list views are treated as all-day too</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`dayEl` | ||
@@ -510,5 +523,5 @@ </td> | ||
```js | ||
function (eventClickInfo) { } | ||
function (info) { } | ||
``` | ||
`eventClickInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -563,10 +576,10 @@ <tr> | ||
This value can be either a string containing HTML `'<p>...</p>'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
This value can be either a string containing text `'...'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
```js | ||
function (eventInfo) { | ||
function (info) { | ||
// return string or object | ||
} | ||
``` | ||
`eventInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -609,5 +622,5 @@ <tr> | ||
```js | ||
function (mountInfo) { } | ||
function (info) { } | ||
``` | ||
`mountInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -851,5 +864,5 @@ <tr> | ||
```js | ||
function (mouseEnterInfo) { } | ||
function (info) { } | ||
``` | ||
`mouseEnterInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -899,5 +912,5 @@ <tr> | ||
```js | ||
function (mouseLeaveInfo) { } | ||
function (info) { } | ||
``` | ||
`mouseLeaveInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -1413,3 +1426,3 @@ <tr> | ||
This value can be either a string containing HTML `'<p>...</p>'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
This value can be either a string containing text `'...'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
@@ -1449,5 +1462,5 @@ ```js | ||
```js | ||
function (clickInfo) { } | ||
function (info) { } | ||
``` | ||
`clickInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -1479,3 +1492,3 @@ <tr> | ||
This value can be either a string containing HTML `'<p>...</p>'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
This value can be either a string containing text `'...'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
@@ -1513,5 +1526,5 @@ ```js | ||
```js | ||
function (selectInfo) { } | ||
function (info) { } | ||
``` | ||
`selectInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -1553,3 +1566,3 @@ <tr> | ||
Boolean (`true` or `false`). Determines if the selection has occurred in the `all-day` slot</td> | ||
`true` or `false`. Determines if the selection has occurred in the `all-day` slot</td> | ||
</tr> | ||
@@ -1609,3 +1622,3 @@ <tr> | ||
- Type `integer` | ||
- Default `0` | ||
- Default `5` | ||
@@ -1798,5 +1811,5 @@ Defines how many pixels the user’s mouse must move before the selection begins. | ||
```js | ||
function (mountInfo) { } | ||
function (info) { } | ||
``` | ||
`mountInfo` is an object with the following properties: | ||
`info` is an object with the following properties: | ||
<table> | ||
@@ -1947,3 +1960,3 @@ <tr> | ||
Boolean (`true` or `false`). Determines if the event is shown in the `all-day` slot</td> | ||
`true` or `false`. Determines if the event is shown in the `all-day` slot</td> | ||
</tr> | ||
@@ -1974,2 +1987,9 @@ <tr> | ||
`titleHTML` | ||
</td> | ||
<td>The HTML version of the title</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`editable` | ||
@@ -1979,3 +1999,3 @@ </td> | ||
Boolean (`true` or `false`) or `undefined`. The value overriding the [editable](#editable) setting for this specific event | ||
`true`, `false` or `undefined`. The value overriding the [editable](#editable) setting for this specific event | ||
</td> | ||
@@ -1990,3 +2010,3 @@ </tr> | ||
Boolean (`true` or `false`) or `undefined`. The value overriding the [eventStartEditable](#eventstarteditable) setting for this specific event | ||
`true`, `false` or `undefined`. The value overriding the [eventStartEditable](#eventstarteditable) setting for this specific event | ||
</td> | ||
@@ -2001,3 +2021,3 @@ </tr> | ||
Boolean (`true` or `false`) or `undefined`. The value overriding the [eventDurationEditable](#eventdurationeditable) setting for this specific event | ||
`true`, `false` or `undefined`. The value overriding the [eventDurationEditable](#eventdurationeditable) setting for this specific event | ||
</td> | ||
@@ -2117,2 +2137,12 @@ </tr> | ||
`titleHTML` | ||
</td> | ||
<td> | ||
`string` The HTML version of the title to be displayed instead of the text version. Default `''` | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`editable` | ||
@@ -2246,2 +2276,9 @@ </td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`titleHTML` | ||
</td> | ||
<td>The HTML version of the title</td> | ||
</tr> | ||
</table> | ||
@@ -2274,2 +2311,12 @@ | ||
</tr> | ||
<tr> | ||
<td> | ||
`titleHTML` | ||
</td> | ||
<td> | ||
`string` The HTML version of the title to be displayed instead of the text version. Default `''` | ||
</td> | ||
</tr> | ||
</table> | ||
@@ -2276,0 +2323,0 @@ |
@@ -23,3 +23,3 @@ import Interaction from './Interaction.svelte'; | ||
options.selectLongPressDelay = undefined; | ||
options.selectMinDistance = 0; | ||
options.selectMinDistance = 5; | ||
options.unselect = undefined; | ||
@@ -26,0 +26,0 @@ options.unselectAuto = true; |
Sorry, the diff of this file is not supported yet
113591
1235
2355
+ Added@event-calendar/common@0.14.3(transitive)
- Removed@event-calendar/common@0.13.4(transitive)