@event-calendar/core 4.4.2 → 4.5.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 +17 -2
- package/dist/index.css +1 -1
- package/dist/index.js +125 -164
- package/package.json +1 -1
- package/src/lib/components/BaseEvent.svelte +1 -1
- package/src/storage/state.js +4 -2
package/README.md
CHANGED
|
@@ -11,6 +11,21 @@ Full-sized drag & drop JavaScript event calendar with resource & timeline views:
|
|
|
11
11
|
|
|
12
12
|
Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar options.
|
|
13
13
|
|
|
14
|
+
### Featured sponsors
|
|
15
|
+
|
|
16
|
+
<table>
|
|
17
|
+
<tr>
|
|
18
|
+
<td>
|
|
19
|
+
|
|
20
|
+
[](https://github.com/steveb85)
|
|
21
|
+
</td>
|
|
22
|
+
<td>
|
|
23
|
+
|
|
24
|
+
:heavy_plus_sign: [Get on the list](https://github.com/sponsors/vkurko)
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
</table>
|
|
28
|
+
|
|
14
29
|
## Table of contents
|
|
15
30
|
- [Usage](#usage)
|
|
16
31
|
- [JavaScript module](#javascript-module)
|
|
@@ -228,8 +243,8 @@ This bundle contains a version of the calendar that includes all plugins and is
|
|
|
228
243
|
|
|
229
244
|
The first step is to include the following lines of code in the `<head>` section of your page:
|
|
230
245
|
```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.
|
|
246
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.1/dist/event-calendar.min.css">
|
|
247
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.5.1/dist/event-calendar.min.js"></script>
|
|
233
248
|
```
|
|
234
249
|
|
|
235
250
|
<details>
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v4.
|
|
2
|
+
* EventCalendar v4.5.1
|
|
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]);
|
|
@@ -1357,7 +1359,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1357
1359
|
$.template_effect(() => $.set_class(h2, 1, ($theme(), $.untrack(() => $theme().title))));
|
|
1358
1360
|
$.append($$anchor3, h2);
|
|
1359
1361
|
};
|
|
1360
|
-
var
|
|
1362
|
+
var alternate_4 = ($$anchor3) => {
|
|
1363
|
+
var fragment_2 = $.comment();
|
|
1364
|
+
var node_2 = $.first_child(fragment_2);
|
|
1361
1365
|
{
|
|
1362
1366
|
var consequent_1 = ($$anchor4) => {
|
|
1363
1367
|
var button_1 = root_4$3();
|
|
@@ -1373,7 +1377,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1373
1377
|
$.event("click", button_1, prev);
|
|
1374
1378
|
$.append($$anchor4, button_1);
|
|
1375
1379
|
};
|
|
1376
|
-
var
|
|
1380
|
+
var alternate_3 = ($$anchor4) => {
|
|
1381
|
+
var fragment_3 = $.comment();
|
|
1382
|
+
var node_3 = $.first_child(fragment_3);
|
|
1377
1383
|
{
|
|
1378
1384
|
var consequent_2 = ($$anchor5) => {
|
|
1379
1385
|
var button_2 = root_6$1();
|
|
@@ -1389,7 +1395,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1389
1395
|
$.event("click", button_2, next);
|
|
1390
1396
|
$.append($$anchor5, button_2);
|
|
1391
1397
|
};
|
|
1392
|
-
var alternate_2 = ($$anchor5
|
|
1398
|
+
var alternate_2 = ($$anchor5) => {
|
|
1399
|
+
var fragment_4 = $.comment();
|
|
1400
|
+
var node_4 = $.first_child(fragment_4);
|
|
1393
1401
|
{
|
|
1394
1402
|
var consequent_3 = ($$anchor6) => {
|
|
1395
1403
|
var button_3 = root_8$1();
|
|
@@ -1403,7 +1411,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1403
1411
|
$.event("click", button_3, () => $.store_set(date, cloneDate(today2)));
|
|
1404
1412
|
$.append($$anchor6, button_3);
|
|
1405
1413
|
};
|
|
1406
|
-
var
|
|
1414
|
+
var alternate_1 = ($$anchor6) => {
|
|
1415
|
+
var fragment_5 = $.comment();
|
|
1416
|
+
var node_5 = $.first_child(fragment_5);
|
|
1407
1417
|
{
|
|
1408
1418
|
var consequent_4 = ($$anchor7) => {
|
|
1409
1419
|
var button_4 = root_10$1();
|
|
@@ -1415,7 +1425,9 @@ function Buttons($$anchor, $$props) {
|
|
|
1415
1425
|
$.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
1426
|
$.append($$anchor7, button_4);
|
|
1417
1427
|
};
|
|
1418
|
-
var
|
|
1428
|
+
var alternate = ($$anchor7) => {
|
|
1429
|
+
var fragment_6 = $.comment();
|
|
1430
|
+
var node_6 = $.first_child(fragment_6);
|
|
1419
1431
|
{
|
|
1420
1432
|
var consequent_5 = ($$anchor8) => {
|
|
1421
1433
|
var button_5 = root_12$1();
|
|
@@ -1429,57 +1441,62 @@ function Buttons($$anchor, $$props) {
|
|
|
1429
1441
|
$.append($$anchor8, button_5);
|
|
1430
1442
|
};
|
|
1431
1443
|
$.if(
|
|
1432
|
-
|
|
1444
|
+
node_6,
|
|
1433
1445
|
($$render) => {
|
|
1434
1446
|
if ($.get(button) != "") $$render(consequent_5);
|
|
1435
1447
|
},
|
|
1436
|
-
|
|
1448
|
+
true
|
|
1437
1449
|
);
|
|
1438
1450
|
}
|
|
1451
|
+
$.append($$anchor7, fragment_6);
|
|
1439
1452
|
};
|
|
1440
1453
|
$.if(
|
|
1441
|
-
|
|
1454
|
+
node_5,
|
|
1442
1455
|
($$render) => {
|
|
1443
1456
|
if ($customButtons(), $.get(button), $.untrack(() => $customButtons()[$.get(button)])) $$render(consequent_4);
|
|
1444
|
-
else $$render(
|
|
1457
|
+
else $$render(alternate, false);
|
|
1445
1458
|
},
|
|
1446
|
-
|
|
1459
|
+
true
|
|
1447
1460
|
);
|
|
1448
1461
|
}
|
|
1462
|
+
$.append($$anchor6, fragment_5);
|
|
1449
1463
|
};
|
|
1450
1464
|
$.if(
|
|
1451
|
-
|
|
1465
|
+
node_4,
|
|
1452
1466
|
($$render) => {
|
|
1453
1467
|
if ($.get(button) == "today") $$render(consequent_3);
|
|
1454
|
-
else $$render(
|
|
1468
|
+
else $$render(alternate_1, false);
|
|
1455
1469
|
},
|
|
1456
|
-
|
|
1470
|
+
true
|
|
1457
1471
|
);
|
|
1458
1472
|
}
|
|
1473
|
+
$.append($$anchor5, fragment_4);
|
|
1459
1474
|
};
|
|
1460
1475
|
$.if(
|
|
1461
|
-
|
|
1476
|
+
node_3,
|
|
1462
1477
|
($$render) => {
|
|
1463
1478
|
if ($.get(button) == "next") $$render(consequent_2);
|
|
1464
1479
|
else $$render(alternate_2, false);
|
|
1465
1480
|
},
|
|
1466
|
-
|
|
1481
|
+
true
|
|
1467
1482
|
);
|
|
1468
1483
|
}
|
|
1484
|
+
$.append($$anchor4, fragment_3);
|
|
1469
1485
|
};
|
|
1470
1486
|
$.if(
|
|
1471
|
-
|
|
1487
|
+
node_2,
|
|
1472
1488
|
($$render) => {
|
|
1473
1489
|
if ($.get(button) == "prev") $$render(consequent_1);
|
|
1474
|
-
else $$render(
|
|
1490
|
+
else $$render(alternate_3, false);
|
|
1475
1491
|
},
|
|
1476
|
-
|
|
1492
|
+
true
|
|
1477
1493
|
);
|
|
1478
1494
|
}
|
|
1495
|
+
$.append($$anchor3, fragment_2);
|
|
1479
1496
|
};
|
|
1480
1497
|
$.if(node_1, ($$render) => {
|
|
1481
1498
|
if ($.get(button) == "title") $$render(consequent);
|
|
1482
|
-
else $$render(
|
|
1499
|
+
else $$render(alternate_4, false);
|
|
1483
1500
|
});
|
|
1484
1501
|
}
|
|
1485
1502
|
$.append($$anchor2, fragment_1);
|
|
@@ -1751,13 +1768,14 @@ function Calendar($$anchor, $$props) {
|
|
|
1751
1768
|
var node_2 = $.sibling(div, 2);
|
|
1752
1769
|
Auxiliary$1(node_2, {});
|
|
1753
1770
|
$.template_effect(
|
|
1754
|
-
($0) => {
|
|
1771
|
+
($0, $1) => {
|
|
1755
1772
|
$.set_class(div, 1, `${$theme().calendar ?? ""} ${$theme().view ?? ""}${$_scrollable() ? " " + $theme().withScroll : ""}${$_iClass() ? " " + $theme()[$_iClass()] : ""}`);
|
|
1756
1773
|
$.set_attribute(div, "role", $0);
|
|
1757
|
-
styles = $.set_style(div, "", styles,
|
|
1774
|
+
styles = $.set_style(div, "", styles, $1);
|
|
1758
1775
|
},
|
|
1759
1776
|
[
|
|
1760
|
-
() => listView($view()) ? "list" : "table"
|
|
1777
|
+
() => listView($view()) ? "list" : "table",
|
|
1778
|
+
() => ({ height: $height() })
|
|
1761
1779
|
]
|
|
1762
1780
|
);
|
|
1763
1781
|
$.append($$anchor, fragment);
|
|
@@ -1806,12 +1824,7 @@ function Header$1($$anchor, $$props) {
|
|
|
1806
1824
|
const $_days = () => $.store_get(_days, "$_days", $$stores);
|
|
1807
1825
|
const $_intlDayHeaderAL = () => $.store_get(_intlDayHeaderAL, "$_intlDayHeaderAL", $$stores);
|
|
1808
1826
|
const $_intlDayHeader = () => $.store_get(_intlDayHeader, "$_intlDayHeader", $$stores);
|
|
1809
|
-
let {
|
|
1810
|
-
theme,
|
|
1811
|
-
_intlDayHeader,
|
|
1812
|
-
_intlDayHeaderAL,
|
|
1813
|
-
_days
|
|
1814
|
-
} = getContext("state");
|
|
1827
|
+
let { theme, _intlDayHeader, _intlDayHeaderAL, _days } = getContext("state");
|
|
1815
1828
|
$.init();
|
|
1816
1829
|
var div = root$p();
|
|
1817
1830
|
var div_1 = $.child(div);
|
|
@@ -1831,8 +1844,7 @@ function Header$1($$anchor, $$props) {
|
|
|
1831
1844
|
return (_a = $theme().weekdays) == null ? void 0 : _a[$.get(day).getUTCDay()];
|
|
1832
1845
|
},
|
|
1833
1846
|
() => $_intlDayHeaderAL().format($.get(day))
|
|
1834
|
-
]
|
|
1835
|
-
$.derived_safe_equal
|
|
1847
|
+
]
|
|
1836
1848
|
);
|
|
1837
1849
|
$.append($$anchor2, div_2);
|
|
1838
1850
|
});
|
|
@@ -1888,10 +1900,7 @@ function BaseEvent($$anchor, $$props) {
|
|
|
1888
1900
|
let display = $.derived(() => $$props.chunk.event.display);
|
|
1889
1901
|
let bgColor = $.derived(() => $.get(event).backgroundColor ?? resourceBackgroundColor($.get(event), $resources()) ?? $eventBackgroundColor() ?? $eventColor());
|
|
1890
1902
|
let txtColor = $.derived(() => $.get(event).textColor ?? resourceTextColor($.get(event), $resources()) ?? $eventTextColor());
|
|
1891
|
-
let style = $.derived(() => entries(styles()({
|
|
1892
|
-
"background-color": $.get(bgColor),
|
|
1893
|
-
"color": $.get(txtColor)
|
|
1894
|
-
})).map((entry) => `${entry[0]}:${entry[1]}`).join(";"));
|
|
1903
|
+
let style = $.derived(() => entries(styles()({ "background-color": $.get(bgColor), "color": $.get(txtColor) })).map((entry) => `${entry[0]}:${entry[1]}`).concat($.get(event).styles).join(";"));
|
|
1895
1904
|
let classNames = $.derived(() => classes()([
|
|
1896
1905
|
bgEvent($.get(display)) ? $theme().bgEvent : $theme().event,
|
|
1897
1906
|
...createEventClasses($eventClassNames(), $.get(event), $_view())
|
|
@@ -3059,11 +3068,7 @@ function Action($$anchor, $$props) {
|
|
|
3059
3068
|
let payload = findPayload(findDayEl());
|
|
3060
3069
|
if (payload) {
|
|
3061
3070
|
let newAllDay;
|
|
3062
|
-
({
|
|
3063
|
-
allDay: newAllDay,
|
|
3064
|
-
date: newDate,
|
|
3065
|
-
resource: newResource
|
|
3066
|
-
} = payload);
|
|
3071
|
+
({ allDay: newAllDay, date: newDate, resource: newResource } = payload);
|
|
3067
3072
|
if (newAllDay === allDay) {
|
|
3068
3073
|
let candidate = copyIEventData({}, $_iEvents()[0]);
|
|
3069
3074
|
let constraintFn = $resizeConstraint();
|
|
@@ -3324,13 +3329,7 @@ function Action($$anchor, $$props) {
|
|
|
3324
3329
|
function createCallbackInfo(event2, oldEvent, jsEvent) {
|
|
3325
3330
|
let info;
|
|
3326
3331
|
if (resizing()) {
|
|
3327
|
-
info = resizingStart() ? {
|
|
3328
|
-
startDelta: delta,
|
|
3329
|
-
endDelta: createDuration(0)
|
|
3330
|
-
} : {
|
|
3331
|
-
startDelta: createDuration(0),
|
|
3332
|
-
endDelta: delta
|
|
3333
|
-
};
|
|
3332
|
+
info = resizingStart() ? { startDelta: delta, endDelta: createDuration(0) } : { startDelta: createDuration(0), endDelta: delta };
|
|
3334
3333
|
} else {
|
|
3335
3334
|
info = {
|
|
3336
3335
|
delta,
|
|
@@ -3375,10 +3374,7 @@ function Action($$anchor, $$props) {
|
|
|
3375
3374
|
selected = false;
|
|
3376
3375
|
destroyIEvent();
|
|
3377
3376
|
if (isFunction($unselectFn())) {
|
|
3378
|
-
$unselectFn()({
|
|
3379
|
-
jsEvent,
|
|
3380
|
-
view: toViewWithLocalDates($_view())
|
|
3381
|
-
});
|
|
3377
|
+
$unselectFn()({ jsEvent, view: toViewWithLocalDates($_view()) });
|
|
3382
3378
|
}
|
|
3383
3379
|
}
|
|
3384
3380
|
}
|
|
@@ -3700,10 +3696,6 @@ function Event$3($$anchor, $$props) {
|
|
|
3700
3696
|
delete style["color"];
|
|
3701
3697
|
return style;
|
|
3702
3698
|
});
|
|
3703
|
-
const expression = $.derived(() => {
|
|
3704
|
-
var _a;
|
|
3705
|
-
return (_a = $_interaction().action) == null ? void 0 : _a.noAction;
|
|
3706
|
-
});
|
|
3707
3699
|
{
|
|
3708
3700
|
const body = ($$anchor2, defaultBody = $.noop, bgColor = $.noop, txtColor = $.noop) => {
|
|
3709
3701
|
var fragment_1 = root_1$8();
|
|
@@ -3711,12 +3703,19 @@ function Event$3($$anchor, $$props) {
|
|
|
3711
3703
|
let styles_1;
|
|
3712
3704
|
var node = $.sibling(div, 2);
|
|
3713
3705
|
$.snippet(node, defaultBody);
|
|
3714
|
-
$.template_effect(
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3706
|
+
$.template_effect(
|
|
3707
|
+
($02) => {
|
|
3708
|
+
$.set_class(div, 1, $theme().eventTag);
|
|
3709
|
+
styles_1 = $.set_style(div, "", styles_1, $02);
|
|
3710
|
+
},
|
|
3711
|
+
[() => ({ "background-color": bgColor() })]
|
|
3712
|
+
);
|
|
3718
3713
|
$.append($$anchor2, fragment_1);
|
|
3719
3714
|
};
|
|
3715
|
+
let $0 = $.derived(() => {
|
|
3716
|
+
var _a;
|
|
3717
|
+
return (_a = $_interaction().action) == null ? void 0 : _a.noAction;
|
|
3718
|
+
});
|
|
3720
3719
|
BaseEvent($$anchor, {
|
|
3721
3720
|
get chunk() {
|
|
3722
3721
|
return $$props.chunk;
|
|
@@ -3725,7 +3724,7 @@ function Event$3($$anchor, $$props) {
|
|
|
3725
3724
|
return $.get(styles);
|
|
3726
3725
|
},
|
|
3727
3726
|
get onpointerdown() {
|
|
3728
|
-
return $.get(
|
|
3727
|
+
return $.get($0);
|
|
3729
3728
|
},
|
|
3730
3729
|
body,
|
|
3731
3730
|
$$slots: { body: true }
|
|
@@ -3824,12 +3823,10 @@ function Day$3($$anchor, $$props) {
|
|
|
3824
3823
|
$.set_class(time_1, 1, $theme().daySide);
|
|
3825
3824
|
$.set_attribute(time_1, "datetime", $.get(datetime));
|
|
3826
3825
|
},
|
|
3827
|
-
[
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
}
|
|
3832
|
-
]
|
|
3826
|
+
[() => {
|
|
3827
|
+
var _a;
|
|
3828
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$$props.date.getUTCDay()];
|
|
3829
|
+
}]
|
|
3833
3830
|
);
|
|
3834
3831
|
$.append($$anchor2, div);
|
|
3835
3832
|
};
|
|
@@ -3844,10 +3841,7 @@ function Day$3($$anchor, $$props) {
|
|
|
3844
3841
|
$.delegate(["pointerdown"]);
|
|
3845
3842
|
function onclick$1(jsEvent, $noEventsClick, noEventsClick, $_view, _view) {
|
|
3846
3843
|
if (isFunction($noEventsClick())) {
|
|
3847
|
-
$noEventsClick()({
|
|
3848
|
-
jsEvent,
|
|
3849
|
-
view: toViewWithLocalDates($_view())
|
|
3850
|
-
});
|
|
3844
|
+
$noEventsClick()({ jsEvent, view: toViewWithLocalDates($_view()) });
|
|
3851
3845
|
}
|
|
3852
3846
|
}
|
|
3853
3847
|
var root_1$6 = $.from_html(`<div></div>`);
|
|
@@ -3892,13 +3886,7 @@ function Body$2($$anchor, $$props) {
|
|
|
3892
3886
|
{
|
|
3893
3887
|
var consequent = ($$anchor2) => {
|
|
3894
3888
|
var div_2 = root_1$6();
|
|
3895
|
-
div_2.__click = [
|
|
3896
|
-
onclick$1,
|
|
3897
|
-
$noEventsClick,
|
|
3898
|
-
noEventsClick,
|
|
3899
|
-
$_view,
|
|
3900
|
-
_view
|
|
3901
|
-
];
|
|
3889
|
+
div_2.__click = [onclick$1, $noEventsClick, noEventsClick, $_view, _view];
|
|
3902
3890
|
$.action(div_2, ($$node, $$action_arg) => setContent == null ? void 0 : setContent($$node, $$action_arg), () => $.get(content));
|
|
3903
3891
|
$.template_effect(() => $.set_class(div_2, 1, $theme().noEvents));
|
|
3904
3892
|
$.append($$anchor2, div_2);
|
|
@@ -4049,12 +4037,7 @@ function Section($$anchor, $$props) {
|
|
|
4049
4037
|
const $slotLabelInterval = () => $.store_get(slotLabelInterval, "$slotLabelInterval", $$stores);
|
|
4050
4038
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
4051
4039
|
const $_times = () => $.store_get(_times, "$_times", $$stores);
|
|
4052
|
-
let {
|
|
4053
|
-
allDayContent,
|
|
4054
|
-
slotLabelInterval,
|
|
4055
|
-
theme,
|
|
4056
|
-
_times
|
|
4057
|
-
} = getContext("state");
|
|
4040
|
+
let { allDayContent, slotLabelInterval, theme, _times } = getContext("state");
|
|
4058
4041
|
let allDayText = $.derived(() => createAllDayContent($allDayContent()));
|
|
4059
4042
|
let showAllTimes = $.derived(() => $slotLabelInterval() && $slotLabelInterval().seconds <= 0);
|
|
4060
4043
|
var fragment = root$f();
|
|
@@ -4186,12 +4169,7 @@ function Event$2($$anchor, $$props) {
|
|
|
4186
4169
|
const $_slotTimeLimits = () => $.store_get(_slotTimeLimits, "$_slotTimeLimits", $$stores);
|
|
4187
4170
|
const $slotHeight = () => $.store_get(slotHeight, "$slotHeight", $$stores);
|
|
4188
4171
|
const $slotEventOverlap = () => $.store_get(slotEventOverlap, "$slotEventOverlap", $$stores);
|
|
4189
|
-
let {
|
|
4190
|
-
slotEventOverlap,
|
|
4191
|
-
slotDuration,
|
|
4192
|
-
slotHeight,
|
|
4193
|
-
_slotTimeLimits
|
|
4194
|
-
} = getContext("state");
|
|
4172
|
+
let { slotEventOverlap, slotDuration, slotHeight, _slotTimeLimits } = getContext("state");
|
|
4195
4173
|
let display = $.derived(() => $$props.chunk.event.display);
|
|
4196
4174
|
let styles = $.derived(() => (style) => {
|
|
4197
4175
|
let step = $slotDuration().seconds;
|
|
@@ -4441,12 +4419,10 @@ function Day$2($$anchor, $$props) {
|
|
|
4441
4419
|
$.set_class(div_2, 1, $theme().events);
|
|
4442
4420
|
$.set_class(div_3, 1, $theme().extra);
|
|
4443
4421
|
},
|
|
4444
|
-
[
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
}
|
|
4449
|
-
]
|
|
4422
|
+
[() => {
|
|
4423
|
+
var _a;
|
|
4424
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$$props.date.getUTCDay()];
|
|
4425
|
+
}]
|
|
4450
4426
|
);
|
|
4451
4427
|
$.append($$anchor, div);
|
|
4452
4428
|
$.pop();
|
|
@@ -4504,13 +4480,7 @@ function Day$1($$anchor, $$props) {
|
|
|
4504
4480
|
const $theme = () => $.store_get(theme, "$theme", $$stores);
|
|
4505
4481
|
const $_interaction = () => $.store_get(_interaction, "$_interaction", $$stores);
|
|
4506
4482
|
let iChunks = $.prop($$props, "iChunks", 19, () => []), resource = $.prop($$props, "resource", 3, void 0);
|
|
4507
|
-
let {
|
|
4508
|
-
highlightedDates,
|
|
4509
|
-
theme,
|
|
4510
|
-
validRange,
|
|
4511
|
-
_interaction,
|
|
4512
|
-
_today
|
|
4513
|
-
} = getContext("state");
|
|
4483
|
+
let { highlightedDates, theme, validRange, _interaction, _today } = getContext("state");
|
|
4514
4484
|
let el = $.state(void 0);
|
|
4515
4485
|
let refs = [];
|
|
4516
4486
|
let dayChunks = $.derived(() => $$props.chunks.filter((chunk) => datesEqual(chunk.date, $$props.date)));
|
|
@@ -4611,12 +4581,10 @@ function Day$1($$anchor, $$props) {
|
|
|
4611
4581
|
$.set_class(div_1, 1, $theme().bgEvents);
|
|
4612
4582
|
$.set_class(div_3, 1, $theme().events);
|
|
4613
4583
|
},
|
|
4614
|
-
[
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
}
|
|
4619
|
-
]
|
|
4584
|
+
[() => {
|
|
4585
|
+
var _a;
|
|
4586
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$$props.date.getUTCDay()];
|
|
4587
|
+
}]
|
|
4620
4588
|
);
|
|
4621
4589
|
$.append($$anchor, div);
|
|
4622
4590
|
var $$pop = $.pop({ reposition });
|
|
@@ -4761,8 +4729,7 @@ function View$2($$anchor, $$props) {
|
|
|
4761
4729
|
() => datesEqual($.get(date), $_today()) ? " " + $theme().today : "",
|
|
4762
4730
|
() => toISOString($.get(date), 10),
|
|
4763
4731
|
() => $_intlDayHeaderAL().format($.get(date))
|
|
4764
|
-
]
|
|
4765
|
-
$.derived_safe_equal
|
|
4732
|
+
]
|
|
4766
4733
|
);
|
|
4767
4734
|
$.append($$anchor3, div_1);
|
|
4768
4735
|
});
|
|
@@ -5078,15 +5045,17 @@ function View$1($$anchor, $$props) {
|
|
|
5078
5045
|
$.each(node_10, 1, $_viewDates, $.index, ($$anchor5, date) => {
|
|
5079
5046
|
var div_10 = root_12();
|
|
5080
5047
|
$.each(div_10, 5, $_viewResources, $.index, ($$anchor6, resource) => {
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5048
|
+
{
|
|
5049
|
+
let $0 = $.derived(() => [$.get(date)]);
|
|
5050
|
+
Week($$anchor6, {
|
|
5051
|
+
get dates() {
|
|
5052
|
+
return $.get($0);
|
|
5053
|
+
},
|
|
5054
|
+
get resource() {
|
|
5055
|
+
return $.get(resource);
|
|
5056
|
+
}
|
|
5057
|
+
});
|
|
5058
|
+
}
|
|
5090
5059
|
});
|
|
5091
5060
|
$.reset(div_10);
|
|
5092
5061
|
$.template_effect(() => $.set_class(div_10, 1, $theme().resource));
|
|
@@ -5145,16 +5114,18 @@ function View$1($$anchor, $$props) {
|
|
|
5145
5114
|
$.each(node_14, 17, () => $.get(loops)[0], $.index, ($$anchor3, item0) => {
|
|
5146
5115
|
var div_13 = root_17();
|
|
5147
5116
|
$.each(div_13, 21, () => $.get(loops)[1], $.index, ($$anchor4, item1) => {
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5117
|
+
{
|
|
5118
|
+
let $0 = $.derived(() => $datesAboveResources() ? $.get(item0) : $.get(item1));
|
|
5119
|
+
let $1 = $.derived(() => $datesAboveResources() ? $.get(item1) : $.get(item0));
|
|
5120
|
+
Day$2($$anchor4, {
|
|
5121
|
+
get date() {
|
|
5122
|
+
return $.get($0);
|
|
5123
|
+
},
|
|
5124
|
+
get resource() {
|
|
5125
|
+
return $.get($1);
|
|
5126
|
+
}
|
|
5127
|
+
});
|
|
5128
|
+
}
|
|
5158
5129
|
});
|
|
5159
5130
|
$.reset(div_13);
|
|
5160
5131
|
$.template_effect(() => $.set_class(div_13, 1, $theme().resource));
|
|
@@ -5310,13 +5281,7 @@ function Expander($$anchor, $$props) {
|
|
|
5310
5281
|
{
|
|
5311
5282
|
var consequent_1 = ($$anchor2) => {
|
|
5312
5283
|
var button = root_2$2();
|
|
5313
|
-
button.__click = [
|
|
5314
|
-
onclick,
|
|
5315
|
-
expanded,
|
|
5316
|
-
payload,
|
|
5317
|
-
toggle,
|
|
5318
|
-
resources
|
|
5319
|
-
];
|
|
5284
|
+
button.__click = [onclick, expanded, payload, toggle, resources];
|
|
5320
5285
|
var node_2 = $.child(button);
|
|
5321
5286
|
{
|
|
5322
5287
|
var consequent = ($$anchor3) => {
|
|
@@ -5403,10 +5368,7 @@ function Sidebar($$anchor, $$props) {
|
|
|
5403
5368
|
$.set_class(div_3, 1, $theme().resource);
|
|
5404
5369
|
$.set_style(div_3, `flex-basis: ${$0 ?? ""}px`);
|
|
5405
5370
|
},
|
|
5406
|
-
[
|
|
5407
|
-
() => max($_resHs().get($.get(resource)) ?? 0, 34)
|
|
5408
|
-
],
|
|
5409
|
-
$.derived_safe_equal
|
|
5371
|
+
[() => max($_resHs().get($.get(resource)) ?? 0, 34)]
|
|
5410
5372
|
);
|
|
5411
5373
|
$.append($$anchor2, div_3);
|
|
5412
5374
|
});
|
|
@@ -5487,8 +5449,7 @@ function Header($$anchor, $$props) {
|
|
|
5487
5449
|
[
|
|
5488
5450
|
() => toISOString($.get(date), 10),
|
|
5489
5451
|
() => $_intlDayHeaderAL().format($.get(date))
|
|
5490
|
-
]
|
|
5491
|
-
$.derived_safe_equal
|
|
5452
|
+
]
|
|
5492
5453
|
);
|
|
5493
5454
|
$.append($$anchor3, fragment);
|
|
5494
5455
|
};
|
|
@@ -5506,8 +5467,7 @@ function Header($$anchor, $$props) {
|
|
|
5506
5467
|
[
|
|
5507
5468
|
() => toISOString($.get(date), 10),
|
|
5508
5469
|
() => $_intlDayHeaderAL().format($.get(date))
|
|
5509
|
-
]
|
|
5510
|
-
$.derived_safe_equal
|
|
5470
|
+
]
|
|
5511
5471
|
);
|
|
5512
5472
|
$.append($$anchor3, div_6);
|
|
5513
5473
|
};
|
|
@@ -5517,17 +5477,13 @@ function Header($$anchor, $$props) {
|
|
|
5517
5477
|
});
|
|
5518
5478
|
}
|
|
5519
5479
|
$.reset(div_2);
|
|
5520
|
-
$.template_effect(
|
|
5521
|
-
(
|
|
5522
|
-
|
|
5523
|
-
()
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
() => datesEqual($.get(date), $_today()) ? " " + $theme().today : ""
|
|
5528
|
-
],
|
|
5529
|
-
$.derived_safe_equal
|
|
5530
|
-
);
|
|
5480
|
+
$.template_effect(($0, $1) => $.set_class(div_2, 1, `${$theme().day ?? ""} ${$0 ?? ""}${$1 ?? ""}`), [
|
|
5481
|
+
() => {
|
|
5482
|
+
var _a;
|
|
5483
|
+
return (_a = $theme().weekdays) == null ? void 0 : _a[$.get(date).getUTCDay()];
|
|
5484
|
+
},
|
|
5485
|
+
() => datesEqual($.get(date), $_today()) ? " " + $theme().today : ""
|
|
5486
|
+
]);
|
|
5531
5487
|
$.append($$anchor2, div_2);
|
|
5532
5488
|
});
|
|
5533
5489
|
$.reset(div_1);
|
|
@@ -6152,14 +6108,19 @@ function NowIndicator($$anchor, $$props) {
|
|
|
6152
6108
|
var consequent = ($$anchor2) => {
|
|
6153
6109
|
var div = root_1();
|
|
6154
6110
|
let styles;
|
|
6155
|
-
$.template_effect(
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6111
|
+
$.template_effect(
|
|
6112
|
+
($0) => {
|
|
6113
|
+
$.set_class(div, 1, $theme().nowIndicator);
|
|
6114
|
+
styles = $.set_style(div, "", styles, $0);
|
|
6115
|
+
},
|
|
6116
|
+
[
|
|
6117
|
+
() => ({
|
|
6118
|
+
top: `${$_headerHeight() + 2}px`,
|
|
6119
|
+
left: `${$.get(left) ?? ""}px`,
|
|
6120
|
+
height: `${$_bodyHeight() - 1}px`
|
|
6121
|
+
})
|
|
6122
|
+
]
|
|
6123
|
+
);
|
|
6163
6124
|
$.append($$anchor2, div);
|
|
6164
6125
|
};
|
|
6165
6126
|
$.if(node, ($$render) => {
|
package/package.json
CHANGED
|
@@ -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)) {
|