@event-calendar/core 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/dist/index.css +1 -1
- package/dist/index.js +12 -9
- package/package.json +2 -2
- package/src/plugins/interaction/Action.svelte +14 -11
- package/src/plugins/interaction/Resizer.svelte +2 -0
package/README.md
CHANGED
|
@@ -251,8 +251,8 @@ This bundle contains a version of the calendar that includes all plugins and is
|
|
|
251
251
|
|
|
252
252
|
The first step is to include the following lines of code in the `<head>` section of your page:
|
|
253
253
|
```html
|
|
254
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.3.
|
|
255
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.3.
|
|
254
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.3.1/dist/event-calendar.min.css">
|
|
255
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.3.1/dist/event-calendar.min.js"></script>
|
|
256
256
|
```
|
|
257
257
|
|
|
258
258
|
<details>
|
|
@@ -1546,7 +1546,7 @@ This option is used instead of the `events` option.
|
|
|
1546
1546
|
|
|
1547
1547
|
`EventSource` should be an object with one of the following sets of properties:
|
|
1548
1548
|
|
|
1549
|
-
#### 1. Fetch events
|
|
1549
|
+
#### 1. Fetch events from a URL
|
|
1550
1550
|
<table>
|
|
1551
1551
|
<tr>
|
|
1552
1552
|
<td>
|
|
@@ -2033,13 +2033,13 @@ The function is triggered during resizing for each cursor movement and takes the
|
|
|
2033
2033
|
- Type `array`, `object` or `function`
|
|
2034
2034
|
- Default `[]`
|
|
2035
2035
|
|
|
2036
|
-
|
|
2036
|
+
Defines the source of resource data displayed in resource views. It can be provided in one of three ways:
|
|
2037
2037
|
|
|
2038
2038
|
#### 1. Array of plain objects
|
|
2039
|
-
The provided plain objects will be parsed into [Resource](#resource-object) objects.
|
|
2039
|
+
If the resources are predefined and do not change, then pass them as an array of plain objects. The provided plain objects will be [parsed]((#parsing-resource-from-a-plain-object)) into [Resource](#resource-object) objects.
|
|
2040
2040
|
|
|
2041
|
-
#### 2. Fetch resources
|
|
2042
|
-
|
|
2041
|
+
#### 2. Fetch resources from a URL
|
|
2042
|
+
To make the calendar load resources from a URL, specify `resources` option as an object with the following properties:
|
|
2043
2043
|
<table>
|
|
2044
2044
|
<tr>
|
|
2045
2045
|
<td>
|
|
@@ -2056,7 +2056,7 @@ A URL from which the calendar will fetch an array of [parsable](#parsing-resourc
|
|
|
2056
2056
|
`start`
|
|
2057
2057
|
</td>
|
|
2058
2058
|
<td>
|
|
2059
|
-
Start date of the range the calendar needs
|
|
2059
|
+
Start date of the range the calendar needs resources for
|
|
2060
2060
|
</td>
|
|
2061
2061
|
</tr>
|
|
2062
2062
|
<tr>
|
|
@@ -2065,7 +2065,7 @@ Start date of the range the calendar needs events for
|
|
|
2065
2065
|
`end`
|
|
2066
2066
|
</td>
|
|
2067
2067
|
<td>
|
|
2068
|
-
End date of the range the calendar needs
|
|
2068
|
+
End date of the range the calendar needs resources for
|
|
2069
2069
|
</td>
|
|
2070
2070
|
</tr>
|
|
2071
2071
|
</table>
|
|
@@ -2094,26 +2094,26 @@ Other GET/POST data you want to send to the server. Can be a plain object or a f
|
|
|
2094
2094
|
</table>
|
|
2095
2095
|
|
|
2096
2096
|
#### 3. Execute custom function
|
|
2097
|
-
You can also
|
|
2097
|
+
You can also specify `resources` as a custom function that provides resource data.
|
|
2098
2098
|
```js
|
|
2099
2099
|
function(fetchInfo, successCallback, failureCallback) { }
|
|
2100
2100
|
```
|
|
2101
2101
|
If [refetchResourcesOnNavigate](#refetchresourcesonnavigate) is enabled, the function will be called every time the user navigates to a different date. In this case,
|
|
2102
|
-
`fetchInfo` will be an object with the following properties (
|
|
2102
|
+
`fetchInfo` will be an object with the following properties (it is an empty object otherwise):
|
|
2103
2103
|
<table>
|
|
2104
2104
|
<tr>
|
|
2105
2105
|
<td>
|
|
2106
2106
|
|
|
2107
2107
|
`start`
|
|
2108
2108
|
</td>
|
|
2109
|
-
<td>JavaScript Date object for the beginning of the range the calendar needs
|
|
2109
|
+
<td>JavaScript Date object for the beginning of the range the calendar needs resources for</td>
|
|
2110
2110
|
</tr>
|
|
2111
2111
|
<tr>
|
|
2112
2112
|
<td>
|
|
2113
2113
|
|
|
2114
2114
|
`end`
|
|
2115
2115
|
</td>
|
|
2116
|
-
<td>JavaScript Date object for the end of the range the calendar needs
|
|
2116
|
+
<td>JavaScript Date object for the end of the range the calendar needs resources for. Note: This value is exclusive</td>
|
|
2117
2117
|
</tr>
|
|
2118
2118
|
<tr>
|
|
2119
2119
|
<td>
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.3.
|
|
2
|
+
* EventCalendar v5.3.1
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
import { untrack, tick, getAbortSignal, getContext, setContext, onMount, mount, unmount } from "svelte";
|
|
@@ -3282,16 +3282,19 @@ function Action($$anchor, $$props) {
|
|
|
3282
3282
|
}
|
|
3283
3283
|
}
|
|
3284
3284
|
}
|
|
3285
|
-
|
|
3286
|
-
action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta = extraDuration = allDay = minResize = selectStep = margin = gridEl = viewport = snapDuration = void 0;
|
|
3287
|
-
mainState.iClass = void 0;
|
|
3288
|
-
if (timer) {
|
|
3289
|
-
clearTimeout(timer);
|
|
3290
|
-
timer = void 0;
|
|
3291
|
-
}
|
|
3285
|
+
handlePointerCancel();
|
|
3292
3286
|
}
|
|
3293
3287
|
noDateClick = false;
|
|
3294
3288
|
}
|
|
3289
|
+
function handlePointerCancel() {
|
|
3290
|
+
interacting = false;
|
|
3291
|
+
action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta = extraDuration = allDay = minResize = selectStep = margin = gridEl = viewport = snapDuration = void 0;
|
|
3292
|
+
mainState.iClass = void 0;
|
|
3293
|
+
if (timer) {
|
|
3294
|
+
clearTimeout(timer);
|
|
3295
|
+
timer = void 0;
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3295
3298
|
function findDayEl() {
|
|
3296
3299
|
return getElementWithPayload(limit(toX, viewport.left, viewport.right), limit(toY, viewport.top, viewport.bottom));
|
|
3297
3300
|
}
|
|
@@ -3482,7 +3485,7 @@ function Action($$anchor, $$props) {
|
|
|
3482
3485
|
};
|
|
3483
3486
|
$.event("pointermove", $.window, handlePointerMove);
|
|
3484
3487
|
$.event("pointerup", $.window, handlePointerUp);
|
|
3485
|
-
$.event("pointercancel", $.window,
|
|
3488
|
+
$.event("pointercancel", $.window, handlePointerCancel);
|
|
3486
3489
|
$.event("scroll", $.window, handleScroll2);
|
|
3487
3490
|
var event_handler = $.derived(() => createPreventDefaultHandler(complexAction));
|
|
3488
3491
|
$.event("selectstart", $.window, function(...$$args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"title": "Event Calendar Core package",
|
|
5
5
|
"description": "Full-sized drag & drop event calendar with resource & timeline views",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"#components": "./src/lib/components/index.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"svelte": "^5.
|
|
35
|
+
"svelte": "^5.49.0"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -393,21 +393,24 @@
|
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
|
|
397
|
-
interacting = false;
|
|
398
|
-
action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta =
|
|
399
|
-
extraDuration = allDay = minResize = selectStep = margin = gridEl = viewport = snapDuration = undefined;
|
|
400
|
-
mainState.iClass = undefined;
|
|
401
|
-
|
|
402
|
-
if (timer) {
|
|
403
|
-
clearTimeout(timer);
|
|
404
|
-
timer = undefined;
|
|
405
|
-
}
|
|
396
|
+
handlePointerCancel();
|
|
406
397
|
}
|
|
407
398
|
|
|
408
399
|
noDateClick = false;
|
|
409
400
|
}
|
|
410
401
|
|
|
402
|
+
function handlePointerCancel() {
|
|
403
|
+
interacting = false;
|
|
404
|
+
action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta =
|
|
405
|
+
extraDuration = allDay = minResize = selectStep = margin = gridEl = viewport = snapDuration = undefined;
|
|
406
|
+
mainState.iClass = undefined;
|
|
407
|
+
|
|
408
|
+
if (timer) {
|
|
409
|
+
clearTimeout(timer);
|
|
410
|
+
timer = undefined;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
411
414
|
function findDayEl() {
|
|
412
415
|
// Limit coordinates to viewport
|
|
413
416
|
return getElementWithPayload(
|
|
@@ -641,7 +644,7 @@
|
|
|
641
644
|
<svelte:window
|
|
642
645
|
onpointermove={handlePointerMove}
|
|
643
646
|
onpointerup={handlePointerUp}
|
|
644
|
-
onpointercancel={
|
|
647
|
+
onpointercancel={handlePointerCancel}
|
|
645
648
|
onscroll={handleScroll}
|
|
646
649
|
onselectstart={createPreventDefaultHandler(complexAction)}
|
|
647
650
|
oncontextmenu={createPreventDefaultHandler(() => timer)}
|
|
@@ -30,9 +30,11 @@
|
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
32
|
{#if resizable && eventResizableFromStart}
|
|
33
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
33
34
|
<div class="{theme.resizer} {theme.start}" onpointerdown={createResizeHandler(true)}></div>
|
|
34
35
|
{/if}
|
|
35
36
|
{@render children()}
|
|
36
37
|
{#if resizable}
|
|
38
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
37
39
|
<div class="{theme.resizer}" onpointerdown={createResizeHandler(false)}></div>
|
|
38
40
|
{/if}
|