@event-calendar/core 4.4.1 → 4.5.0
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 +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +28 -25
- package/package.json +2 -2
- package/src/Calendar.svelte +2 -1
- package/src/lib/components/BaseEvent.svelte +1 -1
- package/src/storage/state.js +4 -2
package/README.md
CHANGED
|
@@ -228,8 +228,8 @@ This bundle contains a version of the calendar that includes all plugins and is
|
|
|
228
228
|
|
|
229
229
|
The first step is to include the following lines of code in the `<head>` section of your page:
|
|
230
230
|
```html
|
|
231
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.
|
|
232
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.
|
|
231
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.0/dist/event-calendar.min.css">
|
|
232
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.0/dist/event-calendar.min.js"></script>
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
<details>
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v4.
|
|
2
|
+
* EventCalendar v4.5.0
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
import { tick, getContext, untrack, setContext, onMount, mount, unmount } from "svelte";
|
|
@@ -1216,7 +1216,9 @@ class State {
|
|
|
1216
1216
|
if (newView === view2) {
|
|
1217
1217
|
this._viewComponent.set(component);
|
|
1218
1218
|
if (isFunction(opts.viewDidMount)) {
|
|
1219
|
-
tick().then(() => opts.viewDidMount(
|
|
1219
|
+
tick().then(() => opts.viewDidMount({
|
|
1220
|
+
view: toViewWithLocalDates(get(this._view))
|
|
1221
|
+
}));
|
|
1220
1222
|
}
|
|
1221
1223
|
for (let key of keys(opts)) {
|
|
1222
1224
|
this[key]._set(opts[key]);
|
|
@@ -1354,7 +1356,7 @@ function Buttons($$anchor, $$props) {
|
|
|
1354
1356
|
var consequent = ($$anchor3) => {
|
|
1355
1357
|
var h2 = root_2$7();
|
|
1356
1358
|
$.action(h2, ($$node, $$action_arg) => setContent == null ? void 0 : setContent($$node, $$action_arg), $_viewTitle);
|
|
1357
|
-
$.template_effect(() => $.set_class(h2, 1, $theme().title));
|
|
1359
|
+
$.template_effect(() => $.set_class(h2, 1, ($theme(), $.untrack(() => $theme().title))));
|
|
1358
1360
|
$.append($$anchor3, h2);
|
|
1359
1361
|
};
|
|
1360
1362
|
var alternate = ($$anchor3, $$elseif) => {
|
|
@@ -1364,11 +1366,11 @@ function Buttons($$anchor, $$props) {
|
|
|
1364
1366
|
var i = $.child(button_1);
|
|
1365
1367
|
$.reset(button_1);
|
|
1366
1368
|
$.template_effect(() => {
|
|
1367
|
-
$.set_class(button_1, 1, `${$theme().button ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1368
|
-
$.set_attribute(button_1, "aria-label", $buttonText().prev);
|
|
1369
|
-
$.set_attribute(button_1, "title", $buttonText().prev);
|
|
1369
|
+
$.set_class(button_1, 1, `${($theme(), $.untrack(() => $theme().button)) ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1370
|
+
$.set_attribute(button_1, "aria-label", ($buttonText(), $.untrack(() => $buttonText().prev)));
|
|
1371
|
+
$.set_attribute(button_1, "title", ($buttonText(), $.untrack(() => $buttonText().prev)));
|
|
1370
1372
|
button_1.disabled = $.get(prevDisabled);
|
|
1371
|
-
$.set_class(i, 1, `${$theme().icon ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1373
|
+
$.set_class(i, 1, `${($theme(), $.untrack(() => $theme().icon)) ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1372
1374
|
});
|
|
1373
1375
|
$.event("click", button_1, prev);
|
|
1374
1376
|
$.append($$anchor4, button_1);
|
|
@@ -1380,11 +1382,11 @@ function Buttons($$anchor, $$props) {
|
|
|
1380
1382
|
var i_1 = $.child(button_2);
|
|
1381
1383
|
$.reset(button_2);
|
|
1382
1384
|
$.template_effect(() => {
|
|
1383
|
-
$.set_class(button_2, 1, `${$theme().button ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1384
|
-
$.set_attribute(button_2, "aria-label", $buttonText().next);
|
|
1385
|
-
$.set_attribute(button_2, "title", $buttonText().next);
|
|
1385
|
+
$.set_class(button_2, 1, `${($theme(), $.untrack(() => $theme().button)) ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1386
|
+
$.set_attribute(button_2, "aria-label", ($buttonText(), $.untrack(() => $buttonText().next)));
|
|
1387
|
+
$.set_attribute(button_2, "title", ($buttonText(), $.untrack(() => $buttonText().next)));
|
|
1386
1388
|
button_2.disabled = $.get(nextDisabled);
|
|
1387
|
-
$.set_class(i_1, 1, `${$theme().icon ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1389
|
+
$.set_class(i_1, 1, `${($theme(), $.untrack(() => $theme().icon)) ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1388
1390
|
});
|
|
1389
1391
|
$.event("click", button_2, next);
|
|
1390
1392
|
$.append($$anchor5, button_2);
|
|
@@ -1396,9 +1398,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1396
1398
|
var text = $.child(button_3, true);
|
|
1397
1399
|
$.reset(button_3);
|
|
1398
1400
|
$.template_effect(() => {
|
|
1399
|
-
$.set_class(button_3, 1, `${$theme().button ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1401
|
+
$.set_class(button_3, 1, `${($theme(), $.untrack(() => $theme().button)) ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1400
1402
|
button_3.disabled = $.get(todayDisabled);
|
|
1401
|
-
$.set_text(text, $buttonText()[$.get(button)]);
|
|
1403
|
+
$.set_text(text, ($buttonText(), $.get(button), $.untrack(() => $buttonText()[$.get(button)])));
|
|
1402
1404
|
});
|
|
1403
1405
|
$.event("click", button_3, () => $.store_set(date, cloneDate(today2)));
|
|
1404
1406
|
$.append($$anchor6, button_3);
|
|
@@ -1412,7 +1414,7 @@ function Buttons($$anchor, $$props) {
|
|
|
1412
1414
|
(_a = $customButtons()[$.get(button)].click) == null ? void 0 : _a.apply(this, $$args);
|
|
1413
1415
|
}));
|
|
1414
1416
|
$.action(button_4, ($$node, $$action_arg) => setContent == null ? void 0 : setContent($$node, $$action_arg), () => $customButtons()[$.get(button)].text);
|
|
1415
|
-
$.template_effect(() => $.set_class(button_4, 1, `${$theme().button ?? ""} ec-${$.get(button) ?? ""}${$customButtons()[$.get(button)].active ? " " + $theme().active : ""}`));
|
|
1417
|
+
$.template_effect(() => $.set_class(button_4, 1, `${($theme(), $.untrack(() => $theme().button)) ?? ""} ec-${$.get(button) ?? ""}${($customButtons(), $.get(button), $theme(), $.untrack(() => $customButtons()[$.get(button)].active ? " " + $theme().active : "")) ?? ""}`));
|
|
1416
1418
|
$.append($$anchor7, button_4);
|
|
1417
1419
|
};
|
|
1418
1420
|
var alternate_4 = ($$anchor7, $$elseif5) => {
|
|
@@ -1422,8 +1424,8 @@ function Buttons($$anchor, $$props) {
|
|
|
1422
1424
|
var text_1 = $.child(button_5, true);
|
|
1423
1425
|
$.reset(button_5);
|
|
1424
1426
|
$.template_effect(() => {
|
|
1425
|
-
$.set_class(button_5, 1, `${$theme().button ?? ""}${$view() === $.get(button) ? " " + $theme().active : ""} ec-${$.get(button) ?? ""}`);
|
|
1426
|
-
$.set_text(text_1, $buttonText()[$.get(button)]);
|
|
1427
|
+
$.set_class(button_5, 1, `${($theme(), $.untrack(() => $theme().button)) ?? ""}${($view(), $.get(button), $theme(), $.untrack(() => $view() === $.get(button) ? " " + $theme().active : "")) ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1428
|
+
$.set_text(text_1, ($buttonText(), $.get(button), $.untrack(() => $buttonText()[$.get(button)])));
|
|
1427
1429
|
});
|
|
1428
1430
|
$.event("click", button_5, () => $.store_set(view2, $.get(button)));
|
|
1429
1431
|
$.append($$anchor8, button_5);
|
|
@@ -1440,7 +1442,7 @@ function Buttons($$anchor, $$props) {
|
|
|
1440
1442
|
$.if(
|
|
1441
1443
|
$$anchor6,
|
|
1442
1444
|
($$render) => {
|
|
1443
|
-
if ($customButtons()[$.get(button)]) $$render(consequent_4);
|
|
1445
|
+
if ($customButtons(), $.get(button), $.untrack(() => $customButtons()[$.get(button)])) $$render(consequent_4);
|
|
1444
1446
|
else $$render(alternate_4, false);
|
|
1445
1447
|
},
|
|
1446
1448
|
$$elseif4
|
|
@@ -1615,8 +1617,8 @@ function Auxiliary$1($$anchor, $$props) {
|
|
|
1615
1617
|
$.each(node, 1, $_auxiliary, $.index, ($$anchor2, Component) => {
|
|
1616
1618
|
var fragment_1 = $.comment();
|
|
1617
1619
|
var node_1 = $.first_child(fragment_1);
|
|
1618
|
-
$.component(node_1, () => $.get(Component), ($$anchor3,
|
|
1619
|
-
|
|
1620
|
+
$.component(node_1, () => $.get(Component), ($$anchor3, Component_1) => {
|
|
1621
|
+
Component_1($$anchor3, {});
|
|
1620
1622
|
});
|
|
1621
1623
|
$.append($$anchor2, fragment_1);
|
|
1622
1624
|
});
|
|
@@ -1697,7 +1699,8 @@ function Calendar($$anchor, $$props) {
|
|
|
1697
1699
|
let id = String(event.id);
|
|
1698
1700
|
let idx = $_events().findIndex((event2) => event2.id === id);
|
|
1699
1701
|
if (idx >= 0) {
|
|
1700
|
-
|
|
1702
|
+
event = createEvents([event])[0];
|
|
1703
|
+
$.store_mutate(_events, $.untrack($_events)[idx] = event, $.untrack($_events));
|
|
1701
1704
|
return toEventWithLocalDates(event);
|
|
1702
1705
|
}
|
|
1703
1706
|
return null;
|
|
@@ -1743,8 +1746,8 @@ function Calendar($$anchor, $$props) {
|
|
|
1743
1746
|
var node = $.child(div);
|
|
1744
1747
|
Toolbar(node, {});
|
|
1745
1748
|
var node_1 = $.sibling(node, 2);
|
|
1746
|
-
$.component(node_1, () => $.get(View2), ($$anchor2,
|
|
1747
|
-
|
|
1749
|
+
$.component(node_1, () => $.get(View2), ($$anchor2, View_1) => {
|
|
1750
|
+
View_1($$anchor2, {});
|
|
1748
1751
|
});
|
|
1749
1752
|
$.reset(div);
|
|
1750
1753
|
var node_2 = $.sibling(div, 2);
|
|
@@ -1890,7 +1893,7 @@ function BaseEvent($$anchor, $$props) {
|
|
|
1890
1893
|
let style = $.derived(() => entries(styles()({
|
|
1891
1894
|
"background-color": $.get(bgColor),
|
|
1892
1895
|
"color": $.get(txtColor)
|
|
1893
|
-
})).map((entry) => `${entry[0]}:${entry[1]}`).join(";"));
|
|
1896
|
+
})).map((entry) => `${entry[0]}:${entry[1]}`).concat($.get(event).styles).join(";"));
|
|
1894
1897
|
let classNames = $.derived(() => classes()([
|
|
1895
1898
|
bgEvent($.get(display)) ? $theme().bgEvent : $theme().event,
|
|
1896
1899
|
...createEventClasses($eventClassNames(), $.get(event), $_view())
|
|
@@ -2003,8 +2006,8 @@ function InteractableEvent($$anchor, $$props) {
|
|
|
2003
2006
|
var consequent = ($$anchor3) => {
|
|
2004
2007
|
var fragment_2 = $.comment();
|
|
2005
2008
|
var node_1 = $.first_child(fragment_2);
|
|
2006
|
-
$.component(node_1, () => $.get(Resizer2), ($$anchor4,
|
|
2007
|
-
|
|
2009
|
+
$.component(node_1, () => $.get(Resizer2), ($$anchor4, Resizer_1) => {
|
|
2010
|
+
Resizer_1($$anchor4, {
|
|
2008
2011
|
get chunk() {
|
|
2009
2012
|
return $$props.chunk;
|
|
2010
2013
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
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.34.8"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/Calendar.svelte
CHANGED
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
let id = String(event.id);
|
|
72
72
|
let idx = $_events.findIndex(event => event.id === id);
|
|
73
73
|
if (idx >= 0) {
|
|
74
|
-
|
|
74
|
+
event = createEvents([event])[0];
|
|
75
|
+
$_events[idx] = event;
|
|
75
76
|
return toEventWithLocalDates(event);
|
|
76
77
|
}
|
|
77
78
|
return null;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
let txtColor = $derived(event.textColor ?? resourceTextColor(event, $resources) ?? $eventTextColor);
|
|
28
28
|
let style = $derived(entries(styles(
|
|
29
29
|
{'background-color': bgColor, 'color': txtColor}
|
|
30
|
-
)).map(entry => `${entry[0]}:${entry[1]}`).join(';'));
|
|
30
|
+
)).map(entry => `${entry[0]}:${entry[1]}`).concat(event.styles).join(';'));
|
|
31
31
|
|
|
32
32
|
// Class
|
|
33
33
|
let classNames = $derived(classes([
|
package/src/storage/state.js
CHANGED
|
@@ -2,7 +2,7 @@ import {get, writable} from 'svelte/store';
|
|
|
2
2
|
import {tick} from 'svelte';
|
|
3
3
|
import {createOptions, createParsers} from './options.js';
|
|
4
4
|
import {activeRange, currentRange, dayGrid, events, now, today, view as view2, viewDates, viewTitle, filteredEvents} from './stores.js';
|
|
5
|
-
import {identity, intl, intlRange, isFunction, keys} from '#lib';
|
|
5
|
+
import {identity, intl, intlRange, isFunction, keys, toViewWithLocalDates} from '#lib';
|
|
6
6
|
|
|
7
7
|
export default class {
|
|
8
8
|
constructor(plugins, input) {
|
|
@@ -111,7 +111,9 @@ export default class {
|
|
|
111
111
|
// switch view component
|
|
112
112
|
this._viewComponent.set(component);
|
|
113
113
|
if (isFunction(opts.viewDidMount)) {
|
|
114
|
-
tick().then(() => opts.viewDidMount(
|
|
114
|
+
tick().then(() => opts.viewDidMount({
|
|
115
|
+
view: toViewWithLocalDates(get(this._view))
|
|
116
|
+
}));
|
|
115
117
|
}
|
|
116
118
|
// update store values
|
|
117
119
|
for (let key of keys(opts)) {
|